Skip to main content
`Ctrl`+`K`

# rotation_matrix

astropy.coordinates.rotation_matrix(angle, axis='z', unit=None)

  Generate matrices for rotation by some angle around some axis.

  Parameters:
    angle astropy:angle-like

      The amount of rotation the matrices should represent. Can be an array.

    axis `python:str` or numpy:array_like

      Either `'x'`, `'y'`, `'z'`, or a (x,y,z) specifying the axis to rotate about. If `'x'`, `'y'`, or `'z'`, the rotation sense is counterclockwise looking down the + axis (e.g. positive rotations obey left-hand-rule). If given as an array, the last dimension should be 3; it will be broadcast against `angle`.

    unit astropy:unit-like, optional

      If `angle` does not have associated units, they are in this unit. If neither are provided, it is assumed to be degrees.

  Returns:
    rmat `numpy.matrix`

      A unitary rotation matrix.