xxxxxxxxxx
let x = 0.0;
let dotPosition = 0;
let circleScale = 40;
let speed = 3; // Higher is slower
let numberOfDots = 150;
function setup() {
createCanvas(800, 800);
strokeWeight(10);
}
function draw() {
background(200);
for (let i = 0; i < numberOfDots; i++) {
push();
translate(width/2, height/2);
rotate(radians(x)+i);
stroke(255-i, 0, 255);
point(i, sin(x/speed)*circleScale);
pop();
}
dotPosition++;
x += 0.1;
}