Code: Select all
\documentclass[border=2mm,tikz]{standalone}
\usepackage{fouriernc}
\usepackage{tikz-3dplot}
\usetikzlibrary{calc,backgrounds}
\usepackage{tkz-euclide,amsmath}
\usetkzobj{all}
\usepackage{pgfplots}
\begin{document}
%polar coordinates of visibility
\pgfmathsetmacro\th{60}
\pgfmathsetmacro\az{130}
\tdplotsetmaincoords{\th}{\az}
%parameters of the cone
\pgfmathsetmacro\R{3}
\pgfmathsetmacro\v{5}
\begin{tikzpicture} [scale=1, tdplot_main_coords, axis/.style={blue,thick}]
\path
coordinate (O) at (0,0,0)
coordinate (S) at (0,0,\v);
\coordinate (A) at ($(O) + (360/10:{\R} and {\R})$);
\coordinate (B) at ($(O) + (2*360/10:{\R} and {\R})$);
\coordinate (C) at ($(O) + (3*360/10:{\R} and {\R})$);
\coordinate (D) at ($(O) + (4*360/10:{\R} and {\R})$);
\coordinate (E) at ($(O) + (5*360/10:{\R} and {\R})$);
\coordinate (F) at ($(O) + (6*360/10:{\R} and {\R})$);
\coordinate (G) at ($(O) + (7*360/10:{\R} and {\R})$);
\coordinate (H) at ($(O) + (8*360/10:{\R} and {\R})$);
\coordinate (I) at ($(O) + (9*360/10:{\R} and {\R})$);
\coordinate (J) at ($(O) + (10*360/10:{\R} and {\R})$);
\tkzDrawPoints[fill = black,size = 5 pt](S,A,B,C,D,E,F,O,G,H,I,J)
% % computation of tangential points
\pgfmathsetmacro\cott{{cot(\th)}}
\pgfmathsetmacro\fraction{\R*\cott/\v}
\pgfmathsetmacro\angle{{acos(\fraction)}}
% % angles for transformed lines
\pgfmathsetmacro\PhiOne{180+(\az-90)+\angle}
\pgfmathsetmacro\PhiTwo{180+(\az-90)-\angle}
% % coordinates for transformed surface lines
\pgfmathsetmacro\sinPhiOne{{sin(\PhiOne)}}
\pgfmathsetmacro\cosPhiOne{{cos(\PhiOne)}}
\pgfmathsetmacro\sinPhiTwo{{sin(\PhiTwo)}}
\pgfmathsetmacro\cosPhiTwo{{cos(\PhiTwo)}}
% % angles for original surface lines
\pgfmathsetmacro\sinazp{{sin(\az-90)}}
\pgfmathsetmacro\cosazp{{cos(\az-90)}}
\pgfmathsetmacro\sinazm{{sin(90-\az)}}
\pgfmathsetmacro\cosazm{{cos(90-\az)}}
% % draw basis circle
\tdplotdrawarc[tdplot_main_coords,thick]{(O)}{\R}{\PhiOne}{360+\PhiTwo}{anchor=north}{}
\tdplotdrawarc[tdplot_main_coords,dashed]{(O)}{\R}{\PhiTwo}{\PhiOne}{anchor=north}{}
% % 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);
% % displaying original surface of the cone (rotated)
\draw[thick] (S) -- (A) (S) -- (B) (S) -- (C) (S)--(D) (S) -- (I) (S) -- (J) (S) -- (H);
\tkzDrawPolygon[dashed](A,B,C,D,E,F,G,H,I,J)
%\draw[dashed] (A) -- (B) --(C)--(D)--(E)--(F) --(G)--(H)-- (I)-- (J) --(A) --cycle;
\draw[dashed](S) --(E) (S) -- (F) (S) --(O) (S)--(G) (A)--(F) (B)--(G) (C)--(H) (D)--(I) (E)--(J);
%\tkzLabelPoints[right](S,A,B,C,D,E,F,G,H,I,J)
\tkzLabelPoints[above](S)
\tkzLabelPoints[below](O)
%\tkzFillPolygon[pattern=north west lines](A,B,C,D,E,F)
\end{tikzpicture}
\end{document}
Code: Select all
[code]\coordinate (A) at ($(O) + (360/10:{\R} and {\R})$);
\coordinate (B) at ($(O) + (2*360/10:{\R} and {\R})$);
\coordinate (C) at ($(O) + (3*360/10:{\R} and {\R})$);
\coordinate (D) at ($(O) + (4*360/10:{\R} and {\R})$);
\coordinate (E) at ($(O) + (5*360/10:{\R} and {\R})$);
\coordinate (F) at ($(O) + (6*360/10:{\R} and {\R})$);
\coordinate (G) at ($(O) + (7*360/10:{\R} and {\R})$);
\coordinate (H) at ($(O) + (8*360/10:{\R} and {\R})$);
\coordinate (I) at ($(O) + (9*360/10:{\R} and {\R})$);
\coordinate (J) at ($(O) + (10*360/10:{\R} and {\R})$);