summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js
index 024476e..bbf8674 100644
--- a/js/util.js
+++ b/js/util.js
@@ -41,6 +41,7 @@ function choice(a){ return a[randint(a.length)] }
function deg(n){ return n*180/PI }
function rad(n){ return n*PI/180 }
function pixel(x,y){ return 4*(y*w+x) }
+function mod(n,m){ return n-(m * Math.floor(n/m)) }
function step (n,a,b) {
return clamp((n - a) / (b - a), 0.0, 1.0);