Skip to main content
`Ctrl`+`K`

# is_rotation_or_reflection

astropy.coordinates.is_rotation_or_reflection(matrix, atol=None)

  Check whether a matrix describes rotation or reflection (or both).

  Proper and improper rotations (i.e. rotations without and with a reflection) could be distinguished by the sign of the determinant, but this function does not bother with that because both preserve lengths of vectors.

  Parameters:
    matrix `numpy.ndarray`

      The check is performed along the last two axes, which must have equal sizes.

    atol `python:float`, optional

      The allowed absolute difference. If `None` it defaults to 1e-15 or 5 * epsilon of the matrix’s dtype, if floating.

  Returns:
    `np.ndarray`, bool

      If the matrix has more than two axes, the check is performed on slices along the last two axes – (M, N, N) => (M, ) bool array.