Geodesic Distance Calculator with Elevation


3D Geodesic Distance Calculator (with Elevation)

A precise tool to calculate distance using latitude and longitude and elevation for accurate real-world measurements.



Choose between Metric and Imperial units for elevation and distance.

Point 1



e.g., 40.7128 (New York)


e.g., -74.0060 (New York)


Elevation above sea level.

Point 2



e.g., 34.0522 (Los Angeles)


e.g., -118.2437 (Los Angeles)


Elevation above sea level.


Total 3D Geodesic Distance

2D Surface Distance

Elevation Difference

Assumed Earth Radius

Distance Visualization

Surface Distance Elevation Diff Total 3D Distance

Visual representation of how surface distance and elevation difference create the total 3D distance.

What Does it Mean to Calculate Distance Using Latitude and Longitude and Elevation?

To calculate distance using latitude, longitude, and elevation means to find the true, three-dimensional path length between two points on Earth. While many tools calculate the great-circle distance (the shortest path on the surface of a perfect sphere), they often ignore the crucial factor of altitude. This calculator incorporates the vertical difference in elevation, providing a more accurate “slant distance” which is vital for applications like aviation, drone flight planning, hiking, and engineering projects in mountainous terrain.

This method combines the 2D surface distance, calculated using the Haversine formula calculator, with the vertical change in elevation. By treating the surface distance and the elevation difference as two sides of a right-angled triangle, we can use the Pythagorean theorem to find the hypotenuse, which represents the precise 3D distance.

The Formula to Calculate 3D Geodesic Distance

The calculation is a two-step process. First, we determine the surface distance (d) using the Haversine formula. Then, we incorporate the elevation difference (Δh) to find the total 3D distance (D).

Step 1: Haversine Formula for Surface Distance (d)

a = sin²(Δφ/2) + cos(φ₁) * cos(φ₂) * sin²(Δλ/2)

c = 2 * atan2(√a, √(1−a))

d = R * c

Step 2: Pythagorean Theorem for 3D Distance (D)

D = √(d² + Δh²)

Variables Explained

Variable Meaning Unit (Auto-Inferred) Typical Range
φ₁, φ₂ Latitude of point 1 and point 2 Degrees -90 to +90
λ₁, λ₂ Longitude of point 1 and point 2 Degrees -180 to +180
R Earth’s mean radius Kilometers or Miles ~6,371 km or ~3,959 mi
Δh Difference in elevation (elev₂ – elev₁) Meters or Feet Any real number
D Total 3D geodesic distance Kilometers or Miles Non-negative real number

Practical Examples

Example 1: Flight Path from Denver to Salt Lake City

Let’s calculate the distance between two high-altitude cities.

  • Point 1 (Denver): Latitude=39.7392, Longitude=-104.9903, Elevation=1609 meters
  • Point 2 (Salt Lake City): Latitude=40.7608, Longitude=-111.8910, Elevation=1288 meters
  • Units: Metric

Using the calculator, the 2D surface distance is approximately 600 km. The elevation difference is -321 meters (0.321 km). The final 3D distance is slightly more than the surface distance, demonstrating the impact of elevation over a long path.

Example 2: Hiking from a Valley to a Peak

Consider a short but steep hike.

  • Point 1 (Trailhead): Latitude=46.8529, Longitude=-121.7604, Elevation=5,400 feet
  • Point 2 (Camp Muir): Latitude=46.8360, Longitude=-121.7370, Elevation=10,188 feet
  • Units: Imperial

Here, the horizontal distance is only about 2.3 miles. However, the elevation gain is 4,788 feet (approx. 0.9 miles). This significant vertical change makes the true hiking distance noticeably longer than the “as the crow flies” surface distance, a crucial detail for any trekker. For more on this, see our article on using a coordinate distance tool.

How to Use This Geodesic Distance Calculator

  1. Select Unit System: Choose ‘Metric’ for kilometers/meters or ‘Imperial’ for miles/feet. The input and result units will update automatically.
  2. Enter Point 1 Coordinates: Input the latitude, longitude, and elevation for your starting point.
  3. Enter Point 2 Coordinates: Input the latitude, longitude, and elevation for your destination point.
  4. Review Results: The calculator instantly provides the total 3D distance, the 2D surface distance, and the vertical elevation difference. The visual chart will also adjust to reflect the proportions of your inputs.
  5. Interpret the Values: The ‘Total 3D Distance’ is the most accurate real-world measurement. The ‘2D Surface Distance’ is the distance if Earth were a smooth ball, useful for understanding the Geodesic distance concept.

Key Factors That Affect Geodesic Distance Calculation

  • Earth’s Shape: The calculator assumes a perfect sphere, which is standard for the Haversine formula. For ultra-high precision over long distances, more complex formulas like Vincenty’s, which account for the Earth’s ellipsoidal shape, are used.
  • Data Accuracy: The precision of your result is directly tied to the precision of your input coordinates and elevation data. A small error in a latitude degree can equate to a large distance error.
  • Unit Selection: Using consistent units is critical. Our calculator handles conversions automatically, but when doing manual calculations, ensure all units (radius, elevation) are harmonized before applying the formula.
  • Topography: This calculator gives the straight-line “slant” distance. It does not account for the actual path taken over varied terrain (e.g., roads winding up a mountain).
  • Elevation’s Impact: The difference between 2D and 3D distance is negligible for small elevation changes but becomes significant for steep gradients or long-distance flights where altitude changes are substantial.
  • Map Projection: When viewing coordinates on a 2D map, the projection can distort distances. A direct Geodesic distance calculation like this one avoids that distortion.

Frequently Asked Questions (FAQ)

1. Why not just use the Pythagorean theorem on lat/lon degrees?

Latitude and longitude are an angular coordinate system, not a grid. The distance represented by one degree of longitude changes drastically as you move from the equator to the poles. Therefore, you must use spherical geometry formulas like Haversine to correctly calculate surface distance.

2. How accurate is the Haversine formula?

It’s highly accurate for most applications. Its main limitation is the assumption that the Earth is a perfect sphere. For most purposes, from aviation to logistics, the error is negligible. Only highly specialized scientific or surveying tasks might require a more complex ellipsoidal model.

3. When does elevation make a significant difference?

It becomes important in two main scenarios: 1) Over short distances with large vertical changes (e.g., hiking, surveying in mountains). 2) Over very long distances where even a slight angle of ascent/descent results in a noticeable difference (e.g., intercontinental flights).

4. What is ‘geodesic’ distance?

A geodesic line is the shortest possible path between two points on a curved surface, like the Earth. It’s the equivalent of a straight line in three-dimensional space, but constrained to the surface of the sphere. Our 2D calculation is a geodesic distance.

5. Can I use negative elevation values?

Yes. Locations below sea level, such as the Dead Sea, should be entered with a negative elevation. The calculator will correctly factor this into the total elevation difference.

6. What’s the difference between this and a driving distance calculator?

This tool calculates the direct, straight-line distance through 3D space (“as the crow flies”). A driving distance calculator measures the distance along a road network, which will almost always be longer due to turns and terrain.

7. How does the unit switcher work?

When you switch units, the calculator converts the Earth’s radius and all input/output values. It uses 6,371 km and 3,959 miles for the Earth’s radius, and converts feet to meters (or vice-versa) using a factor of 3.28084 before any calculations.

8. Why does the chart change shape?

The visual chart is a simple SVG that adjusts its points based on the ratio of surface distance to elevation difference. It provides a quick visual reference for how much elevation contributes to the total distance in your specific calculation.

© 2026 GeoCalculators Inc. All rights reserved.


Leave a Reply

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