Returns the distance between two points in 1D.
Two points for which the distance is required.
Distance between x1 and x2.