View source: R/sl.line.polygon.intersect.R
sl.line.polygon.intersect | R Documentation |
Check if and where a line intersects with a polygon on a sphere.
sl.line.polygon.intersect(line.lon, line.lat, polygon.lon, polygon.lat)
line.lon |
a vector of length 2 giving the longitudes of the points of the first line. |
line.lat |
a vector of length 2 giving the latitudes of the points of the first line. |
polygon.lon |
a vector of length |
polygon.lat |
a vector of length |
This functions is based on sl.line.line.intersect
, which is applied to every line segment of the polygon.
anylines.intersect |
a logical value indicating whether the line intersects with the polygon at all. |
lines.intersect |
a vector of length |
lon , lat , lon2 , lat2 , x , y , z , x2 , y2 , z2 |
vectors of length |
Helge Goessling
sl.line.polygon.intersect(line.lon=c(-10,10),line.lat=c(0,5),polygon.lon=c(-5,5,0),polygon.lat=c(0,0,5))
## Should return:
## $anylines.intersect
## [1] TRUE
##
## $lines.intersect
## [1] FALSE TRUE TRUE
##
## $lon
## [1] 170.000000 1.970366 -3.295047
##
## $lat
## [1] 0.000000 3.036942 1.710705
##
## $lon2
## [1] -10.0000 -178.0296 176.7050
##
## $lat2
## [1] 0.000000 -3.036942 -1.710705
##
## $x
## [1] -0.01490451 0.03703484 0.02213033
##
## $y
## [1] 0.002628067 0.001274107 -0.001274107
##
## $z
## [1] 0.0000000000 0.0019660214 0.0006620458
##
## $x2
## [1] 0.01490451 -0.03703484 -0.02213033
##
## $y2
## [1] -0.002628067 -0.001274107 0.001274107
##
## $z2
## [1] 0.0000000000 -0.0019660214 -0.0006620458
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.