Professional Documents
Culture Documents
Multi-Linear Interpolation: 1 Abstract
Multi-Linear Interpolation: 1 Abstract
Multi-Linear Interpolation
Rick Wagner
1 Abstract
A standard linear algebra method of interpolation that scales to any dimensionality is
described.
2 Description
Given an array (or table) of values for a function of one or more variables, it is often
desired to find a value between two given points. If the given function is not linear, then
the interpolated value will be an approximation. Computation of error terms for the nonlinear case is covered in standard mathematics texts [1]. If the array has more than two
dimensions, the value sought will be at a point within the interior of the corresponding
polytope. In the descriptions below, the functions for interpolation are assumed to be
sufficiently close to linear.
Page 1
(1)
y1
(x1, y1)
y2
y0
(x2, y2)
A
(x0, y0)
y = f(x)
x1 - x0
x2 - x0
x1 - x2
X
x0
x2
x1
To interpolate the value (y2) of f at point C (given at x2) we find the slope (m) of the line
between points A and B. Then
y 2 = y 0 + m (x 2 x0 )
(2)
where
m=
y1 y 0
x1 x 0
(3)
y 0 ( x1 x0 ) + ( y1 y 0 ) ( x 2 x0 )
x1 x 0
(4)
y 0 ( x1 x 2 ) + y1 ( x 2 x 0 )
x1 x0
(5)
The segment of the X axis designated by x1 x0 is the projection of segment AB onto the
X axis. Dividing by this length in equation (5) normalizes the sum of the projections of
Page 2
(6)
and we are given four points, A, B, C, and D defining a rectangle as shown below in
Figure 2:
Y
z = f(x, y)
y1
B
(x0, y1, z0)
y2
y0
D
(x1, y0, z3)
X
x0
x2
x1
The rectangle ABCD is partitioned into four areas by the lines x = x2 and y = y2. To
interpolate the value (z4) of f at point E (given at x2 and y2) we first find the normalized
areas of the partitions of the rectangle ABCD. The four areas are normalized by dividing
them each by the area of rectangle ABCD.
Page 3
Na =
(x1 x2 ) ( y2 y0 )
(x1 x0 ) ( y1 y0 )
(7)
Nb =
(x2 x0 ) ( y 2 y 0 )
(x1 x0 ) ( y1 y 0 )
(8)
(x1 x 2 ) ( y1 y 2 )
(x1 x0 ) ( y1 y 0 )
(x x0 ) ( y1 y 2 )
= 2
(x1 x0 ) ( y1 y 0 )
Nc =
Nd
(9)
(10)
z 4 = z 0 N a + z1 N b + z 2 N c + z 3 N d
(11)
v = f(x, y, z)
(12)
Page 4
v = f(x, y, z)
z1
z2
(x0, y0, z1, v0)
C
B
z0
(x2, y2, z2, v8)
I
(x0, y0, z0, v4)
E
D (x1, y1, z1, v3)
y0
x0
x2
x1
y2
y1
The prism ABCDEFGH is partitioned into eight volumes by the planes x = x2, y = y2, and
z = z2 To interpolate the value (v8) of f at point I (given at x2, y2, and z2) we first find the
normalized volumes of the partitions of the prism ABCDEFGH. The eight volumes are
normalized by dividing them each by the volume of prism ABCDEFGH.
The eight normalized volumes Na, Nb, Nc, Nd Ne, Nf, Ng, and Nh, each diagonally opposite
from its naming prism vertex, are given by
(x1 x2 ) ( y1 y2 ) (z2 z0 )
(x1 x0 ) ( y1 y0 ) (z1 z0 )
( x x ) ( y 2 y0 ) ( z 2 z 0 )
Nb = 1 2
(x1 x0 ) ( y1 y0 ) (z1 z0 )
Na =
Page 5
(13)
(14)
(x2 x0 ) ( y1 y2 ) (z2 z0 )
(x1 x0 ) ( y1 y0 ) (z1 z0 )
(x x0 ) ( y2 y0 ) (z2 z0 )
Nd = 2
(x1 x0 ) ( y1 y0 ) (z1 z0 )
(x x ) ( y1 y2 ) (z1 z2 )
Ne = 1 2
(x1 x0 ) ( y1 y0 ) (z1 z0 )
(x x ) ( y2 y0 ) (z1 z2 )
Nf = 1 2
(x1 x0 ) ( y1 y0 ) (z1 z0 )
(x x0 ) ( y1 y2 ) (z1 z2 )
Ng = 2
(x1 x0 ) ( y1 y0 ) (z1 z0 )
(x x0 ) ( y2 y0 ) (z1 z2 )
Nh = 2
(x1 x0 ) ( y1 y0 ) (z1 z0 )
Nc =
(15)
(16)
(17)
(18)
(19)
(20)
z8 = z0 N a + z1 N b + z2 N c + z3 N d + z4 N e + z5 N f + z6 N g + z7 N h
(21)
y = f ( x1 , x 2 , K x n )
(22)
and we are given 2n points that are the vertices of a right rectangular polytope. If we are
given a point (x12 , x 22 ,K , x n 2 ) in the interior of the polytope, the polytope is divided into
2n partitions by n m-dimensional branes passing through the given interior point where m
= n 1.
Each partition has a normalized quantity given by
Page 6
(23)
y = x1 N 1 + x 2 N 2 + K + x n N n
(24)
3 Conclusion
A generic n-dimensional linear interpolation method has been described with specific
low-dimensional examples.
4 References
[1]
Kreysig, Erwin, Advanced Engineering Mathematics, Third Edition, John Wiley and Sons, Inc.,
1972.
[2]
Safro,
Ilya,
Resampling
Using
Bilinear
Interpolation,
http://www.wisdom.weizmann.ac.il/~maksimf/ex5/Resample.html, 2004.
Page 7
Web
page: