SO(3) and 3D Rotations

Axis-angle, Euler angles, gimbal lock, and SLERP interpolation

The Geometry of 3D Rotations

SO(3), the group of 3D rotations, is one of the most important Lie groups in mathematics and physics. Every rotation can be specified by an axis (a unit vector) and an angle — the axis-angle representation. The space of all rotations forms a solid ball of radius π, where antipodal boundary points are identified (a rotation by π around axis k is the same as a rotation by π around −k).

Euler angles provide an alternative parameterization, but they suffer from gimbal lock — a singularity where two rotation axes align, reducing three degrees of freedom to two. This is not just a mathematical curiosity: it caused real problems for the Apollo spacecraft navigation system.

Axis-Angle Explorer

Every 3D rotation is determined by an axis (a unit vector through the origin) and an angle of rotation around that axis. Drag the axis on the unit sphere and adjust the angle slider. Spiral particles show the rotation direction, and a luminous rod marks the rotation axis.

Euler Angles & Gimbal Lock

Euler angles decompose a rotation into three successive rotations around coordinate axes. But when the middle angle β approaches π/2, two gimbal rings align and a degree of freedom is lost — this is gimbal lock. Watch the DOF indicator drop from 3 to 2 as the rings align and flash red.

Key insight: Gimbal lock is not a bug in the implementation — it's a fundamental topological obstruction. No three-parameter smooth parameterization of SO(3) can avoid singularities (because SO(3) is not homeomorphic to ℝ³).

Non-Commutativity of Rotations

Unlike rotations in 2D, 3D rotations do not commute: R₁R₂ ≠ R₂R₁ in general. Pick two rotations and see them applied in both orders side-by-side. The glowing “error vector” shows the angular distance between the two results.

Rodrigues' Rotation Formula

Rodrigues' formula gives a closed-form expression for rotating a vector v by angle θ around axis k: v′ = v cosθ + (k × v) sinθ + k(k · v)(1 − cosθ). The three color-coded vector components animate as θ sweeps, showing how each term contributes to the final rotated vector.

SLERP: Geodesic Interpolation

To smoothly interpolate between two rotations, SLERP (Spherical Linear Interpolation) traces a geodesic — the shortest path on the rotation manifold. Compare SLERP (which maintains constant angular velocity) with naive linear interpolation (which accelerates and decelerates). Ghost afterimages show the interpolation path at regular intervals.

Key Takeaways

  • Axis-angle — every 3D rotation has an axis and an angle; the rotation space is a ball with antipodal identification
  • Gimbal lock — Euler angles have unavoidable singularities due to the topology of SO(3)
  • Non-commutativity — R₁R₂ ≠ R₂R₁ in 3D, a key difference from 2D rotations
  • SLERP — the natural interpolation on SO(3) is geodesic, giving constant angular velocity