Quaternions and Rotations

Hamiltonian discovered the following Quaternion Algebra over reals.

Hamilton’s quaternions {\mathbb H} is the four dimensional algebra

\displaystyle \mathbb R+ \mathbb R\mathbf{i}+ \mathbb R\mathbf{j}+\mathbb R \mathbf{k} = \left\{ a+b \mathbf{i}+c \mathbf{j}+d \mathbf{k} : a, b, c, d, \in \mathbb R \right\}

with the relations

\displaystyle \mathbf{i}^2=-1, \mathbf{j}^2=-1, \mathbf{i} \mathbf{j}=\mathbf{k}, \quad \mathbf{j} \mathbf{i}=-\mathbf{k}.

Here {1} and hence all reals are assumed to commute with every element.

This algebra can also be seen as a two dimensional algebra over complex numbers

\displaystyle \mathbb H = \left\{(a+ib) + (c+id)\mathbf j\right\}

where {\mathbf j} is satisfies

\displaystyle i \mathbf j =-\mathbf j i

But the complex numbers are not in the center.

We can also think of the algebra as a sum of scalar part {\mathbb R} and the vector part {\mathbb R\mathbf{i}+ \mathbb R\mathbf{j}+\mathbb R \mathbf{k}}. The algebra now is defined by the relations

\displaystyle \left(r_{1}, \vec{v}_{1}\right)+\left(r_{2}, \vec{v}_{2}\right)=\left(r_{1}+r_{2}, \vec{v}_{1}+\vec{v}_{2}\right)

\displaystyle \left(r_{1}, \vec{v}_{1}\right)\left(r_{2}, \vec{v}_{2}\right)=\left(r_{1} r_{2}-\vec{v}_{1} \cdot \vec{v}_{2}, r_{1} \vec{v}_{2}+r_{2} \vec{v}_{1}+\vec{v}_{1} \times \vec{v}_{2}\right) .

Scalar, vector parts are also called real and imaginary parts.

We have a conjugation map {\mathbb H \rightarrow \mathbb H} given by

\displaystyle q=a+b \mathbf{i}+c \mathbf{j}+d \mathbf{k} \rightarrow \bar q=a-b \mathbf{i}-c \mathbf{j}-d \mathbf{k}

The conjugation of a product reverses the order, that is

\displaystyle \bar {q_1q_2} = \bar{q_2}{\bar q_1}

Norm is defined by

\displaystyle N(q) := q\bar q = \bar q q = a^2+b^2+c^2+d^2.

We also denote it by

\displaystyle \|q\|^{2} =a^2+b^2+c^2+d^2

This allows us to invert non-zero elements (both right and left inverse) and we have a division algebra.

\displaystyle q^{-1} =\frac{\bar q}{q\bar q} =\frac{\bar q}{N(q)} =\frac{a-b \mathbf{i}-c \mathbf{j}-d \mathbf{k}}{a^2+b^2+c^2+d^2}

Unit quaternions are the elements with norm {a^2+b^2+c^2+d^2=1}.

These unit quaternions precisely are the roots of {-1}. That is

{\mathbf n^2=-1} \iff  {\mathbf n =b \mathbf{i}+c \mathbf{j}+d \mathbf{k}}.

Hence the name imaginary.

The norm is multiplicative, that is

\displaystyle \|q_1q_2\| =\|q_1\| \| q_2\|

which follows from writing {\|q\|^2 =q\bar q} and grouping terms.

Mutliplicativity of the norm already gives interesting information. For instance it’s useful to study representation of numbers as sums of four squares. The multiplicativity is equivalent to the following identity


$latex \displaystyle \left(a_{1}^{2}+\right.&\left.a_{2}^{2}+a_{3}^{2}+a_{4}^{2}\right)\left(b_{1}^{2}+b_{2}^{2}+b_{3}^{2}+b_{4}^{2}\right)=
\left(a_{1} b_{1}-a_{2} b_{2}-a_{3} b_{3}-a_{4} b_{4}\right)^{2}+\left(a_{1} b_{2}+a_{2} b_{1}+a_{3} b_{4}-a_{4} b_{3}\right)^{2} \quad +\left(a_{1} b_{3}-a_{2} b_{4}+a_{3} b_{1}+a_{4} b_{2}\right)^{2}+\left(a_{1} b_{4}+a_{2} b_{3}-a_{3} b_{2}+a_{4} b_{1}\right)^{2} &fg=000000$

We have the following matrix representations of the algebra

With complex matrices: The left action by an element on {\mathbb H} consider as the two dimensional complex vector space {\mathbb C + \mathbb C \mathbf j} gives the map

\displaystyle a+b i+c j+d k \longrightarrow \left[\begin{array}{cc} a+b i & c+d i \\ -c+d i & a-b i \end{array}\right]

