Skip to main content
`Ctrl`+`K`
scipy.spatial.transform.RigidTransform.

# scipy.spatial.transform.RigidTransform.rotation

property RigidTransform.rotation

  Return the rotation component of the transform.

  A transform is a composition of a rotation and a translation, such that when applied to a vector, the vector is first rotated and then translated. This property returns the rotation part of the transform.

  Returns:
    rotation `Rotation` instance

      A single rotation or a stack of rotations.

  Examples

      >>> from scipy.spatial.transform import RigidTransform as Tf
      >>> from scipy.spatial.transform import Rotation as R
      >>> import numpy as np

  The rotation component is extracted from the transform:

      >>> t = np.array([1, 0, 0])
      >>> r = R.random(3)
      >>> tf = Tf.from_components(t, r)
      >>> np.allclose(tf.rotation.as_matrix(), r.as_matrix())
      True