xxxxxxxxxx
28
let angleUD, angleLR;
function setup() {
createCanvas(560, 492);
angleMode(DEGREES);
rectMode(CENTER);
}
function draw() {
background(20, 30);
stroke(255);
strokeWeight(1)
angleUD = map(millis(), 0, 2000, 0, 180);
angleLR = map(millis(), 0, 2000, 90, 270);
line(mouseX, height/2, width/2, constrain(height * sin(angleUD), 0, height));
line(mouseX, height/2, width/2, constrain(height * sin(angleUD), 0, height));
line(width/2, mouseY, constrain(width * cos(angleLR), 0, width), height/2);
line(width/2, mouseY, constrain(width * cos(angleLR), 0, width), height/2);
noFill();
// push();
// translate(width/2, height/2);
// rotate(45);
line(0, height/2, width/2, 0);
line(0, height/2, width/2, height);
line(width/2, 0, width, height/2);
line(width/2, height, width, height/2);
// rect(0, 0, sqrt(sq(width/2) * 2), sqrt(sq(width/2) * 2));
// pop();
}