diff --git a/src/utility/lib/Functions.re b/src/utility/lib/Functions.re new file mode 100644 index 00000000..3cf4537a --- /dev/null +++ b/src/utility/lib/Functions.re @@ -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; +};