diff options
| author | jules <jules@okfoc.us> | 2014-02-19 23:23:19 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-02-19 23:23:19 -0500 |
| commit | f88469c4f1ba3162a745ba549eae8937dc360d45 (patch) | |
| tree | f5ec63f07d18f9a0fbbd4bdfc701a68483c1a94f /js/util.js | |
| parent | 18f76b826e050a9d353cb8d35eb6c68c9bf23480 (diff) | |
can't believe i forgot log
Diffstat (limited to 'js/util.js')
| -rw-r--r-- | js/util.js | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -13,6 +13,7 @@ var E = Math.E var PI = Math.PI var PHI = (1+Math.sqrt(5))/2 var TWO_PI = PI*2 +var LN10 = Math.LN10 function clamp(n,a,b){ return n<a?a:n<b?n:b } function norm(n,a,b){ return (n-a) / (b-a) } function lerp(n,a,b){ return (b-a)*n+a } @@ -26,6 +27,8 @@ function abs(n){ return Math.abs(n) } function sign(n){ return Math.abs(n)/n } 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 cos(n){ return Math.cos(n) } function sin(n){ return Math.sin(n) } |
