euler_angles_from_matrix

compas.geometry.euler_angles_from_matrix(M, static=True, axes='xyz')[source]

Returns Euler angles from the rotation matrix M according to specified axis sequence and type of rotation.

Parameters:
Mlist[list[float]]

The 3x3 or 4x4 matrix in row-major order.

staticbool, optional

If True the rotations are applied to a static frame. If False, to a rotational.

axesstr, optional

A 3 character string specifying order of the axes.

Returns:
list[float]

The 3 Euler angles.

Examples

>>> ea1 = 1.4, 0.5, 2.3
>>> R = matrix_from_euler_angles(ea1)
>>> ea2 = euler_angles_from_matrix(R)
>>> allclose(ea1, ea2)
True