• Welcome to Valhalla Legends Archive.
 

Lat Longs to Miles

Started by ObsidianWolf, January 26, 2004, 10:40 PM

Previous topic - Next topic

ObsidianWolf

Im wondering if anyone knows the conversion for Lat Longs to Miles.  Im working with it some in a program, but im still a bit hazy.  Any help would be greatly appreciated.

Here what Im currently using, but It isnt giving me the data that I want...and Im in no way a Math favoring man.


DistanceinMiles = (((LatDiff ^ 2) + ((LongDiff * Cos(LongCenter * (22 / 7) / 180)) ^ 2)) ^ 0.5) * 60 * 1.852 / 1.6093



update, spelled distancewrong

Yoni

The formula you've given is very unclear. You're using obscure constants such as 1.852 and 1.6093, without explaining what they mean.

You should give constants names, i.e.:

Const Blah = 1.852

Also, 22/7 is a bad approximation for Pi. I suggest just explicitly writing 3.14159 or something to that effect.