Live data from Hacker News

Let's remove Quaternions from every 3D Engine

marctenbosch.com

161–170 of 184 posts

Re: Let's remove Quaternions from every 3D Engine

#161

Earlier quoted context omitted.

Thank you for posting this, I found it both very enlightening and a pretty fun internet-drama read :D Interesting that the original complaint of that article/thread and this one are both the same - ie. quaternions are 'too hard to understand', and people 'use them without knowing how they work'. With this being posted so soon after https://news.ycombinator.com/item?id=18310788 , I feel like that complaint is less val…

I think matrices are easier for people to visualize because they can think about them as a vector frame and coordinate transformations. Quaternions are seen as this abstract 4D space somehow containing 3D space transformations, and people have a much harder time visualizing 4D space. I do not think spending a lot of time trying to visualize this 4D space, like this video does, is the right way to go. Rotors make that…

I mean, the math of quaternions just sucks for intuitive understanding.

It's not so much about how they 'magically contain 3d transformations', because you can (and I was taught that way) derive generalized quaternion rotation by writing down the math to rotate a vector around an axis by a certain angle, and then given quaternions and their computational rules as a black box, you can bend that math you wrote down into a shape that fits exactly into quaternions.

In that sense how they contain 3D transformations can be made completely intuitive via just mathematical derivation. You don't really need to visualize quaternions that way because you can visualize it using the basic tools - axis and angle - and then just saying that Quaternions are just a way to hammer that into a compact mathematical shape with certain neat properties.

Imo it's almost exactly the same as gaining an understanding of why you plug translations in matrices into a fourth column and all the accompanying shenanigans with homogeneous coordinates where the other basic operations only require 3 columns when you can just translate stuff by adding the translation vector onto your existing vector: Well, it's a neat mathematical tool with extra neat properties like being able to concatenate a wild series of translations intermingling with other transformations, and putting it all into a single matrix.

The problem with quaternions itself is that you always have that black box that is completely sufficient to working with them on an advanced level, but you will have that uneasiness of a looming black box of nonunderstanding unless you go on a voluntary tangent into a different mathematical field and its accompanying history of how and why they were created in the first place.

Re: Let's remove Quaternions from every 3D Engine

#162

I do love Geometric Albegra and hope it gets further adoption. In my field (physics), the project of moving to geometric algebra currently looks hopeless due to the inertia of other formalisms and lack of interest from established physicists. The real shame is that the best opportunity to introduce physicists to geometric algebra was a hundred years ago when we were first discovering spinors. First the Pauli algebra…

Can I ask you (and keldaris) what precisely you mean by geometric algebra, and how you would propose to teach it? I'm a math professor. To me "geometric algebra" refers to any use of geometry in mathematics to illuminate algebraic principles. There are very very many of these -- this article illustrates one good example. I try to incorporate intuition from geometry into my teaching whenever possible. It seems that th…

I'm not any of the two you asked, but given that @eigenspace is a physicist, what you are looking for (notations used, etc) is possibly here:

http://geocalc.clas.asu.edu/html/Evolution.html#References

under "Recent Books". Notably "Clifford Algebra to Geometric Calculus" and "New Foundations for Classical Mechanics" by Hestenes.

PD: if you ever attempt to read any of those two, I'd advise to go to the latest (corrected) reprint.

Re: Let's remove Quaternions from every 3D Engine

#163

Earlier quoted context omitted.

As someone unable to fathom the enthusiasm for geometric algebra... at least this defines this product: It's the sum of an inner product and a wedge product. Acting on two vectors these give a scalar and a 2-form. Why is adding these different objects a good idea? Don't they have different units (like, a pure number vs meters squared)?

It's analogous to the real and imaginary parts of a complex number. Does it makes sense to add a real number and a purely imaginary number? Aren't they different kinds of things? Yes, and yes!

Sure, you've defined a map V⊗V → R⊕T, where T means 2-forms. But I still don't see why this is useful, apart from being able to extract from it both the wedge product and the inner product which you started with.

