我正在尝试绘制展开的正五边形。我有一个非常好的例子:正五边形.代码如下:
\newcommand{\downpent}[2][blue!50!gray,draw=white,thick]% [options], list of direction steps e.g {10/2/1/1}
{
\coordinate (temp) at (0,0);
\foreach \p in {#2}
{ \foreach \s in \p
{ \coordinate (temp) at ($(temp)+(\s*36-18:1)$);
}
\fill[#1] ($(temp)+(54:0.618)$) -- ($(temp)+(126:0.618)$) -- ($(temp)+(198:0.618)$) -- ($(temp)+(270:0.618)$) -- ($(temp)+(342:0.618)$) -- cycle;
\coordinate (temp) at (0,0);
}
}
\newcommand{\uppent}[2][blue!50!gray,draw=white,thick]% [options], list of coordinates e.g {1,2},{1,3},{4,2}
{
\coordinate (temp) at (0,0);
\foreach \p in {#2}
{ \foreach \s in \p
{ \coordinate (temp) at ($(temp)+(\s*36-18:1)$);
}
\fill[#1] ($(temp)+(-54:0.618)$) -- ($(temp)+(-126:0.618)$) -- ($(temp)+(-198:0.618)$) -- ($(temp)+(-270:0.618)$) -- ($(temp)+(-342:0.618)$) -- cycle;
\coordinate (temp) at (0,0);
}
}
\begin{tikzpicture}
\downpent[orange,draw=white,thick]{{2},{4},{6},{8},{10},{10,1,10}}
\uppent[cyan!50!blue,draw=white,thick]{{},{10,1},{10,1,10,3},{10,1,10,1},{10,1,10,9},{10,1,10,7}}
\foreach \a [count=\c] in {18,54,...,342} \draw[->,thick] (0,0) -- (\a:1cm) node[label=\a:\c] {};
\end{tikzpicture}
这给了我这张图片
现在,问题是我该如何绘制展开的正五边形?抱歉,我的 tikz 和 latex 技能不太好。我是新手。任何帮助或建议都将不胜感激。