Skip to content
Omnikalc

Quaternion multiplication calculator: multiply two quaternions

Enter two quaternions to get their Hamilton product, its norm and the product in the reverse order, which shows that quaternion multiplication is not commutative.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Results

Product q₁q₂: real part

-60.00

Product q₁q₂: i part

12.00

Product q₁q₂: j part

30.00

Product q₁q₂: k part

24.00

Norm of the product
72.250
Reverse product q₂q₁: i part
20.00
Reverse product q₂q₁: j part
14.00
Reverse product q₂q₁: k part
32.00

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.

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.

Frequently asked questions

What is a quaternion?

A quaternion is a number with one real part and three imaginary parts, written a + bi + cj + dk. They extend complex numbers to four dimensions and were invented by William Rowan Hamilton in 1843. Today they are used mostly to describe rotations in three dimensions.

Why is the order of multiplication important?

Quaternion multiplication is not commutative, so q₁q₂ is not equal to q₂q₁ in general. The real parts and the norms are the same in both orders, but the vector parts differ in sign and size. This reflects the fact that 3D rotations done in a different order give a different result.

How are quaternions used for rotations?

A unit quaternion with real part cos(θ/2) and vector part sin(θ/2) times a unit axis represents a rotation by the angle θ around that axis. Multiplying two unit quaternions combines the rotations. They avoid gimbal lock and are easy to interpolate, which is why games, robots and aircraft software use them.

What is the conjugate and the inverse?

The conjugate changes the signs of the three imaginary parts. The inverse of a quaternion is its conjugate divided by the square of its norm. For a unit quaternion, the inverse is just the conjugate, which represents the opposite rotation.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.