Find the distance of the two points on the graph