|
-
Mar 16th, 2005, 01:49 PM
#1
Thread Starter
pathfinder
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:
- Test for parallelity, return False if parallel.
- If Not parallel, calc intersection points of the 2 lines. (Call it 5)
- 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
- Else return True.
Is there a more optimal strategy?
Last edited by NotLKH; Mar 17th, 2005 at 06:03 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|