To describe a specific position on the surface of the Earth, we must rely on the geographic coordinate system. The geographic coordinate system is a method used to give every possible location on Earth to be specified by a set of numbers or letters. A common choice of coordinates is latitude and longitude. With this information we can calculate a distance between two points along a surface.

For simplicity’s sake, we will suppose that the Earth is a perfect sphere with a radius of 6,371 kilometers (it gives a mistake no more than 0.3%). You are given two point coordinates and you must find the shortest distance between these points on the surface of the Earth, measured along the surface of the Earth.

Coordinates...