xxxxxxxxxx
var center
function setup() {
createCanvas(800, 800);
colorMode(HSB,360,100,100,100)
background(0,0,100,100);
center = createVector(width / 2.0, height / 2.0);
frameRate(3)
}
function draw() {
let v = vogalPoint( floor( random(100) ) )
v.mult(30.0);
v.add(center);
noStroke()
fill(230 + random(60),20 + random(70) ,100,10);
triangle(0, height, v.x,v.y, width, height);
fill(240,0,100,100 * v.y / height);
ellipse(v.x, v.y, 10, 10);
}
function vogalPoint(n) {
let theta = 2.39996 * n;
let r = sqrt(n);
return createVector(r * sin(theta), r * cos(theta));
}