Wave interference

optics_interference-001.pngoptics_interference-002.pngoptics_interference-003.pngoptics_interference-004.pngoptics_interference-005.png

Edit and compile if you like:

% Author: Izaak Neutelings (June 2020)
% Inspiration: https://tex.stackexchange.com/questions/285578/how-to-draw-parallelepiped-and-cube-with-latex/288101#288101
\documentclass[border=3pt,tikz]{standalone}
\usepackage[outline]{contour} % glow around text
\usepackage{xcolor}
\usepackage{etoolbox} %ifthen
\usetikzlibrary{arrows,arrows.meta}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{angles,quotes} % for pic (angle labels)
\tikzset{>=latex} % for LaTeX arrow head
\contourlength{1.6pt}

\colorlet{myblue}{blue!70!black}
\colorlet{myred}{red!65!black}
\colorlet{mypurple}{red!50!blue!95!black!75}
\colorlet{mylightgreen}{green!60!black!70}
\colorlet{mygreen}{green!60!black}
\colorlet{myredgrey}{red!50!black!80}
\tikzstyle{wave}=[myblue,thick]
\tikzstyle{mydashed}=[black!70,dashed,thin]
\tikzstyle{mymeas}=[{Latex[length=3,width=2]}-{Latex[length=3,width=2]},thin]



\begin{document}


