Skip to content

Instantly share code, notes, and snippets.

@runemadsen
Created March 12, 2014 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runemadsen/9498138 to your computer and use it in GitHub Desktop.
Save runemadsen/9498138 to your computer and use it in GitHub Desktop.
void setup()
{
size(500, 500);
background(255);
smooth();
translate(0, 20);
for(int i = 20; i > 0; i--)
{
float ellipsey = i * 20;
// we add 10 to i to make the circles start small on top.
// then we divide i to make the variation in width a bit smaller
float varyWidth = cos((i / 3.8f) + 10);
float ellipseWidth = map(varyWidth, -1, 1, 20, 150);
float varyX = cos(i / 2.5f);
float ellipsex = (width/2) + map(varyX, 1, -1, -20, 20);
ellipse(ellipsex, ellipsey, ellipseWidth, 10 + (ellipseWidth/10));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment