How to draw the curved line inside the red circle in this picture :
MWE
\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usetikzlibrary{shapes.geometric,arrows,positioning,fit,calc,backgrounds}
\begin{document}
\begin{tikzpicture}
\draw (-2,0) circle (.4cm) node[below=.5cm, align=center] {Client};
\draw[color=red] (0,0) circle (.4cm) node[below=.5cm, text width=1.5cm, color=black, align=center] {Homme du milieu};
\draw (2,0) circle (.4cm) node[below=.5cm, align=center, text width=1cm] {Serveur web};
\draw[color=blue] (-2, 0) -- (-.4,0);
\draw[color=blue] (.4, 0) -- (2,0);
\draw[-, color=red] (-.4,0) to[out=-30,in=100,looseness=2] (.4,0) ;
\end{tikzpicture}
\end{document}
How does function the to[out=-30,in=100,looseness=2]
work?. I read an answer that suggested using it for making curved paths but I don't know how it works.
Best Answer
I suggest to use named circle nodes. If the red one is called
hdm
you can use something liketo get
Code:
Here is a picture to explain how
works (
looseness=0.5
is green,looseness=1.5
is orange andloosness=2
is blue):Code: