10 Comments
User's avatar
Ryan's avatar

> There’s just one real reason for it: in the quaternion space, there is an easily-memorized formula for rotating a point by an angle around a line of our choice.

Isn't the primary reason not the ease of the formula, but to avoid gimbal lock? Euler angles are a lot more intuitive for people otherwise. (I suppose there are also some computational benefits but I don't think that was the primary driver historically?)

Expand full comment
lcamtuf's avatar

What I mean is that the quaternion-style way of doing rotations around an arbitrary axis can be written using three separate x-y-z coordinates - nothing here *requires* the fourth dimension. It's just that it ends up being a real mess - I *think* this is the multiplication matrix for rotation by angle θ around 3D axis u, but don't have me check:

https://wikimedia.org/api/rest_v1/media/math/render/svg/80ff6ba71d60b7128098e1cbaf70c0e268421656

No one remembers this when they need it, and you don't necessarily want to do these calculations repeatedly, so we usually stick to the intuitive way of doing 3D rotations around the coordinate system axes:

https://wikimedia.org/api/rest_v1/media/math/render/svg/a6821937d5031de282a190f75312353c970aa2df

...which indeed does result in problems such as gimball lock.

Computational advantage - maybe in some specific applications, although I doubt it's a bottleneck in modern computing. In accelerated 3D graphics, it all boils down to matrix multiplication in the end.

Expand full comment
Ryan's avatar

Oh, I misunderstood what you meant, thanks! And yes, it's fairly irrelevant nowadays, I just wasn't as sure historically :)

Expand full comment
Mariusz "Emsi" Wołoszyn's avatar

I envy you for having time to write about quaternions. :)

Being non-commutative is less weird if you are used to matrix multiplication. It seems natural, but it's no wonder it took Hamilton so long, considering he had spent years looking for a three-dimentional version of complex numbers.

If you're into 4D and quaternions, you'll probably find vector analysis a real treat. :)

Check this out: https://youtu.be/M12CJIuX8D4?si=zYhQId-ph0hLAqK4

Expand full comment
Wyrd Smythe's avatar

Not bad! I'm a little surprised you didn't mention Hamilton's famous equation: i²=j²=k²=ijk=-1.

FWIW, there's an easy way to remember the multiplication rules: i ⇔ j ⇔ k ⇔ i (best represented by a three-part circle combining the two instances of i). When you go right-to-left (or clockwise around the circle) the result is positive. When you go left-to-right (or counterclockwise), the result is negative.

So, j×k=+i but k×j=-i.

BTW: On my browser, the spiral symbol you used for the 4D axis just shows as a box; the browser doesn't support it. I looked in the app, and it appears okay there. For some authors, the canonical 4D axis is w (and the 5D axis is u), which is an easier typography. I think of them as standing for Weird and Unusual. For more than five dimensions, I've seen authors use xₙ, usually starting at x₁.

Are you next going to enter the deeper waters of octonions? 😁

Expand full comment
lcamtuf's avatar

Hah, thanks!

I really wanted to show how they're constructed from first principles. The equation is sort of the end of the thought process, not the starting point, and every article about quaternions mentions it but usually doesn't explain the "why".

Anyway... I *think* Substack uses web fonts, so that spiral should be loading everywhere unless you're on an older browser, have web fonts disabled for accessibility, or maybe if an overzealous ad blocker intervened? Dunno.

The reason I didn't want to use w is that it's alphabetically in the wrong order, so I think it's actually kinda goofy that the fourth dimension is alphabetically the first. But I guess a spiral might be too cheeky.

I'm not touching octonions, but some people are egging me on to write about Clifford algebras. I think that would appeal to about five readers...

Expand full comment
Wyrd Smythe's avatar

As follow-up, that spiral character is Unicode character U+AA5C, the Cham punctuation spiral. (Cham is an ancient kingdom that was in what is now South Vietnam and Cambodia.) It appears my Windows 10 machine doesn't have any font that will render it.

FWIW, Substack specifies the "Lora" font for your articles. (I picked "Roboto Slab" for mine because I liked the name.) Not sure that makes any difference, though. 🤷🏼‍♂️

The Substack app on my iPhone and iPad render the spiral, but the multiplication table images show up as white blanks. 😣

Expand full comment
Jakub Narębski's avatar

> I'm not touching octonions, but some people are egging me on to write about Clifford algebras. I think that would appeal to about five readers...

There is a very nice YouTube video "Why can't you multiply vectors?" by Freya Holmér

from 2023 https://www.youtube.com/watch?v=htYh-Tq7ZBI that tries to explain why we have rules for complex numbers in 2d, so-called vector product in 3d, and quaternions for 4d.

Expand full comment
Wyrd Smythe's avatar

Heh, yeah, the alphabetical ordering of x,y,z,w,u bothered me a bit, too. That’s why I think of them as Weird and Unusual.

My browser is Edge and is up-to-date. Substack is a little weird with regard to fonts. Assuming it’s a valid Unicode character, it should have rendered it. No idea why it didn’t (but now I want to find out).

I’d be interested in Clifford algebras if you care to go there. Don’t know much about those.

Expand full comment
newt0311's avatar

Yeah. That's why I prefer the geometric algebra approach. It's much more intuitive (for me at least).

Expand full comment