Define objects with a few attributes necessary for pattern matching.
Define List of lines with intersection points defined on them.
Find lines which intersect with two other lines, which in turn intersect with each other. The intersection points are the vertices of a triangle. This is rather slow, since it matches more than it needs to, and thus creates duplicate triangle elements, which are removed with Union.
Converted by Mathematica (January 20, 2005)