This sketch draws a cubic function defined by two points (purple dots) and two derivatives (green/yellow lines).
Change input values by dragging the dots with your mouse
We want a cubic function ax3 + bx2+ cx + d. This function has four unknowns. We are also given four values (two points and two derivatives). Thus we can solve a system of linear equations to get the function.
Alternatively we can draw the same function directly with following formula:
f(x) = (2x3−3x2+1) p0 + (x3−2x2+x) m0 + (−2x3+3x2) p1 + (x3−x2) m1
where p0, p1, m0, m1 are the points resp. derivatives. If we plot the terms from 0 to 1 we get the basis displayed below.