## Section1.2Quaternions

The quaternions, discovered by William Rowan Hamilton in 1843, were invented to capture the algebra of rotations of 3-dimensional real space, extending the way that the complex numbers capture the algebra of rotations of 2-dimensional real space.

Elements in the set of quaternions $\Quat$ are in one-to-one correspondence with points in 4-dimensional real space $\R^4\text{.}$ We will write $r\leftrightarrow (t,x,y,z)$ to denote that the quaternion $r$ corresponds to the 4-tuple $(t,x,y,z)$ of real numbers.

### Subsection1.2.1Cartesian form and pure quaternions

The quaternions $i,j,k$ are defined as follows.

\begin{align} i \amp \leftrightarrow (0,1,0,0)\tag{1.2.1}\\ j \amp \leftrightarrow (0,0,1,0)\tag{1.2.2}\\ k \amp \leftrightarrow (0,0,0,1)\tag{1.2.3} \end{align}

The expression $r=a+bi+cj+dk$ is called the Cartesian form of the quaternion that corresponds to the vector $(a,b,c,d)$ in $\R^4\text{.}$ A quaternion of the form $a=a+0i+0j+0k\leftrightarrow (a,0,0,0)$ is called a scalar quaternion or a real quaternion. A quaternion of the form $xi+yj+zk\leftrightarrow (0,x,y,z)$ is called a pure quaternion or an imaginary quaternion. For a quaternion $r=a+bi+cj+dk\text{,}$ we call the real quaternion $a$ the scalar part or real part of $r\text{,}$ and we call the quaternion $xi+yj+zk$ the vector part or the imaginary part of $r\text{.}$ To reflect the natural correspondence of the pure quaternion $xi+yj+zk$ with the vector $(x,y,z)$ in $\R^3\text{,}$ we will write $\R^3_\Quat$ to denote the space of pure quaternions.

### Subsection1.2.2Correspondence with complex matrices

Analogous to the way that the complex numbers $\C$ can be realized as the set ${\mathcal M}_\C$ of $2\times 2$ real matrices (see Exercise 1.1.7.12), the quaternions can be realized by a set of $2\times 2$ complex matrices, as follows. Let ${\mathcal M}_\Quat$ denote the set of $2\times 2$ complex matrices of the form $\left[\begin{array}{cc} u \amp v\\ -v^\ast \amp u^\ast\end{array}\right]\text{.}$ Given a quaternion $r=a+bi+cj+dk\text{,}$ let $u,v$ be the complex numbers $u=a+bi$ and $v=c+di\text{,}$ and let ${M}(r)$ denote the $2\times 2$ matrix in ${\mathcal M}_\Quat$ given by

\begin{equation*} {M}(r)=\left[\begin{array}{cc} u \amp v\\ -v^\ast \amp u^\ast\end{array}\right]. \end{equation*}

Conversely, given a matrix $M\in {\mathcal M}_\Quat\text{,}$ with top left entry $a+bi$ and top right entry $c+di\text{,}$ let $Q(M)$ denote the quaternion $r=a+bi+cj+dk\text{.}$ It is clear that the mappings $r\to M(r)$ and $M\to Q(M)$ are inverses to one another, and establish a one-to-one correspondence $\Quat\leftrightarrow {\mathcal M}_\Quat\text{.}$

By virtue of Proposition 1.2.1, we can define addition and multiplication of quaternions $r,s$ as follows.

\begin{gather} r+s=Q(M(r)+M(s))\tag{1.2.4}\\ rs=Q(M(r)M(s))\label{quatmultdef}\tag{1.2.5} \end{gather}

Because matrix algebra has associative and distributive laws, these carry over to quaternions. Note that quaternion multiplication is not commutative! However, for any real quaternion $a\text{,}$ we have $M(a)=a\Id\text{,}$ so $M(a)$ commutes with all matrices, and therefore $a$ commutes with all quaternions. To summarize, let $q,r,s$ be quaternions and let $a$ be a real quaternion. We have the following.

\begin{align} q(rs) \amp = (qr)s\;\; \text{ (associative law of multiplication)}\tag{1.2.6}\\ q(r+s)\amp = qr+qs \;\; \text{ (distributive law)}\tag{1.2.7}\\ ar\amp =ra \;\; \text{ (real quaternions commute with all quaternions)}\tag{1.2.8} \end{align}

In practice, it is not necessary to convert quaternions to matrices in order to add and multiply. Quaternion addition and multiplication in Cartesian form is analogous to complex multiplication, using the following basic multiplication rules.

\begin{gather} i^2=j^2=k^2=-1 \label{ijksquaretominus1}\tag{1.2.9}\\ ij=-ji=k, \;\; jk=-kj=i, \;\; ki=-ik=j\label{quatmultrules}\tag{1.2.10} \end{gather}

For $r=a+bi+cj+dk$ and $r'=a'+b'i+c'j+d'k\text{,}$ we have

