xxxxxxxxxx
30
function setup() {
createCanvas(400, 400);
background(0);
}
function draw() {
let x = width/2;
let y = height/2;
stroke(255);
strokeWeight(1);
point(x,y);
let v = p5.Vector.random2D();
v.mult(100);
let newx = x + v.x;
let newy = y + v.y;
//let newx = x + random(-100, 100);
//let newy = y + random(-100, 100);
line(x,y,newx,newy);
}