| author | plurSKI <black.gavin@gmail.com> | 2012-01-22 16:47:24 (GMT) |
|---|---|---|
| committer | plurSKI <black.gavin@gmail.com> | 2012-01-22 16:47:24 (GMT) |
| commit | dbaa3bee7d6871cf5923098e02dcac5eb116e65e (patch) | |
| tree | f31b7ef9edf75e237b02ceb4b928d412b197a4e5 | |
| parent | 8beaba7a028fea95435520cb1ba19eea8968cba0 (diff) | |
| download | prettyGraph-master.zip prettyGraph-master.tar.gz | |
Cleaner processing versionmaster
| -rw-r--r-- | prettyGraph.pde | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/prettyGraph.pde b/prettyGraph.pde index b087ed5..0e4fdec 100644 --- a/prettyGraph.pde +++ b/prettyGraph.pde @@ -1,47 +1,23 @@ - - void setup() { size(1280, 720,P2D); } -float c = 0.000001; void draw() { - c = c*1.1; for(int x = 0; x <= width; x ++) { for(int y = 0; y <= height; y ++) - { -// float v = 500*cos(i)*cos(i) + 500*sin(j)*sin(j); -// float v = 100*sin(i*j); -// float v = 1000*sin(i) + 1000*sin(j); -// float v = 10*sqrt(10*x^2 + 10*y^2); + { + float v = 0; + if(y != height/2) v = x % (y - height/2); - - // Hyperbola - // float xp = x - (width/2); - // float yp = y - (height/2); - // float v = (xp*xp - yp*yp) / 1000; - // Circle - // float v = x*x + y*y; - // Line - float v = x + y; - // Sine - // float v = 30*sin(x) + y; - // Exponential - // float v = exp(0.006*x) + y; - // 2-Norm - // float v = 50*sqrt(x^2 + y^2); - // Mixed - //float v = 500*cos(x)*sin(y) + 50*tan((x + y)*2); - //float v= c*(100*y/(x + 1) + 100*x/(y + 1))*(y/(x + 1) + x/(y + 1)); - // float v = 10000*tan(x) + 100000*atan(y); int vp = floor(v); - stroke(vp%255, (vp*2)%255, (vp*3)%255); + stroke(vp%255, (vp*2)%255, (vp*4)%255); point(x,y); } - save("out.png"); } - + // Uncomment below lines to save a picture + // save("out.png"); + // exit(); } |
