class Euler

There are many ambiguities in Euler angle and rotation matrix definitions. See and

FEASST uses “so-called” proper, active intrinsic z-x-z or “x-convention” which is given by the following three intrinsic rotations:

  1. rotate by phi [-pi, pi] about the z-axis.

  2. rotate by theta [0, pi] about the new x-axis.

  3. rotate by psi [-pi, pi] about the new z-axis.

The rotation matrixes for each of these are as described in

For a z-axis rotation is given by [c, -s, 0 s, c, 0 0, 0, 1] where c is cosine of the angle of rotation, and s is the sine.

and an x-axis rotation is given by [1, 0, 0 0, c, -s 0, s, c]

The following rotation matrix is obtained for the rotation described above [c1c3 - c2s1s3, -c1s3 - c2c3s1, s1s2 c3s1 + c1c2s3, c1c2c3 - s1s3, -c1s2 s2s3, c3s2, c2] which should be equivalent to the Z1X2Z3 Proper Euler angle described in

Note that these resulting rotation matrix is the inverse of the one described in the following website: This is likely because the rotation matrix is a passive rotation, which means that it is from the perspective of changing the coordinate system rather than the coordinates of a particle in a fixed frame.