-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mirror and rotate #22
Comments
I wrote it as new "reverse" and "rot90" methods. "reverse" is named after Array#reverse, "rot90" is named after Numpy method
|
Thank you Masahiro, One minor comment:
I believe it should be:
|
Closing this issue. Thanks for the implementation. By the way, it would be nice if you could push the updated documentation file to: |
Hello
NArray is a wonderful tool in Ruby. However, one thing that I miss with it is a convenient way of rotating or mirroring an array. It might be that I have missed something in the documentation of course, but as far as I can see, there's no (super-easy) way of doing it. I guess I would like to have convenient NArray#rotate and NArray#mirror methods. Then you could do something like this:
Proposed method 1:
NArray#mirror(dim=0)
This would be principal method (it would work just fine on arrays of any dimension).
Proposed method 2:
NArray#rotate(steps)
This would be harder to make principal (it's primarily wanted for two dimensional arrays ('images'), and gets more complicated with vectors or multi-dimensional arrays)
Thanks for your consideration.
Regards,
Chris
The text was updated successfully, but these errors were encountered: