Valhalla Legends Archive

Member Forums => Yoni's Math Forum => Topic started by: ObsidianWolf on January 26, 2004, 10:40 PM

Title: Lat Longs to Miles
Post by: ObsidianWolf on January 26, 2004, 10:40 PM
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
Title: Re:Lat Longs to Miles
Post by: Yoni on January 27, 2004, 05:06 AM
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.