Find correct corresponding point to extend line
0
$begingroup$
I tried this at stackoverflow but was told it's more of a geometry problem than programming. So here goes. I have two non parallel lines(XA and YB) which I need to extend to a curved line piece(PQ). The lines are made of arrays of (x,y) points. A is the last point in XA line and B is the last point in YB line. P and Q are the edge points of the curve. Now, I need to extend point A to P and point B to Q. Is there a way I can find the correct corresponding point of PQ curve so that A->P and B->Q and not A->Q and B->P, in the latter case the extended lines would intersect, that shouldn't happen. Previously I had tried a simple boolean, but it was incorrect. What I tried; if(abs(A.x() - P.x()) < abs(B.x() - P.x()) // extend A to P // extend B to Q else // e