我想复制这张图片
但目前陷入困境:
- 圆弧(确保它们在半径与圆周相交处相交)
- 球体端盖的灰色阴影
以下是我目前所掌握的信息:
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\draw[dashed] (0,0) -- (2cm,0);
\draw (0,0) -- node[midway, anchor=south east] {$R$} ++(60:2cm);
\draw (0,0) -- ++(-60:2cm);
\draw[dashed] (0,0) ++(60:2cm) arc (20:-20:5.1);
\node at (0.35cm,0.25cm) {$\theta$};
\end{tikzpicture}
\end{document}
虽然虚线弧是一个临时解决方案,但还是很接近,而且我不知道如何在端盖上添加阴影...
答案1
这是一个解决方案。
它使用椭圆弧代替圆弧,因为这样看起来更真实。但也有圆弧的代码,只是注释掉了。
另外,它还可以为背景添加阴影,使其看起来更好。
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\draw[dashed] (0,0) -- (2cm,0);
\draw (0,0) -- node[midway, anchor=south east] {$R$} ++(60:2cm);
\draw (0,0) -- ++(-60:2cm);
% correct bounding box, the arc for the section foreground adds
% some invisible stuff, which extends it
\useasboundingbox (current bounding box);
% with circular arcs
%\draw[fill=gray,fill opacity=0.25] (2,0) ++(-120:2cm) arc (20:-20:-5.065) arc (60:-60:2cm);
%\draw[densely dashed,fill=gray,fill opacity=0.25] (0,0) ++(60:2cm) arc (20:-20:5.065) arc (-60:60:2cm);
% don't fill invisible part
%\draw[densely dashed] (0,0) ++(60:2cm) arc (20:-20:5.065);
% with elliptical arcs
\draw[fill=gray,fill opacity=0.25]
(0,0) ++(60:2cm) % start point
arc (90:-90:-0.3 and {2*sin(60)}) % arc for section, foreground
arc (-60:60:2cm); % arc for main circle
\draw[densely dashed,fill=gray,fill opacity=0.25]
(0,0) ++(60:2cm) % start point
arc (90:-90:0.3 and {2*sin(60)}) % arc for section, background
arc (-60:60:2cm); % arc for main circle
% don't fill background part
%\draw[densely dashed] (0,0) ++(60:2cm) arc (90:-90:0.3 and {2*sin(60)});
\node at (0.35cm,0.25cm) {$\theta$};
\end{tikzpicture}
\end{document}