Calculate the distance between two points.