xxxxxxxxxx
19
// Based on Code by The Coding Train / Daniel Shiffman
// https://thecodingtrain.com/learning/nature-of-code/1.3-random-vector.html
function setup() {
createCanvas(250, 250);
strokeWeight(4);
stroke(255, 200);
}
function draw() {
background(10, 5);
translate(width / 2, height / 2);
v = p5.Vector.random2D();
console.log(`x: ${v.x} y: ${v.y}`)
v.mult(random(50, 100));
line(0, 0, v.x, v.y);
}