How far is it from point A to point B?
The calculation is made using the Haversine formula which takes into account that the Earth is spherical. Detailed background.
There are libraries for calculating Haversine distance in
most languages:
Go, jQuery, Node, Perl, PHP, Python, Ruby
Go, jQuery, Node, Perl, PHP, Python, Ruby
For small distances - less than city size - Euclidean distance, which is a faster algorithm, is usually fine.