Number of diagonals in a polygon:
If n = number of vertex points, then D = number of diagonals = n(n-3)/2.
Slider n controls the number as well as the color. In the Advanced tab,
Red = n / 36, Green = 1 - n / 36, and Blue = 0, so the color changes from Green
to Red as the number of sides moves from 3 to 36.
reference: I modified sonom's idea from [url]http://tube.geogebra.org/material/show/id/137056 [/url]