Click to See Complete Forum and Search --> : Long/Lat to Earth Distance


adil56
August 18th, 2005, 10:58 AM
Hello
i need to write an algo that converts given Long / Lat value to some distance unit of earth for exmaple

Point 1: 56 Lat 120 Long
Point 2 : 120 Lat 120 Long

I want the distance b/w these tow points in miles/KM

please if any one has idea about it let me know. I need it urgent

Thanks

Pinky98
August 18th, 2005, 07:02 PM
how accurately do you need it?

Best option I can think of.... create a planar surface though both points, and the center of the earth. The length of the arc created by the intersection of the earths surface and this plane is the length required. To find it, you need to determine to angle on this planar surface at the earths center made by the two radii which pass through these points. Then using this angle (in radians), multiply it by the radius of the earth squared... and thats your answer.

yiannakop
August 19th, 2005, 07:06 AM
I found this (http://www.codeguru.com/Cpp/Cpp/algorithms/article.php/c5115/) article in codeguru that might help you.
Regards,
Theodore