Hi
What is the pros and cons of "Quaternions" and "Euler Angles" Method
 Which one is faster?
 Which one need less Computational Effort?
 which one is more accurate, (in round off error)?

2personally I prefer using matrices– David HeffernanMay 14 '11 at 14:52

I found this my self http://biomchl.isbweb.org/threads/11415SummaryQuaternionsvs.Eulerangles But its some obscure– mrbmMay 14 '11 at 15:21

@David quaternions are represented as matrices.– RossMay 15 '11 at 6:15

@ross I mean rotation matrices– David HeffernanMay 15 '11 at 7:38

2@mrbm Could be. But just do not let it confuse you with it's "3dimensional complex number" explanation. Just take it as is. Except for the multiplication by sin and cos it's just another representation of rotation axis and angle, but in a more efficient way (with the encoded sin/cos) to facilitate fast multiplication and matrix conversion.– Christian RauMay 15 '11 at 11:50
Euler angles are more human understandable and also good for decomposing rotations into individual degrees of freedom (for kinematic joints and the like) but have disadvantages like ambiguity and gimbal lock. In practice I would prefer quaternions, as they are easier to compute with (for the computer, not for humans) and more efficient. You have to make three rotations and multiply them together when rotating by Euler angles, whereas a Quaternion is only one rotation and as it already encodes the sin and cos, the conversion from quaternion to matrix is quite efficient.
Quaternions avoid Gimbal lock. More here.


I can conform this. Used quaternions in Molecular Physics simulations and Gimbal lock is the main reason to use them. This makes one numerical problem less.– RossMay 15 '11 at 6:14
Expanding a bit on a point from Christian Rau's answer:
There's an ambiguity in the specification of Euler angles: which angle applies to which axis? Code that uses the convention (yaw, pitch, roll) won't interoperate with code that assumes (roll, pitch, yaw), and it may not be obvious, from looking at the code, which interpretation is being used.
Quaternions don't suffer from this ambiguity, since they only represent a single rotation, with a welldefined axis.

4I also meant the ambiguity, that different angle triples (of a single convention) can refer to the same rotation. May 14 '11 at 16:30

2This needn't be the extreme gimbal lock case, every rotation can be represented by multiple euler angle triples, even in the same convention. May 14 '11 at 16:35
Quaternions have many advantages over Euler angles, as pointed out in the other answers. However, Euler angles do have one advantage over Quaternions:
Euler angles can tell you the direction and magnitude of a rotation. When you convert a Euler angle to a Quaternion, that information is lost. For example, the Euler rotations of (270°, 0, 0) and (1170°, 0, 0) produce the identical Quaternions (0.7071, 0, 0, 0.7071).

1Yes no one knows this basically. Internally one should always store orientation values as Euler Angles to prevent this information loss. Only temporarily convert that value into a quaternion to do other calculations. Should you ever need the Magnitude of Yaw from an orientation and you only stored the Quaternion in memory give it up... that information is lost to you forever. This is a definitive benefit. Jun 12 at 20:10
Euler angles is faster.
Euler angles requires less computational effort.
Quaternions are absolutely more accurate.
There is a problem called Gimbal lock which was found in Euler angles. It happens when two axis align together. On the other hand quaternions are more flexible and solved this problem as it is more axis oriented. Yet, it is complicated to understand.
Well, to make it easy to understand Quaternions. Let's divide the four components to two: An angle and x,y,z point that is connected to the origin of the axis say P. The (x,y,z)P line representing a new axis. The angle represents the angle between the axis and real orientation. To visualize this answer you need to check this 5minutes video. https://eater.net/quaternions/video/intro
Euler angles are better than quaternions. You should always store Euler angles in memory and use quaternions only for calculations. Nobody knows this but what I say is absolutely true. If you're lurking around, know that this is important. Hear me out.
The reason is because you can always easily derive a quaternion from a Euler angles. The conversion is trivial. However the conversion from quaternion to Euler angles is fundamentally broken. There are two possible Euler angles for every quaternion and you cannot know which of the two possibilities your quaternions came from.
For virtual worlds and 3D games you can always just use quaternions. This is because your computer can just draw a picture of the object at an orientation without actually yawing and pitching an actual physical gimbal to achieve that orientation. However for robots and other real world applications there is real information loss when converting to a quaternion.
If you have a real physical gimbal and you are given a quaternion that represents the orientation of that gimbal you absolutely cannot ever extract the original yaw, roll or pitch the gimbal used to achieve that orientation UNLESS the gimbal is restricted in it's range of motion somewhere.
Remember this. If you're in robotics or some mechanical setting save the orientation value as the original Euler angles. Only convert to quaternions temporarily only for a calculation.
There's basically no return trip back to Euler once you convert to quaternion. So don't make that trip permanent, store all your information as Euler angles.