resqpy.olio.point_inclusion.pip_cn
- resqpy.olio.point_inclusion.pip_cn(p, poly)[source]
2D point inclusion: returns True if point is inside polygon (uses crossing number algorithm).
- Parameters:
p (
numpy array,tupleorlistofat least 2 floats) – xy point to test for inclusion in polygonpoly (
2D numpy array,tupleorlistoftuplesorlistsofat least 2 floats) – the xy points defining a polygon
- Returns:
boolean – True if point is within the polygon
Note
if the polygon is represented by a closed resqpy Polyline, pass Polyline.coordinates as poly