Kolton Ndoj

The rotation matrix

A 2 by 2 table of numbers whose entire job is to spin everything around the origin.

(cos⁡θ−sin⁡θsin⁡θcos⁡θ)(xy)\begin{pmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}

What the symbols mean

θ\theta
angle to rotate by
(cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta)
where the point (1,0) lands

Why it works — the picture

A matrix is fully decided by where it sends the two basic arrows. Rotating (1,0) by theta puts it at (cos, sin). Rotating (0,1) puts it at (-sin, cos). Those become the columns. Because turning by a then by b is the same as turning by a+b, multiplying the two rotation matrices must give a rotation matrix with a+b in it; reading the entries gives the sine and cosine addition formulas for free.

Graph for The rotation matrix 06.282.5-2.5
The new x after rotating the point (a, b) by angle t. Moving b makes the wave start shifted: a spinning point has a wave as its shadow. (drawn with the default slider values — move the sliders live)

Try it yourself

Where it’s used in real life

Every 3D game and animation rotates objects with this; so do robot arms and phone screens.

Related

Play with it live →

Math · Linear algebra · Stretch