Quaternion Multiplication
Quaternions: A Visual and Conceptual Guide
Introduction to Quaternions
Quaternions are a four-dimensional extension of the complex numbers, analogous to how complex numbers extend the real numbers. They were discovered by the Irish mathematician William Rowan Hamilton on October 16, 1843, while crossing the Broom Bridge in Dublin. Hamilton sought a three-dimensional number system but realized he needed to add three imaginary dimensions (i, j, k) to the real numbers, forming a four-dimensional system.
Definition: A quaternion is an expression of the form q=a+bi+cj+dk, where a,b,c,d are real numbers, and i,j,k are imaginary units satisfying i2=j2=k2=ijk=−1.
The story of Hamilton's discovery is famous: his son would ask daily if he had figured out how to divide triples; Hamilton always said no. The breakthrough came when he realized that a three-dimensional system was impossible, but a four-dimensional one worked. He carved the fundamental equation i2=j2=k2=ijk=−1 into the bridge, now commemorated by a plaque.
Historical Context and Controversy
At the time of Hamilton's discovery, the modern notion of vectors (dot product, cross product) did not exist. Hamilton promoted quaternions as the primary language for describing three-dimensional space, even forming a "Quaternion Society." This sparked a fierce debate with mathematicians who found quaternion multiplication unnecessarily complicated — leading to "old-timey trash talk" calling them evil. The Mad Hatter scene in Alice in Wonderland (by Oxford mathematician Charles Dodgson) is thought to parody quaternion multiplication's chaotic, non-commutative nature.
Analogy: Explaining Complex Numbers to a One-Dimensional Being (Linus the Linelander)
To build intuition for quaternions, we first imagine explaining complex numbers to a being who only understands one dimension — a "Linelander" named Linus.
Algebraic Definition
Complex numbers are defined algebraically as z=a+bi, with i2=−1. Multiplication uses the distributive property (FOIL) and the rule i⋅i=−1. This works but misses geometric insight.
Geometric Action
For a two-dimensional observer, multiplying two complex numbers z×w can be seen as z acting as a function on w: rotating and stretching the plane. Fix zero with one hand; drag the point at 1 to z with the other. This uniquely defines the transformation.
Stereographic Projection
To show rotation to Linus, we use stereographic projection to map the unit circle (points ∣z∣=1) onto a line. For each point on the circle, draw a line from −1 through that point; its intersection with the vertical line through the center gives the projected point.
1 projects to the center.
i and −i stay fixed.
The arc from 1 to i maps to the segment between 1 and i on the line.
The arc from i to −1 maps to points farther and farther away; −1 itself has no projection and is considered the point at infinity.
Linus sees only the unit circle projected. Multiplication by i (a 90° rotation) becomes a strange morphing action on the line:
i×1=i: point 1 moves to i.
i×i=−1: i slides off to infinity.
i×(−1)=−i: infinity comes back from below to −i.
i×(−i)=1: −i slides up to 1.
Repeating i4=1 shows four 90° rotations return to start. This core idea — projecting a sphere to a lower dimension — is key to visualizing quaternions.
Analogy: Explaining 3D Rotations to a Two-Dimensional Being (Felix the Flatlander)
Next, we extend the analogy by imagining a being who only understands two dimensions — Felix the Flatlander. We attempt to explain rotations of a sphere.
Extending Complex Numbers
Imagine adding a third axis j, perpendicular to the complex plane, so every point in 3D space is a+bi+cj. However, it is impossible to define a consistent multiplication for 3D numbers. (Hamilton realized this, which is why quaternions need four dimensions.)
Stereographic Projection of the Sphere
The unit sphere (points ∣q∣=1 in 3D) is projected onto the plane (the ij-plane) using stereographic projection from the south pole −1:
1 (north pole) maps to the center.
The equator (circle through i,j,−i,−j) stays fixed — this is the only unaltered part of the sphere.
Northern hemisphere maps inside the unit circle; southern hemisphere maps outside.
−1 again maps to the point at infinity.
Felix sees a warped 2D view of the sphere. A 90° rotation about the j-axis moves 1→i→−1→−i→1, extending Linus's line action to a plane. A rotation about the i-axis similarly transforms the ij unit circle into the 1i circle. Rotations about the real axis simply rotate the whole projection.
Key insight: Lines in Felix's view correspond to circles on the sphere that pass through −1. This analogy prepares us for visualizing quaternions in 4D.
Quaternion Basics
Definition and Components
A quaternion q is written as q=a+bi+cj+dk, where a is the real (scalar) part and bi+cj+dk is the imaginary (vector) part. Hamilton coined the term vector for quaternions with zero real part.
Multiplication Rules
The imaginary units obey:
i2=j2=k2=−1
ij=k, jk=i, ki=j
ji=−k, kj=−i, ik=−j
ijk=−1
Multiplication is distributive and associative but not commutative (order matters). This compact algebraic definition is what makes quaternions efficient for computer graphics: representing a rotation as a quaternion product uses only a few arithmetic operations, unlike matrix multiplication.
Magnitude
The magnitude (norm) of a quaternion is ∣q∣=a2+b2+c2+d2. Multiplying two quaternions scales the second by the magnitude of the first and then applies a special four-dimensional rotation.
Unit Quaternions and Pure Rotations
Quaternions with ∣q∣=1 are unit quaternions; their multiplication corresponds to pure rotation (no scaling) in 4D space. Understanding these rotations is the heart of the visualization.
Visualizing the 4D Hypersphere of Unit Quaternions
Unit quaternions form a hypersphere (a 3-sphere) in 4D space. We cannot see 4D directly, but we can stereographically project this hypersphere into 3D space, just as we projected the 2-sphere into 2D for Felix.
Stereographic Projection of the Hypersphere
Project from the point −1 (on the real axis, perpendicular to our 3D space) onto our 3D space (the ijk-space):
1 projects to the center of our 3D view.
The unit sphere i,j,k (all points with real part 0) stays fixed — this is the only unaltered part of the hypersphere. It appears as a unit sphere in our 3D space.
Unit quaternions with positive real part (between 0 and 1) appear inside this sphere.
Unit quaternions with negative real part appear outside.
−1 maps to the point at infinity in 3D (any direction leads there).
Important: All points in this projection represent unit quaternions — they all have the same distance from 0. The point 0 itself is invisible here. Also, lines or planes in 3D correspond to spheres on the hypersphere that pass through −1.
Double Rotation in 4D
A unit quaternion q acting by left multiplication on any other quaternion w corresponds to a double rotation in 4D: two simultaneous, perpendicular 2D rotations that are synchronized to ensure rigid motion of the hypersphere.
First rotation: occurs in the plane containing 1 and q (and −1). In the projection, this appears as a line through the origin. The action rotates the 1-q circle so that 1 moves to q.
Second rotation: occurs in the perpendicular plane (a plane orthogonal to the first). This plane is represented in the projection by the unit sphere fixed under projection. The rotation in this perpendicular plane follows a right-hand rule.
Right-Hand Rule for Left Multiplication
To determine the direction of rotation in the perpendicular plane:
Point your right thumb from 1 to q (the direction of the first rotation).
The curl of your fingers gives the direction of rotation in the perpendicular circle.
Example: Multiplication by i (left multiplication):
First rotation: the circle through 1 and i (projected as a line) rotates: 1→i, i→−1 (off to infinity), −1→−i, −i→1.
Perpendicular circle: the circle through j and k. Using the right-hand rule (thumb from 1 to i), this circle rotates: j→k, k→−j, −j→−k, −k→j.
Full effect: i⋅j=k, i⋅k=−j, etc.
Example: Multiplication by j (left multiplication):
First rotation: circle through 1 and j (line): 1→j, j→−1.
Perpendicular circle through i and k: right-hand rule (thumb from 1 to j) gives i→−k, k→i.
So j⋅i=−k, j⋅k=i.
General Procedure for Left Multiplication by Any Unit Quaternion q:
Draw the line through 1 and q in the projection (the 1-q circle).
Identify the perpendicular circle (the unit sphere).
Rotate the first circle so 1 goes to q.
Rotate the perpendicular circle by the same angle, following the right-hand rule with thumb from 1 to q.
Non-Commutativity and Right Multiplication
Quaternion multiplication is non-commutative: q1⋅q2=q2⋅q1 in general. For example, i⋅j=k but j⋅i=−k.
Left vs. Right Multiplication
Left multiplication by q: q acts as a function transforming all space. The right-hand rule applies.
Right multiplication by q (e.g., w⋅q): we can think of q acting on w from the right. In this case, the rule changes: use your left hand instead.
For right multiplication by q, the procedure is:
Rotate the 1-q circle so 1 goes to q (same as before).
Rotate the perpendicular circle by the same angle, but using the left-hand rule (thumb from 1 to q, fingers curl the direction).
This asymmetry is essential for understanding how unit quaternions describe 3D rotations via a process called conjugation (not covered in detail here, but previewed below).
Connection to 3D Rotations
It might seem that left multiplication by a unit quaternion does not leave the 3D ijk-sphere (the unit sphere of pure quaternions) invariant — it morphs it. However, 3D rotations are actually described by a conjugation operation: p↦qpq−1, where q is a unit quaternion and p is a pure quaternion (vector). This double-sided multiplication ensures the result stays on the ijk-sphere and corresponds to a 3D rotation.
The detailed mechanics of conjugation will be covered in a follow-up video. For now, the key insight is that the visualization of quaternion multiplication as a double rotation in 4D provides the intuitive foundation for understanding those formulas.
Practical Importance
Quaternions are widely used in computer graphics, robotics, and aerospace for representing orientations and rotations because:
They avoid gimbal lock (a problem with Euler angles).
They are computationally efficient (a quaternion product uses fewer operations than a 3×3 matrix multiplication).
They allow smooth interpolation (slerp) for animations.
In quantum mechanics, quaternions also appear in the description of two-state systems like electron spin and photon polarization, due to the underlying double-rotation symmetry.
Summary of Key Concepts
Quaternions are 4D numbers: a+bi+cj+dk with i2=j2=k2=ijk=−1.
Unit quaternions (∣q∣=1) correspond to pure rotations in 4D.
Stereographic projection maps the 4D hypersphere into 3D, making the geometry visualizable.
Left multiplication by a unit quaternion involves two synchronized perpendicular 2D rotations, with a right-hand rule.
Right multiplication uses a left-hand rule.
Non-commutativity is inherent and crucial for representing 3D rotations via conjugation.
This geometric intuition makes the otherwise mysterious algebraic rules of quaternion multiplication feel natural and inevitable.

Ask anything
We've read this whole study set, so questions about it get the best answers.