logo
Лекция_3(Интерполяция)

Var r, s, l : Vect;

H, D, F, E, P : RealType;

k : Integer;

begin

D:=X[2]-X[1]; E:=(Y[2]-Y[1])/D;

L[1]:=0; L[N1]:=0; R[1]:=0; R[N1]:=0; S[1]:=0; S[N1]:=0;

for k:=2 to N1-1 do

begin

H:=D; D:=X[k+1]-X[k];

F:=E; E:=(Y[k+1]-Y[k])/D; L[k]:=D/(D+H);

R[k]:=1-L[k]; S[k]:=6*(E-F)/(H+D);

end; (* for *)

for k:=2 to N1-1 do

begin

P:=1/(R[k]*L[k-1]+2); L[k]:=-L[k]*P;

S[k]:=(S[k]-R[k]*S[k-1])*P;

end; (* for *)

M[N1]:=0; L[N1-1]:=S[N1-1];

M[N1-1]:=L[N1-1];

for k:=N1-2 downto 1 do

begin

L[k]:=L[k]*L[k+1]+S[k]; M[k]:=L[k];

end; (* for *)

end; (* Spline.CalculateSpline *)

function SplineInterpolate.Interpolate(XX:RealType) : RealType;