Hacker News new | past | comments | ask | show | jobs | submit login




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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: