To do a 90-degree rotation on a point
(x,y)open paren x comma y close paren
(π₯,π¦) about the origin, you swap the coordinates and change the sign of one, depending on the direction: for counter-clockwise, the new point is
(βy,x)open paren negative y comma x close paren
(βπ¦,π₯); for clockwise, the new point is
(y,βx)open paren y comma negative x close paren
(π¦,βπ₯).