# line segment intersection

Do these two line segments intersect ?

I'm confused because if you extend the below line then they will intersect otherwise not but we can't extend them as they are line segments.

Is line segment intersection is different from intersection of lines ?

• No, the line segments do not intersect. – Robert Israel Apr 24 '14 at 7:38
• Keep in mind, a line segment is a set in and of itself. You can "extend" a line segment to a line, but they are different sets: the line has more points. So it makes sense that the two smaller sets (the line segments) might be disjoint even when the two larger sets (the lines) might not be disjoint. – Lee Mosher Apr 24 '14 at 13:18

Since you received Willemien's answer, let us consider the problem from an algebraic point of view.

Let us note $(x_1,y_1)$ and $(x_2,y_2)$ the coordinates of the two points limiting the first segment and $(x_3,y_3)$ and $(x_4,y_4)$ the coordinates of the two points limiting the second segment. So, the equations of the first and second lines are respectively $$y=\frac{ {y_1}-{y_2}}{{x_1}-{x_2}}x+\frac{{x_1} {y_2}-{x_2} {y_1}}{{x_1}-{x_2}}$$ $$y=\frac{ {y_3}-{y_4}}{{x_3}-{x_4}}x+\frac{{x_3} {y_4}-{x_4} {y_3}}{{x_3}-{x_4}}$$ Assuming that they are not parallel, these two lines intersect at a point $x_*$ such that $$x_*=\frac{{x_1} ({x_3} ({y_2}-{y_4})+{x_4} ({y_3}-{y_2}))+{x_2} ({x_3} ({y_4}-{y_1})+{x_4} ({y_1}-{y_3}))}{({x_1}-{x_2}) ({y_3}-{y_4})+({x_4}-{x_3}) ({y_1}-{y_2})}$$ and this value must be such that $x_1 \leq x_* \leq x_2$ and $x_3 \leq x_* \leq x_4$ in order the segments intercept.

• Does the y cordinate of the intersection point matter? Or this is enough? – VLAS Aug 24 '14 at 7:22
• This is sufficient (I hope !). Cheers :-) – Claude Leibovici Aug 24 '14 at 7:33

Is line segment intersection is different from intersection of lines ?

in one way they are the same, in another way they are different.

1- They are the same that an intersection is a point, and if that intersection point exist then the "things" intersect, if that point doesn't exist then they don't intersect. (that should be clear isn't it)

2- They differ that segments don't have to intersect if the extensions do intersect (because the intersection point is outside the two segments, for lines not to intersect they have to be parallel (or asymtopic) , segment can be non intersecting just because they don't .

Maybe best is only to remember 1,

2 is just a bit of background theory.

Hopes this helps