Quaternions are 4-dimensional generalizations of complex numbers. It can also be said that the basis elements , , of a quaternion are 3-dimensional generalization of the pure imaginary number .
William Rowan Hamilton discovered quaternions in 1843. After many years of thinking on the subject, he had a flash of insight while he was walking along the Royal Canal in Dublin. According to legend he inscribed these equations on the Brougham Bridge on 16 October 1843.
Hamilton made many important contributions to physics and mathematics. The “Hamiltonian” in classical dynamics was named after him. In his mind, however, quaternions was the most important discovery. Some say that he was obsessed with quaternions.
Quaternions are superior to vectors for describing rotations in space. This is why quaternions are used extensively in the aerospace industry to compute the orbits of satellites and other space vehicles and in virtual reality simulations. There are many applications in physics as well. A comprehensive bibliography of quaternions in mathematical physics is maintained by A.Gsponer and J.-P. Hurni .
Even though quaternions have many applications today, Hamilton imagined that they would be taught in high schools and replace the vectors in mathematics education. That dream did not materialize.
The , , are known as basis elements.
A quaternion is defined in terms of these basis elements plus the unity element .
The , , , are real numbers. Any of these coefficients can be zero. When we have a pure quaternion.
The norm of a quaternion is defined as
The “norm” is similar to length. You can think of it as a distance measure.
The conjugate of a quaternion is defined as
The quaternion conjugate has the following property. If p and q are quaternions then
Important difference between pure quaternion and pure complex number
Any pure quaternion with norm 1 squares to -1. There are infinite number of such quaternions because defines a sphere of radius 1 (unit sphere). There are infinite number of points on the unit sphere corresponding to different pure quaternions.
In contrast, there are only 2 pure complex numbers that square to -1: and .
Let A and B quaternions. The product of two quaternions is another quaternion
and are the vector-like part of the quaternions involving quaternion basis elements. The and are the 3-dimensional scalar and vector products, respectively. 
AB and BA are not necessarily equal.
Using the inverse of a quaternion we can write “A divided by B” as
These two are not equal.
 Andre Gsponer and Jean-Pierre Hurni, “Quaternions in mathematical physics (2): Analytical bibliography”, arXiv:math-ph/0511092
 J.B. Kuipers, “Quaternions and Rotation Sequences”, Princeton Paperbacks, ISBN 978-0-691-10298-6, p:108