3

I would like to draw the following diagram :
enter image description here I have used the following code generated in Geogebra, but it does not make the diagram which I want.

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm]
\draw (0,4)-- (4,0);
    \draw (4,0)-- (0,-4);
    \draw (0,-4)-- (-4,0);
    \draw (-4,0)-- (0,4);
    \draw (5.41,-0.03)-- (9.41,3.97);
    \draw (9.41,3.97)-- (13.41,-0.03);
    \draw (13.41,-0.03)-- (9.41,-4.03);
    \draw (9.41,-4.03)-- (5.41,-0.03);
    \draw [->] (2,2) -- (1.47,2.53);
    \draw [->] (-1.59,2.41) -- (-2.26,1.74);
    \draw [->] (2.5,-1.5) -- (1.81,-2.19);
    \draw [->] (-1.55,-2.45) -- (-2.34,-1.66);
    \draw [->] (7.11,1.66) -- (7.67,2.22);
    \draw [->] (11.29,-2.16) -- (11.85,-1.59);
    \draw [->] (11.26,2.12) -- (11.89,1.5);
    \draw [->] (6.9,-1.51) -- (7.98,-2.59);
    \draw [shift={(2.18,3.21)}] plot[domain=4.22:5.23,variable=\t]({1*3.69*cos(\t r)+0*3.69*sin(\t r)},{0*3.69*cos(\t r)+1*3.69*sin(\t r)});
    \draw [shift={(2.26,-2.4)}] plot[domain=0.94:2.23,variable=\t]({1*2.97*cos(\t r)+0*2.97*sin(\t r)},{0*2.97*cos(\t r)+1*2.97*sin(\t r)});
    \draw [shift={(7.17,-1.78)}] plot[domain=0.81:2.36,variable=\t]({1*2.48*cos(\t r)+0*2.48*sin(\t r)},{0*2.48*cos(\t r)+1*2.48*sin(\t r)});
    \draw [shift={(7.12,2.08)}] plot[domain=4.03:5.42,variable=\t]({1*2.71*cos(\t r)+0*2.71*sin(\t r)},{0*2.71*cos(\t r)+1*2.71*sin(\t r)});

\draw (2.46,-2.36) node {$b1$};
\draw (2.67,2.47) node {$a1$};
\draw (-2.17,2.32) node {$b1$};
\draw (-2.44,-2.18) node {$a1$};
\draw (-2.13,0.07) node {$T1$};
\draw (7.39,2.26) node {$b2$};
\draw (12.1,-2.06) node {$b2$};
\draw (10.43,-0.69) node {$T2$};
\draw (11.98,2.38) node {$a2$};
\draw (7.17,-2.24) node {$a2$};

\end{tikzpicture}

It produces :
enter image description here

Primo Raj
  • 107

2 Answers2

2

To draw this curve, I used the operation Curve-To (see p 149 of manual 3.0.1a).

\draw [postaction={decorate}](4,0)..controls +(-4,-2.5) and +(-4,2.5).. (4,0);

To place the arrow in the middle, I used the answer from @Caramdir TikZ: How to draw an arrow in the middle of the line?

It is possible to simplify your code. I didn't do it so you could understand the changes made. But it is always possible to do so if you wish. Tori

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{decorations.markings}
\begin{document}


\begin{tikzpicture}[line cap=round,line join=round,>={Triangle[]},scale=.7]
\draw (0,4)-- (4,0);
    \draw (4,0)-- (0,-4);
    \draw (0,-4)-- (-4,0);
    \draw (-4,0)-- (0,4);
    \draw (5.41,-0.03)-- (9.41,3.97);
    \draw (9.41,3.97)-- (13.41,-0.03);
    \draw (13.41,-0.03)-- (9.41,-4.03);
    \draw (9.41,-4.03)-- (5.41,-0.03);
    \draw [->] (2,2) -- (1.47,2.53);
    \draw [->] (-1.59,2.41) -- (-2.26,1.74);
    \draw [->] (2.5,-1.5) -- (1.81,-2.19);
    \draw [->] (-1.55,-2.45) -- (-2.34,-1.66);
    \draw [->] (7.11,1.66) -- (7.67,2.22);
    \draw [->] (11.29,-2.16) -- (11.85,-1.59);
    \draw [->] (11.26,2.12) -- (11.89,1.5);
    \draw [->] (6.9,-1.51) -- (7.98,-2.59);

