The Haversine formula calculates the shortest distance between two points on Earth's surface:
a = sin^2(delta-phi/2) + cos(phi1) * cos(phi2) * sin^2(delta-lambda/2)
c = 2 * atan2(sqrt(a), sqrt(1-a))
d = R * c
Where: phi is latitude, lambda is longitude, R is Earth's radius (6,371 km)