archimedes.spatial.quaternion_to_eulerΒΆ

archimedes.spatial.quaternion_to_euler(q: ndarray, seq: str = 'xyz') ndarrayΒΆ

Convert unit quaternion to roll-pitch-yaw Euler angles.

This method uses the same notation and conventions as the SciPy Rotation class. See the SciPy documentation and euler_to_quaternion() for more details.

The algorithm is based on the method described in [1] as implemented in SciPy.

Parameters:
  • q (array_like, shape (4,)) – Unit quaternion representing rotation, in the format [q0, q1, q2, q3] where q0 is the scalar part.

  • seq (str, optional) – Sequence of axes for Euler angles (default is β€˜xyz’).

Returns:

Euler angle sequence corresponding to the quaternion.

Return type:

np.ndarray, shape (3,)

References