**Polynomial Interpolation** is a method that used in estimating the values between the two data points,to estimate the values ,the data should be available on both sides of the data or at a few specific points .An estimation data between the gap can be made by using the** interpolation **

There are some methods for finding the Interpolation mentioned below

Polynomial is the simplest form of an interpolant. we can construct an unique polynomial of degree n that passes through (n+1) distinct data points.

here n in denotes the degree of the polynomial and

here are called cardinal functions.

now let us consider an example

let n=1 then

is the interpolant for the straight line

where

and

now let us consider n=2 ,then the equation becomes

is the interpolant for the parabola (polynomial of degree 2)

here

,

,

,

Cardinal fucntions are polynomials of degree n and have the property

,

here the is known as kronecker delta

Now to verify that the interpolating polynomial passes through the given data points ,we will substitue in , and use

then we get ,

**Example : 1**

find from the following data set given below

In the above given data set the intervals are unequal .By using the lagrange’s interpolation we have

,

,

Now, we need to find the value of ,so put in the above equation,

on calculating

Now lets try to solve the problem by using s2

` ````
```%use s2
var data01 = SortedOrderedPairs (doubleArrayOf( 5.0 , 7.0 ,9.0 , 12.0 )
,doubleArrayOf ( 2.0 , 5.0 , 6.0 ,9.0 ))
var nt : NevilleTable = NevilleTable(data01)
println(nt.evaluate(10.0))

Output :

6.5

Plot

` ````
```%use s2
// plotting the above function using JGnuplot
val p = JGnuplot(false)
p.addPlot("x*x*x*1/20 - 13/10*x*x + 223/20*x -30 ")
p.plot()

Output :

**Example 2 :**

find the vale of from the above given dataset

In the above given data set the intervals are unequal .By using the lagrange’s interpolation we have

,

Now, we need to find the value of ,so put in the above equation,

on calculating, .

testing

` ````
```%use s2
var data02 = SortedOrderedPairs (doubleArrayOf(5.0 , 6.0 , 8.0 )
,doubleArrayOf ( 7.0 , 10.0, 14.0 ))
var nt : NevilleTable = NevilleTable(data02)
println(nt.evaluate(7.0))

Output :

12.333333333333334

PLOT

` ````
```%use s2
// plot the above function by using JGnuplot
val p = JGnuplot(false)
p.addPlot("-x*x*1/3 + (20/3)*x - 18")
p.plot()

Output :