1

Please consider this 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}

Actual tube

With your help, I want to draw:

What I want

Thanks!

4

This is so simple that even marmots can do it. (EDIT: compute the scattering angle.)

\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}

enter image description here

  • 2
    Marmots are everywhere with nice answers! <3 – manooooh Oct 7 '18 at 0:47

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.