Phyllotaxis_019

Rupert Russell

Ballarat, Australia

  • Available
    Products
    55
  • Artist
    Notes
  • Artwork Comments 1

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...
// https://raw.githubusercontent.com/CodingTrain/R...

int n = 200016;
float c = 8.5;
float start = 0;
float hu ;
float radius = 0;
int count = 0;
int oldCount = 0;

float rrr, ggg, bbb;
int x = 0;

void setup() {
size(1000, 1000);
// size(13500, 13500);
//frameRate(4);
background(0);
stroke(0);
strokeWeight(.5);
println(“Running”);
}

void draw() {
dot(x);
x +;
count +
;
}

void dot (int i) {
translate(width / 2, height / 2);
float a = i * radians(137.51);
float r = c * sqrt(i);
float x = r * cos(a);
float y = r * sin(a);

rrr = (count / 10) % 255;
ggg = (count / 10) % 255;
bbb = (count / 10) % 255;

if (count == oldCount + 13) {
fill(255, 0, 0);
oldCount = count;
println("x = " + x);
} else {
fill(rrr, ggg, bbb);
}

// println(rrr + " " + ggg + " " + bbb);

noStroke();

radius = 2 + log(i) * 2; // increase dot size as you move outwards
ellipse(x, y, radius, radius);

if (x > width * 0.7) {
println(“Saving phyllotaxis_022.png”);
save(“phyllotaxis_022.png”);
println(“SAVED phyllotaxis_022.png”);
exit();
}
}

Artwork Comments

  • Bunny Clarke
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