Skip to content

Instantly share code, notes, and snippets.

@takawo
Created October 20, 2015 07:25
Show Gist options
  • Save takawo/f5fef83e810750c07bfe to your computer and use it in GitHub Desktop.
Save takawo/f5fef83e810750c07bfe to your computer and use it in GitHub Desktop.
float cx,cy;
float r = 150;
float a = 0;
float d = 10;
float t = 0;
void setup(){
size(500,500);
colorMode(HSB,360,100,100);
background(0,0,100);
cx = width/2;
cy = height/2;
}
void draw(){
//background(255);
fill(240,60,100);
noStroke();
float x = width/2 + cos(radians(a))* r*map(sin(t),-1,1,1.0,1.2);
float y = width/2 + sin(radians(a))* r*map(sin(t),-1,1,1.0,1.2);
translate(x,y);
ellipse(0,0,d,d);
a++;
t += TWO_PI/20.0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment