答案1
具有两个 foreach 循环的解决方案
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\foreach \aa in {0,1,2,...,5}{
\draw (0,0)coordinate(O) -- ({\aa*360/5}:2)coordinate(P\aa);
}
\draw
(P0)
\foreach \aa in {1,2,...,5}{--
(P\aa)
}
-- cycle;
\draw[fill] (O) circle (1mm);
\end{tikzpicture}
\end{document}
答案2
您可以使用名为的工具自行创建快速解决方案数学。
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\tikzset{every picture/.style={line width=0.75pt}}
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
\draw (259.15,107.06) -- (342.34,167.5) -- (310.57,265.29) -- (207.74,265.29) -- (175.97,167.5) -- cycle ;
%Straight Lines [id:da5500931558328854]
\draw (259.15,107.06) -- (259.15,194.53) ;
%Straight Lines [id:da9807314972174233]
\draw (175.97,167.5) -- (259.15,194.53) ;
%Straight Lines [id:da4619344120764781]
\draw (342.34,167.5) -- (259.15,194.53) ;
%Straight Lines [id:da9720784168022731]
\draw (259.15,194.53) -- (207.74,265.29) ;
%Straight Lines [id:da3200168995877415]
\draw (259.15,194.53) -- (310.57,265.29) ;
%Shape: Circle [id:dp3653706700614776]
\draw [fill={rgb, 255:red, 0; green, 0; blue, 0 } ,fill opacity=1 ] (254.65,194.53) .. controls (254.65,192.04) and (256.67,190.03) .. (259.15,190.03) .. controls (261.64,190.03) and (263.65,192.04) .. (263.65,194.53) .. controls (263.65,197.02) and (261.64,199.03) .. (259.15,199.03) .. controls (256.67,199.03) and (254.65,197.02) .. (254.65,194.53) -- cycle ;
\draw (268,190.4) node [anchor=north west][inner sep=0.75pt] {\large $A_{i}$};
\end{tikzpicture}
\end{document}
答案3
如果绘制的形状是正五边形,那么我将利用 TikZ 库regular polygon
(参见 TikZ 和 PGF 手册,第 792 页,版本 3.1.7a):
\documentclass[tikz, margin=3.14159]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node (s) [regular polygon, regular polygon sides=5, draw,
minimum size=33mm] {$\bullet$};
\foreach \i in {1,2,...,5}
\draw (0,0) -- (s.corner \i);
\end{tikzpicture}
\end{document}