First, I need to know whether to rotate clockwise or counterclockwise. The mapping rule for a clockwise 90° rotation is (x,y)→(y,-x). If I want to rotate counterclockwise, I need to find the equivalent angle: 270° clockwise is the same as 90° counterclockwise. The mapping rule for a clockwise 270° rotation is (x,y)→(-y,x).