sl.inpolygon.convex | R Documentation |
Check whether a point is located inside a convex polygon on a sphere.
sl.inpolygon.convex(lon.point, lat.point, lon, lat, check.ccw.convex = TRUE, border.as.in = TRUE)
lon.point |
a scalar giving the longitude of the point. |
lat.point |
a scalar giving the latitude of the point. |
lon |
a vector giving the longitudes of the polygon. |
lat |
a vector giving the latitudes of the polygon. |
check.ccw.convex |
a logical value indicating whether it is checked at the beginning if the polygon fulfills the requirements for the algorithm to work, that is, if the polygon is ordered counterclockwise and if it is convex. The default is |
border.as.in |
a logical value indicating whether the polygon edges are counted as 'inside'. |
A logical value indicating whether the point is located inside the polygon.
Helge Goessling
sl.inpolygon.convex(lon.point=0,lat.point=0,lon=c(-10,-10,10,10),lat=c(10,-10,-10,10))
## Should return:
## [1] TRUE
sl.inpolygon.convex(lon.point=0,lat.point=20,lon=c(-10,-10,10,10),lat=c(10,-10,-10,10))
## Should return:
## [1] FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.