Bilinear interpolation
If we are given four (x,y) points such that
f(x
1
,y
1
) = z
1
and
x
2
> x
1
f(x
1
,y
2
) = z
2
y
2
> y
1
f(x
2
,y
1
) = z
3
f(x
2
,y
2
) = z
4
then we can solve for a function in four unknown coefficients. There are an infinite number of such
equations, but the most simple candidate is
z = ax + bx + cxy + d
so the system to solve for a, b, c and d is
ax
1
+ by
1
+ cx
1
y
1
+ d = z
1
ax
1
+ by
2
+ cx
1
y
2
+ d = z
2
ax
2
+ by
1
+ cx
2
y
1
+ d = z
3
ax
2
+ by
2
+ cx
2
y
2
+ d = z
4
We could solve this directly for a, b, c and d, but we can get a more simple solution by scaling x and y,
like this:
and
t
=
x
−
x1
x2
−
x1
u
=
y
−
y1
y2
−
y1
With this scaling, t = 0 when x = x
1
and t = 1 when x = x
2
. Similarly, u = 0 when y = y
1
and u = 1 when y
= y
2
. This equation system to solve simplifies to this:
d = z
1
or
a = z
3
- z
1
b + d = z
2
b = z
2
- z
1
a + d = z
3
c = z
1
- z
2
- z
3
+ z
4
a + b + c + d = z
4
d = z
1
So the equation to estimate z in terms of t and u is
z = (z
3
- z
1
)t + (z
2
- z
1
)u + (z
1
- z
2
- z
3
+ z
4
)ut + z
1
We can expand this equation, collect on z
1
, z
2
, z
3
and z
4
, and further factor that result to get
z = z
1
(1-u)(1-t) + z
2
u(1-t) + z
3
t(1-u) + z
4
ut
The function bilinint() does the interpolation with this formula
bilinint(xa,xb,ya,yb,zaa,zab,zba,zbb,x,y)
Func
©(xa,xb,ya,yb,zaa,zab,zba,zbb,x,y) Lin interpolate z=f(x,y)
©8oct00 [email protected]
local t,u
(x-xa)/(xb-xa)
→
t
6 - 45
Содержание TI-92+
Страница 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Страница 53: ...LCD connector detail PCB switch side 1 42...
Страница 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Страница 55: ...Key cap detail 1 44...
Страница 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Страница 59: ...Keypad rubber sheet key cap side Inside front cover showing keycaps in place Detail of a key cap 1 48...
Страница 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...