# Math Dopers... Quaternions?  (a primer, please?)

**URL:** <https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203>\
**Category:** Factual Questions\
**Created:** [May 10, 2005, 11:48am UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203 "2005-05-10T11:48:23Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 11, 2005, 5:05pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/21 "2005-05-11T17:05:25Z")

</div>

Oh, just one more interesting tidbit: The reason that the sedenions (how’s that for a word of the day?) don’t have multiplicative inverses in general is because they’re not nicely normed. IOW, for anything up to and including the octonions, you have that aa\* = (k, 0) for some constant k, and you can define 1/a as k/a\*. In the sedenions, that fails.

It would be interesting to see what aa\* is equal to in general, but that seems like a lot of work.

---

<div class="post-metadata">

**Author:** ![Loopydude](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Loopydude](https://boards.straightdope.com/u/Loopydude)\
**Post date:** [May 11, 2005, 5:13pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/22 "2005-05-11T17:13:11Z")

</div>

> [@Shalmanese](#):
>
> Quaternions are nice because, IIRC, theres a unique representation for every rotation. This means that you can compare 2 different rotations and see if they are the same or not.

I hope you’ll forgive a slight hijack from a math dummy:

One thing I’ve found rather mystifying about quantum field theory is the whole idea that spin 1/2 particles (common fermions) have to be rotated 720[sup]O[/sup] for them to look the same (the interferance properties of an electron, for instance, are only restored after two spatial rotations, suggesting rather bizarre topological properties). I’m not familiar enough with the math, except with my scratching the surface of matrix mechanics, but it seems to me that maybe these spin properties are described by the equivalent of a quaternion, such that if it has certain elements, it describes a fermion or a boson, and that operations representative of rotations yield different results depending on how those elements look after such operations.

---

<div class="post-metadata">

**Author:** ![tim314](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim314/32/3468_2.png) [@tim314](https://boards.straightdope.com/u/tim314)\
**Post date:** [May 11, 2005, 5:56pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/23 "2005-05-11T17:56:26Z")

</div>

> [@ultrafilter](#):
>
> Oh, just one more interesting tidbit: The reason that the sedenions (how’s that for a word of the day?) don’t have multiplicative inverses in general is because they’re not nicely normed. IOW, for anything up to and including the octonions, you have that aa\* = (k, 0) for some constant k, and you can define 1/a as k/a\*. In the sedenions, that fails.

You mean define 1/a as a\*/k, right?

> [@](#):
>
> It would be interesting to see what aa\* is equal to in general, but that seems like a lot of work.

Actually, I don’t think it’s that bad.

If (a,b)\* = (a\*, -b) and (a,b)(c,d) = (ac - db\*, a\*d + cb)

then wouldn’t it just be:

(a,b)(a,b)\* = (a,b)(a\*,-b) = (aa\* - (-b)b\*, a\*(-b)+a\*(b))

Note that when multiplication between a and b is associative, the second component is zero. This can be proven as follows:  
a\*(-b) + a\*(b) = a\*(-b + b) = a\*(0) = 0

However, without associativity this proof breaks down, and in fact it is no longer the case that the second component must be zero.

---

<div class="post-metadata">

**Author:** ![cppguy](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@cppguy](https://boards.straightdope.com/u/cppguy)\
**Post date:** [May 11, 2005, 6:05pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/24 "2005-05-11T18:05:09Z")

</div>

> [@pullin](#):
>
> I’ve started inheriting some old software which uses quaternions to (apparently) determine the relative position(s) and orientation of 2 objects in a (simulated) space.

You probably don’t want the general quaternions info then. I suggest reading section 5.25 of the comp.graphics.algorithms FAQ. It’s currently managed by Dave Eberly, and is a PDF file: [link](http://www.geometrictools.com/CgaFaq.pdf).

---

<div class="post-metadata">

**Author:** ![tim314](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim314/32/3468_2.png) [@tim314](https://boards.straightdope.com/u/tim314)\
**Post date:** [May 11, 2005, 6:08pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/25 "2005-05-11T18:08:15Z")

</div>

> [@Loopydude](#):
>
> I hope you’ll forgive a slight hijack from a math dummy:
> 
> One thing I’ve found rather mystifying about quantum field theory is the whole idea that spin 1/2 particles (common fermions) have to be rotated 720[sup]O[/sup] for them to look the same (the interferance properties of an electron, for instance, are only restored after two spatial rotations, suggesting rather bizarre topological properties). I’m not familiar enough with the math, except with my scratching the surface of matrix mechanics, but it seems to me that maybe these spin properties are described by the equivalent of a quaternion, such that if it has certain elements, it describes a fermion or a boson, and that operations representative of rotations yield different results depending on how those elements look after such operations.

Well, the [quaternions](http://mathworld.wolfram.com/Quaternion.html) can be represented as **i** times the [Pauli matrices](http://mathworld.wolfram.com/PauliMatrices.html), so it makes sense that they’d be related to spin.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 11, 2005, 6:11pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/26 "2005-05-11T18:11:55Z")

</div>

> [@tim314](#):
>
> You mean define 1/a as a\*/k, right?

Yeah.

> [@](#):
>
> However, without associativity this proof breaks down, and in fact it is no longer the case that the second component must be zero.

That doesn’t follow. There might be an alternative proof that works without associativity. You need a specific counterexample, like the one given at the end of [this page](http://www.math.niu.edu/~rusin/known-math/99/onions).

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [May 11, 2005, 6:40pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/27 "2005-05-11T18:40:54Z")

</div>

I think the real question here is whether an area of mathematics exists which **Mathochist** isn’t an expert on :eek:

---

<div class="post-metadata">

**Author:** ![tim314](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim314/32/3468_2.png) [@tim314](https://boards.straightdope.com/u/tim314)\
**Post date:** [May 11, 2005, 6:46pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/28 "2005-05-11T18:46:53Z")

</div>

> [@tim314](#):
>
> Note that when multiplication between a and b is associative, the second component is zero. This can be proven as follows:  
> a\*(-b) + a\*(b) = a\*(-b + b) = a\*(0) = 0
> 
> However, without associativity this proof breaks down, and in fact it is no longer the case that the second component must be zero.

Actually, I take that back. I used the distributive law, not associativity. I’m not quite sure why this wouldn’t work for non-associative F.

And at any rate, as **ultrafilter** said, that doesn’t prove there’s not some completely different way to show that (a,b)(a,b)\* = (k, 0). (I didn’t really try to prove this – I was actually trying to answer the question about what the general form of (a,b)(a,b)\* would be, and then just sort of tacked that stuff on. I’m not sure, other than by counter-example, how you’d prove that they’re no longer nicely normed when you use Cayley-Dickson on a non-associative F, but I’d like to see it if someone knows how.)

---

<div class="post-metadata">

**Author:** ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)\
**Post date:** [May 11, 2005, 8:35pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/29 "2005-05-11T20:35:48Z")

</div>

> [@tim314](#):
>
> Well, the [quaternions](http://mathworld.wolfram.com/Quaternion.html) can be represented as **i** times the [Pauli matrices](http://mathworld.wolfram.com/PauliMatrices.html), so it makes sense that they’d be related to spin.

As I posted elsewhere in this very thread, spin-1/2 particles are described by spin-1/2 representations of SO(3,1) (the Lorentz group), which contains as a subgroup that or rotations in 3-dimensional space: SO(3). The unit quaternions form the group SU(2), which is a double-cover of SO(3) and all representations of SO(3) are induced from representations of SU(2). If the kernel of the representation contains -1 (in SU(2)) the induced representation of SO(3) has integral spin, otherwise it has half-integral spin.

More topologically, SO(3) is SU(2)/{1,-1}. SU(2) is a 3-sphere, which is simply-connected. SO(3) is _not_ simply connected, which means that there is a closed loop which cannot be smoothly contracted to a point. However, going around that loop _twice_ gives a loop which _can_ be simply connected (since the simply-connected cover is a double-cover). In terms of actual rotations, turning around once may not “be the same” as staying still, but turning around twice must be.

---

<div class="post-metadata">

**Author:** ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)\
**Post date:** [May 11, 2005, 8:37pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/30 "2005-05-11T20:37:42Z")

</div>

> [@+MDI](#):
>
> I think the real question here is whether an area of mathematics exists which **Mathochist** isn’t an expert on :eek:

Analysis. I got through my quals and never looked back. It’s all about bounding this function up or that one down or the other one away from zero or some-such. Frankly, I’m just not that into bondage.

---

<div class="post-metadata">

**Author:** ![ralph124c](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@ralph124c](https://boards.straightdope.com/u/ralph124c)\
**Post date:** [May 11, 2005, 8:44pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/31 "2005-05-11T20:44:36Z")

</div>

I recall that quarternions were discovered/invented, by the early 19th mathematician (Sir William rowan Hamilton). his colleagues didn’t know what to use them for, so they were generally ignored (until recently).  
Just goes to show you…something formerly thought useless may well turn out to be something very useful!  
Now, if we could only apply them to analysis of the stock market! :smack:

---

<div class="post-metadata">

**Author:** ![Loopydude](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Loopydude](https://boards.straightdope.com/u/Loopydude)\
**Post date:** [May 11, 2005, 9:01pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/32 "2005-05-11T21:01:33Z")

</div>

> [@Mathochist](#):
>
> As I posted elsewhere in this very thread…

Bleh. Sorry **Mathocist** , I’ve been outed as a thread-skimmer once again.

---

<div class="post-metadata">

**Author:** ![Loopydude](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Loopydude](https://boards.straightdope.com/u/Loopydude)\
**Post date:** [May 11, 2005, 9:28pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/33 "2005-05-11T21:28:54Z")

</div>

> [@ralph124c](#):
>
> I recall that quarternions were discovered/invented, by the early 19th mathematician (Sir William rowan Hamilton). his colleagues didn’t know what to use them for, so they were generally ignored (until recently).  
> Just goes to show you…something formerly thought useless may well turn out to be something very useful!

I have to admit, I sometimes find the usefulness of mathematics positively creepy. Especially when the application is to something sufficiently weird as to be completely unintuitive. Reading these links about quaternions and Pauli matrices, which admittedly I barely grasp (due in no small part to the notiation formalities and jargon) tends to make my head hurt; but what I can apprehend with more concerted effort and time occasionally makes the hairs on my neck stand up. Think about it: Hamilton derives this incredibly (to me, anyway) abstract mathematical concept, it lies around for a hundred years or whatever, and then somebody else finds out it can be used to describe bizarre phenomena like spin, perhaps as precisely as can be measured. I think spin is bizarre, anyway. You have to rotate some things twice to make it return to its original state? Whah? And this is precisely calcuable, perhaps even predictable from using abstruse mathematical equations that were invented long before the concept was ever imagined? Maybe there’s nothing deeper going on here than more graspable associations, like drug metabolism and exponential functions, or parametric relationships of a similar kind that amount essentially to “curve fitting”.

---

<div class="post-metadata">

**Author:** ![Jake4](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@Jake4](https://boards.straightdope.com/u/Jake4)\
**Post date:** [May 11, 2005, 10:00pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/34 "2005-05-11T22:00:16Z")

</div>

FYI, I just read a review on /. of Roger Penrose’s “The Road to Reality: A Complete Guide to the Laws of the Universe.”

[here](http://science.slashdot.org/article.pl?sid=05/05/09/2145236)

My next stop after SDMB is the local library. Scifi can wait, I’m going to read a little sci-fact. Or theory, at least.

---

<div class="post-metadata">

**Author:** ![pullin](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pullin](https://boards.straightdope.com/u/pullin)\
**Post date:** [May 12, 2005, 2:44am UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/35 "2005-05-12T02:44:07Z")

</div>

Saw the same thing when I was over there Jake (/.) I’m off to amazon now. Thanks everybody. I printed out a lot of the info in the links, and am trying to grasp it now. I haven’t decided which book to get, yet. I’m determined to understand this (all the other programmers fled when they saw this code. Being the old-guy, I couldn’t run as fast. So it’s mine.)

Ya’ll are amazing. (This board is amazing)

Thanks again…

---

<div class="post-metadata">

**Author:** ![Loopydude](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@Loopydude](https://boards.straightdope.com/u/Loopydude)\
**Post date:** [May 12, 2005, 2:56am UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/36 "2005-05-12T02:56:43Z")

</div>

Y’all let us know (maybe in Cafe) how that book is. I’ve thought of getting it, but it intimidates the hell out of me. _What Is Quantum Mechanics? (A Physics Adventure)_ made me weep hard enough at my own stupidity; so do I need Penrose to drive the point home? Or can a math idiot like me get some deep knowledge out of it? I’d be interested to hear people’s impressions.

Sorry again for hijacking.

---

<div class="post-metadata">

**Author:** ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)\
**Post date:** [May 12, 2005, 10:49am UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/37 "2005-05-12T10:49:17Z")

</div>

I thought I would hijack this thread since there seems to be quite a few quaternion experts here. I’m currently trying to implement an algorithm that is iteratively trying to find a minima of a function f® where R represents a rotation via a simple hill climbing algorithm.

What I need to figure out is a way to generate rotations that are “close” to any given R. Would quaternions be the best representation for this? And how would I do it?

---

<div class="post-metadata">

**Author:** ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)\
**Post date:** [May 12, 2005, 12:29pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/38 "2005-05-12T12:29:26Z")

</div>

> [@Loopydude](#):
>
> > [@ralph124c](#):
> >
> > I recall that quarternions were discovered/invented, by the early 19th mathematician (Sir William rowan Hamilton). his colleagues didn’t know what to use them for, so they were generally ignored (until recently).  
> > Just goes to show you…something formerly thought useless may well turn out to be something very useful!
> 
> I have to admit, I sometimes find the usefulness of mathematics positively creepy. Especially when the application is to something sufficiently weird as to be completely unintuitive. Reading these links about quaternions and Pauli matrices, which admittedly I barely grasp (due in no small part to the notiation formalities and jargon) tends to make my head hurt; but what I can apprehend with more concerted effort and time occasionally makes the hairs on my neck stand up. Think about it: Hamilton derives this incredibly (to me, anyway) abstract mathematical concept, it lies around for a hundred years or whatever, and then somebody else finds out it can be used to describe bizarre phenomena like spin, perhaps as precisely as can be measured. I think spin is bizarre, anyway. You have to rotate some things twice to make it return to its original state? Whah? And this is precisely calcuable, perhaps even predictable from using abstruse mathematical equations that were invented long before the concept was ever imagined? Maybe there’s nothing deeper going on here than more graspable associations, like drug metabolism and exponential functions, or parametric relationships of a similar kind that amount essentially to “curve fitting”.

This “lies around for a hundred years” and “generally ignored (until recently)” stuff is just nonsense.

Hamilton published in 1843. The concept was picked up almost immediately by one James Clerk Maxwell, who used it in his 1873 _Treatise on Electricity and Magnetism_. This was the thing that lead, inexorably, to Einstein’s special relativity, quantum mechanics, and god-knows-what-else. The whole vector calculus thing took off from this point.

A bit of history here:

[http://www.hypercomplex.com/education/intro\_tutorial/nabla.html](http://www.hypercomplex.com/education/intro_tutorial/nabla.html)

---

<div class="post-metadata">

**Author:** ![Desmostylus](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@Desmostylus](https://boards.straightdope.com/u/Desmostylus)\
**Post date:** [May 12, 2005, 1:09pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/39 "2005-05-12T13:09:51Z")

</div>

A bit more of the history:

[http://history.hyperjeff.net/hypercomplex.html](http://history.hyperjeff.net/hypercomplex.html)

[http://www-groups.dcs.st-and.ac.uk/~history/HistTopics/Abstract\_linear\_spaces.html](http://www-groups.dcs.st-and.ac.uk/~history/HistTopics/Abstract_linear_spaces.html)

---

<div class="post-metadata">

**Author:** ![tim314](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim314/32/3468_2.png) [@tim314](https://boards.straightdope.com/u/tim314)\
**Post date:** [May 12, 2005, 1:27pm UTC](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203/40 "2005-05-12T13:27:57Z")

</div>

> [@Desmostylus](#):
>
> This “lies around for a hundred years” and “generally ignored (until recently)” stuff is just nonsense.
> 
> Hamilton published in 1843. The concept was picked up almost immediately by one James Clerk Maxwell, who used it in his 1873 _Treatise on Electricity and Magnetism_. This was the thing that lead, inexorably, to Einstein’s special relativity, quantum mechanics, and god-knows-what-else. The whole vector calculus thing took off from this point.

Hamilton may have invented the Nabla operator to deal with quaternions, but as the article you cited states it was redefined in 1881 in terms of Cartesian unit vectors, not quaternions. Also, the article says that in Maxwell’s _Treatise on Electricity and Magnetism_, he “writes everthing in coordinate notation, and only then are some of the main final results repeated again in quaternions.” So while it’s certainly not true to say quaternions were ignored, it seems like they were more of an inspiration for the vector calculus used in Maxwell’s electromagnetism and other areas of physics, rather than an essential part of those theories. At any rate, it doesn’t seem absurd to say that it was a convenient twist of fate that the mathematics for dealing with quantum mechanical spin happened to be invented many decades before any physical quantity that behaves like spin was known to exist.

[Previous page](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203.md?page=1)

[Next page](https://boards.straightdope.com/t/math-dopers-quaternions-a-primer-please/303203.md?page=3)
