xxxxxxxxxx
21
let x = 0;
function setup() {
createCanvas(800, 500);
fill(255);
stroke(100);
}
function draw() {
noStroke();
freq = frameCount * 0.02;
let tanVal = map(tan(freq), -1, 1, -100, 100);
colors = map(tanVal,-1, 1, 0, 255)
fill(colors)
x = frameCount;
ellipse(x, height/2+tanVal, 30, 50);
}