title: Calculate largest inscribed rectangle in a rotated rectangle
body: <p>I'm trying to find the best way to calculate the biggest (in area) rectangle which can be contained inside a rotated rectangle.</p>
  
  <p>Some pictures should help (I hope) in visualizing what I mean:</p>
  
  <p><img src="https://i.stack.imgur.com/GVOIB.jpg" alt="input rectangle with given width and height">
  <img src="https://i.stack.imgur.com/pramO.jpg" alt="rotate erctangle by alpha degrees">
  <img src="https://i.stack.imgur.com/i3sN5.jpg" alt="output inner rectangle"></p>
  
  <p>The width and height of the input rectangle is given and so is the angle to rotate it. The output rectangle is not rotated or skewed.</p>
  
  <p>I'm going down the longwinded route which I'm not even sure if it will handle the corner cases (no pun intended). I'm certain there is an elegant solution to this. Any tips?</p>
  
  <p><strong>EDIT</strong>: The output rectangle points don't necessarily have to touch the input rectangles edges. (Thanks to Mr E)</p>