Distance Calculator
2D Distance Calculator
Calculate the straight-line distance between two points on a 2D plane
Formula:
3D Distance Calculator
Calculate the straight-line distance between two points in 3D space
Formula:
Geographic Distance Calculator
Calculate the great circle distance between two points on Earth using the Haversine formula
Haversine Formula:
Where r is Earth's radius (6,371 km or 3,959 miles)
Distance Calculation Methods
Distance in a 2D Coordinate Plane
Use this formula to find the distance between two points in a 2D plane:
d = √(x₂ – x₁)² + (y₂ – y₁)²
Example: Points A = (1, 5), B = (3, 2)
d = √(3 – 1)² + (2 – 5)² = √4 + 9 = √13
Distance in a 3D Coordinate Space
Extend the formula for 3D space by including the z-axis:
d = √(x₂ – x₁)² + (y₂ – y₁)² + (z₂ – z₁)²
Example: Points A = (1, 3, 7), B = (2, 4, 8)
d = √(1 + 1 + 1) = √3
Distance on Earth’s Surface (Lat/Lng)
There are two main formulas to calculate distance between geographic coordinates:
Haversine Formula (Spherical Earth)
Calculates the great-circle distance between two points:
d = 2r × arcsin(√[sin²(Δφ / 2) + cos(φ₁) × cos(φ₂) × sin²(Δλ / 2)])
Note: r ≈ 6,371 km (Earth’s average radius). Up to 0.5% error due to Earth’s shape.
Lambert’s Formula (Ellipsoidal Earth)
A more accurate method that considers Earth’s flattening and curvature.
Accuracy: ~10 meters over long distances.
External Resources:
Distance Calculator on Calculator.net