Skip to content

rot90

Rotate array by 90 degrees

rot90(A)

  • It rotates A counterclockwise by 90 degrees.
  • Only planes parallel to the plane formed by the first and second dimensions are rotated.

rot90(A, k)

  • It rotates A by k * 90 degrees. It rotates counterclockwise if k > 0, and clockwise if otherwise.
  • Only planes parallel to the plane formed by the first and second dimensions are rotated.