HomeCalculatorsMathNumerical CalculusNumerical Interpolation Calculator
Math calculator

Numerical Interpolation Calculator

Piecewise-linear, Lagrange, or natural cubic spline of tabulated (x, y). Not regression, not CAS. Runs locally.

Instant result
Result

Enter values to calculate.

Inputs
Mode
Formula
Trust summary Engine tested · Specification checked · 13/13 tests · Production surface contract 4/4 · v1.1.0
Input interpretation
Enter values to calculate.
Result
Model
y at x from tabulated points by piecewise linear, Lagrange, or natural cubic spline.
Scope
Unique x; sorted internally
Verification
Engine tested · 13/13 tests · Production surface contract 4/4 · Specification checked · v1.1.0
Named expert review
Optional · Not performed
Specification basis
  • ISO 80000-2:2019 Quantities and units — Mathematics
Specification basis
Evidence
4 golden · 2 boundary · 7 property · Production surface contract 4/4 · Artifact integrity PASS
Production
Embedded snapshot: unpublished · Build schema 1.1.0 ready · Semantic contract ✓ · Attestation report not published on origin · Live production status STALE (1 capability; 163 remain CURRENT) @ 2026-09-19T00:00:17.039Z
Semantic contract
PASS

Formulas

Core equations used by this calculator.

Lineary = y₀ + (y₁−y₀)(x−x₀)/(x₁−x₀)
Lagrangey = Σ yⱼ ℓⱼ(x), ℓⱼ = Πᵢ≠ⱼ (x−xᵢ)/(xⱼ−xᵢ)
Natural splineS″(x₀) = S″(xₙ) = 0
iPoints as x,y; x,y (semicolon-separated) or two-point x0,y0,x1,y1. Linear/spline table ≤ 100 points. Lagrange ≤ 9 points (degree ≤ 8). x outside the table needs extrapolate=true for linear and spline.

How to use

1

Enter tabulated points

At least two pairs with unique x. Linear is piecewise; Lagrange is one polynomial; spline is piecewise cubic. Discovery /spline-interpolation locks spline.

2

Evaluate at x

Linear and spline stay inside [x_min, x_max] unless extrapolate is on. Lagrange is defined everywhere.

Example calculations

Common configurations with formula and result.

ϟ

Midpoint

(0,0) and (10,20) at x=5

y = 0 + 20·5/10
10
ϟ

Natural spline

(0,0), (1,1), (2,0) at x=0.5

S″ ends = 0
0.6875

Numerical Interpolation calculator specification

Version 1.1.0 · Engine tested

Calculation status

Review policy · Evidence

Definition
Given tabulated points (xₖ, yₖ) with unique x, piecewise linear interpolates on the bracketing interval. Lagrange builds the unique polynomial of degree n−1 through n points. A natural cubic spline is piecewise cubic with S″=0 at the ends. Not statistical regression.
What it calculates
y at x from tabulated points by piecewise linear, Lagrange, or natural cubic spline.
Inputs
  • method
  • x
  • points?
  • x0?
  • y0?
  • x1?
  • y1?
  • extrapolate?
Outputs
  • y
  • n
  • in_range
  • extrapolated
Formula
piecewise linear / Lagrange / natural cubic spline
Assumptions
  • Unique x; sorted internally
  • Natural spline ends, not clamped
  • Not Akima / PCHIP / regression / CAS
Units
  • dimensionless
Boundary conditions
  • x outside table without extrapolate → VALUE_OUT_OF_RANGE
  • duplicate x → INVALID_INPUT
  • unknown method (including akima) → INVALID_MODE
Example
linear (0,0)(10,20) x=5 → 10
Validation cases

3 published on this page · 13/13 tests · Production surface contract 4/4 · View evidence

  • method=linear points=0,0;10,20 x=5 → y=10
  • method=spline points=0,0;1,1;2,0 x=0.5 → y=0.6875
  • method=akima points=0,0;1,1 x=0.5 → INVALID_MODE
Specification basis
  • ISO 80000-2:2019 Quantities and units — Mathematics
Calculation version
1.1.0
}

Frequently asked questions

Key distinctions behind the calculation.

Is this Akima, PCHIP, or regression?

No. Methods are piecewise linear, Lagrange, and natural cubic spline. Akima, PCHIP, clamped spline, and least-squares fit are out of scope. It is not a Statistics calculator.

Where does this run?

Locally in the browser by default. REST and MCP call the same interpolation engine. /spline-interpolation is a discovery URL, not a second engine.