Home

Quaternion Rotation Lab

One object, two covers, three ways to see rotation.

A visual lab for the unit quaternion q = w + xi + yj + zk, its 3D rotation p' = qpq^-1, and the Pauli-matrix form of the same SU(2) transformation.

Loading 3D quaternion scene...

Axis-angle form

q = cos(36 deg) + (0.35i + 0.72j + 0.59k) sin(36 deg)

Pauli-matrix form

1.000 + 0.000i 0.000 + 0.000i 0.000 + 0.000i 1.000 + 0.000i

Teaching Path

From quaternion numbers to Pauli matrices.

1. A unit quaternion is a rotation handle

Write q = w + xi + yj + zk. When |q| = 1, the vector part points along a rotation axis and the scalar part stores the half angle.

q = cos(theta/2) + u sin(theta/2)

2. Rotate vectors by conjugation

A 3D vector v becomes a pure quaternion p = 0 + vx i + vy j + vz k. The rotated vector is the vector part of q p q^-1.

p' = q p q^-1

3. Composition is multiplication

Doing rotation A and then rotation B is not ordinary addition of angles. It is quaternion multiplication, so order matters.

q_total = q_B q_A

4. q and -q describe the same 3D attitude

The cube returns after 360 degrees, but the spinor sign flips. The SU(2) object needs 720 degrees to return to its starting sign.

SO(3) = SU(2) / {+I, -I}

The Pauli Bridge

Unit quaternions and SU(2) use the same four real degrees of freedom.

Pack a unit quaternion into a complex matrix with U(q) = wI - i(x sigma_x + y sigma_y + z sigma_z). Because w^2 + x^2 + y^2 + z^2 = 1, this matrix is unitary and has determinant one. That is exactly SU(2).

This is why a 3D rotation can be described either as a quaternion acting on vectors, or as a Pauli-matrix exponential acting on a spinor: U = exp(-i theta n.sigma / 2). The half angle is the shared clue.

sigma_x [[0, 1], [1, 0]]
sigma_y [[0, -i], [i, 0]]
sigma_z [[1, 0], [0, -1]]

Applications

Where the same math shows up.

Graphics and games

Camera orientation, character rigs, and object animation use quaternions because they avoid gimbal lock and interpolate cleanly with SLERP.

Robotics and navigation

Drones, phones, and robot arms fuse IMU data into orientation quaternions, then convert them into control-frame rotations.

Quantum mechanics

Pauli matrices generate SU(2). A single-qubit gate or spin-1/2 rotation is exp(-i theta n.sigma / 2), the matrix twin of a unit quaternion.

Physics visualization

Bloch-sphere motion, angular momentum, and rigid-body attitudes can be shown with the same axis-angle and double-cover ideas.