100% agree that bivectors are an easier to way to think about quaternions with less magical hand-waving. However, I have an opinion that feels important which I like to post whenever geometric algebra comes up:
Just because multivectors are intuitively superior doesn't mean GA is a solved pedagogical solution to rotations. It is itself very strange and unintuitive. In particular there is no satisfying explanation for what the geometric product means that I'm aware of (and I have read more-or-less everything there is on the subject). Certain restrictions of the product have a geometric interpretation but the overall operation doesn't. The product tends to be introduced in a just-so way: look, an operation! How neat! But if you're a student who's already wondering "wtf is a quaternion and why does this work" you're not going to be much better off wondering "wtf is a geometric product and why does it work".
I happen to think that the superior pedagogical solution is to do away with the geometric product as well and just focus on rotations as an application of the exponential map [https://en.wikipedia.org/wiki/Exponential_map_(Lie_theory)]. That is, quaternions emerge like this:
1. apply rotations via the exponential map acting on rotation operators: e^(iB) = 1 + (iB) + (iB)^2/2! + ...
2. in a flash of insight, realize that rotating vectors with two half-rotations is more stable than one full rotation: e^(iB) v => e^(iB/2) v e^(-iB/2)
I don't really understand the point of (2). I remember hearing that it works better in higher dimensions but couldn't tell you why.
But the point is, the useful properties -- like avoiding gimbal lock -- follow from just oriented planes and the exponential map. Gimbal lock is avoided by expressing rotations as a single rotation around an arbitrary axis, instead of, say composing Euler angles around fixed axes. But you don't need to mention the geometric product anywhere for this.
Anyway I think that this is a relatively 'unsolved' space, pedagogically. There is probably a really good explanation of why this all works that feels like it is still missing and doesn't involve any magic handwaving steps at all.
I see what you are saying.. As a counterpoint, to me, an oriented plane in 3d very much remembers a rotation though! The graphical convention of a plane with a circle arrow is great because it makes it very clear.
To see what a plane does to a vector, you take the product: of course you start with basis vectors and then later show that everything composes linearly.
The very important thing here is that the geometric product should Not be taught as the sum of scalar and cross product. Geometric product is defined by rules on the basis vectors and by linearity!
Now, I admit that when you see that making actual rotations is not as straighforward as one would expect, it’s confusing, and a bit disappointing. But, I think one can believe that bivectors are about rotation somehow, and then go further to the more complex exponential thing.
Idk maybe it’s just personal preferences, i studied quite a bit of math at college, but i never studied quaternions, and now I’m just very glad I didn’t, since this is much better to me!
If you wanted to have state with pure functions, you would, according to DRY, be compelled to write the bind operator. You wouldn't have known to call it a monad or why some basement theoretician likens it to a burrtiofunctor, but you nevertheless would have made the obvious coding solution.
Is this possible for rotation without a PhD in geometry or algebra?
Well! I don't have a PhD at all, but I think the exponential map is a surprisingly intuitive operation once you get used to it. It works on all kinds of operators. I'd argue for teaching it much earlier, in intro calculus, to introduce the idea that e^(a d_x) f(x) = f(x + a). But it still feels like there is some magic in the fact that works that I don't have a really satisfying explanation for (although it is easy to see by expanding the Taylor series).
The magic comes from the fact that you can decompose a translation (as in your example) into a bunch of little ones. So you want an operator that has the property that F(a)g(x) = g(x+a) = F(a/N)^N g(x). Equating F(a) to F(a/N)^N (for any N) reveals the exponential structure. I’m sure there are other ways but this is the first that comes to mind. You can also try using a very small translation F(da) and that will give you some insight too.
Yeah, I know how to derive it, but it still feels very unsatisfying to say: voila, you can put derivatives inside functions. It would be a hard sell to an intro calculus student, even though the concept would be very useful at that level.
You certainly do not need to have a phd in geometry and algebra for this. For example, the exp map is used all the time in robotics particularly in rigid body dynamics and kinematics.
IMHO, geometric algebra makes certain things clear, but it's also oversold as something new or novel. It can be recast in the language of differential forms (covariant multivectors) which is very often used in physics.
For what it's worth, differential forms have plenty of their own pedagogical problems. IMO most of the value in them comes from the concept of multivectors, and very little from the fact that they're 'dual' to regular vectors (which is a finicky detail necessary to do covariant geometry correctly, but not useful for general intuition).
Having written professionally about quaternions and GA, and having implemented them multiple times in professional engines, GA is simply slower and worse to use (until you replace them in the special case and put back quaternions).
I recommend every 3D engine keep quaternions - they work well for their task.
Here's [1] one example from the godfather of GA demonstrating how poorly GA performs
It seems like leaning into support from the type system of modern, static-typed languages like C++ could get us the conceptual advantage of GA with the performance of ordinary 3D linear algrebra, by representing knowledge of zero elements in such a way that operations with them shake out.
It is another trick to map this to SIMD operations with vector units or GPUs in modern CPUs, but that should be no harder than doing the same thing with quaternions.
>could get us the conceptual advantage of GA with the performance of ordinary 3D linear algrebra
People have tried this for well over 20 years, and it has never once panned out. It's simply not possible, since the representation required for Clifford Algebras is simply larger than for a quat. C++ static typed engines with all the template magic, or even super optimized hand rolled GA engines, are simply not performant compared to the same effort on a traditional linear algebra one.
Look over the writings of the authors in the paper I linked - they're gods in the GA field, and they've tried for decades to get it to work, as have many others (I worked on it 20ish years ago too..).
Go ahead and reinvent it all. I suspect you'll eventually reach the same conclusion many have before.
Since there's currently an article about quaternions on the front page, it felt like a good time to bring up bivectors, which in my opinion are a much more elegant way to do rotations.
Particularly, I think this part is insightful:
> In 3D, a bivector has three coordinates, one per plane: (xy, xz, and yz). Vectors also have three coordinates, one per axis (x, y and z). Each plane is perpendicular to one axis. This is a coincidence that only happens in three dimensions and it is why historically we have been confusing bivectors with vectors.
> Each plane is perpendicular to one axis. This is a coincidence that only happens in three dimensions
This part is confusing to me; in any number of dimensions, your orthonormal basis vectors (coordinate vectors) will by definition have tangent vector spaces (planes). There's nothing special about 3 in this regard, unless I'm misunderstanding something.
In N dimensions you do indeed have N hyperplanes of dimension N-1. But you have N*(N-1)/2 planes of dimension 2. Then one needs to explain why is rotation in general related to a 2D plane, not to an axis. Tautologically, it is so because rotation is when you oscillate between two directions (the two vectors of the 2D plane). It is not "rotating around an axis", because there is no consistent way to give one single angle of rotation around an axis if you are in 4+ dimensions.
I think they're saying the planes in particular are the tangent vector space in 3 dimensions. They're no longer the tangent vector space in 2,4,5.. dimensions, but they're still a thing there as well.
Off topic: Are the "dual-complex numbers"* used in 2D game engines? They're certainly a part of GA.
The term dual-complex numbers is an unfortunate name for what I'm referring to, which is a 4D number system for representing rigid body motions of 2D space. There is an analogue of SLERP for them for interpolating between rigid body motions. So you would expect the answer to be yes.
Maybe this isn't the right forum for this question.
I like the author's general idea that there should be a separate, mostly-opaque type for 2D and 3D angles.
2D angles are represented by floats, and 3D angles are represented by Quaternions. Which is fine internally, but a smart language should provide an inline wrapper type.
Typing 2D angles as floats presents issues when wrapping: x and 2pi * x will look and mostly function the same, but can lead to edge cases e.g. comparisons and loss of precision.
Typing 3D angles makes them easier to understand, since you won't be doing high-level mathematical operations, you'll just be rotating to face x or rotating by y degrees perpendicular to vector z.
The first sentence in the first slice opens as follows:
"I have always found it important to actually understand the things I am using."
I think there is a certain 'magic' in not understanding certain concepts fully. It's probably why I like maths and heavily dislike physics and chemistry. I do not want to make sense of this world. I want to see "the volume of a sphere is 4/3PIr^3" and in some sense see it as an incantation that one would make when casting magic in an RPG. Once you take some calculus, it is a pretty easy formula to derive (integrate?), but there is an allure, an invitation to do some really interesting math just for itself. It fires up our inner curiosity, if you want.
So anyways, I am neither addressing the title's question nor would I really mind if quaternions were replaced in game engines, but I thought it was important to voice the opinion that sometimes it's ok to not understand something.
> I think there is a certain 'magic' in not understanding certain concepts fully. It's probably why I like maths and heavily dislike physics and chemistry.
This doesn't make sense to me. Math are things that humans can understand fully, physics and chemistry are not, at least not yet. Things like "the volume of a sphere is 4/3PIr^3" can be fully understood, there are many ways to derive that formula. Of course you can apply it without understanding it, but the same goes for newtons equations or any of the many other formulas you have in physics and chemistry.
I agree. You can't know everything. When the 3D world moved to Quaternions I just plugged in the functions and accepted the fact that my maths wasn't good enough to really understand what was going on under the hood and I concentrated my abilities on building the rest of the engine, which was something I did understand.
Most people who drive cars have no idea how a combustion engine works, but the world doesn't completely descend into anarchy because of this.
I found mathematics much more approachable after being convinced it was not important to understand “why” - that I would spend all my time trying to understand that which is not necessarily understandable.
its like wondering how a hammer works instead of just using the hammer
Funny you should choose that particular example, that's the one formula I could never remember in gradeschool until on a whim while bored at my part-time job I used what I'd just learned in calculus to derive it (yep, with integration). Once I understood where each part of the formula came from, I never forgot it again.
> I have always found it important to actually understand the things I am using.
> I think there is a certain 'magic' in not understanding certain concepts fully.
With magic everywhere I wonder how many lifetimes it would take to understand the things we use. And I wonder how much of our knowledge is, should, or must remain tacit[1].
And sometimes “surface explanations” kick off deep understandings that you can’t surface at once, or ever. Jordan Peterson tried rationalizing faith in this way, and it was quite a show[2].
> The change is simple and the code remains almost the same, but the understanding grows a lot.
Does that mean you could rename 'class Quaternion' to 'class Rotor' and be done? I watched the video on rotors and some other videos on quaternions and I found them exactly as unintuitive as each other. I don't really see any advantage to using rotors and I'm quite happy to continue treating quaternions as black boxes.
The article says that rotors are better since they can be generalized to any number of dimensions, unlike quaternions which only work in 3D. But that only seems useful to one person: Marc ten Bosch, the guy who writes games in 4D.
To me a 3d rotation is a linear transformation from a 3d vector space to itself, so the natural way to represent it is as a 3x3 matrix.
Mathematically, this isn't an unusual way to look at it; you can read the Wikipedia page on this way of representing rotations. The nice thing is that it works basically the same as a 2d rotation, you just have one more row and column in your matrix.
What representation you want depends on what you want to do. A matrix is good for applying to vectors, but bad for interpolation and inefficient for storage.
I think there's a lot of fuss here to come up with something which has the same structure (isomorphic) and same representation / encoding as quaternions, while trying to avoid calling them quaternions. Part of math pedagogy is getting comfortable with terminology and when to say that two things are "the same thing". You understand a structures (like quaternions, like rotors) by using both axiomatic approaches (what are the properties of these things?) and from constructive approaches (how do we build these things?)
Take the real numbers, for example. They are intuitively simple, but if you take an analysis class, you'll be asked to rigorously prove that your different approaches to understanding real numbers are equal to each other, and therefore interchangeable. You can take your axiomatic approach (real numbers are an ordered field, where each nonempty set bounded above has a least upper bound). You can construct real numbers as decimal numbers with an infinite number of digits past the decimal point. You can construct real numbers as limits of series of fractions. All of these approaches "are" the real numbers. No one version is privileged over the others. By understanding these different approaches, you get a better understanding of the real numbers.
Same is true of quaternions, but here, it seems that we're being sold an idea that one version is superior and the other versions are inferior. This is, I believe, a bad pedagogical approach. There are certain advantages to thinking of quaternions in terms of a scalar component and 3D imaginary component. For one thing, the imaginary component points in the direction of the axis of rotation! That's pretty handy, for visualizing quaternions as rotations. This article takes the viewpoint that there is no reason to think of quaternions as anything other than rotors and plane reflections--again, this is bad pedagogy, because people should be encouraged to think of mathematical objects in different ways, and use whichever way that they find convenient for the problem, or convenient for their own mental model. No one approach is privileged. As a mathematician, reading this article, all I see at the end is "Oh, you want to use quaternions, but you don't want to call them quaternions."
Perhaps we need a more in-depth article on the notion of rotations explained for non-mathematicians, something that, at the very least, incorporates the relationship between axis-angle representations and quaternions/rotors, because these two different representations are not isomorphic, and they are related to each other through calculus, the exponential map, and Lie algebra. It's also worthwhile to think what the tangent space is for unit quaternions. If you incorporate the different approaches to representing rotations, and don't try to sell one as being "the best" representation, I'd love to read that article.
I'm not sure about this pedagogical argument, since among various pedagogical pathways for any particular math subject, students are generally only aware of the path they took. I think it is a pedagogically motivated student who does even the mildest of surveys for something they already understand.
Bad pedagogy is when you say that one method is right, which is what I’m complaining about.
Students should be encouraged to figure out what approach works for them. For example, if you’re multiplying 19x3, some students might think 19x3 = 30+9x3 = 30+27 = 57, and other students might think 19x3 = (20-1)x3 = 20x3-1x3 = 60-3 = 57.
Telling students that one of these ways is the way you SHOULD multiply—that’s bad pedagogy.
Knowing multiple approaches to solve the same problem is only something we really ask for math majors. It’s not something you’re expected to do until you get to topics like analysis or abstract algebra, where you’re asked to prove that different constructions have the same structure.
Just because multivectors are intuitively superior doesn't mean GA is a solved pedagogical solution to rotations. It is itself very strange and unintuitive. In particular there is no satisfying explanation for what the geometric product means that I'm aware of (and I have read more-or-less everything there is on the subject). Certain restrictions of the product have a geometric interpretation but the overall operation doesn't. The product tends to be introduced in a just-so way: look, an operation! How neat! But if you're a student who's already wondering "wtf is a quaternion and why does this work" you're not going to be much better off wondering "wtf is a geometric product and why does it work".
I happen to think that the superior pedagogical solution is to do away with the geometric product as well and just focus on rotations as an application of the exponential map [https://en.wikipedia.org/wiki/Exponential_map_(Lie_theory)]. That is, quaternions emerge like this:
1. apply rotations via the exponential map acting on rotation operators: e^(iB) = 1 + (iB) + (iB)^2/2! + ...
2. in a flash of insight, realize that rotating vectors with two half-rotations is more stable than one full rotation: e^(iB) v => e^(iB/2) v e^(-iB/2)
I don't really understand the point of (2). I remember hearing that it works better in higher dimensions but couldn't tell you why.
But the point is, the useful properties -- like avoiding gimbal lock -- follow from just oriented planes and the exponential map. Gimbal lock is avoided by expressing rotations as a single rotation around an arbitrary axis, instead of, say composing Euler angles around fixed axes. But you don't need to mention the geometric product anywhere for this.
Anyway I think that this is a relatively 'unsolved' space, pedagogically. There is probably a really good explanation of why this all works that feels like it is still missing and doesn't involve any magic handwaving steps at all.