%% Linear interpolation By L.R.Linares, 2007 %% It receives two points (x1, y1) and (x2, y2) %% and the 'x' of a point for which we want to %% find the 'y'; I called this program 'XTOY' << "x1 x2 y1 y2 x" PROMPT -> x1 x2 y1 y2 x << '(y2-y1)/(x2-x1)*(x-x1)+y1' EVAL x1 x2 y1 y2 5 ROLL >> >> --------------------------------------------- %% This other program is similar, but goes from %% 'y' to 'x', I called it 'YTOX'. << "x1 x2 y1 y2 y" PROMPT -> x1 x2 y1 y2 y << '(x2-x1)/(y2-y1)*(y-y1)+x1' EVAL x1 x2 y1 y2 5 ROLL >> >>