Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maxdevjs/b4b1b71b8d2beb2185069048dc705a8a to your computer and use it in GitHub Desktop.
Save maxdevjs/b4b1b71b8d2beb2185069048dc705a8a to your computer and use it in GitHub Desktop.
//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