summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/math.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/chickadee/math.scm b/chickadee/math.scm
index adb7d8b..e9ebc6d 100644
--- a/chickadee/math.scm
+++ b/chickadee/math.scm
@@ -21,7 +21,8 @@
square
clamp
min
- max)
+ max
+ lerp)
#:replace (min max))
(define pi 3.14159265358979323846)
@@ -55,3 +56,7 @@ actually less than MAX."
((_ a b ...)
(let ((m (max b ...)))
(if (> a m) a m)))))
+
+(define-inlinable (lerp start end alpha)
+ (+ (* start (- 1.0 alpha))
+ (* end alpha)))