Skip to main content

Endpoint vectors A and B, in 2d space. Third vector, C, might be somewhere between them. This is what we are checking for.:

If A+(B-A)*(Distance(A,C)/Distance(A,B))=C, then the line segments intersect.

if (A + (B - A) * (Distance(A, C) / Distance(A, B)) = C) // line segments intersect. 

Endpoint vectors A and B, in 2d space. Third vector, C, might be somewhere between them. This is what we are checking for.

If A+(B-A)*(Distance(A,C)/Distance(A,B))=C, then the line segments intersect.

Endpoint vectors A and B, in 2d space. Third vector, C, might be somewhere between them. This is what we are checking for:

if (A + (B - A) * (Distance(A, C) / Distance(A, B)) = C) // line segments intersect. 
Source Link
Ryan
  • 9
  • 1

Endpoint vectors A and B, in 2d space. Third vector, C, might be somewhere between them. This is what we are checking for.

If A+(B-A)*(Distance(A,C)/Distance(A,B))=C, then the line segments intersect.