compas.geometry.is_point_in_convex_polygon_xy(point, polygon)[source]

Determine if a point is in the interior of a convex polygon lying on the XY-plane.

  • point ([float, float, float] | Point) – XY(Z) coordinates of a point (Z will be ignored).

  • polygon (sequence[point] | Polygon) – A sequence of XY(Z) coordinates of points representing the locations of the corners of a polygon (Z will be ignored). The vertices are assumed to be in order. The polygon is assumed to be closed: the first and last vertex in the sequence should not be the same.


bool – True if the point is in the convex polygon False otherwise.


Does not work for concave polygons.