xxxxxxxxxx
25
let p1
let p2
let p3
let ang = 1 //de angle
let offset
let ree
function setup() {
createCanvas(400, 400);
p1 = createVector(200,100);
p2 = createVector(300,200);
p3 = createVector(100,200);
offset = createVector(p1.x,p1.y)
}
function draw() {
background(220);
ree = collidePointLineVector(p1.x,p1.y,0+offset.x,200+offset.y,0+offset.x,-200+offset.y,10)
point(p1.x,p1.y);
point(p2.x,p2.y);
point(p3.x,p3.y);
// rotate(0.5,p1)
// line(0+offset.x,200+offset.y,0+offset.x,-200+offset.y)
console.log(ree)
}
// hit = collidePointLineVector(mouse, p1, p2, buffer);