7 lines
284 B
ReasonML
7 lines
284 B
ReasonML
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;
|
|
}; |