##
How You Get There From Here or Great Circle Navigation *December 7, 2011*

*Posted by phoenixcomm in Flight Simulation, Great Circle Navigation, Physics, Software.*

trackback

trackback

Have you ever wondered how you navigate on a round world? Remember Columbus thought was flat. So if the world was flat you could stick two pins in the map, and follow the angle from North. But as we know today the world is round so, sadly that will not work… So we came up with Great Circle Navigation. Apparently, the first reference to great circle navigation was by John Davis in his book, *The Seaman’s Secrets* (1594). The theory was understood, but in practice it could hardly be applied without accurate computation of longitude. With Harrison’s chronometer, this was then possible. The theoretical proof was given by Bernhard Riemann around 1900. The following is Great Circle that outputs distance.. Hey this is good for the DME calculation…

BTW I convert all angles into 32 bit BAMs, which means that we get about a size of a postage stamp on the surface of the earth.

*Distance = acos(cos(Lat _{1}-Lat_{2}) – (1-cos(Lon_{1}-Lon_{2})) * cos(Lat_{1})*cos(Lat_{2})) *

So here is a program that I use to calculate my DME.

/*

L_{1}= Original Lat; L_{2}= Destination Lat;

Lon_{1}= Original Lon; Lon_{2}= Destination Lon

D = Distance in Nautical Miles

*/

Lon_{1}= -Lon_{1;}

Lon_{2}= -Lon_{2;}

if((L_{1}== L_{2})&&(Lon_{1}== Lon_{2})){

return(0);}

temp = (cos(L_{1})*cos(L_{2})*cos(Lon_{1}– Lon_{2}))+(sin(L_{1})*sin(L_{2}));

if (temp == 1){

temp = 0;}

elsif (temp == -1){

temp = pi/2;}

else {

temp = 0 – atan(temp / sqrt(1 – (temp * temp))) + pi / 2;}

temp = ((sin(L_{2}) – sin(L_{1}) * cos(temp)) / (sin(temp) * cos(L_{1})))

if (1 – temp < .00000001){

return(360);}

elsif (1 + temp < .000000001){

return(180);}

else {

temp = rad2d(-atan(temp / sqrt(1 – (temp * temp))) + pi / 2;)

if (sin(Lon_{2}– Lon_{1}) > 0){

temp = 360 – temp;}

return(temp);}

Note: This was the test program demo.html/demo.pl was written in Perl. It did not use BAMs. The program has been re-written in C.

if you wish to see the complete program running click here

if you wish to use the source please click here … Please be sure to email me first here.

Sweet internet web site , super pattern , really clean and utilize friendly.