Skip to content

Instantly share code, notes, and snippets.

@raheelahmad
Created October 10, 2011 17:18
Show Gist options
  • Save raheelahmad/1275840 to your computer and use it in GitHub Desktop.
Save raheelahmad/1275840 to your computer and use it in GitHub Desktop.
Circle Drawer
class CircleDraw {
float x, y, r, a;
void drawSelf() {
fill(255);
noStroke();
ellipse(x + r * cos(a), y - r * sin (a), 5, 5);
a += 0.1;
if (a >= 2 * PI) {
background(100);
a = 0;
}
}
}
CircleDraw c;
void setup() {
size (400, 400);
c = new CircleDraw();
c.x = width / 2;
c.y = height / 2;
c.r = 100;
c.a = 0;
}
void draw() {
c.drawSelf();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment