This lets you draw two line segments, calculates the line intersection point, and draws it in green if that point lies on both of your line segments, or in red if one or both segments would have to be longer to reach that point. Type 1 or 2 to choose which line to draw, then click and drag with the mouse to draw it. It also shows the "branch" variable, which tells you which part of the code calculated the point.
Wow, I was just digging through some of my old papers, and found a page of pseudo-code that I wrote for this in 1983.