Examples of use of the spline classes.
{
TText *text5, *text3, *textn;
char text[20];
TF1 *f=
new TF1(
"f",
"sin(x)*sin(x/10)",
a-0.05*(b-a),b+0.05*(b-a));
gPad->GetRangeAxis(xx1,yy1,xx2,yy2);
dx = xx2-xx1;
dy = yy2-yy1;
line5=
new TLine(xx1+dx*0.3,yy1+dy*1.02,
xx1+dx*0.38,yy1+dy*1.02);
text5 =
new TText(xx1+dx*0.4,
yy1+dy*1.03,"quintic spline");
line3=
new TLine(xx1+dx*0.67,yy1+dy*1.02,
xx1+dx*0.75,yy1+dy*1.02);
text3 =
new TText(xx1+dx*0.77,
yy1+dy*1.03,"third spline");
textn =
new TText(xx1+dx*0.8,yy1+dy*0.91,
" ");
for(
Int_t nnp=2; nnp<=np; ++nnp) {
if(xx) delete[] xx;
if(yy) delete[] yy;
for (
Int_t i=0; i<nnp; ++i) {
}
if(spline5) delete spline5;
spline5 =
new TSpline5(
"Test",xx,f,nnp,
"b1e1b2e2",
if(spline3) delete spline3;
spline3 =
new TSpline3(
"Test",xx,yy,nnp,
"b1e1",
spline3->
Draw(
"lcpsame");
sprintf(text,"%3d knots",nnp);
}
}
- Author
- Federico Carminati
Definition in file splines_test.C.