Quaternion Calculator
Multiply two quaternions (Hamilton product).
Quaternions extend complex numbers to four dimensions and are used for 3D rotations in graphics and robotics.
How the Math Works
The Hamilton product of two quaternions q₁ = a + bi + cj + dk and q₂ = e + fi + gj + hk is computed by expanding the product using the rules i² = j² = k² = ijk = -1, and the distributive property. The result combines scalar terms (ae - bf - cg - dh) with vector terms, producing a new quaternion that encodes combined rotational transformations. This non-commutative multiplication ensures precise orientation changes in 3D space, where order of rotations matters critically.
Practical Applications
This calculation is essential in computer graphics and robotics for composing 3D rotations without encountering gimbal lock. Game developers use it to smoothly animate character movements or camera angles, while aerospace engineers apply it to orient spacecraft attitudes. In virtual reality, multiplying quaternions combines head and hand tracking data to render immersive experiences with minimal computational overhead.
Day-to-Day Use
While invisible to most users, this math powers everyday technologies like smartphone AR apps, where your device's sensors use quaternion multiplication to track head movements in real-time. It also enables autonomous vehicles to fuse gyroscope and accelerometer data for accurate navigation, and allows 3D modeling software to smoothly manipulate complex objects on your computer screen — all without the user needing to understand the underlying mathematical complexity.
Worked example
(1 + 2i + 3j + 4k)(5 + 6i + 7j + 8k) = −60 + 12i + 30j + 24k.
FAQ
Is quaternion multiplication commutative?
No — q₁q₂ generally differs from q₂q₁.