compute all distances beteween coordinates, in case needed