![如何在极坐标中对直线进行分段方程](https://linux22.com/image/409364/%E5%A6%82%E4%BD%95%E5%9C%A8%E6%9E%81%E5%9D%90%E6%A0%87%E4%B8%AD%E5%AF%B9%E7%9B%B4%E7%BA%BF%E8%BF%9B%E8%A1%8C%E5%88%86%E6%AE%B5%E6%96%B9%E7%A8%8B.png)
我可以画出两个圆圈,但我需要绘制两条线,$\theta = -\frac{\pi}{3}$ and $\theta = \frac{5\pi}{6}$
这样我才能得到所有点的区域。
\begin{center}
\begin{tikzpicture}[scale=0.75]
\begin{polaraxis}[xticklabel=$\pgfmathprintnumber{\tick}^\circ$,very thick]
\addplot[name path=r1, domain=0:360,samples=300,blue] {2} node[pos=0.35, above]{$r_1$};
\addplot[name path=r2, domain=0:360,samples=300,violet] {3} node[pos=0.2, below]{$r_2$};
\end{polaraxis}
\end{tikzpicture}
\end{center}
答案1
这些是极轴,因此你可以添加参数图,例如
\addplot[domain=2:3,red,samples=2] (-60,x);
\addplot[domain=2:3,cyan,samples=2] (150,x);
请注意,您不要在代码中使用命名路径(但我保留了密钥name path
)。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween,polar}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[scale=0.75]
\begin{polaraxis}[xticklabel=$\pgfmathprintnumber{\tick}^\circ$,very thick]
\addplot[name path=r1, domain=0:360,samples=300,blue] {2} node[pos=0.35, above]{$r_1$};
\addplot[name path=r2, domain=0:360,samples=300,violet] {3} node[pos=0.2, below]{$r_2$};
\addplot[domain=2:3,red,samples=2] (-60,x);
\addplot[domain=2:3,cyan,samples=2] (150,x);
\end{polaraxis}
\end{tikzpicture}
\end{document}