2

I would like to connect two nodes n1 and n2 following a circle of a given radius. I tried to play with to[bend left=<>], but it never fits perfectly (in the picture below I highlighted the problem). Any ideas?

enter image description here

\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[&lt;-, &gt;=latex, blue] (i1) to[bend left=41] (i2);

\end{tikzpicture}

1 Answers1

1

Using the bending library, and a value of 44 for the bending, this seems to fit.

bend on a circle

\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[&lt;-, &gt;=latex, blue] (i1) to[bend left=44] (i2);

\end{tikzpicture} \end{document}

SebGlav
  • 19,186
  • Thanks a lot! Is there are way to compute the bend value? – Michael Dorner Jul 19 '21 at 13:09
  • I'm not aware if there's a way to do it. Try and error did the trick here. But more important is the bending library, which allows your bended arrow to be correctly bended (like if there was no arrow tip). – SebGlav Jul 19 '21 at 13:23