An explorable video series
Lessons by Grant Sanderson
Technology by Ben Eater
One of the main practical uses of quaternions is in how they describe 3d-rotation. These first two modules will help you build an intuition for which quaternions correspond to which 3d rotations, although how exactly this works will, for the moment, remain a black box. Analogous to opening a car hood for the first time, all of the parts will be exposed to you, especially as you poke at it more, but understanding how it all fits together will come in due time. Here we are just looking at the “what”, before the “how” and the “why”.
In addition to this sequence of explorable videos, there are two videos on YouTube on the subject. Some of the material here is duplicated, but you may find a different take on it helpful:
One thing that makes quaternions so challenging is that they live and act in four dimensions, which is extremely hard (impossible?) to visualize. Luckily, we can build an intuition for quaternion multiplication and how it computes rotation in 3d just by focusing on unit quaternions, the ones which sit a distance 1 from the origin. These form a hypersphere in 4d space, which is still really hard to think about, but luckily mathematicians have a tool in their belt that makes it just barely possible to think about a full hypersphere in the confines of our 3d world: Stereographic projection.
It’s easiest to start understanding this idea in a lower dimensional context, like mapping the surface of a sphere onto 2d plane. The geography enthusiasts among you will know that there are many different tactics for displaying the surface of the earth on a 2d plane. Here’s what it would look like using a stereographic projection:
In principle, this would actually extend to fill all of 2d space, with Antarctica extending out to infinity. Perhaps a method like this that warps the southern hemisphere so dramatically as to give the penguins infinite real estate seems way worse than other types of projection. But for a mathematician, this projection presents a number of nice properties. For example, any circle drawn on the surface of the earth remains a circle after this projection. Also, there are no awkward cuts or discontinuities (so long as we consider all paths outward to be converging towards a single “point at infinity”). Once we get to visualizing quaternion multiplication, which is all about thinking of continuous rotations, the idea of circles remaining circles and avoiding awkward cuts will actually be quite welcomed.
To understand how this works, we’ll start in two-dimensions, and work our way upward.
How do you multiply two complex numbers? Well, you start by using the distributive law.
Then use the rule that to simplify further.
Multiplying two quaternions is more complicated, but in principle not too different. There are some rules for how , and multiply amongst themselves,
and multiplication is carried out by distributing and simplifying.
This is what computers do, and it’s what your computer is doing in the visualizations you will see below. But knowing how to compute products is just one way of understanding multiplication. In much the same way that multiplication by real numbers is made more understandable envisioning a process of scaling or squishing, and that understanding complex multiplication is made easier when understanding how they rotate points on the plane, quaternion multiplication can be understood by looking at how it transforms four-dimensional space.
This is not a simple idea or a simple visual, but with some patience, understanding quaternion multiplication in this way can make clear why quaternion multiplication describes 3d rotation the way that it does. We’ll limit our view of this action to the unit hypersphere, as viewed under a stereographic projection filling the entirety of our 3d space.
Let us know below what you think of this as a medium for learning. Needless to say, it took meaningfully more effort to put together than an ordinary video would, as it is both platform and content, but hopefully, you found it worth it. Fun fact: the strong majority of viewership we each get on YouTube comes from YouTube recommending the videos. This sadly means that the irony of creating the tooling to make these lessons more engaging is that they run a risk of reaching fewer people. If you did get something valuable from this experience, kindly consider sharing it.
Many thanks to Andy Matuschak, Cameron Christensen, Michael Nielsen, and Kitt Hirasaki for useful conversations and feedback on this experience.
Each of our YouTube channels is supported on Patreon (Ben Eater, 3blue1brown). Funding for this collaboration came from the 3blue1brown patreon community, with special thanks to the following individuals: