有人能帮我画一个等边三角形吗?每个内角都有数字 1、2、3。另外,我需要将一个字母与该三角形等同起来;即 F = graph。提前谢谢。
答案1
无需任何花哨的技巧:
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\coordinate (a) at (0,0);
\coordinate (b) at (2cm,0);
\coordinate (c) at (60:2cm);
\node[above left = 0.65cm and 0cm of a] {$F=$}; %% change distances suitably
%
\draw (a) -- (b) -- (c) -- cycle;
\path[clip] (a) -- (b) -- (c) -- cycle;
\node[circle,draw,minimum size=0.4cm] at (a) {};
\node[font=\tiny,inner sep=0pt] at (30:0.3cm) {$1$};
\node[circle,draw,minimum size=0.4cm] at (b) (circa) {}
node[font=\tiny,inner sep=0pt,above left = 0.1cm and 0.2cm of b] {$2$};
\node[circle,draw,minimum size=0.4cm] at (c) (circa) {}
node[font=\tiny,inner sep=0pt,below = 0.25cm of c] {$3$};
\end{tikzpicture}
\end{document}
采用以下代码托比昂的回答:
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,positioning}
\tikzset{
buffer/.style={
draw,
name=s,
shape border rotate=0,
regular polygon,
regular polygon sides=3,
node distance=2cm,
minimum height=4em
}
}
\begin{document}
\begin{tikzpicture}
\node[buffer,label={left:$F=\,$}]{};
\clip (s.corner 1) -- (s.corner 2) -- (s.corner 3) --cycle;
\draw (s.corner 1) circle (0.2cm) node[font=\tiny,inner sep=0pt,below = 0.25cm of s.corner 1] {$3$};
\draw (s.corner 2) circle (0.2cm) node[font=\tiny,inner sep=0pt,,above right = 0.1cm and 0.2cm of s.corner 2] {$1$};
\draw (s.corner 3) circle (0.2cm) node[font=\tiny,inner sep=0pt,,above left = 0.1cm and 0.2cm of s.corner 3] {$2$};
\end{tikzpicture}
\end{document}
答案2
也许...
\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\begin{document}
F=\tikz[scale=.625,baseline=0pt]{
\clip[preaction=draw] (-30:1) -- (90:1) -- (210:1) -- cycle;
\draw\foreach \i [count=\j] in {90,210,-30}{
(\i:1) circle [radius=.25] (\i:.875) node [anchor=\i,font=\tiny] {\j}};}
\end{document}
或者
\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\begin{document}
F=\tikz[scale=.625, baseline=0pt, inner sep=1pt]
\draw (-30:1) -- (90:1) -- (210:1) -- cycle
\foreach \i [count=\j] in {90,210,-30}{ [shift={(\i:1)}, rotate=\i+150]
(.25,0) arc (0:60:.25) node [midway, anchor=\i, font=\tiny] {\j}};
\end{document}
其产生与上面(大致)相同的图像。
答案3
使用 PSTricks 只是为了好玩。
\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-eucl}
\begin{document}
\multido{\n=.0+.1}{11}{%
\begin{pspicture}[LabelSep=.7,PointSymbol=none,PointName=none,CurveType=polygon](-.8,0)(3,3)
\pstGeonode{A}(3,0){B}([nodesep=3,angle=-60]{A}B){C}
\pstMarkAngle{B}{A}{C}{1}
\pstMarkAngle{C}{B}{A}{2}
\pstMarkAngle{A}{C}{B}{3}
\ncline[offset=15pt,linestyle=none]{A}{C}\ncput[npos=\n]{$F=$}
\end{pspicture}}
\end{document}