Speak: – P5JS experimentation

function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}

function draw() {
background(220);
translate(width / 2, height / 2);
stroke(0);
strokeWeight(2);
noFill();

let numPetals = 10;
let angleStep = 360 / numPetals;

for (let i = 0; i < numPetals; i++) {
let x1 = 100 * cos(i * angleStep);
let y1 = 100 * sin(i * angleStep);
let x2 = 100 * cos((i + 5) * angleStep);
let y2 = 100 * sin((i + 5) * angleStep);

line(x1, y1, x2, y2);
push();
for (let j = 0; j < 12; j++) {
  rotate(30);
  line(x1, y1, x2, y2);
}
pop();

}
}

Leave a Reply

Your email address will not be published. Required fields are marked *