Basically

\displaystyle 1 \longrightarrow \left[\begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array}\right], \quad i \longrightarrow \left[\begin{array}{cc} i & 0 \\ 0 & -i \end{array}\right], \quad j \longrightarrow \left[\begin{array}{cc} 0 & 1 \\ -1 & 0 \end{array}\right], \quad k \longrightarrow \left[\begin{array}{cc} 0 & i \\ i & 0 \end{array}\right]

Restrict to the unit quaternion we have an isomorphism to {SU(2)}

With real matrices:

\displaystyle a+b i+c j+d k \longrightarrow \left[\begin{array}{cccc} a & -b & -c & -d \\ b & a & -d & c \\ c & d & a & -b \\ d & -c & b & a \end{array}\right]

This corresponds to the left multiplication on the quaternions.

Similarly we have a representation corresponding to the right multiplication

\displaystyle a+b i+c j+d k \longrightarrow \left[\begin{array}{rrrr} a & -b & -c & -d \\ b & a & d & -c \\ c & -d & a & b \\ d & c & -b & a \end{array}\right]

Because the left and right actions commute, and so these matrices commute for all values of the parameters!

Three dimensional Geometry:

If we think in terms of scalar and vector parts of the quaternions, geometric operations can be defined in terms of the algebra.

Dot product of two vectors { \mathbf v_1=b_{1} \mathbf{i}+c_{1} \mathbf{j}+d_{1} \mathbf{k}} and {\mathbf v_2=b_{2} \mathbf{i}+c_{2} \mathbf{j}+d_{2} \mathbf{k}. }

is given by scalar part of any of {\mathbf v_1 \bar{\mathbf v_2}}, {\mathbf v_2 \bar{\mathbf v_1}}, {\bar{\mathbf v_1} \mathbf v_2}, {\bar{\mathbf v_2} {\mathbf v_1}}.

\displaystyle \mathbf v_1 \cdot \mathbf v_2 = \frac{1}{2}\left(\mathbf v_1 \bar{\mathbf v_2}+\mathbf v_2 \bar{\mathbf v_1}\right)=\frac{1}{2}\left(\bar{\mathbf v_1} \mathbf v_2+\bar{\mathbf v_2} {\mathbf v_1}\right).

The cross product {\mathbf v_1 \times \mathbf v_2= \left(c_{1} d_{2}-d_{1} c_{2}\right) \mathbf{i}+\left(d_{1} b_{2}-b_{1} d_{2}\right) \mathbf{j}+\left(b_{1} c_{2}-c_{1} b_{2}\right) \mathbf{k} } is the vector part of {\mathbf v_1 \mathbf v_2}. That is

\displaystyle \mathbf v_1 \times \mathbf v_2 = \frac{\mathbf{v_1} \mathbf {v_2} - \overline{\mathbf v_1}\overline{\mathbf v_2} }{2}.

In general, we have

\displaystyle \mathbf v_1 \mathbf v_2 = \left(-\mathbf v_1 \cdot \mathbf v_2, \mathbf v_1 \times \mathbf v_2 \right)

In particular if the vectors are orthogonal, we have

\displaystyle \mathbf v_1 \mathbf v_2 = \mathbf v_1 \times \mathbf v_2 = - \mathbf v_2 \times \mathbf v_1 = -\mathbf v_2 \mathbf v_1

and the product is anti-commutative. In fact if we { \mathbf v_1 \mathbf v_2 = -\mathbf v_2 \mathbf v_1}, the vectors have to be orthogonal.

We have the general formulae

\displaystyle \mathbf v_1 \mathbf v_2 + \mathbf v_2 \mathbf v_1 = -2\mathbf v_1 \cdot \mathbf v_2.

\displaystyle \mathbf v_1 \mathbf v_2 - \mathbf v_2 \mathbf v_1 = 2\mathbf v_1 \times \mathbf v_2.

Reflections:

The action { v \rightarrow -wv w^{-1}} corresponds to the reflection in the hyperplane perpendicular to {w.}

To see this note that {w} is sent to {-w}. And for any vector orthogonal to {w}, we have the anti-commutativity { vw =-wv} which implies { -wv w^{-1} = w.}

So the hyperplane perpendicular to {w} is fixed and {w} is sent to {-w}, which proves that it’s a reflection.

3D Rotations:

The unit quaternions act by conjugation on the vector parts {\mathbf R^3}. This action corresponds to rotations in {\mathbf R^3}.

\displaystyle q \rightarrow zqz^{-1}

where {\| z\|=1} is a unit quaternion.

From the multiplicativity of norms, we see that {\| zqz^{-1}\| =\| q\|}, so the action is a rotation.

