rot90

Contents

rot90#

class saiunit.math.rot90(m, k=1, axes=(0, 1), **kwargs)#

Rotate an array by 90 degrees in the plane specified by axes.

Rotation direction is from the first towards the second axis.

Parameters:
  • m (Array | ndarray | bool | number | bool | int | float | complex | saiunit.Quantity) – Array of two or more dimensions.

  • k (int) – Number of times the array is rotated by 90 degrees.

  • axes (Tuple[int, int]) – The array is rotated in the plane defined by the axes. Axes must be different.

Returns:

y – A rotated view of m.

This is a quantity if m is a quantity.

Return type:

Array | saiunit.Quantity

Examples

>>> import saiunit as u
>>> a = [[1, 2], [3, 4]] * u.second
>>> u.math.rot90(a)