Re: Let's remove Quaternions from every 3D Engine

#164

I do love Geometric Albegra and hope it gets further adoption. In my field (physics), the project of moving to geometric algebra currently looks hopeless due to the inertia of other formalisms and lack of interest from established physicists. The real shame is that the best opportunity to introduce physicists to geometric algebra was a hundred years ago when we were first discovering spinors. First the Pauli algebra…

Can I ask you (and keldaris) what precisely you mean by geometric algebra, and how you would propose to teach it? I'm a math professor. To me "geometric algebra" refers to any use of geometry in mathematics to illuminate algebraic principles. There are very very many of these -- this article illustrates one good example. I try to incorporate intuition from geometry into my teaching whenever possible. It seems that th…

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

Less ambiguously called "Clifford algebras", though Clifford himself prefered the term geometric algebra.

Re: Let's remove Quaternions from every 3D Engine

#165

I do love Geometric Albegra and hope it gets further adoption. In my field (physics), the project of moving to geometric algebra currently looks hopeless due to the inertia of other formalisms and lack of interest from established physicists. The real shame is that the best opportunity to introduce physicists to geometric algebra was a hundred years ago when we were first discovering spinors. First the Pauli algebra…

Can I ask you (and keldaris) what precisely you mean by geometric algebra, and how you would propose to teach it? I'm a math professor. To me "geometric algebra" refers to any use of geometry in mathematics to illuminate algebraic principles. There are very very many of these -- this article illustrates one good example. I try to incorporate intuition from geometry into my teaching whenever possible. It seems that th…

[deleted]

Re: Let's remove Quaternions from every 3D Engine

#166

I do love Geometric Albegra and hope it gets further adoption. In my field (physics), the project of moving to geometric algebra currently looks hopeless due to the inertia of other formalisms and lack of interest from established physicists. The real shame is that the best opportunity to introduce physicists to geometric algebra was a hundred years ago when we were first discovering spinors. First the Pauli algebra…

Can I ask you (and keldaris) what precisely you mean by geometric algebra, and how you would propose to teach it? I'm a math professor. To me "geometric algebra" refers to any use of geometry in mathematics to illuminate algebraic principles. There are very very many of these -- this article illustrates one good example. I try to incorporate intuition from geometry into my teaching whenever possible. It seems that th…

Geometric algebra has a definition that is more specific than any use of geometry to teach Elementary Algebra on real numbers.

https://en.m.wikipedia.org/wiki/Geometric_algebra

https://en.m.wikipedia.org/wiki/Clifford_algebra

For teaching geometric algebra, there are curricula and textbooks available...

http://geometry.mrao.cam.ac.uk/home/introduction-to-ga/

https://arxiv.org/abs/1205.5935v1

http://www.faculty.luther.edu/~macdonal/GA&GC.pdf

http://assets.cambridge.org/052148/0221/sample/0521480221WS....

http://geometricalgebra.org/downloads/ga4cs_toc.pdf

https://www.amazon.com/dp/0792355148/

Re: Let's remove Quaternions from every 3D Engine

#167
post #132

Earlier quoted context omitted.

No. 3D rotors are represented exactly the same way as quaternions- 4 scalars. The operations are the same as well, only the explanation is different.

Partially true, internally libraries represent the rotor as just four scalars and can convert these to a quaternion. However, to actually make use of the rotor to do anything useful, e.g. interpolate, which is a power quaternion math has innately, you need to provide a lot more external information; plane origin vector, bivector, angle. A 3D file format storing the transformations between joints of the skeleton of a…

You are misunderstanding. A quaternion literally is a scalar + bivector (“imaginary”) rotor. We are talking about the same 4 numbers.

It lives inside a geometric algebra which also includes vectors and trivectors, but those are not part of the rotor.

If you store a rotor as a general 3D multivector, it will have 8 entries 4 of which are always 0; this could be done to simplify your code (then you only need one multivector type), but is not a good idea for efficiency of computation/transmission if you need to represent large numbers of rotations and their transmission might be a bottleneck.

