You can put this solution on YOUR website!
Triangle has none
Rectangle has 1
Pentagon has 2
hexagon has 3
Looks like it's n - 3 where n is the number of vertices.
Stands to reason because one vertex has two adjacent vertices that it can't connect to. The rest it can.
Octagon would be 5
Click on the following hyperlink:
Number of Diagonals of a Polygon
Look at the polygon from one of the vertices only.
Click on more and less to change the number of sides of the polygon.
You'll see that the number of diagonals from one vertex to the other vertices is n-3.
This website goes even further to tell you the total number of diagonals from all vertices.
The formula is n * (n-3) / 2
hexagon is 6 sides
6 * 3 = 18/2 = 9 total diagonals.
There's 3 from each vertex to all the other vertices.
There's 6 vertices in total.
That's where the n * (n-3) comes from.
Each diagonal touches 2 vertices, so the number of diagonals has to be cut in half.
That's where the / 2 comes from.