The quaternions are members of a noncommutative division algebra first invented by William Rowan Hamilton. The idea for quaternions occurred to him while he was walking along the Royal Canal on his way to a meeting of the Irish Academy, and Hamilton was so pleased with his discovery that he scratched the fundamental formula of quaternion algebra,


into the stone of the Brougham bridge (Mishchenko and Solovyov 2000). The set of quaternions is denoted H, H, or Q_8, and the quaternions are a single example of a more general class of hypercomplex numbers discovered by Hamilton. While the quaternions are not commutative, they are associative, and they form a group known as the quaternion group.

By analogy with the complex numbers being representable as a sum of real and imaginary parts, a·1+bi, a quaternion can also be written as a linear combination


The quaternion a+bi+cj+dk is implemented as Quaternion[a, b, c, d] in the Wolfram Language package Quaternions` where however a, b, c, and d must be explicit real numbers. Note also that NonCommutativeMultiply (i.e., **) must be used for multiplication of these objects rather than usual multiplication (i.e., *).

A variety of fractals can be explored in the space of quaternions. For example, fixing j=k=0 gives the complex plane, allowing the Mandelbrot set. By fixing j or k at different values, three-dimensional quaternionic fractals have been produced (Sandin et al. , Meyer 2002, Holdaway 2006).

The quaternions can be represented using complex 2×2 matrices

 H=[z w; -w^_ z^_]=[a+ib c+id; -c+id a-ib],

where z and w are complex numbers, a, b, c, and d are real, and z^_ is the complex conjugate of z.

Quaternions can also be represented using the complex 2×2 matrices

U=[  1   0;   0   1]
I=[  i   0;   0  -i]
J=[  0   1;  -1   0]
K=[  0   i;   i   0]

(Arfken 1985, p. 185). Note that here U is used to denote the identity matrix, not I. The matrices are closely related to the Pauli matrices sigma_x, sigma_y, and sigma_z combined with the identity matrix.

From the above definitions, it follows that


Therefore I, J, and K are three essentially different solutions of the matrix equation


which could be considered the square roots of the negative identity matrix. A linear combination of basis quaternions with integer coefficients is sometimes called a Hamiltonian integer.

In R^4, the basis of the quaternions can be given by

i=[ 0  1  0  0; -1  0  0  0;  0  0  0  1;  0  0 -1  0]
j=[ 0  0  0 -1;  0  0 -1  0;  0  1  0  0;  1  0  0  0]
k=[ 0  0 -1  0;  0  0  0  1;  1  0  0  0;  0 -1  0  0]
1=[ 1  0  0  0;  0  1  0  0;  0  0  1  0;  0  0  0  1].

The quaternions satisfy the following identities, sometimes known as Hamilton's rules,


They have the following multiplication table.


The quaternions +/-1, +/-i, +/-j, and +/-k form a non-Abelian group of order eight (with multiplication as the group operation).

The quaternions can be written in the form


The quaternion conjugate is given by


The sum of two quaternions is then


and the product of two quaternions is


The quaternion norm is therefore defined by


In this notation, the quaternions are closely related to four-vectors.

Quaternions can be interpreted as a scalar plus a vector by writing


where a=[a_2a_3a_4]. In this notation, quaternion multiplication has the particularly simple form


Division is uniquely defined (except by zero), so quaternions form a division algebra. The inverse (reciprocal) of a quaternion is given by


and the norm is multiplicative


In fact, the product of two quaternion norms immediately gives the Euler four-square identity.

A rotation about the unit vector n^^ by an angle theta can be computed using the quaternion


(Arvo 1994, Hearn and Baker 1996). The components of this quaternion are called Euler parameters. After rotation, a point p=(0,p) is then given by


since n(q)=1. A concatenation of two rotations, first q_1 and then q_2, can be computed using the identity


(Goldstein 1980).

See also

Biquaternion, Cayley-Klein Parameters, Complex Number, Division Algebra, Euler Parameters, Four-Vector, Hamiltonian Integer, Hypercomplex Number, Octonion, Quaternion Conjugate, Quaternion Group, Quaternion Norm Explore this topic in the MathWorld classroom

Explore with Wolfram|Alpha


Altmann, S. L. Rotations, Quaternions, and Double Groups. Oxford, England: Clarendon Press, 1986.Arfken, G. Mathematical Methods for Physicists, 3rd ed. Orlando, FL: Academic Press, 1985.Arvo, J. Graphics Gems II. New York: Academic Press, pp. 351-354 and 377-380, 1994.Baker, A. L. Quaternions as the Result of Algebraic Operations. New York: Van Nostrand, 1911.Conway, J. H. and Guy, R. K. The Book of Numbers. New York:Springer-Verlag, pp. 230-234, 1996.Conway, J. and Smith, D. On Quaternions and Octonions. Wellesley, MA: A K Peters, 2001.Crowe, M. J. A History of Vector Analysis: The Evolution of the Idea of a Vectorial System. New York: Dover, 1994.Dickson, L. E. Algebras and Their Arithmetics. New York: Dover, 1960.Downs, L. "CS184: Using Quaternions to Represent Rotation." Val, P. Homographies, Quaternions, and Rotations. Oxford, England: Oxford University Press, 1964.Ebbinghaus, H. D.; Hirzebruch, F.; Hermes, H.; Prestel, A; Koecher, M.; Mainzer, M.; and Remmert, R. Numbers. New York:Springer-Verlag, 1990.Goldstein, H. Classical Mechanics, 2nd ed. Reading, MA: Addison-Wesley, p. 151, 1980.Hamilton, W. R. Lectures on Quaternions: Containing a Systematic Statement of a New Mathematical Method. Dublin: Hodges and Smith, 1853.Hamilton, W. R. Elements of Quaternions. London: Longmans, Green, 1866.Hamilton, W. R. The Mathematical Papers of Sir William Rowan Hamilton. Cambridge, England: Cambridge University Press, 1967.Hardy, A. S. Elements of Quaternions. Boston, MA: Ginn, Heath, & Co., 1881.Hardy, G. H. and Wright, E. M. "Quaternions." §20.6 in An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, pp. 303-306, 1979.Hearn, D. and Baker, M. P. Computer Graphics: C Version, 2nd ed. Englewood Cliffs, NJ: Prentice-Hall, pp. 419-420 and 617-618, 1996.Holdaway, L. "Quaternion Traversal." 2006., D. "Three-Dimensional Fractals (Quaternionic Fractals)." Nov. 10, 2002., C. J. A Manual of Quaternions. London: Macmillan, 1905.Julstrom, B. A. "Using Real Quaternions to Represent Rotations in Three Dimensions." UMAP Modules in Undergraduate Mathematics and Its Applications, Module 652. Lexington, MA: COMAP, Inc., 1992.Kelland, P. and Tait, P. G. Introduction to Quaternions, 3rd ed. London: Macmillan, 1904.Kuipers, J. B. Quaternions and Rotation Sequences: A Primer with Applications to Orbits, Aerospace, and Virtual Reality. Princeton, NJ: Princeton University Press, 1998.Mishchenko, A. and Solovyov, Y. "Quaternions." Quantum 11, 4-7 and 18, 2000.Nicholson, W. K. Introduction to Abstract Algebra, 2nd ed. New York: Wiley, 1999.Salamin, G. Item 107 in Beeler, M.; Gosper, R. W.; and Schroeppel, R. HAKMEM. Cambridge, MA: MIT Artificial Intelligence Laboratory, Memo AIM-239, pp. 46-47, Feb. 1972., D.; Dang, Y.; Kauffman, L.; and DeFanti, T. "A Diamond of Quaternionic Julia Sets.", K. "Animating Rotation with Quaternion Curves." Computer Graphics 19, 245-254, 1985.Smith, H. J. "Quaternions for the Masses.", P. G. An Elementary Treatise on Quaternions, 3rd ed., enl. Cambridge, England: Cambridge University Press, 1890.Tait, P. G. "Quaternions." Encyclopædia Britannica, 9th ed. 1886. Reprinted in Tait, P. §CXXIX in Scientific Papers, Vol. 2. pp. 445-456., E. W. "Books about Quaternions.", S. A New Kind of Science. Champaign, IL: Wolfram Media, p. 1168, 2002.

Referenced on Wolfram|Alpha


Cite this as:

Weisstein, Eric W. "Quaternion." From MathWorld--A Wolfram Web Resource.

Subject classifications