title: Point in rectangle
body: <p>What is the fastest way to find if a point is in a rectangle <strong><em>given in this form:</em></strong><br>
  I have two points which are the <em>centers of opposite sides</em> of the rectangle, and a number which is <em>the height of those sides</em>. I hope this is clear.<br>
  The rectangle is (probably) not aligned with the axis. I am wondering if there may be a faster algorithm given this data then calculating the four corners, rotating, etc.</p>
  
  <p>An idea I though of but am not sure how to implement (having trouble with the math) was to find the distance from the point to the line traced between the two centers, and if it is  less then half the length of the side of the rectangle and also <em>on the line</em> then it is in the rectangle. I don't know how to explain this better.</p>
  
  <p>Maybe the picture will help explain:<img src="https://i.stack.imgur.com/XTh2L.png" alt="explanation"><br>
  A, B, C are given, as well as the length of side A/B. Basically I thought that if CD is less then half of side A and D is on AB, the point is in the rectangle. But how do I do this?<br>
  <strong>Another thought:</strong> Instead of finding D to see if it is on AB, check if angles ABC and BAC are acute, but I still don't know how to do this.</p>