scipy.spatial.transform.Rotation.inv#

Rotation.inv(self)#

Invert this rotation.

Composition of a rotation with its inverse results in an identity transformation.

Returns:
inverseRotation instance

Object containing inverse of the rotations in the current instance.

Examples

>>> from scipy.spatial.transform import Rotation as R

Inverting a single rotation:

>>> p = R.from_euler('z', 45, degrees=True)
>>> q = p.inv()
>>> q.as_euler('zyx', degrees=True)
array([-45.,   0.,   0.])

Inverting multiple rotations:

>>> p = R.from_rotvec([[0, 0, np.pi/3], [-np.pi/4, 0, 0]])
>>> q = p.inv()
>>> q.as_rotvec()
array([[-0.        , -0.        , -1.04719755],
       [ 0.78539816, -0.        , -0.        ]])