A quaternion uses complex numbers to represent rotation.
The x,y,z parts are the complex numbers. By complex I mean they’re imaginary. Because we know they’re complex, we only store the scalar part of the complex number (i is imaginary, a complex number is ix + b, we store the x). The w component is the ‘real’ part of the complex number (the b in ix + b).
In algebraic form we get:
ix + iy + iz + w = 0
Dude man who discovered them realized the proof that:
i2 = j2 = k2 = ijk = −1
(i,j,k are your complex parts ix, iy, iz)
From here on out you need to be really well versed in some linear algebra and the sort to really grasp it. Quaternions in and of themselves are just a 4-dimensional number system. But they can be USED to represent 3-dimensional rotation.
You don’t really NEED to understand it to use it though. Getting into them is really a more academic process then a useful process.
As long as you understand the rules of them, and allow the computer to do the actual arithmetic, they work.
The main principal you got is that the quaternion stores as a complex number an axis and the rotation around that axis. The number system that the quaternion is though allows for simple appending of quaternions onto one another by multiplying one onto the other. Just remember that the multiplication is NOT commutative (the order of the operands is important). Because they’re not commutative, division is slightly tricky, and must default to the definition of division (division is the product of the inverse).
If you want to get into the actual meat of it and learn the math. Well, like a lot of linear algebra, it’s all about building on the basic structure of the line. Remember in Algebra 1 you learn about slope-intercept form, y = mx + b. And that polynomials in their root for are really just that with degrees added onto them which really just append curvature to them.
OK.
Well note the root complex number is f(x) = ix + b. It’s just slope-intercept with i as the slope.
A quaternion is just a polynomial of a complex number.
Just keep this in mind when learning complex numbers. The actual maths is based in simple algebra, just the numbers that result remain in complex space.