Alex Rivera | Logout

How do I calculate the distance between two points of latitude and longitude?

Asked 2010-04-16T10:29:50.720
16

i have latitude and longitude of particular place and i want to calculate the distance so how can i calculate it?

Edit
Report

1 Answer

1

I've cranked through the math, and can now greatly simplify the solution.

Imagine if we spin the earth so that our first vector is at 0 degrees latitude and 0 degrees longitude. The second vector would be at (alpha2 - alpha1) degrees latitude and (beta2 - beta1) degrees latitude.

Since ...

sin(0) = 0 and cos(0) = 1

our dot product simplies to ...

cos(delta_alpha) * cos(delta_beta) = cos(theta)

The rest of the math remains unchanged.

theta = acos (cos(delta_alpha) * cos(delta_beta))
distance = radius * theta

Hope this helps.

answered 2010-04-16T18:09:28.633

Your Answer