archimedes.spatial.dcm_from_eulerΒΆ

archimedes.spatial.dcm_from_euler(rpy: ndarray, transpose: bool = False) ndarrayΒΆ

Returns matrix to transform from inertial to body frame (R_BN).

If transpose=True, returns matrix to transform from body to inertial frame (R_NB).

This is the direction cosine matrix (DCM) corresponding to the given roll-pitch-yaw (rpy) angles. This follows the standard aerospace convention and corresponds to the β€œxyz” sequence when using the Rotation class.

In general, the Rotation class should be preferred over Euler representations, although Euler angles are used in some special cases (e.g. stability analysis). In these cases, this function gives a more direct calculation of the transformation matrix without converting to the intermediate quaternion.

Parameters:
  • rpy (array_like, shape (3,)) – Roll, pitch, yaw angles in radians.

  • transpose (bool, optional) – If True, returns the transpose of the DCM. Default is False.

Returns:

Direction cosine matrix R_BN (or R_NB if transpose=True).

Return type:

np.ndarray, shape (3, 3)