Day 27 - Green Strings
A modification on yesterday’s sketch. Still trying to figure out what I can do with trigonometry without actually relearning trigonometry. I also totally cheated on today’s drawings, manipulating the sketch by commenting out various combinations of the shapes rather than coding in controls. Saving that for tomorrow!
Sketch:
Drawings:
Code:
function setup() { createCanvas(700, 700); fill(0); } function draw() { background(123, 156, 146); translate(width / 2, height / 2); var radius = width / 4; var angle = TAU / 100; r = random(0, 100); for (var i = 0; i <= r; i++) { var x = cos(angle * i) * radius; var y = sin(angle * i) * radius; line(100, 50, x, y); line(300, 300, x, y); line(-300, 50, x, y); line(-100, -300, x, y); noLoop(); } }