Test a set of points in the 2D plane to determine which are located inside or on the edges of a polygon.
The polygon geometry can be non-convex and multiply-connected.
Similar to INPOLYGON, but generally much faster, more memory efficient and less prone to numerical rounding error.
INPOLY also displays superior scaling in terms of problem size (number of points, number of polygon edges) and hence the speedup when compared to INPOLYGON is significant for large problems and can easily be a factor of several hundred.
% UPDATE 31/03/2007
New algorithm! Massive speed improvements for large problems.
Untested on MATLAB pre-R6.5. These older releases lack JIT acceleration and may suffer speed penalties as a result.