Description Usage Arguments Value Author(s) References Examples
Get points on a great circle as defined by the shortest distance between two specified points
1 | greatCircle(p1, p2, n=360, sp=FALSE)
|
p1 |
longitude/latitude of point(s). 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 |
n |
The requested number of points on the Great Circle |
sp |
Logical. Return a SpatialLines object? |
A matrix of points, or a list of such matrices (e.g., if multiple bearings are supplied)
Robert Hijmans, based on a formula provided by Ed Williams
http://www.edwilliams.org/avform.htm#Int
1 | greatCircle(c(5,52), c(-120,37), n=36)
|
Loading required package: sp
lon lat
[1,] -170 -48.1578258
[2,] -160 -37.4620764
[3,] -150 -21.4292761
[4,] -140 -0.3878386
[5,] -130 20.7643542
[6,] -120 37.0000000
[7,] -110 47.8571425
[8,] -100 54.9024899
[9,] -90 59.5002369
[10,] -80 62.4976247
[11,] -70 64.3825856
[12,] -60 65.4270092
[13,] -50 65.7685930
[14,] -40 65.4502820
[15,] -30 64.4320903
[16,] -20 62.5801021
[17,] -10 59.6281858
[18,] 0 55.0979761
[19,] 10 48.1578258
[20,] 20 37.4620764
[21,] 30 21.4292761
[22,] 40 0.3878386
[23,] 50 -20.7643542
[24,] 60 -37.0000000
[25,] 70 -47.8571425
[26,] 80 -54.9024899
[27,] 90 -59.5002369
[28,] 100 -62.4976247
[29,] 110 -64.3825856
[30,] 120 -65.4270092
[31,] 130 -65.7685930
[32,] 140 -65.4502820
[33,] 150 -64.4320903
[34,] 160 -62.5801021
[35,] 170 -59.6281858
[36,] 180 -55.0979761
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.