This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,7 @@
|
||||
// LinearInterp: the value at X on the straight line through (X0, Y0) and
|
||||
// (X1, Y1). X may lie outside [X0, X1]: that is extrapolation, and the line
|
||||
// carries on. The REQUIRE names the difference the division divides by.
|
||||
FUNCTION LinearInterp(X0 : FLOAT, Y0 : FLOAT, X1 : FLOAT, Y1 : FLOAT, X : FLOAT) RETURNS FLOAT
|
||||
REQUIRE X1 - X0 != 0.0
|
||||
RETURN Y0 + (Y1 - Y0) * (X - X0) / (X1 - X0)
|
||||
ENDFUNCTION
|
||||
Reference in new issue
Block a user