When do I need to use quaternions?

peter.murray.rust picture peter.murray.rust · Dec 3, 2009 · Viewed 7.8k times · Source

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?

Answer

JoeG picture JoeG · Dec 3, 2009

They have a smaller memory footprint than rotation matrices and they are more efficient 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.