Live data from Hacker News

Quaternions

liorsinai.github.io

51–60 of 118 posts

Re: Quaternions

#51

This is fine; there are lots of similar "intro to quaternions" pages around. One thing I haven't seen yet is someone showing how to interpolate between multiple quaternions over time, smoothly. (Hint: it's not slerp.) It's a non-trivial problem.

> Hint: it's not slerp.

What is slerp?

Re: Quaternions

#52

Earlier quoted context omitted.

>> Quaternions are hypercomplex numbers of the form > >I'm gonna guess "hypercomplex" means "involves imaginary numbers" due to the rest of this. Think it is right. >> >> Where w, x, y, and z are real and i^2 = j^2 = k^2 = -1 and ij = k, ji = -k, jk = i, kj = -i, ki = j, ik = -j. > >Why even use different letters for i, j, and k, if they're all the same thing? Which thing appears to be i, as in, the square root of -1…

Thank you, this was very helpful. > The axis of rotation is actually the vector "u". Ah, I thought the vector was what we were rotating.

I think "p" is better described as a point instead of a vector. So, a better writing could be: "[..]it is possible rotate any point q by an angle theta around the axis define by u [...]"

Re: Quaternions

#54
post #21

Earlier quoted context omitted.

10-12 years ago, the consensus used to be that this singularity simply does not show up in the wild in the vast majority of scenarios, and the performance hit of using `slerp()` is just not worth it unless truly needed. It was essentially the same reasoning as for using `-ffast-math`. Yeah it's not "correct", but users can't tell the difference and it has a measurable performance benefit. To be clear, I'm not questio…

Yeah, I understand. I just wanted to show that one can understand the exact nature of the approximation in 2D geometry. I think it's useful to think of it as a separate category of "wrong" than -ffast-math, which is "wrong" because two expressions that are mathematically equivalent over real numbers, like a + (b + c) and (a + b) + c, are not equivalent over floating-point numbers. Using lerp in place of slerp is like…

My apologies. I thought you were providing an explanation as to why slerp() is preferred in general. The circle example is a really good way to frame the distinction.

Re: Quaternions

#55
post #51

This is fine; there are lots of similar "intro to quaternions" pages around. One thing I haven't seen yet is someone showing how to interpolate between multiple quaternions over time, smoothly. (Hint: it's not slerp.) It's a non-trivial problem.

> Hint: it's not slerp. What is slerp?

Spherical linear interpolation. (https://en.m.wikipedia.org/wiki/Slerp)

Re: Quaternions

#56

This is fine; there are lots of similar "intro to quaternions" pages around. One thing I haven't seen yet is someone showing how to interpolate between multiple quaternions over time, smoothly. (Hint: it's not slerp.) It's a non-trivial problem.

See "A General Construction Scheme for Unit Quaternion Curves with Simple High Order Derivatives" (Kim, 1995) for a simple extension of Hermite splines to Lie groups, including unit quaternions.

Re: Quaternions

#57

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.

Specifically, GA allows you to invent complex numbers, quaternions, etc. very easily instead of it taking hundreds of years.

I've read linear and geometric algebra and it's amazing for linear operations. Unfortunately it gets more complex when you want to use it for nonlinear operations (such as translation) - now you need to use CGA or PGA or something. Still, seems like it would be amazing for computer graphics, physical simulation, etc. especially if someone can figure out a good strategy for efficient compilation (e.g. representing a multivector with exactly the minimal number of non-zero entries, with non-zero basis elements tracked at compile time).

Re: Quaternions

#58

> although a lecturer once eluded to them during a class in my masters Would be more amusing if "they eluded a lecturer" or "a lecturer once elided them". ("alluded to them").

also: gimbol -> gimbal

I came here to report the same two typos. Thanks.

Re: Quaternions

#59

tldr: Simply explained without demonstrations: Quaternions are hypercomplex numbers of the form w + xi + yj + zk Where w, x, y, and z are real and i^2 = j^2 = k^2 = -1 and ij = k, ji = -k, jk = i, kj = -i, ki = j, ik = -j. Being u = (x, y, z) = xi + yj + zk a unitary vector, it is possible rotate any vector q by an angle theta around u by doing: pqp' where p = cos(theta/2) + sin(theta/2)u and p' = cos(theta/2) - sin(…

> Quaternions are hypercomplex numbers of the form I'm gonna guess "hypercomplex" means "involves imaginary numbers" due to the rest of this. > Where w, x, y, and z are real and i^2 = j^2 = k^2 = -1 and ij = k, ji = -k, jk = i, kj = -i, ki = j, ik = -j. Why even use different letters for i, j, and k, if they're all the same thing? Which thing appears to be i, as in, the square root of -1, that is to say, the most wel…

Sounds a lot like the first time I tried to understand quaternions. The explanation in geometric algebra as a scalar and bivector gives it an intuitive geometric sense that words like words like "hypercomplex" fail to. Others here have linked to that material.

Re: Quaternions

#60

Earlier quoted context omitted.

> Quaternions are hypercomplex numbers of the form I'm gonna guess "hypercomplex" means "involves imaginary numbers" due to the rest of this. > Where w, x, y, and z are real and i^2 = j^2 = k^2 = -1 and ij = k, ji = -k, jk = i, kj = -i, ki = j, ik = -j. Why even use different letters for i, j, and k, if they're all the same thing? Which thing appears to be i, as in, the square root of -1, that is to say, the most wel…

It seems to me that i, j, and k are three things that have the same property, not three identical things.

TIL that not every imaginary number is just "i" with optional scaling applied. Was taught "the square root of negative one is i".
Post reply on HN