Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you should compare your point x and y coordinates with rectangle points, so if the p0 is the top-left vertex of the rectangle and p1 bottom-right then 1. p0 x coordinate < point x < p1 x coordinate 2. p0 y coordinate < point y < p1 y coordinate

if those conditions are true then the point is inside the rectangle

you should compare your point x and y coordinates with rectangle points, so if the p0 p0 is the top-left top-left vertex of the rectangle and p1 bottom-right then p1 bottom-right then

 1.  p0 x coordinate < point x < p1 x coordinate
 2. p0 y coordinate < point y < p1 y coordinate

coordinate

if those conditions are true satisfied then the point is inside inside the rectangle