haversinedistance
Haversine distance is the great-circle distance between two points on a sphere computed from their latitudes and longitudes. In the haversine formula, treat φ1 and φ2 as latitudes and λ1 and λ2 as longitudes in radians. Let Δφ = φ2 − φ1 and Δλ = λ2 − λ1. Then a = sin²(Δφ/2) + cosφ1 cosφ2 sin²(Δλ/2). The central angle between the points is c = 2 arcsin(√a). The distance on a sphere of radius R is d = R·c. For Earth, R is typically taken as mean radius about 6,371 kilometers (3,959 miles).
Uses and practical aspects: The haversine distance is widely used in navigation, mapping, and geographic information
Limitations and alternatives: The calculation assumes a perfect sphere, whereas Earth is an oblate spheroid, so