To rotate (x, y) through angle \(\displaystyle \theta\) about the origin, do the matrix multiplication \(\displaystyle \begin{bmatrix}cos(\theta) & -sin(\theta) \\ sin(\theta) & cos(\theta)\end{bmatrix}\begin{bmatrix}x \\ y \end{bmatrix}\).
To rotate (x, y) through angle \(\displaystyle \theta\) about a point (a, b) that is not the origin
1) translate (a, b) to the origin using (x, y)-> (x- a, y- b)
2) do the matrix multiplication above to get the new (x, y)
3( translate back using (x, y)-> (x+ a, y+ b).