High School Math is Difficult

I’ve spent a good deal of time today working on a project of mine and it’ve had a heck of a time writing a function that will tell me when two segments intersect each other. It’s tricker than you’d think; you have to deal with cases when the lines are vertical and then there’s other issues as well; it’s easy to do if you’re given a specific line, but generalizing this thing has proven rather difficult. It’s really kind of embarassing, since it seems like it should be an easy thing to do.

Update: Finally got it working, and it wasn’t easy. My god.

blog comments powered by Disqus