我有一个三角形,它有一个 [clip] 路径,用于创建一个看起来像圆弧的圆来显示角度。我需要用一个节点标记它为 $\theta$。我该怎么做?当前代码将其置于 0,0。
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (0,3);
\coordinate (C) at (4,0);
\draw (A) -- (B) node[midway,left] {$o$} -- (C) node[midway,above] {$h$} -- cycle node[midway,below] {$a$};
\path[clip] (A) -- (B) -- (C) -- cycle;
\node[circle,draw=black,minimum size=40pt] at (C) (circ) {} node[above] {$\theta$};
\end{tikzpicture}
答案1
它们是表示角度的更好方法,例如库angles
。此外,可以使用命令绘制圆,\draw
而不是将其实现为空节点。
结果
代码
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (0,3);
\coordinate (C) at (4,0);
%
\draw[thick,line join=round]
(A) -- (B)
node[midway,left] {$o$}
-- (C)
node[midway,above] {$h$}
-- cycle
node[midway,below] {$a$}
node[pos=.18,above] {$\theta$};
\path[clip]
(A) -- (B) -- (C) -- cycle;
\draw (C) circle (30pt);
\end{tikzpicture}
\end{document}