% Author: Izaak Neutelings (December 2020)% http://hyperphysics.phy-astr.gsu.edu/hbase/Waves/standw.html\documentclass[border=3pt,tikz]{standalone}\usepackage{amsmath}\usepackage{etoolbox} % ifthen\usepackage{tikz}\usetikzlibrary{arrows.meta} % for arrow size\tikzset{>=latex} % for LaTeX arrow head\colorlet{myred}{red!65!black}\colorlet{xcol}{blue!70!black}\colorlet{vcol}{green!60!black}\colorlet{Pcol}{orange!80!black}\colorlet{dense air}{Pcol!70!red!60}\colorlet{thin air}{brown!10}\tikzstyle{vvec}=[->,vcol,very thick,line cap=round]\tikzstyle{force}=[->,myred,thick,line cap=round]\tikzstyle{wood}=[very thick,brown!70!black]\tikzstyle{piston}=[blue!50!black,top color=blue!30,bottom color=blue!50,middle color=blue!20,shading angle=0]\tikzstyle{walldark}=[blue!20!black,top color=black!10!white!90!blue,bottom color=black!20!white!90!blue,shading angle=-30]\tikzstyle{wall}=[blue!20!black,top color=black!5!white!90!blue,bottom color=black!10!white!85!blue,shading angle=30]\def\tick#1#2{\draw[thick] (#1) ++ (#2:0.1) --++ (#2-180:0.2)}\tikzstyle{myarr}=[xcol!50,-{Latex[length=3,width=2]}]\begin{document}%% AIR PARTICLE DENSITY - test%\begin{tikzpicture}% \def\lam{2.0} % wavelength% \def\N{1000}% \fill[left color=white,right color=white,middle color=blue!80!black!30]% (0,0) rectangle (\lam/2,1);% \fill[left color=white,right color=white,middle color=blue!80!black!30]% (\lam/2,0) rectangle (\lam,1);% \draw (0,0) rectangle++ (\lam,1);% \foreach \i in {1,...,\N}{% \fill[blue!40!black] ({acos(-rand)*\lam/360},{(1+rand)/2}) circle(0.008);% \fill[blue!40!black] ({\lam/2+acos(-rand)*\lam/360},{(1+rand)/2}) circle(0.008);% }%\end{tikzpicture}
Click to download: waves_air.tex • waves_air.pdf
Open in Overleaf: waves_air.tex