Category: Linear Algebra Level: 301
R(θ) = [[cos θ, -sin θ], [sin θ, cos θ]]
To rotate the plane by an angle, track where e₁ and e₂ go on the unit circle. Those two landing points are the columns of the rotation matrix.
The basis vectors e₁ and e₂ both sit on the circle of radius 1. Rotate everything by θ = 30° counterclockwise.
θ = 30°
The tip of e₁ slides 30° along the circle. Its new x is cos θ and its new y is sin θ, the legs of the dashed triangle.
R e1 = (cos θ, sin θ) = (0.866, 0.5)
The tip of e₂ slides 30° too, which moves it left. Its new x is −sin θ and its new y is cos θ.
R e2 = (-sin θ, cos θ) = (-0.5, 0.866)
The first column is where e₁ lands and the second column is where e₂ lands. That is the whole rotation matrix.
R(30°) = [[0.866, -0.5], [0.5, 0.866]]
Every point turns by 30° about the origin. The yellow square keeps its size and its right angles, so the determinant is 1. A rotation never squashes anything.
det R = cos2 θ + sin2 θ = 1
cd svg-generator python3 -m svgmath render rotation-matrix --out /tmp/rotation-matrix
Source: svgmath/diagrams/linear_maps.py