2

I have the code (generously corrected by the stack)

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows.meta,bending}
\usepackage{xparse}
\usepackage{tikz}

\usetikzlibrary{3d}
\begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,
declare function={pX=2;}]
 \begin{scope}[canvas is yz plane at x=0]
 \draw (-pX,-pX) coordinate (bl1) -- (pX,-pX) coordinate (br1)
   -- (pX,pX) coordinate (tr1)  -- (-pX,pX) coordinate (tl1) -- cycle;
   \draw[stealth-stealth] (0,pX) node[below left]{$$}
   -- (0,0) --  (pX,0) node[below left]{$$};
   \pgflowlevelsynccm
 \end{scope}
 %\foreach \X in {bl,tl,br,tr}
 %{\draw[-latex] (\X1) -- ++ (1,0,0);}
 %
 %\draw (0,0,0) -- (4,0,0);
 % plane
  \fill[gray,fill opacity=0] (-1,-4,0) -- (7,-4,0) --
  (7,4,0) -- (-1,4,0) -- cycle;
 \begin{scope}[canvas is yz plane at x=4]
  \draw (-pX,-pX) coordinate (bl2) -- (pX,-pX) coordinate (br2)
   -- (pX,pX) coordinate (tr2)  -- (-pX,pX) coordinate (tl2) -- cycle;
   \draw[stealth-stealth];
 \end{scope}
 \draw[-latex] (4,0,0) -- (5.5,0,0) node[below left]{$$};
 %\foreach \X in {bl,tl,br,tr}
 %{\draw[-latex] (\X2) -- ++ (1,0,0);}
  \begin{scope}[canvas is xy plane at z=0]
   \begin{scope}
      \clip (0,-2) rectangle (4,3);
      \draw[densely dashed] (0,-2) -- (0,2);
      \foreach \X in {0.25,0.75,...,5}
       {\pgfmathsetmacro{\myrnd}{rnd*360}
       \foreach \Y in {-1.75,-1.25,...,1.75}
        {
        \draw[-stealth] ({\X-0.2*cos(\myrnd)},{\Y-0.2*sin(\myrnd)}) --
        ({\X+0.2*cos(\myrnd)},{\Y+0.2*sin(\myrnd)});
        }
        \draw[densely dashed] (\X+.25,-2) -- (\X+0.25,2);}
%       \foreach \X in {-2,-1.6,...,2}
%        {\draw (0,\X) parabola ++(5,1);}
   \end{scope} 
  \end{scope}
\end{tikzpicture}



\end{document}

which outputs enter image description here I'm wondering if it is possible to plot an incident polarised wave that looks like this, with wavelength equal to the separation between dashed lines, entering from the leftmost rectangle. enter image description here Then, as if the wave exits, starting from the right rectangle, it has a decaying, random amplitude, as if the space where the dashed lines are, sap energy and distort the wave. This is the end result I want enter image description here

With the help of SchrodingersCat, I have

\documentclass[tikz,border=3.14mm]{standalone}
    \usepackage{tikz-3dplot}
    \usetikzlibrary{arrows.meta,bending}
    \usepackage{xparse}
    \usepackage{tikz}

    \usetikzlibrary{3d}
    \begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,
