Reanimator Ltd

High-performance coding by Eddie Edwards

Derivation of Quaternion Formulae

02 Mar 2012, 19:16 UTC

To show that the inverse of a unit quaternion (r,V) is (r,-V) we do:

(r,V) * (r,-V) gives
  r' = r*r + V.V = 1
  V' = -r.V + r.V + V^V = (0,0,0)

To rotate a vector X by a quaternion we work as follows:

position quat = (0,X)
resulting position quat = (r,V) * (0,X) * (r,-V)
                        = (0,X')

Working through using the multiplication formula:

(r',X') = (-V.X,rX + V^X)*(r,-V)

r' = -rV.X - (rX + V^X).-V
X' = -V.X(-V) + r(rX + V^X) + (rX + V^X)^(-V)

r' = -rV.X + rX.V = 0
X' = rrX + (V.X)V + r(V^X) + V^(rX + V^X)

We assume the following vector identity:

V^(V^X) = V(V.X) - X(V.V)

This gives us:

X' = rrX + (V.X)V + r(V^X) + rV^X + (V.X)V - (V.V)X
   = (rr - V.V)X + 2(V.X)V + 2r(V^X)

Therefore, vector X rotated by quaternion (r,V) is given as follows:

X' = (r.r - V.V)X + 2(V.X)V + 2r(V^X)

[Back to Quaternion Cheatsheet]

New comments are disabled for this page