[Loadstone] Crossing the international date line

Shawn Kirkpatrick shawn at odyssey.cm.nu
Fri Aug 24 23:08:20 BST 2007

I can get about as far as you did with this algorythm and then I couldn't 
begin to tell you what it's doing. I'm not a math guy. The code for this was 
copied from another open source program (gpsdrive) so I can only hope and 
assume it's right. It seems to be from all ways of varifying it that I can 
find. Calculating distances correctly is quite complicated since the 
distance between longitudes changes depending on the latitude. There seem to 
be a few different formulas to do this with verying degrees of accuracy. We 
need the most accurate one and I think that's what we now have.

On Fri, 24 Aug 2007, Hasan Karahasan wrote:

> 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
> _______________________________________________
> Loadstone mailing list
> Loadstone at loadstone-gps.com
> http://www.loadstone-gps.com/mailman/listinfo/loadstone

More information about the Loadstone mailing list