Phyllotaxis_012

Rupert Russell

Ballarat, Australia

  • Available
    Products
    55
  • Artist
    Notes

Apparel

Cases & Skins

Wall Art

Home Decor

Accessories

Stationery

Artist's Description

// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/KWoJgHFYWxY
// Coding Challenge #30: Phyllotaxis
// http://algorithmicbotany.org/papers/abop/abop-c...

float n = 100000;
float c = 36;
float start = 0;
float hu ;
float radius;
int oldCount = 0;
int count = 0;

void setup() {

size(13500, 13500);
// size(1350, 1350 );
colorMode(HSB, 360, 255, 255);
background(0);
stroke(0);
strokeWeight(2);
println(“Running”);
}

// https://raw.githubusercontent.com/CodingTrain/R...

void draw() {
noLoop();
translate(width / 2, height / 2);
for (int i = 0; i < n; i++) {
float a = i * radians(91.5);
float r = c * sqrt(i);
float x = r * cos(a);
float y = r * sin(a);
hu = i/90.0 % 255; // change the colour as you move out
fill(hu, 255, 255);
// println("hu = " + hu);
// noStroke();

radius = 20 + log(i) * 100;
println("radius = " + radius);

ellipse(x, y, radius, radius);

if (count == oldCount + 1500) {
println(“* Saving Phyllotaxis-19-” + i + “.png”);
// save(“Phyllotaxis-19-” + i + “.png”);
println(“saved”);
oldCount = count;
}

count ++;
}
println(“Saving Phyllotaxis-19-” + n + “.png”);
save(“Phyllotaxis-19-” + n + “.png”);
println(“saved”);
exit();
}

desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait
desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait