#75915 - 2003-07-16 08:07 PM
Linear Interpolation
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Playing around with the following code and get two results.
In Excel - 53 In KiXtart - 50
Here is the code: code:
CLS BREAK ON ;Y0 + (X - X0) * (Y1 - Y0) / (X1 - X0) ; x y ;X0 1 35 ;X 4 ;X1 7 62 ;What is Y?
$XO=1 $X=4 $X1=7 $Y0=35 $Y1=62
$INT=$Y0 + ($X - $X0) * ($Y1 - $Y0) / ($X1 - $X0) ?$INT
GET $
I have added parenthesis too and it does not change the result.
Thanks,
Kent
|
|
Top
|
|
|
|
#75917 - 2003-07-16 08:18 PM
Re: Linear Interpolation
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You seem to mixing "O" and "0" in your variable names.
$XO=1
35 + (4 - $X0) * (62 - 35) / (7 - $X0) [ 16. July 2003, 20:19: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#75920 - 2003-07-16 10:21 PM
Re: Linear Interpolation
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
CDBL = 48.5 Otherwise, 48.
Kent
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1680 anonymous users online.
|
|
|