From 7e8d0020004a438f298b9007bbaf71dbd062f6ae Mon Sep 17 00:00:00 2001 From: Yusof Bandar Date: Fri, 22 Feb 2019 23:12:03 +0000 Subject: [PATCH] Update mapNumRange.md --- mapNumRange.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mapNumRange.md b/mapNumRange.md index 46e40b5cc..5b90907e0 100644 --- a/mapNumRange.md +++ b/mapNumRange.md @@ -2,10 +2,9 @@ Maps a number from one range to another range. -Returns the mapped num from the in range to the out range. - +Returns `num` mapped between `out_min` to `out_max` from `in_min` to `in_max` ```js -const mapNumRange = (num, in_min, in_max, out_min, out_max) => {return (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;} +const distance = (num, in_min, in_max, out_min, out_max) => (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; ``` ```js