The following diagram shows 9 distinct points chosen from the sides of a triangle.
$(1)$ How many line segments are there joining any two points on different sides?
$(2)$ How many triangles can be formed from these points?
I manage to solve $(1)$, by considering the following:
Fix one end of a line at the hypotenuse. Then it has $5$ choices for another end. Since there are $4$ points on hypotenuse, we have $5 \times 4$.
Fix one end of a line at the bottom length of the triangle. Then we have $2 + 2 + 2 = 6$ lines formed between bottom and left side of the triangle.
By the addition principle, we have $20+6=26$ lines formed.
But I don't know how to start $(2)$, as we can have two vertices of a triangle lie on the same side. This extra situation confuses me.
Answer to $(2)$ is $79$.