Lagrange Interpolation Polynomial Calculator
Enter your x,y data points and an x value to evaluate the Lagrange interpolating polynomial.
Result
How it is calculated
Enter one point per line as x,y (a comma or a space both work) and a query value xq. With n points (xi, yi) the tool evaluates P(xq) = Σ yi · Πj≠i (xq − xj) / (xi − xj). It does not print the polynomial's coefficients, only the value at xq, plus the number of points used and the degree n − 1, which is the highest degree the polynomial can have. Every non-empty line must hold exactly two numbers: a line with one number, three numbers or text makes the whole input invalid and no result is shown. Two points with the same x also give no result, because the denominator would be zero, and at least two points are needed. Asking for an xq outside your data range is extrapolation and can be wildly off.
Worked example
Use the four points (0, 1), (1, 3), (2, 11), (3, 31) and ask for xq = 1.5. The weights at 1.5 are −0.0625, 0.5625, 0.5625 and −0.0625, one per point. Multiplying by the y values gives −0.0625 + 1.6875 + 6.1875 − 1.9375. The sum is 5.8750, and the tool reports 4 points and degree 3. These points happen to lie on x³ + x + 1, so 1.5³ + 1.5 + 1 gives the same figure.
Common mistakes
- Repeating an x value, for example two measurements at the same x. The tool returns nothing, because a function cannot have two different y values at one x. Average them or drop one first.
- Extrapolating. With four points, asking for a value far outside their x range gives a large, unreliable number: for xq = 10 these same points give 1,011.0000.
- Using a decimal comma inside a point line. A line such as
1,5is read as x = 1 and y = 5, not x = 1.5, and1,5 2has three numbers and is rejected. Write decimals with a dot. - Leaving a stray line, such as a header or a note, in the list. It is not skipped: the whole input is rejected, so remove everything except the x,y lines.
- Using noisy measurements with many points. The polynomial passes exactly through every point, noise included, so it can oscillate; a regression fit suits noisy data better.
About this calculator
Lagrange interpolation constructs the unique lowest-degree polynomial that passes exactly through a given set of (x, y) points, built as a weighted sum of "basis" polynomials — each one designed to equal 1 at its own x-value and 0 at every other data point's x-value. Unlike fitting a line or curve by least-squares regression, which minimizes overall error but generally misses most points, Lagrange interpolation guarantees the polynomial threads through every single point exactly, which is exactly what you want when the data points are trusted, exact values rather than noisy measurements.
This calculator takes your set of x,y data points (one per line, with distinct x values) and evaluates the Lagrange polynomial at any x value you choose, showing the interpolated value, the number of points and the polynomial degree. It does not print the polynomial's coefficients or expression. Numerical methods students verifying interpolation by hand, engineers estimating a value between sparse tabulated data (like steam tables or lookup charts), and programmers implementing curve-fitting from scratch use it to check their derivations or quickly get an interpolated estimate without coding the algorithm themselves.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments