我画了这个图:
\begin{figure}[H]
\centering
\begin{tikzpicture}
\node[shape=circle,draw=black] (a1) at (0,0) {1};
\node[shape=circle,draw=black] (a2) at (5,0) {$2$};
\node[shape=circle,draw=black] (a3) at (3,1) {3};
\node[shape=circle,draw=black] (a4) at (2,-2) {4};
\node[shape=circle,draw=black] (a5) at (4,-1) {5};
\draw (a1) -- (a2);
\draw (a1) -- (a3);
\draw (a1) -- (a4);
\draw (a1) -- (a5);
\end{tikzpicture}
\end{figure}
但是我需要添加一些点,并希望它像这样。有人能告诉我如何在我的图片中添加像下面这样的点吗?非常感谢。
下面是我希望我的图片呈现的图像。
答案1
使用像这样的简单节点位置。
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[shape=circle,draw=black] (a1) at (0,0) {1};
\node[shape=circle,draw=black] (a2) at (5,0) {2};
\node[shape=circle,draw=black] (a3) at (2,2) {3};
\node[shape=circle,draw=black] (a4) at (2,-2) {4};
\node[shape=circle,draw=black] (a5) at (4,-1) {5};
\draw (a1) -- (a2);
\draw (a1) -- (a3);
\draw (a1) -- (a4);
\draw (a1) -- (a5);
\draw [dotted,thick](a1.10)--++(10:3);
\draw [dotted,thick](a1.25)--++(20:3);
\draw [dotted,thick](a1.40)--++(30:3);
\draw[dotted,thick] (a1)+(35:2.82) arc[start angle=47, end angle=-3, radius=1.65];
\end{tikzpicture}
\end{document}
答案2
这是一种利用极坐标和从交点导出的圆弧的方法。
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,intersections}
\begin{document}
\begin{tikzpicture}[Dotted/.style={% https://tex.stackexchange.com/a/52856/194703
line width=1.5pt,
dash pattern=on 0.001\pgflinewidth off #1,line cap=round,
shorten <=#1},Dotted/.default=6pt]
\begin{scope}[nodes={shape=circle,draw=black}]
\node (a1) at (0,0) {$1$};
\node[name path global=a2] (a2) at (5,0) {$2$};
\node[name path global=a3] (a3) at (30:5) {$3$};
\node (a4) at (-60:5) {$4$};
\node (a5) at (-30:5) {$5$};
\end{scope}
\draw (a1) foreach \X in {2,...,5} {edge (a\X)};
\path[name path=arc,overlay] (a2.center) arc[start angle=0,end
angle=30,radius=5];
\draw[Dotted,name intersections={of=a2 and arc,by=i2},
name intersections={of=a3 and arc,by=i3}]
let \p1=($(i2)-(a1)$),\p2=($(i3)-(a1)$),
\n1={atan2(\y1,\x1)},\n2={atan2(\y2,\x2)} in
(\n1:5) arc[start angle=\n1,end angle=\n2,radius=5]
foreach \X in {1,2,3}{ ({\n1+\X*(\n2-\n1)/4}:5) edge[Dotted] (a1)};
\end{tikzpicture}
\end{document}