How can one intuitively think about quaternions?
Quaternions came up while I was interning not too long ago and it seemed like no one really know how they worked. While eventually certain people were tracked down and were able to help with the issue, it piqued my interest in quaternions.
After reading many articles and a couple books on them, I began to know the formulas associated with them, but still have no clue how they work (why they allow rotations in 3D space to be specific). I back-tracked a little bit and looked at normal complex numbers with just one imaginary component and asked myself if I even understood how they allow rotations in 2D space. After a couple awesome moments of understanding, I understood it for imaginary numbers, but I'm still having trouble extending the thoughts to quaternions.
How can someone intuitively think about quaternions and how they allow for rotations in 3D space?
Solution 1:
Here's one way. The group of unit quaternions is isomorphic to the special unitary group $\text{SU}(2)$, the group of $2 \times 2$ unitary complex matrices with determinant $1$. This group acts on $\mathbb{C}^2$ in the obvious way, and so it also acts on lines in $\mathbb{C}^2$. (These are complex lines, so they have real dimension $2$.) The space of lines in $\mathbb{C}^2$ is the complex projective line $\mathbb{CP}^1$, and it turns out there is a natural way to think about this space as a sphere - namely, the Riemann sphere. There is a beautiful projection which is pictured at the Wikipedia article which shows this; essentially one thinks of $\mathbb{CP}^1$ as $\mathbb{C}$ plus a "point at infinity" and then projects the latter onto the former in a way which misses one point.
So $\text{SU}(2)$ naturally acts on a sphere, and as it turns out it naturally acts by rotations. This describes the famous 2-to-1 map $\text{SU}(2) \to \text{SO}(3)$ which allows quaternions to describe 3D rotations.
Solution 2:
I find the conversion between quaternions and the axis-angle representation quite instructive.
In the axis-angle representation, you describe a rotation by specifying the axis of rotation as a unit vector $\vec\omega$ and an angle $\theta$ about which to rotate around this axis. An interesting fact is that any possible rotation can be described in this way.
The corresponding quaternion is given simply by $\left(\cos(\theta/2), \vec\omega\sin(\theta/2)\right)$. Here the notation $(a, \vec v)$, where $a$ is a scalar and $\vec v$ a real vector, denotes the quaternion $a + v_xi + v_yj + v_zk$, or $(a,v_x,v_y,v_z)$.
Here is the intuitive interpretation of this. Given a particular rotation axis $\omega$, if you restrict the 4D quaternion space to the 2D plane containing $(1,0,0,0)$ and $(0,\omega_x,\omega_y,\omega_z)$, the unit quaternions representing all possible rotations about the axis $\vec \omega$ form the unit circle in that plane. A rotation of $\theta$ about the axis $\vec \omega$ is the point at an angle $\theta/2$ from $(1,0,0,0)$ on that circle. For example, not rotating at all is $(1,0,0,0)$, rotating 180° is $(0,\omega_x,\omega_y,\omega_z)$, and rotating 360° is $(-1,0,0,0)$, which is the same as not rotating at all (see final paragraph).
Multiplying two quaternions is unintuitive, but I'm not bothered by that, because the composition of two rotations in real life is quite unintuitive in the first place.
(Note that the quaternions are a "double cover" of the space of rotations, in that any rotation actually has two quaternions, say $q$ and $-q$, that represent it: $\theta$ and $\theta + 2\pi$ are the same angle, but $\theta/2$ and $(\theta+2\pi)/2$ are not. This is the only "glitch" in the quaternion representation of rotations.)