Lagrange Polynomial Interpolation and Approximation

Numerical Methods

Source inspiration: (Mathew 2000-2019).

Description

Lagrange interpolation builds a unique polynomial of degree at most \(n\) through \(n+1\) data points. In barycentric form, it is numerically stable and efficient for evaluation while keeping the same interpolant.

Given nodes \((x_i, y_i)\), the interpolation polynomial is

\[ P_n(x)=\sum_{i=0}^{n} y_i L_i(x), \qquad L_i(x)=\prod_{j\ne i} \frac{x-x_j}{x_i-x_j}. \]

The 29 animations below follow the legacy Mathews case ordering and use equally spaced nodes on the listed node intervals.

Animations

Each animation increases polynomial degree one step at a time for a fixed function and interval.

Julia source for all cases

Case 01

Lagrange interpolation animation for case 01 from the legacy function-and-interval list.

Case 02

Lagrange interpolation animation for case 02 from the legacy function-and-interval list.

Case 03

Lagrange interpolation animation for case 03 from the legacy function-and-interval list.

Case 04

Lagrange interpolation animation for case 04 from the legacy function-and-interval list.

Case 05

Lagrange interpolation animation for case 05 from the legacy function-and-interval list.

Case 06

Lagrange interpolation animation for case 06 from the legacy function-and-interval list.

Case 07

Lagrange interpolation animation for case 07 from the legacy function-and-interval list.

Case 08

Lagrange interpolation animation for case 08 from the legacy function-and-interval list.

Case 09

Lagrange interpolation animation for case 09 from the legacy function-and-interval list.

Case 10

Lagrange interpolation animation for case 10 from the legacy function-and-interval list.

Case 11

Lagrange interpolation animation for case 11 from the legacy function-and-interval list.

Case 12

Lagrange interpolation animation for case 12 from the legacy function-and-interval list.

Case 13

Lagrange interpolation animation for case 13 from the legacy function-and-interval list.

Case 14

Lagrange interpolation animation for case 14 from the legacy function-and-interval list.

Case 15

Lagrange interpolation animation for case 15 from the legacy function-and-interval list.

Case 16

Lagrange interpolation animation for case 16 from the legacy function-and-interval list.

Case 17

Lagrange interpolation animation for case 17 from the legacy function-and-interval list.

Case 18

Lagrange interpolation animation for case 18 from the legacy function-and-interval list.

Case 19

Lagrange interpolation animation for case 19 from the legacy function-and-interval list.

Case 20

Lagrange interpolation animation for case 20 from the legacy function-and-interval list.

Case 21

Lagrange interpolation animation for case 21 from the legacy function-and-interval list.

Case 22

Lagrange interpolation animation for case 22 from the legacy function-and-interval list.

Case 23

Lagrange interpolation animation for case 23 from the legacy function-and-interval list.

Case 24

Lagrange interpolation animation for case 24 from the legacy function-and-interval list.

Case 25

Lagrange interpolation animation for case 25 from the legacy function-and-interval list.

Case 26

Lagrange interpolation animation for case 26 from the legacy function-and-interval list.

Case 27

Lagrange interpolation animation for case 27 from the legacy function-and-interval list.

Case 28

Lagrange interpolation animation for case 28 from the legacy function-and-interval list.

Case 29

Lagrange interpolation animation for case 29 from the legacy function-and-interval list.

Derivation Notes (Planned)

Short derivations will be added for interpolation error bounds and node-placement effects.

References

Mathew, John H. 2000-2019. Numerical Analysis - Numerical Methods Modules. https://web.archive.org/web/20190808102217/http://mathfaculty.fullerton.edu/mathews/n2003/NumericalUndergradMod.html.