Results 1 to 6 of 6

Thread: Intersecting Line Segments

Threaded View

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Resolved Intersecting Line Segments

    I'm down to the final step of a progie of mine, just have to build an intersection test.


    Whats the best way to determine if 2 line segments intersect.

    I figure, given 2 line segments, 1-2, 3-4:

    1. Test for parallelity, return False if parallel.
    2. If Not parallel, calc intersection points of the 2 lines. (Call it 5)
    3. Return False if one or more of the following distance comparisons are true:

      • 5 to 1 > 1 to 2
      • 5 to 2 > 1 to 2
      • 5 to 3 > 3 to 4
      • 5 to 4 > 3 to 4
    4. Else return True.


    Is there a more optimal strategy?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width