6.2 Polynomial Interpolation Functions

   

 
Java Number Cruncher: The Java Programmer's Guide to Numerical Computing
By Ronald  Mak

Table of Contents
Chapter  6.   Interpolation and Approximation

6.2 Polynomial Interpolation Functions

If we are given two data points in the xy plane, there is one, and only one, polynomial interpolation function f 1 ( x ) of degree 1 that will pass through both points a line function.

As shown in Figure 6-2, let the two points be ( x , f 1 ( x )) and ( x 1 , f 1 ( x 1 )). Then, using similar triangles , we have

graphics/06equ03.gif


Figure 6-2. A line in the xy plane.

graphics/06fig02.jpg

and so

graphics/06equ04.gif


Notice that we have derived the Newton form of the polynomial

graphics/06equ05.gif


where the coefficients b = f 1 ( x ) and b 1 = the quantity in the square brackets. The quantity in the square brackets is called a divided difference, and it happens to be the slope of the line. As we'll soon see, divided differences play a major computational role in determining polynomial interpolation functions.

If there are three points in the xy plane, then there is a polynomial interpolation function f 2 ( x ) of degree 2 that will pass through all three points. This is a quadratic function, which describes a parabola. Although we won't prove it here, this parabola is unique for any three given points.

The Newton form of the parabola is

graphics/06equ06.gif


where the centers x and x 1 are the x coordinates of two of our three given points. The coefficients b i are constant their values are the same for any value of x. So to compute b , first set x to the value x to get rid of the terms containing b 1 and b 2 , and we see that

graphics/06equ07.gif


Now set x to the value x 1 to get rid of the term containing b 2 and substitute in the value we just computed for b :

graphics/06equ08.gif


and so

graphics/06equ09.gif


Finally, set x to the center value x 2 (the x coordinate of the third point) and substitute in the values for b and b 1 :

graphics/06equ10.gif


Subtract f 2 ( x 1 ) from both sides:

graphics/06equ11.gif


But since

graphics/06equ12.gif


we have

graphics/06equ13.gif


Divide both sides by ( x 2 - x 1 ), and we get

graphics/06equ14.gif


and finally

graphics/06equ15.gif


Notice that the values of b and b 1 are similar to the corresponding values we had computed for the first degree polynomial. The definition of b 2 is recursive it's a divided difference that is composed of two divided differences.

In general, if we are given n +1 points, then there exists a unique polynomial function f n ( x ) of degree n that passes through all the points.


   
Top
 


Java Number Cruncher. The Java Programmer's Guide to Numerical Computing
Java Number Cruncher: The Java Programmers Guide to Numerical Computing
ISBN: 0130460419
EAN: 2147483647
Year: 2001
Pages: 141
Authors: Ronald Mak

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net