diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-03-22 11:36:16 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-03-22 11:36:16 -0400 |
| commit | 858587af95cfd02341cee1ec1f63c560f6944145 (patch) | |
| tree | 165b968c7fe9df5d49c07e4ce3b9493faf1cacd5 /js/util.js | |
| parent | 99795bd1552a481dcb8f23e010e836ef06856447 (diff) | |
use modi
Diffstat (limited to 'js/util.js')
| -rw-r--r-- | js/util.js | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -52,6 +52,7 @@ function deg(n){ return n*180/PI } function rad(n){ return n*PI/180 } function xor(a,b){ a=!!a; b=!!b; return (a||b) && !(a&&b) } function mod(n,m){ return n-(m * floor(n/m)) } +function modi(n,m){ return floor(n-(m * floor(n/m))) } function dist(x0,y0,x1,y1){ return sqrt(pow(x1-x0,2)+pow(y1-y0,2)) } function angle(x0,y0,x1,y1){ return atan2(y1-y0,x1-x0) } function avg(m,n,a){ return (m*(a-1)+n)/a } |
