How to check if a point is inside a rectangle?

There is a point (x,y), and a rectangle a(x1,y1),b(x2,y2),c(x3,y3),d(x4,y4), how can one check if the point inside the rectangle?

enter image description here


M of coordinates (x,y) is inside the rectangle iff

(scalar product of vectors)

Source : Link , Question Author : Freewind , Answer Author :
2 revs

Leave a Comment