0
$\begingroup$

Does this question have a solution? I think it's impossible to know if line segments P1Q1 and P2Q2 intersect at all with just the information about their end points Q1 and Q2.

Thanks.

$\endgroup$
  • $\begingroup$ The co-ordinates of only their end points are known (I guess this is not the terminology that is used in math, but that's what I meant). So we know only the co-ordinates of Q1 and Q2. $\endgroup$ – theprogrammer Mar 3 '16 at 8:37
0
$\begingroup$

the x ranges of the two segments as well as the y ranges must intersect.

$\endgroup$
  • $\begingroup$ Your statement is true but is far from a complete answer. Can you give requirements that are both necessary and sufficient? $\endgroup$ – Rory Daulton Mar 2 '16 at 9:20
  • $\begingroup$ See math.stackexchange.com/q/375083 $\endgroup$ – Jean Marie Mar 2 '16 at 9:36
0
$\begingroup$

The condition "if the $(x,y)$ coordinates of their end points is known" almost certainly means that the coordinates of all four end points is known, namely $P_1,Q_1,P_2,Q_2$. In the usual terminology, each line segment has two end points, not a start point and an end point.

So the question as stated definitely has a solution. I wrote a subroutine in Object Pascal to decide that very issue. Let me know if you need details.

If you only know the coordinates of two of the endpoints, then the question does not have a solution.

$\endgroup$
  • $\begingroup$ If all four points were known, then we would have 2 linear equations with 2 unknowns (I guess, I am rusty with my high school math), hence it would become a simple high school math homework problem. However I just wanted to know about what we could do, if only Q1 and Q2 were known to us. Thanks. $\endgroup$ – theprogrammer Mar 3 '16 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.