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?


Rotate the rectangle 4 boundary points and detection point so that the bottom left corner of the rectangle becomes the origin. Change the coordinates of the point relative to the bottom left of the rectangle. Do simple boundary check for x and y axes. Done.