We denote

\displaystyle e^{\theta \mathbf n}:=\cos \theta + \sin \theta \mathbf n.

So we can write every quaternion as

\displaystyle q = \| q\| e^{\theta \mathbf n}.

If we have

{z= \cos \theta + \sin \theta \mathbf n=e^{\theta \mathbf n}},

then the conjugate action corresponds to a rotation of {2\theta} about the axis {\mathbf n}.

The action fixes {\mathbf n}, so it has to be a rotation about {\mathbf n}.

To see that the conjugate action is rotation by angle precisely equal to {2\theta}, we need to get expression for rotations of {q} by about {\mathbf n}.

By splitting the component of {q} along {\mathbf n} and perpendicular to it, we get the Rodrigues formula

\displaystyle {q}_{\|}+\cos (2\theta) {q}_{\perp}+\sin (2\theta) \mathbf{n} \times {q}=\left(\cos 2\theta \right) {q} +\left( \sin 2\theta\right)(\mathbf{n} \times {q}) +(\mathbf{n} \cdot {q})(1-\cos 2\theta) \mathbf{n}

Let’s now compute {zqz^{-1}} with {z=e^{\theta \mathbf n}}.

\displaystyle zqz^{-1} =\left( \cos \theta + \sin \theta \mathbf n \right) q \left( \cos \theta - \sin \theta \mathbf n \right) = \left( \cos \theta q + \sin \theta \left( -\mathbf n \cdot q + \mathbf n \times q\right) \right)\left( \cos \theta - \sin \theta \mathbf n \right)

\displaystyle =\left(\cos ^{2}\theta -\sin ^{2}\theta \right) {q}+\left(2 \cos \theta \sin \theta \right) \hat{\mathbf{n}} \times {q}+2 \sin ^{2}\theta (\hat{\mathbf{n}} \cdot {q}) \hat{\mathbf{n}}

This matches with Rodrigues for rotation by {2\theta.}, so we have checked that e^{\theta \mathbf n} under conjugation rotates a vector by 2\theta about the axis \mathbf n .

4D Rotations:

We can see that left and right multiplication by unit quaternions preserve the norm. Hence we can think of these actions as rotations on the 4-dimensional space. In fact the left and right actions commute, so they give a commuting pair of rotation of 4D space. In fact, every rotation is obtained this way!

\displaystyle q \longrightarrow z_1 qz_2.

So the left action with {z_1= e^{\theta \mathbf n}} and right action with {z_2= e^{-\theta \mathbf n}} are both rotations of the 4-D space, but when you apply them together the vector part {\mathbb R^3} is invariant, and we get a rotation inside the 3-D space.

The left action by {e^{\theta \mathbf i}} is a rotation in the 4-D space but it acts by the usual rule as a rotation of {\theta} on the complex planes { \{ a+ib\}} and { \{ cj+dk =(c+id)j\}}.

In general the left action by {e^{\theta \mathbf n}} is a rotation (counter clockwise) by {\theta} for 3-D vectors in the plane perpendicular to {\mathbf n} and in the complex plane {\{x+y \mathbf n: x, y \in R\}}.

The right action by { e^{\theta \mathbf n}} will also be a rotation by {\theta}, but now the orientation is clockwise if we take vector perpendicular to {\mathbf n}.

Note that these left and right action act as rotation only on the planes perpendicular to {\mathbf n}. Other vectors could moved be away from the {3-d} vector part and get a scalar part after the action. That is the left (and right) action won’t preserve the 3-D space.

But when we act by conjugation the whole 3-D space is invariant and we have a rotation by {\theta} in the counter clockwise direction because of left action by {e^{\theta \mathbf n}} and {-\theta} in the clockwise direction from the right action by {e^{-\theta \mathbf n}}, so in total a rotation of {2\theta} like we mentioned above.

If a rotation {R} has two real eigenvalues, then they should be both {\pm 1}, which implies that there are two lines which are fixed and hence which is almost fixed pointwise (modulo reflections). Such rotations are called simple rotation. If there are no real eigen values, there will be two orthogonal sets of 2-planes on which the rotation acts as 2-d rotation.

In terms of the quaternions, the rotation is simple iff the {z_1} and {z_2} have scalar parts that add to zero.

Also the left (right) action will correspond to “isoclinic” rotations – that is a rotation in which the angles of rotation on the two set of orthogonal planes are both equal (if the angles are different, we call them double rotations). Isoclinic rotations are special because they have infinitely many invariant planes- where the rotation acts shift through the same angle on all the planes.

If {z_1 =a_1+b_1 \mathbf{i}+c_1 \mathbf{j}+d_1 \mathbf{k}, z_2 =a_2+b_2 \mathbf{i}+c_2 \mathbf{j}+d_2 \mathbf{k}}, by the matrix representation we have the rotation

