This Stroke implementation strokes the shape using a thin line, and also
displays the end points and Bezier curve control points of all the line and
curve segments that make up the shape.
see : https://demonstrations.wolfram.com/DistanceOfAPointToASegment To
compute the distance from point p to segment ab (all as complex numbers)
compute first z=(p-a)/(b-a).