ArticleslgStudy

mathematics

Bilinear interpolation

Bilinear interpolation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Bilinear interpolation rather than just read about it. In short: In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., x and y) using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be generalized to functions defined on the vertices of (a mesh of) arbitrary convex quadrilaterals.

Bilinear interpolation — main illustration
Bilinear interpolation — illustration

Key takeaways

  • Bilinear interpolation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Bilinear interpolation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Bilinear interpolation from memory before moving on to harder problems.

Reference excerpt

In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., x and y) using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be generalized to functions defined on the vertices of (a mesh of) arbitrary convex quadrilaterals. Bilinear interpolation is performed using linear interpolation first in one direction, and then again in another direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not linear but rather quadratic in the sample location. Bilinear interpolation is one of the basic resampling techniques in computer vision and image processing, where it is also called bilinear filtering or bilinear texture mapping.

Computation

Suppose that we want to find the value of the unknown function f at the point (x, y). It is assumed that we know the value of f at the four points Q11 = (x1, y1), Q12 = (x1, y2), Q21 = (x2, y1), and Q22 = (x2, y2).

Repeated linear interpolation We first do linear interpolation in the x-direction. This yields

f(x,y1)=x2−xx2−x1f(Q11)+x−x1x2−x1f(Q21),f(x,y2)=x2−xx2−x1f(Q12)+x−x1x2−x1f(Q22). We proceed by interpolating in the y-direction to obtain the desired estimate:

f(x,y)=y2−yy2−y1f(x,y1)+y−y1y2−y1f(x,y2)=y2−yy2−y1(x2−xx2−x1f(Q11)+x−x1x2−x1f(Q21))+y−y1y2−y1(x2−xx2−x1f(Q12)+x−x1x2−x1f(Q22))=1(x2−x1)(y2−y1)(f(Q11)(x2−x)(y2−y)+f(Q12)(x2−x)(y−y1)+f(Q21)(x−x1)(y2−y)+f(Q22)(x−x1)(y−y1))=1(x2−x1)(y2−y1)[x2−xx−x1][f(Q11)f(Q12)f(Q21)f(Q22)][y2−yy−y1]. Note that we will arrive at the same result if the interpolation is done first along the y direction and then along the x direction.

Polynomial fit An alternative way is to write the solution to the interpolation problem as a multilinear polynomial

f(x,y)≈a00+a10x+a01y+a11xy, where the coefficients are found by solving the linear system

[1x1y1x1y11x1y2x1y21x2y1x2y11x2y2x2y2][a00a10a01a11]=[f(Q11)f(Q12)f(Q21)f(Q22)], yielding the result

[a00a10a01a11]=1(x2−x1)(y2−y1)[x2y2−x2y1−x1y2x1y1−y2y1y2−y1−x2x2x1−x11−1−11][f(Q11)f(Q12)f(Q21)f(Q22)].

Weighted mean

The solution can also be written as a weighted mean of the f(Q):

f(x,y)≈w11f(Q11)+w12f(Q12)+w21f(Q21)+w22f(Q22), where the weights sum to 1 and satisfy the transposed linear system

[1111x1x1x2x2y1y2y1y2x1y1x1y2x2y1x2y2][w11w12w21w22]=[1xyxy], yielding the result

[w11w21w12w22]=1(x2−x1)(y2−y1)[x2y2−y2−x21−x2y1y1x2−1−x1y2y2x1−1x1y1−y1−x11][1xyxy], which simplifies to

w11=(x2−x)(y2−y)(x2−x1)(y2−y1),w12=(x2−x)(y−y1)(x2−x1)(y2−y1),w21=(x−x1)(y2−y)(x2−x1)(y2−y1),w22=(x−x1)(y−y1)(x2−x1)(y2−y1), in agreement with the result obtained by repeated linear interpolation. The set of weights can also be interpreted as a set of generalized barycentric coordinates for a rectangle.

Alternative matrix form Combining the above, we have

f(x,y)≈1(x2−x1)(y2−y1)[f(Q11)f(Q12)f(Q21)f(Q22)][x2y2−y2−x21−x2y1y1x2−1−x1y2y2x1−1x1y1−y1−x11][1xyxy].

On the unit square If we choose a coordinate system in which the four points where f is known are (0, 0), (0, 1), (1, 0), and (1, 1), then the interpolation formula simplifies to

f(x,y)≈f(0,0)(1−x)(1−y)+f(0,1)(1−x)y+f(1,0)x(1−y)+f(1,1)xy, or equivalently, in matrix operations:

f(x,y)≈[1−xx][f(0,0)f(0,1)f(1,0)f(1,1)][1−yy]. Here we also recognize the weights:

