Math‎ > ‎

Quaternions

No game developer knows how they work, we just think it's name sounds cool.
  • 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-1q* / ||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


Comments