Previously you may have had to manually implement something like the haversine formula manually to get this simple measurement. Displaystyle R_ 1 frac 1 3 2abapprox 6371009mathrm km for the WGS84 ellipsoid means that in the limit of. So to get the distance from your reference point lat1lon1 to the point your are testing lat2lon2 use the formula below.
Another similar way to measure distances is by using the Haversine formula which takes the equation a h a v D f c o s f 1 c o s f 2 h a v D l.
The haversine can be expressed in trignometric function as. So to get the distance from your reference point lat1lon1 to the point your are testing lat2lon2 use the formula below. The distance between two points AxA yA A x A y A and BxB yB B x B y B in two-dimensional Cartesian coordinate plane is the length of the segment connecting them AB dA B xB xA2 yB yA2 A B d A B x B - x A 2 y B - y A 2 What is the Distance between Two Points. Haversine dr haversine F 2 F 1 cosF 1cosF 2haversinel 2 -l 1 Where d is the distance between two points with longitude and latitude lF and r is the radius of the earth.