Is there a simple way to compute great circle distances?
Assuming Earth is a perfect sphere of radius 6371.2 km, convert longitude and latitude to radians (multiply by pi/180), then compute as follows: theta = lon2 – lon1 dist = acos(sin(lat1) × sin(lat2) + cos(lat1) × cos(lat2) × cos(theta)) if (dist < 0) dist = dist + pi dist = dist × 6371.2 The resulting distance is in kilometers.