Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quaternions vs. Euler Angles

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)?

like image 680
mrbm Avatar asked May 14 '11 14:05

mrbm


People also ask

Are quaternions better than Euler angles?

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.

Why should you use quaternions over Euler angles?

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.

How do you convert Euler angles to quaternions?

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 .

Why do we use Euler angles?

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.


2 Answers

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.

like image 191
Christian Rau Avatar answered Oct 03 '22 01:10

Christian Rau


Quaternions avoid Gimbal lock. More here.

like image 35
YXD Avatar answered Oct 03 '22 02:10

YXD