Рисуем между фигурами в Tikz

Рисуем между фигурами в Tikz

Я пытаюсь провести линии от центрального круга (Генеральная Ассамблея) к кругам Экономического и Социального Совета и Международного уголовного суда таким образом, чтобы угол падения линии на все три круга был равен 0 градусов, т. е. линия находилась под углом 90 градусов к поверхности круга. Прямо сейчас у меня есть вот что.

\documentclass{article}
\usetikzlibrary{calc}
\usetikzlibrary{matrix, shapes}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{snakes}
\usetikzlibrary{positioning, intersections}
\pgfplotsset{compat=1.10}
\begin{document}

    \begin{figure}[H]
    \label{fig:structure}
    \centering
    \begin{tikzpicture}
    \node[xshift=6cm,draw,regular polygon, regular polygon sides=4,text width=3cm,align=center] (sa)
      {{\Large Specialized agencies}:\\
      \textbullet FAO\\
      \textbullet ILO\\
      \textbullet ITU\\
      \textbullet WHO};
      \node[minimum size= 4.5cm, xshift=12cm,draw,circle, text width=3cm,align=center] (ga) {\Large{General Assembly}\\
      \small{1 nation, 1 vote}};
      \node[xshift=12cm,yshift=-5cm,draw, circle, text width=3cm,align=center] (sc) {\Large Security Council\\
      \small{5 permanent members\\
      10 rotating members chosen by GA}};
        \node[xshift=12cm,yshift=5cm,draw,circle, text width=3cm,align=center] (sg) {\Large Secretary General\\
      \small{Supports GA decisions}};
          \node[xshift=17cm,yshift=2cm,draw,circle, text width=3cm,align=center] (ecsoc) {\Large Economic and Social Council
    };
          \node[xshift=17cm,yshift=-2cm,draw,circle, text width=3cm,align=center] (icc) {\Large International Criminal Court
    };
    \draw (sa.east) -- (ga.west);
    \draw (sg.south) -- (ga.north);
    \draw (sc.north) -- (ga.south);
    \draw (ga.east) -- (ecsoc.west);
    \draw (ga.east) -- (icc.west);
    \end{tikzpicture}
    \caption{Structure of the United Nations}
    \end{figure}

\end{document}

диаграмма

решение1

Если вы имеете в виду, что они должны быть перпендикулярны границе круга, то вместо --, используйте, edge[out=0, in=180]например, в \draw (ga.east) edge[out=0, in=180] (ecsoc.west);. Таким образом, линия выходит под углом 0 градусов (справа) и входит под углом 180 градусов (слева).

Также запишите все библиотеки Tikz в одном месте, разделив их запятыми,послевы вызываете пакет Tikz, чтобы он не создавал ошибок. Я обычно перечисляю все необходимые мне пакеты, а затем библиотеки, если они применимы, после всех них. Так это также проще для понимания и более организованно.

Рисунок 1

\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}

\usetikzlibrary{positioning, intersections, calc, matrix, shapes, snakes}
\pgfplotsset{compat=1.10}

\begin{document}

    \begin{figure}[H]
    \label{fig:structure}
    \centering
    \begin{tikzpicture}
    \node[xshift=6cm,draw,regular polygon, regular polygon sides=4,text width=3cm,align=center] (sa)
      {{\Large Specialized agencies}:\\
      \textbullet FAO\\
      \textbullet ILO\\
      \textbullet ITU\\
      \textbullet WHO};
      \node[minimum size= 4.5cm, xshift=12cm,draw,circle, text width=3cm,align=center] (ga) {\Large{General Assembly}\\
      \small{1 nation, 1 vote}};
      \node[xshift=12cm,yshift=-5cm,draw, circle, text width=3cm,align=center] (sc) {\Large Security Council\\
      \small{5 permanent members\\
      10 rotating members chosen by GA}};
        \node[xshift=12cm,yshift=5cm,draw,circle, text width=3cm,align=center] (sg) {\Large Secretary General\\
      \small{Supports GA decisions}};
          \node[xshift=17cm,yshift=2cm,draw,circle, text width=3cm,align=center] (ecsoc) {\Large Economic and Social Council
    };
          \node[xshift=17cm,yshift=-2cm,draw,circle, text width=3cm,align=center] (icc) {\Large International Criminal Court
    };
    \draw (sa.east) -- (ga.west);
    \draw (sg.south) -- (ga.north);
    \draw (sc.north) -- (ga.south);
    \draw (ga.east) edge[out=0, in=180] (ecsoc.west);
    \draw (ga.east) edge[out=0, in=180] (icc.west);
    \end{tikzpicture}
    \caption{Structure of the United Nations}
    \end{figure}

\end{document}

Кстати, вы можете изменить внешний вид кривой, добавив ключ "looseness". Значение по умолчанию 1, 0 создает прямую линию, а увеличение числа подчеркивает кривизну. Вот пример (черный - стандарт, или 1):

фигура 2

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}

\usetikzlibrary{positioning, intersections, calc, matrix, shapes, snakes}
\pgfplotsset{compat=1.10}

\begin{document}

    \begin{tikzpicture}
    \node[draw, circle, text width=3cm, align=center] (ga) {\Large General Assembly};
    \node[draw, circle, text width=3cm, align=center, xshift=6cm, yshift=3cm] (ecsoc) {\Large Economic and Social Council};

    \draw[green] (ga.east) edge[out=0, in=180, looseness=0] (ecsoc.west);
    \draw (ga.east) edge[out=0, in=180, looseness=1] (ecsoc.west);
    \draw[red] (ga.east) edge[out=0, in=180, looseness=5] (ecsoc.west);
    \draw[blue] (ga.east) edge[out=0, in=180, looseness=10] (ecsoc.west);

    \end{tikzpicture}

\end{document}

Связанный контент