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

# scipy.spatial.transform.RigidTransform.translation

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:
    translationnumpy.ndarray, shape (N, 3) or (3,)

      A single translation vector or a stack of translation vectors.

  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