Calculating the shortest distance between two points on a sphere - the spherical cosine rule.