title: Find the Bounding Rectangle of Rotated Rectangle
body: <p>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</p>
  
  <pre><code> |  cosθ  sinθ |
   | -sinθ  cosθ |
  </code></pre>
  
  <p>I need to find the co-ordinates of bounding rectangle after rotation. </p>
  
  <p><strong>Before rotation</strong></p>
  
  <pre><code>0,0
   |"""""""""""""""""""""""""""""""""""""""""""|
   |                                           |
   |  x1,y1                                    |
   |       |"""""""""""""|                     |
   |       |             |                     |
   |       |             |                     | 
   |       |             |                     |
   |       """""""""""""" x2,y2                |
   |                                           |
   |                                           |
    """"""""""""""""""""""""""""""""""""""""""" W,H
  </code></pre>
  
  <p><strong>After rotation</strong> </p>
  
  <pre><code> 0,0
       |"""""""""""""""""""""""""""""""""""""""""""|
       |           ?,?                             |
       |            |""""/\"""""|                  |      
       |            |   /   \   |                  |
       |            |  /      \ |                  |
       |            | /        /|                  |
       |            |/        / |                  |
       |            |\       /  |                  |
       |            |  \    /   |                  |
       |            |    \ /    |                  |
       |             """""""""""  ?,?              |
       |                                           |
       |                                           |
        """"""""""""""""""""""""""""""""""""""""""" W,H
  </code></pre>
  
  <p>Is there any general equation for finding the co-ordinates of bounding rectangle?.</p>
  
  <p>Thanks....</p>
  
  <p>Haris.</p>