diff options
author | Karl Berry <karl@freefriends.org> | 2016-09-06 21:30:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-09-06 21:30:22 +0000 |
commit | 3a322c171ab33afe5d5481ca124f9c2b3d3e1fc9 (patch) | |
tree | 5bed7d776cdd363805b6a0c895b892dbf04cc801 /Master/texmf-dist/tex/generic/pst-optic | |
parent | f58fded086e14735547d650ff180805e3868c3f9 (diff) |
pst-optic (6sep16)
git-svn-id: svn://tug.org/texlive/trunk@41999 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-optic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex | 75 |
1 files changed, 39 insertions, 36 deletions
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 e5dd1b3bfd8..c9906a52b4c 100644 --- a/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex +++ b/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex @@ -30,8 +30,8 @@ \ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey\fi % -\def\fileversion{1.01} -\def\filedate{2010/07/23} +\def\fileversion{1.02} +\def\filedate{2016/07/10} \message{`PST-Optic' v\fileversion, \filedate\space (Manuel Luque and Herbert Voss)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -81,10 +81,11 @@ % \define@boolkey[psset]{pst-optic}[Pst@]{lensTwo}[false]{} % is a second lens present? \define@boolkey[psset]{pst-optic}[Pst@]{lensGlass}[true]{}% draw a _real_ lens? +\define@boolkey[psset]{pst-optic}[Pst@]{onlyrays}[true]{}% draw only the rays? \define@boolkey[psset]{pst-optic}[Pst@]{drawing}[true]{} % draw the nodes and rays? \define@boolkey[psset]{pst-optic}[Pst@]{rightRay}[false]{}% a ray on the right side? % -\psset[pst-optic]{lensGlass,drawing,lensTwo,rightRay} +\psset[pst-optic]{lensGlass,drawing,lensTwo,rightRay,onlyrays=false} % % ------- the global definitions for the pspicture frame ------ % @@ -367,7 +368,7 @@ /YA \pst@tempA exch pop \pst@number\psyunit div def /XA \pst@tempA pop \pst@number\psxunit div def YA 0 eq XA 0 eq and {0 0}{ - /r XA dup mul YA dup mul add sqrt def + /r XA dup mul YA dup mul add Sqrt def /AlphaOld YA XA atan def /AlphaNew AlphaOld \pst@optic@angle\space add def r AlphaNew cos mul r AlphaNew sin mul @@ -447,13 +448,13 @@ \pscustom{% \parametricplot{\psk@optic@lensHeight}{-\psk@optic@lensHeight}{% /arg t radius 2.0 mul div def - arg 1 arg dup mul sub sqrt atan + arg 1 arg dup mul sub Sqrt atan cos 1 sub radius mul neg Width2 sub t 2.0 div } \parametricplot{-\psk@optic@lensHeight}{\psk@optic@lensHeight}{% /arg t radius 2.0 mul div def - arg 1 arg dup mul sub sqrt atan + arg 1 arg dup mul sub Sqrt atan cos 1 sub radius mul neg Width2 sub neg t 2.0 div } @@ -466,7 +467,7 @@ % (-d-w/2,h/2)->(-d-w/2,-h/2) \parametricplot{\psk@optic@lensHeight}{-\psk@optic@lensHeight}{% /arg t 2.0 div radius div def - arg 1 arg dup mul sub sqrt atan cos 1 sub radius mul Width2 sub + arg 1 arg dup mul sub Sqrt atan cos 1 sub radius mul Width2 sub t 2.0 div } % (-d-w/2,-h/2)(d+w/2,-h/2) @@ -474,7 +475,7 @@ % (d+w/2,-h/2)->(d+w/2,h/2) \parametricplot{-\psk@optic@lensHeight}{\psk@optic@lensHeight}{% /arg t 2.0 div radius div def - 1 arg 1 arg dup mul sub sqrt atan cos sub radius mul Width2 add + 1 arg 1 arg dup mul sub Sqrt atan cos sub radius mul Width2 add t 2.0 div } \fill @@ -616,11 +617,11 @@ /dX XB XA sub def dX abs 0.01 lt { % a horizontal line - /Y YM radius dup mul XA dup mul sub sqrt YM 0 gt {sub}{add}ifelse def - /YSecond YM radius dup mul XA dup mul sub sqrt YM 0 gt {add}{sub}ifelse def + /Y YM radius dup mul XA dup mul sub Sqrt YM 0 gt {sub}{add}ifelse def + /YSecond YM radius dup mul XA dup mul sub Sqrt YM 0 gt {add}{sub}ifelse def /X XA def /XSecond XA def - /mT XA radius dup mul XA dup mul sub sqrt div YM 0 lt {neg}if def + /mT XA radius dup mul XA dup mul sub Sqrt div YM 0 lt {neg}if def Y X neg }{ /dY YB YA sub def @@ -629,12 +630,12 @@ /klammer YM m XA mul add YA sub def /p2neg klammer m mul m21 div def /q klammer dup mul radius dup mul sub m21 div def - /root p2neg dup mul q sub sqrt def + /root p2neg dup mul q sub Sqrt def /X p2neg root YM m mul 0 gt {sub}{add}ifelse def /XSecond p2neg root YM m mul 0 gt {add}{sub}ifelse def /Y m X XA sub mul YA add def /YSecond m XSecond XA sub mul YA add def - /mT X radius dup mul X dup mul sub sqrt div YM 0 lt {neg}if def + /mT X radius dup mul X dup mul sub Sqrt div YM 0 lt {neg}if def Y X neg } ifelse){#4} \else% DVG @@ -649,10 +650,10 @@ /dX XB XA sub def dX abs 0.01 lt { % a horizontal line - /Y YM radius dup mul XA dup mul sub sqrt YM 0 gt {sub}{add}ifelse def - /YSecond YM radius dup mul XA dup mul sub sqrt YM 0 gt {add}{sub}ifelse def + /Y YM radius dup mul XA dup mul sub Sqrt YM 0 gt {sub}{add}ifelse def + /YSecond YM radius dup mul XA dup mul sub Sqrt YM 0 gt {add}{sub}ifelse def /X XA def - /mT XA radius dup mul XA dup mul sub sqrt div YM 0 lt {neg}if def + /mT XA radius dup mul XA dup mul sub Sqrt div YM 0 lt {neg}if def /XSecond XA def Y X neg }{ @@ -662,12 +663,12 @@ /klammer YM m XA mul add YA sub def /p2neg klammer m mul m21 div def /q klammer dup mul radius dup mul sub m21 div def - /root p2neg dup mul q sub sqrt def + /root p2neg dup mul q sub Sqrt def /X p2neg root YM m mul 0 gt {sub}{add}ifelse def /XSecond p2neg root YM m mul 0 gt {add}{sub}ifelse def /Y m X XA sub mul YA add def /YSecond m XSecond XA sub mul YA add def - /mT X radius dup mul X dup mul sub sqrt div YM 0 lt {neg}if def + /mT X radius dup mul X dup mul sub Sqrt div YM 0 lt {neg}if def Y X neg } ifelse){#4} \fi @@ -793,8 +794,9 @@ \pnode(! \psk@optic@xRight\space A'B' YO add){I1}% \pnode(! \psk@optic@xRight\space neg A'B' YO add){I2}% \fi% + \ifPst@onlyrays\else \begingroup% - \ifPst@lensGlass% + \ifPst@lensGlass \rput(! XO YO){% \ifx\psk@optic@lensType\lensTypeCVG\lensCVG% \else\ifx\psk@optic@lensType\lensTypePCVG\lensCVG @@ -811,14 +813,15 @@ (! XO 0.5 \psk@optic@lensHeight\space mul \psk@optic@lensScale\space mul YO add)% \fi% - \endgroup% + \endgroup + \fi \ifPst@drawing % axe optique \psline[style=opticalAxis](! \psk@optic@xLeft\space YO)(! \psk@optic@xRight\space YO) \ifx\psk@optic@lensType\lensTypeDVG\pst@drawDVGRays\else \ifx\psk@optic@lensType\lensTypePDVG\pst@drawDVGRays\else \pst@drawCVGRays\fi\fi - \fi% + \fi \end{pspicture*}% }\ignorespaces} % @@ -1005,7 +1008,7 @@ XB XA sub abs 0.01 lt {A XA dup mul mul XA neg}{ /m YB YA sub XB XA sub div def /m2a m A div 2 div def - /Root m2a dup mul m XA mul YA sub A div sub sqrt def + /Root m2a dup mul m XA mul YA sub A div sub Sqrt def /Xp m2a Root add XA sub def /Xn m2a Root sub XA sub def /YSp m Xp mul YA add def @@ -1055,7 +1058,7 @@ /NoMoreReflection false def % pq Formel anwenden /m2a m A div 2 div def - /Root m2a dup mul m XA mul YA sub A div sub sqrt def + /Root m2a dup mul m XA mul YA sub A div sub Sqrt def /X1 m2a Root add def /X2 m2a Root sub def % be sure, that we get the right point @@ -1173,7 +1176,7 @@ \else \parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{% /radD radius \psk@optic@mirrorWidth\space add def - radius \psk@optic@mirrorWidth\space sub radD dup mul t 2 div dup mul sub sqrt sub t 2 div } + radius \psk@optic@mirrorWidth\space sub radD dup mul t 2 div dup mul sub Sqrt sub t 2 div } \fi % (d-w,-h/2)(d,-h/2) \psline(!% @@ -1187,7 +1190,7 @@ t 2 exp 4 div mul t 2 div } \else \parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{ - radius dup dup mul t 2 div dup mul sub sqrt sub t 2 div } + radius dup dup mul t 2 div dup mul sub Sqrt sub t 2 div } \fi \fill }% @@ -1278,7 +1281,7 @@ Depth Height dup mul div t 2 exp 4 div mul neg t 2 div } \else \parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{% - radius dup mul t 2 div dup mul sub sqrt radius sub t 2 div } + radius dup mul t 2 div dup mul sub Sqrt radius sub t 2 div } \fi % (d-w,-h/2)(d,-h/2) \psline(! Depth Width add neg Height neg)(! Depth neg Height neg)% @@ -1288,7 +1291,7 @@ Depth Height dup mul div t 2 exp 4 div mul neg Width sub t 2 div } \else \parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{% - radius Width sub dup mul t 2 div dup mul sub sqrt radius sub t 2 div } + radius Width sub dup mul t 2 div dup mul sub Sqrt radius sub t 2 div } \fi \fill% } @@ -1356,7 +1359,7 @@ /Xmax \psk@optic@mirrorHeight\space 2 div def /m YB YA sub XB XA sub div def /m2a m A div 2 div def - /Root m2a dup mul m XA mul YA sub A div sub sqrt def + /Root m2a dup mul m XA mul YA sub A div sub Sqrt def /X1 m2a Root add def /X2 m2a Root sub def /X XB X1 sub abs XB X2 sub abs lt @@ -1565,7 +1568,7 @@ def /xA' 2 xH mul XA sub def /yA' 2 yH mul YA sub def - /D12 Dx Dx mul Dy Dy mul add sqrt def + /D12 Dx Dx mul Dy Dy mul add Sqrt def xA' yA' moveto xH yH rlineto xA' yA'){#4} @@ -1660,7 +1663,7 @@ % 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{ - /Root 1 sinBeta dup mul sub sqrt def + /Root 1 sinBeta dup mul sub Sqrt def /Beta sinBeta Root atan def }{ /Beta 180 Alpha sub def @@ -1700,7 +1703,7 @@ /dX1 XA XP sub def /signum YP 0 lt {-1}{1}ifelse def % the gradient of the point. radius must be defined - /root radius dup mul XP dup mul sub sqrt def + /root radius dup mul XP dup mul sub Sqrt def /Gamma XP signum mul root atan 180 sub def % the angle of the incoming ray /AlphaStrich dY1 dX1 atan 180 sub def @@ -1773,7 +1776,7 @@ % Les datas % Sellmeier's % glass sf15 : verre flint - % n=sqrt(1+B1*L^2/(l^2-C1)+B2*L^2/(l^2-C2)+B3*L^2/(l^2-C3)) + % n=Sqrt(1+B1*L^2/(l^2-C1)+B2*L^2/(l^2-C2)+B3*L^2/(l^2-C3)) % Cauchy : /N {1.606 6545 1 mul lambda dup mul div add} bind def /L2 {lambda 1e-3 mul dup mul} bind def % en micromètres /N {1 @@ -1783,7 +1786,7 @@ add 1.038164 L2 mul L2 116.416755 sub div add - sqrt} bind def + Sqrt} bind def /alpha1 AnglePlan1 AnglePrism add def /sinB1 alpha1 sin N div def /B1 sinB1 arcsin def @@ -1943,14 +1946,14 @@ % Les datas % Sellmeier's % glass sf15 : verre flint lourd - % n=sqrt(1+B1*L^2/(l^2-C1)+B2*L^2/(l^2-C2)+B3*L^2/(l^2-C3)) + % n=Sqrt(1+B1*L^2/(l^2-C1)+B2*L^2/(l^2-C2)+B3*L^2/(l^2-C3)) % Cauchy : /N {1.606 6545 1 mul lambda dup mul div add} bind def /L2 {lambda 1e-3 mul dup mul} bind def /N {1 1.539259 L2 mul L2 0.011931 sub div add 0.247621 L2 mul L2 0.055608 sub div add 1.038164 L2 mul L2 116.416755 sub div add - sqrt} bind def + Sqrt} bind def /alpha1 AnglePlan1 AnglePrism add def /sinB1 alpha1 sin N div def /B1 sinB1 asin def @@ -1997,7 +2000,7 @@ \def\resetOpticOptions{% hv 2006-07-20 \newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=black,linestyle=solid} \psset[pst-optic]{% - lensGlass=false,drawing=true,,lensTwo,rightRay, + lensGlass=false,drawing=true,,lensTwo,rightRay,onlyrays=false, xLeft=-7.5,xRight=7.5,yBottom=-3.0,yTop=3.0, lensType=CVG,lensColor=lightgray,lensWidth=0.5,lensDepth=1, lensHeight=5,lensScale=1,lensArrowSize=0.2,lensArrowInset=0.5, |