答案1
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{intersections}% <- not needed for the below code
\begin{document}
\begin{tikzpicture}[scale=1.7]
\begin{scope}
\clip (1,1) circle [radius=1];
\fill[gray] (0,0) arc[start angle=270,end angle=360,radius=2] |- cycle;
\end{scope}
\draw[semithick] (0,0) rectangle (2,2);
\draw[name path=f, semithick] (1,1) circle [radius=1];
\draw[name path=g, semithick] (0,0) arc[start angle=270,end angle=360,radius=2];
\end{tikzpicture}
\end{document}
答案2
答案3
另一种方法是先填充区域,然后绘制线条,而不用剪辑命令。
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[scale=1.7]
\fill[gray!50] (1,1) circle (1); % gray circle
\fill[white] (0,0) arc (270:360:2) -| cycle; % white sector over
\draw[semithick] (0,0) -- (2,0) -- (2,2) -- (0,2) -- cycle;
\draw[name path=f, semithick] (1,1) circle (1);
\draw[name path=g, semithick] (0,0) arc (270:360:2);
\end{tikzpicture}
\end{document}
由此得出以下结论