Skip to content

Instantly share code, notes, and snippets.

@cangevine
Created May 6, 2014 14:51
Show Gist options
  • Save cangevine/983c6a59e50a1dd52570 to your computer and use it in GitHub Desktop.
Save cangevine/983c6a59e50a1dd52570 to your computer and use it in GitHub Desktop.
float startAngle;
float angleVel;
float amp;
void setup() {
startAngle = 0;
angleVel = 0.4;
amp = 100;
size(500, 500);
}
void draw() {
background(255);
float angle = startAngle;
for (int x = 0; x < width; x += 25) {
float y = amp * sin(angle);
ellipse(x, y + height/2, 25, 25);
angle += angleVel;
}
startAngle += 0.04;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment