4

Please consider this LaTeX file:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
  \draw[->,thick] ({sqrt(2)},{sqrt(2)+2}) arc (45:225:2);
  \draw[->,thick] ({-sqrt(2)},{-sqrt(2)+2}) arc (225:405:2);
  \draw[->,thick] ({sqrt(2)+4},{sqrt(2)+2}) arc (45:225:2);
  \draw[->,thick] ({-sqrt(2)+4},{-sqrt(2)+2}) arc (225:405:2);
\end{tikzpicture}\par
\begin{tikzpicture}
  \draw[-LaTeX,thick] ({sqrt(2)},{sqrt(2)+2}) arc (45:225:2);
  \draw[-LaTeX,thick] ({-sqrt(2)},{-sqrt(2)+2}) arc (225:405:2);
  \draw[-LaTeX,thick] ({sqrt(2)+4},{sqrt(2)+2}) arc (45:225:2);
  \draw[-LaTeX,thick] ({-sqrt(2)+4},{-sqrt(2)+2}) arc (225:405:2);
\end{tikzpicture}
\end{document}

It should draw two pairs of tangent circles with arrows. Actually, each circle consists of two half-circles with an arrow at the end.

What I get is this:

enter image description here

As you can see, the circles from the second pair are not tangent. However, both pairs were created by the same process. The only difference is that the second pair uses LaTeX arrowheads, whereas the first pair doesn't.

Is this a known problem? How do I avoid this?

3 Answers 3

7

If you load the bending library this works as expected:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending}
\begin{document}
\begin{tikzpicture}
  \draw[->,thick] ({sqrt(2)},{sqrt(2)+2}) arc (45:225:2);
  \draw[->,thick] ({-sqrt(2)},{-sqrt(2)+2}) arc (225:405:2);
  \draw[->,thick] ({sqrt(2)+4},{sqrt(2)+2}) arc (45:225:2);
  \draw[->,thick] ({-sqrt(2)+4},{-sqrt(2)+2}) arc (225:405:2);
\end{tikzpicture}\par
\begin{tikzpicture}
  \draw[-LaTeX,thick] ({sqrt(2)},{sqrt(2)+2}) arc (45:225:2);
  \draw[-LaTeX,thick] ({-sqrt(2)},{-sqrt(2)+2}) arc (225:405:2);
  \draw[-LaTeX,thick] ({sqrt(2)+4},{sqrt(2)+2}) arc (45:225:2);
  \draw[-LaTeX,thick] ({-sqrt(2)+4},{-sqrt(2)+2}) arc (225:405:2);
\end{tikzpicture}
\end{document}

enter image description here

1
  • I did not even know that that library existed! Thanks a lot. Apr 11, 2021 at 10:42
7

Just for fun, you could have used the decorations.markings library instead of all those calculations. decorated circles

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings}

\begin{document}
    \begin{tikzpicture}
        \tikzset{arrowedcircle/.style={
                    postaction=decorate,
                    decoration={
                    markings,
                    mark=between positions 0.125 and 1 step 0.5 with \arrow{latex}
                    }}}
        \draw[arrowedcircle] (0,0) circle (2cm);    
        \draw[arrowedcircle] (4,0) circle (2cm);
    \end{tikzpicture}
\end{document}
2
  • 1
    Thank you. I am trying to learn as much as I can about TikZ. Apr 11, 2021 at 14:58
  • 3
    Everyone always has something to learn, hence the beauty of this website.
    – SebGlav
    Apr 11, 2021 at 15:00
2

Just checking with tzplot:

enter image description here

\documentclass[border=1mm]{standalone} 

\usepackage{tzplot}

\begin{document}

\begin{tikzpicture}[scale=1.4]
\tzcircle[-->--=.125](0,0)(2)
\tzcircle[draw=none,-->--=.625](0,0)(2)
\tzcircle(4,0)(2)
\foreach \apos in {.125,.25,...,1}
{
  \settzmidarrow{Latex}[red,scale=1.5]
  \tzcircle[draw=none,-->--=\apos](4,0)(2)
}
\end{tikzpicture}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .