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, tuple or list of at least 2 floats) – xy point to test for inclusion in polygon

  • poly (2D numpy array, tuple or list of tuples or lists of at 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