TikZ 中圆上两个节点之间的线

TikZ 中圆上两个节点之间的线

我想按照给定半径的圆连接两个节点 n1 和 n2。我尝试过to[bend left=<>],但总是无法完美匹配(下图中我突出显示了这个问题)。有什么想法吗?

在此处输入图片描述

\begin{tikzpicture}
    \def\radius{2cm}
    \draw[color=black!50, name path=c] (0:\radius) arc (0:360:\radius);
    \node[draw, circle, fill=white, name path=n1] at (110:\radius) (n1) {n1}; 
    \node[draw, circle, fill=white, name path=n2] at (0:\radius) (n2) {n2}; 
    
    \path[name intersections={of=n1 and c, by={i1, i2}}];
    \path[name intersections={of=n2 and c, by={i2, i3}}];
    
    \node[draw, red, circle, scale=0.5] at (i1) {};
    \node[draw, red, circle, scale=0.5] at (i2) {};
    
    \draw[<-, >=latex, blue] (i1) to[bend left=41] (i2);
\end{tikzpicture}

答案1

使用该bending库,并将弯曲值设为 44,这似乎很合适。

绕圈弯曲

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{bending,intersections}
\begin{document}
\begin{tikzpicture}
    \def\radius{2cm}
    \draw[color=black!50, name path=c] (0:\radius) arc (0:360:\radius);
    \node[draw, circle, fill=white, name path=n1] at (110:\radius) (n1) {n1}; 
    \node[draw, circle, fill=white, name path=n2] at (0:\radius) (n2) {n2}; 
    
    \path[name intersections={of=n1 and c, by={i1, i2}}];
    \path[name intersections={of=n2 and c, by={i2, i3}}];
    
    \node[draw, red, circle, scale=0.5] at (i1) {};
    \node[draw, red, circle, scale=0.5] at (i2) {};
    
    \draw[<-, >=latex, blue] (i1) to[bend left=44] (i2);
\end{tikzpicture}
\end{document}

相关内容