(y-ya)/(yb-ya)
→
u
(
1
-t)*(
1
-u)*zaa+t*(
1
-u)*zba+t*u*zbb+(
1
-t)*u*zab
EndFunc
Note that the variable names have been changed to avoid conflict with built-in variables. The
equivalence is
xa == x
1
ya == y
1
zaa == z
1
zab == z
2
xb == x
2
yb == y
2
zba == z
3
zbb == z
4
The z-variables are named so it is easy to remember which z-variable goes with a particular (x,y) data
point. The second two characters of each z-variable indicate the corresponding x- and y-variables:
zaa = f(xa,ya)
zab = f(xa,yb)
zba = f(xb,ya)
zbb = f(xb,yb)
As an example, given this data:
zbb = 0.5394
zba = 0.5534
xb = 0.6
zab = 0.4580
zaa = 0.4699
xa = 0.5
yb = 0.3
ya = 0.2
to interpolate for x = 0.52 and y = 0.28, the call is
bilinint(.5,.6,.2,.3,.4699,.4580,.5534,.5394,.58,.28)
which returns 0.4767.
This program, bilinui(), provides a user interface for the interpolation function.
bilinui()
Prgm
©User interface for bilinint()
©8oct00 [email protected]
local z
if gettype(x
1
)="NONE" then
0
→
xa:2
→
xb:0
→
ya:2
→
yb
0
→
zaa:
1→
zab:2
→
zba:3
→
zbb
1→
x:
1→
y
endif
lbl l
1
string(xa)
→
xa:string(xb)
→
xb
string(ya)
→
ya:string(yb)
→
yb
string(zaa)
→
zaa:string(zab)
→
zab
string(zba)
→
zba:string(zbb)
→
zbb
dialog
title "bilinui"
request "x
1
",xa
request "x2",xb
6 - 46
Содержание 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...