randRange( 5, 7 )
180 * ( SIDES - 2 ) {}

What is the sum of this polygon's interior angles?

init({ range: [ [ -5, 5 ], [ -1, 5 ] ], scale: [ 40, 40 ] }); graph.polygon = new Polygon( SIDES ); graph.polygon.draw(); CLONE = graph.polygon.clone();
ANSWER \Large{^\circ}

There are a couple of ways to approach this problem.

Since this polygon has SIDES sides, we can draw SIDES triangles that all meet in the center.

graph.polygon.drawRadialDiagonals();

We can combine all the triangles' angles, and then we must subtract 360^{\circ} because the circle in the middle is extra.

There are 180^{\circ} in a triangle.

\begin{align*}&SIDES \times 180^{\circ} - 360^{\circ} \\ &= SIDES * 180^{\circ} - 360^{\circ} \\ &= ANSWER^{\circ}\end{align*}

An alternative approach is shown below.

We can use four of the cardinalThrough20( SIDES ) sides to make two triangles, as shown in orange.

init({ range: [ [ -5, 5 ], [ -1, 5 ] ] }); graph.polygon = CLONE; graph.polygon.draw(); graph.polygon.drawDiagonals( randRange( 0, SIDES - 1 ) );

There is one side between the orange triangles, to make one additional triangle.

There are SIDES - 4 sides between the orange triangles, to make SIDES - 4 additional triangles.

We chopped this polygon into SIDES - 2 triangles, and each triangle's angles sum to 180^{\circ}.

SIDES - 2 \times 180^{\circ} = ANSWER^{\circ}

The sum of the polygon's interior angles is ANSWER^{\circ}.

What is the sum of this polygon's exterior angles?

init({ range: [ [ -6, 6 ], [ -2, 7 ] ] }); graph.polygon = new Polygon( SIDES ); graph.polygon.draw();
360 \Large{^\circ}

The exterior angles are shown above.

graph.polygon.drawExteriorAngles();
graph.polygon.animateExteriorAngles( randRange( 0, SIDES - 1 ) );

The exterior angles fit together to form a circle.

Therefore, the sum of the exterior angles is 360^{\circ}.