$$r+r'=(a+a')+(b+b')i+(c+c')j+(d+d')k.\tag{1.2.11}$$

Multiplication looks like this.

\begin{align} rr'\amp = (a+bi+cj+dk)(a'+b'i+c'j+d'k) \notag\\ \amp = aa'+bb'i^2+cc'j^2+dd'k^2\notag\\ \amp + ab'i+ba'i+cd'jk+dc'kj\notag\\ \amp + ac'j+ca'j+bd'ik+db'ki\notag\\ \amp + ad'k+da'k+bc'ij+cb'ji\notag\\ \amp = (aa'-bb'-cc'-dd')\label{quatmultcartesian}\tag{1.2.12}\\ \amp + (ab'+ba'+cd'-dc')i\notag\\ \amp + (ac'+ca'-bd'+db')j\notag\\ \amp + (ad'+da'+bc'-cb')k\notag \end{align}

If $u,v$ are pure quaternions, (1.2.12) can be written more compactly in terms of the dot and cross products for vectors in $\R^3\text{.}$

$$uv = -(u\cdot v) + u\times v \;\;(\text{for pure quaternions }u,v)\label{purequatproduct}\tag{1.2.13}$$

### Subsection1.2.4Conjugate, modulus, and polar form

The conjugate of a quaternion $r=a+bi+cj+dk$ is $r^\ast = a-bi-cj-dk\text{,}$ and the modulus of $r$ is $|r|=\sqrt{a^2+b^2+c^2+d^2}\text{.}$ The unit quaternions , denoted $U(\Quat)$, is the set of quaternions with modulus 1. 1

The set of unit quaternions $U(\H)$ is in one-to-one correspondence with the 3-sphere $S^3=\{(t,x,y,z)\in \R^4\colon t^2+x^2+y^2+z^2=1\}\text{.}$ This is analogous to the set of norm 1 complex numbers that is in one-to-one correspondence with the 1-sphere $S^2\text{.}$

Analogous to complex numbers, quaternions can be expressed in polar form. Given a nonzero quaternion $r\text{,}$ the quaternion $r'=\frac{r}{|r|}$ is a unit quaternion, say $r'=a+bi+cj+dk\text{.}$ If $|a|\lt 1\text{,}$ let $u=\frac{1}{\sqrt{1-a^2}}(bi+cj+dk)$ be the unit pure quaternion obtained by normalizing the pure quaternion $bi+cj+dk\text{.}$ Let $\theta=\arccos a\text{.}$ The expression

$$r=|r|(\cos \theta + u\sin \theta)\tag{1.2.14}$$

is called the polar form of $r\text{.}$

Fill in the remaining details on polar form for quaternions. What happens if $r=0\text{?}$ What happens if $|a|=1\text{?}$

Continuing the analogy with complex numbers, we have the following, for all quaternions $r,s\text{.}$

\begin{gather} (rs)^\ast = s^\ast r^\ast\label{quatconjmult}\tag{1.2.15}\\ |rs|=|r||s|\label{quatnormmult}\tag{1.2.16}\\ |r|^2 = rr^\ast\text{.}\label{quatnormsquare}\tag{1.2.17} \end{gather}
Verify the three equations above.

### Subsection1.2.5Quaternions as rotations of $\R^3_\Quat$

Let $r$ be a unit quaternion and let $v$ be a pure quaternion. Let $R_r(v)$ denote the quaternion $R_r(v)=rvr^\ast\text{.}$ It is easy to check that $(R_r(v))^\ast = -R_r(v)\text{.}$ From this we conclude that $rvr^\ast$ is a pure quaternion.

Explain how "we conclude" that $R_r(v)$ is pure when $r$ is a unit quaternion and $v$ is a pure quaternion.

It is easy to see that $R_r$ is a linear map from the real vector space of unit quaternions to itself. That means that the following properties hold for all pure quaternions $v,w$ and all real scalars $\alpha\text{.}$

\begin{gather} R_r(v+w) = R_r(v) + R_r(w)\tag{1.2.18}\\ R_r(\alpha v) = \alpha R_r(v)\tag{1.2.19} \end{gather}

Show the details to prove that $R_r$ is linear.

We conclude with the main result of this section that shows how rotations of 3-dimensional real space are encoded in the algebra of quaternions.

### Exercises1.2.6Exercises

###### 1.
Let $r$ be a pure, unit quaternion. Use (1.2.13) to show that the map $\R^3_\Quat \to \R^3_\Quat$ given by $u\to rur$ is the reflection across the plane normal to $r\text{.}$ That is, show that $rur=u-2(u\cdot r)r\text{.}$ See Figure 1.2.10.
###### 2.

Prove Proposition 1.2.9 using the following outline. Let $r=\cos\theta + u\sin\theta$ be the polar form for a unit quaternion $r\text{.}$

1. Show that $R_r(u)=u\text{.}$
2. Let $v$ be any pure unit quaternion orthogonal to $u\text{,}$ and let $w=u\times v\text{,}$ so that the triple $u,v,w$ forms a right-handed coordinate system for $\R^3\text{.}$ Show that
\begin{equation*} R_r(v) = \cos(2\theta)v + \sin(2\theta)w \end{equation*}
(use equation (1.2.13)) and explain how this proves the Proposition.
###### 3.
Show that the following hold for all $r,s\in U(\Quat)\text{.}$
1. $R_r\circ R_s = R_{rs}\text{.}$
2. $(R_r)^{-1}=R_{r^\ast}\text{.}$