Ask Your Question
4

How to determine the distance between two sets of geographic coordinates specified as latitude and longitude?

asked 2023-05-29 06:17:33 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-29 06:40:01 +0000

woof gravatar image

One common way to determine the distance between two sets of geographic coordinates specified as latitude and longitude is to use the Haversine formula.

The formula is:

distance = 2 * r * arcsin( sqrt( sin^2((lat2-lat1)/2) + cos(lat1) * cos(lat2) * sin^2((lon2-lon1)/2) ) )

Where - distance is the distance between the two locations in kilometers - r is the radius of the Earth, typically 6,371 km - lat1 and lat2 are the latitude coordinates of the two locations - lon1 and lon2 are the longitude coordinates of the two locations

Note that the latitude and longitude should be in radians, so convert them from degrees to radians before plugging them into the formula.

There are also many online calculators that can automatically calculate the distance between two sets of coordinates using the Haversine formula.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-29 06:17:33 +0000

Seen: 10 times

Last updated: May 29 '23