\documentclass[border=10pt,pstricks]{standalone}
\usepackage{xfp,pst-eucl}
\begin{document}
\begin{pspicture}[showgrid,linejoin=1](-2,-2)(2,2)
%%%
\def\mypoly#1#2{% #1: sides, #2: angles
\pnode(0,0){O}
\def\n{#1}
\def\goc{\fpeval{round(360/#1,2)}} %% https://tex.stackexchange.com/questions/425043/decimal-on-divison
\multido{\iA=1+1}{#1}{\pnode(1;\fpeval{#2+\iA*\goc}){A\iA}}
\pstProjection[PointName=,PointSymbol=none]{A1}{A2}{O}[K]
\pstTriangleOC[fillstyle=solid,fillcolor=red]{A1}{A2}{A3}
\pspolygon(A1)(A2)(A3)(A4)(A5)%(A6)%(A7)%(A8)
\pstCircleOA[fillstyle=solid,fillcolor=white]{O}{K}}
%%%%%
\mypoly{5}{18}
\end{pspicture}
\end{document}
Question:
You can see \pspolygon(A1)(A2)(A3)(A4)(A5)%(A6)%(A7)%(A8)
With \mypoly{5}{18} n=5 , LaTeX print \pspolygon(A1)(A2)(A3)(A4)(A5); \mypoly{4}{45} n=4 , LaTeX print \pspolygon(A1)(A2)(A3)(A4); ...
How can I do?




loopofTeX. – Black Mild Oct 31 '19 at 18:29