I can do this (see sketch) with lerp(), but it cannot be the best way. Using lerp() and starting at the desired angle, one would have to use tan(), then solve two equations before knowing what value to give lerp(). Then I would need to lengthen the line. All doable, but inelegant.
I am guessing the cross formula is the way to go, but I could see further if I stood on the shoulders of giants.
PVector a, b, c;
PVector middle;
float angle = 0.5;
float m;
void setup() {
size(400, 400, P3D);
a = new PVector(0, 0, 0);
b = new PVector(100, 100, 0);
c = new PVector(100, -100, 0);
m = PVector.dist(a, b);
}
void draw() {
background(255);
strokeWeight(1);
//noLoop();
//println(mouseX);
angle = 1-(mouseY/float(height));
translate(width/2, height/2); // move (0, 0, 0) to centre of window
stroke(0, 0, 0);
line(a.x, a.y, a.z, b.x, b.y, b.z);
line(a.x, a.y, a.z, c.x, c.y, c.z);
middle = PVector.lerp(b, c, angle);
middle.normalize();
middle.mult(m);
stroke(0, 0, 127);
line(a.x, a.y, a.z, middle.x, middle.y, middle.z);
pushMatrix(); // move (0, 0, 0) back to centre of window
translate(a.x, a.y, a.z);
noFill();
stroke(0);
sphere(4);
popMatrix();
pushMatrix();
translate(b.x, b.y, b.z);
noFill();
stroke(0);
sphere(4);
popMatrix();
pushMatrix();
translate(c.x, c.y, c.z);
noFill();
stroke(0);
sphere(4);
popMatrix();
pushMatrix();
translate(middle.x, middle.y, middle.z);
noFill();
stroke(127);
sphere(4);
popMatrix();
}