I realize this might be more of a math problem.
To draw the lines for my rectangles I need to solve for their corners. I have a rectangle center at (x,y) With a def
If 'theta' is the anti-clockwise angle of rotation, then the rotation matrix is:
| cos(theta) -sin(theta) |
| sin(theta) cos(theta) |
i.e.
x' = x.cos(theta) - y.sin(theta)
y' = x.sin(theta) + y.cos(theta)
If the rotation point isn't at the origin, subtract the center of rotation from your original coordinates, perform the rotation as shown above, and then add the center of rotation back in again.
There's examples of other transformations at http://en.wikipedia.org/wiki/Transformation_matrix