我想画一个有方向的三角形,但我做不到。请帮帮我。我还想在中心插入一个圆形箭头。
\documentclass{standalone}
\usepackage{pgf,tikz,pgfplots,bm,tikz-cd}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows,shapes.geometric,decorations.markings, calc, fadings, decorations.pathreplacing, patterns, decorations.pathmorphing, positioning}
\newcommand{\midarrow}{\tikz \draw[-triangle 90] (0,0) -- +(.2a5,0);}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\draw [black,line width=1.5pt] (0,0) -- (1.5,2.6) -- (3,0) -- cycle;
\draw [thick] (0,0) -- node {\midarrow} (3,0);
\draw [thick] (1.5,2.6) -- node {\midarrow} (3,0);
\draw [thick] (1.5,2.6) -- node {\midarrow} (0,0);
\filldraw[black] (0,0) circle (3 pt);
\filldraw[black] (3,0) circle (3 pt);
\filldraw[black] (1.5,2.6) circle (3 pt);
\node [below left] at (0,0) {\textbf{a}};
\node [above] at (1.5,2.6) {\textbf{b}};
\node [below right] at (3,0) {\textbf{c}};
\end{tikzpicture}
\end{document}
答案1
像这样?中间的箭头取自这个答案并且该/.list
键允许绘制多个三角形,使用节点和标签允许我们将所有内容打包到一条路径中。我还删除了这个三角形不需要的包和库。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings,arrows.meta,bending}
\tikzset{->-/.style={decoration={markings, % https://tex.stackexchange.com/a/39282/121799
mark=at position #1 with {\arrow[line width=2pt]{>}}},postaction={decorate}}}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,fill,inner
sep=3pt,label={[font=\bfseries]#1}},>=latex]
\draw [black,line width=1.5pt,->-/.list={1/6,1/2,5/6}]
(210:3) node[bullet={below left:a}] (a) {}
-- (90:3) node[bullet={above:b}] (b) {}
-- (-30:3) node[bullet={below right:c}] (c) {}
-- cycle;
\draw[line width=1.5pt,-{Latex[bend]}] (240:0.5) arc(240:-60:0.5);
\end{tikzpicture}
\end{document}