pointinpolygon.RdTest whether each point lies inside a specified polygon.
pointinpolygon(P, A, eps, x0, y0)An integer vector with one entry for each point in P.
The result is 0 if the point lies outside A,
1 if the point lies inside A, and -1 if it lies on the
boundary.
This is part of an interface to the polygon-clipping library
Clipper written by Angus Johnson.
The argument A represents a closed polygon.
It should be
a list containing two components x and y
giving the coordinates of the vertices.
The last vertex should
not repeat the first vertex.
Calculations are performed in integer arithmetic
after subtracting x0,y0 from the coordinates,
dividing by eps, and rounding to the nearest integer.
Thus, eps is the effective spatial resolution.
The default values ensure reasonable accuracy.
Clipper Website: http://www.angusj.com
Vatti, B. (1992) A generic solution to polygon clipping. Communications of the ACM 35 (7) 56–63. https://dl.acm.org/doi/10.1145/129902.129906
Agoston, M.K. (2005) Computer graphics and geometric modeling: implementation and algorithms. Springer-Verlag. http://books.google.com/books?q=vatti+clipping+agoston