A quaternion is a number of the form
where are real numbers and the units satisfy
Quaternions form a four-dimensional associative algebra, denoted , in which every nonzero element has a multiplicative inverse. Unlike real and complex numbers, their multiplication is not commutative: for example, , whereas . They are therefore a division algebra rather than a field in the usual commutative sense.
Discovered by William Rowan Hamilton in 1843, quaternions helped establish that useful systems of arithmetic need not obey every familiar law of ordinary numbers. Their most widespread computational role is the representation of rotations in three-dimensional space. Unit quaternions describe orientation compactly, compose rotations through multiplication, and support smooth interpolation without the coordinate singularities of three-angle descriptions. Beyond this role, quaternions connect linear algebra, geometry, number theory, and the study of continuous symmetry.
Algebraic definition and arithmetic
As a real vector space, has the basis . Addition and multiplication by real scalars are performed componentwise. Quaternion multiplication is determined by distributivity, associativity, and the table
Thus the order of multiplication matters even for the simplest imaginary units. For example,
whereas reversing the factors changes the sign of the -component. Real numbers commute with every quaternion, but general quaternions do not.
The real, or scalar, part of is ; its imaginary, or vector, part is . Writing , with , makes multiplication especially transparent:
Here is the dot product, and is the cross product in an oriented three-dimensional Euclidean space. For purely imaginary quaternions, this becomes
The scalar part measures alignment, while the vector part records an oriented perpendicular component. This identity explains much of the connection between quaternion multiplication and spatial geometry.
Quaternion conjugation reverses the imaginary part:
It reverses the order of products,
and gives the squared norm
The norm is the ordinary Euclidean length of the four real coordinates. Its decisive algebraic property is multiplicativity:
Consequently, the product of two nonzero quaternions cannot be zero, and every nonzero quaternion has the inverse
This proves directly that is a division algebra.
Division nevertheless requires specifying a side. If , the equation has solution , while has solution . These expressions generally differ. Likewise, cancellation is valid, but factors cannot be rearranged arbitrarily.
The quaternions commuting with every element of are precisely the real scalars. Two individual quaternions commute exactly when their imaginary parts are linearly dependent, including the case in which one imaginary part is zero. Thus commutative complex arithmetic appears inside quaternion arithmetic, but no single complex plane contains all quaternions.
Hamilton’s discovery and the development of vector methods
Hamilton developed quaternions while seeking an extension of complex-number arithmetic suitable for three-dimensional geometry. Complex numbers already offered a successful model: multiplication by a unit complex number represents a rotation in a plane. Hamilton tried to construct an analogous arithmetic of triples, with a multiplication compatible with a Euclidean norm. The successful construction required four components rather than three and required abandoning commutativity.
On 16 October 1843, while walking near Brougham Bridge, now generally called Broom Bridge, in Dublin, Hamilton recognized the multiplication relations
He later described carving these relations into a stone of the bridge. His account made the event one of the best-known discovery episodes in the history of algebra. The important mathematical step was not merely adding an additional coordinate: it was accepting a coherent number system in which the order of factors changes the product.
Hamilton developed the subject in Lectures on Quaternions in 1853. His Elements of Quaternions appeared posthumously in 1866. He used the terms “scalar” and “vector” for the two parts of a quaternion and sought to make quaternion methods a general language for geometry and mathematical physics. Peter Guthrie Tait became a major advocate, publishing An Elementary Treatise on Quaternions in 1867 and applying quaternion techniques to physical problems.
During the later nineteenth century, Josiah Willard Gibbs and Oliver Heaviside developed vector methods that separated three-dimensional vectors from the full quaternion algebra. In modern notation, the dot and cross products preserve two distinct parts of the product of imaginary quaternions. Vector analysis became the more common language of electromagnetism and continuum mechanics because many calculations required these operations without needing arbitrary quaternion products. Quaternion terminology and notation consequently lost some of their early prominence in physics education.
The mathematical significance of Hamilton’s discovery extended beyond the competition between notational systems. Quaternions supplied a concrete, geometrically meaningful example of noncommutative arithmetic and contributed to the emergence of abstract algebra. They also provided a normed multiplication in four dimensions, connecting algebraic identities with sums of squares.
In the twentieth century, quaternions acquired a renewed practical importance in spacecraft attitude calculations, robotics, and computer graphics. These applications use a narrower but particularly effective part of Hamilton’s system: the multiplication of unit quaternions as a representation of rotation composition. Their modern role does not depend on replacing ordinary vector analysis. Instead, vector coordinates and quaternion orientations are routinely used together, with each representation serving a different computational purpose.
Matrix models and structural classification
Quaternions can be represented faithfully by complex matrices. Write
where the chosen complex plane is generated by and . The relation
encodes the failure of to commute with complex scalars. Define
Then
so quaternion multiplication becomes ordinary matrix multiplication. The representation is injective, allowing algebraic questions about quaternions to be translated into questions about a special family of complex matrices.
The determinant and trace are
Moreover,
where the asterisk denotes conjugate transpose. Unit quaternions therefore correspond exactly to complex unitary matrices with determinant one. This matrix group is denoted . The determinant formula is also another proof of norm multiplicativity, since determinants multiply.
A real matrix model comes from left multiplication. For a fixed , the map is a real linear map on , represented by
It satisfies
Thus multiplication by a unit quaternion is an orientation-preserving isometry of four-dimensional Euclidean space. This action should be distinguished from the three-dimensional rotation action, which uses multiplication on both sides.
Quaternions occupy a special place in classification results. Frobenius’s theorem states that every finite-dimensional associative real division algebra with identity is isomorphic to , , or . The assumptions are essential: removing associativity admits further examples, and replacing division algebras by more general algebras greatly expands the possibilities.
A related theorem classifies finite-dimensional real unital composition algebras with positive-definite norm: their possible dimensions are and . The familiar examples are the reals, complex numbers, quaternions, and octonions. Quaternions retain associativity but lose commutativity; octonions lose associativity as well.
Quaternionic vector spaces require a corresponding distinction between left and right scalar multiplication. For example, a right quaternionic vector space satisfies . Matrices over can represent linear maps, but scalar order must remain explicit. Even eigenvalue equations have left and right versions, and their theory cannot be obtained simply by replacing complex entries with quaternion entries in every formula.
Three-dimensional rotations
Identify a vector with the imaginary quaternion
For a unit quaternion , define
The result remains purely imaginary, and its norm equals that of . The map is real-linear and is an orientation-preserving rotation of three-dimensional space. Every such rotation arises in this way.
Let be a unit imaginary quaternion representing a rotation axis. A rotation through angle , with the usual right-handed convention, is represented by
The half-angle is fundamental. The spatial action involves both and its inverse, so the quaternion parameter traverses only half the corresponding spatial angle. Expanding the product gives Rodrigues’s formula:
The component parallel to the axis is unchanged; the perpendicular component rotates in its plane.
For example, a quarter-turn about the positive -axis is represented by
Direct multiplication gives
so the positive -direction moves to the positive -direction. Reversing the conjugation order produces the inverse rotation. This difference explains why formulas from sources using different conventions may appear inconsistent even when each is internally correct.
Rotation composition follows directly from associativity:
Under this convention, applying first and then corresponds to the product . Since rotations about different axes generally do not commute, quaternion noncommutativity expresses a geometric fact rather than a computational inconvenience.
For of unit norm, the corresponding rotation matrix acting on column vectors is
Its columns are orthonormal and its determinant is . Four stored components therefore encode a rotation that would otherwise require nine matrix entries subject to six independent orthogonality constraints.
The representation is not one-to-one: and produce exactly the same rotation. Unit quaternions also satisfy one constraint, , leaving three continuous degrees of freedom. Thus quaternions do not add a physical degree of freedom to orientation. They replace a minimal three-coordinate description with a constrained four-coordinate description that avoids many local-coordinate difficulties.
Unit quaternions, Lie groups, and topology
The unit quaternions form a group under multiplication and, as a subset of , form the three-dimensional sphere
Multiplication and inversion are smooth, making this a Lie group. The complex matrix representation identifies it with . Its smooth manifold dimension is three, despite its realization using four real coordinates.
The rotation action gives a surjective group homomorphism
where is the group of orientation-preserving orthogonal transformations of . Its kernel is . Consequently, the rotation group is obtained by identifying antipodal points of :
This quotient is real projective three-space. The map is a two-sheeted covering map, meaning that each rotation has two quaternion representatives and that locally either representative gives a faithful parametrization.
The topology explains a distinctive feature of rotation paths. A continuous rotation through about a fixed axis starts and ends at the same spatial orientation, but its lift to unit quaternions runs from to . A rotation through returns the lifted path to . The sphere is simply connected, whereas the fundamental group of has two elements. A full rotation represents the nontrivial loop class, while traversing that loop twice gives the trivial class.
This structure is important in the representation theory underlying angular momentum in quantum mechanics. Spinor representations can be representations of that do not descend to ordinary single-valued representations of . In a spin- representation, the group element corresponding to a rotation acts as minus the identity. The relationship concerns how rotations act on states, not a claim that ordinary spatial vectors require to return to their original directions.
A second geometric construction is the Hopf fibration. Fix the unit imaginary quaternion and define
for . Its values lie on the unit two-sphere of imaginary quaternions. Each fiber is a circle: multiplying on the right by leaves unchanged. Distinct fibers form linked circles in . The construction connects quaternion multiplication with fiber bundles and illustrates why spheres can carry structures not apparent from their coordinate equations alone.
Exponentials, roots, and quaternionic analysis
The quaternion exponential function is defined by the convergent power series
Writing , with imaginary and , gives
when , and when . The derivation uses , so even and odd powers separate into cosine and sine series. Exponentials of imaginary quaternions are unit quaternions, explaining the axis–angle rotation formula.
Every nonzero quaternion can be written
for a unit imaginary . This yields quaternion logarithms
with additional freedom in the axis when is real. For a negative real number, every unit imaginary axis supplies a logarithm with the appropriate odd multiple of . As with complex logarithms, choosing a single-valued branch requires restrictions. Unlike the scalar real identity, does not generally hold unless and commute.
Polynomial equations behave differently from their real and complex counterparts. The equation
has every unit imaginary quaternion as a solution, giving an entire two-sphere of roots. For polynomials with quaternion coefficients, it also matters whether coefficients are placed on the left or right, because they need not commute with the variable. Familiar conclusions that bound the number of roots solely by polynomial degree therefore require careful qualification.
Differentiation presents an even sharper distinction. A direct analogue of complex differentiability, requiring a direction-independent quaternion difference quotient in all four real directions, is highly restrictive. Quaternionic function theories instead adopt differential equations or notions of regularity adapted to the algebra.
One influential approach is Fueter regularity, developed by Rudolf Fueter in the 1930s. A left-regular function satisfies
with the units acting on the left. If
then is the four-dimensional Laplacian. Regular functions therefore have harmonic real components.
Another approach, slice regularity, studies restrictions to complex planes , where . It includes quaternion power series and supports a substantial analogue of complex analysis. These theories have different definitions and function classes; neither is simply complex analysis with three imaginary symbols substituted for one.
Interpolation, angular velocity, and numerical computation
Unit quaternions are especially useful when orientation must vary smoothly over time. Given two unit quaternions , define their four-dimensional inner product by
Because opposite quaternions encode the same orientation, one usually replaces by if this inner product is negative. This selects representatives whose connecting arc on has length at most , corresponding to a shortest spatial rotation of at most .
For , spherical linear interpolation, or slerp, is
It follows a great-circle arc at constant speed on , giving constant angular speed for the corresponding rotation. Ken Shoemake’s 1985 paper “Animating Rotation with Quaternion Curves” helped establish quaternion interpolation in computer animation.
When is small, direct evaluation of the sine ratios can be numerically inconvenient. A common approximation is normalized linear interpolation:
After consistent sign selection, this follows the same short great-circle arc but generally does not traverse it at constant angular speed. Interpolating a sequence of orientations requires more than separate pairwise arcs if continuity of angular velocity or acceleration is desired; quaternion spline constructions address those higher-order conditions.
Angular velocity also has a compact quaternion expression. Suppose maps body-frame vectors to spatial-frame vectors by . Represent angular velocity as an imaginary quaternion. If is expressed in spatial coordinates, then
If is expressed in body coordinates, then
The multiplication side is essential. It follows from whether the incremental rotation is applied before or after the current orientation transformation.
Numerical integration with floating-point arithmetic can make drift from one. Implementations may renormalize the quaternion or use exponential updates that preserve unit length in exact arithmetic. For constant body-frame angular velocity over a step,
This update captures the exact rotation under that assumption.
Orientation comparisons must likewise respect the sign ambiguity. For unit quaternions, a standard angular discrepancy is
Roundoff may require clamping the inner-product magnitude to the interval . Ordinary componentwise differences do not define a reliable global orientation error: two opposite coordinate vectors can represent precisely the same attitude.
Applications in mechanics, graphics, and robotics
In aerospace engineering, attitude is the orientation of a vehicle relative to a reference frame. Quaternion kinematic equations permit attitude propagation from gyroscope measurements without introducing the singularities associated with Euler angles. In a three-angle representation, certain configurations make two nominal rotation axes coincide, a phenomenon called gimbal lock. Unit quaternions avoid that coordinate singularity, although they still require a norm constraint and a choice between two equivalent signs.
Robotic systems use quaternions for the orientations of tools, cameras, mobile platforms, and articulated links. A complete rigid pose contains both a rotation and a translation. Quaternions encode only the rotational part; a separate translation vector or a larger transformation representation is necessary. In optimization and state estimation, orientations are often stored globally as unit quaternions while small corrections are represented by three-component rotation vectors. This matches the three local degrees of freedom without requiring unrestricted optimization over four independent coordinates.
Computer graphics uses quaternion products to combine camera and object orientations and quaternion interpolation to construct motion between keyframes. Rotations are frequently converted to matrices for the final transformation of large numbers of vertices, because matrix operations fit established graphics pipelines. Quaternions and matrices are thus complementary: one representation is convenient for storing and interpolating orientation, while the other is convenient for applying a common transformation to many points.
Dual quaternions extend the representation to rigid motions. They use a commuting symbol satisfying and have the form
If is a unit rotation quaternion and is an imaginary quaternion representing translation, a common convention is
The associated rigid motion is . Under consistent conventions, dual-quaternion multiplication composes these motions. The rotation and translation data satisfy both a unit-norm condition and a compatibility condition.
Dual-quaternion blending is used in character skinning, where vertices are influenced by several moving skeletal links. Compared with directly averaging transformation matrices, it can reduce characteristic volume-loss artifacts, such as excessive collapse under twisting. Weighted sums still require suitable normalization and sign handling; averaging representations is not automatically the same as averaging rigid motions.
Quaternion-valued methods also occur in signal processing, color-image analysis, and quaternion-valued neural networks. Their attraction is the ability to couple several real channels through a structured multiplication. Four real channels can be packaged into one quaternion, but the multiplication imposes particular interactions among them. Whether those interactions are useful depends on the model and task; quaternion notation alone does not establish a computational or statistical advantage.
Quaternion integers and related algebras
Quaternion arithmetic has a substantial integral theory. The Lipschitz integers are quaternions whose four coordinates are integers. A larger and especially useful ring is the ring of Hurwitz integers:
where the coordinates are either all integers or all half-integers in . This set is closed under addition and multiplication. The second coordinate class is essential to its particularly effective division and factorization properties.
The norm of a Hurwitz integer is a nonnegative integer, and norms multiply. Its units are exactly the 24 elements of norm one: the eight quaternions
and the sixteen quaternions
with independent sign choices. Under multiplication they form the binary tetrahedral group. The Hurwitz ring admits left and right Euclidean division with respect to its norm, providing quaternionic versions of algorithms for greatest common divisors. Because multiplication is noncommutative, left and right divisibility must be kept distinct.
Norm multiplicativity yields Euler’s four-square identity: the product of two sums of four squares is another sum of four squares. Quaternion multiplication supplies the four resulting bilinear expressions at once. This identity is central to quaternionic treatments of Lagrange’s four-square theorem, which states that every nonnegative integer is a sum of four integer squares. The theorem was proved in 1770, decades before Hamilton’s discovery; quaternions subsequently supplied an organizing algebraic framework for its arithmetic.
A broader quaternion algebra over a field of characteristic not equal to two is defined by generators satisfying
where are nonzero. It has basis . Hamilton’s quaternions correspond to and . Depending on the field and parameters, a quaternion algebra may be a division algebra or may be isomorphic to the matrix algebra .
Over the reals, the split quaternion algebra is isomorphic to and contains nonzero elements with zero norm, unlike . Over the complex numbers, Hamilton’s algebra becomes split after extension of scalars:
Thus the division property depends on the underlying scalar field.
Quaternions also appear within Clifford algebras, which encode quadratic forms through multiplication relations. The even subalgebra of the Euclidean three-dimensional Clifford algebra is isomorphic to . In that setting, unit quaternions are rotors: algebraic objects that act on vectors by a two-sided product. This construction places the familiar quaternion rotation formula within a framework that extends systematically to other dimensions and signatures.