Rotating (the right way)

Images and text from 2D Transformations tutorial by J David Eisenberg

The correct way to rotate the square is to: 1) Translate the coordinate system’s origin (0, 0) to where you want the upper left of the square to be. 2) Rotate the grid π/4 radians (45°) 3) Draw the square at the origin.