UBC distance between two points.