amai 6 years ago

Sorry 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 and then you understand that quaternions are simply matrices of a specific form: 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).

  • joppy 6 years ago

    A lot of open problems in mathematics boil down to trying to analyse "matrices of a specific form" - I think while this viewpoint is important to recognise (essentially: quaternions are a finite-dimensional real associative algebra), it might not give as much intuition as other interpretations. It's kind of like how in computer science, many many hard problems can be restated as problems about some graph constructed from the input, but now you have two problems...

  • gmadsen 6 years ago

    it 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 6 years ago

      The 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 6 years 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?

  • twtw 6 years ago

    Do you have any books you could recommend that present this approach?

    • earthicus 6 years ago

      Stillwell[1] discusses quaternions in chapters 1 & 2, although the meat and potatoes of the book is more generally about lie groups and lie algebras. It's pitched at a lower level than most books on this topic by restricting attention to the classical matrix groups.

      [1]https://www.amazon.com/Naive-Theory-Undergraduate-Texts-Math...

      • twtw 6 years ago

        Thank you.

umanwizard 6 years ago

Possibly 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?

  • GlenTheMachine 6 years ago

    My 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.

    • iantrt 6 years ago

      If someone learned French to read about Lagrange multipliers from Lagrange's original papers, then they would be sorely disappointed: it was actually Euler who first used the Lagrange method! (And by some curious coincidence, the L/lambda could just as easily be a homage to Leonhard as to Lagrange...)

    • ModernMech 6 years 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 6 years ago

        It 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 6 years ago

          It’s definitely not

      • dboreham 6 years ago

        I believe German was required in order to study Chemistry back in the day.

        • hprotagonist 6 years ago

          it had to be. The bulk of the literature wasn’t in english.

          it is now..but it’s still good to know for reviewing the older work.

      • paulgrant999 6 years ago

        in fact this is the primary reasons why I want to learn French, Russian, German ;)

        reading the masters, is never a waste.

  • nj65537 6 years ago

    I 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.)

    • xelxebar 6 years ago

      Also, in Hamilton's time they didn't have the view of mathematics as axiom systems that could be played with. Math was a way of finding Truth, so the idea of making up multiplication rules at your convenience probably seemed like an extremely non-obvious move.

      The discovery of complex numbers and quaternions probably played a big part in getting people to question what math is, leading to Hilbert's program to study Foundations etc. Hamilton's story is a nice, rare single instance we can point to, symbolizing this discovery.

      • umanwizard 6 years ago

        Fair point, but hadn’t complex numbers been around for a while by the time quaternions were discovered?

    • blt 6 years ago

      I think it's more like a meme. Countless other mathematical insights in the same time period have been at least as important and counterintuitive.

    • jf- 6 years 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 6 years ago

        By "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.
  • samontar 6 years ago

    It 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 6 years ago

      Thanks - 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.

  • twtw 6 years ago

    I 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 6 years ago

      People 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. :-)

      • twtw 6 years ago

        It's always been interesting to me that both Galois and Abel accomplished so much despite dying so young.

        Most introductions to Galois theory that I've read have mentioned his duel.

      • rzzzt 6 years ago

        The Determinants of a Matrix

  • KboPAacDA3 6 years ago

    And 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.

    • joppy 6 years ago

      The 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 6 years 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?

    • umanwizard 6 years ago

      In 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)

  • garmaine 6 years ago

    Surely you read about Galois fatal dual? I think it's just that these are instances where there is an interesting story attached.

  • jf- 6 years ago

    People think it’s a cute story and there’s a plaque on the bridge. It doesn’t need to be anything more than that.

  • Retra 6 years ago

    There 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.

  • brandonmenc 6 years ago

    > somebody

    • umanwizard 6 years ago

      What exactly is your point? I said "somebody" for effect, not because I don't know who Hamilton was.

      • i88y6 6 years ago

        It just showcases your own arrogance

        • dang 6 years ago

          We've banned this account for breaking the site guidelines and ignoring our request to stop.

          Could you please not create accounts to do that with?

nraynaud 6 years ago

