![画出两个角,带箭头,并标记三角形的边](https://linux22.com/image/294494/%E7%94%BB%E5%87%BA%E4%B8%A4%E4%B8%AA%E8%A7%92%EF%BC%8C%E5%B8%A6%E7%AE%AD%E5%A4%B4%EF%BC%8C%E5%B9%B6%E6%A0%87%E8%AE%B0%E4%B8%89%E8%A7%92%E5%BD%A2%E7%9A%84%E8%BE%B9.png)
Stack Exchange 上有人给我提供了以下代码,用于绘制一个三角形,其中一个顶点位于原点,两个角从正 x 轴绘制。我使用 WinEdt 对其进行编译。它给出了我不熟悉的错误消息。
"<"C:\Program Files/My Own Download\MiKTeX 2.7\tex\latex\amsfonts\umsa.fd">"
是否有我必须放在序言中的包?我还想将三角形的边标记为 a、b 和 c,并将顶点的坐标设为P = (\cos\phi, \sin\phi)
和Q = (\cos\theta, \sin\theta)
。
\documentclass{amsart}
\usepackage{}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{newlfont}
\usepackage{mathtools}
\usepackage{tikz}
\tikzset{
mydot/.style={
fill,
circle,
inner sep=1.5pt
}
}
\begin{document}
\begin{tikzpicture}[>=latex]
% the coordinates of the vertices
\coordinate (O) at (0,0);
\coordinate (A) at (2,1);
\coordinate (B) at (-3,5);
% the axis
\draw[help lines,->] (-3.5,0) -- (2.5,0);
\draw[help lines,->] (0,-0.5) -- (0,5.5);
% the edges of the triangle
\draw (O) -- (A) -- (B) -- cycle;
% labelling the vertices
\node[mydot,label={right:$A$}] at (A) {};
\node[mydot,label={left:$B$}] at (B) {};
\node[mydot,label={below:$O$}] at (O) {};
% the arcs for the angles
\begin{scope}[gray]
\draw[->]
(1,0) +(0:0.5cm) arc [radius=1cm,start angle=0,end angle=41] node[midway,right] {$\phi$};
\draw[->]
(0.5,0) +(0:0.25cm) arc [radius=0.75cm,start angle=0,end angle=122] node[midway,above] {$\theta$};
\end{scope}
\end{tikzpicture}
\end{document}
答案1
我在 WinEdt 中使用 MikTeX 2.9。您的代码编译得很好。我建议您更新您的发行版,或者至少更新amsmath
产生错误的软件包和相关软件包。关于问题的后半部分,请看这里:
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{newlfont}
\usepackage{mathtools}
\usepackage{tikz}
\tikzset{
mydot/.style={
fill,
circle,
inner sep=1.5pt
}
}
\begin{document}
\begin{tikzpicture}[>=latex]
% the coordinates of the vertices
\coordinate (O) at (0,0);
\coordinate (P) at (2,1);
\coordinate (Q) at (-3,5);
% the axis
\draw[help lines,->] (-3.5,0) -- (2.5,0);
\draw[help lines,->] (0,-0.5) -- (0,5.5);
% the edges of the triangle
\draw (O) -- node[pos=0.60,below] {$a$} (P) -- node[pos=0.45,above] {$b$} (Q) -- node[pos=0.60,left] {$c$} cycle;
% labelling the vertices
\node[mydot,label={right:$P = (\cos\phi, \sin\phi)$}] at (P) {};
\node[mydot,label={left:$Q = (\cos\theta, \sin\theta)$}] at (Q) {};
\node[mydot,label={below:$O$}] at (O) {};
% the arcs for the angles
\begin{scope}[gray]
\draw[->]
(1,0) +(0:0.5cm) arc [radius=1cm,start angle=0,end angle=41] node[midway,right] {$\phi$};
\draw[->]
(0.5,0) +(0:0.25cm) arc [radius=0.75cm,start angle=0,end angle=122] node[midway,above] {$\theta$};
\end{scope}
\end{tikzpicture}
\end{document}
输出如下所示: