blog posts

databases (1) django (1) drupal (2) java (4) processing (7) wamp (1) yahoo pipes (1)

Tuesday, 8 February 2011

Growing ellipse

// this little program expands the size of an ellipse
int radius =10;
float speed=0.2;
// this sets the variable x to minus the radius 

float x = -radius;


void setup()
{
size(400,200); 
 
}

/* everytime the draw method is called

 the x variable is increased by speed 0.2


*/
void draw()
{
  x += speed;
  ellipse(20,20,x,x);

}

No comments:

Post a Comment

Popular Posts