The Lagrange interpolation is a classical technique for performing interpolation. Sometimes this interpolation is also
called the polynomial interpolation. In the first order approximation, it reduces to a linear interpolation, a concept also
applied in (see Cubic Spline Method).
Algorithm Creation
For a given set of n + 1 data points (x_{0},y_{0}),(x_{1},y_{1}),...,
(x_{n},y_{n}), where no two x_{i} are the same, the interpolation polynomial in the Lagrange form
is a linear combination:
y = f(x) = ∑_{i=0}^{n} l_{i}(x) f(x_{i})

Testing the Lagrange Method
In order to test the Lagrange method as defined above, a new TestLagrange()
static method has been added and executed. Supporting code and methods are not shown.
static void TestLagrange();
{
ListBox1.Items.Clear();
ListBox2.Items.Clear();
double[] xarray = new double[] { t1, t2, t3, t4, t5 };
double[] yarray = new double[] { t6, t7, t8, t9, t10 };
double[] x = new double[] { t11, t12, t13 };
double[] y = Interpolation.Lagrange(xarray, yarray, x);
VectorR vx = new VectorR(x);
VectorR vy = new VectorR(y);
ListBox1.Items.Add(" " + vx.ToString());
ListBox2.Items.Add(" " + vy.ToString());
}
