Skip to content

Instantly share code, notes, and snippets.

@mutterer
Last active October 2, 2017 04:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mutterer/887e0521057e9d41dbbd7651545fde7d to your computer and use it in GitHub Desktop.
Save mutterer/887e0521057e9d41dbbd7651545fde7d to your computer and use it in GitHub Desktop.
// 10PRINT rosette Processing 3 code, thanks to @shiffman !
// 10PRINT rosette Processing 3 code
// thanks to @shiffman !
float r=20;
float s=10;
void setup() {
size(300, 300);
frameRate(1);
}
void draw() {
background(72, 58, 170);
translate (width/2, height/2);
scale (1, -1);
strokeWeight(1.5);
stroke (134, 122, 222);
for (int i=0; i<60; i++) {
for (int j=0; j<10; j++) {
stroke (134, 122, 222, 255-15*j);
float d = (random(1)>0.5)?-1:1;
float a = (i-d/2)*2*PI/60;
float b = (i+d/2)*2*PI/60;
line ((r+j*s)*sin(a),(r+j*s)*cos(a),
(r+(j+1)*s)*sin(b),(r+(j+1)*s)*cos(b));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment