summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-02-21 17:40:03 -0500
committerjules <jules@okfoc.us>2014-02-21 17:40:03 -0500
commite8fce3352e6fbb0eb6949bf63f1d3a3b6c5eb8f6 (patch)
treea162b68c764eeece2ec4ae36496aaf1b8ce5b327
parentf88469c4f1ba3162a745ba549eae8937dc360d45 (diff)
fix sqrt
-rw-r--r--js/util.js5
1 files changed, 3 insertions, 2 deletions
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