I see at Add an angle to a sphere to draw a cone in 3D. I tried

 \pgfmathsetmacro{\R}{4} % radius
 \pgfmathsetmacro{\myang}{150} % latitude angle of the red circle
 \coordinate (O) at (0,0,0);

 \begin{scope}[canvas is xy plane at z={-\R*sin(\myang)},transform shape]
  % \angVis from https://tex.stackexchange.com/a/49589/121799
  \begin{scope}[on background layer]
   \draw[] (\angVis:{\R*cos(\myang)}) arc (\angVis:180-\angVis:{\R*cos(\myang)});
  \draw[dashed] (180-\angVis:{\R*cos(\myang)}) arc (180-\angVis:360+\angVis:{\R*cos(\myang)});
  \path (0:{\R*cos(\myang)}) coordinate (R) 
  (180:{\R*cos(\myang)}) coordinate (L);
 \begin{scope}[on background layer]
 \coordinate (H) at ($ (L)!0.5!(R) $);
   \draw[] (L) -- (O) (R) -- (O) ;
  \draw[dashed] (H) -- (O) (L) -- (R);
\fill (O) circle[radius=1pt] node[above] {$O$};
\fill (L) circle[radius=1pt] node[above] {$L$};
\fill (R) circle[radius=1pt] node[above] {$R$};

I got:

Enter image description here

I feel the edges OR and OL are not nice. How can I repair it?

  • 1
    there are post about this situation. Please search before asking! – Black Mild Aug 19 at 2:49

Your cone with R= 4 and \myang = 150, then hight of cone equal to r*sin(\myang) = 2. I use the code of this question at here How can I draw this cone exactly? to draw your cone

%polar coordinates of visibility
%parameters of the cone
\pgfmathsetmacro\R{4} %radius of base
\pgfmathsetmacro\v{2} %hight of cone
\begin{tikzpicture} [scale=1, tdplot_main_coords, axis/.style={blue,thick}]
coordinate (O) at (0,0,0)
coordinate (A) at ($(O) + (-70:{\R} and {\R})$)
coordinate (B) at ($ (O) - (A) $)
coordinate (S) at (0,0,\v)
\foreach \v/\position in { B/right,O/below,A/left,S/above} {\draw[draw =black, fill=black] (\v) circle (1pt) node [\position=0.2mm] {$\v$};
\draw[thick] (S) -- (A) (S) -- (B);
\draw[dashed] (A) -- (B) (S)--(O)  ;
\pgfmathsetmacro\fraction{\fraction<1 ? \fraction : 1}

% % angles for transformed lines

% % coordinates for transformed surface lines

% % angles for original surface lines

% % draw basis circle

% % displaying tranformed surface of the cone (rotated)
\draw[thick] (0,0,\v) -- (\R*\cosPhiOne,\R*\sinPhiOne,0);
\draw[thick] (0,0,\v) -- (\R*\cosPhiTwo,\R*\sinPhiTwo,0);

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.