Forked from volfegan/circlesTunnelPerfectSpiral.pde
Created
December 20, 2019 19:45
-
-
Save maxdevjs/b4b1b71b8d2beb2185069048dc705a8a 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
//reference code for solution of perfect Spiral: | |
//https://gist.github.com/chandeeland/b69156115e2b5842d83ca9eb3b2bbf2e | |
//failed trial:: https://gist.github.com/volfegan/e55decad6814e63fb450379c9bf13a61 | |
//attempt to recreate: https://twitter.com/Borrachas/status/1204855395006763009 | |
float a, b, x, y, d, h=600/2, r, s, shrink=0.94; | |
void setup() { | |
size(600, 600); | |
} | |
void draw() { | |
background(#EFF2D0); | |
translate(h, h); | |
for (s=600*2; s>1; s*=shrink) { | |
d=norm(s, 0, 600*2); | |
fill(0, (1-d)*20); | |
strokeWeight(d*15); | |
r = d*50*shrink; | |
x=cos((b*d*100*(1-shrink))+a)*r; | |
y=sin((b*d*100*(1-shrink))+a)*r; | |
circle(x, y, s); | |
b+=d; | |
} | |
a+=.1; | |
fill(0); | |
circle(cos(b+a)*5, 0, 40); | |
b=0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment