2020-02-21 13:54:39 +00:00
|
|
|
let interpolate =
|
|
|
|
(xMin: float, xMax: float, yMin: float, yMax: float, xIntended: float)
|
|
|
|
: float => {
|
|
|
|
let minProportion = (xMax -. xIntended) /. (xMax -. xMin);
|
|
|
|
let maxProportion = (xIntended -. xMin) /. (xMax -. xMin);
|
|
|
|
yMin *. minProportion +. yMax *. maxProportion;
|
2020-03-26 23:18:19 +00:00
|
|
|
};
|