Live data from Hacker News

Quaternions

liorsinai.github.io

71–80 of 118 posts

Re: Quaternions

#71

Ask HN: Do quaternions have any interesting properties, akin to those of complex numbers, when calculus is applied? The only application I've ever seen is for doing rotations in computer graphics.

If I understand correctly, yes, calculus on quaternions is a useful thing. I'm not sure whether or not you have an equivalent of the residue theorem from the calculus of complex variables, but I'm pretty sure that you can do path integrals and stuff...

John Baez was tweeting about this recently:

https://twitter.com/johncarlosbaez/status/146720413326244659...

Re: Quaternions

#72
post #40

Earlier quoted context omitted.

The story goes that he was with his wife going to a dinner. On the way he got the flash of insight after years of working on the problem but he had no paper to write it down. When passing a bridge, he carved the equation on the side of the bridge to remind himself on the way back after the dinner.

always have a bridge nearby whenever you're trying to enter history

Ah that explains my failed attempts. It was always too far.

Re: Quaternions

#73

In my opinion, Geometric Algebra and bivectors ( https://bivector.net ) in particular is a much better (both practically and pedagogically) approach compared to quaternions and significantly more elegant. It's a real shame that people continue to focus so much on quaternions in this day and age.

GA is much slower in practice and takes more to store. In places speed and cache are important, quaternions are much better.

Game engines don't need much if anything from GA (and I've written about using GA decades ago for software, and did it for some time, before realizing that trading that elegance for worse performance was not worth it).

Here's [1] one example from the godfather of GA demonstrating how poorly GA performs

[1] https://webspace.science.uu.nl/~kreve101/asci/GAraytracer.pd...

Re: Quaternions

#74
I remember "quarternions" from my math-heavy computer graphics class.

Today, I have zero recollection of what they were or why it was in my graphics class. Heck I barely remember anything from that class today, which is ironical considering it was a required class for me to graduate that semester.

I wish my job had atleast a little more to do withwhat I learnt in college.

(I'm a web developer, and I'd like to get closer to the machine.)

Re: Quaternions

#75

In my opinion, Geometric Algebra and bivectors ( https://bivector.net ) in particular is a much better (both practically and pedagogically) approach compared to quaternions and significantly more elegant. It's a real shame that people continue to focus so much on quaternions in this day and age.

Quanternions' ubiquity is relatively recent. Rotation matrices ruled supreme in games and graphics and it was only after concerted effort to abolish R's were Q's made ubiquitous.

Two heartbeats later, we're bearish on Q's.

Re: Quaternions

#76

In my opinion, Geometric Algebra and bivectors ( https://bivector.net ) in particular is a much better (both practically and pedagogically) approach compared to quaternions and significantly more elegant. It's a real shame that people continue to focus so much on quaternions in this day and age.

GA is much slower in practice and takes more to store. In places speed and cache are important, quaternions are much better. Game engines don't need much if anything from GA (and I've written about using GA decades ago for software, and did it for some time, before realizing that trading that elegance for worse performance was not worth it). Here's [1] one example from the godfather of GA demonstrating how poorly GA…

I have done some experiments with type-directed static optimization of geometric algebra, but I didn’t get far enough to find out if it would scale up to real applications. The idea was to represent in the type system which components are known to be zero, so that (for instance) the GA representation of a vector or a rotation is the same size as it would be as a traditional matrix-based linear algebra. And the type system can check that the resulting of an operation is what you expect, eg, two planes intersect in a line. So, similar optimizations to gaigen, but (I hoped) more automatic and less runtime machinery. But as I said, I didn’t get it to work.

Re: Quaternions

#77
Quaternion trivia.

There was at one point a debate in physics about whether it was better to use quaternions or linear algebra for physics. With i, j, and k being the unit vectors, and the real numbers representing time. In the end, of course, linear algebra won. But we still use i, j, and k as the unit vectors. And in electrical engineering where i wound up hijacked for current, they use j as the square root of -1.

Re: Quaternions

#78
post #49

I first encountered quaternions in the concept of abstract algebra. It's interesting to think of it as part of a spectrum starting with reals and continuing to octonions (and beyond). Interestingly with each extension we lose something: Complex numbers (2-dimensional): No more ordering Quaternions (4-dimensional): No more commutative multiplication Octonions (8-dimensional): No more associative multiplication Sedenio…

Interestingly, if we go in the opposite direction we also loose something:

Real numbers (1-dimensional): No more algebraic closure [1]

though as you suggest we do gain a nice ordering where "nice" means "compatible with operations". BTW, you can always impose some ordering on all of these sets. It is the orderings' compatibility with arithmetic that we lose going from real numbers to complex numbers.

This can be generalized a little. Real numbers fail to be algebraically closed because some real polynomials lack real solutions, e.g. xx=-2. Complex numbers "fix" this problem since there every n degree polynomial has exactly n roots (counting multiplicity). In a sense, quaternions overdo this, e.g. xx=-2 has an infinite number of solutions (exercise for the reader). However, since quaternion multiplication is not commutative, polynomials as traditionally understood are ill-defined. For example, axx, xax and xxa are different degree two quaternion "polynomials". Ugh.

[1]: https://en.wikipedia.org/wiki/Algebraically_closed_field

Re: Quaternions

#79
post #49

I first encountered quaternions in the concept of abstract algebra. It's interesting to think of it as part of a spectrum starting with reals and continuing to octonions (and beyond). Interestingly with each extension we lose something: Complex numbers (2-dimensional): No more ordering Quaternions (4-dimensional): No more commutative multiplication Octonions (8-dimensional): No more associative multiplication Sedenio…

First 4 (reals, complex, quaternions, octonions) are normed division algebras.

Normed means that each number has associated nonnegative real number that describes the "size" of the number, also |xy| Sedions and the rest are less useful because they are not normed algebras.

Re: Quaternions

#80
One interesting thing about quaternions that’s almost never mentioned anywhere on the internets, there’re two conventions for them.

The convention in that article is known as “Hamilton's quaternions”. There’s another incompatible one usually called “JPL quaternions”, for some American Jet Propulsion Laboratory.

Authors of 99% articles about the quaternions, and software libraries implementing quaternions, are assuming exactly one of these conventions, and almost never mention which one that is.

More info there: https://fzheng.me/2017/11/12/quaternion_conventions_en/

Post reply on HN