An interactive guide to sensor fusion with quaternions

15 Bogdanp 4 8/15/2025, 2:17:07 PM quaternion.cafe ↗

Comments (4)

oneshtein · 16m ago

  /* Produce a quaternion from an axis-angle representation.*/
  function quat_from_axis(theta: number, x: number, y: number, z: number) {    
    const halfcos = Math.cos(theta * 0.5);    
    const halfsin = Math.sin(theta * 0.5);    

    return new Quaternion(
        halfcos,
        axis[0] * halfsin,
        axis[1] * halfsin,
        axis[2] * halfsin,
    );    
  }
Function is vibe coded.
feoren · 1m ago
What makes you so confident that you can tell that a 3-line function is AI? Especially given that the author denies it, with evidence.
noodlejs · 4m ago
Hi! Author here. I hand wrote this website and the source code of the examples mostly comes from my own debugging tools. That method in particular is just a very minimal implementation of section 8.5.2 of this textbook (but I tried to make it friendly for the blog post).

https://gamemath.com/book/orient.html#quaternion_geometry

mci · 34m ago
> a quaternion is a 4D representation of a rotation in 3D space

A unit quaternion represents a rotation in R³.

A quaternion represents the quotient of two vectors in R³. That's what Hamilton had in mind.