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)?
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.
And they are good reasons. As you already seem to understand, quaternions encode a single rotation around an arbitrary axis as opposed to three sequential rotations in Euler 3-space. This makes quaternions immune to gimbal lock. Also, some forms of interpolation become nice and easy to do, like SLERP.
eul = quat2eul( quat ) converts a quaternion rotation, quat , to the corresponding Euler angles, eul . The default order for Euler angle rotations is "ZYX" . eul = quat2eul( quat , sequence ) converts a quaternion into Euler angles. The Euler angles are specified in the axis rotation sequence, sequence .
Conversion to other orientation representations Euler angles are one way to represent orientations. There are others, and it is possible to change to and from other conventions. Three parameters are always required to describe orientations in a 3-dimensional Euclidean space.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With