w11=(1−x)(1−y),w12=(1−x)y,w21=x(1−y),w22=xy. Alternatively, the interpolant on the unit square can be written as

f(x,y)=a00+a10x+a01y+a11xy, where

a00=f(0,0),a10=f(1,0)−f(0,0),a01=f(0,1)−f(0,0),a11=f(1,1)−f(1,0)−f(0,1)+f(0,0). In both cases, the number of constants (four) correspond to the number of data points where f is given.

Properties

As the name suggests, the bilinear interpolant is not linear; but it is linear (i.e. affine) along lines parallel to either the x or the y direction, equivalently if x or y is held constant. Along any other straight line, the interpolant is quadratic. Even though the interpolation is not linear in the position (x and y), at a fixed point it is linear in the interpolation values, as can be seen in the (matrix) equations above. The result of bilinear interpolation is independent of which axis is interpolated first and which second. If we had first performed the linear interpolation in the y direction and then in the x direction, the resulting approximation would be the same. The interpolant is a bilinear polynomial, which is also a harmonic function satisfying Laplace's equation. Its graph is a bilinear Bézier surface patch.

Inverse and generalization In general, the interpolant will assume any value (in the convex hull of the vertex values) at an infinite number of points (forming branches of hyperbolas), so the interpolation is not invertible. However, when bilinear interpolation is applied to two functions simultaneously, such as when interpolating a vector field, then the interpolation is invertible (under certain conditions). In particular, this inverse can be used to find the "unit square coordinates" of a point inside any convex quadrilateral (by considering the coordinates of the quadrilateral as a vector field which is bilinearly interpolated on the unit square). Using this procedure bilinear interpolation can be extended to any convex quadrilateral, though the computation is significantly more complicated if it is not a parallelogram. The resulting map between quadrilaterals is known as a bilinear transformation, bilinear warp or bilinear distortion. Alternatively, a projective mapping between a quadrilateral and the unit square may be used, but the resulting interpolant will not be bilinear. In the special case when the quadrilateral is a parallelogram, a linear mapping to the unit square exists and the generalization follows easily. The obvious extension of bilinear interpolation to three dimensions is called trilinear interpolation.

… excerpt ends here. Continue reading the full article.

Illustrations

Bilinear interpolation: Example of bilinear interpolation on the unit square with the z values 0, 1, 1 and 0.5 as indicated. Interpolated values in between represented by color.
Example of bilinear interpolation on the unit square with the z values 0, 1, 1 and 0.5 as indicated. Interpolated values in between represented by color.
Bilinear interpolation: The four red dots show the data points and the green dot is the point at which we want to interpolate.
The four red dots show the data points and the green dot is the point at which we want to interpolate.
Bilinear interpolation: A geometric visualisation of bilinear interpolation. The product of the value at the desired point (black) and the entire area is equal to the sum of the products of the value at each corner and the partial area diagonally opposite the corner (corresponding colours).
A geometric visualisation of bilinear interpolation. The product of the value at the desired point (black) and the entire area is equal to the sum of the products of the value at each corner and the partial area diagonally opposite the corner (corresponding colours).
Bilinear interpolation: Comparison of Bilinear interpolation  with some 1- and 2-dimensional interpolations.
Black and red/yellow/green/blue dots correspond to the interpolated point and neighbouring samples, respectively. 
Their heights above the ground correspond to their values.
Comparison of Bilinear interpolation with some 1- and 2-dimensional interpolations. Black and red/yellow/green/blue dots correspond to the interpolated point and neighbouring samples, respectively. Their heights above the ground correspond to their values.
Bilinear interpolation: Example of bilinear interpolation in grayscale values
Example of bilinear interpolation in grayscale values

Worked examples

Example 1 — a first encounter with Bilinear interpolation

Start with the simplest possible case. Write down what Bilinear interpolation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Bilinear interpolation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Bilinear interpolation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Bilinear interpolation

In research
Bilinear interpolation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Bilinear interpolation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Bilinear interpolation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Euclidean plane geometry, Multivariate interpolation, so understanding it makes those chapters shorter.
In everyday life
Look for Bilinear interpolation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Bilinear interpolation” →

How to study Bilinear interpolation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Bilinear interpolation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Bilinear interpolation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Bilinear interpolation in simple terms?

In mathematics, bilinear interpolation is a method for interpolating functions of two variables (e.g., x and y) using repeated linear interpolation. It is usually applied to functions sampled on a 2D rectilinear grid, though it can be generalized to functions defined on the vertices of (a mesh of)…

Why does Bilinear interpolation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Bilinear interpolation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Bilinear interpolation.

Tags

  • Euclidean plane geometry
  • Multivariate interpolation

Keep exploring