Sunday, 27 November 2011

Weird Big Bang Trigonometry


Now I know how the universe began,mucking around with Trigonometry..suddenly stuff like this happens. It's the wicked atan() function..



void setup() {

size(500, 500);
background(0, 12);
smooth();
}

void draw() {

translate(width/2, height/2);

for (int i = 0;i<680;i++) {
stroke(random(55), random(55), random(255), 75);
point(cos(i)*frameCount%width, sin(i)*frameCount%height);

strokeWeight(1.2);
stroke(random(53), random(55), random(255), 120);
point(cos(i*atan(frameCount))*width, sin(i)*height);

stroke(random(253), random(55), random(255), 123);
line(tan(i*frameCount)*width, tan(i)*121, tan(i*frameCount)*height, tan(i)*120);
}
filter(BLUR);
filter(DILATE);
if (frameCount%width*55==0) {
setup();
}
}