Finding min/max of quadratic bezier with CoreGraphics
问题 I am using CoreGraphics to draw a quadratic bezier but want to computer the min/max value of the curve. I am not from a mathematical background so this has become a bit troublesome. Does anyone have any articles or ideas about how to solve this? 回答1: For a quadratic Bezier, this is actually quite simple. Define your three control points as P0 = (x0,y0) , P1 = (x1,y1) and P2 = (x2,y2) . To find the extrema in x , solve this equation: t = (x0 - x1) / (x0 - 2*x1 + x2) If 0 <= t <= 1 , then