From 5efc7885e1c3959aa165be640858ffb3f8a5860b Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 31 May 2022 20:52:15 -0500 Subject: refactor: remove modules/ folder --- src/modules/Util.js | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/modules/Util.js (limited to 'src/modules/Util.js') diff --git a/src/modules/Util.js b/src/modules/Util.js deleted file mode 100644 index 165d1d0..0000000 --- a/src/modules/Util.js +++ /dev/null @@ -1,20 +0,0 @@ -function useAverage() { - var avg = 0; - let weight = 0; - const append = value => { - avg = (weight * avg) + value; - weight += 1; - avg = avg/weight; - } - - return [() => avg, append]; -} - -function clamp(value, min, max) { - return Math.min(Math.max(value, min), max); -} - -function lerp(a, b, alpha) { - return ((1-alpha)*a) + (alpha*b); -} -export { useAverage, clamp, lerp }; -- cgit v1.2.1