tags:

views:

316

answers:

3

I have been carrying out 2D and 3D operations, including graphics, for many years and have never used quaternions so I don't have a feel for them. I know that they can be used for certain operations that are difficult in Euler angles and also that they can be used to find the rotation required to best fit one set of coordinates (X1, X2...XN, X=(xyz)) onto another (X1', X2'... XN').

Are there places where quaternions are essential? And are there places where they make solutions more elegant or more efficient?

+3  A: 

Essentially they have a smaller memory footprint than rotation matrices and they are more efficent than both matrix and angle/axis representations.

Also:

  • It's extremely easy to interpolate between two quaternions, which is useful for smooth camera movements etc.
  • Unit normalisation of floating point quaternions suffers from fewer rounding defects than matrix representations.
Joe Gauterin
+1  A: 

The advantage of quaternions over matrices is not only faster computation, but mostly because a matrix representation of successive rotations around arbitrary angles eventually give in to dreadful floating-point round-off errors and no longer represent proper, affine rotations. "Restoring" a rotation matrix is computationally more expensive than normalizing a quaternion. Therefore, quaternions should be chosen over pure rotation matrices.

Cecil Has a Name
Quaternions actually take a bit more arithmetic, and successive quats will accumulate roundoff errors just as much as matrices. Their advantage is not carrying around the redundancy found in orthogonal matrices.
DarenW
+1  A: 

With quaternions you also handle the problem of the gimbal lock. And they are easier to work with when you want to perform arbitrary rotations.

Stefano Borini