title: Find a point inside a rotated rectangle
body: <p>Ok so, this should be super simple, but I'm not a smart man. Technically I want to know whether a point resides inside a rectangle, however the rectangle can be in different states. In my current context when I want to draw a rectangle rotated by, lets say, 45° clockwise, what I do is rotate the entire x,y axis centered at the top-left corner of the rectangle and then I just draw the rectangle as if nothing has happened. Same goes if I want to draw the rectangle at a random coordinate. Given that is the coordinate system who gets tossed and rotated, the rectangle always thinks it's being drawn at (0,0) with 0°, therefore, the best way to find if a given point is inside the rectangle would be to find the projection for the point based on the translation + rotation of the rectangle. But I have no idea how to do that.</p>
  
  <p>This is what I currently do in order to find out if a point is inside a rectangle (not taking into consideration rotation):</p>
  
  <pre><code>bool Image::isPointInsideRectangle(int x, int y, const ofRectangle &amp; rectangle){
      return x - xOffset &gt;= rectangle.getX() &amp;&amp; x - xOffset &lt;= rectangle.getX() + rectangle.getWidth() &amp;&amp;
              y - yOffset &gt;= rectangle.getY() &amp;&amp; y - yOffset &lt;= rectangle.getY() + rectangle.getHeight();
  }
  </code></pre>
  
  <p>I already have <code>angleInDegrees</code> stored, as long as I could use it to project the (x,y) point I receive I should be able find out if the point is inside the rectangle.</p>
  
  <p>Cheers!</p>
  
  <p>Axel</p>