More about rotations in 4 dimensions.

It is easy to take a quaternion and recognize the rotation it actually represents. This is about doing the same thing for 4 dimensional rotations. It is easy to multiply two four dimensional rotations together. Can we extract the orthogonal planes of rotation and their angles of rotations from that. We can represent a rotation as a product of two vectors $ab$ via $w\ mapsto ba v ab$ and this will be the rotation of the $ab$ plane which leaves the space orthogonal to that plane pointwise fixed. It will be the rotations from the vector $a$ to the vector $b$ applied twice. This specifies both the direction and that amount of the rotation. Since $ab = g(a,b) + a\wedge b$ then this rotation is $\cos(\alpha/2) + \sin(\alpha/2) \omega$ where $\alpha$ is the amount of rotation and $\omega$ is $a \wedge b$ scaled to have norm one by a positive scalar constant. The product $a\wedge b$ specifies the direction in which the rotation $\alpha$ is applied, since any vectors $c\wedge d$ which equals $a \wedge b$ specifies the direction of the rotation as it is a rotation of angle $\alpha$ rotating starting from $c$ and moving toward $d$. We can extract the plane $a,b$ from the product $a\wedge b$ because it is those vectors $u$ with $u\wedge (a\wedge b) = 0$. This is a system of 4 homogeneous equations which has rank 2 over $\mathbb{R}^4$. We can extract the orthogonal plane $\phi = c \wedge d$ to the $a,b$ plane from $\omega$ alone. Write $\omega = r_{12} e_1e_2 + r_{13} e_1e_3 + r_{14} e_1e_4 + r_{23}e_2e_3 + r_{24}e_2e_4 + r_{34} e_3 e_4$ where $r_{12}r_{34} - r_{13}r_{24} + r_{14}r_{23} = 0$. Then the orthogonal plane is $\psi = r_{34}e_1e_2 - r_{24} e_1e_3 + r_{23} e_1e_4 + r_{14}e_2e_3 - r_{13}e_2e_4 + r_{12}e_3e_4$. Then $\omega \psi = (r_{12} e_1e_2 + r_{13} e_1e_3 + r_{14} e_1e_4 + r_{23}e_2e_3 + r_{24}e_2e_4 + r_{34} e_3 e_4) (r_{34}e_1e_2 - r_{24} e_1e_3 + r_{23} e_1e_4 + r_{14}e_2e_3 - r_{13}e_2e_4 + r_{12}e_3e_4)$. The constant term is $-r_{12}r_{34} + r_{13}r_{24} - r_{14}r_{23} - r_{23}r_{14} + r_{24}r_{13} - r_{34}r_{12} = 0$. The $e_1e_2e_3e_4$ term is $r_{12}^2 + r_{13}^2 + r_{14}^2 + r_{23}^2 + r_{24}^2 + r_{34}^2$. The $e_1e_2$ term of $\omega\psi$ is $r_{13}r_{14} e_1e_3e_2e_3 - r_{14}r_{13}e_1e_4e_2e_4 - r_{23}r_{24}e_2e_3 e_1e_3 + r_{24}r_{23} e_2e_4 e_1e_4$ This simplifies to zero. The other grade 2 terms should simply to zero as well. Then $(a + b \omega) ( c + d \psi) = ac + (bc \omega + ad \psi) + bd \omega\psi$. So if $\omega$ and $\psi$ were norm one then $\omega\psi = e_1e_2e_3e_4$. Thus our product becomes $ac + (bc \omega + ad\psi) + bd e_1e_2e_3e_4$. If $a = \cos(\alpha/2)$ and $b=\sin(\alpha/2)$ and if $c=\cos(\beta/2)$ and $d = \sin(\beta/2)$ then $ac = \cos(\alpha/2)\cos(\beta/2)$ and $bd = \sin(\alpha/2)\sin(\beta/2)$ and consequently $ac - bd = \cos((\beta - \alpha)/2)$ and $ac + bd = \cos((\alpha + \beta)/2)$. Since $ac$ and $bd$ are known (being the constant and the volume coefficients) then we can solve this for $\alpha$ and $\beta$. Now $ad + bc = \sin((\alpha + \beta)/2)$ And $ad - bc = \sin((\beta - \alpha)/2)$. Now $ bc\omega + ad \psi = \frac{1}{2}(ad + bc) (\psi + \omega) + \frac{1}{2}(ad - bc) (\psi - \omega)$. This then equals $\frac{1}{2}\sin((\alpha + \beta)/2) (\psi + \omega) + \frac{1}{2}\sin((\beta-\alpha)/2)(\psi - \omega)$ This is useful because $ac$ and $bd$ are not known. But we can find $\sin((\alpha + \beta)/2)$ and $\sin((\beta-\alpha)/2)$ up to sign (of each) using $ac$ and $bd$. This then becomes easy to solve for the actual coefficients $r_{ij}$ of $\omega$ (and $\psi$).

