Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distance using WGS84-ellipsoid

Tags:

gps

wgs84

Consider points P1 (60°N, 20°E, 0) and P2 (60°N, 22°E, 0) on the surface of the Earth

What is the shortest distance between the points P1 and P2, when the shape of the Earth is modeled using WGS-84 ellipsoid?

like image 604
Daniele Peruzzini Avatar asked Oct 09 '12 12:10

Daniele Peruzzini


1 Answers

Unfortunately, Vincenty's algorithm fails to converge for some inputs. GeographicLib provides an alternative which always converges (and is also more accurate). Implementations in C++, C, Fortran, Javascript, Python, Java, and Matlab are provided. E.g., using the Matlab package:

format long;
geoddistance(60,20,60,22)
->
111595.753650629
like image 103
cffk Avatar answered Oct 02 '22 16:10

cffk