Haversine formula to calculate the great-circle distance between two points in kilometers and miles.