liveBook · Manning

Rotation matrix

As explained in Math and Architectures of Deep Learning

A matrix that represents a geometric rotation in this section, with orthogonal rotation matrices being length-preserving and invertible by transposition.

A rotation matrix represents geometric rotation by mapping vectors to new coordinates while preserving their distance from the center. In two dimensions, rotation by θ uses R = [[cos θ, −sin θ], [sin θ, cos θ]]. Three-dimensional variants rotate around the X, Y, or Z axis; the coordinate on the rotation axis remains unchanged. section 2.14 section 2.14.1

Key properties connect the geometry to matrix computation:

  • Every rotation matrix R is orthogonal: RᵀR = RRᵀ = I, so Rᵀ = R⁻¹. section 2.14.2
  • Orthogonality preserves vector length, so rotating u into Ru does not change its magnitude. section 2.14.2
  • Negating the angle reverses the rotation: R(−θ) = R(θ)ᵀ. section 2.14.2
  • Every rotation has eigenvalue 1; its corresponding eigenvector defines the rotation axis, whose points remain fixed. section 2.14.4

Compose two three-dimensional rotations

Start with u = [1, 1, 1]. Apply a 45° rotation about the Z-axis to obtain v = R₃ᴅ,z(45°)u, then apply a 45° rotation about the X-axis to obtain w = R₃ᴅ,x(45°)v. In PyTorch, each step is matrix multiplication, such as torch.matmul(R3dz, u).

Rotation also changes coordinates without changing the underlying geometry of a quadratic shape. For a hyperellipse, diagonalizing its symmetric matrix supplies an orthogonal eigenvector matrix S; rotating coordinates by S aligns the coordinate axes with the ellipse axes. section 2.17 section 2.17.1

How Math and Architectures of Deep Learning covers it

How deep it goes
Develops formulas, geometric properties, PyTorch checks, eigen-axes, and hyperellipse alignment without extending into later applications.
Examples
Demonstrates planar and axis-specific rotations, sequential 3D rotations, PyTorch assertions, and a 45-degree hyperellipse axis.
What it assumes
Builds from vectors, matrices, matrix multiplication, transposes, inverses, eigenvalues, eigenvectors, and linear transformations.
What you can do after
Apply it via PyTorch to construct rotations, transform vectors, verify orthogonality, reverse angles, and find hyperellipse axes.
How it connects
Connects rotation matrices with orthogonal matrices, eigenvalues, eigenvectors, diagonalization, linear transformations, and hyperellipses.

Also explained in

Compare how 2 books explain rotation matrix →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.