Quaternions extend complex numbers with three imaginary units, and they are multiplied with the Hamilton product. The quaternion multiplication calculator takes two quaternions and gives the real, i, j and k parts of their product, the norm of the product and the vector part of the product in the reverse order.
How the calculation works
- Write each quaternion as q = a + b i + c j + d k, with the rules i² = j² = k² = ijk = −1, ij = k, jk = i and ki = j.
- Real part of the product: a₁a₂ − b₁b₂ − c₁c₂ − d₁d₂. The i part is a₁b₂ + b₁a₂ + c₁d₂ − d₁c₂.
- The j part is a₁c₂ − b₁d₂ + c₁a₂ + d₁b₂ and the k part is a₁d₂ + b₁c₂ − c₁b₂ + d₁a₂.
- The norm of a quaternion is √(a² + b² + c² + d²), and the norm of a product equals the product of the norms. Swapping the order gives a different vector part, because quaternion multiplication is not commutative.
Example
Multiply q₁ = 1 + 2i + 3j + 4k by q₂ = 5 + 6i + 7j + 8k. The real part is 5 − 12 − 21 − 32 = −60, the i part is 12, the j part is 30 and the k part is 24. The product is −60 + 12i + 30j + 24k, with a norm of 72.250. In the other order, q₂q₁ = −60 + 20i + 14j + 32k, which has the same real part and norm but a different vector part.
Why it matters
Multiplying quaternions by hand is error-prone because of the signs. The calculator gives the result and the reverse product, which makes it easy to check homework, test code that rotates objects, or see how the order of rotations changes the outcome.
Good to know
The calculator multiplies general quaternions, not only unit ones, and the result is exact up to rounding. To compose rotations, use unit quaternions, which have a norm of 1. Conventions vary between fields, with some placing the real part last, so check the order of the parts used by your software.
Related tools
The vector calculator handles dot and cross products, which come from the quaternion product of two pure vectors, and the complex number calculator handles the two-dimensional case.