Question 556823
<pre>
An n-sided polygon has n sides and n vertices.

Every diagonal and every side of the polygon is the line segment 
connecting a combination of two vertices.  

Every combination of 2 vertices uniquely represents either a side
or a diagonal. 

Derivation of the formula:

1. First we get the number of sides and diagonals by getting the
   number of combinations of n vertices taken 2 at a time:

   C(n,2) = {{{n(n-1)/2}}} 

2. To get the number of diagonals only, we must subtract the number 
   of sides, which is n. 

   {{{n(n-1)/2}}} - n

3. We get an LCD of 2 and simplify:

    {{{n(n-1)/2}}} - {{{2n/2}}}

    {{{(n^2-n)/2}}} = {{{2n/2}}}

    {{{(n^2-n-2n)/2}}}

    {{{(n^2-3n)/2}}}

    {{{(n(n-3))/2}}}

So if d represents the number of diagonals of 
an n-sided polygon, then the formula is

d = {{{n(n-3)/2}}}

Edwin</pre>