I would like to get an image like this:enter image description here

with two spheres, intersecting a cone,the points on the intersections should also be highlighted in the way showed in figure.

I've tried to get this work with tikz-3dplot (documentation here) , but I haven't find any solution for the intersection problem.

Thanks in advance for any help you will give me.


1 Answer 1


Maybe this pgfplots diagram is sufficient.

\begin{tikzpicture}[declare function={R=3;D=11;c=0.9;s=sqrt(1-c*c);
\begin{axis}[xmin=-D/2-R,xmax=D/2+R,hide axis,
    axis equal,view={0}{20}]
 \addplot3[surf,shader=interp,domain=-L:L,domain y=0:360,z buffer=sort,
 colormap={bb}{color=(blue) color=(blue!20)},opacity=0.8] 
 \path (-D/2,0,0) coordinate(L)  (D/2,0,0) coordinate(R) 
  (1,0,0) coordinate (X) (0,0,0) coordinate (O);
\begin{scope}[on background layer]
 \shade[ball color=blue!20] let \p1=($(X)-(O)$) in
  (L)  circle[radius=R*\x1];
 \shade[ball color=blue!20] let \p1=($(X)-(O)$) in
  (R)  circle[radius=R*\x1];

enter image description here

  • @schrodingerscat you can now the « gym » library :)
    – JeT
    Commented May 26, 2020 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .