View source: R/sl.point.between.R
sl.point.between | R Documentation |
Check if a point is located on the (shortest) line between two points on a sphere, UNDER THE ASSUMPTION THAT the point is located either on the shorter or the longer part of the great-circle line defined by the two points.
sl.point.between(p.lon, p.lat, line.lon, line.lat)
p.lon |
a scalar specifying the longitude of the point. |
p.lat |
a scalar specifying the latitude of the point. |
line.lon |
a vector of length 2 specifying the longitudes of the line end points. |
line.lat |
a vector of length 2 specifying the latitudes of the line end points. |
Given that the function works under the assumption that the point is located either on the shorter or the longer part of the great-circle line defined by the two points, the result is not meaningful if that assumption is not met. If in doubt, use sl.checkposition
to check the assumption.
a logical value indicating whether or not the point is located on the shortest line between the two points.
Helge Goessling
sl.checkposition
sl.point.between(90,0,c(0,170),c(0,0))
## Should return:
## [1] TRUE
sl.point.between(90,0,c(0,190),c(0,0))
## Should return:
## [1] FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.