Polynomials – Convert Segment of Parabola to Quadratic Bezier Curve

bezier-curvepolynomials

How do I convert a segment of parabola to a cubic Bezier curve?

The parabola segment is given as a polynomial with two x values for the edges.

My target is to convert a quadratic piecewise polynomial to a Bezier path (a set of concatenated Bezier curves).

Best Answer

You can do this in two steps, first convert the parabola segment to a quadratic Bezier curve (with a single control point), then convert it to a cubic Bezier curve (with two control points).

Let $f(x)=Ax^2+Bx+C$ be the parabola and let $x_1$ and $x_2$ be the edges of the segment on which the parabola is defined.

Then $P_1=(x_1,f(x_1))$ and $P_2=(x_2,f(x_2))$ are the Bezier curve start and end points and $C=(\frac{x_1+x_2}{2},f(x_1)+f'(x_1)\cdot \frac{x_2-x_1}{2})$ is the control point for the quadratic Bezier curve.

Now you can convert this quadratic Bezier curve to a cubic Bezier curve by define the two control points as: $C_1=\frac{2}{3}C+\frac{1}{3}P_1$ and $C_2=\frac{2}{3}C+\frac{1}{3}P_2$.

Related Question