- At first there were numbers, they were used to count objects like stones or apples or whatever (~ 9000 b.c.)
- Then people thought, that there must be some "nothing", so clever people invented the most important number, called "zero"
- After that people played around and asked whether there could be numbers smaller than 0, and they invented negative numbers.
- Then the communists came and wanted to divide everything, and that's how rational numbers were invented (a/b, a and b numbers.)
- Then some mathematics asked for the solution of x*x=2. He did not find a number, he found only an approximation (1.41...), so the clever guy just wrote sqrt(2), and voila! The irrational numbers were invented.
- Ok, so far so good. All numbers were invented. All numbers? No! We forgot the mathematicians! They searched and searched, and suddenly somebody asked why there should not be a solution to x*x=-1. They told the number to be written as i, and so the complex numbers were invented. Unfortunately the good old number line was dense (i.e. full), there was no place for these strange "complex" numbers (just as the name implies ). So they placed them below and above the real numbers: And even nowadays they form the complex number plane, each complex number consistring of a real part and an imaginary part.
- And then, as if this were not enough, in 1843 Sir William R. Hamilton was trying to find a way to rotate a 3D vector by multiplying it with another one.
After 15 years of hard work, he stumbled upon the idea of using a 4D notation. He called these numbers quaternions.
A Quaternion q is a quadruple of real numbers and can be defined as q=[s,v] where s is a scalar and v is a 3D vector.
One can express the vector v in terms of its components:
q = [s + xi + vj + zk], where s is a real number called the scalar part.
The three imaginary parts are xi, yj, zk. The coefficients x, y, z in the imaginary terms are the real numbers.
Now how are the rules for mathematical operations with quaternion numbers?
Given two Quaternions q1 and q2:
q1 = [s1, v1] = [s1 + x1i+y1j + z1k]
q2 = [s2, v2] = [s2 + x2i+y2j + z2k]
The product of q1q2 is:
Fortunately this can be written using dot and cross products
For any Quaternion q = [s + xi + yj + zk] = (s,v):
The inverse Quaternion is:
q = [s - xi - yj - zk] / |q|2 = (s,-v) / |q|2
Where |q| is the magnitude or modulus of q given by:
|q| = sqrt(s2 + x2 + y2 + z2)
Also, |q|2 = (s2 + v · v)