Skip to main content
Mathematics LibreTexts

1.2: Quaternions

  • Page ID
    85705
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    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 \(\mathbb{H}\) are in one-to-one correspondence with points in 4-dimensional real space \(\mathbb{R}^{4}\) 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.

    Cartesian form and pure quaternions

    The quaternions \(i,j,k\) are defined as follows.

    \begin{align}
    i & \leftrightarrow (0,1,0,0)\tag{1.2.1}\\
    j & \leftrightarrow (0,0,1,0)\tag{1.2.2}\\
    k & \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 \(\mathbb{R}^{4}\). 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 \(\mathbb{R}^{3}\) we will write \(\mathbb{R}_{\mathbb{H}}^{3}\) to denote the space of pure quaternions.

    Correspondence with complex matrices

    Analogous to the way that the complex numbers \(\mathbb{C}\) can be realized as the set \({\mathcal M}_\mathbb{C}\)of \(2×2\) real matrices (see Exercise 1.1.7.12), the quaternions can be realized by a set of \(2×2\) complex matrices, as follows. Let \({\mathcal M}_\mathbb{H}\) denote the set of \(2×2\) complex matrices of the form \(\left[\begin{array}{cc} u & v\\ -v^\ast & 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×2\) matrix in \({\mathcal M}_\mathbb{H}\) given by

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

    Conversely, given a matrix \(M\in {\mathcal M}_\mathbb{H}\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 \(\mathbb{H}\leftrightarrow {\mathcal M}_\mathbb{H}\text{.}\)
    Proposition 1.2.1. \({\mathcal M}_\mathbb{H}\) is closed under addition and multiplication.

    Let \(M,N\) be elements of \({\mathcal M}_\mathbb{H}\) Then the sum \(M+N\) and the product \(MN\) are also elements of \({\mathcal M}_\mathbb{H}\).

    Checkpoint 1.2.2.

    Prove Proposition 1.2.1

    Addition and multiplication

    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)=aId\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) & = (qr)s\;\; \text{ (associative law of multiplication)}\tag{1.2.6}\\
    q(r+s) & = qr+qs \;\; \text{ (distributive law)}\tag{1.2.7}\\
    ar & =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}

    Checkpoint 1.2.3.

    Verify (1.2.9) and (1.2.10).

    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'& = (a+bi+cj+dk)(a'+b'i+c'j+d'k) \notag\\
    & = aa'+bb'i^2+cc'j^2+dd'k^2\notag\\
    & + ab'i+ba'i+cd'jk+dc'kj\notag\\
    & + ac'j+ca'j+bd'ik+db'ki\notag\\
    & + ad'k+da'k+bc'ij+cb'ji\notag\\
    & = (aa'-bb'-cc'-dd')\label{quatmultcartesian}\tag{1.2.12}\\
    & + (ab'+ba'+cd'-dc')i\notag\\
    & + (ac'+ca'-bd'+db')j\notag\\
    & + (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 \(\mathbb{R}^{3}\).

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

    Checkpoint 1.2.4.

    Verify (1.2.13).

    Conjugate, 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(\mathbb{H})\), is the set of quaternions with modulus 1. 1 

    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{.}\)

    Checkpoint 1.2.5.

    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}

    Checkpoint 1.2.6.

    Verify the three equations above.

    Quaternions as rotations of \(\mathbb{R}_{\mathbb{H}}^{3}\)

    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.

    Checkpoint 1.2.7.

    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}

    Checkpoint 1.2.8.

    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.

    Proposition 1.2.9. Quaternions and rotations of \(\mathbb{R}_{\mathbb{H}}^{3}\).

    Let \(r=\cos\theta + u\sin\theta\) be a unit quaternion in polar form, and let \(R_r\) be the linear transformation of the space of pure quaternions given by \(v\to rvr^\ast\text{.}\) The action of \(R_r\) is a rotation by \(2θ\) radians about the axis given by the unit vector \(u\text{.}\)

    Proof

    See Exercise 1.2.6.2.

    Exercises

    Exercise 1

    Let r be a pure, unit quaternion. Use (1.2.13) to show that the map \(\mathbb{R}_{\mathbb{H}}^{3} \to \mathbb{R}_{\mathbb{H}}^{3}\)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.

    Figure 1.2.10. The reflection of \(u\in \mathbb{R}_{\mathbb{H}}^{3}\) across the plane normal to \(r\in \mathbb{R}_{\mathbb{H}}^{3}\text{.}\)
    Exercise 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{.}\)

    a. Show that \(R_r(u)=u\text{.}\)

    b. 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 \(\mathbb{R}^{3}\) Show that

    \[
    R_r(v) = \cos(2\theta)v + \sin(2\theta)w
    \nonumber \]

    (use equation (1.2.13)) and explain how this proves the Proposition.

    Exercise \(\PageIndex{1}\)

    Show that the following hold for all \(r,s\in U(\mathbb{H})\text{.}\)

    a. \(R_r\circ R_s = R_{rs}\text{.}\)

    b. \((R_r)^{-1}=R_{r^\ast}\text{.}\)


    This page titled 1.2: Quaternions is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by David W. Lyons via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.