From f85814b15b6f6d0a80e0e15dc1d15e8c43147b99 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 16 Dec 2013 23:52:28 -0500 Subject: E, PI, PHI --- instructions.html | 8 ++++---- js/util.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/instructions.html b/instructions.html index f0c6800..435a9d9 100644 --- a/instructions.html +++ b/instructions.html @@ -20,10 +20,10 @@ mousex, mousey Math aliases floor, ceil, round, abs, sign pow, exp, sqrt -sin, cos, tan -asin, acos, atan, atan2 +cos, sin, tan +acos, asin, atan, atan2 random() -E, PI +E, PI, PHI convenience functions clamp(n,min,max) @@ -31,7 +31,7 @@ lerp(n,a,b) mix(n,a,b) step(n,a,b) smoothstep(n,a,b) -sinp, cosp (mapped to [0,1]) +cosp, sinp (mapped to [0,1]) pixel(x,y) == 4*(y*w+h) rand(n), randint(n) choice(array) diff --git a/js/util.js b/js/util.js index e4c50dc..024476e 100644 --- a/js/util.js +++ b/js/util.js @@ -10,6 +10,7 @@ function trim(s){ return s.replace(/^\s+/,"").replace(/\s+$/,"") } var E = Math.E var PI = Math.PI +var PHI = (1+Math.sqrt(5))/2 function clamp(n,a,b){ return n