:py:mod:`gnome.utilities.geometry.PinP` ======================================= .. py:module:: gnome.utilities.geometry.PinP .. autoapi-nested-parse:: Point in Polygon code. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: gnome.utilities.geometry.PinP.points_in_poly gnome.utilities.geometry.PinP.CrossingsTest .. py:function:: points_in_poly(pgon, points) compute whether the points given are in the polygon defined in pgon. :param pgon: the vertices of teh polygon :type pgon: NX2 numpy array of floats :param points: the points to test :type points: NX3 numpy array of (x, y, z) floats :returns: a boolean array the same length as points Note: this version takes a 3-d point, even though the third coord is ignored. .. py:function:: CrossingsTest(pgon, xxx_todo_changeme) Point in polygon test using the "Crossings" algorithm. CrossingsTest(pgon, (tx, ty)) pgon is an NX2 numpy array of points (or something that can be turned into one) (tx, ty) is the coords of the point to check translated from C code from "Graphics Gems" This could be compiled with cython nicely Note: This code will ignore the last point if the first and last points are the same.