The formula of a rotation is:
90° clockwise rotation: (x,y) —> (y,-x)
90° counterclockwise rotation: (x,y) —> (-y,x)
180° clockwise and counterclockwise rotation: (x, y) —> (-x,-y)
270° clockwise rotation: (x,y) —> (-y,x)
270° counterclockwise rotation: (x,y) —> (y,-x)
More about Rotations:
- Rotations are isometric
- 180 rotations are equal to a reflection through its origin.