News for hackers. Stuff that matters.
Re:How Quaternions encode rotations: derivation and sample code by Sharlin on Wednesday September 07, 2016 @08:19AM (#12442702)
If you only want to represent a rotation there's some extra information in a quaternion, just like there is in a complex number - an arbitrary number in C actually represents rotation-and-scale where the magnitude of the number is the scale factor. If you stick to numbers with unit magnitude, given one part you can calculate the other, up to reflection. Similarly, with a unit quaternion you can calculate any one component given the other three, again up to reflection.

In general the number of real numbers needed to describe a rotation is the number of rotational degrees of freedom. This number is n(n - 1) / 2 in n dimensions, or C(n, 2), basically the number of orthogonal (2-)planes of rotation in R^n.

[0] https://en.wikipedia.org/wiki/Degrees_of_freedom_(mechanics)

Re:How Quaternions encode rotations: derivation and sample code by UlyssesSKrunk on Wednesday September 07, 2016 @02:48PM (#12445968)
So in 3d that becomes 3(2)/2 = 3. Quaternions have 4 parts. That's what has always made it hard for me to understand.
Re:How Quaternions encode rotations: derivation and sample code by Sharlin on Wednesday September 07, 2016 @11:19PM (#12450048)
And in 2D it is 1 but complex numbers have two parts. As I tried to explain, there's simply some redundancy in the representations because it's just unit complex numbers/quaternions that we're interested in. We accept that because it makes the math prettier. Heck, matrices, the de facto standard for representing rotations, have much more redundancy - four and nine elements in 2D and 3D respectively.