Graphics Programs Reference
In-Depth Information
Introducing the divided differences
y i
y 1
y i
=
x 1 ,
i
=
2
,
3
,...,
n
x i
y i
−∇
y 2
2 y i
=
=
,
,...,
,
i
3
4
n
x i
x 2
2 y i −∇
2 y 3
3 y i
=
,
i
=
4
,
5
,...
n
(3.5)
x i
x 3
.
n
1 y n −∇
n
1 y n 1
n y n =
x n
x n 1
the solution of Eqs. (a) is
2 y 3
n y n
a 1 =
y 1
a 2 =∇
y 2
a 3 =∇
···
a n =∇
(3.6)
If the coefficients arecomputedbyhand, it isconvenienttowork with the format in
Table 3.1 (shown for n
=
5).
x 1
y 1
x 2
y 2
y 2
2 y 3
x 3
y 3
y 3
2 y 4
3 y 4
x 4
y 4
y 4
2 y 5
3 y 5
4 y 5
x 5
y 5
y 5
Table 3.1
4 y 5 ) in the table are the coefficients
of the polynomial. If the datapoints arelistedinadifferentorder, the entries in the table
will change, but the resultant polynomial will be the same—recall that apolynomial
of degree n
2 y 3 ,
3 y 4 and
The diagonalterms( y 1 ,
y 2 ,
1interpolating n distinct datapoints is unique.
newtonCoeff
Machinecomputations are best carried out within a one-dimensional array a employ-
ing the following algorithm:
functiona=newtonCoeff(xData,yData)
% Returns coefficients of Newton's polynomial.
Search WWH ::




Custom Search