Name

CL_rot_quat2eul — Quaternion to Euler '123' angles

Calling Sequence

   [phi,theta,psi] = CL_rot_quat2eul(q)
   
   

Description

  • Computes Euler angles (rotation order (123)) from the given quaternion q.

    NOTE: One must be aware of singularities in the Euler angle parametrization when the pitch (theta) approaches +-%pi or +-%pi/2. These cases must be handled specifically: results may not be accurate!

  • Last update : 3/6/2008

Parameters

q:

quaternion (dim N)

phi:

X axis angle rotation [rad] (1xN)

theta:

Y axis angle rotation [rad] (1xN)

psi:

Z axis angle rotation [rad] (1xN)

Authors

CNES - DCT/SB

Bibliography

Mecanique spatiale - CNES Cepadues 1995, Tome I, 7.2.2.3 Les quaternions

See also

CL_rot_eul2quat, CL_rot_defQuat

Examples

M = [cos(%pi/4),sin(%pi/4),0;-sin(%pi/4),cos(%pi/4),0;0,0,1];  // rotation of angle %pi/4 around Z
q = CL_rot_matrix2quat(M); // quaternion of this rotation
[phi,theta,psi] = CL_rot_quat2eul(q) // psi = %pi/4