if you're only doing 90 degree rotations, you can simplify it without sin/cos
clockwise:
newX = oldY;
newY = -oldX;
counterclockwise:
newX = -oldY;
newY = oldX;
(pivot is the origin, rotations are looking down at it)
if you're using any other angle besides 90 for rotations, use sin/cos