Why interpolate a table
Standards and handbooks — building codes, steam tables, material properties, price lists — give values only at nodes. The value you need almost always lies between two rows. For two neighbouring rows a two-point linear interpolation is enough; this calculator takes the whole table so you can evaluate any number of points without picking the interval by hand.
How it works
Piecewise linear interpolation. For every x the interval [xi; xi+1] is found and the value is taken on the straight segment between the neighbouring nodes:
y = yi + (x − xi) · (yi+1 − yi) / (xi+1 − xi)
Cubic spline. A smooth curve made of cubic polynomials passes through all points; value, first and second derivatives match at the nodes (natural spline: zero second derivative at the ends). It is more accurate than straight segments for smooth curved data and does not oscillate like a single high-degree Lagrange or Newton polynomial.
Inverse interpolation. y is known, x is needed. All intervals where the table passes through y are found; a non-monotonic table may give several answers.
Example
Table (0; 1.00), (10; 0.95), (20; 0.85), (30; 0.70). For x = 15: y = 0.95 + (15 − 10) · (0.85 − 0.95) / (20 − 10) = 0.90. Inversely, y = 0.9 gives x = 15. x = 35 is outside the table and is marked as extrapolation.
Tips
- Copy two columns in Excel (Ctrl+C) and paste them into the table field.
- Results for many points are copied with one button and pasted back into Excel as a column.
- The link stores the table and the values.
- If the value depends on two parameters (row and column), use bilinear interpolation.