我怎样才能用 tikz 描绘以下内容?
使用以下最小示例
\usetikzlibrary{arrows,quotes,angles}
\begin{tikzpicture}
\draw[dashed] (0,0) node (v1) {} circle (4);
\draw
(3.815,-1.2) coordinate (a) node[right] {}
-- (0,0) coordinate (b) node[left] {}
-- (2.52,3.1) coordinate (c) node[above right] {}
pic["$y$", draw, <->, angle eccentricity=1.3, angle radius=1cm]
{angle=a--b--c};
\draw (b) -- (c) node [above,midway,sloped] {$x$};
\draw (a) -- (b) {};
\node [circle,fill=green] at (3.8,3) {};
\node [circle,fill=green] at (4,2) {};
\node [circle,fill=green] at (4.15,-0.5) {};
\node [triangle,fill=red] at (2.5,1.5){};
\end{tikzpicture}
- 首先,“\node[triangle...” 出现错误。
- 其次,我怎样才能像图中一样去除圆圈的下半部分。
答案1
像这样?
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{angles, arrows, quotes, shapes}
\begin{document}
\begin{tikzpicture}[
TR/.style = {isosceles triangle,fill=red, node contents={}}
]
\clip (-4,-2) rectangle + (9,6);
\draw[dashed] (0,0) coordinate (c) circle (4);
\draw (c) to ["$x$", sloped] ++ ( 75:4) coordinate (a)
(c) -- ++ (-15:4) coordinate (b)
pic["$y$", draw, <->, angle eccentricity=1.3, angle radius=1cm]
{angle=b--c--a};
\foreach \i in {0,15,...,60}
{
\fill[green] (\i:4.4) circle (1mm);
\path (\i:3) node[TR];
}
\end{tikzpicture}
\end{document}