How to get upper-left, upper-right, lower-left and lower-right corners XY coordinates from a rectangle shape. How can I get the get upper-left, upper-right, lower-left and lower-right corners given XY coordinates from a rectangle shape when I have the following data available to me?
positionX 
positionY
width
height
rotation

Is there an easy way of doing this?
Clarification:
The rectangle is being rotated at positionX and positionY, the upper-left corner when no rotation is applied (rotation=0).
 A: First, let me take these smaller notifications:


*

*positionX = $x$

*positionY = $y$

*width = $w$

*height = $h$

*rotation = $\theta$
Thus, our top-left point is $(x,y)$. The other 3 points will be(without rotation): $(x+w, y)$, $(x+w, y-h)$ and $(x, y-h)$.


Since we are rotating the complete geometry about point $(x,y)$ by an angle of $\theta$, we'll have new points given as:


*

*$(x, y)$

*$(x + w*\cos(\theta), y + w*\sin(\theta))$

*$(x + w*\cos(\theta) + h*\cos(\frac{3\pi}{2}-\theta), y + w*\sin(\theta) + h*\sin(\frac{3\pi}{2}-\theta))$

*$(x + h*\cos(\frac{3\pi}{2}+\theta), y + h*\sin(\frac{3\pi}{2}+\theta))$


which, on simplification give us the co-ordinates


*

*$(x, y)$

*$(x + w*\cos(\theta), y + w*\sin(\theta))$

*$(x + w*\cos(\theta) - h*\sin(\theta), y + w*\sin(\theta) - h*\cos(\theta))$

*$(x + h*\sin(\theta), y - h*\cos\theta))$


I am not entirely sure of the conversion I did for $\sin(\frac{3\pi}{2}±\theta)$ or $\cos(\frac{3\pi}{2}±\theta)$

KEY: 1. -> Top-Left corner, 2. -> Top-Right Corner, 3. -> Bottom-Right Corner and 4. -> Bottom-Left Corner.

A: Let the coordinate of upper left corner be $(a,b)$ and width and hight are $w$ and $h$ respectively. Now if the rotation angle is $0$ then upper right corner is $(a+w,b)$, lower left corner is $(a,b-h)$, lower right corner is $(a+w,b-h)$. Now translate your origin to $(a,b)$ and rotate the coordinate axes by $\theta$ say, then you can compute the transformed coordinates using the formulas given here and here ${} {} {}$
