diff options
| author | jules <jules@okfoc.us> | 2013-12-17 12:05:46 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2013-12-17 12:05:46 -0500 |
| commit | 1cf341496d20276fac099450942112f2bec269ce (patch) | |
| tree | c188dc75326ed95a17aa86d28b3732ac6137aeec /js | |
| parent | f4eee2184b439c4e60edd3215441a212bf2bae58 (diff) | |
avg, show fps
Diffstat (limited to 'js')
| -rw-r--r-- | js/util.js | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -51,6 +51,7 @@ function rgbpixel(d,x,y){ function mod(n,m){ return 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 } function step (n,a,b) { return clamp((n - a) / (b - a), 0.0, 1.0); |
