230215_p5js_circle
code:js
let i = 0;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(240);
strokeWeight(2);
stroke(0);
noFill();
ellipseMode(CORNER);
const random = () => {
const num1 = noise(i / 100) * 100;
const num2 = noise(i / 100) * (100 - num1);
const num3 = noise(i / 100) * (100 - num1 - num2);
const num4 = 100 - num1 - num2 - num3;
};
const randomNum = random();
const randomNum2 = [
];
const sum = randomNum0 + randomNum1 + randomNum2 + randomNum3; console.log(randomNum, sum);
ellipse(0, 0, randomNum20, randomNum21); ellipse(randomNum20, 0, randomNum21, randomNum22); ellipse(randomNum20 + randomNum21, 0, randomNum22, randomNum23); ellipse(
randomNum20 + randomNum21 + randomNum22, 0,
);
//1230
ellipse(0, randomNum21, randomNum20, randomNum22); ellipse(0, randomNum21 + randomNum22, randomNum20, randomNum23); ellipse(
0,
randomNum21 + randomNum22 + randomNum23, );
//2301
ellipse(randomNum20, randomNum22, randomNum21, randomNum23); ellipse(
randomNum22 + randomNum23, );
ellipse(
randomNum22 + randomNum20 + randomNum23, );
//3012
ellipse(
randomNum20 + randomNum21, );
ellipse(
randomNum20 + randomNum21, randomNum23 + randomNum20, );
ellipse(
randomNum20 + randomNum21, randomNum23 + randomNum21 + randomNum20, );
//0123
ellipse(
randomNum20 + randomNum21 + randomNum22, );
ellipse(
randomNum20 + randomNum21 + randomNum22, randomNum20 + randomNum21, );
ellipse(
randomNum20 + randomNum21 + randomNum22, randomNum20 + randomNum21 + randomNum22, );
i++;
}