add tag
Anonymous 1123
I see picture in [this book]( I do not understand all the book. At this picture, I guess that is tangents from the point `A` to the sphere. How to draw this figure?
![ScreenHunter 96.png](/image?hash=cf51aef05327bbaa22a6ef318129c93d55bc96d054842e74e1de2126b67a7890)
Top Answer
user 3.14159
Since we have already examples of such pictures in which the axis of the cone points "upwards", basically all we need to do is to use such an example and introduce a nonzero `psi` angle. The `circle on sphere` pic is designed in such a way that it works in arbitrary orthonormal projections, at least it is supposed to, so we can use it as in the other pictures. And then one needs a tiny bit of trigonometry to figure out the latitude of the circle at which the tangents attach.
\begin{tikzpicture}[3d/install view={phi=40,theta=70,psi=-30},
	line cap=butt,line join=round,c/.style={circle,fill=white,draw,thin,inner sep=1pt},
	declare function={R=3;H=7;alpha=asin(R/H);r=R*cos(alpha);delta=200;t=2;}] 
  \path (0,0,0) coordinate[c,label={above:{$C$}}] (C)
	(0,0,{R*sin(alpha)}) coordinate (P)
	(0,0,H) coordinate[c,label={above left:{$A$}}] (A)
	(0,0,R) node[c] (N){} (0,0,-R) node[c] (S){}
	foreach \X [count=\Y] in {10,30,...,170} 
	 {({r*cos(delta+\X)},{r*sin(delta+\X)},{R*sin(alpha)}) coordinate (p\Y)
	 (A) edge[shorten >=-2em] (p\Y)}
	(0,{r*t},{H-t*(H-R*sin(alpha))}) coordinate (T') 
	(0,{-r*t},{H-t*(H-R*sin(alpha))}) coordinate (T) 
	(0,{r},{H-(H-R*sin(alpha))}) coordinate (U') 
	(0,{-r},{H-(H-R*sin(alpha))}) coordinate (U) 
	(C) pic[every path/.append style={thick}]{3d/circle on sphere={R=R,C={(C)},P={(P)}}}
	pic[behind path]{3d/circle on sphere={R=R,C={(C)},P={(C)},n={(1,0,0)}}}
	(N) edge[3d/hidden,behind path] (S)
	(C) edge[3d/hidden,behind path] (U); 
  \draw[3d/screen coords,thick] (C) circle[radius=R];	
   \draw[3d/hidden] (A) -- (U');
   \clip[3d/screen coords] (C) circle[radius=R];	
   \draw[3d/hidden] (A) -- (T');
   \clip[3d/screen coords,even odd clip] (C) circle[radius=R]
   	[generous outside path];	
   \draw[3d/visible] (U') -- (T');
  \draw[decoration={random steps,segment length=4mm},rounded corners] 
  	(A) -- (T) decorate {-- (T')};
![Screen Shot 2021-04-16 at 11.39.01 PM.png](/image?hash=4bcf29d3f3d3f177f311a1d35d3593a7b00a5d7e1cfc5fc4c5e94753743b7c4f)

P.S. What I did not know before writing this answer is that `behind path` also works for edges. It can be quite handy.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.