点を繋ぐときに波線を作るにはどうすればいいですか?

点を繋ぐときに波線を作るにはどうすればいいですか?

私の教授は、プリムのアルゴリズムについての証明を LaTeX で書き、グラフを使用してカット方法などを説明しました。私が興味を持っているのは、中央の円から波線が出ているのをどうやって描いたかです。

https://www.uncg.edu/cmp/faculty/srtate/330.f16/primsproof.pdf

誰かこれをどうやってやったのか説明してくれませんか? 論文で再現したいです。 よろしくお願いします!

答え1

smoothようこそ!滑らかな曲線を描く方法はたくさんあります。またはを使用したプロットを使用したり、 およびをsmooth cycle使用したりすることができます。inout

\documentclass[tikz,border=3mm]{standalone}

\begin{document}
\begin{tikzpicture}[bullet/.style={circle,fill,inner sep=1.4pt}]
  \draw[semithick]  plot[smooth cycle,looseness=1.3] coordinates 
  {(0,1) (0.5,0.7) (1.2,0.9) (2,1.3) (2.5,1.2) (3.6,1.1) (3.7,2.2)
  (3,3.2) (1.6,2.9) (0.3,2.5)  };
 \draw[semithick] 
  (1,1.7) node{$W$}
  (2.8,2.6) node[bullet,label=above left:$a$](a){}
  (a) +(20:1.2)   node[bullet,label=above right:$b$](b){}
  (2.8,1.5) node[bullet,label=left:$x$](x){}
  (x) +(-10:1.2)   node[bullet,label=below right:$y$](y){}
  (x) to[out=60,in=-60] (3,1.9) to[out=120,in=-120] (a) 
  -- (b) to[out=-80,in=90] (3.4,1.9)
  to[out=-90,in=100] (y) -- (x);
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

波線を描くには、coilデコレーションを使うだけです。

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,fill,inner sep=1.4pt,outer sep=0pt}]
  \draw[semithick]  plot[smooth cycle,looseness=1.3] coordinates 
  {(0,1) (0.5,0.7) (1.2,0.9) (2,1.3) (2.5,1.2) (3.6,1.1) (3.7,2.2)
  (3,3.2) (1.6,2.9) (0.3,2.5)  };
 \draw[semithick] 
  (1,1.7) node{$W$}
  (2.8,2.6) node[bullet,label=above left:$a$](a){}
  (a) +(20:1.2)   node[bullet,label=above right:$b$](b){}
  (2.8,1.5) node[bullet,label=left:$x$](x){}
  (x) +(-10:1.2)   node[bullet,label=below right:$y$](y){}
   (a) 
  -- (b) to[out=-80,in=90] (3.4,1.9)
  to[out=-90,in=100] (y) -- (x);
  \draw[thick,blue,decorate,decoration={coil,aspect=0,segment length=5.9mm}] (x) -- (a);
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

より美しい波線が見つかるここ

関連情報