[Loadstone] Crossing the international date line

Hasan Karahasan karahasan at onlinehome.de
Fri Aug 24 16:28:24 BST 2007


Hi Shawn,
it really looks great! ;-)

First you check for zero values to discard unnecessary
calculations and return immediately.

if (((adestlat - asrclat) == 0.0) && ((adestlong - asrclong) == 0.0))
  return 0.0;

Then you do the same degrees to rad conversion like me. But your's is more
effective due to the previously calculated fix value for radiant.

glat1 = radiant * asrclat;
glat2 = radiant * adestlat;
glon1 = radiant * asrclong;
glon2 = radiant * adestlong;

Could you explain the rest of your algorithm a little bit in a fiew words 
and why it is better than the standard distance formular that I used? Mine 
takes also into consideration that the earth is not an exact globe. It also 
calculates the shortest path - the ortodrome rather than the loxodrome 
instead.

Hasan 



More information about the Loadstone mailing list