summaryrefslogtreecommitdiff
path: root/graphics/pstricks
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pstricks')
-rw-r--r--graphics/pstricks/contrib/pst-circ/Changes1
-rw-r--r--graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdfbin568373 -> 1034519 bytes
-rw-r--r--graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex31
-rw-r--r--graphics/pstricks/contrib/pst-optic/Changes1
-rw-r--r--graphics/pstricks/contrib/pst-optic/README5
-rw-r--r--graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib1
-rw-r--r--graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdfbin518230 -> 531736 bytes
-rw-r--r--graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex26
-rw-r--r--graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex113
9 files changed, 111 insertions, 67 deletions
diff --git a/graphics/pstricks/contrib/pst-circ/Changes b/graphics/pstricks/contrib/pst-circ/Changes
index 7c65cba773..4e7aef8965 100644
--- a/graphics/pstricks/contrib/pst-circ/Changes
+++ b/graphics/pstricks/contrib/pst-circ/Changes
@@ -1,3 +1,4 @@
+2.20 2024-10-10 reset fillstyle for OA until the connections are drawn
2.19 2021-09-09 fixes for use with lualatex
2.18 2021-04-28 Added new transistors: JFET (N and P channels),
D-MOSFET (N and P channels), and IGBT
diff --git a/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf b/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf
index 1d65756456..d66436aff7 100644
--- a/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf
+++ b/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex b/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex
index 4a3e81fde0..298ac906bc 100644
--- a/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex
+++ b/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex
@@ -1,4 +1,4 @@
-%% $Id: pst-circ.tex 210 2021-09-10 07:52:09Z herbert $
+%% $Id: pst-circ.tex 1015 2024-10-10 12:02:54Z herbert $
%% This is file `pst-circ.tex'
%%
%% IMPORTANT NOTICE:
@@ -26,8 +26,8 @@
\ifx\PSTXKeyLoaded\endinput \else\input pst-xkey \fi
\ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
%
-\def\fileversion{2.19}
-\def\filedate{2021/09/09}
+\def\fileversion{2.20}
+\def\filedate{2024/10/10}
\message{`pst-circ' v\fileversion (hv)}
%
\edef\PstAtCode{\the\catcode`\@}
@@ -1022,6 +1022,7 @@
/YC Y1 Y2 add 2 div def
XC YC end ){C@}
\rput(C@){\pst@draw@OA}
+ \psset{fillstyle=none}% reset, otherwise the connectionlines are also used for a fillstyle
\ncangle[arrows=-,arm=.5,angleA=0,angleB=180]{#1}{\ifPst@OAinvert Minus@\else Plus@\fi}
\ncput[npos=2]{\pnode{\ifPst@OAinvert Minus@@\else Plus@@\fi}}
\ifPst@OAiplus
@@ -1905,9 +1906,9 @@
\fi
\pcline[fillstyle=none,linestyle=none](#2)(#3)
%%%%%
- \pst@intensity{#2}{#3}
- \pst@tension{#2}{#3}
- \fi%
+ \pst@intensity{#2}{#3}%
+ \pst@tension{#2}{#3}%
+ \fi
}%
%
\def\pst@intensity#1#2{%
@@ -2112,15 +2113,15 @@
\pnode(0.5,0){dipole@2}
\psframe[linewidth=1.5\pslinewidth,fillstyle=solid,fillcolor=black](-0.5,-0.25)(0.5,0.25)
\else
- \pscurve[arrows=-,linewidth=1.5\pslinewidth](-1,0)(-0.75,0.5)(-0.5,0)
- \pscurve[arrows=-,linewidth=1.5\pslinewidth](-0.5,0)(-0.25,0.5)(0,0)
- \pscurve[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.25,0.5)(0.5,0)
- \pscurve[arrows=-,linewidth=1.5\pslinewidth](0.5,0)(0.75,0.5)(1,0)
- \pnode(-1,0){dipole@1}
- \pnode(1,0){dipole@2}
- \fi\fi\fi\fi%
- \ifPst@variable\psline{->}(-0.75,-0.5)(0.75,0.5)\fi%
- }
+ \pscurve[arrows=-,linewidth=1.5\pslinewidth](-1,0)(-0.75,0.5)(-0.5,0)%
+ \pscurve[arrows=-,linewidth=1.5\pslinewidth](-0.5,0)(-0.25,0.5)(0,0)%
+ \pscurve[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.25,0.5)(0.5,0)%
+ \pscurve[arrows=-,linewidth=1.5\pslinewidth](0.5,0)(0.75,0.5)(1,0)%
+ \pnode(-1,0){dipole@1}%
+ \pnode(1,0){dipole@2}%
+ \fi\fi\fi\fi
+ \ifPst@variable\psline{->}(-0.75,-0.5)(0.75,0.5)\fi
+}
%
\def\pst@draw@Ucc{%
\pnode(-0.5,0){dipole@1}
diff --git a/graphics/pstricks/contrib/pst-optic/Changes b/graphics/pstricks/contrib/pst-optic/Changes
index e51864d848..f5d28372a2 100644
--- a/graphics/pstricks/contrib/pst-optic/Changes
+++ b/graphics/pstricks/contrib/pst-optic/Changes
@@ -1,4 +1,5 @@
---- pst-optic.tex
+1.05 2024-10-28 - added individueal color setting for the focal, center amd parallel beam
1.04 2024-06-02 - small fixes to code and documentation
1.03 2024-05-17 - small fixes to code and documentation
1.02a 2023-05-07 - fix documentation for \psRefractionRay
diff --git a/graphics/pstricks/contrib/pst-optic/README b/graphics/pstricks/contrib/pst-optic/README
index 0f33952022..2fe9d76fc7 100644
--- a/graphics/pstricks/contrib/pst-optic/README
+++ b/graphics/pstricks/contrib/pst-optic/README
@@ -3,7 +3,7 @@
%% Manuel Luque <Mluque5130@aol.com> (France)
%% Herbert Voss <hvoss@tug.org> (Germany)
%%
-%% 2024-06-02
+%% 2024-10-28
%%
Save the files
@@ -21,6 +21,5 @@ dvips pst-optic-doc.dvi
to get a PostScript file. But pay attention, that the pst-optic
files are saved in the above mentioned way, before you run
-latex on the documentation file. Or simply use lualatex to get
-directly the pdf.
+latex on the documentation file.
diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib
index 6eea964780..d906cfcd47 100644
--- a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib
+++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib
@@ -105,7 +105,6 @@
altnumber = 14,
month = mar,
pages = {40--47},
- annote = bretter,
abstract = { \PS, faktisch genauso alt wie {\TeX}, ist im
Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es
darum geht zu beurteilen, was es denn nun im eigentlichen
diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf
index 182863a16e..4a4002f476 100644
--- a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf
+++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf
Binary files differ
diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex
index 5ec11a0297..2af432ab37 100644
--- a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex
+++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex
@@ -1,4 +1,4 @@
-%% $Id: pst-optic-doc.tex 903 2024-06-02 06:16:43Z herbert $
+%% $Id: pst-optic-doc.tex 1019 2024-10-28 07:59:50Z herbert $
\DocumentMetadata{}
\documentclass[11pt,english,bibliography=totoc,parskip=false,headings=small,
@@ -69,7 +69,7 @@ Table~\ref{tab:defaultLens} and \ref{tab:defaultSpiegel}.
Node A as string & \Lkeyword{nameA} & A\\
Angle A in degrees & \Lkeyword{spotA} & 270\\
Node B as string & \Lkeyword{nameB} & B\\
- Angle B in degrees & \Lkeyword{spotB} & 270\\
+ Angle B in degrees & \Lkeyword{spotB} & 90\\
Node F as string & \Lkeyword{nameF} & F\\
Angle F in degrees & \Lkeyword{spotF} & 270\\
Node O as string & \Lkeyword{nameO} & O\\
@@ -144,7 +144,21 @@ There are macros for the convergent and divergent lens
% \fill[fillstyle=solid,fillcolor=BleuVerre]
-The predefined options for \Lcs{lens} are \texttt{xLeft=-7.5, xRight=7.5, yBottom=-3, yTop=3}.
+The predefined options for \Lcs{lens} are \texttt{xLeft=-7.5, xRight=7.5,
+yBottom=-3, yTop=3}. The default color for the rays is red, which can be changed
+with the key \Lkeyword{raycolor}. An individual color setting is possible
+for the focal, center, and parallel ray with the keywords:
+\Lkeyword{parallelrayColor},
+\Lkeyword{focalrayColor},
+and \Lkeyword{centerrayColor}
+
+
+\begin{LTXexample}
+\begin{pspicture*}(-5,-3)(5,3)
+\rput(0,0){\lens[lensType=DVG, parallelrayColor=blue, focalrayColor=red!80!blue!30,
+ centerrayColor=green, lensScale=1,focus=1,OA=-3,lensGlass,lensWidth=0.5]}
+\end{pspicture*}
+\end{LTXexample}
\subsection{Short forms}
@@ -230,7 +244,8 @@ Using \Lcs{lens}\OptArg{\Lkeyword{lensType}=\ldots} gives the in figures \ref{fi
\caption{Available options for lenses with the defaults}\label{tab:defaultLens}
\begin{tabular}{@{} l l l @{}}
\emph{Option} & \emph{Name} & \emph{Default}\\\hline
- Lense type (\Lkeyval{CVG}|\Lkeyval{DVG}|\Lkeyval{PCVG}|\Lkeyval{PDVG}) & \Lkeyword{lensType} & \Lkeyval{CVG}\\
+ Lense type (\Lkeyval{CVG}|\Lkeyval{DVG}|\Lkeyval{PCVG}|\Lkeyval{PDVG})
+ & \Lkeyword{lensType} & \Lkeyval{CVG}\\
Lense height in cm & \Lkeyword{lensHeight} & 5cm\\
Lense width in cm & \Lkeyword{lensWidth} & 0.5cm\footnotemark\\
vertical scale (obsolet) & \Lkeyword{lensScale} & 1\\
@@ -244,7 +259,8 @@ Using \Lcs{lens}\OptArg{\Lkeyword{lensType}=\ldots} gives the in figures \ref{fi
Arrow length in cm & \Lkeyword{lensArrowSize}${}^2$ & 0.2\\
Arrow inset in cm & \Lkeyword{lensArrowInset}${}^2$ & 0.5\\
\end{tabular}
-\footnotetext{\textsuperscript{1} only for \Lkeyset{lensGlass=true}, otherwise set to \texttt{2\textbackslash pslinewidth}}
+\footnotetext{\textsuperscript{1} only for \Lkeyset{lensGlass=true},
+otherwise set to \texttt{2\textbackslash pslinewidth}}
\footnotetext{\textsuperscript{2} only for \Lkeyset{lensGlass=false}}
\end{minipage}
\end{table}
diff --git a/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex b/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex
index 0c06f849b3..c60869c4b4 100644
--- a/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex
+++ b/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex
@@ -1,4 +1,4 @@
-%%%% $Id: pst-optic.tex 903 2024-06-02 06:16:43Z herbert $
+%%%% $Id: pst-optic.tex 1019 2024-10-28 07:59:50Z herbert $
%% This is file `pst-optic.tex',
%%
%% IMPORTANT NOTICE:
@@ -8,8 +8,6 @@
%% Manuel Luque <Mluque5130@aol.com> (France)
%% Herbert Voss <hvoss@tug.org> (Germany)
%%
-%% 2024-06-02
-%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
@@ -30,8 +28,8 @@
\ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey\fi
%
-\def\fileversion{1.04}
-\def\filedate{2024/06/02}
+\def\fileversion{1.05}
+\def\filedate{2024/10/28}
\message{`PST-Optic' v\fileversion, \filedate\space (Manuel Luque and Herbert Voss)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -169,14 +167,27 @@
\definecolor{BleuVerre}{cmyk}{0.2,0,0,0}
\definecolor{JauneVert}{cmyk}{0.3,0,1,0}
\newpsstyle{rayuresJaunes}{fillstyle=hlines,hatchsep=2\pslinewidth,hatchcolor=JauneVert}
-\define@key[psset]{pst-optic}{rayColor}[red]{\pst@getcolor{#1}\psk@optic@rayColor}
+
+\define@key[psset]{pst-optic}{rayColor}[red]{%
+ \pst@getcolor{#1}\psk@optic@rayColor
+ \pst@getcolor{#1}\psk@optic@parallelrayColor
+ \def\psk@optic@paralleltipcolor{#1}%
+ \pst@getcolor{#1}\psk@optic@focalrayColor
+ \def\psk@optic@focaltipcolor{#1}%
+ \pst@getcolor{#1}\psk@optic@centerrayColor
+ \def\psk@optic@centertipcolor{#1}%
+}
+\define@key[psset]{pst-optic}{parallelrayColor}[red]{\pst@getcolor{#1}\psk@optic@parallelrayColor}
+\define@key[psset]{pst-optic}{focalrayColor}[red]{\pst@getcolor{#1}\psk@optic@focalrayColor}
+\define@key[psset]{pst-optic}{centerrayColor}[red]{\pst@getcolor{#1}\psk@optic@centerrayColor}
+
\psset[pst-optic]{rayColor=red}
\define@key[psset]{pst-optic}{rayWidth}[1.5\pslinewidth]{\def\psk@optic@rayWidth{#1}}
\psset[pst-optic]{rayWidth=1.5\pslinewidth}
%
\newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=black,linestyle=solid}
%
-%
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Utility stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -491,7 +502,7 @@
\uput[-90](Center'){Center'}
\psdots(Center)
\uput[-90](Center){Center}
- \psset{linecolor=\psk@optic@rayColor}
+ \psset{linecolor=\psk@optic@rayColor} %%%%%%%%%%%%%%%%%%%%%%
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B)
\ifx\psk@optic@lensType\lensTypeCVG
% the parallel ray
@@ -682,18 +693,21 @@
% dessin de l'image
\psline[linewidth=1.5\pslinewidth,arrowinset=0,linestyle=dashed]{->}(A')(B')
%dessin des rayons
- \psset{linecolor=\psk@optic@rayColor}
- \Arrows[length=16,arrows=-](B)(O)
- \Arrows(B)(I)
- \psline(B)(I)
- \psOutLine[arrows=->,length=1](B')(I){END1}
- \psOutLine[length=5](B')(I){END2}
- \psline[linestyle=dashed](F')(I)
- \Arrows[arrows=->>](B)(I')
- \psline(B)(I')
- \psOutLine[arrows=->>,length=2](B')(I'){END3}
- \psOutLine[length=10](B')(I'){END4}
- \psline[linestyle=dashed](B')(I')
+%% \psset{linecolor=\psk@optic@rayColor}
+ %% center beam
+ \Arrows[linecolor=\psk@optic@centerrayColor,length=16,arrows=-](B)(O)
+ %% parallel beam
+ \Arrows[linecolor=\psk@optic@parallelrayColor](B)(I)
+ \psline[linecolor=\psk@optic@parallelrayColor](B)(I)
+ \psOutLine[linecolor=\psk@optic@parallelrayColor,arrows=->,length=1](B')(I){END1}
+ \psOutLine[linecolor=\psk@optic@parallelrayColor,length=5](B')(I){END2}
+ \psline[linecolor=\psk@optic@parallelrayColor,linestyle=dashed](F')(I)
+ %% focal beam
+ \Arrows[linecolor=\psk@optic@focalrayColor,arrows=->>](B)(I')
+ \psline[linecolor=\psk@optic@focalrayColor](B)(I')
+ \psOutLine[linecolor=\psk@optic@focalrayColor,arrows=->>,length=2](B')(I'){END3}
+ \psOutLine[linecolor=\psk@optic@focalrayColor,length=10](B')(I'){END4}
+ \psline[linecolor=\psk@optic@focalrayColor,linestyle=dashed](B')(I')
%\uput[45](I'){I'}
%\uput[45](I){I}
\uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}%
@@ -713,17 +727,22 @@
% dessin de l'image
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A')(B')
%dessin des rayons
- \psset{linecolor=\psk@optic@rayColor}
- \pcline(B)(B')
- \Arrows[length=16,arrows=-](B)(O)
- \Arrows(B)(I)
- \psline(B)(I)
- \Arrows[length=10,posStart=0,arrows=-](I)(F')
- \Arrows[posStart=1,arrows=->](I)(F')
- \Arrows[arrows=->>](B)(I')
- \psline(B)(I')(B')
- \Arrows[length=10,arrows=-](I')(B')
- \Arrows[length=2,posStart=0.5,arrows=->>](I')(B')
+% \psset{linecolor=\psk@optic@rayColor}%% No global setting
+ %% Center beam
+ \pcline[linecolor=\psk@optic@centerrayColor](B)(B')%%CMittelpunktsstrahl
+ \Arrows[linecolor=\psk@optic@centerrayColor,length=16,arrows=-](B)(O)
+ \Arrows[linecolor=\psk@optic@centerrayColor](B)(I)
+ %% parallel beam
+ \psline[linecolor=\psk@optic@parallelrayColor,tipcolor=\psk@optic@paralleltipcolor](B)(I)
+ \Arrows[linecolor=\psk@optic@parallelrayColor](B)(I)
+ \Arrows[linecolor=\psk@optic@parallelrayColor,length=10,posStart=0,arrows=-](I)(F')
+ \Arrows[linecolor=\psk@optic@parallelrayColor,posStart=1,arrows=->](I)(F')
+ %% focal beam
+ \psline[linecolor=\psk@optic@focalrayColor](B)(I')(B')
+ \Arrows[linecolor=\psk@optic@focalrayColor,arrows=->>](B)(I')
+ \Arrows[linecolor=\psk@optic@focalrayColor,length=10,arrows=-](I')(B')
+ \Arrows[linecolor=\psk@optic@focalrayColor,length=2,posStart=0.5,
+ arrows=->>,tipcolor=\psk@optic@focaltipcolor](I')(B')
%\uput[-45](I'){I'}
%\uput[45](I){I}
\uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}
@@ -736,7 +755,8 @@
%Lentille convergente : CVG
%(#2) est l'abscisse du centre optique
\def\lens{\@ifnextchar[{\pst@lens}{\pst@lens[]}}
-\def\pst@lens[#1]{{%
+\def\pst@lens[#1]{%
+ \begingroup
\psset[pst-optic,pstricks]{xLeft=-7.5,xRight=7.5,yBottom=-3,yTop=3,#1}%
% \psset[pst-optic,pstricks]{#1}%
\pst@killglue%
@@ -771,7 +791,7 @@
\pnode(! \psk@optic@xRight\space A'B' YO add){I1}
\pnode(! \psk@optic@xRight\space neg A'B' YO add){I2}
\else%
- \pnode(!%
+ \pnode(!
/OF' \psk@optic@focus\space def
/AB \psk@optic@AB\space def
/OA \psk@optic@OA\space def
@@ -812,7 +832,8 @@
\psset{arrows=<->}%
\fi\fi
\psline[linecolor=\psk@optic@lensColor,
- linewidth=\psk@optic@lensWidth,arrowsize=\psk@optic@lensArrowSize,
+ linewidth=2\pslinewidth, %\psk@optic@lensWidth,
+ arrowsize=\psk@optic@lensArrowSize,
arrowinset=\psk@optic@lensArrowInset]%
(! XO -0.5 \psk@optic@lensHeight\space mul
\psk@optic@lensScale\space mul YO add)%
@@ -829,7 +850,8 @@
\pst@drawCVGRays\fi\fi
\fi
\end{pspicture*}%
-}\ignorespaces}
+ \endgroup
+ \ignorespaces}
%
% 25 december 2002 Herbert <voss@perce.de>
% make the lenses dynamical to width _and_ height
@@ -1243,7 +1265,9 @@
\uput[-45](B'){B'}
\fi
\end{pspicture}%
-}\ignorespaces}
+ }%
+ \ignorespaces
+}
%
%
\def\mirrorDVG{\@ifnextchar[{% Herbert Voss 2003/01/05
@@ -1640,12 +1664,12 @@
\pst@getcoor{#8}\pst@tempp
\def\pst@optic@cIn{#6} % refraction number 1
\def\pst@optic@cOut{#7} % refraction number 2
- \pnode(!%
- /YA \pst@tempA exch pop \pst@number\psyunit div def
+ \pnode(!
+ /YA \pst@tempA exch pop \pst@number\psyunit div def
/XA \pst@tempA pop \pst@number\psxunit div def
/YB \pst@tempB exch pop \pst@number\psyunit div def
/XB \pst@tempB pop \pst@number\psxunit div def
- /YC \pst@tempc exch pop \pst@number\psyunit div def
+ /YC \pst@tempc exch pop \pst@number\psyunit div def
/XC \pst@tempc pop \pst@number\psxunit div def
/YD \pst@tempd exch pop \pst@number\psyunit div def
/XD \pst@tempd pop \pst@number\psxunit div def
@@ -1656,8 +1680,11 @@
/dY2 YD YC sub def
/dX2 XD XC sub def
% the gradient of the material (if negativ then it must be the nominator)
- /Gamma dY2 dX2 mul 0 lt {dY2 abs neg dX2 abs}{dY2 dX2} ifelse atan def
-% the perpendicular line is: 90°-Gamma
+% if = 0 then substract 180°
+ /Gamma dY2 dX2 mul 0 ge {dY2 dX2}{dY2 abs neg dX2 abs} ifelse atan
+ %dup 0 eq { 180 sub } if
+ def
+% the perpendicular line is: 90°-Gamma
/GammaStrich 90 Gamma sub def
% the angle of the incoming ray
/AlphaStrich dY1 dX1 atan def
@@ -1667,7 +1694,7 @@
% the law of Snell: sin(Alpha)/sin(Beta) = n2/n1
% sin(Beta)>1 is a total reflection instead of a refraction
/sinBeta \pst@optic@cIn\space \pst@optic@cOut\space div Alpha sin mul def
- sinBeta abs 1 le{
+ sinBeta abs 1 le {
/Root 1 sinBeta dup mul sub Sqrt def
/Beta sinBeta Root atan def
}{
@@ -1677,7 +1704,7 @@
/BetaStrich 90 Gamma sub Beta add def
% Determine the intermediate point
XP BetaStrich cos sub
- YP BetaStrich sin add ){#8'}%
+ YP BetaStrich sin add ){#8'}
%\qdisk(#8){5pt}
}\ignorespaces}
%