[Math] line segment intersection

geometry

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 ?

Best Answer

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.