get_closest_point_on_segment(A,B,P) now handles the A==B case