Distance Calculator

2D Distance Calculator

Calculate the straight-line distance between two points on a 2D plane

Formula:

Distance = √[(x₂ - x₁)² + (y₂ - y₁)²]

3D Distance Calculator

Calculate the straight-line distance between two points in 3D space

Formula:

Distance = √[(x₂ - x₁)² + (y₂ - y₁)² + (z₂ - z₁)²]

Geographic Distance Calculator

Calculate the great circle distance between two points on Earth using the Haversine formula

Haversine Formula:

d = 2r × arcsin(√[sin²(Δlat/2) + cos(lat₁) × cos(lat₂) × sin²(Δlon/2)])

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:

1️⃣ 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.

2️⃣ Lambert’s Formula (Ellipsoidal Earth)

A more accurate method that considers Earth’s flattening and curvature.

Accuracy: ~10 meters over long distances.

⚠️ Note: These formulas estimate the surface distance, not terrain-based distance. For real-world paths, use GPS or GIS tools
 
External Resources:
Distance Calculator on Calculator.net

Advertisement

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top