Mathwords logoMathwords

Quaternion — Definition, Formula & Examples

A quaternion is a number of the form a+bi+cj+dka + bi + cj + dk, where a,b,c,da, b, c, d are real numbers and i,j,ki, j, k are distinct imaginary units that each square to 1-1. Quaternions extend the complex numbers into four dimensions but, unlike real or complex multiplication, their multiplication is not commutative.

The quaternions H\mathbb{H} form a four-dimensional associative division algebra over R\mathbb{R} with basis {1,i,j,k}\{1, i, j, k\} subject to the relations i2=j2=k2=ijk=1i^2 = j^2 = k^2 = ijk = -1. From these relations it follows that ij=kij = k, jk=ijk = i, ki=jki = j, and their reverses carry a negative sign (e.g., ji=kji = -k).

Key Formula

q=a+bi+cj+dkq = a + bi + cj + dk
Where:
  • aa = Real (scalar) part of the quaternion
  • b,c,db, c, d = Coefficients of the three imaginary units
  • i,j,ki, j, k = Imaginary basis elements satisfying $i^2 = j^2 = k^2 = ijk = -1$

How It Works

You manipulate quaternions much like complex numbers, but you must track three imaginary parts instead of one. When multiplying, distribute and apply the rules ij=kij = k, jk=ijk = i, ki=jki = j, being careful about order since ijjiij \neq ji. The conjugate of q=a+bi+cj+dkq = a + bi + cj + dk is qˉ=abicjdk\bar{q} = a - bi - cj - dk, and the norm is q=a2+b2+c2+d2|q| = \sqrt{a^2 + b^2 + c^2 + d^2}. Every nonzero quaternion has a multiplicative inverse q1=qˉ/q2q^{-1} = \bar{q}/|q|^2, which is why H\mathbb{H} is a division algebra.

Worked Example

Problem: Multiply the quaternions q1=1+2i+3j+4kq_1 = 1 + 2i + 3j + 4k and q2=2i+j3kq_2 = 2 - i + j - 3k.
Distribute: Apply the distributive property, expanding all 16 products of basis elements.
q1q2=1(2i+j3k)+2i(2i+j3k)+3j(2i+j3k)+4k(2i+j3k)q_1 q_2 = 1(2 - i + j - 3k) + 2i(2 - i + j - 3k) + 3j(2 - i + j - 3k) + 4k(2 - i + j - 3k)
Compute each group: Use i2=j2=k2=1i^2 = j^2 = k^2 = -1 and the multiplication rules ij=kij=k, ik=jik=-j, ji=kji=-k, jk=ijk=i, ki=jki=j, kj=ikj=-i.
=(2i+j3k)+(4i+2+2k+6j)+(6j+3k3+9i)+(8k+4j4i12(1))= (2 - i + j - 3k) + (4i + 2 + 2k + 6j) + (6j + 3k - 3 + 9i) + (8k + 4j - 4i - 12(-1))
Collect like terms: Group the scalar, ii, jj, and kk components separately.
Scalar: 2+23+12=13i1+4+94=8j1+6+6+4=17k3+2+3+8=10\text{Scalar: } 2 + 2 - 3 + 12 = 13 \quad i\text{: } -1 + 4 + 9 - 4 = 8 \quad j\text{: } 1 + 6 + 6 + 4 = 17 \quad k\text{: } -3 + 2 + 3 + 8 = 10
Answer: q1q2=13+8i+17j+10kq_1 q_2 = 13 + 8i + 17j + 10k

Why It Matters

Quaternions are the standard tool for representing 3D rotations in computer graphics, robotics, and aerospace engineering because they avoid gimbal lock and are more numerically stable than rotation matrices. In abstract algebra, H\mathbb{H} serves as a key example of a noncommutative division ring, illustrating why commutativity cannot be taken for granted.

Common Mistakes

Mistake: Treating quaternion multiplication as commutative, e.g., assuming q1q2=q2q1q_1 q_2 = q_2 q_1.
Correction: Order matters. Since ij=kij = k but ji=kji = -k, reversing the order of two quaternions generally gives a different product.