How can I test whether a line has a point that lies within (not on the edge of) a triangle. (All in 2D).
Currently I'm thinking I'll do this:
- Define the line, and each side of the triangle as Ax+By+C=0, and have an xrange.
- Check if the line intersects any of the lines of the triangle.
- If it does, check that this is NOT at the end of the line.
Is there a better way to do this?