X-axis coordinates of outer control points (only) for a Quadratic Bézier curve through 3 points

271 Views Asked by At

I am interested in the distance between the 2 outer (left & right: P0 & P2) control-points of a quadratic Bézier curve that goes through 3 data points. The curve's non-equidistant control points are different from the 3 data points (sampled concurrent x&y values from the curve): image.

Is there a shortcut to calculate the x-axis coordinates of these outer control points (P0 & P2) for my curve? I could then simply fit a parabola to my 3 points (ax^2+bx+c) and "cut" it off vertically at these 2 points on the X-axis, so I have a curve with the same shape as my old Bézier curve, but this time in a simple non-parametric/explicit y=f(x) form!

Or is there another way to calculate this distance?

Hardly an original idea I guess, but any help is mucho appreciado!!

1

There are 1 best solutions below

2
On

I can't view your picture, so I'm not 100% sure what you're trying to do. Specifically, I don't know what "data points" you're talking about. Can you upload your picture to this site, please. Just click on the "picture" icon above the editing panel.

But it sounds like you want to take an arbitrary quadratic Bezier curve and express it in the form $y = ax^2 + bx + c$. In general, this is not possible -- take for example the curve with control points $P_0 = (0,0)$, $P_1 = (2, 1)$, $P_2 = (0,2)$. You can construct an equation of the form $y = ax^2 + bx + c$ that is an approximation of the original Bezier curve, but, as my example shows, it will sometimes be a very poor approximation.

Any quadratic Bezier curve is a parabola, but in general, this parabola will be rotated so that its axis of symmetry is at some angle (not vertical). So, it is possible to get an equation of the form $ax^2 + bxy + cy^2 + dx + ey + f = 0$, but that's the best you can do.

Back to your "data points". Three points that are to be interpolated do not uniquely define a quadratic Bezier curve, so, if you want three data points to be the inputs to the calculation, you'll have to provide a bit more info, too. See this topic for more details.