title: Find vertices of rectangle after rotating it
body: <p>So I admit I didn't really know how to phrase the question. But a full explanation should help shed some light. Here is what I know. I have a rectanlge drawn on an HTML5 Canvas. I know the points of all 4 corners and the width and height. From this I can calculate the mid-point. What I want to know is if I rotate the rectangle n degress, what the new points will be. So for example I want to rotate it 45deg from the center point. What will the new vertices of the four corners be? Hopefully that fully explains what I'm looking for. Code examples, preferably in JavaScript, would be great. Thanks in advance. </p>