如何使用 tikz 为箭头添加更多弯曲?

如何使用 tikz 为箭头添加更多弯曲?

我怎样才能使从 a_2 ---> a_0 的箭头更加弯曲?

在此处输入图片描述

这是我的代码:

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}

\begin{document}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2cm]

\node[initial,state,accepting] (S)      {$a_0$};
\node[state]         (a1) [right of=S]  {$a_1$};
\node[state]         (a2) [right of=a1] {$a_2$};
\node[state]         (a3) [right of=a2] {$a_3$};


\path[->] (S)  edge [loop above] node {0} (S);
\path[->] (S)  edge              node {1} (a1);
\path[->] (a1)  edge             node {0} (a2);
\path[->] (a3)  edge             node {0} (a2);
\path[->] (a3)  edge [loop above] node {1} (a3);
\path[->] (a2)  edge [bend left] node {0} (S);
\path[->] (a1)  edge [bend left] node {1} (a3);
\path[->] (a2)  edge [bend left] node {1} (a1);

\end{tikzpicture}
\end{document}

答案1

添加圆弧离开的角度作为参数。省略参数对应的值为 30 度。

\path[->] (a2)  edge [bend left=50] node {0} (S);

在此处输入图片描述

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{arrows,automata}

\begin{document}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2cm]

\node[initial,state,accepting] (S)      {$a_0$};
\node[state]         (a1) [right of=S]  {$a_1$};
\node[state]         (a2) [right of=a1] {$a_2$};
\node[state]         (a3) [right of=a2] {$a_3$};


\path[->] (S)  edge [loop above] node {0} (S);
\path[->] (S)  edge              node {1} (a1);
\path[->] (a1)  edge             node {0} (a2);
\path[->] (a3)  edge             node {0} (a2);
\path[->] (a3)  edge [loop above] node {1} (a3);
\path[->] (a2)  edge [bend left=50] node {0} (S);
\path[->] (a1)  edge [bend left] node {1} (a3);
\path[->] (a2)  edge [bend left] node {1} (a1);

\end{tikzpicture}
\end{document}

相关内容