Line Segment Intersection
Posted: Wed Dec 21, 2011 10:42 pm
Hi People that can do maths
Please help...
I need an line segment intersection routine, I have tried several and they either fail all the time, fail part of the time (ie. one line is vertical or horizontal) but generally do not succeed?
I am writing an application that allows the user to draw 2D planes of a shop front opening. For example there may be several planes at varying angles (these angles are of a limited range) but of course cannot intersect.....I just cannot get it to work other than get all the points from the 'new line' and check them against all the (plotted) points of the previous lines...this gets really too slow as we add more lines of course.....
I need a robust procedure that i send the coords of two lines and returns true or false on intersection!
Many many many thanks in advance!
Merry Christmas
Please help...
I need an line segment intersection routine, I have tried several and they either fail all the time, fail part of the time (ie. one line is vertical or horizontal) but generally do not succeed?
I am writing an application that allows the user to draw 2D planes of a shop front opening. For example there may be several planes at varying angles (these angles are of a limited range) but of course cannot intersect.....I just cannot get it to work other than get all the points from the 'new line' and check them against all the (plotted) points of the previous lines...this gets really too slow as we add more lines of course.....
I need a robust procedure that i send the coords of two lines and returns true or false on intersection!
Many many many thanks in advance!
Merry Christmas