Skip to content

Instantly share code, notes, and snippets.

@volfegan
Last active December 17, 2019 23:44
Show Gist options
  • Save volfegan/e55decad6814e63fb450379c9bf13a61 to your computer and use it in GitHub Desktop.
Save volfegan/e55decad6814e63fb450379c9bf13a61 to your computer and use it in GitHub Desktop.
Circles in Circles moving to give the illusion of spirals
//visual output: https://twitter.com/VolfeganGeist/status/1205621889416208384
//reference code for some of the effects used: https://twitter.com/ky0ju_art/status/1175391601121611776
//attempt to recreate: https://twitter.com/Borrachas/status/1204855395006763009
float a, b, c=0, x, y, d, r=600*2, h=600/2, s=40;
void setup() {
size(600, 600);
}
void draw() {
background(#EFF2D0);
for (x=0; x<=r; x+=s*2) {
for (y=0; y<=r; y+=s*2) {
d=norm(dist(h, h, x, y), h, 0);
fill(0, d*20);
strokeWeight(abs(d*2));
b=cos(s+a)*((pow(1.0081,x)/y)+(x+y+log(abs(c)))/64);
c=sin(s+a)*(log(s*x+y)+(pow(1.0017, x)*x)/s);
circle(h+b, h+c, x);
a+=.1;
}
}
fill(0);
circle(h+cos(s+a)*s/8, h, s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment