\DocumentMetadata{lang=en}
%\PassOptionsToPackage{backref}{biblatex}
%\PassOptionsToPackage{backref}{hyperref}
%% $Id: pst-hertz-doc.tex 1263 2026-05-29 08:05:14Z herbert $

\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,
   smallheadings, headexclude,footexclude,twoside]{pst-doc}

\usepackage{pst-hertz}
\let\pstFV\fileversion

\addbibresource{\jobname.bib}

\usepackage{enumitem,xltabular,hvindex,minted-code}
\setlist{nosep}

\usepackage{makeidx}
\makeindex

\definecolor{rougesombre}{rgb}{0.5 0 0}

\def\bgImage{%
\psscalebox{0.65}{%
\begin{pspicture}(-8,-8)(8,7)
\psclip{\psframe(-8,-7)(8,7)}
  \psHertzDipole[t=0,h=0.5]
\endpsclip
\end{pspicture}}}

\title{\texttt{pst-hertz}: Representation of the electric field \newline 
  radiated by a Hertzian dipole}
\subtitle{Version \pstFV}
\author{Manuel Luque \\Herbert Voß}
\docauthor{}
\date{\today}

\begin{document}

\settitle

\section{Introduction}
The files can be run with \Lprog{lualatex}, which creates directly the pdf,
or with the sequenz \Lprog{latex}$\rightarrow$\Lprog{dvips}$\rightarrow$%
\Lprog{ps2pdf}. The last one is to preferred for \Index{animation}s which needs heavy
calculations.

\begin{description}[nosep]
\item[\Lfile{pst-hertz-doc}] The main documentation
\item[\Lfile{pst-hertz-animate}] The main animation  
\item[\Lfile{pst-hertz-text-0}] Base file for a gif-animation with \newline
  \verb|\psHertzDipole[t=\i,lambda=150,Ez=false,linewidth=1pt,h=0.5,FillSpace,HSBFill,DrawLines]|
\item[\Lfile{pst-hertz-text-1}] Base file for a gif-animation with additional markers and \newline
  \verb|\psHertzDipole[t=\i,linewidth=1.2pt,linecolor=orange,doublecolor={[rgb]{0 0.5 0}},BiColorLines]|
\item[\Lfile{pst-hertz-text-2}] Base file for a gif-animation with \newline
  \verb|\psHertzDipole[t=\i,FieldLines=8,lambda=100,Ez=false,linewidth=0.5pt,DrawArrows=false,h=1,FillSpace,DrawLines,hatchcolor=orange,fillcolor=cyan]|
\end{description}




\section{Options for the \Lcs{psHertzDipole} command in the pst-hertz package}

Many authors have created visualizations of the electromagnetic field 
radiated by a Hertzian dipole; the version by Raimund V. Girwidz is 
the most comprehensive.~\cite{dipol}
The objectives of the \Lcs{psHertzDipole} command are much more modest; 
it allows only for the visualization of electric field lines, utilizing the 
following options (for which default values are indicated):

\begin{itemize}
  \item \LKeyword{lambda=100}: selects the \Index{wavelength} (in meters);
  \item \LKeyword{t=0}: date as a fraction of the period: 0 to 100;
  \item \LKeyword{h=1}: iteration step size for the method (\Index{RK-4}) suggested by Raimund V. Girwidz;
  \item \LKeyword{FieldLines=6}: number of lines within the $λ/2$ interval;
  \item \LKeyword{ScaleFactor=1}: scale factor;
\end{itemize}

as well as the following Boolean options:

\begin{itemize}
  \item \LKeyword{BiColorLines=false}: with the \Lkeyword{BiColorLines} option, 
  the color of the line bundles alternates;
  one color is defined by the PSTricks command \LKeyword{linecolor=\ldots} 
  and the other by \LKeyword{doublecolor=\ldots};
 
  \item \LKeyword{DrawArrows=true}: draws arrows by default;
  \item \LKeyword{DrawLines=true}: draws the lines by default;
  \item \LKeyword{Ez=true}: plots $E(x, t)$ at the points $x = 0$;
  \item \LKeyword{FillSpace=false}: colors the space between two consecutive lines using two colors—one defined by the
PSTricks command \LKeyword{fillcolor=\ldots} and the other 
by \LKeyword{hatchcolor=\ldots};
  \item \LKeyword{HSBFill=false} : : colors the space between the lines using 
  color \Index{gradation}s from the \Index{HSB color} space.
