First of all, I would like to tell You, I have really limited time. So i would appricate every help with that task.
I have to draw a regular polygon with every diagonal.
( attached file: http://s30.postimg.org/5m6cvd7u9/polygon_with_all_diagonal.png )
Could someone help me with this?
Edit:
Please check scource code:
300 200 translate
/S 28 def
S S scale
4 S div setlinewidth
1 setlinecap
1 setlinejoin
/n 5 def
/r 5 def
newpath
r 0 moveto
1 1 n 1 sub
{
/i exch def
360 n div i mul cos r mul
360 n div i mul sin r mul lineto
} for
closepath
stroke
Thats all what i could do, i have no more idea, how to draw the diagonals.


Arguably a more fitting description of the problem is that you are trying to draw a fully connected graph.
The [Wikipedia-entry on PostScript][http://en.wikipedia.org/wiki/PostScript#Units_of_length] reveals a simple procedure that can be used to solve your problem:
Observe that the above sample can be easily adapted to draw any line; that is, it does not necessarily have to be a vertical line. Now, for each vertex of your polygon draw a line to every other vertex.
Knowing that the polar coordinates of the vertices of a n-polygon will be (rad,i(2π/n)) for i=0..n-1, you can generate the postscript code to describe a polygon path from another language, like C.