In order to get Lagrange interpolating curve

* P(t) = S_{i=0,n}
L_{i}^{n}(t) P_{i}* (*)

the

L

**Quadratic Lagrange curve**

*Interactive Lagrange applet.*

Drag the mouse to move the nearest Lagrange control point (a small blue
square in the left window) or knot (a small black square in the right window).
In the right applet window you see basis Lagrange polynomials.
Move a knot to see how it influences on spline shape and basis functions.
As since *0 <= t <= 1* you will get an extrapolating curves
if *t _{0} > 0* or

**Cubic Lagrange curve**

Note that Lagrange curves are not contained in the convex hull
of its control points.

**Aitken algorithm**

The analogue of the de Casteljau algorithm in the case of Lagrange curves
is the *Aitken algorithm*

* P_{i}^{j} =
P_{i}^{j-1}
(t_{i+j} - t) / (t_{i+j} - t_{i}) +
P_{i+1}^{j-1}
(t - t_{i}) / (t_{i+j} - t_{i}) ,
j = 1, n i = 0, n-j* .

However formula (*) and stored array of basis functions are used in Lagrange.java. These polynomials were calculated earlier for the right window as

for (i = 0; i < N; i++){ P = 1; for (j = 0; j < N; j++) if (j != i) P = P*(t-ti[j])/(ti[i] - ti[j]); }

**Oscillations of Lagrange curves**

As Lagrange polynomials oscillate between its roots (knots), therefore
they can take negative values. Unfortunately these oscillations grow quickly
with *n* increasing. You see below these oscillations in an interpolating
curve of *n = 7* degree. Compare Lagrange and Bezier (lower picture)
curves too.

Therefore Lagrange interpolation is useless for complex curves with
large *n* values. But further we will compose an interpolating spline
of cubic Bezier segments joined smoothly.

Contents Previous: More Bezier splines Math Next: Interpolating Cardinal splines