Why sum of interior angles in convex polygon is $(n-2)\cdot 180$

couple days ago in my math high school lessons I learned that sum of interior angles in convex polygon is:

$Z$ = sum of the angles, $n$ = number of sides in polygon

$Z=(n-2)\cdot 180$

Can someone help me understanding this formula, and why is it like this?


Here is a useful diagram:

enter image description here

The sum of all the angles in all the triangles equals the sum of the interior angles of the polygon. Notice that the shape has $7$ sides, and we are able to fit $5$ triangles inside it each of whose angles sum to $180$ degrees. This generalises to a $n$ sided polygon being able to fit $n-2$ triangles inside it as shown above. Then the sum of the angles must = $(n-2)*180$ degrees


One way to understand this is to look at the exterior angles in a traverse one way around the polygon - the exterior angle being the angle turned in passing each vertex. (For example, in a regular decagon, the exterior angle at each vertex is $36°$.) Clearly the sum of such angles $\{\epsilon_i\}$ is $360°$, since you arrive back on the starting edge having turned fully around the polygon. The interior angles $\{\theta_i\}$ are each $\theta_k=180°-\epsilon_k$, so you have $$\sum^n \theta_i = \sum^n (180°-\epsilon_i) = n\cdot180° - \sum^n \epsilon_i = n \cdot 180°-360° = (n-2)180°$$


diagram for clarity

enter image description here


Start with a triangle.

Choose an edge on the triangle and mark a point on it.

Now imagine pulling the point outwardly away from the edge.

What happens is the original triangle gains 2 more edges and there is an extra $180^{\circ} $ from the triangle formed by the original edge and the two new ones.

This has the advantage of explaining why there are $n-2$ less triangles as each triangle is paired with the $2$ parts of a broken edge.

If I get chance I'll add an animation or if someone wants to edit feel free. This can be extended to make the polygon grow.