For a given matrix of points coordinates, pointsInPolygon
returns a
logical vector stating whether or not these points are inside a specific
polygon whose coordinate as passed as an argument.
pointsInPolygon(points, polygon)
points | a matrix of coordinates of points to be tested. |
---|---|
polygon | a two-columns matrix including the coordinate of the polygon. |
Implements the Ray-casting algorithm.
https://rosettacode.org/wiki/Ray-casting_algorithm#C