euler_to_rotmat¶
giant.rotations.core.conversions
:
- giant.rotations.core.conversions.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()
, androt_z()
functions passing in the corresponding index from the angles input according to the order input.- Parameters:
angles (Sequence[float | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]] | ndarray[tuple[Any, ...], dtype[float64]]) – The euler angles
order (Literal['xyz', 'xzy', 'xyx', 'xzx', 'yxz', 'yzx', 'yxy', 'yzy', 'zxy', 'zyx', 'zyz', 'zxz']) – 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[tuple[Any, …], dtype[float64]]