\displaystyle R= \left[\begin{array}{cccc} a_1 & -b_1 & -c_1 & -d_1 \\ b_1 & a_1 & -d_1 & c_1 \\ c_1 & d_1 & a_1 & -b_1 \\ d_1 & -c_1 & b_1 & a_1 \end{array}\right] \left[\begin{array}{rrrr} a_2 & -b_2 & -c_2 & -d_2 \\ b_2 & a_2 & d_2 & -c_2 \\ c_2 & -d_2 & a_2 & b_2 \\ d_2 & c_2 & -b_2 & a_2 \end{array}\right]

On the other hand if we have

\displaystyle R=\left[\begin{array}{cccc} r_{11} & r_{12} & r_{13} & r_{14} \\ r_{21} & r_{22} & r_{23} & r_{24} \\ r_{31} & r_{32} & r_{33} & r_{34} \\ r_{41} & r_{42} & r_{43} & r_{44} \end{array}\right],we can solve for the {a_i, b_i c_i, d_i} in terms of {R}. Explicitly we compute

\displaystyle M = \frac{1}{4}\left[\begin{array}{llll} r_{11}+r_{22}+r_{33}+r_{44} & +r_{21}-r_{12}-r_{43}+r_{34} & +r_{31}+r_{42}-r_{13}-r_{24} & +r_{41}-r_{32}+r_{23}-r_{14} \\ r_{21}-r_{12}+r_{43}-r_{34} & -r_{11}-r_{22}+r_{33}+r_{44} & +r_{41}-r_{32}-r_{23}+r_{14} & -r_{31}-r_{42}-r_{13}-r_{24} \\ r_{31}-r_{42}-r_{13}+r_{24} & -r_{41}-r_{32}-r_{23}-r_{14} & -r_{11}+r_{22}-r_{33}+r_{44} & +r_{21}+r_{12}-r_{43}-r_{34} \\ r_{41}+r_{32}-r_{23}-r_{14} & +r_{31}-r_{42}+r_{13}-r_{24} & -r_{21}-r_{12}-r_{43}-r_{34} & -r_{11}+r_{22}+r_{33}-r_{44} \end{array}\right]

{M} is of rank {1} and can be uniquely (up to sign) written as

\displaystyle M= \left[\begin{array}{llll} a_1 a_2 & a_1 b_2 & a_1 c_2 & a_1 d_2 \\ b_1 a_2 & b_1 b_2 & b_1 c_2 & b_1 d_2 \\ c_1 a_2 & c_1 b_2 & c_1 c_2 & c_1 d_2 \\ d_1 a_2 & d_1 b_2 & d_1 c_2 & d_1 d_2 \end{array}\right]

where { a_1^2+b_1^2+c_1^2+d_1^2=1 = a_2^2+b_2^2+c_2^2+d_2^2}. So we can recover {z_1} and {z_2} given the rotation {R}.

To see that it is of rank {1} compute every {2\times 2} minor and show that it’s zero. For example the minor

\displaystyle \left | \begin{array}{ll} r_{11}+r_{22}+r_{33}+r_{44} & +r_{21}-r_{12}-r_{43}+r_{34} \\ r_{21}-r_{12}+r_{43}-r_{34} & -r_{11}-r_{22}+r_{33}+r_{44} \end{array}\right | =(r_{33}+r_{44})^2- (r_{11}+r_{22})^2 - (r_{21}-r_{12})^2+(r_{43}-r_{34})^2

Use the fact that {RR^{T}=I} to show that this is equal to zero.

It’s easy to check the factorization for infinitesimal elements near the identity. If

\displaystyle R= \left[\begin{array}{cccc} 1 & -d x_{21} & -d x_{3 1} & -d x_{4 1} \\ d x_{2 1} & 1 & -d x_{3 2} & -d x_{4 2} \\ d x_{31} & d x_{3 2} & 1 & -d x_{4 3} \\ d x_{41} & d x_{ 42} & d x_{4 3} & 1 \end{array}\right]

The factorization is

\displaystyle z_{1}=1+\frac{d x_{21}+d t_{43}}{2} i+\frac{d x_{31}-d x_{42}}{2} j+\frac{d x_{41}+d x_{32}}{2} k

\displaystyle {z}_{2}=1+\frac{dx_{21}-d t_{43}}{2} i+\frac{d x_{31}+d x_{42}}{2} j+\frac{d x_{41}-d x_{32}}{2} k

The existence of this factorization in terms of the quaternions is a very non-trivial property which is true only for 4-D and reflects special structure of the 4-dimensional geometry.

Posted in $.

Leave a comment