A 2D coordinate (x1,y1)(x_1, y_1)(x1,y1) can be easily rotated by θ\thetaθ around another point (xc,yc)(x_c, y_c)(xc,yc) to give the new rotated point (x2,y2)(x_2, y_2)(x2,y2) with the equation:
The angle θ\thetaθ is positive for a counter-clockwise rotation. You may notice that the coordinate is translated as if (xc,yc)(x_c, y_c)(xc,yc) was the origin, the rotation transformation is applied, and then it is translated back into position.