How Quaternions encode rotations: derivation and sample code | Hacker News Reader