View source: R/sl.line.lat.intersect.R
sl.line.lat.intersect | R Documentation |
Check if and where a (great-circle) line defined by two points on a sphere intersects with a given latitude. Check also if the intersection point(s) lie(s) on the shorther way between the points.
sl.line.lat.intersect(line.lon, line.lat, lat0)
line.lon |
a vector of length 2 with the longitudes of the two points defining the great-circle line. |
line.lat |
a vector of length 2 with the latitudes of the two points defining the great-circle line. |
lat0 |
a scalar giving the latitude for which intersection points are sought. |
line.lat.intersect |
a logical value indicating whether the line intersects with the latitude between the two points (on the shorter way). |
lat |
equals the argument |
lon |
if existent, the longitude at which the great circle line (shorter and longer way) intersects with the latitude. |
line.lat.intersect.twice |
a logical value indicating whether the line intersects twice with the latitude between the two points (on the shorter way). |
lon2 |
if existent, the second longitude at which the line intersects with the latitude (on the shorter way). |
gcline.lat.intersect |
an integer indicating how often the complete great-circle line (shorter and longer way) intersects with the latitude (must be |
x |
if existent, a scalar giving the |
y |
if existent, a scalar giving the |
z |
if existent, a scalar giving the |
x2 |
if existent, a scalar giving the |
y2 |
if existent, a scalar giving the |
z2 |
if existent, a scalar giving the |
Helge Goessling
sl.line.lat.intersect(line.lon=c(0,1),line.lat=c(0,1),lat0=30)
## Should return:
## $line.lat.intersect
## [1] FALSE
##
## $lat
## [1] 30
##
## $lon
## [1] 35.25822
##
## $line.lat.intersect.twice
## [1] FALSE
##
## $lon2
## [1] 144.7418
##
## $gcline.lat.intersect
## [1] 2
##
## $x
## [1] 0.7071606
##
## $y
## [1] 0.4999238
##
## $z
## [1] 0.5
##
## $x2
## [1] -0.7071606
##
## $y2
## [1] 0.4999238
##
## $z2
## [1] 0.5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.