Convert between a quaternion and its Euler angles (and vice versa)
The quaternion values
can be computed from the ZYX Euler angles
:

or inversely the ZYX Euler angles (in radians)
can be derived from the quaternion values
:

There are several online tools to perform these conversion, see for example here.