coords_to_distances function

Convert coordinate matrix to distance matrix