I have a cubic polynomial :

$f(x) = ax^3 + bx^2 + cx + d$,

where $ a, b, c$ and $d$ are known values.

The graph of the function goes through points $(x_0, y_0)$ and $(x_1, y_1)$. Also $x_1 > x_0$ : as shown in this image.

I need to draw this graph between $[x_0, x_1]$ in 2D space using cubic Bezier curves. Point at $(x_0, y_0)$ must be the first control point and point at $(x_1, y_1)$ must be the fourth control point.

How can i find the second and the third control points ($C_0$ and $C_1$ as shown here)? Is it possible?



1 Answer 1


Let $C_0(x_i,y_i)$ ("i" like initial) and $C_1(x_f,y_f)$ ("f" like final).

You have a large degree of freedom for choosing $x_i,y_,x_f,y_f$. But the constraint is to get a spline function that can coincide with the graphical representation of a function $y=f(x)$.

The usual guaranteed solution is to take $x_i=\dfrac23x_0+\dfrac13x_1$ and $x_f=\dfrac13x_0+\dfrac23x_1$, with (almost...) any $y_i$ and $y_f$ (the abscissas are situated at the third and two-third of the abscissas of the "extremal" points).

If you plug these abscissas in the general formulas, you will find a solution.

  • $\begingroup$ I am glad. Thanks for your thanks. $\endgroup$
    – Jean Marie
    Sep 2, 2017 at 20:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .