bool contains(Point point)

Whether the given point lies between the left and right and the top and bottom edges of this rectangle.

Rectangles include their top and left edges but exclude their bottom and right edges.

Source

bool contains(Point point) {
  return point.x >= left && point.x < right && point.y >= top && point.y < bottom;
}