Calculates the distance from a point to a cubic Bezier curve segment
The point to check distance from
Start point of Bezier curve
End point of Bezier curve
First control point
Second control point
Number of samples to use for approximation
Approximate distance from point to Bezier curve
Calculates the distance from a point to a cubic Bezier curve segment