答案1
Ascope
是你的朋友。你只能为里面的绘图设置选项,如旋转、缩放、原点等。
例如:
\documentclass[tikz,border=2mm]{standalone}
\tikzset
{% styles
my node/.style={midway,black},
my violet/.style={violet,fill=violet!#1},
my violet/.default=10,
}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round]
% dimensions
\def\r{4} % radius
\def\h{10} % height
\pgfmathsetmacro\a{asin(\r/\h)} % angle
\pgfmathsetmacro\g{sqrt(\h*\h-\r*\r)} % generatrix
% right figure
\draw[my violet] (-45:\r) arc (-45:225:\r) -- (0,0) -- cycle node[my node,below left] {$l$};
\draw[-latex] (-45:0.6) arc (-45:225:0.6) node[pos=0.35,above] {$\theta$};
% left figure
\begin{scope}[shift={(-10,0)},y=0.5cm,rotate=-20,scale=0.9]
\draw[my violet=20] (0,\h) -- (-70:\r) arc (-70:250:\r) -- cycle;
\draw[my violet] (0,\h) --++ (\a-90:\g) arc (\a:180-\a:\r) -- cycle node[my node,yshift=0.5cm] {$l$};
\end{scope}
\end{tikzpicture}
\end{document}
答案2
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{bending}
\begin{document}
\begin{tikzpicture}[very thick]
\filldraw[cyan, fill=cyan!20, rotate=-20, miter limit=1] (0,3) -- (-70:2 and 1) arc[x radius=2, y radius=1, start angle=-70, end angle=250] -- cycle;
\filldraw[cyan, fill=cyan!20, rotate=-20] (0,3) -- (20:2 and 1) arc[x radius=2, y radius=1, start angle=20, end angle=160] --node[black, above left]{$l$} cycle;
\filldraw[cyan, fill=cyan!20] (5,1) --node[black, pos=0.6, below left]{$l$} +(-40:2) arc[radius=2, start angle=-40, end angle=220] -- cycle;
\draw[-latex] (5,1) +(-40:0.6) arc[radius=0.6, start angle=-40, end angle=220] node[pos=0.3, above right]{$\theta$};
\end{tikzpicture}
\end{document}