diff options
| author | jules <jules@okfoc.us> | 2014-02-21 17:40:03 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-02-21 17:40:03 -0500 |
| commit | e8fce3352e6fbb0eb6949bf63f1d3a3b6c5eb8f6 (patch) | |
| tree | a162b68c764eeece2ec4ae36496aaf1b8ce5b327 /js | |
| parent | f88469c4f1ba3162a745ba549eae8937dc360d45 (diff) | |
fix sqrt
Diffstat (limited to 'js')
| -rw-r--r-- | js/util.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |
