Quaternion Multiplication

Calculator for quaternion multiplication and rotation concatenation

Quaternion Multiplication Calculator

Quaternion multiplication

Multiplies two quaternions q₁ × q₂ for concatenating rotations and coordinate transformations

Quaternion multiplication (Hamilton product)

Not commutative: q₁ × q₂ ≠ q₂ × q₁ (order matters!)
Rotation concatenation: first q₁, then q₂
Complex formula: 16 terms in the full expression

Enter two quaternions to multiply
First quaternion (q₁)
Second quaternion (q₂)
q₁ × q₂: Apply rotation q₁ first, then q₂
Not commutative: q₁ × q₂ ≠ q₂ × q₁
Quaternion multiplication result
W (scalar):
X (i comp.):
Y (j comp.):
Z (k comp.):
Hamilton product: q₁ × q₂ (rotation concatenation, not commutative)

Multiplication Info

Multiplication properties

Not commutative: q₁ × q₂ ≠ q₂ × q₁
Associative: (q₁ × q₂) × q₃ = q₁ × (q₂ × q₃)
Hamilton product: Full quaternion multiplication

Not commutative Associative Rotation concatenation

Order matters: q₁ × q₂ ≠ q₂ × q₁
Concatenation: apply q₁ first, then q₂

Hamilton rules
i² = j² = k² = ijk = -1
ij = k, ji = -k
jk = i, kj = -i
ki = j, ik = -j

Formulas for quaternion multiplication

Hamilton product (full formula)
\[q_1 \times q_2 = (w_1 + x_1 i + y_1 j + z_1 k) \times (w_2 + x_2 i + y_2 j + z_2 k)\]

Distribute using Hamilton rules

Component-wise calculation
\[\begin{align} w &= w_1 w_2 - x_1 x_2 - y_1 y_2 - z_1 z_2 \\ x &= w_1 x_2 + x_1 w_2 + y_1 z_2 - z_1 y_2 \\ y &= w_1 y_2 - x_1 z_2 + y_1 w_2 + z_1 x_2 \\ z &= w_1 z_2 + x_1 y_2 - y_1 x_2 + z_1 w_2 \end{align}\]

All four result components

Hamilton rules
\[\begin{align} i^2 = j^2 = k^2 &= ijk = -1 \\ ij = k, \quad ji &= -k \\ jk = i, \quad kj &= -i \\ ki = j, \quad ik &= -j \end{align}\]

Basic multiplication rules for i, j, k

Vector form
\[\begin{align} q_1 \times q_2 &= (w_1 w_2 - \vec{v_1} \cdot \vec{v_2}) \\ &+ (w_1 \vec{v_2} + w_2 \vec{v_1} + \vec{v_1} \times \vec{v_2}) \end{align}\]

With vector part v = (x, y, z)

Matrix representation
\[Q_1 \cdot Q_2 = \begin{pmatrix} w_1 & -x_1 & -y_1 & -z_1 \\ x_1 & w_1 & -z_1 & y_1 \\ y_1 & z_1 & w_1 & -x_1 \\ z_1 & -y_1 & x_1 & w_1 \end{pmatrix} \begin{pmatrix} w_2 \\ x_2 \\ y_2 \\ z_2 \end{pmatrix}\]

Equivalent matrix multiplication

Examples for quaternion multiplication

Example 1: Step-by-step
q₁ = 3 + 2i + 4j + 1k q₂ = 1 + 3i + 5j + 2k
W component: \[w = 3 \cdot 1 - 2 \cdot 3 - 4 \cdot 5 - 1 \cdot 2 = 3 - 6 - 20 - 2 = -25\] X component: \[x = 3 \cdot 3 + 2 \cdot 1 + 4 \cdot 2 - 1 \cdot 5 = 9 + 2 + 8 - 5 = 14\] Y component: \[y = 3 \cdot 5 - 2 \cdot 2 + 4 \cdot 1 + 1 \cdot 3 = 15 - 4 + 4 + 3 = 18\] Z component: \[z = 3 \cdot 2 + 2 \cdot 5 - 4 \cdot 3 + 1 \cdot 1 = 6 + 10 - 12 + 1 = 5\]

q₁ × q₂ = -25 + 14i + 18j + 5k

