xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
rectMode(CENTER);
}
function draw() {
//background(0);
// jump to the center of the sketch
translate(width/2, height/2);
//mapping of sin over time (-1 , +1) to (-200, 200)
//speed is defined by /1000
let s = map(sin(millis()/1500), -1, 1, -200, 250);
let sc = map(cos(millis()/1500), -1, 1, -200, 250);
//mapping of sin over time to an angle 0-PI
let r = map(sin(millis()/1500), -5, 10, 50, PI);
let c = map(sin(millis()/1000), -1, 1, 0, 50);
let w = map(sin(millis()/1000), -1, 1, 100, 250);
noFill();
stroke(255, c);
translate(s, sc);
translate(r);
rotate(r);
//strokeWeight(c);
rect(0, 0, w, w);
ellipse(0, 0, 100, 200);
}