COMP-205 / Homework 2 / Problem #3
Four Lines Intersecting at a Common Point
Kenny Hoff
1/27/97
The given algorithm:
The algorithm's assymetry:
From a given example, the algorithm was shown to give different results (intersecting or nonintersecting) depending on which two lines were chosen first (for finding P). Why does this happen? We will attempt to show by geometric example.
Basically, the problem arises from the inconsistency of the valid intersecting region formed from the remaining two lines given different relative orientations. This region is the area in which the point P must lie in order to be close enough to both lines to be considered intersecting. As shown in the figures below, we can graphically show the valid region for a single line by increasing the line's width about its center +/-E (so the line's width is 2E). If P lies on this thick line then it's distance must be less than E (ok, it could be EQUAL to E, but this will still illustrate the point). The intersection of the two thick lines will form the valid intersecting region where a point P in this area will be within distance E of both lines.



The main problem with this inconsistency is that the maximum allowable error from the true intersection point (at the center of the dark regions) increases as the lines become more parallel to each other. Given this, there is no way for there to be symmetry in this algorithm. First of all, the point P is considered to be calculated quite precisely (up to 14 or 15 digits), but the intersection test between P and the remaining lines can be considered intersecting as long as it lies anywhere in the valid intersecting region; however, this region changes based on how parallel those lines are to each other!
Consider the following sets of four lines. The two blue lines have the same intersection point in both images, and so do the red and green lines; however, in the left image they would not be considered to intersection, but in the right image they would NOT because the intersection points moved, but because of the orientation of the red and green lines!


Breaking the assymetry
There are several ways we can modify the algorithm so that it will give the same results regardless of the order of processing the lines. We will suggest only one (without using the distance-from-pt-to-line test):
It may be possible to simplify this algorithm significantly. Perhaps we need only find the following intersection points: between 1 and 2, 2 and 3, and 3 and 4. If these three points are within distance E of each other, then they intersect.
Or perhaps we can do it with only two intersection calculations and one distance test: find intersection between 1 and 2 and between 3 and 4; if these points are within distance E of each other, they intersect.