xxxxxxxxxx
24
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
translate(width/2, height/2);
let pos = createVector(mouseX-width/2,mouseY-height/2);
strokeWeight(1);
stroke(255,0,0);
line(0,0, pos.x, pos.y);
pos.normalize();
pos.mult(100);
strokeWeight(4);
stroke(0);
line(0,0, pos.x, pos.y);
}