Define objects with a few attributes necessary for pattern matching.
![SetAttributes[lineVector, {Flat, Orderless}] SetAttributes[lin, {Flat, Orderless, OneIdentity}] SetAttributes[tri, {Flat, Orderless}]](HTMLFiles2/index_1.gif)
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.
![]()
![{tri[p0, p1, p10], tri[p0, p1, p2], tri[p0, p1, p3], tri[p0, p1, p4], tri[p0, p1, p5], tri[p0, p1, p6], tri[p0, p1, p7], tri[p0, p1, p8], tri[p0, p1, p9], tri[p0, p10, p6], tri[p0, p10, p9], tri[p0, p2, p3], tri[p0, p2, p5], tri[p0, p3, p5], tri[p0, p4, p7], tri[p0, p4, p8], tri[p0, p6, p9], tri[p0, p7, p8], tri[p1, p10, p5], tri[p1, p10, p8], tri[p1, p2, p4], tri[p1, p2, p6], tri[p1, p3, p7], tri[p1, p3, p9], tri[p1, p4, p6], tri[p1, p5, p8], tri[p1, p7, p9]}](HTMLFiles2/index_4.gif)
![]()
Converted by Mathematica (January 20, 2005)