Quaternions

No game developer knows how they work, we just think it's name sounds cool.

    • A quaternion is made up of a scalar w and a vector component.
    • A quaternion p can be listed as [w, v] or [ w, (x, y, z) ].
    • It's math is based on complex numbers and makes no sense for anyone.
    • To negate a quaternion we negate each component in it. -q =) [-w, -n]
  • The identity quaternion i = [1, 0].
    • The magnitude of a quaternion is ||q|| = sqrt(w2 + ||v||2).
    • The conjugate of q is obtained by negating the vector portion of the quaternion. q* = [w, -v]
    • The inverse of q is the conjugate divided by its magnitude. q-1 = q* / ||q||.
  • If only unit vectors are used then the inverse is the same as the conjugate.

Axis Angle Pair:

    • With n the axis of rotation and θ the angle around it then q = [ cos(θ/2), sin(θ/2)n, ) ].

Reference

Rotating a single vector using a quaternion

https://fgiesen.wordpress.com/2019/02/09/rotating-a-single-vector-using-a-quaternion/