Finding whether a point lies inside a rectangle or not
- by avd
The rectangle can be oriented in any way...need not be axis aligned. Now I want to find whether a point lies inside the rectangle or not.
One method I could think of was to rotate the rectangle and point coordinates to make the rectangle axis aligned and then by simply testing the coordinates of point whether they lies within that of rectangle's or not.
The above method requires rotation and hence floating point operations. Is there any other efficient way to do this??