Composition of two axis-angle rotations

The formula is given in this excerpt from a journal paper. It was discovered by the French mathematician Olinde Rodrigues in 1840, which was before the invention of vectors or even quaternions (which were invented before vectors).

The composition of $\alpha\hat{l}$ and $\beta\hat{m}$ (where the second rotation is applied and then the first is applied) is given by $\gamma\hat{n}$, where $\cos\frac{\gamma}{2} = \cos\frac{\alpha}{2}\cos\frac{\beta}{2} - \sin\frac{\alpha}{2}\sin\frac{\beta}{2}\hat{l}\cdot\hat{m}$ and $\sin\frac{\gamma}{2}\hat{n}=\sin\frac{\alpha}{2}\cos\frac{\beta}{2}\hat{l}+\cos\frac{\alpha}{2}\sin\frac{\beta}{2}\hat{m}+\sin\frac{\alpha}{2}\sin\frac{\beta}{2}\hat{l}\times\hat{m}$.

As a sanity check, it's easy to see that when $\hat{l}=\hat{m}$, then it's easy to see that $\gamma=\alpha+\beta$ and $\hat{n}= \hat{l}=\hat{m}$.

In any case, these formulas are proven in detail in this chapter of Simon Altman's book "Rotations, Quaternions, and Double Groups", but it basically boils down to this spherical triangle:

enter image description here

See also this related result proven by William Rowan Hamilton after he invented quaternions.


I did some original research using Mathematica, and this was the simplest form I could find.

Given two axis angles $\vec{a}$ and $\vec{b}$, with $a = \|\vec{a}\|$ and $b = \|\vec{b}\|$

The resulting vector has the length

$c = \cos^{-1}\left(\cos a \cos b - (\hat{a} \sin a) \cdot (\hat{b} \sin b)\right)$

and is in the direction

$d = (\cos a) (\hat{b} \sin b) + (\cos b) (\hat{a} \sin a) + (\hat{a} \sin a) \times (\hat{b} \sin b)$

So

$C = c \hat{d}$

where $\hat{x} = \vec{x} / |x|$. Not very monstrous, but it took several hours of simplifying and prodding.