I need to represent a gray sphere of radius R with a hollow circle defined by a cone of angle alpha, and I have the cone part but I do not know how to draw the sphere ....

I Have this:

\documentclass[10pt, letterpaper]{article}%tipo
\usepackage{amsmath, amsthm, amssymb}
    \usepackage{etex, tikz, tikz-3dplot, xcolor}
\draw[miverde] (-\rvec,0,\Rvec*\df) arc (180:360:\rvec);
\draw[red,line width=0.7pt,-latex](0,0,0)--(2,0,0)node[left]{$x$};
\draw[red,line width=0.7pt,-latex](0,0,0)--(0,2,0)node[right]{$y$};
\draw[red,line width=0.7pt,-latex](0,0,0)--(0,0,2)node[left]{$z$};
\draw[miverde] (\rvec,0,\Rvec*\df) arc (0:180:\rvec);

it's produced: enter image description here

I'd like it to look: enter image description here but centered at the origin, radio \Rvec and grayish, thanks in advance.

  • 2
    where should the sphere be? – percusse Mar 30 '15 at 20:33
  • @percusse centered at the origin and radius \Rvec thanks :) – Cristian Rodríguez Mar 30 '15 at 22:25

I didn't exactly understand how the end result should look like so kind of freestyled. The axes and the tick labels can be adjusted later but keep the sample numbers low when you are tweaking stuff. Otherwise it is really not fun waiting for compilation.

Basically what I tried is to draw a half sphere then the cone and then the remaining slice such that the z order is not killing the mood. Asymptote/MetaPost guys will spoil it anyways :)

axis lines=center,
axis on top,axis equal,
xlabel={$x$}, ylabel={$y$}, zlabel={$z$},
y domain=0:2*pi,
xmin=-1.5, xmax=1.5,
ymin=-1.5, ymax=1.5, zmin=-1,
samples y=20,
z buffer=sort,
colormap/blackwhite,point meta rel=per plot
\addplot3[surf,domain=-1:0.8,y domain=0:pi, colormap/hot,mesh/interior colormap name=blackwhite,opacity=0.8]({sqrt(1-x^2)*cos(deg(y))},{sqrt(1-x^2)*sin(deg(y))},x);
\addplot3[surf,colormap/blackwhite,mesh/interior colormap name=hot]({6/8*x*cos(deg(y))},{6/8*x*sin(deg(y))},{x});
\addplot3[surf,colormap/hot,domain=-1:0.8,opacity=0.8,y domain=-pi:-pi/2.5,mesh/interior colormap name=blackwhite]({sqrt(1-x^2)*cos(deg(y))},{sqrt(1-x^2)*sin(deg(y))},x);

enter image description here

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.