Graphics Programs Reference
In-Depth Information
y
Curve fitting
Interpolation
Figure 3.1. Interpolation and curve fitting of data.
Data points
x
One meansofobtaining this polynomial is the formula of Lagrange
n
P n 1 ( x )
=
y i i ( x )
(3.1a)
=
i
1
where
x
x 1
x
x 2
x
x i 1
x
x i + 1
x
x n
i ( x )
=
x 1 ·
x 2 ···
x i 1 ·
x i + 1 ···
x i
x i
x i
x i
x i
x n
n
x
x j
=
x j ,
i
=
1
,
2
,...,
n
(3.1b)
x i
j
=
1
j
=
i
arecalled the cardinal functions .
For example, if n
=
2, the interpolant is the straight line P 1 ( x )
=
y 1 1 ( x )
+
y 2 2 ( x ),
where
x
x 2
x
x 1
1 ( x )
=
2 ( x )
=
x 1
x 2
x 2
x 1
=
=
y 1 1 ( x )
+
y 2 2 ( x )
+
y 3 3 ( x ), where now
With n
3, interpolationis parabolic: P 2 ( x )
( x
x 2 )( x
x 3 )
1 ( x )
=
( x 1
x 2 )( x 1
x 3 )
( x
x 1 )( x
x 3 )
2 ( x )
=
( x 2
x 1 )( x 2
x 3 )
( x
x 1 )( x
x 2 )
3 ( x )
=
( x 3
x 1 )( x 3
x 2 )
The cardinalfunctions are polynomials of degree n
1 and have the property
0
if i
=
j
i ( x j )
=
= δ i j
(3.2)
=
1 f i
j
δ i j is the Kroneckerdelta. This propertyis illustrated in Fig. 3.2 for three-point
interpolation ( n
where
=
3) with x 1
=
0, x 2
=
2 and x 3
=
3
.
Search WWH ::




Custom Search