why is representing rotations through quaternions more compact and quicker than using matrices??

6k Views Asked by At

According to the wikipedia page on Quaternions:

The representations of rotations by quaternions are more compact and quicker to compute than the representations by matrices.

However, I have to admit, I don't fully understand what quaternions are and why they are useful. I have tried to read the article, but I don't understand why defining such a system is useful.

It appears to a define a four dimensional space in which 3 components are imaginary and one is real. Is this attempting to describe spacetime?

Regardless, I was hoping someone here could show how to represent a rotation using both quaternions and matrices and compare the two for me.

1

There are 1 best solutions below

2
On BEST ANSWER

Consider the wikipedia article's section on performance considerations. For numerical computation, quaternions can be stored as 4 numbers, rather than 9 for a rotation matrix. When combining several successive rotations, quaternions save 17 floating point operations compared to multiplying rotation matrices together. Moreover, in a practical computation, one has to ensure that the quaternion is normalized (or account for its norm in some other way). It's quicker and more efficient to renormalize a quaternion than it is to renormalize a rotation matrix.

The cost for this convenience is that trying to compute a rotated vector from a quaternion takes 26 more floating point operations, so one has to consider whether the bulk of a computation is chaining rotations together or actually computing rotated vectors. For a computation that involves, say, tracking the orientation of a rigid body, that's all about chaining rotations, and quaternions would offer a reduction in memory and arithmetic operations needed.

Quaternions are substantially easier to work with as representations of individual rotations and when you need to chain those rotations together. They're a little more cumbersome to work with when you need to turn that representation into actually computing rotating vectors.