Skip to main content

Module spatial

Module spatial 

Source
Expand description

Point-in-polygon and segment intersection for convex polygons.

Functions§

collinear_segments_overlap_area
Collinear segment overlap: true if two collinear segments share more than a point.
point_inside_or_on_boundary
True if point is inside OR on the boundary of a polygon (convex or non-convex).
point_on_polygon_boundary
True if point (px, py) is on the boundary of the polygon (on any edge).
point_strictly_inside_convex
True if point (px, py) is strictly inside the convex polygon. Uses cross-product sign consistency: for CCW polygon, point is inside iff it’s on the left side of ALL edges (all cross products positive).