\end{itemize}


\clearpage
\section{Examples}
The drawing at the beginning illustrates the command using the default 
options; the tick marks have been added manually.

\subsection{The two-tone version}
\begin{center}
\begin{pspicture}(-8,-8)(8,7)
\psclip{\psframe(-8,-7)(8,7)}
\psHertzDipole[t=50,lambda=200,h=1,BiColorLines,linecolor=red,doublecolor=blue,FieldLines=8]
\endpsclip%
\psline{<->}(0,7)(0,0)(8,0)
\uput[l](0,6.8){$z$}
\uput[u](7.8,0){$x$}
\uput[r](0,6.5){\textcolor{rougesombre}{E(x,z=0,t)}}
\psset{xunit=1pt}
\multido{\i=-200+50}{9}{
\psline(\i,-7.2)(\i,-6.8)}
\uput[d](-200,-7.2){$-\lambda$}
\uput[d](-150,-7.2){$-\frac{3\lambda}{4}$}
\uput[d](-100,-7.2){$-\frac{\lambda}{2}$}
\uput[d](-50,-7.2){$-\frac{\lambda}{4}$}
\uput[d](200,-7.2){$\lambda$}
\uput[d](150,-7.2){$\frac{3\lambda}{4}$}
\uput[d](100,-7.2){$\frac{\lambda}{2}$}
\uput[d](50,-7.2){$\frac{\lambda}{4}$}
\uput[d](0,-7.2){$0$}
\end{pspicture}
\end{center}

%\begin{verbatim}
%\psHertzDipole[t=50,lambda=200,BiColorLines,linecolor=red,doublecolor=blue,FieldLines=8]
%\end{verbatim}

\begin{codeblockA}[title=BiColorLines,breakable]
\begin{pspicture}(-8,-8)(8,7)
\psclip{\psframe(-8,-7)(8,7)}
\psHertzDipole[t=50,lambda=200,h=1,BiColorLines,linecolor=red,doublecolor=blue,FieldLines=8]
\endpsclip%
\psline{<->}(0,7)(0,0)(8,0)
\uput[l](0,6.8){$z$}
\uput[u](7.8,0){$x$}
\uput[r](0,6.5){\textcolor{rougesombre}{E(x,z=0,t)}}
\psset{xunit=1pt}
\multido{\i=-200+50}{9}{
\psline(\i,-7.2)(\i,-6.8)}
\uput[d](-200,-7.2){$-\lambda$}
\uput[d](-150,-7.2){$-\frac{3\lambda}{4}$}
\uput[d](-100,-7.2){$-\frac{\lambda}{2}$}
\uput[d](-50,-7.2){$-\frac{\lambda}{4}$}
\uput[d](200,-7.2){$\lambda$}
\uput[d](150,-7.2){$\frac{3\lambda}{4}$}
\uput[d](100,-7.2){$\frac{\lambda}{2}$}
\uput[d](50,-7.2){$\frac{\lambda}{4}$}
\uput[d](0,-7.2){$0$}
\end{pspicture}
\end{codeblockA}




\subsection{Color the space between two lines}
\begin{center}
\begin{pspicture}(-8,-8)(8,7)
\psclip{\psframe(-8,-7)(8,7)}
\psHertzDipole[t=75,h=0.5,FillSpace,hatchcolor=orange,fillcolor=cyan,linecolor=blue,FieldLines=8]
\endpsclip%
\psline{<->}(0,7)(0,0)(8,0)
\uput[l](0,6.8){$z$}
\uput[u](7.8,0){$x$}
\uput[r](0,6.5){\textcolor{rougesombre}{E(x,z=0,t)}}
\psset{xunit=1pt}
\multido{\i=-200+50}{9}{
\psline(\i,-7.2)(\i,-6.8)}
\uput[d](-200,-7.2){$-2\lambda$}
\uput[d](-150,-7.2){$-\frac{3\lambda}{2}$}
\uput[d](-100,-7.2){$-\lambda$}
\uput[d](-50,-7.2){$-\frac{\lambda}{2}$}
\uput[d](200,-7.2){$2\lambda$}
\uput[d](150,-7.2){$\frac{3\lambda}{2}$}
\uput[d](100,-7.2){$\lambda$}
\uput[d](50,-7.2){$\frac{\lambda}{2}$}
\uput[d](0,-7.2){$0$}
\end{pspicture}
\end{center}

