Euler Angles describe orientation as three sequential rotations about coordinate axes: φ (Roll/X), θ (Pitch/Y), ψ (Yaw/Z). Simple and intuitive — but prone to gimbal lock when the middle angle reaches ±90°.
Convention
Rotation Order
Angles
–
0.0°
–
0.0°
–
0.0°
⚠ Near Gimbal Lock — middle angle ≈ ±90°. One DOF is lost. See Compare tab.
Rotation Matrix
SLERP — Capture Orientations & Animate
t0%
Options
Legend
World X
World Y
World Z
Body x
Body y
Body z
Presets
Rotation Matrix R ∈ SO(3) is a 3×3 orthogonal matrix with det(R) = +1. Its columns are the body-frame axes expressed in world coordinates — making it geometrically transparent. No singularities, but redundant (9 values for 3 DOF).
Matrix Input — columns = body axes in world
body x
body y
body z
Validity
—
det = —‖RᵀR−I‖ = —
Operations
Extracted from R using θ = arccos((tr(R)−1)/2) :
θ—rotation angle
n̂—unit axis
SLERP
t0%
Euler Decomposition
α₁——
α₂——
α₃——
Presets
Quaternion q = w + xi + yj + zk encodes a rotation by angle θ about unit axis n̂ as: w = cos(θ/2), and x,y,z = sin(θ/2)·n̂. No singularities, compact (4 values), ideal for interpolation and composition.
Set via Axis-Angle (Most Intuitive)
θ Rotation Angle
0.0°
Formula Breakdown — how components are computed
q = cos(θ/2) + sin(θ/2)·(nₓi + nᵧj + n_zk)
θ——
n̂axis direction—
wcos(θ/2)—
xsin(θ/2)·nₓ—
ysin(θ/2)·nᵧ—
zsin(θ/2)·n_z—
Raw Components (editable)
w
x
y
z
|q|² = w²+x²+y²+z² = 1.00000 ✓
⚠ If |q| ≠ 1, the quaternion does not represent a pure rotation — it scales or skews the result. Drag sliders freely to see the effect, then Normalize to restore validity.
Double Cover — q and −q are identical rotations
Negating all components produces the same 3D orientation — the object doesn't move. This is the "double cover" of SO(3) by the unit sphere S³.
SLERP — Shortest Arc Interpolation on SO(3)
t0%
SLERP interpolates along the great circle on S³ — constant angular velocity, shortest path. Unlike Euler LERP which produces non-uniform, potentially large-arc interpolation.
Resulting R (derived)
Comparison — Euler angles are intuitive but singular; rotation matrices are universal but redundant; quaternions are the engineering sweet-spot. Use the interactive demos below to build intuition for when each representation shines.
📊 Representation Properties
Euler
Matrix
Quaternion
Parameters
3 minimal
9 redundant
4 compact
Singularity
Gimbal lock ⚠
None ✓
None ✓
Compose cost
Trig-heavy
27 mul
16 mul
Renormalize
—
Gram-Schmidt
÷|q| (5 ops)
Interpolation
Non-uniform
Complex
SLERP ✓
Human intuition
High ✓
Low
Medium
🔒 Gimbal Lock — Interactive (ZYX Body)
ψ Yaw (Z)0.0°
θ Pitch (Y) ← drag to ±90°0.0°
φ Roll (X)0.0°
Axes independent (3 DOF active)
The gold, orange, red-orange arrows show the three rotation axes. At θ = ±90°, two axes align → one DOF is permanently lost. A quaternion has no such issue.
Apply N random small rotations in sequence. Floating-point rounding causes both representations to drift from their constraints. Each click runs a fresh simulation with a new random seed — compare across runs.
#
N
Matrix ‖RᵀR−I‖
Quat |1−|q||
Ratio
Even if drift magnitudes are similar, quaternion renormalization costs ~5 ops (divide by norm) vs matrix Gram-Schmidt at ~40 ops.