bundles / scipy 1.18.0 / scipy / spatial / transform / _rigid_transform / RigidTransform / as_matrix
function
scipy.spatial.transform._rigid_transform:RigidTransform.as_matrix
Signature
def as_matrix(self) → ArraySummary
Return a copy of the matrix representation of the transform.
Extended Summary
4x4 rigid transformation matrices are of the form
[ tx] [ R ty] [ tz] [ 0 0 0 1]
where R is a 3x3 orthonormal rotation matrix and t = [tx, ty, tz] is a 3x1 translation vector.
Returns
matrix: numpy.ndarray, shape (..., 4, 4)Transformation matrices 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✓
t = np.array([2, 3, 4]) r = R.from_matrix([[0, 0, 1], [1, 0, 0], [0, 1, 0]]) tf = Tf.from_components(t, r)✓
tf.as_matrix()
✗array([[0., 0., 1., 2.],
[1., 0., 0., 3.],
[0., 1., 0., 4.],
[0., 0., 0., 1.]])
Tf.identity(2).as_matrix()
✗array([[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]],
[[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]]])
Aliases
scipy.spatial.transform.RigidTransform.as_matrix