I have rectangle with co-ordinates(x1,y1) and (x2,y2) and I have to rotate the rectangle an amount of θ about it centre using Rotation Matrix
| cosθ sinθ |
| -sinθ cosθ |
I need to find the co-ordinates of bounding rectangle after rotation.
Before rotation
0,0
|"""""""""""""""""""""""""""""""""""""""""""|
| |
| x1,y1 |
| |"""""""""""""| |
| | | |
| | | |
| | | |
| """""""""""""" x2,y2 |
| |
| |
""""""""""""""""""""""""""""""""""""""""""" W,H
After rotation
0,0
|"""""""""""""""""""""""""""""""""""""""""""|
| ?,? |
| |""""/\"""""| |
| | / \ | |
| | / \ | |
| | / /| |
| |/ / | |
| |\ / | |
| | \ / | |
| | \ / | |
| """"""""""" ?,? |
| |
| |
""""""""""""""""""""""""""""""""""""""""""" W,H
Is there any general equation for finding the co-ordinates of bounding rectangle?.
Thanks....
Haris.