Efficient maths algorithm to calculate intersections
Most of the answers already here seem to follow the general idea that: find the intersection of two straight lines passing the given points. determine if the intersection belong to both line segments. But when intersection does not occur often, a better way probably is to reverse these steps: express the straight lines in the … Read more