Learn R Programming

oce (version 0.9-13)

geodGc: Find great-circle segments between two points on earth

Description

Find great-circle segments between two points on earth

Usage

geodGc(longitude, latitude, dmax)

Arguments

longitude
vector of longitudes, in degrees east
latitude
vector of latitudes, in degrees north
dmax
maximum angular separation to tolerate between sub-segments, in degrees.

Value

  • Data frame of longitude and latitude.

source

http://williams.best.vwh.net/avform.htm#Intermediate

Details

Each pair in the longitude and latitude vectors is considered in turn. For long vectors, this may be slow.

See Also

geodDist and geodXy

Examples

Run this code
library(oce)
data(coastlineWorld)
mapPlot(coastlineWorld, type='l',
        latitudelim=c(35,80), longitudelim=c(-80,10),
        projection="orthographic", orientation=c(35, -35, 0))
## Airplanes travelling between New York and London 
## pass over Newfoundland and Nova Scotia.
lon <- c(-74.0064, 0.1062)
lat <- c(40.7142, 51.5171)
l <- geodGc(lon, lat, d=1)
mapLines(l$longitude, l$latitude, col='red', lwd=2)

Run the code above in your browser using DataLab