Skip to content

Instantly share code, notes, and snippets.

@cangevine
Created May 5, 2014 16:22
Show Gist options
  • Save cangevine/79a53c9c5a88b0c9d442 to your computer and use it in GitHub Desktop.
Save cangevine/79a53c9c5a88b0c9d442 to your computer and use it in GitHub Desktop.
void setup() {
size(500, 500);
}
void draw() {
background(255);
float period = 50;
float amplitude = 200;
float x = amplitude * cos(TWO_PI * frameCount / period);
translate(width/2, height/2);
line(0, 0, x, 0);
ellipse(x, 0, 20, 20);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment