title: 2D Rotated rectangle contains point calculation
body: <p>My issue is that I've been trying to check if a rectangle that is rotated by a certain amount of degrees contain a point, but I wasn't able to calculate that after many attempts with the help of some code samples and examples that I've found online.</p>
  
  <p>What I got is the rectangle (X, Y, Width, Height, Rotation) and the point (X, Y) and I've been trying to create a simple function that lets me instantly calculate that, which would be something something like this:</p>
  
  <pre><code>public bool Contains(Rect Rectangle, float RectangleRotation, Point PointToCheck);
  </code></pre>
  
  <p>But as I mentioned, I wasn't able to do so, those mathematical calculations that include some formulas I found online are way too much for me to understand.</p>
  
  <p>Could someone help me with calculating this? If you could provide the calculation in C# code form (not formulas) then that would be great! Thanks.</p>
  
  <p>PS: Using the 2D Physics Engine that is available in Unity3D is not a option, my rectangle is not associated with a gameobject that I could attach a 2D collision component to, I need to do this mathematically without the involvement of gameobjects or components.</p>
  
  <p>Edit: I forgot to mention, the rectangle is being rotated by the middle of the rectangle (center/origin).</p>