This commit is contained in:
Roman Galochkin 2020-02-21 16:54:39 +03:00
parent fc66ac0082
commit 3de54bee23

View File

@ -0,0 +1,7 @@
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;
};