Skip to content

Instantly share code, notes, and snippets.

@bogoreh
Created March 11, 2021 10:48
Show Gist options
  • Select an option

  • Save bogoreh/e173f5a9f8a4b5de8aab38108760a979 to your computer and use it in GitHub Desktop.

Select an option

Save bogoreh/e173f5a9f8a4b5de8aab38108760a979 to your computer and use it in GitHub Desktop.
//defining variables
var r = 0;
var theta = 0;
draw = function() {
pushMatrix();
translate(width/2, height/2);
//switching the type of coordinate
var x = r * cos(theta);
var y = r * sin(theta);
fill(0, 0, 0);
ellipse(x, y, 10, 10);
popMatrix();
//increasing the angle
theta += 1;
//increasing radius of circle being drawn
r += 0.1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment