A triangle is formed by 3 intersecting lines. A line has the equation y=mx+a where m is the gradient and a is the y-intercept. Two lines will always intersect one another provided that their gradients are different. Also, the y-intercept can be zero.
Let's take two lines y=mx and y=nx+a, and m≠n.
These intersect when mx=nx+a, (m-n)x=a, x=a/(m-n), so y=am/(n-n), which gives us the location of one vertex at:
(a/(m-n), am/(m-n)).
A third line y=px+b is needed to create two more angles. p≠m, p≠n.
This line intersects the other two lines when:
px+b=mx and px+b=nx+a.
So the other two vertices are (b/(m-p), bm/(m-p)) and ((a-b)/(p-n),n(a-b)/(p-n)+a).
n(a-b)/(p-n)+a=(na-nb+ap-na)/(p-n)=(ap-nb)/(p-n) making the vertex:
((a-b)/(p-n),(ap-nb)/(p-n)).
Note that if a=b, this vertex lies on the y-axis.
So we can create a triangle with three intersecting lines, but the sides of the triangle are finite line segments, while each line has infinite length. Provided none of the gradients are the same there will always be a triangle enclosed by the three intersections of the lines, but there is one exception: if the third line passes through the intersection of the other two, then the triangle becomes a point.
If (a/(m-n), am/(m-n)) lies on y=px+b, we have a point, not a triangle.
So that occurs when:
am/(m-n)=ap/(m-n)+b, am=ap+b(m-n), ap=am-bm-bn, p=m-bm/a-bn/a. So p≠m-(b/a)(m-n) is the condition that a triangle is formed.