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
  • M (list[list[float]]) – The 3x3 or 4x4 matrix in row-major order.

  • static (bool, optional) – If True the rotations are applied to a static frame. If False, to a rotational.

  • axes (str, 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