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

# scipy.spatial.transform.RigidTransform.translation

property RigidTransform.translation

  Return the translation 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 translation part of the transform.

  Returns:
    translation numpy.ndarray, shape (…, 3)

      Translation vectors with the same leading dimensions as the transform.

  Examples

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

  The translation component is extracted from the transform:

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