Quaternion Calculator

Perform quaternion arithmetic: add, subtract, multiply, conjugate, norm, and inverse with step-by-step solutions.

Enter Quaternions

Quaternion Q1 = a + bi + cj + dk

Quaternion Q2 = e + fi + gj + hk

Result

Q1 + Q2
--
Q1 --
Q2 --
|Q1| (norm) --

Step-by-Step Solution

What Are Quaternions?

Quaternions are a number system that extends complex numbers. Discovered by Sir William Rowan Hamilton in 1843, they are written as q = a + bi + cj + dk, where a, b, c, d are real numbers and i, j, k are the fundamental quaternion units. Quaternions are widely used in 3D computer graphics, robotics, and aerospace engineering for representing rotations.

Hamilton Product Rules

Fundamental Identities

The defining equations of quaternion algebra.

i² = j² = k² = ijk = -1

Product Rules

Products of the basis elements follow specific rules.

ij = k, jk = i, ki = j

Anti-Commutativity

Reversing the order negates the result.

ji = -k, kj = -i, ik = -j

Quaternion Operations

Addition & Subtraction

Quaternion addition and subtraction are performed component-wise: (a1+b1i+c1j+d1k) + (a2+b2i+c2j+d2k) = (a1+a2) + (b1+b2)i + (c1+c2)j + (d1+d2)k.

Multiplication (Hamilton Product)

Quaternion multiplication is not commutative (q1 x q2 is generally not equal to q2 x q1). The product is computed by distributing and applying the multiplication rules for i, j, and k. The result components are:

  • Real: a1a2 - b1b2 - c1c2 - d1d2
  • i: a1b2 + b1a2 + c1d2 - d1c2
  • j: a1c2 - b1d2 + c1a2 + d1b2
  • k: a1d2 + b1c2 - c1b2 + d1a2

Conjugate, Norm & Inverse

The conjugate of q = a + bi + cj + dk is q* = a - bi - cj - dk. The norm is |q| = sqrt(a² + b² + c² + d²). The inverse is q⊃-1 = q* / |q|².

Applications

  • 3D Rotations: Quaternions avoid gimbal lock and provide smooth interpolation (SLERP) for 3D rotations in games and simulations.
  • Aerospace: Spacecraft attitude control systems use quaternions for orientation tracking.
  • Robotics: Robot arm joint rotations are efficiently computed using quaternions.
  • Computer Vision: Camera orientation and pose estimation rely on quaternion math.