Header Ads

Today’s the Day You Finally Learn Quaternions

If you’ve ever dealt with orbital mechanics or sophisticated computer graphics, you’ve probably run across the math term quaternions. [Anyleaf] has a guide to the practical use of this math concept which focuses more on practicality than theory. We like it!

Quaternions are one of at least two ways to model rotations in a 3D space. Most people are familiar with the classic Euler angles which cover yaw, pitch, and roll. However, this method is prone to some ambiguities — in other words, there are multiple ways to go from one Euler state to another and all are equally valid. In addition, Euler angles are prone to gimbal lock where two of the axes are parallel and, thus, don’t have a different effect on the object’s orientation. There are several ways to combat that including the use of quaternions.

If you think gimbal lock isn’t a problem, don’t forget that the Apollo IMU had this problem because they used three gimbals instead of four. The system would detect it was in gimbal lock and require manual intervention. This prompted [Mike Collins] to joke “How about sending me a fourth gimbal for Christmas?”

Of course, you can convert between Euler angles and quaternions subject to the ambiguity involved. The section about converting from quaternions is marked as future work, though, so you might need some more resources to fill in that blank. If you want more detail in general, [Anyleaf] suggests an excellent page from [3Blue1Brown] and [Ben Eater] that has explorable videos (the title graphic comes from one of these videos) and also a PDF tutorial from the Weizmann Institute of Science.

Honestly, we know not everyone likes math and it is true that — especially today — you can do a lot without diving into math. But if you do know the math behind things it often makes things easier or, sometimes, even possible. It is like assembly language. You probably don’t need to know it these days, but if you do know it, helps sometimes in strange and unexpected ways. So why not brush up on calculus or advanced topics like the Laplace transform?


No comments