texlive[61562] Master: pgf-interference (10jan22)
commits+karl at tug.org
commits+karl at tug.org
Mon Jan 10 22:29:22 CET 2022
Revision: 61562
http://tug.org/svn/texlive?view=revision&revision=61562
Author: karl
Date: 2022-01-10 22:29:22 +0100 (Mon, 10 Jan 2022)
Log Message:
-----------
pgf-interference (10jan22)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/pgf-interference/
trunk/Master/texmf-dist/doc/latex/pgf-interference/README
trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.pdf
trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.tex
trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.pdf
trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.tex
trunk/Master/texmf-dist/tex/latex/pgf-interference/
trunk/Master/texmf-dist/tex/latex/pgf-interference/pgf-interference.sty
trunk/Master/tlpkg/tlpsrc/pgf-interference.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/pgf-interference/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-interference/README (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/pgf-interference/README 2022-01-10 21:29:22 UTC (rev 61562)
@@ -0,0 +1,22 @@
+The LaTeX package pgf-interference makes it possible to simulate interference
+patterns occuring on a screen if monochromatic light is diffracted at regular
+structures of slits. It makes use of the pgf/TikZ graphics package.
+
+The package is still in an experimental stage. The user interface may change in
+future versions.
+
+Package author: K. Wehr
+Version: 0.1
+Date: 9th January 2022
+
+The pgf-interference package is subject to the LaTeX Project Public License,
+version 1.3 or later.
+
+Files in the doc/ subtree:
+pgf-interference-de.pdf -- German manual
+pgf-interference-de.tex -- Source of the German manual
+pgf-interference-en.pdf -- English manual
+pgf-interference-en.tex -- Source of the English manual
+
+File in the tex/ subtree:
+pgf-interference.sty -- Package code
Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-interference/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.pdf 2022-01-10 21:28:10 UTC (rev 61561)
+++ trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.pdf 2022-01-10 21:29:22 UTC (rev 61562)
Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.tex 2022-01-10 21:29:22 UTC (rev 61562)
@@ -0,0 +1,344 @@
+% pgf-interference package: German manual
+% Version 0.1
+% 9. Januar 2022
+\documentclass{scrartcl}
+\usepackage[UKenglish,ngerman]{babel}
+\usepackage{pgf-interference}
+\usepackage{libertinus}
+\usepackage{cnltx-example}
+\usepackage{mathtools}
+\usepackage{pgfplots}
+\usepackage{worldflags}
+\usepackage[locale=DE,mode=match]{siunitx}
+\usepackage[colorlinks=true,
+ allcolors=black,
+ bookmarksopen=true,
+ bookmarksopenlevel=0,
+ bookmarksnumbered=true,
+ pdfencoding=auto,
+ pdftitle={Interferenzmuster zeichnen mit pgf/TikZ},
+ pdfsubject={Anleitung zum Paket pgf-interference},
+ pdfkeywords={latex pgf tikz Interferenz},
+ pdfauthor={K. Wehr}]{hyperref}
+
+\definecolor{pgfinterferencered}{wave}{632.8}
+
+\definecolorscheme{pgfinterferencecolorscheme}{cs => cnltxformalblue,
+ option => cnltxgreen,
+ cnltx => pgfinterferencered}
+
+\setcnltx{add-cmds = {pgfinterferenceoptions,pgfinterferencepattern},
+ color-scheme = pgfinterferencecolorscheme,
+ add-listings-options = {numbers=none},
+ pre-output = {\raggedright}}
+
+\makeatletter
+\setlength{\cnltx at before@skip}{5pt plus1pt minus1pt}
+\setlength{\cnltx at after@skip}{1pt plus1pt minus1pt}
+\makeatother
+
+\selectcolormodel{rgb}
+
+\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase]
+
+\pgfplotsset{compat=newest}
+\usetikzlibrary{angles}
+
+\newenvironment{Befehlsliste}{\begin{list}{}{
+ \setlength\leftmargin{0pt}
+ \setlength\itemindent{-1em}
+ \setlength\parsep{0pt}
+ \setlength\listparindent{\parindent}
+ \setlength\itemsep{\topsep}}}{\end{list}}
+
+\newcommand*\Befehlsbeschreibung[2]{\item\cs{#1}#2\\}
+
+\newcommand*\Optionsbeschreibung[3]{\item\choicekey{#1}{#2}
+ \hfill Voreinstellung:~\code{#3}\\}
+
+\newcommand*\OptionsbeschreibungZahl[2]{\item
+ \choicekey{#1}{\meta{Zahl}}
+ \hfill Voreinstellung:~\code{#2}\\}
+
+\newcommand*\Paket[1]{\textsf{#1}}
+\newcommand\inter{\textcolor{pgfinterferencered}{\Paket{pgf-interference}}}
+\newcommand\pgftikz{\Paket{\textsc{pgf}/Ti\textit{k}Z}}
+\newcommand\pakettikz{\Paket{Ti\textit{k}Z}}
+\newcommand\AutorNachname{Wehr}
+\newcommand\AutorVorname{Keno}
+
+\begin{document}
+
+\begin{center}
+\fontsize{41}{41}\selectfont\textsc{\inter}
+
+\medskip
+\pgfinterferencepattern{}
+
+\LARGE
+\rmfamily
+Interferenzmuster zeichnen mit \pgftikz
+
+\bigskip
+\Large
+\textcolor{pgfinterferencered}{Version 0.1}
+
+\medskip
+\large
+\today
+
+\bigskip
+\textit{Paketautor}
+
+\smallskip
+\AutorVorname\ \AutorNachname
+
+\bigskip
+\textit{Fragen und Fehlermeldungen}
+
+\smallskip
+\normalsize
+\url{https://codeberg.org/wehr/pgf-interference}
+\end{center}
+
+\begin{abstract}
+\noindent Mit diesem \LaTeX-Paket können Interferenzmuster, die bei Beugung von monochromatischem Licht an regelmäßigen Spaltanordnungen auf einem Schirm entstehen, simuliert werden. Hierfür wird das Graphikpaket \pgftikz\ verwendet.
+
+\medskip
+\noindent Das Paket ist noch im experimentellen Stadium. Die Nutzerschnittstelle kann sich in künftigen Versionen ändern.
+
+\medskip
+\noindent
+\worldflag[width=9pt,framewidth=0pt]{GB} \foreignlanguage{UKenglish}{An English version of this manual is available in the file \texttt{pgf-interference-en.pdf}.}
+\end{abstract}
+
+\vfill
+\tableofcontents
+
+\newpage
+\section{Einführung}
+Zu den eindrücklichsten Belegen für die Wellennatur des Lichts zählt das Auftreten von Interferenzmustern nach dem Durchgang durch feine Spaltanordnungen. Solche Interferenzmuster werden bereits im Physikunterricht der gymnasialen Oberstufe untersucht.
+
+Da in Physiksammlungen nur ein begrenzter Vorrat an Lichtquellen und Beugungsobjekten zur Verfügung steht, ist es wünschenswert, auch die Interferenzbilder für Wellenlängen und Spaltabmessungen, die nicht experimentell zugänglich sind, präsentieren zu können.
+\begin{center}
+\pgfinterferencepattern{wavelength=450e-9}
+
+\small
+Interferenzmuster für Licht der Wellenlänge
+\qty{450}{nm}
+hinter einem Doppelspalt
+
+\medskip
+\pgfinterferencepattern{wavelength=550e-9,slits=4,intensity=3}
+
+\small
+Interferenzmuster für Licht der Wellenlänge
+\qty{550}{nm}
+hinter einem Vierfachspalt
+
+\medskip
+\pgfinterferencepattern{slits=1,slit-width=5e-5,intensity=10}
+
+\small
+Interferenzmuster für Licht der Wellenlänge
+\qty{633}{nm}
+hinter einem Einzelspalt
+\end{center}
+
+Das Paket \inter\ macht dies möglich. Unterstützt werden nur monochromatisches Licht und regelmäßige Spaltanordnungen (Einzel-, Doppel- und Mehrfachspalte). Auch können bisher nur Interferenzstreifen dargestellt werden, wie sie bei vertikaler Aufweitung des Lichts entstehen, nicht die typischen „Interferenzkuller“, die von einem Laserstrahl erzeugt werden.
+
+Das Paket unterliegt der
+\emph{\LaTeX\ Project Public License},
+Version 1.3 oder Nachfolgeversion.%
+\footnote{\url{http://www.latex-project.org/lppl.txt}}
+
+\newpage
+\section{Verwendung}
+Das Paket wird wie üblich geladen:
+\begin{sourcecode}
+ \usepackage{pgf-interference}
+\end{sourcecode}
+Damit wird indirekt auch das Paket \pakettikz{} geladen.
+
+Das Übersetzen von Dokumenten mit vielen Interferenzmustern kann aufgrund der nötigen Berechnungen lange dauern. Daher gibt es einen Entwurfsmodus, in dem nur der Schirm, aber kein Interferenzmuster gezeichnet wird, was wesentlich schneller geht. Der Entwurfsmodus wird durch die Paketoption
+\code{draft} aktiviert.
+\begin{sourcecode}
+ \usepackage[draft]{pgf-interference}
+\end{sourcecode}
+
+Das Paket \inter{} definiert zwei Befehle:
+\begin{Befehlsliste}
+\Befehlsbeschreibung{pgfinterferencepattern}{\marg{Optionen}}
+Erzeugt ein Interferenzmuster. Das Argument ist eine kommaseparierte Optionenliste. Die verfügbaren Optionen werden im Abschnitt \ref{Optionen} beschrieben.
+\begin{example}
+ \pgfinterferencepattern{slits=3,wavelength=590e-9,slit-distance=3e-5,intensity=2}
+\end{example}
+\Befehlsbeschreibung{pgfinterferenceoptions}{\marg{Optionen}}
+Legt Optionen fest, ohne ein Interferenzmuster zu zeichnen.
+\begin{sourcecode}
+ \pgfinterferenceoptions{slit-width=1e-6,screen-distance=3.5,screen-width=0.15}
+\end{sourcecode}
+\end{Befehlsliste}
+
+\newpage
+\section{Optionen\label{Optionen}}
+\pgfinterferenceoptions{screen-width=0.05,screen-height=0.015}
+Alle Längen des Experiments wie die Wellenlänge, der Spaltabstand, die Schirmbreite usw. sind in Metern anzugeben, wobei die wissenschaftliche Schreibweise verwendet werden kann. Beispielsweise kann ein Spaltabstand von
+\qty{0,1}{mm}
+als
+\code{0.0001}, \code{0.1e-3} oder \code{1e-4} eingegeben werden.\footnote{Die Längen werden intern als Gleitkommazahlen des \Paket{expl3}-Moduls \Paket{l3fp} behandelt, dessen Syntax daher auch für die Eingabe gilt.}
+
+\subsection{Optionen für das Licht}
+\begin{Befehlsliste}
+\OptionsbeschreibungZahl{wavelength}{632.8e-9}
+Wellenlänge des Lichts in \unit{m}. Die Voreinstellung entspricht der Wellenlänge des Helium-Neon-Lasers
+(\qty{632,8}{nm}).
+Aus der Wellenlänge ergibt sich nicht nur die Lage, sondern auch die Farbe der Interferenzmaxima, die mit Hilfe des Pakets \Paket{xcolor} ermittelt wird.
+
+Für Wellenlängen außerhalb des sichtbaren Bereichs werden die Maxima schwarz dargestellt.\footnote{Nach dem Algorithmus des Pakets \Paket{xcolor} ist dies für Wellenlängen unter
+\qty{363}{nm}
+und über
+\qty{814}{nm} der Fall.}
+Um solche Maxima sichtbar zu machen, sollte weiße Schirmfarbe eingestellt werden. Die größtmögliche Wellenlänge ist
+\qty{1}{m}.
+\begin{sidebyside}
+ \pgfinterferencepattern{wavelength=590e-9}
+ \pgfinterferencepattern{wavelength=350e-9,screen-color=white}
+\end{sidebyside}
+\OptionsbeschreibungZahl{intensity}{1.0}
+Relative Intensität des Lichts. Falls nicht alle erwarteten Maxima sichtbar sind, sollte der Wert vergrößert werden.
+\begin{sidebyside}
+ \pgfinterferencepattern{slits=5}
+ \pgfinterferencepattern{slits=5,intensity=6.5}
+\end{sidebyside}
+\end{Befehlsliste}
+
+\subsection{Optionen für das Beugungsobjekt}
+\begin{Befehlsliste}
+\OptionsbeschreibungZahl{slits}{2}
+Anzahl der Spalte
+\begin{sidebyside}
+ \pgfinterferencepattern{slits=3}
+ \pgfinterferencepattern{slits=20}
+\end{sidebyside}
+\OptionsbeschreibungZahl{slit-distance}{1e-4}
+Spaltabstand in m
+\begin{sidebyside}
+ \pgfinterferencepattern{slit-distance=2e-4}
+ \pgfinterferencepattern{slit-distance=5e-5}
+\end{sidebyside}
+\OptionsbeschreibungZahl{slit-width}{1e-5}
+Spaltbreite in m
+\begin{sidebyside}
+ \pgfinterferencepattern{slit-width=2e-5}
+ \pgfinterferencepattern{slit-width=3.5e-5}
+\end{sidebyside}
+\end{Befehlsliste}
+
+\subsection{Optionen für den Schirm}
+\begin{Befehlsliste}
+\OptionsbeschreibungZahl{screen-distance}{1.0}
+Abstand des Schirms vom Beugungsobjekt in m
+\begin{sidebyside}
+ \pgfinterferencepattern{screen-distance=0.8}
+ \pgfinterferencepattern{screen-distance=1.6}
+\end{sidebyside}
+\OptionsbeschreibungZahl{screen-width}{0.1}
+Breite des Schirms in m
+\OptionsbeschreibungZahl{screen-height}{0.03}
+Höhe des Schirms in m
+\OptionsbeschreibungZahl{scale}{1.0}
+Faktor, um den der Schirm in der Abbildung skaliert wird
+
+Die Maße für Breite und Höhe beziehen sich auf den realen Schirm. Die Größe des Schirms in der Abbildung hängt vom Wert der Option \option{scale} ab.
+\begin{sidebyside}
+ \pgfinterferencepattern{screen-width=0.06,screen-height=0.01}
+ \pgfinterferencepattern{slits=10,slit-distance=2e-6,slit-width=2e-7,screen-width=2,screen-height=0.5,scale=0.03}
+\end{sidebyside}
+\Optionsbeschreibung{screen-color}{\meta{Farbe}}{black}
+Farbe des Schirms. Für die Farbe gilt die Syntax des \Paket{xcolor}-Pakets.
+\begin{sidebyside}
+ \pgfinterferencepattern{screen-color=yellow}
+ \pgfinterferencepattern{screen-color=green!25!black}
+\end{sidebyside}
+\Optionsbeschreibung{ruler}{above,below,screen,none}{none}
+Oberhalb oder unterhalb des Schirms kann ein Lineal mit Zentimeterskala angezeigt werden.
+
+Mit \code{ruler=screen} dient das Lineal selbst als Schirm. In diesem Fall werden die Optionen \option{screen-height} und \option{screen-color} ignoriert.
+\begin{example}
+ \pgfinterferenceoptions{screen-width=0.135,screen-height=0.025}
+ \pgfinterferencepattern{ruler=above}
+ \pgfinterferencepattern{ruler=below,scale=0.8}
+ \pgfinterferencepattern{ruler=screen}
+\end{example}
+\end{Befehlsliste}
+
+\section{Physikalische Theorie}
+Für die Intensität des in Richtung $\varphi$ gebeugten Lichts hinter einem Mehrfachspalt geben die Lehrbücher (z.\,B. \cite{BS}, S. 373) folgende Formel an:
+\begin{equation}
+I(\varphi)\sim\frac{\sin^2\bigl(\frac{\pi\,b}{\lambda}\,\sin\varphi\bigr)}{\bigl(\frac{\pi\,b}{\lambda}\,\sin\varphi\bigr)^2}\cdot\frac{\sin^2\bigl(\frac{p\,\pi}{\lambda}\,s\,\sin\varphi\bigr)}{\sin^2\bigl(\frac{\pi}{\lambda}\,s\,\sin\varphi\bigr)}\label{Winkelabhaengigkeit}
+\end{equation}
+Dabei ist $b$ die Spaltbreite, $s$ der Spaltabstand und $p$ die Anzahl der Spalte.
+
+Der erste Faktor beschreibt die Intensitätsverteilung in Folge der Beugung am Einzelspalt, der zweite die Interferenz am idealen Mehrfachspalt (siehe Abb.
+\ref{Intensitaetsverteilung}).
+\begin{figure}
+\centering
+\begin{minipage}{13,4cm}
+\raggedleft
+\begin{tikzpicture}
+\begin{axis}[xmin=-2.5,xmax=2.5,ymin=0,ymax=1.2,xlabel=$\varphi$,ylabel=Intensität in Skt.,xtick={-2,...,2},xticklabels={\ang{-2},\ang{-1},\ang{0},\ang{1},\ang{2}},yticklabels=\empty,x=2.5cm,y=5.5cm]
+\addplot[domain=-2.5:2.5,samples=500,blue] {(sin(180*3e-5/632.8e-9*sin(x)))^2/(pi*3e-5/632.8e-9*sin(x))^2};
+\addplot[domain=-2.5:2.5,samples=700,green] {(sin(4*180/632.8e-9*1e-4*sin(x)))^2/(sin(180/632.8e-9*1e-4*sin(x)))^2/16};
+\addplot[domain=-2.5:2.5,samples=700,thick,red] {(sin(180*3e-5/632.8e-9*sin(x)))^2/(pi*3e-5/632.8e-9*sin(x))^2*(sin(4*180/632.8e-9*1e-4*sin(x)))^2/(sin(180/632.8e-9*1e-4*sin(x)))^2/16};
+\legend{Einzelspalt,idealer Vierfachspalt,realer Vierfachspalt}
+\end{axis}
+\end{tikzpicture}
+
+\medskip
+\pgfinterferencepattern{slits=4,slit-width=3e-5,screen-distance=1.431,screen-width=0.125,screen-height=0.025,intensity=6}
+\end{minipage}
+\caption{Intensitätsverteilung und Interferenzmuster für einen Vierfachspalt mit Spaltabstand
+\qty{0,1}{mm}
+und Spaltbreite
+\qty{30}{\micro\m}
+bei einer Wellenlänge von
+\qty{632,8}{nm}\label{Intensitaetsverteilung}}
+\end{figure}
+
+\begin{figure}
+\centering
+\begin{tikzpicture}[font=\small]
+\draw[thick] (-3,5)--node[above] {Schirm} (3,5);
+\draw (0,0) coordinate (O)--node[left] {$a$} (0,5) coordinate(A);
+\draw (0,0)--node[right] {$e$} (2,5) coordinate (B);
+\draw[dotted,thick] (-2,0)--node[below] {Beugungsobjekt} (2,0);
+\path (A)--node[below] {$x$} (B);
+\draw pic[draw,angle radius=1.4cm,pic text={$\varphi$}] {angle=B--O--A};
+\end{tikzpicture}
+\caption{Zusammenhang zwischen Beugungswinkel
+$\varphi$
+und Position
+$x$
+auf dem Schirm
+\label{Dreieck}}
+\end{figure}
+Für die Darstellung des Interferenzmusters benötigen wir die Intensität in Abhängigkeit von der Position $x$ auf dem Schirm. Aus Abb. \ref{Dreieck} ergibt sich
+\begin{equation}
+\sin\varphi=\frac{x}{e}=\frac{x}{\sqrt{a^2+x^2}}\label{Sinus}
+\end{equation}
+mit dem Schirmabstand $a$. Durch Einsetzen von
+\eqref{Sinus}
+in
+\eqref{Winkelabhaengigkeit}
+ergibt sich:
+\[I(x)\sim\frac{\sin^2\left(\frac{\pi\,b\,x}{\lambda\,\sqrt{a^2+x^2}}\right)}{\left(\frac{\pi\,b\,x}{\lambda\,\sqrt{a^2+x^2}}\right)^2}\cdot\frac{\sin^2\left(\frac{p\,\pi\,s\,x}{\lambda\,\sqrt{a^2+x^2}}\right)}{\sin^2\left(\frac{\pi\,s\,x}{\lambda\,\sqrt{a^2+x^2}}\right)}\]
+Diese Formel ist die Grundlage für die Berechnung der Interferenzmuster.
+
+Unberücksichtigt bleibt die Verminderung der Intensität durch steigenden Abstand vom Beugungsobjekt mit steigendem $x$.
+
+\begin{thebibliography}{9}
+\bibitem{BS} Bergmann/Schaefer: Lehrbuch der Experimentalphysik. Band 3: Optik, hrsg. von Heinrich Gobrecht, \textsuperscript{7}1978.
+\end{thebibliography}
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-de.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.pdf 2022-01-10 21:28:10 UTC (rev 61561)
+++ trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.pdf 2022-01-10 21:29:22 UTC (rev 61562)
Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.tex 2022-01-10 21:29:22 UTC (rev 61562)
@@ -0,0 +1,344 @@
+% pgf-interference package: English manual
+% Version 0.1
+% 9. Januar 2022
+\documentclass{scrartcl}
+\usepackage[UKenglish]{babel}
+\usepackage{pgf-interference}
+\usepackage{libertinus}
+\usepackage{cnltx-example}
+\usepackage{mathtools}
+\usepackage{pgfplots}
+\usepackage{worldflags}
+\usepackage[locale=UK,mode=match]{siunitx}
+\usepackage[colorlinks=true,
+ allcolors=black,
+ bookmarksopen=true,
+ bookmarksopenlevel=0,
+ bookmarksnumbered=true,
+ pdfencoding=auto,
+ pdftitle={Drawing interference patterns with pgf/TikZ},
+ pdfsubject={Manual for the pgf-interference package},
+ pdfkeywords={latex pgf tikz interference},
+ pdfauthor={K. Wehr}]{hyperref}
+
+\definecolor{pgfinterferencered}{wave}{632.8}
+
+\definecolorscheme{pgfinterferencecolorscheme}{cs => cnltxformalblue,
+ option => cnltxgreen,
+ cnltx => pgfinterferencered}
+
+\setcnltx{add-cmds = {pgfinterferenceoptions,pgfinterferencepattern},
+ color-scheme = pgfinterferencecolorscheme,
+ add-listings-options = {numbers=none},
+ pre-output = {\raggedright}}
+
+\makeatletter
+\setlength{\cnltx at before@skip}{5pt plus1pt minus1pt}
+\setlength{\cnltx at after@skip}{1pt plus1pt minus1pt}
+\makeatother
+
+\selectcolormodel{rgb}
+
+\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase]
+
+\pgfplotsset{compat=newest}
+\usetikzlibrary{angles}
+
+\newenvironment{Befehlsliste}{\begin{list}{}{
+ \setlength\leftmargin{0pt}
+ \setlength\itemindent{-1em}
+ \setlength\parsep{0pt}
+ \setlength\listparindent{\parindent}
+ \setlength\itemsep{\topsep}}}{\end{list}}
+
+\newcommand*\Befehlsbeschreibung[2]{\item\cs{#1}#2\\}
+
+\newcommand*\Optionsbeschreibung[3]{\item\choicekey{#1}{#2}
+ \hfill Default:~\code{#3}\\}
+
+\newcommand*\OptionsbeschreibungZahl[2]{\item
+ \choicekey{#1}{\meta{number}}
+ \hfill Default:~\code{#2}\\}
+
+\newcommand*\Paket[1]{\textsf{#1}}
+\newcommand\inter{\textcolor{pgfinterferencered}{\Paket{pgf-interference}}}
+\newcommand\pgftikz{\Paket{\textsc{pgf}/Ti\textit{k}Z}}
+\newcommand\pakettikz{\Paket{Ti\textit{k}Z}}
+\newcommand\AutorNachname{Wehr}
+\newcommand\AutorVorname{Keno}
+
+\begin{document}
+
+\begin{center}
+\fontsize{41}{41}\selectfont\textsc{\inter}
+
+\medskip
+\pgfinterferencepattern{}
+
+\LARGE
+\rmfamily
+Drawing interference patterns with \pgftikz
+
+\bigskip
+\Large
+\textcolor{pgfinterferencered}{Version 0.1}
+
+\medskip
+\large
+\today
+
+\bigskip
+\textit{Package author}
+
+\smallskip
+\AutorVorname\ \AutorNachname
+
+\bigskip
+\textit{Questions and bug reports}
+
+\smallskip
+\normalsize
+\url{https://codeberg.org/wehr/pgf-interference}
+\end{center}
+
+\begin{abstract}
+\noindent This \LaTeX\ package makes it possible to simulate interference patterns occuring on a screen if monochromatic light is diffracted at regular structures of slits. It makes use of the \pgftikz\ graphics package.
+
+\medskip
+\noindent The package is still in an experimental stage. The user interface may change in future versions.
+
+\medskip
+\noindent
+\worldflag[width=9pt,framewidth=0pt]{DE} A German version of this manual is available in the file \texttt{pgf-interference-de.pdf}.
+\end{abstract}
+
+\vfill
+\tableofcontents
+
+\newpage
+\section{Introduction}
+The occurence of interference patterns after passing through fine structures of slits gives impressive evidence for the wave nature of light. Such interference patterns are already examined in physics lessons in upper secondary school.
+
+As only a limited stock of light sources and diffraction objects is available in physics collections, it is desirable to be able to present the interference images for wavelengths and slit dimensions that are not experimentally accessible.
+\begin{center}
+\pgfinterferencepattern{wavelength=450e-9}
+
+\small
+Interference pattern for light with a wavelength of
+\qty{450}{nm}
+behind a double slit
+
+\medskip
+\pgfinterferencepattern{wavelength=550e-9,slits=4,intensity=3}
+
+\small
+Interference pattern for light with a wavelength of
+\qty{550}{nm}
+behind a quadruple slit
+
+\medskip
+\pgfinterferencepattern{slits=1,slit-width=5e-5,intensity=10}
+
+\small
+Interference pattern for light with a wavelength of
+\qty{633}{nm}
+behind a single slit
+\end{center}
+
+The \inter\ package makes this possible. Only monochromatic light and regular slit structures (single, double, and multiple slits) are supported. Also, so far only interference fringes can be displayed, as they occur when the light is expanded vertically, not the typical “interference dots” generated by a laser beam.
+
+The package is subject to the
+\emph{\LaTeX\ Project Public License},
+version 1.3 or later.%
+\footnote{\url{http://www.latex-project.org/lppl.txt}}
+
+\newpage
+\section{Usage}
+The package is loaded as usual:
+\begin{sourcecode}
+ \usepackage{pgf-interference}
+\end{sourcecode}
+This also loads the \pakettikz{} package indirectly.
+
+Compiling documents with many interference patterns can take a long time due to the calculations involved. Therefore, there is a draft mode in which only the screen is drawn, but no interference pattern, which is much faster. The draft mode is activated by the package option
+\code{draft}.
+\begin{sourcecode}
+ \usepackage[draft]{pgf-interference}
+\end{sourcecode}
+
+The \inter{} package defines two commands:
+\begin{Befehlsliste}
+\Befehlsbeschreibung{pgfinterferencepattern}{\marg{options}}
+Generates an interference pattern. The argument is a comma-separated list of options. The available options are described in section \ref{Optionen}.
+\begin{example}
+ \pgfinterferencepattern{slits=3,wavelength=590e-9,slit-distance=3e-5,intensity=2}
+\end{example}
+\Befehlsbeschreibung{pgfinterferenceoptions}{\marg{options}}
+Sets options without drawing an interference pattern.
+\begin{sourcecode}
+ \pgfinterferenceoptions{slit-width=1e-6,screen-distance=3.5,screen-width=0.15}
+\end{sourcecode}
+\end{Befehlsliste}
+
+\newpage
+\section{Options\label{Optionen}}
+\pgfinterferenceoptions{screen-width=0.05,screen-height=0.015}
+All lengths of the experiment such as the wavelength, the slit distance, the screen width, etc.\@ are to be given in metres, possibly using the scientific notation. For example, a slit distance of
+\qty{0,1}{mm}
+can be typed in as
+\code{0.0001}, \code{0.1e-3}, or \code{1e-4}.\footnote{The lengths are internally treated as floating point numbers of the \Paket{expl3} module \Paket{l3fp}, whose syntax therefore also applies to the input.}
+
+\subsection{Options for the light}
+\begin{Befehlsliste}
+\OptionsbeschreibungZahl{wavelength}{632.8e-9}
+Wavelength of the light in \unit{m}. The default setting corresponds to the wavelength of the helium-neon laser
+(\qty{632,8}{nm}).
+The wavelength does not only influence the position but also the colour of the interference maxima, which is determined with the help of the \Paket{xcolor} package.
+
+For wavelengths outside the visible range, the maxima are shown in black.\footnote{According to the algorithm of the \Paket{xcolor} package, this is the case for wavelengths below
+\qty{363}{nm}
+and above
+\qty{814}{nm}.}
+In order to make such maxima visible, the screen colour should be set to white. The longest possible wavelength is
+\qty{1}{m}.
+\begin{sidebyside}
+ \pgfinterferencepattern{wavelength=590e-9}
+ \pgfinterferencepattern{wavelength=350e-9,screen-color=white}
+\end{sidebyside}
+\OptionsbeschreibungZahl{intensity}{1.0}
+Relative intensity of the light. If not all expected maxima are visible, the value should be increased.
+\begin{sidebyside}
+ \pgfinterferencepattern{slits=5}
+ \pgfinterferencepattern{slits=5,intensity=6.5}
+\end{sidebyside}
+\end{Befehlsliste}
+
+\subsection{Options for the diffraction object}
+\begin{Befehlsliste}
+\OptionsbeschreibungZahl{slits}{2}
+Number of slits
+\begin{sidebyside}
+ \pgfinterferencepattern{slits=3}
+ \pgfinterferencepattern{slits=20}
+\end{sidebyside}
+\OptionsbeschreibungZahl{slit-distance}{1e-4}
+Slit distance in m
+\begin{sidebyside}
+ \pgfinterferencepattern{slit-distance=2e-4}
+ \pgfinterferencepattern{slit-distance=5e-5}
+\end{sidebyside}
+\OptionsbeschreibungZahl{slit-width}{1e-5}
+Slit width in m
+\begin{sidebyside}
+ \pgfinterferencepattern{slit-width=2e-5}
+ \pgfinterferencepattern{slit-width=3.5e-5}
+\end{sidebyside}
+\end{Befehlsliste}
+
+\subsection{Options for the screen}
+\begin{Befehlsliste}
+\OptionsbeschreibungZahl{screen-distance}{1.0}
+Distance of the screen from the diffraction object in m
+\begin{sidebyside}
+ \pgfinterferencepattern{screen-distance=0.8}
+ \pgfinterferencepattern{screen-distance=1.6}
+\end{sidebyside}
+\OptionsbeschreibungZahl{screen-width}{0.1}
+Width of the screen in m
+\OptionsbeschreibungZahl{screen-height}{0.03}
+Height of the screen in m
+\OptionsbeschreibungZahl{scale}{1.0}
+Factor by which the screen is scaled in the figure
+
+The dimensions for width and height refer to the real screen. The size of the screen in the figure depends on the value of the \option{scale} option.
+\begin{sidebyside}
+ \pgfinterferencepattern{screen-width=0.06,screen-height=0.01}
+ \pgfinterferencepattern{slits=10,slit-distance=2e-6,slit-width=2e-7,screen-width=2,screen-height=0.5,scale=0.03}
+\end{sidebyside}
+\Optionsbeschreibung{screen-color}{\meta{colour}}{black}
+Colour of the screen. The syntax of the \Paket{xcolor} package applies.
+\begin{sidebyside}
+ \pgfinterferencepattern{screen-color=yellow}
+ \pgfinterferencepattern{screen-color=green!25!black}
+\end{sidebyside}
+\Optionsbeschreibung{ruler}{above,below,screen,none}{none}
+A ruler with a centimetre scale can be displayed above or below the screen.
+
+With \code{ruler=screen}, the ruler itself serves as a screen. In this case the \option{screen-height} and \option{screen-color} options are ignored.
+\begin{example}
+ \pgfinterferenceoptions{screen-width=0.135,screen-height=0.025}
+ \pgfinterferencepattern{ruler=above}
+ \pgfinterferencepattern{ruler=below,scale=0.8}
+ \pgfinterferencepattern{ruler=screen}
+\end{example}
+\end{Befehlsliste}
+
+\section{Physical theory}
+The textbooks (e.\,g. \cite{BS}, p. 373) give the following formula for the intensity of the light diffracted in the direction of $\varphi$ behind a multiple slit:
+\begin{equation}
+I(\varphi)\sim\frac{\sin^2\bigl(\frac{\pi\,b}{\lambda}\,\sin\varphi\bigr)}{\bigl(\frac{\pi\,b}{\lambda}\,\sin\varphi\bigr)^2}\cdot\frac{\sin^2\bigl(\frac{p\,\pi}{\lambda}\,s\,\sin\varphi\bigr)}{\sin^2\bigl(\frac{\pi}{\lambda}\,s\,\sin\varphi\bigr)}\label{Winkelabhaengigkeit}
+\end{equation}
+where $b$ is the slit width, $s$ the slit distance, and $p$ the number of slits.
+
+The first factor describes the intensity distribution as a result of diffraction at the single slit, the second the interference at an ideal multiple slit (see Fig.\@
+\ref{Intensitaetsverteilung}).
+\begin{figure}
+\centering
+\begin{minipage}{13,4cm}
+\raggedleft
+\begin{tikzpicture}
+\begin{axis}[xmin=-2.5,xmax=2.5,ymin=0,ymax=1.2,xlabel=$\varphi$,ylabel=Intensity (a.\,u.),xtick={-2,...,2},xticklabels={\ang{-2},\ang{-1},\ang{0},\ang{1},\ang{2}},yticklabels=\empty,x=2.5cm,y=5.5cm]
+\addplot[domain=-2.5:2.5,samples=500,blue] {(sin(180*3e-5/632.8e-9*sin(x)))^2/(pi*3e-5/632.8e-9*sin(x))^2};
+\addplot[domain=-2.5:2.5,samples=700,green] {(sin(4*180/632.8e-9*1e-4*sin(x)))^2/(sin(180/632.8e-9*1e-4*sin(x)))^2/16};
+\addplot[domain=-2.5:2.5,samples=700,thick,red] {(sin(180*3e-5/632.8e-9*sin(x)))^2/(pi*3e-5/632.8e-9*sin(x))^2*(sin(4*180/632.8e-9*1e-4*sin(x)))^2/(sin(180/632.8e-9*1e-4*sin(x)))^2/16};
+\legend{Single slit, Ideal quadruple slit, Real quadruple slit}
+\end{axis}
+\end{tikzpicture}
+
+\medskip
+\pgfinterferencepattern{slits=4,slit-width=3e-5,screen-distance=1.431,screen-width=0.125,screen-height=0.025,intensity=6}
+\end{minipage}
+\caption{Intensity distribution and interference pattern for a quadruple slit with a slit distance of
+\qty{0,1}{mm}
+and a slit width of
+\qty{30}{\micro\m}
+at a wavelength of
+\qty{632,8}{nm}\label{Intensitaetsverteilung}}
+\end{figure}
+
+\begin{figure}
+\centering
+\begin{tikzpicture}[font=\small]
+\draw[thick] (-3,5)--node[above] {Screen} (3,5);
+\draw (0,0) coordinate (O)--node[left] {$a$} (0,5) coordinate(A);
+\draw (0,0)--node[right] {$e$} (2,5) coordinate (B);
+\draw[dotted,thick] (-2,0)--node[below] {Diffraction object} (2,0);
+\path (A)--node[below] {$x$} (B);
+\draw pic[draw,angle radius=1.4cm,pic text={$\varphi$}] {angle=B--O--A};
+\end{tikzpicture}
+\caption{Relationship between the diffraction angle
+$\varphi$
+and the position
+$x$
+on the screen
+\label{Dreieck}}
+\end{figure}
+To display the interference pattern, we need the intensity as a function of the position $x$ on the screen. From Fig.\@ 2 we get
+\begin{equation}
+\sin\varphi=\frac{x}{e}=\frac{x}{\sqrt{a^2+x^2}}\label{Sinus}
+\end{equation}
+where $a$ is the screen distance. Substituting
+\eqref{Sinus}
+into
+\eqref{Winkelabhaengigkeit}
+gives:
+\[I(x)\sim\frac{\sin^2\left(\frac{\pi\,b\,x}{\lambda\,\sqrt{a^2+x^2}}\right)}{\left(\frac{\pi\,b\,x}{\lambda\,\sqrt{a^2+x^2}}\right)^2}\cdot\frac{\sin^2\left(\frac{p\,\pi\,s\,x}{\lambda\,\sqrt{a^2+x^2}}\right)}{\sin^2\left(\frac{\pi\,s\,x}{\lambda\,\sqrt{a^2+x^2}}\right)}\]
+The calculation of the interference patterns is based on this formula.
+
+The reduction of the intensity due to the increasing distance from the diffraction object with increasing $x$ is not taken into account.
+
+\begin{thebibliography}{9}
+\bibitem{BS} Bergmann/Schaefer: Lehrbuch der Experimentalphysik. Band 3: Optik, hrsg. von Heinrich Gobrecht, \textsuperscript{7}1978.
+\end{thebibliography}
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-interference/pgf-interference-en.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/pgf-interference/pgf-interference.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-interference/pgf-interference.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/pgf-interference/pgf-interference.sty 2022-01-10 21:29:22 UTC (rev 61562)
@@ -0,0 +1,460 @@
+% pgf-interference.sty
+% LaTeX package for simulating interference patterns
+% Author: K. Wehr
+% Version 0.1
+% 9th January 2022
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+\ProvidesExplPackage {pgf-interference} {2022-01-09} {0.1} {simulating interference patterns}
+
+\RequirePackage {tikz}
+
+\bool_new:N \g_pgfinterference_draft_bool
+
+\int_new:N \l_pgfinterference_slits_int % Anzahl der Spalte
+
+\fp_new:N \l_pgfinterference_wavelength_fp % Wellenlänge
+\fp_new:N \l_pgfinterference_slit_distance_fp % Spaltabstand (in m)
+\fp_new:N \l_pgfinterference_slit_width_fp % Spaltbreite (in m)
+\fp_new:N \l_pgfinterference_h_fp % Hilfsgröße (in 1/m)
+\fp_new:N \l_pgfinterference_hb_fp % Hilfsgröße (dimensionslos)
+\fp_new:N \l_pgfinterference_hs_fp % Hilfsgröße (dimensionslos)
+\fp_new:N \l_pgfinterference_x_fp % Position auf dem Schirm (in m)
+\fp_new:N \l_pgfinterference_screen_distance_fp % Schirmabstand (in m)
+\fp_new:N \l_pgfinterference_screen_width_fp % Schirmbreite (in m)
+\fp_new:N \l_pgfinterference_screen_height_fp % Schirmhöhe (in m)
+\fp_new:N \l_pgfinterference_screen_scale_fp % Skalierung
+\fp_new:N \l_pgfinterference_i_fp % relative Intensität innerhalb des Musters
+\fp_new:N \l_pgfinterference_i_scale_fp % Skalierung der Intensität
+
+\str_new:N \l_pgfinterference_ruler_type_str
+
+\tl_const:Nn \c_pgfinterference_ruler_unity_tl { \fontsize{9}{9} \upshape \sffamily cm }
+\tl_const:Nn \c_pgfinterference_ruler_tick_format_tl { \fontsize{9}{9} \upshape \sffamily }
+
+\dim_new:N \l_pgfinterference_screen_width_dim % Schirmbreite in der Abbildung
+\dim_new:N \l_pgfinterference_screen_height_dim % Schirmhöhe in der Abbildung
+\dim_new:N \l_pgfinterference_ruler_height_dim % Höhe des Lineals in der Abbildung
+\dim_new:N \l_pgfinterference_ruler_ticklength_i_dim % Länge eines langen Skalenstrichs auf dem Lineal
+\dim_new:N \l_pgfinterference_ruler_ticklength_ii_dim % Länge eines mittleren Skalenstrichs auf dem Lineal
+\dim_new:N \l_pgfinterference_ruler_ticklength_iii_dim % Länge eines kurzen Skalenstrichs auf dem Lineal
+\dim_new:N \l_pgfinterference_ruler_linewidth_dim % Strichstärke der Linealskala in der Abbildung
+\dim_const:Nn \c_pgfinterference_delta_dim {0.2pt} % Größe eines Bildpunkts
+
+\msg_new:nnn {pgf-interference} {non-positive number}
+ {
+ The~value~of~#1~must~be~positive~ \msg_line_context: .
+ }
+
+\msg_new:nnn {pgf-interference} {wavelength too big}
+ {
+ The~wavelength~is~greater~than~1~metre~ \msg_line_context: .~
+ Radio~waves~are~not~supported!
+ }
+
+\msg_new:nnn {pgf-interference} {slit width too big}
+ {
+ The~slit~width~is~greater~than~the~slit~distance~ \msg_line_context: .~
+ This~is~not~possible!
+ }
+
+\int_set:Nn \l_pgfinterference_slits_int {2}
+\fp_set:Nn \l_pgfinterference_wavelength_fp {632.8e-9}
+\fp_set:Nn \l_pgfinterference_slit_width_fp {1e-5}
+\fp_set:Nn \l_pgfinterference_slit_distance_fp {1e-4}
+\fp_set:Nn \l_pgfinterference_screen_distance_fp {1}
+\fp_set:Nn \l_pgfinterference_screen_width_fp {0.1}
+\fp_set:Nn \l_pgfinterference_screen_height_fp {0.03}
+\fp_set:Nn \l_pgfinterference_screen_scale_fp {1}
+\fp_set:Nn \l_pgfinterference_i_scale_fp {1}
+\str_set:Nn \l_pgfinterference_ruler_type_str {none}
+
+\colorlet {pgfinterferencescreencolor} {black}
+
+% Paketoption
+\DeclareOption {draft}
+ {
+ \bool_gset_true:N \g_pgfinterference_draft_bool
+ }
+\ProcessOptions
+
+% Optionen für das Licht
+\keys_define:nn {pgf-interference}
+ {
+ wavelength .value_required:n = true ,
+ wavelength .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_wavelength_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {wavelength}
+ }
+ } ,
+ intensity .value_required:n = true ,
+ intensity .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_i_scale_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {intensity}
+ }
+ }
+ }
+
+% Optionen für das Beugungsobjekt
+\keys_define:nn {pgf-interference}
+ {
+ slits .value_required:n = true ,
+ slits .code:n =
+ {
+ \int_compare:nNnTF {#1} > {0}
+ {
+ \int_set:Nn \l_pgfinterference_slits_int {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {slits}
+ }
+ } ,
+ slit-distance .value_required:n = true ,
+ slit-distance .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_slit_distance_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {slit-distance}
+ }
+ } ,
+ slit-width .value_required:n = true ,
+ slit-width .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_slit_width_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {slit-width}
+ }
+ }
+ }
+
+% Optionen für den Schirm
+\keys_define:nn {pgf-interference}
+ {
+ screen-distance .value_required:n = true ,
+ screen-distance .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_screen_distance_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {screen-distance}
+ }
+ } ,
+ screen-width .value_required:n = true ,
+ screen-width .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_screen_width_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {screen-width}
+ }
+ } ,
+ screen-height .value_required:n = true ,
+ screen-height .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_screen_height_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {screen-height}
+ }
+ } ,
+ screen-color .value_required:n = true ,
+ screen-color .code:n = { \colorlet {pgfinterferencescreencolor} {#1} } ,
+ scale .value_required:n = true ,
+ scale .code:n =
+ {
+ \fp_compare:nNnTF {#1} > {0}
+ {
+ \fp_set:Nn \l_pgfinterference_screen_scale_fp {#1}
+ }
+ {
+ \msg_warning:nnn {pgf-interference} {non-positive number} {scale}
+ }
+ }
+ }
+
+% Optionen für das Lineal
+\keys_define:nn {pgf-interference}
+ {
+ ruler .choices:nn = { above , below , screen , none }
+ {
+ \str_set:Nn \l_pgfinterference_ruler_type_str {#1}
+ } ,
+ ruler .default:n = {below}
+ }
+
+\cs_new:Nn \pgfinterference_prepare_ruler:
+ {
+ \dim_set:Nn \l_pgfinterference_ruler_height_dim
+ {
+ \fp_eval:n { \l_pgfinterference_screen_scale_fp * 1.2 } cm
+ }
+ \dim_set:Nn \l_pgfinterference_ruler_ticklength_i_dim
+ {
+ \fp_eval:n { \l_pgfinterference_screen_scale_fp * 5 } mm
+ }
+ \dim_set:Nn \l_pgfinterference_ruler_ticklength_ii_dim
+ {
+ \fp_eval:n { \l_pgfinterference_screen_scale_fp * 4 } mm
+ }
+ \dim_set:Nn \l_pgfinterference_ruler_ticklength_iii_dim
+ {
+ \fp_eval:n { \l_pgfinterference_screen_scale_fp * 3 } mm
+ }
+ \dim_set:Nn \l_pgfinterference_ruler_linewidth_dim
+ {
+ \fp_eval:n { \l_pgfinterference_screen_scale_fp * 0.15 } mm
+ }
+ }
+
+\cs_new:Nn \pgfinterference_draw_ruler:
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {above}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( 0.5 \l_pgfinterference_screen_width_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( - \l_pgfinterference_screen_width_dim , 0 ) -- ++ ( 0 , \l_pgfinterference_ruler_height_dim )
+ node [ below~right , scale = \fp_use:N \l_pgfinterference_screen_scale_fp ] { \c_pgfinterference_ruler_unity_tl }
+ -- ++ ( \l_pgfinterference_screen_width_dim , 0 ) -- cycle ;
+ }
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {below}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( 0.5 \l_pgfinterference_screen_width_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( - \l_pgfinterference_screen_width_dim , 0 ) -- ++ ( 0 , - \l_pgfinterference_ruler_height_dim )
+ node [ above~right , scale = \fp_use:N \l_pgfinterference_screen_scale_fp ] { \c_pgfinterference_ruler_unity_tl }
+ -- ++ ( \l_pgfinterference_screen_width_dim , 0 ) -- cycle ;
+ }
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( 0.5 \l_pgfinterference_screen_width_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( - \l_pgfinterference_screen_width_dim , 0 ) -- ++ ( 0 , - \l_pgfinterference_ruler_height_dim )
+ node [ above~right , scale = \fp_use:N \l_pgfinterference_screen_scale_fp ] { \c_pgfinterference_ruler_unity_tl }
+ -- ++ ( \l_pgfinterference_screen_width_dim , 0 ) -- cycle ;
+ }
+ }
+ \int_set:Nn \l_tmpa_int { \fp_eval:n { floor ( 1000 * \l_pgfinterference_screen_width_fp ) - 1 } }
+ \int_step_inline:nnn {1} { \l_tmpa_int }
+ {
+ \dim_set:Nn \l_tmpa_dim { \fp_eval:n { \l_pgfinterference_screen_scale_fp * ##1 } mm }
+ \dim_sub:Nn \l_tmpa_dim { 0.5 \l_pgfinterference_screen_width_dim }
+ \int_compare:nNnTF { \int_mod:nn {##1} {10} } = {0}
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {above}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , \l_pgfinterference_ruler_ticklength_i_dim )
+ node [ above , scale = \fp_use:N \l_pgfinterference_screen_scale_fp ]
+ { \c_pgfinterference_ruler_tick_format_tl \int_eval:n {##1/10} } ;
+ }
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {below}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , - \l_pgfinterference_ruler_ticklength_i_dim )
+ node [ below , scale = \fp_use:N \l_pgfinterference_screen_scale_fp ]
+ { \c_pgfinterference_ruler_tick_format_tl \int_eval:n {##1/10} } ;
+ }
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , - \l_pgfinterference_ruler_ticklength_i_dim )
+ node [ below , scale = \fp_use:N \l_pgfinterference_screen_scale_fp ]
+ { \c_pgfinterference_ruler_tick_format_tl \int_eval:n {##1/10} } ;
+ }
+ }
+ }
+ {
+ \int_compare:nNnTF { \int_mod:nn {##1} {5} } = {0}
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {above}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , \l_pgfinterference_ruler_ticklength_ii_dim ) ;
+ }
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {below}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , - \l_pgfinterference_ruler_ticklength_ii_dim ) ;
+ }
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , - \l_pgfinterference_ruler_ticklength_ii_dim ) ;
+ }
+ }
+ }
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {above}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , \l_pgfinterference_ruler_ticklength_iii_dim ) ;
+ }
+ {
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {below}
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , - \l_pgfinterference_ruler_ticklength_iii_dim ) ;
+ }
+ {
+ \draw [ line~width = \l_pgfinterference_ruler_linewidth_dim ]
+ ( \l_tmpa_dim , 0.5 \l_pgfinterference_screen_height_dim )
+ -- ++ ( 0 , - \l_pgfinterference_ruler_ticklength_iii_dim ) ;
+ }
+ }
+ }
+ }
+ }
+ }
+
+\cs_new:Nn \pgfinterference_draw_pattern:
+ {
+ \dim_step_inline:nnnn { -0.5 \l_pgfinterference_screen_width_dim + 0.5 \c_pgfinterference_delta_dim }
+ { \c_pgfinterference_delta_dim } { 0.5 \l_pgfinterference_screen_width_dim }
+ {
+ \fp_set:Nn \l_pgfinterference_x_fp { \dim_ratio:nn {##1} {100cm} / \l_pgfinterference_screen_scale_fp }
+ \fp_set:Nn \l_pgfinterference_h_fp
+ {
+ pi / \l_pgfinterference_wavelength_fp
+ / sqrt ( ( \l_pgfinterference_screen_distance_fp / \l_pgfinterference_x_fp ) ^ 2 + 1 )
+ }
+ \fp_set:Nn \l_pgfinterference_hb_fp { \l_pgfinterference_slit_width_fp * \l_pgfinterference_h_fp }
+ \fp_set:Nn \l_pgfinterference_hs_fp { \l_pgfinterference_slit_distance_fp * \l_pgfinterference_h_fp }
+ \fp_set:Nn \l_pgfinterference_i_fp
+ {
+ ( sin ( \l_pgfinterference_hb_fp ) / \l_pgfinterference_hb_fp
+ * sin ( \l_pgfinterference_slits_int * \l_pgfinterference_hs_fp ) / sin ( \l_pgfinterference_hs_fp )
+ / \l_pgfinterference_slits_int ) ^ 2
+ }
+ \int_set:Nn \l_tmpa_int
+ {
+ \fp_eval:n { round ( 100 * \l_pgfinterference_i_fp * \l_pgfinterference_i_scale_fp ) }
+ }
+ \int_compare:nNnTF { \l_tmpa_int } < {100}
+ {
+ \colorlet {pgfinterferencecolor}
+ {
+ pgfinterferencelasercolor
+ ! \int_use:N \l_tmpa_int
+ ! pgfinterferencescreencolor
+ }
+ }
+ {
+ \colorlet {pgfinterferencecolor} {pgfinterferencelasercolor}
+ }
+ \dim_set:Nn \l_tmpa_dim { ##1 - 0.5 \c_pgfinterference_delta_dim }
+ \fill [ pgfinterferencecolor ] ( \l_tmpa_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ rectangle ++ ( \c_pgfinterference_delta_dim , \l_pgfinterference_screen_height_dim ) ;
+ }
+ }
+
+\NewDocumentCommand \pgfinterferenceoptions {m}
+ {
+ \keys_set:nn {pgf-interference} {#1}
+ }
+
+\NewDocumentCommand \pgfinterferencepattern {m}
+ {
+ \group_begin:
+ \keys_set:nn {pgf-interference} {#1}
+ \selectcolormodel {rgb}
+ \fp_compare:nNnTF { \l_pgfinterference_wavelength_fp * 1e9 } < {1000}
+ {
+ \definecolor {pgfinterferencelasercolor} {wave}
+ {
+ \fp_eval:n { \l_pgfinterference_wavelength_fp * 1e9 }
+ }
+ }
+ {
+ \colorlet {pgfinterferencelasercolor} {black}
+ }
+ \dim_set:Nn \l_pgfinterference_screen_width_dim
+ {
+ \fp_eval:n { 100 * \l_pgfinterference_screen_scale_fp * \l_pgfinterference_screen_width_fp } cm
+ }
+ \str_if_eq:VnF \l_pgfinterference_ruler_type_str {none}
+ {
+ \pgfinterference_prepare_ruler:
+ }
+ \str_if_eq:VnTF \l_pgfinterference_ruler_type_str {screen}
+ {
+ \colorlet {pgfinterferencescreencolor} {white}
+ \dim_set_eq:NN \l_pgfinterference_screen_height_dim \l_pgfinterference_ruler_height_dim
+ }
+ {
+ \dim_set:Nn \l_pgfinterference_screen_height_dim
+ {
+ \fp_eval:n { 100 * \l_pgfinterference_screen_scale_fp * \l_pgfinterference_screen_height_fp } cm
+ }
+ }
+ \begin {tikzpicture}
+ \extractcolorspec {pgfinterferencescreencolor} \pgfinterference_tmpa:
+ \extractcolorspec {white} \pgfinterference_tmpb:
+ \bool_lazy_and:nnTF { ! \str_if_eq_p:Vn \l_pgfinterference_ruler_type_str {screen} }
+ { \cs_if_eq_p:NN \pgfinterference_tmpa: \pgfinterference_tmpb: }
+ {
+ \draw [ fill = pgfinterferencescreencolor ]
+ ( -0.5 \l_pgfinterference_screen_width_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ rectangle ( 0.5 \l_pgfinterference_screen_width_dim , 0.5 \l_pgfinterference_screen_height_dim ) ;
+ }
+ {
+ \fill [ pgfinterferencescreencolor ]
+ ( -0.5 \l_pgfinterference_screen_width_dim , -0.5 \l_pgfinterference_screen_height_dim )
+ rectangle ( 0.5 \l_pgfinterference_screen_width_dim , 0.5 \l_pgfinterference_screen_height_dim ) ;
+ }
+ \fp_compare:nNnTF { \l_pgfinterference_wavelength_fp } > {1}
+ {
+ \msg_warning:nn {pgf-interference} {wavelength too big}
+ }
+ {
+ \fp_compare:nNnTF { \l_pgfinterference_slit_width_fp } > { \l_pgfinterference_slit_distance_fp }
+ {
+ \msg_warning:nn {pgf-interference} {slit width too big}
+ }
+ {
+ \bool_if:NF \g_pgfinterference_draft_bool { \pgfinterference_draw_pattern: }
+ }
+ }
+ \str_if_eq:VnF \l_pgfinterference_ruler_type_str {none}
+ {
+ \pgfinterference_draw_ruler:
+ }
+ \end {tikzpicture}
+ \group_end:
+ }
Property changes on: trunk/Master/texmf-dist/tex/latex/pgf-interference/pgf-interference.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2022-01-10 21:28:10 UTC (rev 61561)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2022-01-10 21:29:22 UTC (rev 61562)
@@ -604,7 +604,7 @@
pecha pedigree-perl penlight penrose perception perfectcut perltex
permute persian-bib
petiteannonce petri-nets pfarrei pfdicons
- pgf pgf-blur pgf-cmykshadings pgf-pie
+ pgf pgf-blur pgf-cmykshadings pgf-interference pgf-pie
pgf-soroban pgf-spectra pgf-umlcd pgf-umlsd
pgfgantt pgfkeyx pgfmath-xfp pgfmolbio pgfmorepages
pgfopts pgfornament pgfornament-han pgfplots
Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2022-01-10 21:28:10 UTC (rev 61561)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc 2022-01-10 21:29:22 UTC (rev 61562)
@@ -103,6 +103,7 @@
depend pgf
depend pgf-blur
depend pgf-cmykshadings
+depend pgf-interference
depend pgf-pie
depend pgf-soroban
depend pgf-spectra
Added: trunk/Master/tlpkg/tlpsrc/pgf-interference.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list.