calculate distances between stations