The calculation is a bit simple:

First, calculate the distance between the two coordinates throght the cosine law:

cos(S) = sin(l1)*sin(l2)+cos(11)*cos(l2)*cos(dl)

where:

l1 and l2 are...