Lagrange Interpolation
Edit interpolation nodes and an evaluation point to connect Lagrange basis weights, exact nodal interpolation and the limits of extrapolation.
Free theory articleEdit interpolation nodes and an evaluation point to connect Lagrange basis weights, exact nodal interpolation and the limits of extrapolation.
Concept & interpretation
Lagrange interpolation provides a direct way to find the unique polynomial of lowest degree that passes through a given set of data points. For n points, the resulting polynomial has a degree of at most n - 1.
Verify the interpolation with the module
Open Lagrange Interpolation to explore how moving points affects the global polynomial and local basis weights.
- Select the Quadratic preset. The nodes are (-1, 1), (0, 0), and (1, 1). Set the evaluation point to 0.5. Verify the basis weights are exactly -0.1250, 0.7500, and 0.3750, summing to 1.0000, and p(0.5) = 0.2500.
- Move the evaluation point precisely to one of the nodes, for example x = 1.00. Notice that the weight for L2 becomes 1.0000 and all other weights become 0.0000, yielding p(1.00) = 1.0000 exactly. This demonstrates that Lagrange polynomials perfectly interpolate the given nodes.
- Switch to the Linear preset with nodes (0, 1) and (2, 5). The resulting polynomial is p(x) = 1 + 2x. Set the evaluation point to 1 and verify p(1) = 3.0000.
- Switch to the Constant preset. Every interpolated value across the domain is 2. Evaluating outside the node interval (e.g., x < -1 or x > 1) is correctly labeled as extrapolation.