Quaternions are expressions of the form w + x i + y j + z k
, with x i + y j + z k
being the vector/imaginary part and w
the scalar/real part. Math libraries differ in the way they order the vector and real part of a quaternion. This can lead to bothersome debugging sessions.
The following table shows quaternion implementations and their chosen order:
X-Y-Z-W (scalar-last format) vs. W-X-Y-Z