Calculates distance between two points on a sphere