pub fn point_segment_distance(p: P2, a: P2, b: P2) -> f64
Distance from p to the closed segment a-b (the point distance when the segment is a point).
p
a-b