User Rating 0.0
Total Usage 0 times
Grid Coordinates
Corner Values
Interpolation Point
Presets:
Visualization
Is this tool helpful?

Your feedback helps us improve.

About

Bilinear interpolation estimates a value f(x, y) at an arbitrary point within a rectangular grid defined by four known corner values. It performs three linear interpolations: two along one axis to produce intermediate values R1 and R2, then one along the perpendicular axis to yield the final result. The method assumes the function varies linearly between sample points, which introduces error proportional to the second derivative of the true surface. Misapplying it to non-rectilinear grids or extrapolating outside the cell produces incorrect results without warning. This calculator enforces strict domain checks: the interpolation point must lie within or on the boundary of the rectangle [x1, x2] × [y1, y2].

Applications span image resampling (where corner values are pixel intensities), GIS terrain modeling (elevation grids), computational fluid dynamics (pressure or velocity fields), and climate data interpolation (temperature at unsampled coordinates). The tool assumes a rectilinear grid with x1 x2 and y1 y2. For irregular point distributions, consider inverse distance weighting or kriging instead.

bilinear interpolation 2D interpolation grid interpolation numerical methods linear interpolation image scaling terrain interpolation

Formulas

Given four corner values on a rectilinear grid at coordinates (x1, y1), (x2, y1), (x1, y2), and (x2, y2), the interpolated value at point (x, y) is computed in two stages.

First, compute normalized distances:

t = x x1x2 x1 , u = y y1y2 y1

Interpolate along the x-axis at each y level:

R1 = (1 t) Q11 + t Q21
R2 = (1 t) Q12 + t Q22

Then interpolate along the y-axis:

P = (1 u) R1 + u R2

Equivalently, the full expanded form:

f(x, y) = Q11(x2 x)(y2 y) + Q21(x x1)(y2 y) + Q12(x2 x)(y y1) + Q22(x x1)(y y1)(x2 x1)(y2 y1)

Where: Q11 = f(x1, y1) is the value at the bottom-left corner. Q21 = f(x2, y1) is the bottom-right. Q12 = f(x1, y2) is the top-left. Q22 = f(x2, y2) is the top-right. t and u are the normalized interpolation parameters, each [0, 1].

Reference Data

Interpolation MethodDimensionsRequired PointsContinuityTypical Use CaseError Order
Nearest NeighborAny1C−1 (discontinuous)Fast image scaling, classificationO(h)
Linear (1D)1D2C0Signal resampling, table lookupO(h2)
Bilinear2D4C0Image scaling, terrain grids, CFDO(h2)
Trilinear3D8C0Volumetric data, 3D texturesO(h2)
Bicubic2D16C1Photo resampling, smooth surfacesO(h4)
Cubic Spline (1D)1D4C2Smooth curve fitting, CADO(h4)
Lanczos1D/2D6-12C0High-quality image downscalingO(h4)
Inverse Distance WeightingAnynC0Irregular point clouds, GISData-dependent
Kriging2D/3DnC0Geostatistics, mineral explorationOptimal (BLUE)
Radial Basis FunctionAnynCMesh-free methods, scattered dataSpectral
Barycentric (Triangle)2D3C0FEM, triangulated surfacesO(h2)
Hermite1D/2D4 + derivativesC1Animation, smooth motion pathsO(h4)
B-Spline (Quadratic)1D/2D9C1CAD surfaces, font renderingO(h3)
Shepard’s MethodAnynC0Quick scattered data approx.Data-dependent

Frequently Asked Questions

When the point lies on an edge, bilinear interpolation degenerates to standard linear interpolation along that edge. If the point coincides exactly with a corner, the result equals the corner value. Both are mathematically correct special cases of the general formula - the weights for the non-contributing corners become zero. This calculator handles these cases without additional logic because the formula naturally produces the correct result.
Bilinear interpolation uses 4 points and produces C⁰ continuity (continuous values, but discontinuous first derivatives at cell boundaries). Bicubic interpolation uses 16 points (a 4×4 neighborhood) and achieves C¹ continuity (continuous first derivatives). Use bilinear when speed matters or data is sparse. Use bicubic when visual smoothness is critical, such as photographic image scaling or smooth surface rendering in CAD.
Technically, the formula accepts any values of x and y, but extrapolation (when t or u falls outside [0, 1]) produces unreliable results. The linear assumption between grid points does not hold beyond the sampled region. This calculator warns you if the point lies outside the grid and flags the result as an extrapolation.
No. Bilinear interpolation is commutative with respect to axis order. Interpolating along x first then y yields the identical result as interpolating along y first then x. This is because the expanded formula is symmetric in the product terms (x2 x)(y2 y), etc.
The truncation error is O(h2), where h is the grid spacing. More precisely, the error bound is proportional to hxhy times the magnitude of the mixed second partial derivative ∂²f/∂xy. Halving the grid spacing reduces the error by a factor of 4. For functions with large curvature or sharp gradients, bilinear interpolation introduces visible artifacts.
It does not. Bilinear interpolation for points inside the cell always returns a value within the range [min(Q11, Q21, Q12, Q22), max(Q11, Q21, Q12, Q22)]. This is the convex combination property. If your result exceeds corner values, the interpolation point is outside the cell (extrapolation) or the inputs contain an error.