News for hackers. Stuff that matters.
Re:Quaternion Knowledge Graph Embeddings by barfbagginus on Thursday April 25, 2024 @07:07AM (#40155967)
I recently took the plunge and learned unit quaternions and dual quaternions for representing rotations, compound rotation-translations, and kinematic chains and geometric interpolation (serial and parallel robot arms, character skeletons, skinning).

The advantages I found are:

Unit quaternions represent rotations with less redundancy than matrices

It's easier and more intuitive to derive, manipulate, simplify, interpolate, and solve quaternions than matrices.

They're less abstract/more concrete than matrices.

Rotating with quaternions takes fewer multiplications than matrices.

Dual quaternion inverse kinematics are easier to derive and faster than matrices

Unit and Dual quaternions have an efficient implicit form, which further speeds up IK. See: https://www.researchgate.net/profile/Neil-Dantam/publication...

Re:Quaternion Knowledge Graph Embeddings by captaincaveman on Thursday April 25, 2024 @11:39AM (#40158851)
Re:Quaternion Knowledge Graph Embeddings by barfbagginus on Friday April 26, 2024 @10:36AM (#40169871)
Quaternions makes it hard to imagine why gimbal lock would even have to be a problem.

Normally it happens because we have to solve a rotation into potentially redundant roll, pitch and yaw factors.

In Q, you can just write the axis of rotation as a unit vector quaternion v = v1 i + v2 j + v3 k. That pure vector quaternion represents a 180 degree rotation around v. Other rotations around v are interpolations between v and the identity rotation scalar 1:

w = a1 + bv, where a^2 + b^2 = 1.

This is a circular analogue of linear interpolation. Indeed, if t in [0, 1] is our rotation angle, we observe:

a = cos(pi t) b = sin(pi t)

And we can reduce

w = a + sqrt(1-a^2)*v

Where a \in [-1, 1].

This representation is so nice. There is no need to solve roll, pitch, and yaw. Just pick unit rotation axis v, then twist the scalar knob a to set the rotation amount.

This is quite human!