get_distance function

Distance to a smooth curve