Re: Let's remove Quaternions from every 3D Engine

#168

Earlier quoted context omitted.

Partially true, internally libraries represent the rotor as just four scalars and can convert these to a quaternion. However, to actually make use of the rotor to do anything useful, e.g. interpolate, which is a power quaternion math has innately, you need to provide a lot more external information; plane origin vector, bivector, angle. A 3D file format storing the transformations between joints of the skeleton of a…

You are misunderstanding. A quaternion literally is a scalar + bivector (“imaginary”) rotor. We are talking about the same 4 numbers. It lives inside a geometric algebra which also includes vectors and trivectors, but those are not part of the rotor. If you store a rotor as a general 3D multivector, it will have 8 entries 4 of which are always 0; this could be done to simplify your code (then you only need one multiv…

According to the formula I provided, to slerp for example, rotors require lambda and theta. Whereas quaternions only require the lambda. Is there an alternative I'm missing?

Re: Let's remove Quaternions from every 3D Engine

#169

Earlier quoted context omitted.

You are misunderstanding. A quaternion literally is a scalar + bivector (“imaginary”) rotor. We are talking about the same 4 numbers. It lives inside a geometric algebra which also includes vectors and trivectors, but those are not part of the rotor. If you store a rotor as a general 3D multivector, it will have 8 entries 4 of which are always 0; this could be done to simplify your code (then you only need one multiv…

According to the formula I provided, to slerp for example, rotors require lambda and theta. Whereas quaternions only require the lambda. Is there an alternative I'm missing?

Which formula are you talking about? The arithmetic is literally exactly the same.

“Slerp” just means follow a path on a circle at uniform speed (i.e. “use trigonometry”). In this case, we are talking about a circle on the conceptual unit 4-sphere. It doesn’t really matter what names we call the basis elements.

Re: Let's remove Quaternions from every 3D Engine

#170

Earlier quoted context omitted.

I should be clear here that my longing for a physics community that embraces GA should not be confused with any level of optimism that it'll actually happen. I agree its a monstrously difficult task and our current formalisms are more or less good enough. A man can dream though! One advantage I see in the GA treatment of E&M is in radiation. If one takes the Faraday bivector for a stationary charge (ie. the Coulumb f…

How do you "just 'rotate'" bivector into accelerated frame? Because if you're talking about Lorentz transformations between inertial frames, those alone can't give you radiation fields. To get radiation fields, you need Maxwell's equations and boundary conditions. When you have those, what is the use of GA?

Yes, it seems I have oversimplified things. My apologies, it's been a little while. Instead of the prescription I described, here is what one must do:

1) Start with the Coulomb potential A(r) = qγ₀/(4πr)

2) make it covariant by replacing r -> r -> X⋅γ₀ where X = r(γ₀ + γᵣ). This is a trivial transformation in the static frame as one can easily show X⋅γ₀ == r, but it's important as it encodes the causal information you astutely pointed out is vital to obtaining radiation solutions.

This gives A(r) = qγ₀/(4π X⋅γ₀)

3) Now, one can 'rotate' this to a frame with (not necessarily constant) velocity v via A'(r) = R A(R̃ x R) R̃ ie. evaluate the rotated A at inverse rotate spacetime position. Then

A'(r) = q v/(4π X⋅v)

This is the Liénard–Wiechert potential (this can also be obtained by solving ∇²A = J using the retarded Green's function G(r, t) = δ(|r|-t)/(4π|r|).

4) Now once can get the radiation fields by taking the derivative of this and doing some algebra:

F = ∇A = (q/4π) (X ∧ v + ½ X(v̇ ∧ v)X)/(X⋅v)³

The term proportional to X ∧ v is just the Coulomb field, but the term with the X(v̇ ∧ v)X is the radiation field which one can show propagates to infinity.

This is unfortunately much less elegant and straightforward than I let on initially so I apologize.

I still think this has advantages over standard treatments but your milage may vary.

Post reply on HN