无法在 Latex 中为我的数学作业绘制特定图形

无法在 Latex 中为我的数学作业绘制特定图形

有人能告诉我如何在 latex 中绘制此图表(以及这些类型的图表)吗?谢谢图形

答案1

这是可以玩的东西。我以不同的方式排列节点,您可以自行更改。我不会解释此示例中的步骤,请参阅 tikz 手册。

\documentclass[tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
  \coordinate (a1) at (0,0);
  \coordinate (a2) at ($(a1)+(0:3cm)$);
  \coordinate (a3) at ($(a1)+(60:3cm)$);
  \coordinate (move) at (4,1);
  \coordinate (b1) at ($(a1)+(move)$);
  \coordinate (b2) at ($(a2)+(move)$);
  \coordinate (b3) at ($(a3)+(move)$);

  \draw (a1) -- (a2) -- (a3) -- cycle;
  \draw (b1) -- (b2) -- (b3) -- cycle; 

  \draw (a1) to [bend left] (b1);
  \draw (a2) to [bend right] (b2);
  \draw (a3) to [bend left] (b3);

  \fill (a1) circle (1pt) node[left] {$v_1$};
  \fill (a2) circle (1pt) node[below] {$v_2$};
  \fill (a3) circle (1pt) node[left] {$v_3$};
  \fill (b1) circle (1pt) node[below] {$v_1'$};
  \fill (b2) circle (1pt) node[right] {$v_2'$};
  \fill (b3) circle (1pt) node[right] {$v_3'$};

  \node at ($(a1)!0.5!(b2)+(0,-1.5)$) {$G_1$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

相当简短的代码pstricks

\documentclass[border=6pt]{standalone}
\usepackage{pst-eucl}

\begin{document}

\begin{pspicture}(-0.5,-0.5)(5,3)
\psset{PosAngleA=90,PosAngleB=-90,PosAngleC=-90}
\pstTriangle(1,1.7){v_1}(0,0){v_2}(2,0){v_3}
\pstTriangle[PointNameA=v^\prime_1, PointNameB=v^\prime_2, PointNameC=v^\prime_3] (3.6,2.5){u_1}(2.6,0.8){u_2}(4.6,0.8){u_3}
\foreach \s/\t in {v_1/u_1, v_2/u_2, u_3/v_3}{\ncarc[arcangle=40]{\s}{\t}}
\end{pspicture}

\end{document} 

在此处输入图片描述

答案3

图书馆graphs可以把它弄得相当短。

代码

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs, quotes}
\begin{document}
\tikz[label position=below, bend angle=15]\graph[
  nodes={fill, draw, circle, inner sep=+.1em},
  simple, empty nodes, counterclockwise=3]{
  { [cycle] 1 ["$v _1$" above], 2 ["$v _2$"], 3 ["$v _3$"] }
  --[bend left]
  { [cycle, /tikz/shift=(15:4), radius=+0cm]
            1'["$v'_1$" above], 2'["$v'_2$"], 3'["$v'_3$"] },
  3 --[bend right] 3'
};
\end{document}

输出

在此处输入图片描述

相关内容