Two parallel line segments intersection

Posted by Judarkness on Stack Overflow See other posts from Stack Overflow or by Judarkness
Published on 2010-05-11T02:49:13Z Indexed on 2010/05/11 2:54 UTC
Read the original article Hit count: 226

Filed under:

I know there are many algorithms to verify whether two line segments are intersected.

But once they encountered parallel condition, they just tell the user a big "No" and
pretend there is no overlap, share end point, or end point collusion.

I know I can can calculate the distance between 2 lines segments.
If the distance is 0, check the end points located in the other line segments or not.
And this means I have to use a lot of if else and && || conditions.

This is not difficult, but my question is

"Is there a trick( or mathematics) method to calculate this special parallel case?"

© Stack Overflow or respective owner

Related posts about geometry