Great Circle Functions and Calculations

A great circle from Africa to Antarctic 6422 km
For more information about great circles and why they are
used visit for example
this link.
The great circle distance is the shortest distance between any two points on a sphere.
Navigational Functions
There are four special navigational functions available,
which will calculate great circle values on the sphere (Earth):
dist(lat1,lon1,lat2,lon2)
-> distance from P1 to P2 in meters
example:
d1=dist(61.534,21.432, 62.325,21.467)
[=87914.9667447436]
cog(lat1,lon1,lat2,lon2)
-> COG at P1 in degr.
example:
heading=cog (61.534,21.432, 62.325,21.467)
[=1.1773584522]
point(lat1,lon1,cog,dist)
-> point at course and distance
example:
point(61.534,21.432, 90, 1000)
[=(61.5339986965, 21.4508807761)]
midp(lat1,lon1,lat2,lon2)
-> mid point between 2 points
example:
midp(61.534,21.432, 62.325,21.467)
[=(61.9295011095, 21.4492734801)]
- Latitudes are given positive north in degrees
- Longitudes are given positive east in degrees
- COG is Course Over Ground 90-east and 180-south
- Distances are in meters on a sphere with earth radius
Conversion Functions
Two functions can be used to convert between degrees only
and degrees, minutes and seconds formats:
degr(d,m,s)
-> result in degrees only
example:
degr(61,59,59)
[=61.9997222222]
dtoms(degr)
-> shows minutes and seconds (m.m, s.s)
example:
dtoms(61.534)
[=(32.0400000006, 2.4000000360)]