xxxxxxxxxx
let step = Math.floor(Math.random()*1000);
let sketchSize = 800;
numSteps = 512
let stepSize = Math.PI / numSteps;
function setup() {
createCanvas(sketchSize, sketchSize);
background(0);
colorMode(HSB)
pixelDensity(1);
}
function draw() {
step++
fill(0x00,0x80)
rect(0,0,sketchSize, sketchSize)
centerPoint = sketchSize / 2;
for (i = 0; i <= TWO_PI - stepSize ; i += stepSize) {
stroke((step/4 + i*35)%360,100,100)
line(
//I encourage you to change these values inside Sin/cos. I tried i*i, 2*i , 5*i, some of thema are quite good!
sin(2 * i ) * sketchSize + centerPoint,
cos(i ) * sketchSize + centerPoint,
//the numbers below are chosen because they are prime numbers and so this should delay repetition for as long as possible.
sin(2 * i + step / (numSteps / 2753 * 1000)) * sketchSize / 4 + centerPoint,
cos(i + step / (numSteps / 39439 * 10000)) * sketchSize / 2 + centerPoint)
}
}