誰能幫我畫一下Ti的下面兩張圖kZ?我在嘗試繪製弧線時遇到困難,並且沒有找到好的/簡單的參考。
這是我對第一張圖所做的嘗試:
\begin{tikzpicture}
\node[circle,draw] (A) at (-1,0) {};
\node[circle,draw] (B) at (5,0) {};
\draw (-5,0) node {} -- (-1,0) node{} -- (5,0) node{};
\draw (A) to[out=20,in=160] (B);
\draw (A) to[out=40,in=120] (B);
\draw (A) to[out=-20,in=200] (B);
\draw (A) to[out=-40,in=220] (B);
\end{tikzpicture}
P/S:使用下面的 JouleV 程式碼,我不確定為什麼節點周圍有一個不需要的圓圈e0 ,...,e4、如下圖所示:
答案1
這是弧線的良好開端:
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\fill[black] (0,0) circle (1pt) (4,0) circle (1pt) (8,0) circle (1pt);
\draw (0,0)--(4,0) node[midway,above] {$e_0$};
\draw (4,0) to[out=90,in=90] node[midway,above] {$e_4$} (8,0);
\draw (4,0) to[out=30,in=150] node[midway,above] {$e_2$} (8,0);
\draw (4,0) -- node[midway,below] {$e_1$} (8,0);
\draw (4,0) to[out=-60,in=-120] node[midway,below] {$e_3$} (8,0);
\end{tikzpicture}
\end{document}
如果您之前已經定義了節點格式,則必須將指令放入\draw
a 中scope
,在其中重新定義節點:
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\fill[black] (0,0) circle (1pt) (4,0) circle (1pt) (8,0) circle (1pt);
\begin{scope}[every node/.style={fill=none,draw=none}]
\draw (0,0)--(4,0) node[midway,above] {$e_0$};
\draw (4,0) to[out=90,in=90] node[midway,above] {$e_4$} (8,0);
\draw (4,0) to[out=30,in=150] node[midway,above] {$e_2$} (8,0);
\draw (4,0) -- node[midway,below] {$e_1$} (8,0);
\draw (4,0) to[out=-60,in=-120] node[midway,below] {$e_3$} (8,0);
\end{scope}
\end{tikzpicture}
\end{document}
獎金|第二張圖:
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}
\draw[->] (-1,0)--(5.5,0);
\draw (0,-.5)--(0,4);
\coordinate (o) at (0,0);
\coordinate (a) at (3,0);
\coordinate (c) at (1,3);
\coordinate (b) at (4,2);
\coordinate (bx) at (5,2);
\coordinate (cx) at (2,3);
\coordinate (ax) at (5,0);
\draw[very thick] (o)--(a);
\draw[very thick] (a)--(b) node[midway,above left] {$\varphi'_B$};
\draw[very thick] (b)--(c) node[midway,below] {$\varphi'_A$};
\draw[very thick] (c)--(o) node[midway,right] {$\varphi'_I$};
\draw[dashed] (b)--(bx) (c)--(cx);
\pic[draw,"$\alpha_3$",angle radius=0.3cm,angle eccentricity=2] {angle=ax--a--b};
\pic[draw,"$\alpha_1$",angle radius=0.2cm,angle eccentricity=2] {angle=cx--c--o};
\pic[draw,"$\alpha_2$",angle radius=0.2cm,angle eccentricity=2] {angle=bx--b--c};
\end{tikzpicture}
\end{document}
您需要angles
角度符號庫和quotes
插入角度名稱的庫。
答案2
作為@JouleV 答案第一個版本的補充:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{positioning, quotes}
\begin{document}
\begin{tikzpicture}[
node distance = 30mm,
on grid,
dot/.style = {circle, draw, fill, minimum size=3pt, inner sep=0pt,
node contents={}},
every edge quotes/.style = {inner sep=1pt, font=\footnotesize, auto=left}
]
\node (n1) [dot];
\node (n2) [dot, right=of n1];
\node (n3) [dot, right=of n2];
\path (n1) edge ["$e_0$"] (n2)
(n2) edge ["$e_1$"] (n3)
(n2) edge [bend left=60,"$e_4$"] (n3)
(n2) edge [bend left,"$e_2$"] (n3)
(n2) edge [bend right,"$e_3$"] (n3)
;
\end{tikzpicture}
\end{document}