Some notes on geometric algebra in 4 dimensions

Working in $\mathbb{R}^4$ here with the geometric algebra corresponding to the usual norm, i.e. $e_i e_j = - e_j e_i$ for $i \neq j$ and $e_i e_i = 1$. The inverse of a vector $v$ is just $v / \|v\|^2$. A geometric algebra is an algebra with zero divisors, for if $v$ is a vector of norm 1 so $v v = 1$ then $\frac{1}{2}(1 + v)$ is idempotent and is also a zero divisor (by multiplying by $(1 - v)$. An element of grade $k$ is often called a $k$ vector. Now the product of two vectors $a,b$ is $g(a, b) + a\wedge b$. The product of $a$ and $b - a g(a,b)/g(a,a)$ is therefore $g(a,b) - g(a,a)g(a,b)/g(a,a) + (a \wedge (b - ag(a,b)/g(a,a)) ) = a \wedge b$ since $a \wedge a = 0$. So the grade 2 part of a 2 blade is also always a 2 blade. Put differently, $a\wedge b$ is always a 2 blade. Now given a 2 blade $a\wedge b$ then as above we can assume without loss of generality that $g(a,b) = 0$ and we can also assume that $a$ and $b$ are unit vectors. Then for any scalar $\alpha$ the two blade $a (b + \alpha a) = g(a,b+\alpha a) + a\wedge (b + \alpha a) = \alpha + a \wedge b$. So the grade 0 part is irrelevant to whether something is a 2 blade. If $A = u v$ for othogonormal vectors $u,v$ then $AA = uvuv = -uuvv = -1$. Let $A = r_{12} e_1e_2 + r_{13} e_1e_3 + r_{14} e_1e_4 + r_{23}e_2e_3 + r_{24}e_2e_4 + r_{34} e_3 e_4$. Then $AA = -1$ means $(r_{12} e_1e_2 + r_{13} e_1e_3 + r_{14} e_1e_4 + r_{23}e_2e_3 + r_{24}e_2e_4 + r_{34} e_3 e_4)(r_{12} e_1e_2 + r_{13} e_1e_3 + r_{14} e_1e_4 + r_{23}e_2e_3 + r_{24}e_2e_4 + r_{34} e_3 e_4) = -1$ Now $r_{ij} e_ie_j r_{ij} e_ie_j = r^2_{ij} e_ie_je_ie_j = -r^2_{ij} e_ie_ie_je_j = -r^2_{ij}$. For the mixed terms things are uglier. The $e_1e_2e_3e_4$ term is $r_{12}r_{34}e_1e_2e_3e_4 + r_{13}r_{24}e_1e_3e_2e_4 + r_{14}r_{23}e_1e_4 e_2e_3 + r_{23}r_{14}e_2e_3e_1e_4 + r_{24}r_{13}e_2e_4e_1e_3 + r_{34}r_{12}e_3e_4e_1e_2$ This is equal to $(r_{12}r_{34} - r_{13}r_{24} + r_{14}r_{23} + r_{23}r_{14} - r_{24}r_{13} + r_{34}r_{12})$. Thus $r_{12}r_{34} - r_{13}r_{24} + r_{14}r_{23} = 0$ for a blade. The $e_1e_2$ part of $AA$ is $r_{13}r_{23}e_1e_3e_2e_3 + r_{14}r_{24}e_1e_4e_2e_4 + r_{23}r_{13} e_2e_3e_1e_3 + r_{24}r_{14}e_2e_4e_1e_4 = (-r_{13}r_{32} - r_{14}r_{24} + r_{13}r_{23} + r_{24}r_{14})e_1e_2 = 0$. Let $B = r_{12} e_1e_2 + r_{13} e_1e_3 + r_{14} e_1e_4 + r_{23}e_2e_3 + r_{24}e_2e_4 + r_{34} e_3 e_4$ in $\mathbb{R}^4$ and assume that $r_{12}r_{34} - r_{13}r_{24} + r_{14}r_{23} = 0$. How big is the space of vectors $u$ with $u \wedge B = 0$? If $u = x_1 e_1 + x_2 e_2 + x_3 e_3 + x_4 e_4$ then $u\wedge B = 0$ becomes $x_1 r_{23} e_1e_2e_3 + x_1 r_{24} e_1e_2e_4 + x_1 r_{34} e_1e_3e_4 + x_2 r_{13} e_2 e_1e_3 + x_2r_{14} e_2 e_1 e_4 + x_2 r_{34}e_2e_3e_4 + x_3 r_{12} e_3 e_1e_2 + x_3 r_{14} e_3e_1e_4 + x_3 r_{24} e_3 e_2e_4 + x_4 r_{12} e_4 e_1 e_2 + x_4 r_{13} e_4 e_1 e_3 + x_4 r_{23} e_4 e_2e_3 = 0$ This then becomes the system of 4 homogeneous equations: $x_1 r_{23} - x_2 r_{13} + x_3r_{12} = 0$, $x_1 r_{24} - x_2 r_{14} + x_4r_{12} = 0$, $x_1 r_{34} - x_3 r_{14} + x_4r_{13} = 0$, $x_2 r_{34} - x_3 r_{24} + x_4r_{23} = 0$. Taking $r_{14}$ times the first equation minus $r_{13}$ times the second we obtain $x_1(r_{14}r_{23}-r_{13}r_{24}) + x_3r_{14}r_{12} - x_4r_{13}r_{12} = 0$ If $r_{12}r_{34} - r_{13}r_{24} + r_{14}r_{23} = 0$ then we can rewrite this as $-x_1 r_{12}r_{34} + x_3 r_{14}r_{12} - x_4 r_{13}r_{12} = 0$ which is $-r_{12}$ times the third equation. Similarly if we take the linear combination of the first two equations which eliminates the $x_1$ term we should obtain the fourth equation. Thus the system has rank at most two. If $B$ is a wedge of two orthonormal vectors then we can obtain the span of those vectors as the space of vectors $u$ satisfying $u\wedge B = 0$.

Rotations in 4D

So the geometric algebra specifies a rotation on $\mathbb{R}^n$ in quite a nice form. Given unit vectors $a,b$ then defining $\sigma\colon v \mapsto b a v a b$ we get the $\sigma$ is a rotation that leaves everything perpendicular to the $a,b$ plan pointwise fixed, and within the $a,b$ plane $\sigma$ is the rotation from $a$ to $b$ applied twice (so that the rotation of $\sigma$ is twice the angle between $a$ and $b$). Now in the plane if we choose $a$ to be $e_1 = (1,0)$ and we choose $b = \cos(\theta/2) e_1 + \sin(\theta/2) e_2 = (\cos(\theta/2),\sin(\theta/2))$ so that applying the rotation from $a$ to $b$ twice is a counterclockwise rotation of the plane by angle $\theta$ then the geometric product $ab = \cos(\theta/2) + \sin(\theta/2) e_1 e_2$ and the geometric $ba = \cos(\theta/2) - \sin(\theta/2) e_1 e_2$. Now in 4 dimensions a rotation is made up of a plane, and its orthogonal plane, each of them being setwise invariant, and each undergoing a rotation. Thus we can see a model of a 4 dimensional rotation by taking the product $(\cos(\alpha/2) + \sin(\alpha/2) e_1 e_2) (\cos(\beta/2) + \sin(\beta/2) e_3 e_4)$. Then $v \mapsto q^{-1} v q$ is a rotation in $\mathbb{R}^4$ which is a rotation in the direction from $e_1$ to $e_2$ by angle $\alpha$ in the $e_1,e_2$ plane, and is a rotation in the $e_3,e_4$ plane rotating in the direction from $e_3$ to $e_4$ by angle $\beta$. More interestingly, given a general unit member $z = a + b_{12} e_1 e_2 + b_{13} e_1 e_3 + b_{14} e_1 e_4 + b_{23} e_2 e_3 + b_{24} e_2 e_4 + b_{34} e_3 e_4 + c e_1 e_2 e_3 e_4$ one wonders whether we can factor it as a product of two planar orthogonal rotations. That is, can you read off the planes of rotation and the corresponding angles of rotation from any unit even member of the geometric algebra. The answer is that yes one can. Assume that the two rotations are $g = \cos(\alpha/2) + \sin(\alpha/2) (r_{12} e_1 e_2 + r_{13} e_1 e_3 + r_{14} e_1 e_4 + r_{23} e_2 e_3 + r_{24} e_2 e_4 + r_{34} e_3 e_4)$ and by $h = \cos(\beta/2) + \sin(\beta/2) (s_{12} e_1 e_2 + s_{13} e_1 e_3 + s_{14} e_1 e_4 + s_{23} e_2 e_3 + s_{24} e_2 e_4 + s_{34} e_3 e_4)$. For a rotation to represent a plane it must have $r_{12} r_{34} + r_{13} r_{24} + r_{14} r_{23} = 0$ For the planes of these two members of the product to be orthogonal we must have $r_{12} = s_{34}$, $r_{13} = s_{24}$, $r_{14} = s_{23}$, $r_{23} = s_{14}$, $r_{24} = s_{13}$, $r_{34} = s_{12}$. Consequently the grade 4 part of the product $g h$ is $r_{12} s_{34} + r_{13} s_{24} + r_{14} s_{23} + r_{23} s_{14} + r_{24} s_{13} + r_{34} s_{14}$ which is equal to $r_{12}^2 + r_{13}^2 + r_{14}^2 + r{23}^2 + r_{24}^2 + r_{34}^2 = 1$. Consequently if $z = gh$ then $a = \cos(\alpha/2) \cos(\beta/2)$ and $c= \sin(\alpha/2) \sin(\beta/2)$. We then have $a - c = \cos((\alpha + \beta)/2)$ and $a + c = \cos((\alpha - \beta)/2)$. From this we can readily extract both $\alpha$ and $\beta$. Then since $b_{ij} = \cos(\beta/2)\sin(\alpha/2) r_{ij} + \sin(\beta/2) \cos(\alpha/2) s_{ij} = \cos(\beta/2)\sin(\alpha/2) r_{ij} + \sin(\beta/2) \cos(\alpha/2) r_{kl}$ and $b_{kl} = \cos(\beta/2)\sin(\alpha/2) r_{kl} + \sin(\beta/2) \cos(\alpha/2) s_{kl} = \cos(\beta/2)\sin(\alpha/2) r_{kl} + \sin(\beta/2) \cos(\alpha/2) r_{ij}$ where $kl$ are the two members different than $ij$ we have equations we can readily solve for $r_{ij}$ and $r_{kl}$ in terms of $b_{ij}$ and $b_{kl}$ (since $\beta$ and $\alpha$ are known). Thus one can decompose any even unit member of the geometric algebra of $\mathbb{R}^4$ into two orthogonal plane rotations with known angles and directions of rotation.
So the wedge product can be defined by simply setting a basis $e_i$ and requiring that $e_i \wedge e_j = - e_j \wedge e_i$ for $i \neq j$ and that $e_i \wedge e_i = 0$ along with commuting with scalars and distribution and associativity. It can be shown then that for any vector $a$ one has $a \wedge a = 0$. The wedge product defines a bit of signed area (or volume) on an oriented plane, hyperplane, etc.... just as a vetor represents a signed quantity in a specific direction. The (typical) geometric product is defined as follows for an orthonormal basis: $e_i e_j = - e_i e_j$ for $i\neq j$ and $e_i e_i = 1$. If $a$ is a vector then $a a = a\cdot a$ the usual dot product of a with itself. In general for vectors $a$ and $b$ the geometric product is $ab = a\cdot b + a \wedge b$. If $b$ has unit length then $b b = 1$, so $b$ is its own inverse. Consider the conjugation $\tau_v \colon v \mapsto e_1 v e_1$. Then for any basis vector other than $e_1$ the result is $e_i \mapsto e_1 e_i e_1 = - e_1 e_1 e_i = - e_i$. But $e_1 \mapsto e_1 e_1 e_1 = e_1$. Thus $\tau_v$ preserves the $e_1$ axis, but is an inversion on the perpendicular space. The same is true for $\tau_a \colon v \mapsto a v a$ for any unit vector $a$. The line through $a$ is fixed pointwise, and the perpendicular space to $a$ undergoes an involution where everything is negated. The combination of $\tau_a$ followed by $\tau_b$ then fixes everything perpendicular to the $a,b$ plane. However, on the $a,b$ plane, if $h$ is rotation from $a$ to $b$ then $\tau_b\circ \tau_a$ is $h$ applied twice, giving twice the rotation of a direct rotation from $a$ to $b$. Thus the map $v \mapsto (ba)v(ab)$ rotates the $a,b$ plane as if a single rotation directly from $a$ to $b$ had been applied twice, whereas it leaves the subspace perpendicular to the $a,b$ plane pointwise fixed. The scalar part of $ab$ is the cosine of $\psi$ where $\psi$ is the angle from $a$ to $b$. Put differently, the angle of rotation is $\theta$ and the scalar part of this rotation is $\cos(\theta/2)$. Because $abab = -aabb = -1$ then if we write out the taylor series expansion for $exp(t ab)$ where t is a scalar we get $cos(t) + sin(t) ab$. The inverse of $cos(t) + sin(t)ab$ is $cos(t) + sin(t) ba = cos(t) - sin(t)ab$. Thus there is a rotation subgroup cos(t) + sin(t)ab, i.e. $v \mapsto (cos(t) - sin(t) ab) v (cos(t) + sin(t) ab)$ When $t=0$ this is the identity map and when $t=\pi/2$ this is the rotation $ v\mapsto (ba) v (ab)$ Now $ab = a\cdot b + a \wedge b$. If $a,b$ are unit vectors, then multiplying $[\cos(t) + \sin(t)ab][\cos(s) + \sin(s)ab]$ yields $\cos(t) \cos(s) + \sin(t)\sin(s)abab + \cos(t)\sin(s) ab + \sin(t)\cos(s) ab = (\cos(t) \cos(s) - \sin(t)\sin(s)) + [ \cos(t)\sin(s) + \sin(t)\cos(s)]ab$ but this is just $\cos(t + s) + \sin(t +s) ab$ In 4 dimensions a rotation is determined by the element $( \cos(s/2) + \sin(s/2) e_1 e_2 ) ( \cos(t/2) + \sin(t/2) e_3 e_4 )$ Expanding gives $\cos(s/2) \cos(t/2) + \cos(s/2) \sin(t/2) e_3 e_4 + \cos(t/2) \sin(s / 2) e_1 e_2 + \sin(s/2) \sin(t/2) e_1 e_2 e_3 e_4$ So there is a vector and a pseudovector and one is $\cos(s/2) \cos(t/2)$ and the other is $\sin(s/2) \sin(t/2) e_1 e_2 e_3 e_4$ There is also a bivector part which is where we get real direction (because the vector and pseudovector are directionless). So given a unit versor for $\mathbb{R}^4$ is there necessarily a corresponding rotation, and if so, can we read off the planes of rotations and their rotation angles as we can in 3 dimensions? That is, given $a + b_{12) e_1 e_2 + b_{13} e_1 e_3 + b_{14} e_1 e_4 + b_{23} e_2 e_3 + b_{24} e_2 e_4 + b_{34} e_3 e_4 + c e_1 e_2 e_3 e_4$ a unit vector where the sum of squares of the coefficients is one, does this always give a rotation, and if so, what are the planes and their rotations? Now the grade two part should be the sum of two different blades, each one the orthogonal complement of the other. A single 2 blade in $\mathbb{R}^4$ has grade two part satisfying $u_{12}u_{34} + u_{13}u_{24} + u{14}u_{23} = 0$. The orthogonal blade grade 2 part has $v_{12} = u_{34}$ and $v_{13} = u_{24}$ etc.... One would expect that every possible choice of $b_{ij}$ can be represented nearly uniquely as a weighted sum of two orthogonal 2 blades, i.e. choose 1, then the other is detemined, and one can choose the coefficient of the other which gives just the right dimension.

More about rotations in 4 dimensions.

It is easy to take a quaternion and recognize the rotation it actually represents. This is about doing the same thing for 4 dimensional rota...