Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculate Distance in Km and Miles

I have two points whose latitude and longitude i know.

How can i calculate the distance(in Km and Miles) between them. What is the formulae?

like image 410
Sidharth Avatar asked Jan 19 '23 13:01

Sidharth


2 Answers

You can use the haversine formula to calculate such distances.

like image 187
Matthias Avatar answered Feb 16 '23 08:02

Matthias


Use the haversine Formula for this...

Here is the link having java script code to calculate distance

http://www.movable-type.co.uk/scripts/latlong.html

like image 20
Syeda Avatar answered Feb 16 '23 10:02

Syeda