我想要一个有 108° 角的完美五边形

我想要一个有 108° 角的完美五边形

我尝试了相对坐标,但无法输入坐标来生成角度。这可能吗?

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{quotes,angles,calc,plotmarks,decorations.text}
\begin{document}   
\begin{tikzpicture}
    \draw[red,fill=red] (3:0) circle (.5ex);
    
%\draw[help lines] (-1,0) grid (5,5);   
    %\draw   (0,0)    --++(2,0) --++(72:2)--++(144:1.75)--++(210:1.75) --cycle   ;
\draw   (0,0)    --(2,0) -- (2.5,2) -- (1,3) --(-0.5,2) --cycle  ;

\coordinate (a) at (0,0);
\coordinate (b) at (2,0);
\coordinate (c) at (2.5,2);
\coordinate (d) at (1,3);
\coordinate (e) at (-0.5,2);


\node[align=center, below  ] at (a) {1};    
\node[align=center, below  ] at (b) {2};
\node[align=center,right    ] at (c) {3};
\node[align=center,above    ] at (d) {4};
\node[align=center,left    ] at (e) {5};
    
%\pic [draw, -, "$\alpha_0$", angle eccentricity=1.5] {angle = c--b--a};
\pic [draw, -, "$\alpha_1$", angle eccentricity=1.5] {angle = a--e--d};
\pic [draw, -, "$\alpha_2$", angle eccentricity=1.5] {angle = e--d--c};
\pic [draw, -, "$\alpha_3$", angle eccentricity=1.5] {angle = d--c--b};
\pic [draw, -, "$\alpha_3$", angle eccentricity=1.5] {angle = b--a--e};


\draw pic[draw,fill=green!30,angle radius=0.4cm,"$ $" shift={(0mm,-5mm)}] {angle= c--b--a};

\end{tikzpicture}
\end{document}   

答案1

有很多方法可以找到正五边形的角。

这里我只使用绝对极坐标,第一个和最后一个获得别名,以便稍后在循环中更容易引用它们。

mark with dashes = <num>中画出了<num>我们沿着边缘放置的斜线。

代码

\documentclass[tikz]{standalone}
\usetikzlibrary{angles, quotes}
\tikzset{
  mark with dashes/.style={
    every to/.append style={edge node={pic{mark with dashes={#1}}}}},
  pics/mark with dashes/.style={
    /tikz/sloped, /tikz/allow upside down, /tikz/line width=+.4pt,% thin
    code={
      \foreach \i in {1, ..., #1}
        \draw[line cap=round, shift=(left:{\i pt-(#1+1)/2}), pic actions]
          (-1pt, -2pt) -- (1pt, 2pt);}}}
\begin{document}
\begin{tikzpicture}[angle eccentricity=1.5]
\foreach[count=\j from 0, count=\i] \p in {below, below, right, above, left}
  \coordinate["$\i$" \p] (c\i) at (90+72*2+\j*72:2);
\node also[alias=c0] (c5) node also[alias=c6] (c1);
\foreach[count=\j from 2, count=\k from 0] \i in {1, ..., 5}
  \pic[draw, "$\alpha_\i$"] {angle=c\j--c\i--c\k};
\draw[mark with dashes=2, thick] (c1) to (c2) to (c3) to (c4) to (c5) to cycle;
\end{tikzpicture}
\end{document}

输出

在此处输入图片描述

相关内容