euler_to_rotmat

mod:giant.rotations:

giant.rotations.euler_to_rotmat(angles, order='xyz')[source]

This function converts a sequence of 3 euler angles into a rotation matrix.

The order of the rotations is specified using the order keyword argument which recognizes x, y, and z for axes of rotation. For instance, say you have a rotation sequence of (1) rotate about x by xr, (2) rotate about y by yr, and (3) rotate about z by zr then you would specify order as ‘xyz’, and the angles as [xr, yr, zr] (order should correspond to the indices of angles).

The rotation matrix is formed using the rot_x(), rot_y(), and rot_z() functions passing in the corresponding index from the angles input according to the order input.

Parameters:
  • angles (Sequence[Sequence | ndarray | Real]) – The euler angles

  • order (str) – The order to apply the rotations in

Returns:

The rotation matrix formed by the euler angles

Raises:

ValueError – When the order string contains a character that is not x, y, or z

Return type:

ndarray