% arrow in the middle from https://tex.stackexchange.com/a/3172/138900
\begin{scope}[decoration={markings,mark=at position 0.5 with {\arrow{>}}}]
    \draw [postaction={decorate},fill=gray!50](4,0)..controls +(-4,-2.5) and +(-4,2.5).. (4,0);
    \draw [postaction={decorate},fill=gray!50](5.41,-0.03)..controls +(4,-2.5) and +(4,2.5).. (5.41,-0.03);
\end{scope}

\draw (2.46,-2.36) node {$b1$};
\draw (2.67,2.47) node {$a1$};
\draw (-2.17,2.32) node {$b1$};
\draw (-2.44,-2.18) node {$a1$};
\draw (-2.13,0.07) node {$T1$};
\draw (7.39,2.26) node {$b2$};
\draw (12.1,-2.06) node {$b2$};
\draw (10.43,-0.69) node {$T2$};
\draw (11.98,2.38) node {$a2$};
\draw (7.17,-2.24) node {$a2$};

\end{tikzpicture}
\end{document}
AndréC
  • 24,137
2

An alternative with the same idea as @AndréC answer but without scope and with to instead of controls

\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm, decoration={markings, mark=at position 0.52 with {\arrow{>}}}] 
\draw (0,4)-- (4,0);
    \draw (4,0)-- (0,-4);
    \draw (0,-4)-- (-4,0);
    \draw (-4,0)-- (0,4);
    \draw (5.41,-0.03)-- (9.41,3.97);
    \draw (9.41,3.97)-- (13.41,-0.03);
    \draw (13.41,-0.03)-- (9.41,-4.03);
    \draw (9.41,-4.03)-- (5.41,-0.03);
    \draw [->] (2,2) -- (1.47,2.53);
    \draw [->] (-1.59,2.41) -- (-2.26,1.74);
    \draw [->] (2.5,-1.5) -- (1.81,-2.19);
    \draw [->] (-1.55,-2.45) -- (-2.34,-1.66);
    \draw [->] (7.11,1.66) -- (7.67,2.22);
    \draw [->] (11.29,-2.16) -- (11.85,-1.59);
    \draw [->] (11.26,2.12) -- (11.89,1.5);
    \draw [->] (6.9,-1.51) -- (7.98,-2.59);
    %\draw [shift={(2.18,3.21)}] plot[domain=4.22:5.23,variable=\t]({1*3.69*cos(\t r)+0*3.69*sin(\t r)},{0*3.69*cos(\t r)+1*3.69*sin(\t r)});
    %\draw [shift={(2.26,-2.4)}] plot[domain=0.94:2.23,variable=\t]({1*2.97*cos(\t r)+0*2.97*sin(\t r)},{0*2.97*cos(\t r)+1*2.97*sin(\t r)});
    %\draw [shift={(7.17,-1.78)}] plot[domain=0.81:2.36,variable=\t]({1*2.48*cos(\t r)+0*2.48*sin(\t r)},{0*2.48*cos(\t r)+1*2.48*sin(\t r)});
    %\draw [shift={(7.12,2.08)}] plot[domain=4.03:5.42,variable=\t]({1*2.71*cos(\t r)+0*2.71*sin(\t r)},{0*2.71*cos(\t r)+1*2.71*sin(\t r)});
    \draw[fill=gray,,postaction={decorate}] (4,0) to[in=270, out=225] (1,0) to[in=135, out=90] (4,0);
    \draw[fill=gray,,postaction={decorate}] (5.42,0) to[in=270, out=315] (8.42,0) to[in=45, out=90] (5.42,0);

\draw (2.46,-2.36) node {$b1$};
\draw (2.67,2.47) node {$a1$};
\draw (-2.17,2.32) node {$b1$};
\draw (-2.44,-2.18) node {$a1$};
\draw (-2.13,0.07) node {$T1$};
\draw (7.39,2.26) node {$b2$};
\draw (12.1,-2.06) node {$b2$};
\draw (10.43,-0.69) node {$T2$};
\draw (11.98,2.38) node {$a2$};
\draw (7.17,-2.24) node {$a2$};

\end{tikzpicture}
\end{document}

enter image description here

PS: Please upvote his answer instead of mine because he answered before me, but his answer became visible to me after I had already created the code... and so, I decided to add it as an alternative.

koleygr
  • 20,105