jax.scipy.spatial.transform.Rotation#
- class jax.scipy.spatial.transform.Rotation(quat: Array)[source]#
Rotation in 3 dimensions.
LAX-backend implementation of
scipy.spatial.transform._rotation.Rotation()
.Original docstring below.
This class provides an interface to initialize from and represent rotations with:
Quaternions
Rotation Matrices
Rotation Vectors
Modified Rodrigues Parameters
Euler Angles
The following operations on rotations are supported:
Application on vectors
Rotation Composition
Rotation Inversion
Rotation Indexing
Indexing within a rotation is supported since multiple rotation transforms can be stored within a single Rotation instance.
To create Rotation objects use
from_...
methods (see examples below).Rotation(...)
is not supposed to be instantiated directly.- __init__()#
Methods
__init__
()apply
(vectors[, inverse])Apply this rotation to one or more vectors.
as_euler
(seq[, degrees])Represent as Euler angles.
as_matrix
()Represent as rotation matrix.
as_mrp
()Represent as Modified Rodrigues Parameters (MRPs).
as_quat
()Represent as quaternions.
as_rotvec
([degrees])Represent as rotation vectors.
concatenate
(rotations)Concatenate a sequence of Rotation objects.
count
(value, /)Return number of occurrences of value.
from_euler
(seq, angles[, degrees])Initialize from Euler angles.
from_matrix
(matrix)Initialize from rotation matrix.
from_mrp
(mrp)Initialize from Modified Rodrigues Parameters (MRPs).
from_quat
(quat)Initialize from quaternions.
from_rotvec
(rotvec[, degrees])Initialize from rotation vectors.
identity
([num, dtype])Get identity rotation(s).
index
(value[, start, stop])Return first index of value.
inv
()Invert this rotation.
magnitude
()Get the magnitude(s) of the rotation(s).
mean
([weights])Get the mean of the rotations.
random
(random_key[, num])Generate uniformly distributed rotations.
Attributes
quat
Alias for field number 0
single
Whether this instance represents a single rotation.