Add a function to calculate the distance beween to points