Math time, oh yeah. Okay so quaternions are what we call hypercomplex numbers. Here complex doesn't mean that they are complicated, they are a complex. Multiple dings combined, just like a building complex. It's hypercomplex because whereas a regular complex number is made up of a real component and an imaginary component, a quaternion has a real component and 3 imaginary components.

Okay so you must have a lot you are thinking about, but it might be useful to understand how you do operations. The quaternion is sort of a hybrid of a 3d vector and a regular complex number. You can add quaternions together by summing each component, just like with vectors and regular complex numbers. For simplicity we can call the units of the imaginary components i j and k.

(r +xi +yj +zk) + (s + ai + bj + ck) = ( (r+s) + (x+a)i + (y+b)j + (z+c)k )

For multiplication, you multiply each component by each other component. Multiplying by a constant is easy, you just scale each component. But what happens when the components interact? If you multiply an imaginary unit by itself you get what you would with regular imaginary numbers.

i×i = j×j = k×k = -1

But what about the rest? It operates just like a cross product of vectors!

i×j = k j×k = i k×i = j j×i = -k k×j = -i i×k = -j

Pretty neat huh? You can use these things to represent rotations, and the math isn't all that complicated to use.