How to use this calculator
Evaluate the polynomial that passes through a set of distinct data points using Lagrange basis polynomials.
- Enter Known x coordinates, Known y coordinates, Evaluation x. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Lagrange polynomial interpolation explained
The Lagrange form constructs the unique polynomial passing through each distinct xᵢ,yᵢ pair, then evaluates that polynomial at t. Node order does not change the interpolant, but each y value must remain paired with its original x coordinate.
How the calculation works
P(t)=Σ yi ∏ over j≠i [(t−xj)/(xi−xj)].
Inputs and units
- Known x coordinates
- Distinct interpolation nodes.
- Known y coordinates
- Values paired with nodes in the same order.
- Evaluation x
- The t-coordinate where the fitted polynomial is evaluated; values outside the smallest and largest node are extrapolations.
Limits of this model
High-degree interpolation and extrapolation can be unstable. It is interpolation of data, not evidence that the true relationship is polynomial.
Linear interpolation uses two neighbors. This tool fits one polynomial through every entered node.
Check a numerical scenario
Known x coordinates = 0,1,2; Known y coordinates = 1,2,5; Evaluation x = 1.5.
- Interpolated polynomial value: 3.25 y units
For nodes (0,1), (1,2), and (2,5), the interpolating polynomial is x²+1. Evaluating at t=1.5 gives 1.5²+1=3.25 y units. This agrees with the calculator output.
Frequently asked questions
Can two x coordinates be equal?
Not in this interpolation formula.
Is a value outside the node range allowed?
Yes, but that is extrapolation and may be unreliable.
Does adding more nodes always improve accuracy?
No. High-degree oscillation and data noise can worsen results.
How do I use the Lagrange polynomial interpolation calculator?
Enter Known x coordinates, Known y coordinates, Evaluation x. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Lagrange polynomial interpolation?
Known x coordinates = 0,1,2; Known y coordinates = 1,2,5; Evaluation x = 1.5. Interpolated polynomial value: 3.25 y units For nodes (0,1), (1,2), and (2,5), the interpolating polynomial is x²+1. Evaluating at t=1.5 gives 1.5²+1=3.25 y units. This agrees with the calculator output.
See our calculation methodology.