diff options
-rw-r--r-- | sly/math.scm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sly/math.scm b/sly/math.scm index c25e24d..1a5f2c6 100644 --- a/sly/math.scm +++ b/sly/math.scm @@ -92,8 +92,8 @@ actually less than MAX." ((> x max) max) (else x))) -(define (linear-scale min max a b val) - "Map a VAL in the range [MIN,MAX] to numbers in [A,B]" +(define (linear-scale min max a b n) + "Map a number N in the range [MIN,MAX] to the range [A,B]." (+ a - (/ (* (- b a) (- val min)) + (/ (* (- b a) (- n min)) (- max min)))) |