Distance on a curved Earth
Work through why distance between latitude/longitude points is not just a flat-screen ruler measurement.
Why this matters
Distance powers โnear me,โ service radii, route checks, field planning, clustering, and proximity alerts. The Earth is curved, while most screens are flat, so the calculation method matters.
Learn it
For two longitude/latitude positions, the Haversine formula estimates great-circle distance on a sphere. It converts angular differences into a central angle, then multiplies by an Earth radius. For higher-accuracy work, ellipsoidal geodesic methods model the Earth more precisely. The important skill is knowing what approximation you are using and whether it is good enough for the decision.
Work through an example
Two points may look close on a web map but the screen distance changes with zoom and projection. A geographic distance calculation uses their coordinates instead of measuring pixels.
a = sinยฒ(ฮฯ/2) + cos ฯโ ยท cos ฯโ ยท sinยฒ(ฮฮป/2)
c = 2 ยท atan2(โa, โ(1โa))
d = R ยท cPractice
- 1Choose two positions in the distance exercise and calculate their Haversine distance.
- 2Move one point north and predict whether the result grows or shrinks before recalculating.
- 3Compare the result with the kind of accuracy your project actually needs.
Try it
Haversine distance
The Haversine formula estimates great-circle distance between two longitude/latitude points by treating Earth as a sphere. It is useful for many distance checks, but it is an approximation rather than a full ellipsoidal geodesic.
What to watch for
Haversine is useful, not magical. It is a spherical approximation. Do not present it as an exact ellipsoidal geodesic.
Where this takes you
Use this reasoning for proximity searches, nearest-resource lookup, distance-based rules, research comparisons, and route sanity checks.