Last data update: 2014.03.03
|
R: In-Polygon test
in.polygon | R Documentation |
In-Polygon test
Description
Checks if points are in the interior of a polygon.
Usage
in.polygon(x0, y0, x, y)
Arguments
x0 |
coordinates of points to check
|
y0 |
see x0
|
x |
coordinates defining the polygon
|
y |
see x
|
Details
Uses a simple points-in-polygon check combined with the polygon
function.
Polygon is closed automatically.
Value
comp1 |
Description of ‘comp1’
|
comp2 |
Description of ‘comp2’
|
Author(s)
Albrecht Gebhardt <agebhard@uni-klu.ac.at>
References
Follows an idea from algorithm 112 from CACM
(available at http://www.netlib.org/tomspdf/112.pdf)
See Also
in.convex.hull , polygon , in.chull
Examples
in.polygon(c(0,1),c(0,1),c(0,1,0,-1),c(-1,0,1,0))
# should give: TRUE FALSE
Results
|