Distance Calculator
Enter the latitude and longitude of two points to calculate the distance between them.
Point 1
Point 2
Steps for Calculation
- Input Coordinates:
- Enter the latitude and longitude of Point 1 (e.g.,
40.7128
for latitude and-74.0060
for longitude). - Enter the latitude and longitude of Point 2 (e.g.,
34.0522
for latitude and-118.2437
for longitude).
- Enter the latitude and longitude of Point 1 (e.g.,
- Calculate Distance:
- Click the Calculate Distance button to compute the distance between the two points.
- View Result:
- The distance between the two points will be displayed below the button in kilometers.
Detailed Description
- Haversine Formula:
- The Haversine formula is used to calculate the great-circle distance between two points on the Earth’s surface given their latitude and longitude.
- Formula:a=sin2(Δlat2)+cos(lat1)⋅cos(lat2)⋅sin2(Δlon2)a=sin2(2Δlat)+cos(lat1)⋅cos(lat2)⋅sin2(2Δlon)c=2⋅atan2(a,1−a)c=2⋅atan2(a,1−a)Distance=R⋅cDistance=R⋅cWhere:
- RR = Earth’s radius (6371 km),
- ΔlatΔlat = Difference in latitude,
- ΔlonΔlon = Difference in longitude.
- Example Calculation:
- For Point 1: Latitude =
40.7128
, Longitude =-74.0060
(New York City). - For Point 2: Latitude =
34.0522
, Longitude =-118.2437
(Los Angeles). - The calculated distance is approximately
3935.75 km
.
- For Point 1: Latitude =