A quaternion is a four-part hypercomplex number used to describe 3D rotations and orientations.

Think of quaternions as 3 parameters to indicate a unit vector and 1 to indicate a rotation around it.

  • In math, we have:
    • and .

Important property: q -q

Notes from Steven

Double Cover Property (Singularity)

Quaternions have singularities in the context of representing orientation, known as the double-cover property. This means that two quaternions can represent the same orientation. Specifically, a quaternion (q) and its negation (-q) represent the same spatial orientation.

So then why are quaternions better if they also have singularities? Because

A quaternion q has a real part and three imaginary parts.

The three imaginary parts of the quaternion satisfy the following relationship:

Rotation with quaternions

To rotate a point p using Rotation Matrix, we know that p’ = Rp. How do we do that with a quaternion?

We can also use a scalar and a vector to express quaternions: q with s .

Let the rotation be specified by a unit quaternion q. First, we extend the 3D point to an imaginary quaternion p  

We just put the three coordinates into the imaginary part and leave the real part to be zero. Then, the rotated point p′ can be expressed as such a product:

The multiplication here is the quaternion multiplication, and the result is also a quaternion. Finally, we take the imaginary part of p′ and get the coordinates of the point after the rotation.