Valhalla Legends Forums Archive | Yoni's Math Forum | Lat Longs to Miles

AuthorMessageTime
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.

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


update, spelled distancewrong
January 27, 2004, 4:40 AM
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.:
[code]
Const Blah = 1.852
[/code]
Also, 22/7 is a bad approximation for Pi. I suggest just explicitly writing 3.14159 or something to that effect.
January 27, 2004, 11:06 AM

Search