0

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.

  • 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. – theprogrammer Mar 03 '16 at 08:37

2 Answers2

0

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

Adelafif
  • 1,275
0

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.

Rory Daulton
  • 32,288
  • 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. – theprogrammer Mar 03 '16 at 08:39