User:Muphrid15/Rotation representation draft

Rotors in a geometric algebra
The formalism of geometric algebra (GA) provides an extension and interpretation of the quaternion method. Central to GA is the geometric product of vectors, an extension of the traditional inner and cross products, given by


 * $$ab = a \cdot b + a \wedge b$$

where the symbol $$\wedge$$ denotes the outer product. This product of vectors $$a,b$$ produces two terms: a scalar part from the inner product and a bivector part from the outer product. This bivector describes the plane perpendicular to what the cross product of the vectors would return.

Bivectors in GA have some unusual properties compared to vectors. Under the geometric product, bivectors have negative square: the bivector $$\hat x \hat y$$ describes the $$xy$$-plane. Its square is $$(\hat x \hat y)^2 = \hat x \hat y \hat x \hat y$$. Because the unit basis vectors are orthogonal to each other, the geometric product reduces to the antisymmetric outer product--$$\hat x$$ and $$\hat y$$ can be swapped freely at the cost of a factor of $$-1$$. The square reduces to $$-\hat x \hat x \hat y \hat y = -1$$ since the basis vectors themselves square to $$+1$$.

This result holds generally for all bivectors, and as a result the bivector plays a role similar to the imaginary unit. Geometric algebra uses bivectors in its analogue to the quaternion, the rotor, given by $$R = \exp(- \hat u\theta/2)= \cos \theta/2 - \hat u \sin \theta/2$$, where $$\hat u$$ is a unit bivector that describes the plane of rotation. Because $$u$$ squares to $$-1$$, the power series expansion of $$R$$ generates the trigonometric functions. The rotation formula that maps a vector $$a$$ to a rotated vector $$a'$$ is then


 * $$a' = R a R^\dagger$$

where $$R^\dagger = \exp(\hat u\theta/2) = \cos \theta/2 +\hat u \sin \theta/2$$ is the reverse of $$R$$ (reversing the order of the vectors in $$u$$ is equivalent to changing its sign).

Example. A rotation about the axis $$\hat v = (\hat x + \hat y + \hat z)/\sqrt{3}$$ can be accomplished by converting $$\hat v$$ to its dual bivector, $$\hat u = \hat x \hat y \hat z \hat v = i \hat v$$, where $$i = \hat x \hat y \hat z$$ is the unit volume element, the only trivector in three-dimensional space. The result is $$\hat u = (\hat y \hat z + \hat z \hat x + \hat x \hat y)/\sqrt{3}$$. In three-dimensional space, however, it is often simpler to leave the expression for $$\hat u = i \hat v$$, using the fact that $$i$$ commutes with all objects in 3D and also squares to $$-1$$. A rotation of the $$\hat x$$ vector in this plane by an angle $$\theta$$ is then


 * $$\hat x' = R \hat x R^\dagger = e^{-i\hat v \frac{\theta}{2}} \hat x e^{i \hat v \frac{\theta}{2}} = \hat x \cos^2 \frac{\theta}{2} + i (\hat x \hat v - \hat v \hat x) \cos \frac{\theta}{2} \sin \frac{\theta}{2} + \hat v \hat x \hat v \sin^2 \frac{\theta}{2}$$

Recognizing that $$i (\hat x \hat v - \hat v \hat x) = 2i (\hat x \wedge \hat v)$$ and that $$-\hat v \hat x \hat v$$ is the reflection of $$\hat x$$ about the plane perpendicular to $$\hat v$$ gives a geometric interpretation to the rotation operation: the rotation preserves the components that are parallel to $$\hat v$$ and changes only those that are perpendicular. The terms are then computed:


 * $$\begin{array}{r c l}

\hat v \hat x \hat v & = & \frac{1}{3} (-\hat x + 2 \hat y + 2 \hat z) \\ 2i \hat x \wedge \hat v & = & 2i \frac{1}{\sqrt{3}} (\hat x \hat y + \hat x \hat z) = \frac{2}{\sqrt{3}} (\hat y - \hat z) \end{array}$$

The result of the rotation is then


 * $$\hat x' = \hat x \left(\cos^2 \frac{\theta}{2} - \frac{1}{3} \sin^2 \frac{\theta}{2}\right) + \frac{2}{3} \hat y \sin \frac{\theta}{2} \left(\sin \frac{\theta}{2} +\sqrt{3} \cos \frac{\theta}{2}\right)  + \frac{2}{3} \hat z \sin \frac{\theta}{2} \left(\sin \frac{\theta}{2} - \sqrt{3} \cos \frac{\theta}{2}\right) $$

A simple check on this result is the angle $$\theta = 2\pi/3$$. Such a rotation should map the $$\hat x$$ to $$\hat y$$. Indeed, the rotation reduces to


 * $$\hat x' = \hat x\left(\frac{1}{4} - \frac{1}{3} \frac{3}{4}\right) + \frac{2}{3} \hat y \frac{\sqrt{3}}{2} \left(\frac{\sqrt{3}}{2} + \sqrt{3}\frac{1}{2}\right) + \frac{2}{3} \hat z \frac{\sqrt{3}}{2} \left(\frac{\sqrt{3}}{2} - \sqrt{3}\frac{1}{2}\right) = 0 \hat x + \hat y + 0 \hat z = \hat y$$

exactly as expected. This rotation formula is valid not only for vectors but for any multivector. In addition, when Euler angles are used, the complexity of the operation is much reduced. Compounded rotations come from multiplying the rotors, so the total rotor from Euler angles is


 * $$R = R_{\gamma'} R_{\beta'} R_\alpha = \exp(-i \hat z' \gamma/2) \exp(-i \hat x' \beta/2) \exp(-i \hat z \alpha/2)$$

but $$\hat x' = R_\alpha \hat x R_\alpha^\dagger$$ and $$\hat z' = R_{\beta'} \hat z R_{\beta'}^\dagger$$. These rotors come back out of the exponentials like so:


 * $$R_{\beta'} = \cos \beta/2 - i R_\alpha \hat x R_\alpha^\dagger \sin \beta/2 = R_\alpha R_\beta R_\alpha^\dagger$$

where $$R_\beta$$ refers to rotation in the original coordinates. Similarly for the $$\gamma$$ rotation, $$R_{\gamma'} = R_{\beta'} R_\gamma R_{\beta'}^\dagger = R_\alpha R_\beta R_\alpha^\dagger R_\gamma R_\alpha R_\beta^\dagger R_\alpha^\dagger$$. Noting that $$R_\gamma$$ and $$R_\alpha$$ commute (rotations in the same plane must commute), and the total rotor becomes


 * $$R = R_\alpha R_\beta R_\gamma$$

Thus, the compounded rotations of Euler angles become a series of equivalent rotations in the original fixed frame.

While rotors in geometric algebra work almost identically to quaternions in three dimensions, the power of this formalism is its generality: this method is appropriate and valid in spaces with any number of dimensions. In 3D, rotations have three degrees of freedom, a degree for each linearly independent plane (bivector) the rotation can take place in. It has been known that pairs of quaternions can be used to generate rotations in 4D, yielding six degrees of freedom, and the geometric algebra approach verifies this result: in 4D, there are six linearly independent bivectors that can be used as the generators of rotations.