Quaternion Fundamentals

The quaternion is a rank 4 complex number system that consists of a real and three complex(vector) parts. The vector component is an extension from the basic complex or imaginary number system, i^\hat{i}. The basic properties of the complex components of a quaternion are listed:

i^2=j^2=k^2=i^j^k^=1 \hat{i}^2 = \hat{j}^2 = \hat{k}^2 = \hat{i}\hat{j}\hat{k} = -1

Clockwise multiplication around the circle results in positive values, while counter-clockwise multiplication results in negative values. Quaternion i-j-k

i^j^=k^j^k^=i^k^i^=j^ \hat{i}\hat{j} = \phantom{-}\hat{k} \qquad \hat{j}\hat{k} = \phantom{-}\hat{i} \qquad \hat{k}\hat{i} = \phantom{-}\hat{j}

j^i^=k^k^j^=i^i^k^=j^ \hat{j}\hat{i} = -\hat{k} \qquad \hat{k}\hat{j} = -\hat{i} \qquad \hat{i}\hat{k} = -\hat{j}

The basic forms of a Quaternion are shown below:

q=q0+q1i^+q2j^+q3k^=[q0q1q2q3]T=[q0qv] \boldsymbol{q} = q_0 + q_1 \hat{i} + q_2 \hat{j} + q_3 \hat{k} = \begin{bmatrix} \phantom{-}q_0 & \phantom{-}q_1 & \phantom{-}q_2 & \phantom{-}q_3 \\ \end{bmatrix}^T = \begin{bmatrix} \phantom{}q_0 \\ \boldsymbol{q}_v \end{bmatrix}

In the quaternion, q0q_0 represents the scalar part, while q1q_1, q2q_2, and q3q_3 represent the vector parts of the quaternion, also written as qv\boldsymbol{q}_v. The quaternion can also be re-written as:

q=cos(θ2)+vsin(θ2)=[q0q1q2q3]=[cos(θ2)sin(θ2)sin(θ2)sin(θ2)] \boldsymbol{q} = \cos \left( \frac{\theta}{2} \right) + \boldsymbol{v} \sin \left( \frac{\theta}{2} \right) = \begin{bmatrix} q_0 \\ q_1 \\ q_2 \\ q_3 \end{bmatrix} = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) \\[0.5em] \sin\left(\frac{\theta}{2}\right) \\[0.5em] \sin\left(\frac{\theta}{2}\right) \\[0.5em] \sin\left(\frac{\theta}{2}\right) \\[0.5em] \end{bmatrix}

Where v\boldsymbol{v} represents the rotation axis, and must be a unit vector, and θ\theta is the angle of rotation, which is similar to roll in the Euler-space.

The conjugate of the quaternion is defined as:

q=q0q1i^q2j^q3k^=[q0q1q2q3]T=[q0qv] \boldsymbol{q}^* = q_0 -q_1\hat{i} - q_2\hat{j} - q_3\hat{k} = \begin{bmatrix} \phantom{-}q_0 & -q_1 & -q_2 & -q_3 \end{bmatrix}^T = \begin{bmatrix} \phantom{-}q_0 \\ - \boldsymbol{q}_v \end{bmatrix}

The magnitude of a quaternion is defined by: q=q02+q12+q22+q32 \Vert \boldsymbol{q} \Vert = \sqrt{q^2_0 + q^2_1 + q^2_2 + q^2_3}

The inverse of a quaternion is defined: q1=qq \boldsymbol{q}^\mathrm{-1} = \frac{\boldsymbol{q}^*}{\Vert \boldsymbol{q} \Vert}

The inverse of a Rotation quaternion is equal to the conjugate of the quaternion: q1=q \boldsymbol{q}^\mathrm{-1} = \boldsymbol{q}^*

The inverse, or conjugate, of a Rotation quaternion causes the axis of rotation to be rotated to the complete opposite direction from the initial quaternion.