Method: Numo::NArray#rot90
- Defined in:
- lib/numo/narray/extra.rb
#rot90(k = 1, axes = [0,1]) ⇒ Object
Rotate in the plane specified by axes.
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/numo/narray/extra.rb', line 67 def rot90(k=1,axes=[0,1]) case k % 4 when 0 view when 1 swapaxes(*axes).reverse(axes[0]) when 2 reverse(*axes) when 3 swapaxes(*axes).reverse(axes[1]) end end |