rotation_matrix#
- astropy.coordinates.rotation_matrix(angle, axis='z', unit=None)[source]#
Generate matrices for rotation by some angle around some axis.
- Parameters:
- angleastropy:angle-like
The amount of rotation the matrices should represent. Can be an array.
- axis
python:stror 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 againstangle.- unitastropy:unit-like, optional
If
angledoes 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.
- rmat