3D Theory - Matrix vs. Quaternion

If we want to model 3 dimensional rotations, is it best to use matrices or quaternions?

Pure Rotations

If we want our program to combine 3 dimensional rotations then we have a choice of using 3x3 matrices or quaternions. So which should we use? Provided that we constrain the values in the matrix to be an orthogonal matrix then both algebras are mathematically equivalent so our choice can be made on practical issues.

The advantages of quaternions are:

The advantages of matrices are:

Conclusions

I don't think there is a clear winner, it depends on what you are most comfortable with and what tools are available for your program. I have not done any tests of relative speed but I don't think there is much to choose between them, the matrix has more scalars but this is cancelled out by the more complicated equations for transforming a point.

Isometries and Physics

If we want to model isometries, such as the movement of solid bodies, combining rotation and translation, in one single operation, we need to expand the above algebras to model translations as well as rotations.

To model isometries we could either:

Again matrices tend to be easier to understand for most programmers, dual quaternions have a lop sided multiplication table in which some dimensions have non-zero values which square to zero.

So can we extend these algebras to model physics? For example, modeling forces/torques and their effect on linear/angular acceleration. To do this we need to:

Conclusions

So far, matrices seem to be able to model of these things than quaternion-like algebras, but I'm still working on this and I think that Geometric algebra may have a lot of advantages.


metadata block
see also:
Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2022 Martin John Baker - All rights reserved - privacy policy.