Fiveable

📐Geometric Algebra Unit 3 Review

QR code for Geometric Algebra practice questions

3.2 Quaternions and their properties

3.2 Quaternions and their properties

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
📐Geometric Algebra
Unit & Topic Study Guides

Quaternions are mind-bending extensions of complex numbers, adding two more imaginary units to create a four-dimensional number system. They're like the Swiss Army knife of 3D rotations, offering a compact way to represent and manipulate orientations without the pesky issues of other methods.

These mathematical powerhouses shine in computer graphics, gaming, and physics simulations. They make rotating objects in 3D space a breeze, smoothly interpolating between orientations and avoiding the dreaded gimbal lock. Quaternions are the unsung heroes behind many of your favorite 3D applications.

Quaternions and their components

Definition and structure

  • A quaternion is a four-dimensional complex number that extends the concept of complex numbers to higher dimensions
  • Quaternions consist of a real part and three imaginary parts, often denoted as q=a+bi+cj+dkq = a + bi + cj + dk, where aa, bb, cc, and dd are real numbers, and ii, jj, and kk are imaginary units
    • Example: q=2+3i4j+5kq = 2 + 3i - 4j + 5k is a quaternion with real part a=2a = 2 and imaginary parts b=3b = 3, c=4c = -4, and d=5d = 5

Properties of imaginary units

  • The imaginary units ii, jj, and kk have the following properties: i2=j2=k2=1i^2 = j^2 = k^2 = -1, ij=kij = k, jk=ijk = i, ki=jki = j, ji=kji = -k, kj=ikj = -i, and ik=jik = -j
    • These properties define the non-commutative multiplication rules for the imaginary units
  • The real part of a quaternion is a scalar, while the imaginary parts form a 3D vector
  • Pure quaternions are quaternions with a zero real part, representing vectors in 3D space
    • Example: q=0+2i+3j4kq = 0 + 2i + 3j - 4k is a pure quaternion representing the vector (2,3,4)(2, 3, -4) in 3D space

Quaternion arithmetic operations

Definition and structure, Quaternion - Wikipedia

Addition and multiplication

  • Quaternion addition is performed by adding the corresponding components of two quaternions: (a1+b1i+c1j+d1k)+(a2+b2i+c2j+d2k)=(a1+a2)+(b1+b2)i+(c1+c2)j+(d1+d2)k(a_1 + b_1i + c_1j + d_1k) + (a_2 + b_2i + c_2j + d_2k) = (a_1 + a_2) + (b_1 + b_2)i + (c_1 + c_2)j + (d_1 + d_2)k
    • Example: (2+3i4j+5k)+(12i+3j4k)=(2+1)+(32)i+(4+3)j+(54)k=3+ij+k(2 + 3i - 4j + 5k) + (1 - 2i + 3j - 4k) = (2 + 1) + (3 - 2)i + (-4 + 3)j + (5 - 4)k = 3 + i - j + k
  • Quaternion multiplication is non-commutative and follows the distributive law and the properties of imaginary units: (a1+b1i+c1j+d1k)(a2+b2i+c2j+d2k)=(a1a2b1b2c1c2d1d2)+(a1b2+b1a2+c1d2d1c2)i+(a1c2b1d2+c1a2+d1b2)j+(a1d2+b1c2c1b2+d1a2)k(a_1 + b_1i + c_1j + d_1k)(a_2 + b_2i + c_2j + d_2k) = (a_1a_2 - b_1b_2 - c_1c_2 - d_1d_2) + (a_1b_2 + b_1a_2 + c_1d_2 - d_1c_2)i + (a_1c_2 - b_1d_2 + c_1a_2 + d_1b_2)j + (a_1d_2 + b_1c_2 - c_1b_2 + d_1a_2)k
    • Example: (2+3i4j+5k)(12i+3j4k)=(213(2)(4)3+5(4))+(2(2)+31+(4)(4)53)i+(233(4)+(4)1+5(2))j+(2(4)+33(4)(2)+51)k=4416i16j+6k(2 + 3i - 4j + 5k)(1 - 2i + 3j - 4k) = (2 \cdot 1 - 3 \cdot (-2) - (-4) \cdot 3 + 5 \cdot (-4)) + (2 \cdot (-2) + 3 \cdot 1 + (-4) \cdot (-4) - 5 \cdot 3)i + (2 \cdot 3 - 3 \cdot (-4) + (-4) \cdot 1 + 5 \cdot (-2))j + (2 \cdot (-4) + 3 \cdot 3 - (-4) \cdot (-2) + 5 \cdot 1)k = -44 - 16i - 16j + 6k

Conjugation, norm, and inverse

  • The conjugate of a quaternion q=a+bi+cj+dkq = a + bi + cj + dk is defined as q=abicjdkq^* = a - bi - cj - dk. The conjugate satisfies the property (pq)=qp(pq)^* = q^*p^*
    • Example: The conjugate of q=2+3i4j+5kq = 2 + 3i - 4j + 5k is q=23i+4j5kq^* = 2 - 3i + 4j - 5k
  • The norm of a quaternion q=a+bi+cj+dkq = a + bi + cj + dk is defined as q=a2+b2+c2+d2|q| = \sqrt{a^2 + b^2 + c^2 + d^2}. The norm satisfies the property pq=pq|pq| = |p||q|
    • Example: The norm of q=2+3i4j+5kq = 2 + 3i - 4j + 5k is q=22+32+(4)2+52=54|q| = \sqrt{2^2 + 3^2 + (-4)^2 + 5^2} = \sqrt{54}
  • The inverse of a quaternion qq is given by q1=q/q2q^{-1} = q^* / |q|^2, provided that qq is non-zero
    • Example: The inverse of q=2+3i4j+5kq = 2 + 3i - 4j + 5k is q1=(23i+4j5k)/54=127118i+227j554kq^{-1} = (2 - 3i + 4j - 5k) / 54 = \frac{1}{27} - \frac{1}{18}i + \frac{2}{27}j - \frac{5}{54}k

Geometric interpretation of quaternions

Definition and structure, Complex Numbers | Algebra and Trigonometry

Rotations in 3D space

  • Quaternions provide a compact and efficient representation of rotations in 3D space, avoiding gimbal lock and other issues associated with Euler angles
  • A unit quaternion, with a norm equal to 1, can represent a rotation in 3D space
    • Example: The unit quaternion q=cos(θ/2)+(xsin(θ/2))i+(ysin(θ/2))j+(zsin(θ/2))kq = \cos(\theta/2) + (x \sin(\theta/2))i + (y \sin(\theta/2))j + (z \sin(\theta/2))k represents a rotation by an angle θ\theta around the axis (x,y,z)(x, y, z)
  • Composing rotations is achieved by multiplying the corresponding unit quaternions in the order of the desired rotations
    • Example: To compose two rotations represented by unit quaternions q1q_1 and q2q_2, the resulting rotation is given by the quaternion product q2q1q_2q_1

Rotating vectors using quaternions

  • The rotation of a vector vv by a unit quaternion qq is given by v=qvqv' = qvq^*, where vv is treated as a pure quaternion
    • Example: To rotate a vector v=(1,2,3)v = (1, 2, 3) by a unit quaternion q=12+12i+0j+0kq = \frac{1}{\sqrt{2}} + \frac{1}{\sqrt{2}}i + 0j + 0k (representing a 90-degree rotation around the x-axis), we first express vv as a pure quaternion v=0+1i+2j+3kv = 0 + 1i + 2j + 3k, then calculate v=qvq=2i+1j+3kv' = qvq^* = -2i + 1j + 3k, which corresponds to the rotated vector (2,1,3)(-2, 1, 3)

Quaternions for 3D applications

Computer graphics and gaming

  • Quaternions are widely used in computer graphics, gaming, virtual reality, and other applications involving 3D rotations and orientations
  • Quaternions can be used to interpolate between two orientations using techniques such as spherical linear interpolation (SLERP) and spherical quadratic interpolation (SQUAD)
    • Example: In a 3D animation, SLERP can be used to smoothly transition an object's orientation from one quaternion q1q_1 to another quaternion q2q_2 over a given time interval

3D geometry and physics simulations

  • In 3D geometry, quaternions can be used to calculate the shortest rotation between two vectors or to align one coordinate system with another
    • Example: Given two unit vectors v1v_1 and v2v_2, the quaternion representing the shortest rotation from v1v_1 to v2v_2 is given by q=1+v1×v2+2(1+v1v2)(v1×v2)q = 1 + v_1 \times v_2 + \sqrt{2(1 + v_1 \cdot v_2)}(v_1 \times v_2), where ×\times denotes the cross product and \cdot denotes the dot product
  • Quaternions are used in physics simulations, such as rigid body dynamics, to represent the orientation and rotation of objects in 3D space
  • Quaternions can be converted to and from other rotation representations, such as rotation matrices and Euler angles, depending on the specific requirements of the application
    • Example: A quaternion q=a+bi+cj+dkq = a + bi + cj + dk can be converted to a 3x3 rotation matrix R=[12(c2+d2)2(bcad)2(bd+ac)2(bc+ad)12(b2+d2)2(cdab)2(bdac)2(cd+ab)12(b2+c2)]R = \begin{bmatrix} 1-2(c^2+d^2) & 2(bc-ad) & 2(bd+ac) \\ 2(bc+ad) & 1-2(b^2+d^2) & 2(cd-ab) \\ 2(bd-ac) & 2(cd+ab) & 1-2(b^2+c^2) \end{bmatrix}