diff options
Diffstat (limited to 'src/modules/Util.js')
-rw-r--r-- | src/modules/Util.js | 20 |
1 files changed, 0 insertions, 20 deletions
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 }; |