Created
March 12, 2014 01:02
-
-
Save josePhoenix/9498519 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
| color c = color(255, 204, 0); | |
| float rect_theta = 0.25; | |
| void setup() { | |
| size(300, 300); | |
| fill(c); | |
| } | |
| void draw() { | |
| for (float step = 0; step < TWO_PI; step += 0.01) { | |
| point(50*cos(step) + 150, 100*sin(step) + 150); | |
| } | |
| float x1 = 50 * cos(rect_theta), y1 = 100 * sin(rect_theta), | |
| x2 = 50 * cos(PI - rect_theta), y2 = 100 * sin(PI - rect_theta), | |
| x3 = 50 * cos(PI + rect_theta), y3 = 100 * sin(PI + rect_theta), | |
| x4 = 50 * cos(TWO_PI - rect_theta), y4 = 100 * sin(TWO_PI - rect_theta); | |
| //println("x1 "+x1+" y1 "+y1); | |
| //println("x2 "+x2+" y2 "+y2); | |
| //println("x3 "+x3+" y3 "+y3); | |
| //println("x4 "+x4+" y4 "+y4); | |
| rect(x3 + 150, y3 + 150, x1 - x3, y1 - y3); | |
| rect_theta += 0.01; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment