# How do you construct the quaternion and the multiplication rules, like Hamilton did?

So, I understand complex number multiplication, and how it represents $2D$ rotations.

What I don't understand is, how you add two more imaginary numbers $j$ and $k$, and get $3D$ rotations. I believe Hamilton "made up rules" on how to add these extra imaginary numbers, but how did he construct it in a way that worked?

I also don't understand the purpose of adding two imaginary numbers instead of just $1$ more for $3D$ rotations.

In this paragraph, I will explain my attempt to visualize / construct the quaternion, you don't have to read this, it's probably utterly wrong. I tried to imagine a $3D$ space with the axis vectors $1$ (the real number line, side to side), $i$ (up), and $j$ (depth). Next, I imagined a vector pointing out from the origin with a real component and a $j$ component. Next, I imagined multiplying this vector by $i$ to rotate it $90$ degrees up, so I would get a resultant vector with an '$i$' component and an '$j$' component. The problem is, multiplying (real + $j$) with ($i$) algebraically gives you an '$i$' component and an '$ij$' component, which does not make sense to me. This is where I got stuck.

-
If I remember right, Hamilton spent a decade trying to do it with just one more instead of two more, and then just realized in a flash of inspiration that two were necessary so that there was "enough room". I guess you're kind of asking for a back-explanation of that flash of inspiration? – rschwieb Mar 14 '13 at 0:34
@rschwieb yes, that would be helpful. I want to know how he constructed it though – Dan Webster Mar 14 '13 at 0:37
If I remember right, Hamilton struggled for a decade trying to use "just one more" before he realized it wasn't possible, and then he found that four worked. – rschwieb Mar 14 '13 at 1:16

So in the complex picture, rotations and dilations of the plane are acheived just by multiplying with a complex number.

I see here you are transferring that idea, but as you said, you get stuck if your three axes are $1,i,j$, because $ij=k$, which is a fourth axis perpendicular to the first two. If you're willing to imagine a four-dimensional space, then you have a similar picture to the complex numbers: multiplication by $i$ would permute the set $\{\pm 1, \pm i,\pm j,\pm k\}$ just as multiplying by $i$ permutes $\{\pm 1, \pm i\}$.

There is a more useful way to view quaternions as rotations in 3-space, though. Imagine $i,j,k$ acting as orthogonal unit vectors, as in physics. Linear combinations of these model every point in that 3-space as a "pure" quaternion $v$ with no real part. Now given another nonzero quaternion $q$, conjugating $v$ to become $qvq^{-1}$ produces a tranformation of the 3 space! When $q$ is a unit-length quaternion, this transformation is actually a rotation.

Try it out with $q=i$ and see what happens to the $i,j,k$ axes! If you feel like skipping $j$ and $k$, you can try $\sqrt{2}/2 +i\sqrt{2}/2$ (whose inverse is, naturally, $\sqrt{2}/2 -i\sqrt{2}/2$.)

This is not useful in the complex numbers because $aba^{-1}=b$ by commutativity, so no change occurs. However, the noncommutativity of the quaternions allows interesting stuff to happen :)

One thing to keep in mind about this conjugation action modeling rotations is that many rotations are produced by a pair of unit-length quaternions (and not just one unit-length quaternion). All that means is that there is a slight redundancy in the way unit-length quaternions model rotations.

EDIT: I just wanted to add a little more trying to justify why "just one more" doesn't seem to work. In analogy with the complex numbers, you want to get $1,i,j$ such that the produce of any two lands in $\{\pm1, \pm i \pm j\}$. As you noted, we have to figure out where $ij$ goes. But if $ij=\pm i$, that implies that $-j=\pm -1$, and then $j$ is not orthogonal to 1. Similarly, $ij\neq \pm j$. The only thing left is if $ij=\pm 1$, but then $-j=\pm i$, and $j$ is not perpendicular to $i$.

-

Here's one way to think about it. Let's restrict ourselves to unit quaternions (they are of the form $a+bi+cj+dk$ such that $a^2+b^2+c^2+d^2 = 1).$ Unit quaternions aren't supposed to give you elements of $\mathbb{R}^3,$ they're supposed to give you orthogonal transformations. So you shouldn't just use $i,j,$ and $k$ to label the axes of $\mathbb{R}^3,$ you should be using them to label certain kinds of rigid motions (although we will end up labeling the axes $i,j,$ and $k$ later to see how these rigid motions work).

So what do rigid motions of $\mathbb{R}^3,$ look like? Well they are all given by fixing an axis of rotation and an angle of rotation about that axis. Unit quaternions are three dimensional, so there better be 3 independent parameters here. Choosing the axis of rotation amounts to choosing a unit vector in $\mathbb{R}^3,$ so a point on the 2 sphere. Choosing an angle is an additional 1 parameter, so we should have a 3 dimensional group of orthogonal transformations.

To see what linear transformation a quaternion $q=a+bi+cj+dk$ gives, label the axes $i,j$ and $k.$ This will be our basis for $\mathbb{R}^3.$ The transformation will be given by conjugating by the quaternion, so $i$ goes to $qiq^{-1}.$ For example, what does the linear transformation given by $q=i$ do? It sends $i$ to $(i)(i)(-i) = i$ and thus fixes the first axis. It sends $j$ to $-j$ and $k$ to $-k,$ so rotates by 180 degrees in the $j,k$ plane. This also gives us a matrix representation for the transformation $i,$ it is $$\begin{pmatrix} 1 & 0& 0 \\ 0 &-1& 0 \\ 0& 0&-1 \\ \end{pmatrix}$$ when we use the ordered basis $i,j,k.$ Note that $i$ and $-i$ actually induce the same linear transformation, so the unit quaternions are not exactly the special orthogonal transformations, but map 2-1 onto them. Geometrically, the unit quaternions look like $S^3$ and $SO(3)$ is homeomorphic to $RP^3,$ and this map gives a double cover.

-

I like to think of the quaternions as $\mathbb{H},$ the set of complex matrices of the form $\left( \begin{array}{clcr} z & w\\ -\bar{w} &\overline{z} \end{array} \right)$, where $z,w$ run through all the complex numbers. Note that any such complex matrix has strictly positive real determinant, except when $z = w =0.$ Hence this is an example of a division ring (a ring in which every non-zero element has an inverse). Thinking of quaternions this way, $i$ corresponds to the case $z = i, w = 0$, $j$ corresponds to the case $z=0, w =i$ and $k$ corresponds to the case $z=0, w = 1.$ Note that such a matrix has trace zero exactly when $z$ is pure imaginary (as a complex number). In fact, such a matrix gives rise to a rotation of $3$-dimensional real space, because we can identify the matrices of trace $0$ with the $\mathbb{R}$-linearcombinations of $i,j,k$ in the above correspondence. And for any such matrix $M,$ and matrix $T \in \mathbb{H}$ of trace zero, $M^{-1}TM$ also has trace zero. This allows us to think of $M$ as a linear transformation on $\mathbb{R}^{3},$ and as such it is length preserving and has determinant $1$ (this takes a little checking which I omit). To recover $M$ from the rotation of $\mathbb{R}^{3}$ which it induces, we also have to include ${\rm det}(M) = |z|^{2} + |w|^{2},$ for notice that replacing $T$ by a non-zero real positive multiple does not change its effect on the matrix $T.$ This gives a way of describing the quaternions as ordered pairs, the first component being a non-negative real number, and the second being a rotationof $\mathbb{R}^{3},$ but it is easier to think of the multiplication as given by the usual matrix multiplication of complex $2 \times 2$ matrices.

-