By the way, the constant value 20,890,584 is the earthâs average radius in miles (3,956.55) multiplied by 5,280 feet per mile. The wikipedia article on haversine states that the average radius of the earth is 6,367.45 Km and Iâm assuming itâs correct.