diff options
| author | jules <jules@okfoc.us> | 2014-02-18 08:48:42 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-02-18 08:48:42 -0500 |
| commit | 18f76b826e050a9d353cb8d35eb6c68c9bf23480 (patch) | |
| tree | 43e119404c10c34adf6cefbf20981f371ab5a113 | |
| parent | f2e65b33288a249e2c2a8a9677701b634d15f1bc (diff) | |
norm
| -rw-r--r-- | js/util.js | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -14,6 +14,7 @@ var PI = Math.PI var PHI = (1+Math.sqrt(5))/2 var TWO_PI = PI*2 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 } function mix(n,a,b){ return a*(1-n)+b*n } function ceil(n){ return Math.ceil(n) } |
