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.
Quaternions
41–50 of 118 posts
Re: Quaternions
#42tldr: 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…
>
>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, that is to say, the most well-known and basic imaginary number, if I'm reading this right.
They are not the same thing. All of these are equal to -1 when squared, but they are different when multiplied by any other of this set and multiplication between them is anti-commutative.
>As for the second part, I can't even begin to unravel the significance. I know it must not be, but it just seems like arbitrary rules added for... some unknown reason.
>
These are not added for unknown reasons. They specify rotations of unitary vectors of a canonical base around one another.
>> 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(theta/2)u .
>>
>Oooooh kay... 1) Where'd w go?
The coordinate 'w' is the real part. For the vector 'u', such coordinate is 0. For 'p' and 'p'', it is cos(theta/2).
>Is this one of those things where there's a (situationally-defined) constant in the formula but we just pretend it doesn't exist most of the time (until it comes time to actually use the math to, like, do anything real)?
No.
>Would we need to bring it back in to apply the rest of this?
No. Just follow the rules to multiply hypercomplex numbers and the rotation will occur.
>2) "u =" is just defining something, fine, but (x, y, z) doesn't seem to equal the thing after it at all—I suppose this is a shorthand function notation, though it seems really weird to me to use equality to relate that. Am I right, or is this something else?,
The notation '(x, y, z)' is just a shorter notation for "xi + yj + zk". For this problem, the vector 'u' defines the axis of rotation.
>3) A quaternion is... a point, then? Since we're rotating around it?
You can see a quaternion as a point in R^4 since it has 4 coordinates. Actually it describes an axis of rotation, by its imaginary part, and the angle of rotation.
>4) I've got a feeling that theta needs a direction in this hypercomplex space but don't see where it's coming from. Somewhere "off screen", in this explanation? Or is it there but I'm not seeing it?
>
The axis of rotation is actually the vector "u".
Re: Quaternions
#43tldr: 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…
Re: Quaternions
#44In 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.
Came here to say this! I always felt like quaternions weren't a perfect fit for 3d rotation, and when I finally learned about bivectors my faith in the elegance of mathematics was restored :D I liked this article: https://marctenbosch.com/quaternions/
Yikes! This is the sort of thing that scares people away from complex numbers from a young age.
Re: Quaternions
#45tldr: 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…
Why should -1 have three distinct imaginary roots? Well, why should it have one? Essentially, we just made up i, and we found out that the complex numbers had some really useful algebraic properties. The same is true of the quaternions.
But why not two imaginary roots, or four, or 17? Those turn out not to have nice algebraic properties. The only other thing out there are the octonions, with 7 imaginary roots.
Re: Quaternions
#46Re: Quaternions
#47Earlier 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…
>> 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…
> The axis of rotation is actually the vector "u".
Ah, I thought the vector was what we were rotating.
Re: Quaternions
#48Earlier quoted context omitted.
Came here to say this! I always felt like quaternions weren't a perfect fit for 3d rotation, and when I finally learned about bivectors my faith in the elegance of mathematics was restored :D I liked this article: https://marctenbosch.com/quaternions/
> Why does i2=j2=k2=−1 and ij=k? Why do we take a vector and upgrade it to an "imaginary" vector in order to transform it, like q(xi+yj+zk)q∗? Who cares as long as it rotates vectors the right way, right? Yikes! This is the sort of thing that scares people away from complex numbers from a young age.
Re: Quaternions
#49Complex numbers (2-dimensional): No more ordering
Quaternions (4-dimensional): No more commutative multiplication
Octonions (8-dimensional): No more associative multiplication
Sedenions (16-dimensional): We lose the alternative property, i.e., with octonions its still true that x(xy) = (xx)y but with sedenions it is not.
We can continue this process indefinitely, although I know nothing of the characteristics of trigintaduonions or what comes later. I suspect that it might be the loss of the flexible identity next, a(ba) = (ab)a but I don't know for sure.
Re: Quaternions
#50Check out a demo https://observablehq.com/@enkimute/animated-orbits
Join the discord https://discord.gg/vGY6pPk.
Enki (the guy behind bivector) also gave a talk on GA at SIGGRAPH 2019 https://www.youtube.com/watch?v=tX4H_ctggYo