CHAPTER 02
The shape of the Earth
Sphere, ellipsoid, geoid — three models, three answers, and which one you actually need for app development.
sphere vs WGS84 ellipsoid (flattening ×1000 for visibility)
Equatorial radius (a)
6,378,137 m
Polar radius (b)
6,356,752 m
Flattening (a−b)/a
≈ 1 / 298.257
The Earth is not a perfect sphere. It bulges at the equator, flattens at the poles, and its surface ripples with irregular mass distributions. For most mapping purposes you can ignore all of that. But knowing what you're ignoring — and when it matters — is the difference between a solid codebase and one that breaks on edge inputs.
Three models, three answers
The Earth has three commonly used shapes, in increasing accuracy:
| Model | Description | Error vs. reality | When to use |
|---|---|---|---|
| Sphere | Perfect ball, radius ≈ 6,371 km | < 0.5% | Consumer apps, distance/bearing math |
| Ellipsoid | Flattened at poles (WGS84) | < 0.001% | GPS, surveying, aviation |
| Geoid | Lumpy gravitational equipotential | ~0 | Elevation referencing, geodesy |
Each model gives a different answer to "where is this point?" — differing by hundreds of metres depending on location and model chosen.
The sphere
A sphere is the simplest model: a ball with a single radius . It's wrong, but usefully wrong — for most consumer applications, the error is under 0.5%, far smaller than GPS receiver noise.
The most commonly used spherical radius is the mean radius of the WGS84 ellipsoid:
Rule of thumb: Use the sphere. Unless you're writing geodetic software, aviation systems, or need sub-metre accuracy, the sphere is the right choice. It's simpler, faster, and the errors are invisible in practice.
The ellipsoid (WGS84)
The Earth bulges at the equator because it rotates — centrifugal force pushes mass outward along the equatorial plane. The WGS84 ellipsoid (World Geodetic System 1984) captures this shape with two numbers:
The difference . The Earth is slightly fatter around the middle than it is tall.
The flattening quantifies this:
Why WGS84 specifically? It was defined by the US Department of Defense in 1984 and adopted as the reference system for GPS. When your phone reports lat: 51.5074, lon: -0.1278, those numbers are WGS84 coordinates. It is the coordinate system of the modern world.
Before WGS84, different countries used different local datums (NAD27 in North America, ED50 in Europe, etc.). A coordinate in NAD27 can be hundreds of metres off from the same physical point in WGS84. If you're reading data from old surveys or paper maps, always check the datum.
The geoid
The geoid is the shape that Earth's oceans would take if they were perfectly still and extended under the continents — a gravitational equipotential surface. It's neither a sphere nor a smooth ellipsoid; it bulges and dips based on variations in underground mass density.
The geoid matters for elevation. When a GPS device reports altitude, it reports ellipsoidal height (distance above the WGS84 ellipsoid). But when a topographic map says a mountain is 8,849 m tall, it's using orthometric height (height above the geoid — essentially above sea level). The difference, called geoid undulation, varies from about −107 m (Indian Ocean) to +85 m (near New Guinea).
For app development you almost never need to deal with the geoid directly. If you need elevations, use a pre-computed dataset like SRTM or Mapbox Terrain tiles — they've already baked the geoid correction in.
The "good enough" sphere
For ~99% of app development, a sphere with radius m gives errors under 0.5%. Use it.
When it matters:
- High-accuracy land surveying → use an ellipsoidal formula (Vincenty, Chapter 8)
- Aviation and aerospace → WGS84 ellipsoid required
- Elevation data → geoid corrections required
When it doesn't:
- Showing a map with pins
- Calculating "nearby" distances for a search radius
- Drawing routes and overlays
- Tile math (the projection already handles curvature — Chapter 5)
Worked example
Q: What is the circumference of the Earth at the equator using the spherical model?
The "real" equatorial circumference (using WGS84's equatorial radius ) is:
The spherical estimate is ~45 km short — 0.1% error. About the distance from central London to Heathrow. For mapping work: invisible.
Key numbers to remember
| Quantity | Value |
|---|---|
| Mean spherical radius | 6,371 km |
| Equatorial radius (WGS84) | 6,378.137 km |
| Polar radius (WGS84) | 6,356.752 km |
| Equatorial circumference | ~40,075 km |
| 1° of latitude | ~111 km (constant) |
| 1° of longitude at equator | ~111 km |
| 1° of longitude at 60°N | ~55.5 km |
Note the last row: 1° of latitude is always ~111 km, but 1° of longitude shrinks as you move toward the poles. At 60°N it's half that. This is why Mercator maps make Greenland look the size of Africa — Chapter 4 works through exactly why.
References
3 sources- [1]
National Imagery and Mapping Agency (2000).
“Department of Defense World Geodetic System 1984: Its Definition and Relationships With Local Geodetic Systems.”
NIMA Technical Report TR8350.2, 3rd ed.
The authoritative definition of WGS84 — the datum underlying GPS and every major mapping system.
- [2]
Bowring, B.R. (1985).
“The Geodesic Line and the Normal Section.”
Survey Review, 28(218), 161–163
Iterative algorithm for converting ECEF coordinates to geodetic latitude and longitude.
- [3]
Gauss, C.F. (1827).
“Disquisitiones Generales Circa Superficies Curvas.”
Commentationes Societatis Regiae Scientiarum Gottingensis Recentiores, 6
The Theorema Egregium — the proof that a sphere cannot be projected onto a plane without distortion.
Related chapters
- Coordinate systems: latitude and longitude — addressing points on the ellipsoid
- Map projections — flattening the globe — how the sphere becomes a flat map
- ECEF and 3D coordinate systems — leaving 2D for 3D Earth-centred work