Learn R Programming

geosphere (version 1.3-13)

onGreatCircle: Is a point on a given great circle?

Description

Test if a point is on a great circle defined by two other points.

Usage

onGreatCircle(p1, p2, p3)

Arguments

p1
Longitude/latitude of the first point definging a great circle, in degrees; can be a vector of two numbers, a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialPoints* object
p2
as above for the second point
p3
the point(s) to be tested if they are on the great circle or not

Value

  • logical

Examples

Run this code
onGreatCircle(c(0,0), c(30,30), rbind(c(-10 -11.33812), c(10,20)))

Run the code above in your browser using DataLab