summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorpepper <peppersclothescult@gmail.com>2014-01-19 18:16:53 -0800
committerpepper <peppersclothescult@gmail.com>2014-01-19 18:16:53 -0800
commit5301a264c8da39a9401ab9d619477e0ea2c83dc1 (patch)
tree4d458e4f20f72213549f12e000022cbd93e3f237 /js/util.js
parentf01087dbacca5640205cd2d8c6629b244a15ed74 (diff)
parent1e739b4df7e03cc94997e5b5b5c8180b0962e5ee (diff)
mergin'
Merge branch 'master' of ghghgh.us:/home/git/dither into pepper
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index 46943f9..7bb1c78 100644
--- a/js/util.js
+++ b/js/util.js
@@ -61,9 +61,13 @@ function step(a, b){
// ^^ bool -> int
}
+function julestep (a,b,n) {
+ return clamp((n - a) / (b - a), 0.0, 1.0);
+}
+
// hermite curve apparently
-function smoothstep(n,a,b){
- var t = clamp((n - a) / (b - a), 0.0, 1.0);
+function smoothstep(min,max,n){
+ var t = clamp((n - min) / (max - min), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t)
}