In the eighteenth century, W. R. Hamilton devised quaternions as a four-dimensional extension to complex numbers. Soon after this, it was proven that quaternions could also represent rotations and orientations in three dimensions. There are several notations that we can use to represent quaternions. The two most popular notations are complex number notation (Eq. 1) and 4D vector notation (Eq. 2).
And, just for fun...
A complex number is an imaginary number that is defined in terms of i, the imaginary number, which is defined such that i * i = -1.
A quaternion is an extension of the complex number. Instead of just i, we have three numbers that are all square roots of -1, denoted by i, j, and k. This means that
j * j = -1
k * k = -1
So a quaternion can be represented as
q = w + xi + yj + zk
where w is a real number, and x, y, and z are complex numbers.
Another common representation is
q=[ w,v ]
where v = (x, y, z) is called a "vector" and w is called a "scalar". Although the v is called a vector, don't think of it as a typical 3 dimensional vector. It is a vector in 4D space, which is totally unintuitive to visualize.