← Tutorials

Tutorial Series · Part 4 of 27

Distance on Earth: Flat Map, Sphere or Ellipsoid?

Compare local flat distance, spherical great-circle distance and ellipsoid-aware thinking.

Series Context

Navigation from First Principles

This article is part of an ordered course. Use the previous and next links to stay in sequence.

Two latitude/longitude points are not ordinary x,yx,y coordinates on a flat sheet. The Earth has shape, gravity and reference-frame definitions behind the scenes. WGS 84 is the practical global reference system used for mapping, geopositioning and navigation.1 This post shows why a simple distance formula works in a car park but not across a country.

The problem

Suppose your phone records two points:

(ϕ1,λ1),(ϕ2,λ2)(\phi_1, \lambda_1), \quad (\phi_2, \lambda_2)

How far apart are they? If they are only a few metres apart, a local flat approximation is usually fine. If they are hundreds of kilometres apart, a flat approximation can become misleading.

Three distance models

1. Flat local approximation

For small movements near a latitude ϕ\phi:

ΔnRΔϕ\Delta n \approx R\Delta\phi ΔeRcosϕΔλ\Delta e \approx R\cos\phi\Delta\lambda dflatΔn2+Δe2d_{flat} \approx \sqrt{\Delta n^2 + \Delta e^2}

This is fast and intuitive, but it assumes a local tangent plane.

2. Spherical great-circle distance

The haversine formula is a common spherical approximation:

a=sin2(Δϕ2)+cosϕ1cosϕ2sin2(Δλ2)a = \sin^2\left(\frac{\Delta\phi}{2}\right) + \cos\phi_1\cos\phi_2\sin^2\left(\frac{\Delta\lambda}{2}\right) c=2atan2(a,1a)c = 2\operatorname{atan2}(\sqrt{a},\sqrt{1-a}) dsphere=Rcd_{sphere}=Rc

This treats Earth as a sphere with radius RR.

3. Ellipsoid-aware methods

A more precise geodetic solution treats Earth as an ellipsoid rather than a sphere. The full inverse geodesic problem is beyond this introduction, but the key point is simple: precise distance depends on the reference ellipsoid, not just a single radius.12

Interactive demo: Earth distance comparator

The comparator below places the local flat and spherical models side by side and visually separates a straight projected map segment from a sampled great-circle arc.

Interactive Demo

Earth Distance Comparator

Compare when a quick flat approximation is close enough and when a curved Earth model starts to matter.

Drag A or B. The dashed line is the flat map segment, and the blue curve samples a spherical great-circle path between the same points.

Controls

Point A
Point B

Use the local preset to see how close the two models are over metres. Use Liverpool to London to see the gap grow over longer ranges.

Results

Δ latitude -
Δ longitude -
Flat local distance -
Spherical distance -
Difference -
Warning level -
Primary readout -
Ellipsoid row -

What to watch

  • Point A acts as the local tangent-plane reference for the flat approximation.
  • Small moves keep the flat and spherical results nearly identical.
  • Longer moves make the difference easier to see in both the readout and the curved-arc overlay.
  • The demo converts all angles to radians internally before applying the formulas.

Try this

Place one point in Liverpool and one in London. Compare the flat local approximation against a spherical great-circle estimate. Then move the second point only 10 metres away and observe that the simple local approximation becomes much more reasonable.

Where this breaks

This demo does not cover map projection distortion in detail. A projected web map can make visual distances look different from geodesic distances.

Footnotes

  1. National Geospatial-Intelligence Agency, “World Geodetic System 1984 (WGS 84)”. https://earth-info.nga.mil/GandG/wgs84/ - Official reference for WGS 84 as a 3D coordinate reference frame for latitude, longitude and height in navigation, positioning and targeting. Accessed 2026-06-11. 2

  2. NOAA National Geodetic Survey, “Geodesy”. https://www.ngs.noaa.gov/INFO/geodesy.shtml - Defines geodesy as measurement and understanding of Earth shape, gravity field and orientation in space. Accessed 2026-06-11.