TikZ-PGF – How to Draw a Mini Wave with TikZ Arrows for Physics

physicstikz-arrowstikz-pgf

I'm trying to draw the following figure using TikZ, but I'm stuck on how can I produce that red wave representing a photon :

enter image description here

Here's my code and what it produces :

\begin{tikzpicture}[>=stealth]
\filldraw[gray!40!white] (0,0)circle(0.3);
\draw[smooth] (0,0)circle(0.3);
\draw[smooth] (0,0)circle(1);
\draw[smooth] (0,0)circle(2);
\node[right] at (30:1) {$n=1$};
\node[right] at (30:2) {$n=2$};
\draw[->, smooth] (30:2)--(30:1);
\filldraw[black] (30:1)circle(0.025);
\filldraw[black] (30:2)circle(0.025);
\end{tikzpicture}

enter image description here

Any ideas on how to produce that ?

Best Answer

You can use \usetikzlibrary{snakes}:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{snakes}

\begin{document}

    \begin{tikzpicture}[->,>= stealth]

\draw[snake=snake,red] (0,0) -- (3,0) node[below,xshift=-1.5cm,yshift=-0.25cm] {$\Delta E=hv$};

    \end{tikzpicture}

\end{document}

enter image description here

You can achieve the same by using \usetikzlibrary{decorations.pathmorphing}:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
    
    \begin{tikzpicture}[->,>= stealth]
        
        \draw[decorate,decoration=snake,red]  (0,0) - - (3,0) node[below,xshift=-1.5cm,yshift=-0.25cm] {$\Delta E=hv$};
        
    \end{tikzpicture}
    
\end{document}

enter image description here