What is a quaternion and what is it used for

322 views

I’ve seen quaternions in an essay type video about imaginary numbers and it comes up quite a bit in game dev? What does it even mean.

In: 2

5 Answers

Anonymous 0 Comments

Complex numbers are often used to represent coordinates on a two-dimensional plane. One of the advantages of doing so is that you can rotate and scale a set of coordinates via multiplication.

Let’s say we have the cartesian coordinates (3,4). This corresponds to (3 + 4i). If we want to rotate this 90 degrees to the left, we’d simply multiply by (0 + 1i) – the coordinates of the position on the unit circle 90 degrees to the left of 0 degrees (along the x-axis). The result of our multiplication would be (4 + 3i) – a 90 degree rotation to the left.

Extending this model to 3 dimensions is what quaternions do. You can use them in the same way to indicate position and perform rotations in 3 dimensional space.

You are viewing 1 out of 5 answers, click here to view all answers.