Курсовая работа: Базисные сплайны
A[0]=Y[0];
for(i=1;i<n;i++)
{
A[i]=Y[i];
D[i]=(C[i]-C[i-1])/3.*(X[i]-X[i-1]);
B[i]=(Y[i]-Y[i-1])/(X[i]-X[i-1])+2.*(X[i]-X[i-1])*C[i]/3.+(X[i]-X[i-1])*C[i-1]/3.;
}
DXp=Xp-X[k];
//получение значения интерполирующей функции
Yp = A[k] + B[k]*DXp + C[k]*DXp*DXp + D[k]*DXp*DXp*DXp;
delete []A;
delete []B;
delete []C;
delete []D;
delete []Q;
delete []L;
return Yp;
}
void main ( void )
{
double *X, *Y, Xp;
int n, i;
system("CLS");
cout << "Enter n: ";
cin >> n;
X = new double [n];
Y = new double [n];
for ( i = 0; i < n; i ++ )
{