Monday, September 28, 2009
Drawing a circle in polar coordinates
// just type here
// and click "submit" when done
int frameCount = 0;
void setup(){
background(0);
size(600,600);
fill(125,125,125);
noStroke();
}
void draw() {
frameCount++;
int x = sin(frameCount)* width/4;
int y = cos(frameCount)* height/4;
translate(width/2,height/2);
ellipse(x,y,2,2);
}
// and click "submit" when done
int frameCount = 0;
void setup(){
background(0);
size(600,600);
fill(125,125,125);
noStroke();
}
void draw() {
frameCount++;
int x = sin(frameCount)* width/4;
int y = cos(frameCount)* height/4;
translate(width/2,height/2);
ellipse(x,y,2,2);
}
info
submitted by: DARYL_Gammaviews:
What's interesting about this sketch is how hackable it is. You can mess with the expression to calculate x and y a bit, and interesting stuff always come out.
comments
loading...
Add a comment: