Created
March 11, 2021 10:48
-
-
Save bogoreh/e173f5a9f8a4b5de8aab38108760a979 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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