answersLogoWhite

0

If the earth is treated as a sphere, the formula is 6371 km * cos-1(cos(Long1-Long2)cos(Lat1)cos(Lat2)+sin(Lat1)sin(Lat2))Here, Long1 and Lat1 are the coordinates of one point, and Long2 and Lat2 are the coordinates of the other. 6371 km is the radius of the Earth (which you could convert to miles to get an answer in miles for your distance). You'll notice we're taking sines and cosines of latitude and longitude: this is because they're really angles! Longitude measures a point's angle in the equator's plane, and latitude measures its angle away from that horizontal. If you've seen spherical coordinates before, this should be familiar. The formula assumes you're dealing with angles in radians. If you want to use degrees, you'll have to multiply the final answer by pi/180. Here's how to get this formula. First, note that it's very easy to get a distance between two points on a sphere if you know the angle of the arc between them: just multiply it by the radius. So we're going to concentrate on finding this angle. We're going to use the fact that the dot product of two vectors is equal to the product of their lengths, times the cosine of the angle between them. At the same time, we can compute a dot product coordinate by coordinate. Let the vectors a and b be the vectors from the center of the earth to each of our points. Using spherical coordinates, we can write them down explicitly: a = (r cos(Long1)cos(Lat1), r sin(Long1)cos(Lat1), r sin(Lat1)) b = (r cos(Long2)cos(Lat2), r sin(Long2)cos(Lat2), r sin(Lat2)) We take their dot product and get r^2 (cos(Long1)cos(Long2)cos(Lat1)cos(Lat2) + sin(Long1)sin(Long2)cos(Lat1)cos(Lat2) + sin(Lat1)sin(Lat2)) By the other formula for dot product, this is r^2 times the cosine of the angle between them. So cancel the r^2, and take the inverse cosine. You'll get the formula above (if you simplify some terms). In fact the earth is not a sphere. It is generally an "oblate spheroid", meaning that it is somewhat flattened at the poles. But the true shape of the Earth is actually irregular, and it is therefore impossible to determine by formula the exact distance between two points. Various approximations of the shape of the earth, called reference ellipsoids, are used in other, more complex formulas that come closer to the actual distance. The spherical solution given here is pretty close for many purposes though.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
JudyJudy
Simplicity is my specialty.
Chat with Judy
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran

Add your answer:

Earn +20 pts
Q: What is the formula for distance using latitude and longitude?
Write your answer...
Submit
Still have questions?
magnify glass
imp