declare function={pX=2;}]
 \begin{scope}[canvas is yz plane at x=0]
 \draw (-pX,-pX) coordinate (bl1) -- (pX,-pX) coordinate (br1)
   -- (pX,pX) coordinate (tr1)  -- (-pX,pX) coordinate (tl1) -- cycle;
   \draw[stealth-stealth] (0,pX) node[below left]{$$}
   -- (0,0) --  (pX,0) node[below left]{$$};
   \pgflowlevelsynccm
 \end{scope}
 %\foreach \X in {bl,tl,br,tr}
 %{\draw[-latex] (\X1) -- ++ (1,0,0);}
 %
 %\draw (0,0,0) -- (4,0,0);
 % plane
  \fill[gray,fill opacity=0] (-1,-4,0) -- (7,-4,0) --
  (7,4,0) -- (-1,4,0) -- cycle;
 \begin{scope}[canvas is yz plane at x=4]
  \draw (-pX,-pX) coordinate (bl2) -- (pX,-pX) coordinate (br2)
   -- (pX,pX) coordinate (tr2)  -- (-pX,pX) coordinate (tl2) -- cycle;
   \draw[stealth-stealth];
 \end{scope}
 %\draw[-latex] (4,0,0) -- (5.5,0,0) node[below left]{$$};
  \begin{scope}[canvas is xy plane at z=0]
   \begin{scope}
      \clip (0,-2) rectangle (4,3);
      \draw[densely dashed] (0,-2) -- (0,2);
      \foreach \X in {0.25,0.75,...,5}
       {\pgfmathsetmacro{\myrnd}{rnd*360}
       \foreach \Y in {-1.75,-1.25,...,1.75}
        {
        \draw[-stealth] ({\X-0.2*cos(\myrnd)},{\Y-0.2*sin(\myrnd)}) --
        ({\X+0.2*cos(\myrnd)},{\Y+0.2*sin(\myrnd)});
        }
        \draw[densely dashed] (\X+.25,-2) -- (\X+0.25,2);}
   \end{scope} 
  \end{scope}
%
\begin{scope}[shift={($(-4,0,0)-(0,0,0)$)}]
 \begin{scope}[canvas is xy plane at z=0,dashed]
   \foreach \X in {0.1,0.3,...,3.2}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (1*\X,0) -- (1*\X,{-sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (1*\x,{-sin(\x*180)});  
  \begin{scope}
   \pgflowlevelsynccm
   \draw[-latex,ultra thick,solid] (12.2,0) -- (12.8,0);
  \end{scope}
 \end{scope} 
 \begin{scope}[canvas is xz plane at y=0]
   \foreach \X in {0.1,0.3,...,3.2}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (1*\X,0) -- (1*\X,{sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (1*\x,{sin(\x*180)});   
 \end{scope} 
 \node at (1*3.5,1.75,0) {$$};
 \node at (1*3.5,0,-1.25) {$$};
\end{scope} 

%
\begin{scope}[shift={($(4,0,0)-(0,0,0)$)}]
 \begin{scope}[canvas is xy plane at z=0,dashed]
   \foreach \X in {0.4,0.6,...,3}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (1*\X,0) -- (1*\X,{-.2*sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (1*\x,{-.2*sin(\x*180)});  
  \begin{scope}
   \pgflowlevelsynccm
   \draw[-latex,ultra thick,solid] (12.2,0) -- (12.8,0);
  \end{scope}
 \end{scope} 
 \begin{scope}[canvas is xz plane at y=0]
   \foreach \X in {0.4,0.6,...,3}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (1*\X,0) -- (1*\X,{.5*sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (1*\x,{.5*sin(\x*180)});   
 \end{scope} 
 \node at (1*3.5,1.75,0) {$$};
 \node at (1*3.5,0,-1.25) {$$};
\end{scope} 

\end{tikzpicture}






\end{document}

which outputs enter image description here

2

One way to do that is

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{50}
\begin{tikzpicture}[tdplot_main_coords]
 \begin{scope}[canvas is xy plane at z=0,dashed]
   \foreach \X in {0.1,0.3,...,3.9}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (3*\X,0) -- (3*\X,{-2*sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (3*\x,{-2*sin(\x*180)});    
  \begin{scope}
   \pgflowlevelsynccm
   \draw[-latex,ultra thick,solid] (12.2,0) -- (12.8,0);
  \end{scope}
 \end{scope} 
 \begin{scope}[canvas is xz plane at y=0]
   \foreach \X in {0.1,0.3,...,3.9}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (3*\X,0) -- (3*\X,{2*sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (3*\x,{2*sin(\x*180)}); 
 \end{scope} 
 \node at (3*3.5,2.5,0) {$\vec B$};
 \node at (3*3.5,0,-2.5) {$\vec E$};
\end{tikzpicture}
\end{document}

enter image description here

You can add this to your picture like this:

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{20}
\begin{tikzpicture}[tdplot_main_coords,
declare function={pX=2;}]
 \begin{scope}[canvas is yz plane at x=0]
 \draw (-pX,-pX) coordinate (bl1) -- (pX,-pX) coordinate (br1)
   -- (pX,pX) coordinate (tr1)  -- (-pX,pX) coordinate (tl1) -- cycle;
   \draw[stealth-stealth] (0,pX) node[below left]{$$}
   -- (0,0) --  (pX,0) node[below left]{$$};
   \pgflowlevelsynccm
 \end{scope}
 %\foreach \X in {bl,tl,br,tr}
 %{\draw[-latex] (\X1) -- ++ (1,0,0);}
 %
 %\draw (0,0,0) -- (4,0,0);
 % plane
  \fill[gray,fill opacity=0] (-1,-4,0) -- (7,-4,0) --
  (7,4,0) -- (-1,4,0) -- cycle;
 \begin{scope}[canvas is yz plane at x=4]
  \draw (-pX,-pX) coordinate (bl2) -- (pX,-pX) coordinate (br2)
   -- (pX,pX) coordinate (tr2)  -- (-pX,pX) coordinate (tl2) -- cycle;
   \draw[stealth-stealth];
 \end{scope}
 \draw[-latex] (4,0,0) -- (5.5,0,0) node[below left]{$$};
  \begin{scope}[canvas is xy plane at z=0]
   \begin{scope}
      \clip (0,-2) rectangle (4,3);
      \draw[densely dashed] (0,-2) -- (0,2);
      \foreach \X in {0.25,0.75,...,5}
       {\pgfmathsetmacro{\myrnd}{rnd*360}
       \foreach \Y in {-1.75,-1.25,...,1.75}
        {
        \draw[-stealth] ({\X-0.2*cos(\myrnd)},{\Y-0.2*sin(\myrnd)}) --
        ({\X+0.2*cos(\myrnd)},{\Y+0.2*sin(\myrnd)});
        }
        \draw[densely dashed] (\X+.25,-2) -- (\X+0.25,2);}
   \end{scope} 
  \end{scope}
%
\begin{scope}[shift={($(-5,0,0)-(0,0,0)$)}]
 \begin{scope}[canvas is xy plane at z=0,dashed]
   \foreach \X in {0.1,0.3,...,3.9}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (1*\X,0) -- (1*\X,{-sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (1*\x,{-sin(\x*180)});  
  \begin{scope}
   \pgflowlevelsynccm
   \draw[-latex,ultra thick,solid] (12.2,0) -- (12.8,0);
  \end{scope}
 \end{scope} 
 \begin{scope}[canvas is xz plane at y=0]
   \foreach \X in {0.1,0.3,...,3.9}
    {\begin{scope}
      \pgflowlevelsynccm
      \draw[-latex,thick] (1*\X,0) -- (1*\X,{sin(\X*180)});
     \end{scope} 
    }
   \draw plot[smooth,domain=0:4,samples=41] (1*\x,{sin(\x*180)});   
 \end{scope} 
 \node at (1*3.5,1.75,0) {$\vec B$};
 \node at (1*3.5,0,-1.25) {$\vec E$};
\end{scope} 
\end{tikzpicture}
\end{document}

enter image description here

  • This is what I am looking for, but how can I insert this into my original frame? I have added a crudely drawn picture for reference – rodger_kicks Nov 14 at 15:10
  • 1
    @rodger_kicks Sure, I added it. – Schrödinger's cat Nov 14 at 15:20
  • Thanks so much. Okay. I have edited my post. I'm trying now to make the second wave have a random amplitude. I tried using /myrnd but it doesn't work. Is there something easier I can use? – rodger_kicks Nov 14 at 15:42
  • @rodger_kicks Would you mind asking a separate question on this? Asking questions is free, and I am afraid that after too many edits the answer will become useless for others. – Schrödinger's cat Nov 14 at 15:48

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.