How to calculate the nearest point of a line and curve? .. or curve and curve?
问题 Given the points of a line and a quadratic bezier curve, how do you calculate their nearest point? 回答1: I just wanna give you a few hints, in for the case Q.B.Curve // segment : to get a fast enough computation, i think you should first think about using a kind of 'bounding box' for your algorithm. Say P0 is first point of the Q. B. Curve, P2 the second point, P1 the control point, and P3P4 the segment then : Compute distance from P0, P1, P2 to P3P4 if P0 OR P2 is nearest point --> this is