Complex numbers rotate the plane, quaternions rotate 3D, and dual quaternions rotate and translate at once. A playground for all three, and why conformal geometric algebra subsumes them.
Complex numbers rotate the plane. Quaternions rotate three-dimensional space. Dual quaternions rotate and translate at the same time, and the motion they describe is a screw: a rotation about an axis combined with a slide along that axis.
Each step adds one algebraic idea and removes one geometric headache. Complex multiplication replaces a 2D rotation matrix. Quaternion multiplication replaces a 3D rotation matrix, with no Euler angles and no gimbal lock. A dual quaternion replaces a rotation-plus-translation pair with one object that can be composed and interpolated directly.
The playground below has three tabs: Complex, Quaternion and Dual quaternion. Each one shows the algebra and the geometry at the same time.
The Playground
unit quaternion
rotate a vector
A unit quaternion is a rotor. Composition is multiplication; interpolation is slerp. The quaternion and its negative encode the same rotation.
A few things to try:
- In Complex, move the angle and magnitude sliders. The cyan vector is multiplied by ; the fuchsia vector is . Multiplication is a rotation plus a uniform scale, and the readout shows the corresponding matrix.
- In Quaternion, change the rotation axis and angle. The faint craft is the identity pose, the amber wireframe is the target pose, and the cyan craft is the slerp between them. Slide to watch the interpolation.
- In Dual quaternion, add a translation. The object now rotates and moves. Slide : the path is a helix around the green screw axis, not a straight line with a separate rotation.
- Set the dual-quaternion rotation angle to zero. The motion becomes a pure translation, and the screw axis is the direction of travel.
- Set the translation to zero. The motion becomes a pure rotation, and the screw axis passes through the origin.
- Compare the quaternion and dual-quaternion tabs. The quaternion has three degrees of freedom; the dual quaternion has six.
Complex Numbers: The First Rotor
A complex number is a pair of reals with the rule :
Multiplying two complex numbers is
If , then multiplication by rotates by and scales by . The unit complex numbers, , form the circle group and act as the rotations of the plane. In matrix form,
This is the first example of a rotor: an algebraic object that acts on vectors by conjugation or multiplication, with composition given by the same multiplication. Complex numbers are the even subalgebra of the 2D Clifford algebra ; the bivector plays the role of .
Complex numbers are also the reason 2D conformal maps are so pleasant: a holomorphic function is locally a complex multiplication, hence a rotation and a scale. We explored that in Conformal Maps.
Quaternions: Rotations in Three Dimensions
Hamilton's quaternions extend the complex numbers with three imaginary units:
subject to
The multiplication is associative but not commutative. The conjugate is
and the norm is . A unit quaternion, , encodes a rotation. For a unit axis and an angle ,
To rotate a vector , treat it as the pure quaternion and conjugate:
The result has zero scalar part; its vector part is the rotated vector. The half-angle is not a typo. It is what makes the double cover work: and represent the same rotation, and a full rotation is a path from to , not back to .
Two rotations compose by multiplying their quaternions. Interpolation uses slerp:
where is the angle between the two unit quaternions. Slerp follows the shortest arc on the unit sphere. The playground's slider is exactly this interpolation.
Quaternions are the even subalgebra of the 3D Clifford algebra . The bivectors , , square to and anticommute, just like . A unit quaternion is a rotor; a rotation matrix is what you get if you insist on coordinates.
Dual Quaternions: Rotation and Translation Together
A dual number extends the reals with a nilpotent element:
It is the algebra of the Taylor expansion
and it is the engine behind forward-mode automatic differentiation.
A dual quaternion is a quaternion with quaternion coefficients in the dual numbers:
The real part is a rotation quaternion. The dual part carries the translation. For a translation vector ,
where is treated as the pure quaternion . The unit conditions are
A point is embedded as , and the rigid transform is
Expanding this gives the familiar rotation-plus-translation formula:
The translation can also be read directly from the dual part:
This is the whole trick. A dual quaternion is not a rotation and a translation stored side by side; it is one unit object whose multiplication composes rigid transforms and whose interpolation moves the object along a screw.
The Screw Axis
Chasles' theorem says every rigid motion in 3D is a rotation about some axis plus a translation along that axis. That axis is the screw axis, and the ratio of axial translation to rotation angle is the pitch.
Given a unit dual quaternion, the screw parameters are:
where and . The translation is . Decompose it into
Then
where is the point on the screw axis closest to the origin. The transform after fraction of the motion is a rotation by about the axis through , plus a translation along .
That is what the playground draws: the green line is the screw axis, the orange path is the helix traced by the nose of the craft, and the pitch readout is . When the rotation angle is zero, the axis is at infinity and the motion is a pure translation. When the translation is zero, the pitch is zero and the motion is a pure rotation.
Dual quaternions are used for rigid-motion interpolation, character skinning, hand-eye calibration and robot trajectory blending. They avoid the shrinking and candy-wrapper artifacts of naive matrix blending, and they keep every interpolated transform rigid.
Quaternions Are Clifford Algebra in Disguise
The pattern is not a coincidence.
| Algebra | Signature | What it describes |
|---|---|---|
| Complex numbers | 2D rotations and scales | |
| Quaternions | 3D rotations | |
| Dual quaternions | quaternions plus dual numbers | rigid motions and screws |
| Conformal geometric algebra | points, spheres, planes, circles, lines, intersections, rotors |
Complex numbers are the even part of the 2D Clifford algebra. Quaternions are the even part of the 3D Clifford algebra. Dual quaternions combine quaternions with a nilpotent direction. Each is a different specialization of the same geometric product.
Conformal Geometric Algebra: One Algebra to Hold Them All
Quaternions and dual quaternions are excellent when the problem is rotation or rigid motion. Conformal geometric algebra (CGA) takes a different approach: it embeds 3D Euclidean space in a 5D space with signature , and then represents everything with the same product.
In CGA:
- points are null vectors,
- circles, lines, spheres and planes are blades,
- intersections are meets,
- rotations and translations are rotors.
There is no separate translation vector and no dual-unit constraint. A point is , and a rigid motion is a rotor acting by . The same meet operation that intersects two spheres also intersects a line with a plane. The same algebra that rotates a vector translates a point.
The price is dimension and bookkeeping. The reward is one vocabulary for geometry, motion and intersection. Quaternions and dual quaternions are the fast, compact tools for rotations and rigid motions; CGA is the larger language that subsumes these constructions under one notation.
The companion article Conformal Clifford Algebra builds the 5D model from scratch, with a playground for N-joint inverse kinematics and sphere/plane/circle intersections. It is the natural next step after dual quaternions.
Further Reading
- William Rowan Hamilton, Lectures on Quaternions — the original, surprisingly readable source.
- Andrew Hanson, Visualizing Quaternions — the best geometric intuition for quaternion curves and frames.
- Ken Shoemake, Animating Rotation with Quaternion Curves — the paper that brought slerp to computer graphics.
- Ladislav Kavan et al., Dual Quaternions for Rigid Transformation Blending — the standard reference for dual-quaternion skinning.
- Leo Dorst, Daniel Fontijne and Stephen Mann, Geometric Algebra for Computer Science — how quaternions, dual numbers and CGA fit into one Clifford algebra.
- The Conformal Clifford Algebra article on this site.
Related Articles
Conformal Clifford Algebra: Points, Rotors and a Robot Arm
Embed 3D geometry in a 5D Clifford algebra where points, circles, spheres, planes and lines are all blades. A playground for N-joint inverse kinematics, curve and surface intersections.
Conformal Maps: When Complex Functions Preserve Angles
A conformal map preserves angles: near every point it behaves like a rotation followed by a uniform scaling. Explore them in a playground that warps grids and images — written with complex numbers, 2D vectors, and dual numbers.
Automatic Differentiation
A deep-dive into automatic differentiation: symbolic vs. numerical vs. AD, AST transformation, dual numbers, tapes, hybrid methods, and a generic C++ implementation that computes gradients and solves optimisation problems.

Hamilton: A Phase-Space Playground
Type a Hamiltonian or Lagrangian, integrate it in the browser, and watch an entire phase space evolve. A WebGL2 playground with RK4, symbolic derivatives and 21 built-in systems.