← Back to curriculum

Frames & rigid motion

Rigid body motion in 2D and 3D

Special orthogonal groups, Euler vs axis–angle, and homogeneous coordinates for compact composition.

~60 min read + exercises

You will unify rotation representations and see why homogeneous coordinates are the standard bookkeeping trick in robotics, graphics, and vision calibration.

Figure

Planar rigid motion: rotate θ, then translate t

Planar rigid motion: rotate θ, then translate (x, y)Three degrees of freedom describe any body pose in the plane.xᵂyᵂworldt = (x, y)xᵇyᵇbodyθpᵂ = R(θ) pᵇ + tSE(2): 3 DoF (x, y, θ)
The body frame's axes are R(θ) applied to the world axes, anchored at the translated origin. Three numbers (x, y, θ) describe any pose.

Learning objectives

  • Parameterize planar rotation with one angle; describe the 2D rotation matrix.
  • Name three 3D rotation parameterizations and one trade-off for each.
  • Build a 4×4 homogeneous transform that combines rotation and translation.

Prerequisites

  • Coordinate frames lesson.
  • Comfort multiplying 3×3 matrices.

Step 1 — Planar rigid motion (SE(2))

A rigid body in the plane has three degrees of freedom: translation (x,y)(x, y) and rotation θ\theta.

Rotation:

R(θ)=[cos⁡θ−sin⁡θsin⁡θcos⁡θ]R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

Transform a point p\mathbf{p} in body frame to world:

pw=R(θ) pb+t\mathbf{p}^w = R(\theta)\, \mathbf{p}^b + \mathbf{t}

Checkpoint: How many degrees of freedom in SE(2)?


Step 2 — SO(3): the space of 3D rotations

The set of valid 3D rotation matrices is SO(3) (“special orthogonal”).

  • Matrix storage: 9 numbers with 6 constraints — redundant but easy to compose.
  • Euler angles: 3 numbers but suffer gimbal lock in some conventions and can be ambiguous.
  • Axis–angle / rotation vector: compact, useful for optimization and IMU integration.
  • Unit quaternions: 4 numbers with 1 constraint, smooth interpolation (SLERP), no gimbal lock.

Figure

Four ways to store a 3D rotation

Three popular ways to store a 3D rotationEach is convenient for some task — almost no team uses just one.Rotation matrixR ∈ SO(3)+ easy to compose− 9 numbers + 6 constraintsEuler angles(φ, θ, ψ)+ human-readable− gimbal lockϑûAxis–angle(û, ϑ)+ compact, IMU-friendly− discontinuous near πS³Unit quaternionq ∈ S³+ smooth, no gimbal lock− double cover (±q)
Almost no real codebase uses just one — matrices for composing, quaternions for integration, axis–angle for IMUs, Euler only for human-readable logs.

Exercise: When would you avoid Euler angles in estimation code?


Step 3 — Homogeneous transforms in SE(3)

Pack rotation and translation into one 4×44 \times 4 matrix:

T=[Rt0⊤1]T = \begin{bmatrix} R & \mathbf{t} \\ \mathbf{0}^\top & 1 \end{bmatrix}

(0\mathbf{0} is the 1×31 \times 3 zero row under RR, then a 11 in the bottom-right.)

A homogeneous point [x,y,z,1]⊤[x, y, z, 1]^\top in frame bb maps to frame ww by multiplying by the transform from bb to ww (read direction per your software’s convention — always verify against a known pose).

Checkpoint: Why is the bottom row (0, 0, 0, 1) useful rather than storing R and t separately?


Step 4 — Inverting rigid transforms

The inverse of a rigid transform is:

T−1=[R⊤−R⊤t0⊤1]T^{-1} = \begin{bmatrix} R^\top & -R^\top \mathbf{t} \\ \mathbf{0}^\top & 1 \end{bmatrix}

Intuition: “undo translation in the rotated coordinates, then undo rotation.”

Exercise: Derive −R⊤t-R^\top \mathbf{t} in words: why not just −t-\mathbf{t}?


Step 5 — Velocities preview (twists)

Rigid motion over time leads to angular velocity ω\boldsymbol{\omega} and linear velocity v\mathbf{v}. In advanced courses, these are packaged as twists and mapped through Jacobians — the kinematics lessons next.


Check your understanding

  1. Why are unit quaternions preferred over Euler angles for integrating IMU orientation?
  2. What does det⁡(R)=−1\det(R) = -1 imply physically?
  3. Compute R(90∘)R(90^\circ) about the zz axis and verify R⊤R=IR^\top R = I.

Lab-style stretch goal (optional)

Implement axis–angle → rotation matrix (Rodrigues) and test on random vectors:

∥Rv∥≈∥v∥\|R\mathbf{v}\| \approx \|\mathbf{v}\|