TITLE: Convert segment of parabola to quadratic bezier curve
QUESTION [5 upvotes]: 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).

REPLY [3 votes]: Let $f(x)=ax^2+bx+c$ be the parabola and let $[x_1, x_2]$ be the interval of the segment that you want to convert to cubic Bezier curve. The first step is to convert that segment into a quadratic Bezier curve as follows:
1) The start point is $P_1=(x_1,f(x_1))$ and the end point $P_2=(x_2,f(x_2))$.
2) The control point $C$ should be the intersection point of the tangent lines at $P_1$ and $P_2$. These two tangent lines can be found as 
$y=(2ax_1+b)(x-x_1)+y_1$, and 
$y=(2ax_2+b)(x-x_2)+y_2$
Solving for the intersection point of above two line equations result in $C=(C_x,C_y)$ as   
$C_x=\frac{x_1+x_2}{2}$  
$C_y=\frac{x_2-x_1}{2}(2ax_1+b)+f(x_1)$
Once you have the quadratic Bezier curve, the cubic Bezier curve control points can be found as $C_1=\frac13P_1+\frac23C$ and $C_2=\frac23C+\frac13P_2$