Quaternion Calculator & 3D Visualizer
Compute quaternion operations and instantly see the rotation in 3D. Built for graphics programmers, robotics engineers, and students working with rotations.
Result
w: 1
x: 0
y: 0
z: 0
Norm: 1 (unit ✓)
Euler (Z-Y-X): yaw 0°, pitch 0°, roll 0°
Live visualization
Drag to orbit. Purple = A. Indigo = B. Green = Result (A * B).
What is a quaternion?
A quaternion is a four-component number w + xi + yj + zk used to represent 3D rotations without the gimbal-lock problems of Euler angles. Unit quaternions (norm = 1) correspond one-to-one with rotations in 3D space (up to a sign), and can be composed efficiently with the Hamilton product, smoothly interpolated with slerp, and converted to and from rotation matrices or Euler angles. See Wikipedia's quaternion article for the full mathematical background.
Conventions used on this page
- Hamilton product:
multiply(A, B)computes A * B. - Euler angles use the intrinsic Z-Y-X order (yaw, then pitch, then roll), in degrees for input/output.
- Rotations are active (they rotate the object, not the coordinate frame).
- The visualizer shows the rotation each quaternion applies to a reference rod starting along +X. X/Y/Z axis lines are labeled, and the controls below the view let you choose which axis (Y or Z) renders as "up", switch between a right- and left-handed display, and independently flip which way positive yaw, pitch, or roll point on screen.
Supported operations
Add / Subtract
Componentwise addition and subtraction of the w, x, y, z values. These aren't rotations themselves, but they're the building blocks for blending or perturbing quaternions before renormalizing, and for computing differences between two orientations.
Multiply (Hamilton product): A * B and B * A
Multiplying two quaternions composes their rotations: applying A * B to a vector rotates it by B first, then by A. Because the Hamilton product is non-commutative, A * B and B * A generally give different results — this calculator lets you compare both directly.
Conjugate and Inverse
The conjugate negates the vector part (x, y, z) and is used to reverse a rotation for unit quaternions. The inverse generalizes this to non-unit quaternions (dividing the conjugate by the squared norm), so that q * inverse(q) is always the identity rotation.
Normalize and Norm
Only unit quaternions (norm = 1) represent pure rotations. Norm computes the quaternion's magnitude; Normalize rescales it to length 1 without changing the direction it represents — useful for cleaning up drift after repeated multiplications in a physics or animation system.
Dot product
The dot product measures how similar two quaternions' orientations are: a value near ±1 means they represent nearly the same rotation, while a value near 0 means they're roughly 90° apart. It's also the basis for choosing the shortest path in slerp.
Slerp vs. Lerp
Slerp (spherical linear interpolation) moves at a constant angular velocity along the shortest arc between two rotations, which is why it's the standard choice for animating smooth camera or character rotations. Lerp (linear interpolation, then re-normalized) is cheaper to compute but can speed up and slow down non-uniformly through the interpolation.