summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorpepper <peppersclothescult@gmail.com>2014-01-13 22:40:43 -0800
committerpepper <peppersclothescult@gmail.com>2014-01-13 22:40:43 -0800
commitf01087dbacca5640205cd2d8c6629b244a15ed74 (patch)
treee641eeea6ee1d7844b2fa07311d4b0f8e2399147 /js/util.js
parent2263ec93f393c0eaae4df31f0ef3ff2eb99f73e2 (diff)
parent5242f387995b6251ff1bf7902b3ac6428f381fb0 (diff)
mergin'
Merge branch 'master' of ghghgh.us:/home/git/dither into pepper
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index b728377..46943f9 100644
--- a/js/util.js
+++ b/js/util.js
@@ -56,9 +56,11 @@ 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);
+function step(a, b){
+ return (b >= a) + 0
+ // ^^ bool -> int
}
+
// hermite curve apparently
function smoothstep(n,a,b){
var t = clamp((n - a) / (b - a), 0.0, 1.0);