%\begin{verbatim}
%\psHertzDipole[t=75,h=0.5,FillSpace,hatchcolor=orange,fillcolor=cyan,linecolor=blue,FieldLines=8]
%\end{verbatim}

\begin{codeblockA}[title=Colors space,breakable]
\begin{pspicture}(-8,-8)(8,7)
\psclip{\psframe(-8,-7)(8,7)}
\psHertzDipole[t=75,h=0.5,FillSpace,hatchcolor=orange,fillcolor=cyan,linecolor=blue,FieldLines=8]
\endpsclip%
\psline{<->}(0,7)(0,0)(8,0)
\uput[l](0,6.8){$z$}
\uput[u](7.8,0){$x$}
\uput[r](0,6.5){\textcolor{rougesombre}{E(x,z=0,t)}}
\psset{xunit=1pt}
\multido{\i=-200+50}{9}{
\psline(\i,-7.2)(\i,-6.8)}
\uput[d](-200,-7.2){$-2\lambda$}
\uput[d](-150,-7.2){$-\frac{3\lambda}{2}$}
\uput[d](-100,-7.2){$-\lambda$}
\uput[d](-50,-7.2){$-\frac{\lambda}{2}$}
\uput[d](200,-7.2){$2\lambda$}
\uput[d](150,-7.2){$\frac{3\lambda}{2}$}
\uput[d](100,-7.2){$\lambda$}
\uput[d](50,-7.2){$\frac{\lambda}{2}$}
\uput[d](0,-7.2){$0$}
\end{pspicture}
\end{codeblockA}



\begin{center}
\begin{pspicture}(-8,-8)(8,7)
\psclip{\psframe(-8,-7)(8,7)}
\psHertzDipole[t=90,h=0.5,FillSpace,HSBFill,FieldLines=6]
\endpsclip%
\psline{<->}(0,7)(0,0)(8,0)
\uput[l](0,6.8){$z$}
\uput[u](7.8,0){$x$}
\uput[r](0,6.5){\textcolor{rougesombre}{E(x,z=0,t)}}
\psset{xunit=1pt}
\multido{\i=-200+50}{9}{
\psline(\i,-7.2)(\i,-6.8)}
\uput[d](-200,-7.2){$-2\lambda$}
\uput[d](-150,-7.2){$-\frac{3\lambda}{2}$}
\uput[d](-100,-7.2){$-\lambda$}
\uput[d](-50,-7.2){$-\frac{\lambda}{2}$}
\uput[d](200,-7.2){$2\lambda$}
\uput[d](150,-7.2){$\frac{3\lambda}{2}$}
\uput[d](100,-7.2){$\lambda$}
\uput[d](50,-7.2){$\frac{\lambda}{2}$}
\uput[d](0,-7.2){$0$}
\end{pspicture}
\end{center}

%\begin{verbatim}
%\psHertzDipole[t=75,h=0.5,FillSpace,HSBFill,FieldLines=6]
%\end{verbatim}


\begin{codeblockA}[title=Fill space,breakable]
\begin{pspicture*}(-8,-8)(8,7)
\psHertzDipole[t=90,h=0.5,FillSpace,HSBFill,FieldLines=6]
\psline{<->}(0,7)(0,0)(8,0)
\uput[l](0,6.8){$z$}
\uput[u](7.8,0){$x$}
\uput[r](0,6.5){\textcolor{rougesombre}{E(x,z=0,t)}}
\psset{xunit=1pt}
\multido{\i=-200+50}{9}{\psline(\i,-7.2)(\i,-6.8)}
\uput[d](-200,-7.2){$-2\lambda$}
\uput[d](-150,-7.2){$-\frac{3\lambda}{2}$}
\uput[d](-100,-7.2){$-\lambda$}
\uput[d](-50,-7.2){$-\frac{\lambda}{2}$}
\uput[d](200,-7.2){$2\lambda$}
\uput[d](150,-7.2){$\frac{3\lambda}{2}$}
\uput[d](100,-7.2){$\lambda$}
\uput[d](50,-7.2){$\frac{\lambda}{2}$}
\uput[d](0,-7.2){$0$}
\end{pspicture*}
\end{codeblockA}

\printbibliography

\printindex
\end{document} 
