// Standard cubic spline interpolation with clamped conditions f'(a), f'(b) // splinetype clamped(real slopea, real slopeb) import graph; size(10cm); real[] x={0,2,4}, y={0,0,0}; path p[] = {graph(x,y,Hermite(clamped(5,5))), graph(x,y,Hermite(clamped(2,0))), graph(x,y,Hermite(clamped(-1,1)))}; int np = p.length; pen coul[]={red,blue,green}; coul.cyclic=true; // pour ne pas avoir toujours à adapter le nombre // de couleurs au nombre de chemins dans p, quand // on effectue des tests. for(int k=0; k