请考虑这个MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node (C) [cylinder,rotate=180,draw,minimum height=4cm,minimum width=1.5cm] {};
\draw [thick,->] ([xshift=-20pt]C.top) -- ([xshift=-80pt]C.bottom) node {};
\draw [thick] ([xshift=-80pt]C.bottom) -- ([xshift=-30pt]C.bottom) node {};
\end{tikzpicture}
\end{document}
在您的帮助下,我想画出:
谢谢!
答案1
这非常简单,甚至土拨鼠都可以做到。(编辑:计算散射角。)
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,intersections,decorations.markings,angles,calc}
\begin{document}
\begin{tikzpicture}[thick,font=\sffamily]
\node[ellipse,draw,inner sep=0pt,minimum height=1.5cm,minimum width=4mm]
(L){};
\draw[name path=tube] (L.north) -- ++ (3,0) coordinate (A) node[above] {A}
-- ++ (-40:2) coordinate (B) node[right] {B}
-- ++ (-80:3)
[rotate=10]arc(0:-180:0.75 and 0.2)[rotate=0] -- ++(110:2) to[out=90,in=0] ++ (-0.5,0.5)
--(L.south);
\draw[dashed] (A) to[out=0,in=110,looseness=1.3] (B);
\path[name path=test ray] (L.center) -- ++ (4.5,0);
\draw[ultra thick,-latex,name intersections={of=tube and test ray},
postaction={decorate,decoration={markings,
mark=at position 2.5cm with {\draw[-latex] (-5pt,0) -- (0,0);}}}]
let \p1=($(intersection-1)-(A)$),\n1={2*atan2(\y1,\x1)} in
([xshift=-4mm]L.center) -- (intersection-1) -- ++ (\n1:2.5);
\draw[dashed,very thick,blue] (intersection-1) -- ($(intersection-1)!3!90:(B) $)
coordinate (x3);
\draw[dashed,very thick,red] (intersection-1) -- ($(intersection-1)!0.5cm!(B)$)
coordinate (x4);
\draw pic[draw=purple,angle radius=5mm] {angle=x4--intersection-1--x3};
\draw pic[draw=black,angle radius=5mm,pic text=$\theta$,
angle eccentricity=1.3] {angle=A--intersection-1--L};
\end{tikzpicture}
\end{document}