Iam using google map code for my project, so i need to calculate the distance between two location by latitude and longitude values. i need correct "mathematical formula" to do that code. plz help me, iam waiting for ur's answer.What is the mathematical formula to measure distance between two latitude and longitude points.?
This is a problem in spherical trigonometry. I will spare you the gory details and give you the formula.
Given: City A is at Latitude LatA, + north, - south
Longitude LonA, + east, - west
City B is at Latitude LatB, + north, - south
Longitude LonB, + east, - west
cos C = (sin LatA * sin LatB) + (cos LatA * cos LatB * cos (LonA - LonB))
Where C is the angle at the center of the Earth between the two cities.
Convert C to radians by dividing C by 180 / pi.
Convert radians to miles by multiplying by the radius of the Earth, 3959 miles (average).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment