How many triangles in picture

How many triangles in this picture:

-
I only count 40...and unless someone can explain me how this is a mathematics question I think I'm going to vote to close it as off-topic –  DonAntonio Jun 26 '13 at 9:16
I do not think one needs mathematics to solve the puzzle. –  Avitus Jun 26 '13 at 9:18
@DonAntonio: A systematic approach of the kind that’s second nature to most mathematicians works quite nicely and can even be generalized to larger diagrams of the same type. It’s certainly on-topic. –  Brian M. Scott Jun 26 '13 at 9:20
That sounds sound, Brian. Not closing, then. Thanks. –  DonAntonio Jun 26 '13 at 9:23

They can be counted quite easily by systematic brute force.

All of the triangles are isosceles right triangles; I’ll call the vertex opposite the hypotenuse the peak of the triangle. There are two kinds of triangles:

1. triangles whose hypotenuse lies along one side of the square;
2. triangles whose legs both lie along sides of the square and whose peaks are at the corners of the square.

The triangles of the second type are easy to count: each corner is the peak of $4$ triangles, so there are $4\cdot4=16$ such triangles.

The triangles of the first type are almost as easy to count. I’ll count those whose hypotenuses lie along the bottom edge of the square and then multiply that by $4$. Such a triangle must have a hypotenuse of length $1,2,3$, or $4$. There $4$ with hypotenuse of length $1$, $3$ with hypotenuse of length $2$, $2$ with hypotenuse of length $3$, and one with hypotenuse of length $4$, for a total of $10$ triangles whose hyponenuses lie along the base of the square. Multiply by $4$ to account for all $4$ sides, and you get $40$ triangles of the second type and $40+16=56$ triangles altogether.

Added: This approach generalizes quite nicely to larger squares: the corresponding diagram with a square of side $n$ will have $4n$ triangles of the first type and $$4\sum_{k=1}^nk=4\cdot\frac12n(n+1)=2n(n+1)$$

of the second type, for a total of $2n^2+6n=2n(n+3)$ triangles.

-

I know there's already an excellent answer from Brian M. Scott... Buuuuut...

Here's a visual supplement to the aforementioned systematic brute force.

-
Pretty! $\quad$ –  Brian M. Scott Jun 27 '13 at 9:23