I have not yet posted on this blog that last year I released an article/video with interactive diagrams on Geometric Algebra, specifically Rotors. (I also recently updated it). Here is the introduction: To represent 3D rotations graphics programmers use Quaternions. However, Quaternions are taught at face value. We just accept their odd multiplication tables and […]
<p><iframe loading="lazy" src="https://www.youtube.com/embed/Idlv83CxP-8" allowfullscreen="allowfullscreen" width="650" height="365" frameborder="0"></iframe></p>
<p>I have not yet posted on this blog that last year I released an <a href="https://marctenbosch.com/quaternions/" class="red">article/video with interactive diagrams on Geometric Algebra</a>, specifically Rotors. (I also recently updated it). Here is the introduction:</p>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}, messageStyle: "none" });
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<style>
.inmargin { position: relative; left: calc(50% - 100px); }
</style>
<div style="background-color: rgba(255,255,255,0.2); padding: 10px; padding-left: 30px; padding-right: 30px">
<p>To represent 3D rotations graphics programmers use <i>Quaternions</i>. However, <strong>Quaternions are taught at face value</strong>. We just accept their odd multiplication tables and other arcane definitions and use them as black boxes that rotate vectors in the ways we want. Why does $\mathbf{i}^2=\mathbf{j}^2=\mathbf{k}^2=-1$ and $\mathbf{i} \mathbf{j} = \mathbf{k}$? Why do we take a vector and upgrade it to an “imaginary” vector in order to transform it, like $\mathbf{q} (x\mathbf{i} + y\mathbf{j} + z \mathbf{k}) \mathbf{q}^{*}$? Who cares as long as it rotates vectors the right way, right?</p>
<p>Personally, I have always found it <strong>important to actually understand the things I am using</strong>. I remember learning about Cross Products and Quaternions and being confused about why they worked this way, but nobody talked about it. Later on I learned about <i>Geometric Algebra</i> and suddenly I could see that the questions I had were legitimate, and everything became so much clearer.</p>
<p>In Geometric Algebra there is a way to represent rotations called a <i>Rotor</i> that <strong>generalizes</strong> Quaternions (in 3D) and Complex Numbers (in 2D) and even works in any number of dimensions. </p>
<p>3D Rotors are in a sense <strong>the true form</strong> of quaternions, or in other words Quaternions are an <strong>obfuscated</strong> version of Rotors. They are equivalent in that they have the same number of components, their API is the same, they are as efficient, they are good for interpolation and avoiding gimbal lock, etc… in fact, they are isomorphic, so it is possible to do some math to turn a rotor into a quaternion, <strong>but doing so makes them less general and less intuitive</strong> (and loses extra capabilites). </p>
<p>But instead of defining Quaternions out of nowhere and trying to explain how they work <strong>retroactively</strong>, it is possible to explain Rotors <strong>almost entirely from scratch</strong>. This obviously takes more time, but I find it is very much worth it because it makes them much easier to understand!</p>
<img src="https://marctenbosch.com/quaternions/planets.png" alt="Earth-Centric planetary motion" class="inmargin" width="200">
<p>For example, Quaternions are introduced as this mysterious four-dimensional object, but why introduce a fourth dimension of space to visualize a 3D concept? By contrast 3D Rotors do not require the use of a fourth dimension of space in order to be visualized.</p>
<p>Trying to visualize quaternions as operating in 4D just to explain 3D rotations is a bit like trying to understand planetary motion from an earth-centric perspective i.e. overly complex because you are looking at it from the wrong viewpoint.</p>
<p>It would be great if we could start phasing out the use and teaching of Quaternions and replace them with Rotors. The change is simple and <strong>the <a href="code.htm" style="color: black">code</a> remains almost the same, but the understanding grows a lot.</strong> </p>
<p>As a side note, Geometric Algebra contains more than just Rotors, and is a very useful tool to have in one’s toolbox. This article also serves as an introduction to it.</p>
</div>
<p>And here are some quotes about it:</p>
<blockquote class="nopad"><i>The clearest explanation of 3D geometric algebra within 15 minutes that I’ve seen so far</i> <span class="g">—BrokenSymmetry</span></blockquote>
<blockquote class="nopad"><i>I am sold. While I can understand quaternions to an extent, this way of thinking is a much more intuitive and elegant approach.</i> <span class="g">—Jack Rasksilver</span></blockquote>
<blockquote class="nopad"><i>This sets a high standard for educational material, and is a shining example of how we can improve education with today’s technologies.</i> <span class="g">—Sebastien Pierre</span></blockquote>
<blockquote class="nopad"><i>When I was in college, I asked one of my math professors why the cross product of two vectors results in a perpendicular vector whose magnitude is equal to the area of the parallelogram formed by the two vectors. Like..what? Why? And what about 2D?
They blew me off, and that was a big part of why I stopped taking math in college. […]
Anyway, I had pretty much given up on ever truly understanding the whole jumble of seemingly unrelated types that are cross products. But then I saw this: And…wow. Just 15 minutes and a lot more than just cross products suddenly make a lot more sense.</i> <span class="g">—Mason Remaley</span></blockquote>
<blockquote class="nopad"><i>I’m a pure math dude at heart, even if I don’t get to do it much any more.
Two years ago, my wife asked me, “If you had to get a math equation tattooed on your body, what would it be?” I answered, “i^2 = j^2 = k^2 = ijk = -1”.
I felt a brief flush of anger when I saw this headline.
This is an extraordinarily good article that should be read by pretty much anyone doing graphics programming.</i> <span class="g">—pflats</span></blockquote>
<p>I wrote most of in 2011/2012, but didn’t release it because I was not satisfied with part of it. But I thought it was time to let go and release it anyway. I actually think it is hurting the advancement of science that people are still mainly using quaternions instead of Geometric Algebra, so holding on to it was not good.</p>
<p>So last fall/summer I cleaned up some of the diagrams and made a 15 minute long video that follows the article exactly. I never made a video this long, and it was quite exhausting. But I thought it would be really cool to make an article that is perfectly synced to a video, so you can either read it or watch it, and the article serves as an exact table of contents for the video. </p>
<p>I think I came across Geometric Algebra from attending SIGGRAPH a long time ago? Specifically this book: <a href="http://www.amazon.com/gp/product/0123749425/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0123749425&linkCode=as2&tag=martenbos-20">Geometric Algebra for Computer Science by Dorst et al.</a> Later on I found this great book: <a href="http://www.amazon.com/gp/product/1453854932/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=miegakure-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=1453854932">Linear and Geometric Algebra by Macdonald</a></p>
<p>Geometric Algebra soon came in handy for Miegakure, specifically to define the 4D equivalent to Quaternions, <a href="https://marctenbosch.com/news/2011/05/4d-rotations-and-the-4d-equivalent-of-quaternions/">which I posted about on this blog</a>. Later on it became the backbone of 4D Toys. </p>
<p>Learning about Geometric Algebra was also great because it answered so many questions I had when learning linear algebra, the cross product, quaternions, etc… <strong>I basically wrote this article for my past self as a college student.</strong> </p>
<p>I recently rewrote the introduction to add more detail about the properties of Rotors and how they relate to quaternions. Even though the content went into detail, it should now be clear what Rotors are from only reading the introduction. I can already see from reading recent comments that it was worth it.</p>
<p> I deliberately picked a cheeky click-bait title…</p>
<p>Something else that might be of interest is the history of Geometric Algebra, so I recently added a heavily summarized version to the <a href="https://marctenbosch.com/quaternions/#history">end of the article</a>. I think looking at the history makes it clearer <em>how </em>the quaternion viewpoint stayed in people’s minds for longer than necessary…</p>