What the idea is behind a quaternion and why do developers prefer them for graphical design?

188 views

I have a high level understanding of the mathematics and concepts but I want a _true_ eli5.

In: 8

3 Answers

Anonymous 0 Comments

Somebody already talked about gimbal lock and quaternions not being affected.

Another thing is the ability to keep time-integrating a rotation without hitting limits. When you keep rotating an object 30 degrees per timestep you will at some point need to implement a 2-pi-flip or risk overflow of the integrator when long times pass (the number gets to big for the computer to handle, so you subtract 360° every time you go past 180 or -180). Quaternions always stay between -1 and 1 without “manual” correction.

A third thing is relative rotation.

You have one orientation and you want to bring it over to another. Doing it with angles seems simple enough. Just rotate from 30 to 45 degrees, so a 15 degree increment.
Now turn from 179 degrees to -179 degrees. You would have to implement special code to catch this case and move the 2 degrees in the right direction and not the 358 degrees in the wrong one.
Quaternions just WORK, no special code necessary.

But: quaternions are hard to grasp as a human, so we use euler angles as initial conditions and for readout/debugging and direct cosine matrices for coordinate system conversion and chaining transformations through different coordinate systems, because we can do that math in the head if necessary. But in the nitty gritty numerical kernel, nothing beats quaternions, because their math has no poles.

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