View source: R/sl.checkposition.R
sl.checkposition | R Documentation |
Check if a point is located to the left or to the right of a (directed) line, defined by two other points, on a sphere. This is equivalent to checking the direction of rotation of the resulting triangle.
sl.checkposition(a, b, c, ccw.defined.as = 1)
a |
Vector of length 2 with longitude and latitude of the start point of the line. |
b |
Vector of length 2 with longitude and latitude of the end point of the line. |
c |
Vector of length 2 with longitude and latitude of the point for which the position relative to the (great circle) line spanned from |
ccw.defined.as |
By default |
Scalar return value: 1
if c
is located to the left (if the triangle a-b-c
rotates counterclockwise), -1
if c
is located to the right (if the triangle a-b-c
rotates clockwise), or 0
if all points lie on one (great circle) line. (Values inverted if ccw.defined.as=-1
.))
Helge Goessling
sl.checkposition(a=c(0,0),b=c(90,0),c=c(45,1))
## Should return:
## [1] 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.