User:Prof McCarthy/Rodrigues equation

Quaternions and spatial rotations
A benefit of the quaternion formulation of the composition of two rotations RB and RA is that the resulting quaternion yields directly the rotation axis and angle of the composite rotation RC=RBRA.

In general, the quaternion associated with a spatial rotation R is constructed from its rotation axis S and the rotation angle φ this axis. The associated quaternion is given by,
 * $$ S = \cos\frac{\phi}{2} + \sin\frac{\phi}{2} \mathbf{S}. $$

Let the composition of the rotation RR with RA be the rotation RC=RBRA. The rotation axis and angle of RC is obtained from the product of the quaternions
 * $$A=\cos(\alpha/2)+ \sin(\alpha/2)\mathbf{A}\quad

\text{and}\quad B=\cos(\beta/2)+ \sin(\beta/2)\mathbf{B}.$$ That is, the composite rotation RC=RBRA is defined by the quaternion
 * $$ C = \cos\frac{\gamma}{2}+\sin\frac{\gamma}{2}\mathbf{C}

= \Big(\cos\frac{\beta}{2}+\sin\frac{\beta}{2}\mathbf{B}\Big) \Big(\cos\frac{\alpha}{2}+ \sin\frac{\alpha}{2}\mathbf{A}\Big). $$

Expand this product to obtain

\cos\frac{\gamma}{2}+\sin\frac{\gamma}{2} \mathbf{C} = \Big(\cos\frac{\beta}{2}\cos\frac{\alpha}{2} - \sin\frac{\beta}{2}\sin\frac{\alpha}{2} \mathbf{B}\cdot \mathbf{A}\Big) +  \Big(\sin\frac{\beta}{2}\cos\frac{\alpha}{2} \mathbf{B} + \sin\frac{\alpha}{2}\cos\frac{\beta}{2} \mathbf{A} + \sin\frac{\beta}{2}\sin\frac{\alpha}{2} \mathbf{B}\times \mathbf{A}\Big). $$

Divide both sides of this equation by the identity, which is the law of cosines on a sphere,
 * $$ \cos\frac{\gamma}{2} = \cos\frac{\beta}{2}\cos\frac{\alpha}{2} -

\sin\frac{\beta}{2}\sin\frac{\alpha}{2} \mathbf{B}\cdot \mathbf{A},$$ and compute
 * $$ \tan\frac{\gamma}{2} \mathbf{C} = \frac{\tan\frac{\beta}{2}\mathbf{B} +

\tan\frac{\alpha}{2} \mathbf{A} + \tan\frac{\beta}{2}\tan\frac{\alpha}{2} \mathbf{B}\times \mathbf{A}}{1 - \tan\frac{\beta}{2}\tan\frac{\alpha}{2} \mathbf{B}\cdot \mathbf{A}}. $$

This is Rodrigues formula for the axis of a composite rotation defined in terms of the axes of the two rotations. He derived this formula in 1840 (see page 408).

The three rotation axes A, B, and C form a spherical triangle] and the dihedral angles at the vertices of the triangle between the planes formed by the sides of the this triangle are defined by the these rotation angles.