archimedes.spatial.euler_to_quaternionΒΆ
- archimedes.spatial.euler_to_quaternion(angles: ndarray, seq: str = 'xyz') ndarrayΒΆ
Convert Euler angles in radians to unit quaternion.
This method uses the same notation and conventions as the SciPy Rotation class. See the SciPy documentation for more details. Some common examples:
- βxyzβ: Extrinsic rotations about x, then y, then z axes (classical roll,
pitch, yaw sequence)
- βZXZβ: Rotation from perifocal (Ξ©, i, Ο) frame (right ascension of ascending
node, inclination, argument of perigee) used by Kepler orbital elements to ECI (Earth-Centered Inertial) frame
- Parameters:
angles (array_like, shape (N,) or (1, N) or (N, 1)) β Euler angles in radians. The number of angles must match the length of seq.
seq (str) β Specifies sequence of axes for rotations. Up to 3 characters belonging to the set {βxβ, βyβ, βzβ} or {βXβ, βYβ, βZβ}. Lowercase characters correspond to extrinsic rotations about the fixed axes, while uppercase characters correspond to intrinsic rotations about the rotating axes. Examples include βxyzβ, βZYXβ, βxzxβ, etc.
- Returns:
Unit quaternion [q0, q1, q2, q3] corresponding to the Euler angles, where q0 is the scalar part.
- Return type:
np.ndarray, shape (4,)
- Raises:
ValueError β If seq is not a valid sequence of axes, or if the shape of angles does not match the length of seq.