10 ms·
Understanding Quaternions
- adamnemecek 8y agoDual quaternion are even whackier. They are the best formalism for reasoning about 3D space developing over time. Here’s a cool example http://www.chinedufn.com/dual-quaternion-shader-explained/ http://www.chinedufn.com/dual-quaternion-shader-explained/
- umanwizard 8y agoPossibly off-topic: why does practically any description of quaternions include the anecdote about somebody carving something into some bridge in Ireland? I’ve learned about plenty of mathematical concepts while having no idea who discovered them or under what circumstances. Why are quaternions the exception?
- brandonmenc 8y ago> somebody
- umanwizard 8y agoWhat exactly is your point? I said "somebody" for effect, not because I don't know who Hamilton was.
- twtw 8y agoI don't know, but here are my ideas: - quaternions maybe have a more interesting backstory than other constructs. Not everything was carved into stone. - quaternions never really became part of mainstream mathematical education. This makes them more niche and strange, and worth telling a story about. It's not as interesting to tell a story about something commonplace.
- Entalpi 8y agoPeople should read up on Galois theory and the story behind it. It involves a french youth, the french revolution, groundbreaking maths, and tangentially Poisson, Fourier and Cauchy, Gauss, Jacobi. His life should be a movie. :-)
- GlenTheMachine 8y agoMy doctoral dissertation used quaternions to describe spacecraft attitudes. My advisor was a stickler for not only appropriately citing references, but citing the most original (in the sense of oldest) references. This was something of a problem because the original references to some of the mathematical techniques I used were several hundred years old and not in English, and under the theory that a big part of the purpose of a citation is to help the reader understand the backgroud material this seemed a bit excessive. Nobody is going to learn French in order to read about Lagrange multipliers from Lagrange's original papers. But for quaternions, it was easy: I actually cited the Brougham Bridge inscription. One cannot, of course, check the bridge out of the engineering library to check the citation, but clearly this was the original “publication” of quaternion multiplication. My advisor finally got the point.
- ModernMech 8y ago> Nobody is going to learn French in order to read about Lagrange multipliers from Lagrange's original papers. You'd think, but I had a professor in physics who learned German just so he could read Boltzmann's original works.
- twtw 8y agoIt used to be common in hard sciences and mathematics for English-speaking doctoral candidates to be required to show some aptitude for German or Russian. Maybe still is, dunno.
- joeberon 8y agoIt’s definitely not
- dboreham 8y agoI believe German was required in order to study Chemistry back in the day.
- hprotagonist 8y ago
- nj65537 8y agoI think the story is told as a sort of cultural marker of what a Big F-ing Deal this discovery was/is. Mathematics, collectively, struggled for a long time to find a way to make 3-dimensional numbers into an algebra in a way that extends the algebra of complex numbers. (The cross and dot products are unsatisfying, because they don't have division.) The shock that this can be done in four, -- not three -- dimensions is still sort of reverberating, and that's what I think this story marks. It's a short stand-in for the longer story I've just summarized, and it evokes (or is meant to evoke) the mind-shattering thrill of discovery. I don't necessarily think the story accomplishes this -- your question is but one piece of evidence that it doesn't -- but I think for those who spend a good amount of time with these kinds of algebra questions, it comes to take on that role, and that's why I think it's repeated. (Teaser -- if you want to know more about these kinds of questions, Google for "real division algebras". There are not very many, and they way they are organized is not, I think, something one would expect.)
- jf- 8y ago> To find a way to make 3-dimensional numbers into an algebra in a way that extends the algebra of complex numbers What does that mean? My understanding was that Hamilton was searching for a way to make the manipulation of points in space easier, such as rotation, and noticed that the imaginary part of the complex numbers could be manipulated in the way he wanted. He then created a rather artificial tool in the form of the quaternions that allowed this.
- xelxebar 8y agoBy "extends" here we formally mean "normed division algebra". Basically, we want any 2D slice of our space to be equivalent to the complex numbers. This is analogous to how the reals embed into the complex plane or how slices of vector spaces are still vector spaces. We don't want things to depend on a particular basis (i.e. implementation). Anyway, it's pretty easy to make up some multiplication on 3D vectors, like multiplying their components. However, in general, it won't play nicely with such arbitrary 2D slices. As it turns out, this slicing property is equivalent to having multiplication play nicely with vector norms: |ab| = |a| |b|. that is, multiplication of vectors multiplies their lengths. Getting a multiplication with this property is the hard part, per se, and is only possible in dimensions 1, 2, 4, and 8.
- jf- 8y agoPeople think it’s a cute story and there’s a plaque on the bridge. It doesn’t need to be anything more than that.
- samontar 8y agoIt wasn’t when we learned it in high school, but it’s just that it’s a story that’s easy to tell. Just like the Königsberg reference for Eulerian graphs; Kekule and the Benzene ring; Lorenz, the weather, the butterfly, and deterministic chaos.
- umanwizard 8y agoThanks - out of all the replies to my comment, I think this is one of the most plausible hypotheses. I indeed think the Konigsberg and benzene stories are as commonly trotted out as the Hamilton one.
- garmaine 8y agoSurely you read about Galois fatal dual? I think it's just that these are instances where there is an interesting story attached.
- KboPAacDA3 8y agoAnd why do descriptions of quaternions include a rigorous proof? I trust quaternions work, so skip the proof and show me how to use them in a practical, efficient way.
- umanwizard 8y agoIn mathematics often proofs lead to understanding why something works (on the other hand, many proofs aren’t written in a way that make the main ideas clear or easy to tease out from details)
- joppy 8y agoThe fact that the quaternions “work” (are a finite-dimensional real vector space with an associative real-bilinear multiplication, and a division operation) is quite special. In fact there are only three objects satisfying this criteria: the real numbers themselves, the complex numbers, and the quaternions.
- j1vms 8y ago> there are only three objects satisfying this criteria: the real numbers themselves, the complex numbers, and the quaternions. Does a proof exist that these are the only three of such objects?
- billfruit 8y agoVery curious indeed why it is so, esp since there is normally zero historical background explained about vectors and matrices.
- beautifulfreak 8y agoMaybe you haven't heard of Oliver Heaviside. https://en.wikipedia.org/wiki/Oliver_Heaviside https://en.wikipedia.org/wiki/Oliver_Heaviside
- Retra 8y agoThere are millions of abstractions in mathematics, and the truth is that the human brain has a much better time remembering stories than it does math. You teach the stories so people have some context to associate complex ideas with.
- edflsafoiewq 8y agoAnyone know an easy way to show that multiplication by a unit quaternion is a unitary operator?
- joppy 8y agoUnitary in what sense? Clearly multiplication by a unit quaternion preserves the quaternion norm.
- edflsafoiewq 8y agoIn the sense of preserving the dot product, x.y = (ux).(uy).
- joppy 8y agoSince the quaternion norm is induced via the quaternion dot product, any transformation that preserves the norm automatically also preserves the dot product. This is a standard result for inner product spaces.
- edflsafoiewq 8y agoAh, polarization? And for it preserving the norm you can use the conjugate. Easy! Thanks!
- xelxebar 8y agoA little more exotic, but if you look here https://en.m.wikipedia.org/wiki/Plate_trick https://en.m.wikipedia.org/wiki/Plate_trick you can read about some simple rotating systems that, in some sense, end up reversed after a 360 degree rotation amd require another 360 to turn fully around. The article above has a nifty gif of this. Formally, this kind of thing is studied using what are called spinors and gets used a lot in quantum mechanics and friends when talking about quantum spin. Behind the scenes these are described using things called spinors. As it turns out, quaternions (and octonions) are capable of describing such things while simple rotations of any kind are insufficient. There are deep connections between spinors of different dimensions and the quaternions/octonions. For those interested, the term here is "Bott periodicity".
- aaaaaaaaaab 8y agoProtip: learn Geometric Algebra.
- dbcurtis 8y agoCan you recommend any good references?
- aaaaaaaaaab 8y agoHere’s an appetizer from Eric Lengyel in the context of game development (or 3D graphics in general): https://m.youtube.com/watch?v=WZApQkDBr5o https://m.youtube.com/watch?v=WZApQkDBr5o And here’s the in-depth stuff: Geometric Algebra for Computer Science: http://www.geometricalgebra.net http://www.geometricalgebra.net
- pjbk 8y agohttp://bleyer.org/dw/doku.php?id=geometric_algebra http://bleyer.org/dw/doku.php?id=geometric_algebra
- nraynaud 8y agoI had a question about quaternions: does anyone use them for anything else than multiplying a rotation by a scalar? In particular, it feels a bit like a waste of coding space to always use unit ones.
- colechristensen 8y agoSome control systems for air and space craft are designed with quaternions - here the problem being solved isn't a programming problem but a math problem involving the dynamics of the craft and/or orbital dynamics.
- nraynaud 8y agoAs far as I know they are also only doing SLERP for attitude control.
- colechristensen 8y agoI am not sure what you mean.
- nraynaud 8y agoAttitude control is not an example of using quaternions for something else than rotations.
- blt 8y agoThere does not exist a R^3 parameterization of the 3d rotations without some problem. https://en.m.wikipedia.org/wiki/Charts_on_SO(3)#Parametrizations https://en.m.wikipedia.org/wiki/Charts_on_SO(3)#Parametrizat...
- edflsafoiewq 8y agoBut quaternions are pretty good. They're a double cover but angles are an "infinity cover" of SO(2) and everyone understands angles. For animation purposes, being a single-cover is arguably a problem. An example in 2D is to suppose you have a rotation sequence 0° -> 90° -> 180° -> 270° -> X and you want to return to the original state. Well, you can do that either by continuing to rotate in the same direction, corresponding to X=360° or by going back along the path you came corresponding to X=0°. These alternatives are unrepresentable in a single cover. (For angles you also have X=-360°, 720°, etc. corresponding to making any number of revolutions in either direction before coming to rest at the desired target, which if you think is weird makes quaternions an even better chart on SO(3) than angles are on SO(2)).
- foobarbecue 8y agoIn case you missed it, 3B1B has a brilliant video introducing quaternions: https://youtu.be/d4EgbgTm0Bg https://youtu.be/d4EgbgTm0Bg
- raffael-vogler 8y agoHis videos are really incredibly intuitive and well-made. He deserves an award for his channel.
- foobarbecue 8y agoYep, and all the source code is developed in the open as well! https://github.com/3b1b/manim https://github.com/3b1b/manim
- jasonincanada 8y agoApparently part 2 is interactive and his patreon supporters already have access to it
- choonway 8y agoPlease use Lie Groups/Algebra instead.
- formalsystem 8y agoDo you mind on elaborating on that? Any nice books or tutorials you've seen on the subject?
- choonway 8y agoSkipping the formalism you can get directly into the practical aspects in this book. Modern Robotics by Lynch and Park Chapters 3 and 4 pre-preprint of book / more info available here http://hades.mech.northwestern.edu/index.php/Modern_Robotics http://hades.mech.northwestern.edu/index.php/Modern_Robotics
- edflsafoiewq 8y agoInstead? Non-zero quaternions are a Lie group under multiplication...
- choonway 8y agoYes, you are referring to SO(3) but SE(3) includes translations.
- edflsafoiewq 8y agoNo, I was referring to the group of non-zero quaternions. There's a double-cover from the group U of unit quaternions to SO(3) though. If you care about SE(3), there's an obvious surjection U x R^3 -> SE(3) where the domain is "a translation following a rotation". This is a homomorphism of Lie groups. I just don't get what you were going for with "use Lie groups instead". Everything here appears to already be a Lie group. How am I supposed to use that?
- choonway 8y ago
- bnolsen 8y agoleft handed thingies. go to geometric algebra for the real meal deal.
- paulgrant999 8y agoI have no idea why they insist on using such horrible graphs to explain a simple idea. Go to wiki/quaternions. scroll down to about 2/3rds of the way ;)
- kuwze 8y agoI remember being introduced to quaternions recently by this post[0] which recommended this book[1]. [0]: https://www.haroldserrano.com/blog/best-books-to-develop-a-game-engine https://www.haroldserrano.com/blog/best-books-to-develop-a-g... [1]: https://www.amazon.com/Quaternions-Computer-Graphics-John-Vince/dp/0857297597/ https://www.amazon.com/Quaternions-Computer-Graphics-John-Vi...
- amai 8y agoSorry to spoil the party, but this is the old 19th century way of teaching quaternions (and also complex numbers). It is much easier to start with some https://en.wikipedia.org/wiki/Group_theory https://en.wikipedia.org/wiki/Group_theory and then you understand that quaternions are simply matrices of a specific form: https://en.wikipedia.org/wiki/Quaternion#Matrix_representations https://en.wikipedia.org/wiki/Quaternion#Matrix_representati... . Quaternion multiplication is simply matrix multiplication of these matrices. And that's it. No mysteries, this is just simple linear algebra (you do't even need complex numbers, the real representation is enough and makes the connection to 4d rotations manifest).
- gmadsen 8y agoit shouldn't be an either or with geometry and algebra. both are valid and it helps to know both. representing H as a matrix is certainly valid and makes computations easier, but I dont really think that is building intuition
- earthicus 8y agoThe modern approach is not lacking all geometry, and the 19th century presentation is not lacking all algebra. Any respectable treatment will include both, the question is which makes the relationship clearer? The abstract algebraic approach talks of 'the rotation group' which maps on to geometric concepts as cleanly and directly as possible. Then we talk of different parameterizations or representations of this group, with the unit quaternions being the 'double cover' of the rotation group (which gives rise to the primary difficulty in understanding them - that a rotation by 360 degrees reverses orientation, and 720 degrees returns us to where we started). I think the modern approach is much clearer - the geometric ideas appear more directly, and the algebra is far less messy.
- edflsafoiewq 8y ago> I think the modern approach is much clearer - the geometric ideas appear more directly, and the algebra is far less messy. Can you show us an example?
- splittingTimes 8y agoPrevious discussion https://news.ycombinator.com/item?id=7364442 https://news.ycombinator.com/item?id=7364442 Those who like to have a print version: https://github.com/frankMilde/interesting-reads/blob/master/3d-game-engine-programming_jeremiah-van-oosten_understanding-quaternions.pdf https://github.com/frankMilde/interesting-reads/blob/master/...
- wink 8y agoI found these videos very helpful: https://www.youtube.com/watch?v=SCbpxiCN0U0 https://www.youtube.com/watch?v=SCbpxiCN0U0