From e8fce3352e6fbb0eb6949bf63f1d3a3b6c5eb8f6 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 21 Feb 2014 17:40:03 -0500 Subject: fix sqrt --- js/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/util.js b/js/util.js index 66d5757..218b845 100644 --- a/js/util.js +++ b/js/util.js @@ -29,7 +29,7 @@ function pow(n,b) { return Math.pow(n,b) } function exp(n) { return Math.exp(n) } function log(n){ return Math.log(n) } function ln(n){ return Math.log(n)/LN10 } -function sqrt(n) { return Math.sqrt(n,b) } +function sqrt(n) { return Math.sqrt(n) } function cos(n){ return Math.cos(n) } function sin(n){ return Math.sin(n) } function tan(n){ return Math.tan(n) } @@ -70,8 +70,9 @@ function step(a, b){ // ^^ bool -> int } + function julestep (a,b,n) { - return clamp((n - a) / (b - a), 0.0, 1.0); + return clamp(norm(n,a,b), 0.0, 1.0); } // hermite curve apparently -- cgit v1.2.3-70-g09d2