Talk:Conversion between quaternions and Euler angles
Appearance
Are the "Euler angles" in this article really Tait-Bryan_angles?
Canonical form of quaternion?
The equation presented for conversion from Euler angles to Quaternion has several discontinuities that are not necessarily present in the Quaternions themselves.
For instance, for the Euler angles (0,0,-180) and (0,0,180), the conversion would produce the quaternions (0,0,0,1) and (0,0,0,-1). These refer to the same attitude, but linear interpolation or slerp between them would not work well.
It appears that the proper way to handle this is to compute the cosine of the angle between the quaternions (via the dot product) and if this is less than zero to negate one of the quaternions.