How to test for two segments intersecting, excluding their endpoints?

131 Views Asked by At

Given two segments, for example

S1=(2,1)-(2,3)
S2=(7,8)-(2,3)

the intersection test would be false.

However, if I use the cross-products test the result is true. I understand the two segments have a point in common but is there a way to exclude those endpoints from the test?

1

There are 1 best solutions below

3
On

Clearly they intersect at (2,3) . Run a dry run by co-ordinate geometry. :)