Are there any benefits from using quaternions for rotations rather than a matrix?

Sorry, I'm really excited about quaternions and have to share what I've found:

One of the main reasons why quaternions are so well suited for rotations is because they make use of the imaginary numbers (designated as i, j, k in the quaternion). What makes them so special regarding rotations is because imaginary numbers are perpendicular to the real numbers. (Think of how the y-axis is perpendicular to the x-axis).

The imaginary & real numbers do a little handshake through this single equality:

i2 = -1

It's our gateway between the two "realms":

i1 = i

i2 = -1

i3 = i * -1 = -i

i4 = -1 * -1 = 1

We've come full circle. i5 = i all over again.

In fact, if you treat i as y, and real (1, -1) as x, and plot the answers on an x-y graph, you get a unit circle!

So, by combining different amounts of 'imaginary' with 'real', you can get any point on the circle. You could combine say... 30% real with 70% imaginary, like so: 0.3(1) + 0.7(i) = 0.3 + 0.7i, etc.

Now, sin(Θ) + cos(Θ) = 1, so you can say P = cos(Θ) + sin(Θ) i

You'll notice that quaternions also have j and k. Those are for the other two axes, and they work the same way.

That's as far as I've gotten in understanding quaterions but yeah.

/r/gamedev Thread Parent