diff options
author | Karl Berry <karl@freefriends.org> | 2024-10-28 20:26:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-10-28 20:26:54 +0000 |
commit | 0e7c0eb0861863c67fa080b701af7322f8ba76c7 (patch) | |
tree | ed914549bbe267a7fca421fccf2b1d965bdfb570 /Master | |
parent | 69fea17c8e671b6beff284cdeb0b05e9bd265f07 (diff) |
pst-optic (28oct24)
git-svn-id: svn://tug.org/texlive/trunk@72694 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-optic/Changes | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-optic/README | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.pdf | bin | 518230 -> 531736 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex | 26 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex | 113 |
6 files changed, 94 insertions, 52 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-optic/Changes b/Master/texmf-dist/doc/generic/pst-optic/Changes index e51864d8487..f5d28372a2d 100644 --- a/Master/texmf-dist/doc/generic/pst-optic/Changes +++ b/Master/texmf-dist/doc/generic/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/Master/texmf-dist/doc/generic/pst-optic/README b/Master/texmf-dist/doc/generic/pst-optic/README index 0f339520228..2fe9d76fc76 100644 --- a/Master/texmf-dist/doc/generic/pst-optic/README +++ b/Master/texmf-dist/doc/generic/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/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib b/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib index 6eea9647803..d906cfcd471 100644 --- a/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib +++ b/Master/texmf-dist/doc/generic/pst-optic/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/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.pdf b/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.pdf Binary files differindex 182863a16ef..4a4002f4769 100644 --- a/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex b/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex index 5ec11a0297a..2af432ab370 100644 --- a/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-optic/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/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex b/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex index 0c06f849b33..c60869c4b4b 100644 --- a/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex +++ b/Master/texmf-dist/tex/generic/pst-optic/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} % |