Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Intersection of line segments
Index -> Off Topic
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
RandomLetters




PostPosted: Sat Feb 11, 2012 11:35 pm   Post subject: Intersection of line segments

How can I find if two line segments intersect each other on a computer?
Sponsor
Sponsor
Sponsor
sponsor
mirhagk




PostPosted: Sun Feb 12, 2012 2:25 pm   Post subject: RE:Intersection of line segments

Have you done this in grade 9 math?
RandomLetters




PostPosted: Sun Feb 12, 2012 5:36 pm   Post subject: RE:Intersection of line segments

Ah, nevermind. My problem was that I couldn't use y = mx+b because one of the lines is vertical, but then I realized that this meant that the x coordinate would be known already.
mirhagk




PostPosted: Sun Feb 12, 2012 7:44 pm   Post subject: RE:Intersection of line segments

actually you could determine it using parametric lines, which is approximately 25% faster, but more complicated (however it works for all cases, including vertical lines)
Display posts from previous:   
   Index -> Off Topic
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: