calcGCdist {PBSmapping} | R Documentation |
Calculate Great-Circle Distance
Description
Calculate the great-circle distance between geographic (LL) coordinates. Also calculate the initial bearing of the great-circle arc (at its starting point).
Usage
calcGCdist(lon1, lat1, lon2, lat2, R=6371.2)
Arguments
lon1 |
|
lat1 |
|
lon2 |
|
lat2 |
|
R |
|
Details
The great-circle distance is calculated between two points along a
spherical surface using the shortest distance and disregarding
topography.
Method 1: Haversine Formula
where
= latitude (in radians),
= longitude (in radians),
= radius (km) of the Earth,
= square of half the chord length between the points,
= angular distance in radians,
= great-circle distance (km) between two points.
Method 2: Spherical Law of Cosines
The initial bearing (aka forward azimuth) for the start point can be calculated using:
Value
A list obect containing:
a
– Haversine = square of half the chord length between the points,
c
– Haversine = angular distance in radians,
d
– Haversine = great-circle distance (km) between two points,
d2
– Law of Cosines = great-circle distance (km) between two points,
theta
– Initial bearing (degrees) for the start point.
Note
If one uses the north geomagnetic pole as an end point,
crudely approximates the magnetic declination.
Author(s)
Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Offsite, Vancouver BC
Last modified Rd: 2023-11-03
References
Movable Type Scripts – Calculate distance, bearing and more between Latitude/Longitude points
See Also
In package PBSmapping:
addCompass
,
calcArea
,
calcCentroid
,
calcLength
Examples
local(envir=.PBSmapEnv,expr={
#-- Distance between southern BC waters and north geomagnetic pole
print(calcGCdist(-126.5,48.6,-72.7,80.4))
})