How to check if a point is inside a rectangle? There is a point $(x,y)$, and a rectangle $a(x_1,y_1),b(x_2,y_2),c(x_3,y_3),d(x_4,y_4)$, how can one check if the point inside the rectangle?
$M$ of coordinates $(x,y)$ is inside the rectangle iff

$$(0&lt;\textbf{AM}\cdot \textbf{AB}&lt;\textbf{AB}\cdot \textbf{AB}) \land (0&lt;\textbf{AM}\cdot \textbf{AD}&lt;\textbf{AD}\cdot \textbf{AD})$$
(scalar product of vectors)
find the equations of the lines and equate the distance from the point P TO THE GIVEN TWO Pairs of lines .if the point is inside the rectangle,the distances to the pairs will be less than the distances between the line in the pair