TITLE: Counting the number of triangles inside $3-4-5-$triangle [Found in Arabic Math book: الرياضيات | هندسة الإحداثيات | الإحصاء]
QUESTION [16 upvotes]: While reading a pdf Arabic math book, counting chapter, I found this question:


It says:
The points $(0,0),(0,3),(4,0)$ are jointed to each other. Also, the
  points:
$(0,1),(0,2),(0.8,2.4),(1,0),(1.6,1.8),(2,0),(2.4,1.2),(3,0),(3.2,0.6)$
  are jointed to each other and to the vertices of the $3-4-5-$triangle.
  What is the total number of triangle? (Note: All triangles must be
  considered).


I tried to use simple formulas of counting triangles in simple shapes, like the big triangle is divided by joining a straight line from a vertex to the opposite side, we just count the number of bases on the divided side, we apply the formula $N=n(n+1)/2$. Also for adjacent equilateral triangles we can use the formula $N=n(n+2)(2n+2)/8$ and then we round down, where $n$ is the number triangles on one side of the big one, .... and some other simple shapes. I tried to combine some of the together, but noway.
What I knew about the given points is to make fixed total number of triangles. Moving a point slightly may change the answer. THERE ARE SMALL TRIANGLES!

But this one is so complected, and without calculation, I think the total number of triangles is so large number. Maybe it is okay to keep the answer in a form containing factorials or $^aC_b$ or or $^aP_b$ such forms. I am not sure how to begin.
If the vertices of the triangles that to be counted lie on the boundaries of the $3-4-5-$triangle, then this is:
$$^{12}C_3-^6C_3-^5C_3-^4C_3=186$$
But this is not the case, the required is to find the total number of possible triangles in the figure. Note: listing the coordinates implies an interest in the tiny triangles. Also, note that: because of these particular given coordinates, we have some intersection points of $3$ lines, and some of only $2$ lines, resulting some tiny triangles to be considered.
EDIT:
Here is a big figure, I used desmos to make it:


Any help would be really appreciated. THANKS!

REPLY [3 votes]: In order to take an accurate census of the number of triangles inhabiting the $3-4-5$ Pythagorean triangle--an ancient city with three walls, twelve gates, and thirty-five gate-to-gate streets, as can be seen from OP's illustration,--I found it necessary to reconstruct the city one street at a time and count the successive generations of inhabitants as they appear along each new street.
I. Although easy enough at first, the need for a method soon became apparent. In triangle $ABC$, with $AB$, $AC$, $CB$ divided at $D$, $E$, $F$, $G$, $H$, $I$, $J$, $K$, $L$, joining segments $AI$, $AJ$, $AK$, $AL$ in succession produces two, three, four, and five new triangles. 
Next, joining $BG$, $BH$ produces twenty and twenty-five more triangles, which I determined by the following method.

With $BH$ the last line drawn, first count the three new triangles having $BH$ for a side: $ABH$, $GBH$, $CBH$. 
Then take $Q$, the point next most distant from $B$ and the intersection of $BH$ with $AI$. With those lines as analogous to axes in coordinate geometry, making quadrants $IQB$, $IQH$, $HQA$, $AQB$, count all triangles having the new point $Q$ for vertex, beginning with with the largest triangle in each quadrant and working inward toward $Q$. Thus in the first quadrant $IQB$ we have triangle $IQB$; in $IQH$, no triangle; in $HQA$, triangle $HQA$; in $AQB$, triangles $AQB$, $AQT$, $AQS$, $AQR$, $PQB$. 
Next, around point $R$ as vertex, in quadrants $JRB$, $JRH$, $HRA$, $ARB$ we find triangle $JRB$ in the first quadrant, none in the second, $HRA$ in the third ($QRA$ has already been counted), and $ARB$, $ART$, $ARS$, $ORB$ in the fourth. 
Similarly with $S$ as vertex we get triangles $KSB$; none; $HSA$ ($HRA$, $HQA$ have already been counted); and $ASB$, $AST$, $NSB$. 
Finally with $T$ as vertex we have triangles $LTB$; none; $HTA$; and $ATB$, $MTB$.
Summing up the new triangles:$$3+7+6+5+4=25$$
II. When $CD$, $CE$, $CF$ have been joined, as in the next figure, three-line concurrencies appear at points $O$ and $S$. Taking $CF$, the last line drawn, note that any triangles within sectors $KSB$, $KSH$, $HSA$, $ASB$ were already counted when $BH$ was joined. 
There is now, however, an octant of new sectors around $S$ to be examined for new triangles:$$CSB, CSK, CSH, CSA, BSF, KSF, HSF, ASF$$(There appear to be seventeen three-line concurrencies when all thirty-five lines have been drawn in triangle $ABC$, each requiring that we search for new triangles in eight sectors instead of four.)

As $CD$, $CE$, $CF$ are successively joined, I count thirty-five, forty-three, and forty-seven triangles generated. Thus with the original triangle, when all nine lines from vertices $A$, $B$, $C$, are joined in the above order, the number of triangles is$$1+2+3+4+5+20+25+35+43+47=185$$
Twenty-six lines remain to be joined.
III. The seven segments $GI$, $GJ$, $GK$, $GL$, $GF$, $GE$, $GD$ generate$$26+41+56+74+65+58+52=372$$new triangles, bringing the triangle population now to$$185+372=557$$Segment $GJ$ passes through $C'$, making a third three-line concurrency as seen in the next figure.

IV. The next seven segments $HI$, $HJ$, $HK$, $HL$, $HF$, $HE$, $HD$ generate$$24+43+70+102+133+139+148=659$$more triangles, bringing the count to $$557+659=1216$$Segment $HE$ brings in a fourth and fifth three-line concurrency, and $HD$ a sixth. I leave the figure unlettered except for the points of 3-line concurrency.

V. The remaining twelve segments$$DI, DJ, DK, DL, EI, EJ, EK, EL, FI, FJ, FK, FL$$make$$16, 12, 11, 8, 14, 12, 8, 4, 16, 12, 6, 2$$intersections, respectively, within triangle $ABC$, each intersection a center of four (or eight) sectors to be searched for additional triangles. By using, for each new line drawn, the method explained above, I count$$232+186+155+117+239+188+139+89+249+183+117+62=1956$$new triangles, for a total of$$1216+1956=3172$$within the $3-4-5$ triangle. 
I have indicated the order in which I have drawn the lines, and the number of new triangles I found for each line. I could in more detail also give the number of new triangles for each intersection point on a given line, as well as for each of the four (or eight sectors) around that point, in order to compare notes with anyone interested in this search of the Pythagorean triangle. I think this is a reliable way to find the number of triangles in the $3-4-5$ triangle, and to guard against leaving out any triangle or counting any triangle twice. It's laborious, but I don't see how combinatorial theory alone can yield an answer; the seventeen three-line concurrencies affect the count, and they arise from the geometry of the case being considered. But to proceed by counting, intersection points must be labeled, and things get very crowded and confusing to the eye, since the number of intersections generally increases as more lines are drawn. I relied greatly on GeoGebra's capacity to zoom in, and even to temporarily hide labels when they get too crowded. The figure below shows seventeen points of three-line concurrency.