You are here

Quaternions for Computer Graphics

John Vince
Publication Date: 
Number of Pages: 
[Reviewed by
Allen Stenger
, on
This book gives an exposition of how to use quaternions to perform rotations in 3-dimensional space. It deals with rotations in general and is not particularly slanted to computer graphics. It does not cover any techniques besides rotation that are useful in computer graphics. The book states (p. 3) “The over-riding objective of this book is to enable the reader to design and code quaternion algorithms.”
The two more common methods for rotations are Euler angles and multiplication by a matrix. The quaternion method, which is already well-known (and goes back to the invention of quaternions by W. R. Hamilton) starts with encoding the axis of rotation and the angle in a quaternion. Thus if the axis is given by a unit vector \( a\mathbf{i} + b \mathbf{j} +c \mathbf{k} \) and the angle is \( \theta \), we represent the rotation by the quaternion \( q = \cos \frac{\theta}{2} + \sin \frac{\theta}{2} (a \mathbf{i} + b \mathbf{j} + c \mathbf{k}) \).  This is not just a representation, but we can use quaternion multiplication to perform the rotation. Let \( r \mathbf{i} + s \mathbf{j} + t \mathbf{k} \) be the orientation vector of the object to be rotated; we turn this into a pure quaternion p by giving it a zero scalar component. Then \( \mathbf{q} \mathbf{p} \mathbf{q}^{-1} \) also has a zero scalar component and gives the rotated orientation vector.
The book does not do a very good job of explaining the advantages of the quaternion method; the one advantage it brings up repeatedly is avoiding the phenomenon of “gimbal lock” (which only afflicts the Euler angles method, not the matrix or quaternion methods). Other advantages of quaternions include simpler calculations, better numerical stability, and a better interpolation method.
The inquisitive reader may wonder why it takes a whole book to explain rotation by quaternions. In this case, the answer is (in several parts): (1) the book takes a very leisurely approach and assumes no background at all; (2) all the calculations are written out in detail; (3) there’s a lot of historical background, including some digressions on who invented quaternion multiplication; (4) complex numbers are developed first as motivation; (5) the quaternion and matrix methods are developed in parallel; (6) there are many pages of numerical examples.
The first 70 pages are devoted to number systems in general and complex numbers in particular (as a model of the abstract approach that will then be used to define quaternions). Then there are 30 pages on the definition and properties of quaternions and 20 pages on rotations in space using matrices.  Finally, at page 129 we see 45 pages of quaternions in action. Much of this last 45 pages is devoted to translating quaternion methods back into matrix methods.
This is presented as a textbook, although it has no exercises. It does have a good set of worked examples in each chapter.


Allen Stenger is a math hobbyist and retired software developer. He was Number Theory Editor of the Missouri Journal of Mathematical Sciences from 2010 through 2021. His personal website is His mathematical interests are number theory and classical analysis.