Currently the Wikipedia page on quaternion rotations gives you this helpful figure to explain $Q\mathbf{p}$ portion of $ \eqref{xform} $ when the rotation angle is $\frac{\pi}{3}$. I will try to do a little better.


Given a non-zero quaternion $Q$ we can rotate a 3D coordinate $\mathbf{p}$ with the similarity transform:

and by restricting ourselved to unit quaternions this reduces to:

where $ \eqref{xforml} $ and $ \eqref{xformr} $ are simply stating that quaternion products are associative.

if we have unit quaternion: $Q = \cos\left(\theta\right)+\sin\left(\theta\right)~\mathbf{u} $, which represents a $2\theta$ rotation about $\mathbf{u}$, then we have:


The rotation

Still here? Okay instead of using the traditional basis set, define three unit bivectors 1:

All rotations are mathematically similar so we can choose an arbitrary fixed axis like “up”, which we can all agree is positive Z. To be “mathy” let’s define the set of quaterions with the following form: $ a + b~\mathbf{z} $ where $a$ is a real and $b$ is a positive (or zero) real. In set-builder notation: $ \newcommand{\hcomplex}[1]{\mathbb{C}_{#1}} $

The members of this set form a plane which spans (contains) the line-of-reals ($\mathbb{R}$) and $~\mathbf{z}$. Our rotation is member of this set:

which represents a rotation of $2\theta$ about $\mathbf{z}$.

The complex case and Complex is easy

The simplest case is some coordinate in $\hcomplex{z}$:

and since the product is associative $ \eqref{xform} $ can be evaluated as either $ \eqref{xforml} $ or $ \eqref{xformr} $. Expanding the first terms of both gives:

Note that these are rotations by $\theta$ and $-\theta$ respectively in $\hcomplex{z}$ (angles are with respect to the line-of-reals so the angle of $\mathbf{p}_z$ is $\frac{\pi}{2}$).

Completing both composes the result with the opposite rotation, which cancels out any movement ($ Q\mathbf{p}_z Q^* = \mathbf{p}_z $), exactly as we would expect.

To generalize this consider a unit quaternion in $\hcomplex{z}$:

then the product with Q is ($\mathbf{z}^2=-1$):

This whole section boils down to a more general property:

Where {1,Q}-plane spans the line-of-reals and Q which in our case is $\hcomplex{z}$ (and why I chose to name the set this way). Our product is simply the complex product and we could have immediately flipped two of the term, cancelled and called it a day:

The orthogonal case is Complex too

Now consider a coordinate independent of $\hcomplex{z}$, which falls in the {$\mathbf{x},\mathbf{y}$}-plane:

although not needed we can factor this into a $\hcomplex{z}$ term on either the left or right:

I’ll leave the factorization as “black-magic” here. The math is straight forward but pretty wordy so I’ll leave that for another day. (It’s just a boring formalization of standard vector space operations anyway) In these factorized forms we can multiply on the left (for the first) or right (for the second) by a quaternion in $\hcomplex{z}$ and the first product is simply complex like the first case above:

the left term is simply a rotation by $\theta$ in $\hcomplex{z}$. Completing the product maps the result back to the {$\mathbf{x},\mathbf{y}$}-plane, so it is a rotation by $\theta$ about $\mathbf{z}$ as expected.

Instead of mechanically expanding the right product, instead let’s mechanically apply identities:

  • second factorized version $ \eqref{s1} $
  • the terms are in same complex plane so they commute $\eqref{s2} $
  • basic conjugation property $\eqref{s3} $
  • conjugate distributes $ \eqref{s4} $
  • ahh…see below $ \eqref{s5} $
  • same as previous expansion $ \eqref{s6} $

so this is also a rotation by $\theta$ about $\mathbf{z}$ as expected and the composition of both results in a total rotation of $2\theta$.

All the previous steps up to $ \eqref{s5} $ are in the complex plane. This is the product with a bivector orthogonal to that plane:

The arbitrary coordinate case

Now consider the coordinate:

The only thing left to be said is the right and left products both distribute over addition.

using both results in:


Let’s do a quick recap. We can think in terms of an fixed axis of rotation which is positive Z in this case. We can simply expand the left-product and right-products of $ \eqref{xform}$ and we get:

where the black terms are the proper rotation in 3D and the blue are the rotation in the complex plane. Each product performs a rotation of $\theta$ in the {$x,y$}-plane (the desired) and a rotation of $\pm\theta$ in the {$1,z$}-plane (complex plane). These planes are orthogonal (independent).

The coordinate of both in the orthogonal plane can expressed as the 2D coordinate:

which composes to a total rotation of $2\theta$. The 2D coordinate in the complex plane, after factoring out the scale and adding symmetry as:

which cancel under composition.

So my proposed “better” visualization than the wikipedia figure presented at the top is as follows:


This also is a total rotation by $\frac{\pi}{3}$, so $\theta=\frac{\pi}{6}$. We have two superimposed 2D figures.

  1. The horizontal plane is the {$x,y$}-plane and the vertical axis represents the axis of rotation. The original coordinate $p$ is transformed to $p_1$ by either the left or right product and $p’$ is the composition of both. As a slice of 3D space this is doing the expected at each step.

  2. The vertical plane is $\hcomplex{z}$. In this case the vertical axis represents the line-of-reals with positive values going down. The 2D coordinate in this plane of $p$ is $\left(0,c\right)$, rotate that to “up” and “down” is now to the “right”. In this plane the $p$ and $p’$ appears as $p_1$ and the line to the vertical axis is $z$ in 3-space. The right product perform a $+\theta$ rotation and the left a $-\theta$ as shown. The unlabeled green point along this $z$-axis is $c~\cos(\theta)$ which is simply the $z$ coordiate scale by “unexpected” cosine factor.

Closing remarks

The visualization here is simply an excuse for the exercise. My main point was to lay out the foundation for thinking about the quaternion product as a factorization into two 2D planes and to note the connection to complex products.

References and Footnotes

  1. Commonly called either “pure quaternion” or “vector”.