A rotation matrix R is a linear operator that transforms a point in a two-dimensional space according to the rotation rules. To use the rotation matrix, we write the initial point as a vector (xi,yi); then, we apply the matrix to it using the matrix product. The final equation is simple:
xf = R · xi
where R is equal to: cos(Θ) -sin(Θ) sin(Θ) cos(Θ) and Θ is the angle of the rotation.