Labels

Thursday, 1 August 2013

My sine example


float angle = 0;

void setup() {
   size(500, 500);
   background(0);

}

void draw() {
   background(0);
   float x =map(sin(angle), -1,1,100,400);
   float y = map(sin(angle), -1,1,250,height/2);
 
   ellipse(x,y,50,50);
 
   angle = angle + 0.10;
}

No comments:

Post a Comment