Example 2: Order matters!
q₁ = 1 + i + 0j + 0k q₂ = 1 + 0i + j + 0k
q₁ × q₂: \[\begin{align} w &= 1 \cdot 1 - 1 \cdot 0 - 0 \cdot 1 - 0 \cdot 0 = 1 \\ x &= 1 \cdot 0 + 1 \cdot 1 + 0 \cdot 0 - 0 \cdot 1 = 1 \\ y &= 1 \cdot 1 - 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 0 = 1 \\ z &= 1 \cdot 0 + 1 \cdot 1 - 0 \cdot 0 + 0 \cdot 1 = 1 \end{align}\] q₂ × q₁: \[\begin{align} w &= 1, \quad x = 1 \\ y &= 1, \quad z = -1 \end{align}\]

q₁×q₂ ≠ q₂×q₁ (z component!)

Example 3: Unit quaternions
q₁ = cos(α/2) + sin(α/2)k q₂ = cos(β/2) + sin(β/2)k
Rotation about Z: \[\begin{align} q_1 \times q_2 &= \cos\left(\frac{\alpha + \beta}{2}\right) \\ &+ \sin\left(\frac{\alpha + \beta}{2}\right) k \end{align}\] Angles add!

Rotation concatenation = angle addition

Example 4: Hamilton rules
i × j = ? j × i = ?
Basic rules: \[\begin{align} i \times j &= k \\ j \times i &= -k \\ i \times i &= -1 \\ j \times j &= -1 \\ k \times k &= -1 \end{align}\]

Hamilton rules are fundamental

Geometric meaning
Rotation concatenation
Sequential
Coordinate transform
Change of frame
Animation
Motion sequences
Robotics
Joint chains

Multiplication = perform rotations sequentially (order matters!)

Step-by-step guide
Preparation
  1. Write both quaternions in standard form
  2. Decide the order: q₁ × q₂
  3. Have Hamilton rules ready
  4. Systematically compute all terms
Execution
  1. W component: 4 terms (1 positive, 3 negative)
  2. X component: 4 terms by Hamilton rules
  3. Y component: 4 terms by Hamilton rules
  4. Z component: 4 terms by Hamilton rules

Applications of quaternion multiplication

Quaternion multiplication is at the heart of 3D rotation calculations:

3D Graphics & Animation
  • Rotation concatenation: combine multiple rotations
  • Skeletal animation: bone hierarchies
  • Camera control: complex movements
  • Object transform: local + global rotation
Robotics & Kinematics
  • Forward kinematics: chain joint rotations
  • Robot arms: segment orientations
  • Path planning: complex motion sequences
  • Coordinate transformation: between frames
Aerospace
  • Attitude control: multi-axis rotations
  • Navigation: frame changes
  • Stabilization: corrective rotations
  • Maneuvers: sequential movements
Key properties
  • Not commutative: order is crucial
  • Associative: grouping doesn't matter
  • Hamilton rules: i²=j²=k²=ijk=-1
  • 16 terms: complex but systematic calculation

Quaternion multiplication: the Hamilton product

The quaternion multiplication, also called the Hamilton product, is the most complex but powerful operation in quaternion algebra. It enables rotation concatenation and is fundamental for 3D computer graphics. The operation is not commutative — the order of factors matters since q₁ × q₂ ≠ q₂ × q₁. This reflects the physical reality that rotation order affects the result. The 16 terms of the full formula follow the Hamilton rules and can be computed systematically. Modern 3D engines use highly optimized implementations for real-time rendering.

Summary

Quaternion multiplication is the tool for precise rotation concatenation in 3D applications. Its non-commutative nature models realistic rotations, while associativity allows efficient computation. Understanding Hamilton rules and systematically computing all 16 terms is essential for working with 3D rotations. From simple object turns to complex robot kinematics, quaternion multiplication forms the mathematical basis of modern 3D technology.

More Quaternion Functions

Addition  •  Subtraction  •  Division  •  Multiplication  •  Concatenate  •  Length  •  Interpolation  •  Normalize  •  Scalar Multiplication  •  Dot Product  •  Yaw-Pitch-Roll  •  Conjugates  •  Inverse  •  Negation  •