I 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.

  • macawfish 6 years ago

    The remarkable thing about quaternions is that you can describe rotation around any arbitrary axis! Try doing that with real rotation matrices and you will bump into a major problem:

    https://en.wikipedia.org/wiki/Gimbal_lock

    Because matrix multiplication is not commutative, you can't easily compose a matrix representing rotation around an arbitrary axis from "component rotation matrices".

    With quaternions/clifford algebras, you can say "here's the vector I want to rotate about and here's this is how much I want to rotate", and it just magically works.

    • xaedes 6 years ago

      Not quite...

      Gimbal lock is no problem of rotation matrices but of euler angles. Just look up the wikipedia page you posted: "The problem of gimbal lock appears when one uses Euler angles in applied mathematics"

      You can represent any (any!) rotation with rotation matrices.

      Quaternions are neither commutative. Fortunately you don't need commutativity to build up arbitrary rotations.

      • macawfish 6 years ago

        Thanks, I realize now that the non-commutativity I was noticing is more a property of SO(3), which can be seen both in quaternion and matrix representations of rotations.

        • joppy 6 years ago

          The non-commutativity of rotations can also be seen directly: rotating something 90 degrees about the x then the y axis is not the same as the y then the x.

          • macawfish 6 years ago

            I was just doing this earlier with my arms

    • civility 6 years ago

      > The remarkable thing about quaternions is that you can describe rotation around any arbitrary axis! Try doing that with real rotation matrices and you will bump into a major problem

      https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matri...

      • macawfish 6 years ago

        I understand you can represent any rotation with matrices, but it's very awkward, and when you compose rotations, you quickly lose information about the resulting axis of rotation.

        • gugagore 6 years ago

          The information is still there. The axis of rotation is the eigenvector with eigenvalue 1. (That vector doesn't move when you apply the rotation)

          • macawfish 6 years ago

            Okay let me rephrase: the axis of rotation becomes relatively obfuscated!

            I guess it doesn't matter if you're doing everything on the computer, but it's pretty cool that with quarternions you can immediately see the composite rotation's axis and angle without any extra work!

    • billfruit 6 years ago

      I find that many articles explaining how to describe the orientation of a rigid body rotated along an axis by an angle in a confusing manner.

      Normally in 3d space you will have to construct quaternions for rotations along yaw, pitch and roll, and then take their product to get the quaternion of the orientation of the rigid body.

      That is, when using quaternions to describe orientations,we are actually describing the rotations done to bring the body from its default orientation to its present orientation.

      • twtw 6 years ago

        > Normally in 3d space you will have to construct quaternions for rotations along yaw, pitch and roll, and then take their product to get the quaternion of the orientation of the rigid body

        Is this not just using Euler angles via quaternions? If I understand correctly, tracking rotation via yaw, pitch, and roll will still run into issues of gimbal lock because it's the same parameterization just using quaternions.

    • nraynaud 6 years ago

      how is that an example of using quaternion for something else than rotations?

  • colechristensen 6 years ago

    Some 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 6 years ago

      As far as I know they are also only doing SLERP for attitude control.

      • colechristensen 6 years ago

        I am not sure what you mean.

        • nraynaud 6 years ago

          Attitude control is not an example of using quaternions for something else than rotations.

  • blt 6 years ago

    There does not exist a R^3 parameterization of the 3d rotations without some problem. https://en.m.wikipedia.org/wiki/Charts_on_SO(3)#Parametrizat...

    • edflsafoiewq 6 years ago

      But 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)).
      • blt 6 years ago

        I agree quaternions are a good parameterization of SO(3). But they can still cause unexpected problems, e.g. any machine learning task involving quaternions will be made harder because the learned function must deal with the double covering.

        Of course, the same problem exists for angles in SO(2), and from what I've seen people usually deal with that by using the [sin, cos] pair instead.

edflsafoiewq 6 years ago

Anyone know an easy way to show that multiplication by a unit quaternion is a unitary operator?

  • xelxebar 6 years ago

    A little more exotic, but if you look here

    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".

  • joppy 6 years ago

    Unitary in what sense? Clearly multiplication by a unit quaternion preserves the quaternion norm.

    • edflsafoiewq 6 years ago

      In the sense of preserving the dot product, x.y = (ux).(uy).

      • joppy 6 years ago

        Since 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 6 years ago

          Ah, polarization? And for it preserving the norm you can use the conjugate. Easy! Thanks!

  • chombier 6 years ago

    You just have to show that the quaternion norm is multiplicative, which follows easily from its definition |q|^2 = q * conj(q).

choonway 6 years ago

Please use Lie Groups/Algebra instead.

  • edflsafoiewq 6 years ago

    Instead? Non-zero quaternions are a Lie group under multiplication...

    • choonway 6 years ago

      Yes, you are referring to SO(3) but SE(3) includes translations.

      • edflsafoiewq 6 years ago

        No, 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 6 years ago

          I was careful to put the Algebra after the Groups. :) Look up Matrix Exponentials and Logarithms, or just follow the link I gave above.

      • chombier 6 years ago

        Dual quaternions offer a cheap projection operator by means of dual normalization (very much like quaternion normalization), which the Lie group perspective does not provide.

        In fact this is probably the only reason to use dual quaternions at all.

        • choonway 6 years ago

          Quaternions are more efficient yes, but I would prefer the more general Screw theory.

          • chombier 6 years ago

            Really both are the same thing up to group homomorphism (double covering in this case).

            Dual quaternions only add a cheap way of blending several rigid transformations together, which is useful in computer graphics for skinning meshes around articulated rigid bodies.

bnolsen 6 years ago

left handed thingies. go to geometric algebra for the real meal deal.

paulgrant999 6 years ago

I 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 ;)