Distance between two sets of geographic coordinates (latitude, longitude) in Ruby, JS, SQL, and Python using the Haversine Formula.

In this article I’ve put together some code samples of the Haversine formula in JS, Ruby, and SQL.

First, let me provide an explanation for the formula known as the Haversine Formula.