circuitikz 中两点之间的曲线

circuitikz 中两点之间的曲线

在此处输入图片描述

如何在两个节点上或两点之间绘制箭头边曲线circuitikz。我已经添加了 MWE...

\begin{circuitikz}
  \draw (0,0) to [twoport,t=G,v^<= .] (2,0) (2,0) -- (4,0)node[anchor=west]{AG} (2,0) |- (4,-1)node[anchor=west]{AG} (-1,0)node[anchor=east]{A} --(0,0) (6,-0.5)node[]{\Large$\Rightarrow$} (8,0)node[anchor=east]{A} (9,0) (10,0) to [twoport,t=G] (12,0)node[anchor=west]{AG} (10,-1.5) to [twoport,t=G] (12,-1.5)node[anchor=west]{AG} (8,0) -- (10,0) (9,0) |- (10,-1.5) ;
\end{circuitikz} 

答案1

正如约翰提到的,曲线的一个选项是to[bend left]。对于箭头,您可以使用decorations.markingsTikZ 库。

在此处输入图片描述

\documentclass[border=5mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{decorations.markings} % <-- required
\begin{document}
\begin{circuitikz}
 \draw 
      (0,0) coordinate(a) to [twoport,t=G] (2,0) coordinate (b) % <-- I added two coordinates here
      (2,0) -- (4,0)node[anchor=west]{AG}
      (2,0) |- (4,-1)node[anchor=west]{AG}
      (-1,0) node[anchor=east]{A} --(0,0)
      (6,-0.5) node[]{\Large$\Rightarrow$}
      (8,0) node[anchor=east]{A} (9,0)
      (10,0) to [twoport,t=G]
      (12,0) node[anchor=west]{AG}
      (10,-1.5) to [twoport,t=G]
      (12,-1.5) node[anchor=west]{AG}
      (8,0) -- (10,0)
      (9,0) |- (10,-1.5) ;

\draw [decoration={
         markings,
         mark=at position 0.5 with \arrow{>} % arrow head halfway along the path
         },
       postaction={decorate},
       dashed
       ]
     % draw the line between the coordinates defined previously.
     (a) to[bend left=90, looseness=1.2] (b);      
 \end{circuitikz} 

\end{document}

相关内容