0

I'd like to reproduce this image

but am currently getting stuck on:

  • the arcs (ensuring that they intersect where the radii meet the circumference)
  • the gray shading of the endcap of the sphere

Here's what I have so far:

\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}

Which is close, though the dashed arc is a kluge, and I don't know how to add shading to the endcap...

2

Here is a solution.

It uses elliptical arcs instead of circular arcs, because this looks more real. But there is also code for for circular arcs, just commented out.

It additionally also shades the background, again, to make it look better.

\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}

enter image description here

  • This is wonderful. I changed the radius of the elliptical arcs from 0.3 to 0.15 to reduce the overlap with the radii lines at +/-60 degrees. Thanks for the answer -- this example helps me better understand the use of arcs in tikz. – James Oct 3 '17 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.