% DESTRUCTIVE INTERFERENCE
\def\A{0.5}
\def\k{360}
\def\xmin{-0.3}
\def\xmax{4.4}
\def\h{2.3}
\def\lang{90}
\def\rang{270} % 720+270 = 990
\def\nsamples{200}
\begin{tikzpicture}
  %\def\angg{asin(\na/\ng*sin(\anga))}
  %\coordinate (O) at (0,0);
  
  % WAVE 1
  \draw[->,black]
    (\xmin,0) -- (1.06*\xmax,0);
  \draw[wave,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
    plot(\x,{\A*sin(\k*\x)});
  \node at (\xmax/2,-\h/2) {$+$};
  
  % WAVE 2
  \begin{scope}[shift={(0,-\h)}]
    \draw[->,black]
      (\xmin,0) -- (1.06*\xmax,0);
    \draw[wave,myred,variable=\x,samples=\nsamples,smooth,variable=\x,domain=\xmin:\xmax]
      plot(\x,{\A*sin(\k*\x+180)});
  \end{scope}
  \node at (\xmax/2,-1.5*\h) {$=$};
  
  % WAVE 3
  \begin{scope}[shift={(0,-2*\h)}]
    \draw[->,black]
      (\xmin,0) -- (1.06*\xmax,0);
    \draw[wave,mypurple]
      (\xmin,0) -- (\xmax,0);
  \end{scope}
  
  % DASHED
  \draw[mydashed]
    (\lang/\k,1.25*\A) -- (\lang/\k,-2*\h-2.3*\A);
  \draw[mydashed]
    (\rang/\k,1.25*\A) -- (\rang/\k,-2*\h-2.3*\A);
  \draw[mymeas,myredgrey]
    (\lang/\k,-2.15*\A) --++ (180/\k,0)
    node[midway,below,scale=0.8] {\contour{white}{$\Delta \phi=\frac{\pi}{2}$}};
  
\end{tikzpicture}


% PARTIAL INTERFERENCE
\begin{tikzpicture}
  \def\dphi{138}
  
  % WAVE 1
  \draw[->,black]
    (\xmin,0) -- (1.06*\xmax,0);
  \draw[wave,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
    plot(\x,{\A*sin(\k*\x)});
  \node at (\xmax/2,-\h/2) {$+$};
  
  % WAVE 2
  \begin{scope}[shift={(0,-\h)}]
    \draw[->,black]
      (\xmin,0) -- (1.06*\xmax,0);
    \draw[wave,myred,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
      plot(\x,{\A*sin(\k*\x-\dphi)});
  \end{scope}
  \node at (\xmax/2,-1.5*\h) {$=$};
  
  % WAVE 3
  \begin{scope}[shift={(0,-2*\h)}]
    \draw[->,black]
      (\xmin,0) -- (1.06*\xmax,0);
    \draw[wave,mypurple,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
      plot(\x,{2*cos(\dphi/2)*\A*sin(\k*\x-\dphi/2)});
  \end{scope}
  
  % DASHED
  \draw[mydashed]
    (\lang/\k,1.25*\A) -- (\lang/\k,-2*\h-2.3*\A);
  \draw[mydashed]
    (\rang/\k,1.25*\A) -- (\rang/\k,-2*\h-2.3*\A);
  \draw[mydashed,myredgrey]
    ({(\lang+\dphi)/\k},0.55*\A) -- ({(\lang+\dphi)/\k},-\h-1.3*\A);
  \draw[mymeas,myredgrey]
    (\lang/\k,-2.1*\A) --++ (\dphi/\k,0)
    node[midway,below,scale=0.8] {\contour{white}{$\Delta \phi$}};
  \draw[mymeas]
    (0.3*\xmin+\dphi/\k/2,-2*\h) --++ (0,{2*cos(\dphi/2)*\A})
    node[inner sep=-3,scale=0.8,below=4,left=4] %fill=white
      {$2A\cos\!\frac{\color{myredgrey}\Delta\phi}{2}$};
  
\end{tikzpicture}


% CONSTRUCTIVE INTERFERENCE
\begin{tikzpicture}
  
  % WAVE 1
  \draw[->,black]
    (\xmin,0) -- (1.06*\xmax,0);
  \draw[wave,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
    plot(\x,{\A*sin(\k*\x)});
  \node at (\xmax/2,-\h/2) {$+$};
  
  % WAVE 2
  \begin{scope}[shift={(0,-\h)}]
    \draw[->,black]
      (\xmin,0) -- (1.06*\xmax,0);
    \draw[wave,myred,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
      plot(\x,{\A*sin(\k*\x)});
  \end{scope}
  \node at (\xmax/2,-1.4*\h) {$=$};
  
  % WAVE 3
  \begin{scope}[shift={(0,-2*\h)}]
    \draw[->,black]
      (\xmin,0) -- (1.06*\xmax,0);
    \draw[wave,mypurple,variable=\x,samples=\nsamples,smooth,domain=\xmin:\xmax]
      plot(\x,{2*\A*sin(\k*\x)});
  \end{scope}
  
  % DASHED
  \draw[mydashed]
    (\lang/\k,1.25*\A) -- (\lang/\k,-2*\h-2.3*\A);
  \draw[mydashed]
    (\rang/\k,1.25*\A) -- (\rang/\k,-2*\h-2.3*\A);
  \draw[mymeas]
    (0.7*\xmin,-2*\h) --++ (0,2*\A)
    node[fill=white,midway,inner sep=1,scale=0.8] {$2A$};
  
\end{tikzpicture}


% POINT SOURCES
\begin{tikzpicture}[
    nodal/.style={mylightgreen,dashed,very thin},
    declare function={
      %xnode(\n,\dn,\lam,\f) = sqrt( (\n^2+(\n+\dn)^2)*\lambd^2/2 - (\n^2-(\n+\dn)^2)^2*\lambd^4/(4*\a^2) - \a^2/4 );
      xnode(\n,\dn,\lam,\f) = \lam/\f*sqrt( \n^2*(\f^2-\dn^2)+\n*\dn*(\f^2-\dn^2)+\dn^2*\f^2/2-(\f^4+\dn^4)/4 );
      ynode(\n,\dn,\lam,\a) = (2*\n*\dn+\dn^2)*\lam/(2*\f);
      intensity(\y,\lam,\a,\L) = cos(180*\a*\y/(2*\lam*sqrt(\L*\L+\y*\y)))^2;
    }
  ]
  
  %\def\W{2.2}
  %\def\H{2.2}
  \def\N{10}
  \def\lambd{0.28}
  \def\R{\N*\lambd}
  \def\a{1.0}
  \def\Nlines{3}
  \def\r{0.06}
  %\def\nmax{10}
  \def\nsamples{150}
  
  % NODAL LINES
  \draw[nodal]
    (-1.06*\R,0) -- (1.06*\R,0) node[mygreen,right] {$\Delta m=0$};
  % -1/2 + (1/0.44)/2 = 0.6363636364
  % -2/2 + (1/0.44)/2 = 0.1363636364
  % \c=int(\dn
Click to download: optics_interference.texoptics_interference.pdf
Open in Overleaf: optics_interference.tex

Leave a Reply

Your email address will not be published.