diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex | 590 |
1 files changed, 447 insertions, 143 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 90920f2e1be..8ca214b87a7 100644 --- a/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex +++ b/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex @@ -19,20 +19,21 @@ %% \csname PSTopticLoaded\endcsname \let\PSTopticLoaded\endinput -% Requires PSTricks, pst-node, pstcol, pst-plot, pst-3d, multido packages +% Requires PSTricks, pst-node, pst-plot, pst-grad, pst-3d, +% pst-math, pst-xkey, multido packages \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi \ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi \ifx\PSTplotLoaded\endinput\else\input pst-plot.tex\fi % parametric-plot \ifx\PSTthreeDLoaded\endinput\else\input pst-3d.tex\fi % symplan +\ifx\PSTGradLoaded\endinput\else\input pst-grad.tex\fi +\ifx\PSTmathLoaded\endinput\else\input pst-math.tex\fi \ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi % -\def\fileversion{0.95} -\def\filedate{2006/07/20} +\def\fileversion{0.96} +\def\filedate{2006/08/02} \message{`PST-Optic' v\fileversion, \filedate\space (Manuel Luque and Herbert Voss)} % -% DPC interface to the `keyval' package (until keyval based version of PSTricks) -% \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax \pst@addfams{pst-optic} \SpecialCoor @@ -78,20 +79,12 @@ % % ---------------- the if's ----------------- % -\newif\ifPst@lensTwo% is a second lens present? -\define@key[psset]{pst-optic}{lensTwo}[false]{\@nameuse{Pst@lensTwo#1}% -} -\newif\ifPst@lensGlass% draw a _real_ lens? -\define@key[psset]{pst-optic}{lensGlass}[true]{\@nameuse{Pst@lensGlass#1}% -} -\newif\ifPst@drawing% draw the nodes and rays? -\define@key[psset]{pst-optic}{drawing}[true]{\@nameuse{Pst@drawing#1}% -} -\newif\ifPst@rightRay% a ray on the right side? -\define@key[psset]{pst-optic}{rightRay}[false]{\@nameuse{Pst@rightRay#1}% -} +\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@]{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=false,drawing=true} +\psset[pst-optic]{lensGlass,drawing,lensTwo,rightRay} % % ------- the global definitions for the pspicture frame ------ % @@ -103,12 +96,8 @@ % % ---------------- the lenses ----------------- % -\define@key[psset]{pst-optic}{lensType}{% CVG|DVG - \def\psk@optic@lensType{#1}% -} -\define@key[psset]{pst-optic}{lensColor}{% - \def\psk@optic@lensColor{#1}% -} +\define@key[psset]{pst-optic}{lensType}{\def\psk@optic@lensType{#1}}% CVG|DVG|PCVG|PDVG +\define@key[psset]{pst-optic}{lensColor}{\def\psk@optic@lensColor{#1}} \define@key[psset]{pst-optic}{lensWidth}{% the thichness of the lens \def\psk@optic@lensWidth{#1}% } @@ -127,7 +116,10 @@ \define@key[psset]{pst-optic}{lensArrowInset}{% \def\psk@optic@lensArrowInset{#1}% } -\def\lensType{CVG} +\def\lensTypeCVG{CVG} +\def\lensTypeDVG{DVG} +\def\lensTypePCVG{PCVG} +\def\lensTypePDVG{PDVG} \psset[pst-optic]{lensType=CVG,lensColor=lightgray,lensWidth=0.5,lensDepth=1, lensHeight=5,lensScale=1,lensArrowSize=0.2,lensArrowInset=0.5} % @@ -136,21 +128,13 @@ \define@key[psset]{pst-optic}{mirrorType}{% PLAN|PARAbolic|SPHerical \def\psk@optic@mirrorType{#1}% } -\define@key[psset]{pst-optic}{mirrorDepth}{% - \def\psk@optic@mirrorDepth{#1}% -} +\define@key[psset]{pst-optic}{mirrorDepth}{\def\psk@optic@mirrorDepth{#1}} \define@key[psset]{pst-optic}{mirrorHeight}{% it's the TOTAL height \def\psk@optic@mirrorHeight{#1}% } -\define@key[psset]{pst-optic}{mirrorWidth}{% - \def\psk@optic@mirrorWidth{#1}% -} -\define@key[psset]{pst-optic}{mirrorColor}{% - \def\psk@optic@mirrorColor{#1}% -} -\define@key[psset]{pst-optic}{mirrorFocus}{% - \def\psk@optic@mirrorFocus{#1}% -} +\define@key[psset]{pst-optic}{mirrorWidth}{\def\psk@optic@mirrorWidth{#1}} +\define@key[psset]{pst-optic}{mirrorColor}{\def\psk@optic@mirrorColor{#1}} +\define@key[psset]{pst-optic}{mirrorFocus}{\def\psk@optic@mirrorFocus{#1}} \define@key[psset]{pst-optic}{posMirrorTwo}{% a sencond mirror? (telescope) \def\psk@optic@posMirrorTwo{#1}% } @@ -467,7 +451,7 @@ /Width \psk@optic@lensWidth\space def /Width2 Width 2.0 div def } - \ifx\psk@optic@lensType\lensType% CVG ? + \ifx\psk@optic@lensType\lensTypeCVG% CVG ? \pnode(!% /radius Width2 dup mul Height dup mul add Width2 div 2 div def /XM Width2 radius sub def @@ -497,7 +481,7 @@ linecolor=\psk@optic@lensColor% } \rput(! XO YO){% - \ifx\psk@optic@lensType\lensType% CVG + \ifx\psk@optic@lensType\lensTypeCVG% CVG \pscustom{% \parametricplot{\psk@optic@lensHeight}{-\psk@optic@lensHeight}{% /arg t radius 2.0 mul div def @@ -546,7 +530,7 @@ \uput[-90](Center){Center} \psset{linecolor=\psk@optic@rayColor} \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) - \ifx\psk@optic@lensType\lensType + \ifx\psk@optic@lensType\lensTypeCVG % the parallel ray \lensSPHRay[lensType=CVG]% (B)(I){\psk@optic@refractA}{\psk@optic@refractB}{PSPH} @@ -621,7 +605,7 @@ \def\lensSPHRay{\@ifnextchar[{\pst@lensSPHRay}{\pst@lensSPHRay[]}} \def\pst@lensSPHRay[#1](#2)(#3)#4#5#6{{% \psset{#1} - \ifx\psk@optic@lensType\lensType% CVG + \ifx\psk@optic@lensType\lensTypeCVG% CVG \ifPst@rightRay \ABinterSPHLens(#2)(#3)(Center){#6} \else @@ -632,7 +616,7 @@ \fi % \psline(! Y mT sub X 1 sub neg)(! Y mT add X 1 add neg) \refractionRay(#2)(#6)(! Y mT sub X 1 sub neg)(! Y mT add X 1 add neg){#4}{#5}{tempSPHRay} - \ifx\psk@optic@lensType\lensType% CVG + \ifx\psk@optic@lensType\lensTypeCVG% CVG \ifPst@rightRay \ABinterSPHLens(#6)(tempSPHRay')(Center'){#6'} \else @@ -658,7 +642,7 @@ \pst@getcoor{#2}\pst@tempB \pst@getcoor{#3}\pst@tempm % calculate the intersection point. we change the coordinates - \ifx\psk@optic@lensType\lensType% CVG + \ifx\psk@optic@lensType\lensTypeCVG% CVG \pnode(!% /YA \pst@tempA pop \pst@number\psxunit div def /XA \pst@tempA exch pop \pst@number\psyunit div neg def @@ -729,6 +713,62 @@ %\arrowLine[linecolor=blue,arrows=->](#4)(#4'){2} } % +\def\pst@drawDVGRays{% + %dessin de l'objet + \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) +% 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') + %\uput[45](I'){I'} + %\uput[45](I){I} + \uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}% + \uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$}% + \uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$}% + \uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$}% + \uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$}% +} +\def\pst@drawCVGRays{% +% Position des foyers + \psdots[dotstyle=|](F') + \uput[\psk@optic@spotFi](F'){$\mathrm{\psk@optic@nameFi}$} + \psdots[dotstyle=|](F) + \uput[\psk@optic@spotF](F){$\mathrm{\psk@optic@nameF}$} +%dessin de l'objet + \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) +% 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') + %\uput[-45](I'){I'} + %\uput[45](I){I} + \uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$} + \uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$} + \uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$} + \uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$} + \uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$} +} %fin 26 juin 2001 %Lentille convergente : CVG %(#2) est l'abscisse du centre optique @@ -793,9 +833,14 @@ \fi% \begingroup% \ifPst@lensGlass% - \rput(! XO YO){\ifx\psk@optic@lensType\lensType\lensCVG\else\lensDVG\fi}% + \rput(! XO YO){% + \ifx\psk@optic@lensType\lensTypeCVG\lensCVG% + \else\ifx\psk@optic@lensType\lensTypePCVG\lensCVG + \else\lensDVG\fi\fi}% \else% - \ifx\psk@optic@lensType\lensType\psset{arrows=<->}\else\psset{arrows=>-<}\fi% + \ifx\psk@optic@lensType\lensTypeDVG\psset{arrows=>-<}\else + \ifx\psk@optic@lensType\lensTypePDVG\psset{arrows=>-<}\else\psset{arrows=<->} + \fi\fi \psline[linecolor=\psk@optic@lensColor, linewidth=\psk@optic@lensWidth,arrowsize=\psk@optic@lensArrowSize, arrowinset=\psk@optic@lensArrowInset]% @@ -805,66 +850,14 @@ \psk@optic@lensScale\space mul YO add)% \fi% \endgroup% -\ifPst@drawing + \ifPst@drawing % axe optique \psline(! \psk@optic@xLeft\space YO)(! \psk@optic@xRight\space YO) - \ifx\psk@optic@lensType\lensType% -% Position des foyers - \psdots[dotstyle=|](F') - \uput[\psk@optic@spotFi](F'){$\mathrm{\psk@optic@nameFi}$} - \psdots[dotstyle=|](F) - \uput[\psk@optic@spotF](F){$\mathrm{\psk@optic@nameF}$} -%dessin de l'objet - \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) -% 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') - %\uput[-45](I'){I'} - %\uput[45](I){I} - \uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$} - \uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$} - \uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$} - \uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$} - \uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$} - \else - %dessin de l'objet - \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) -% 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') - %\uput[45](I'){I'} - %\uput[45](I){I} - \uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}% - \uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$}% - \uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$}% - \uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$}% - \uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$}% - \fi% -\fi% -\end{pspicture*}% + \ifx\psk@optic@lensType\lensTypeDVG\pst@drawDVGRays\else + \ifx\psk@optic@lensType\lensTypePDVG\pst@drawDVGRays\else + \pst@drawCVGRays\fi\fi + \fi% + \end{pspicture*}% }\ignorespaces} % % 25 december 2002 Herbert <voss@perce.de> @@ -874,11 +867,12 @@ % \def\pslensDVG{\pst@object{pslensDVG}} \def\pslensDVG@i#1#2{% - \begin@OpenObj - \pssetlength\pst@dima{#1}% - \pssetlength\pst@dimb{#2}% - \addto@pscode{\pslensDVG@ii}% - \end@OpenObj% + \begin@OpenObj + \pssetlength\pst@dima{#1}% + \pssetlength\pst@dimb{#2}% + \ifx\psk@optic@lensType\lensTypeDVG\addto@pscode{\pslensDVG@ii}% + \else\addto@pscode{\pslensPDVG@ii}\fi% + \end@OpenObj% } \def\pslensDVG@ii{% /w \pst@number\pst@dima def% lensWidth @@ -894,28 +888,58 @@ x neg y Radius angleA angleB arc wHalbe h lineto } -% -\def\pslensCVG{\pst@object{pslensCVG}} -\def\pslensCVG@i#1#2{% - \begin@OpenObj - \pssetlength\pst@dima{#1}% - \pssetlength\pst@dimb{#2}% - \addto@pscode{\pslensCVG@ii}% - \end@OpenObj% -} -% -\def\pslensCVG@ii{% +\def\pslensPDVG@ii{% /w \pst@number\pst@dima def% lensWidth /wHalbe w 2 div def% half of the width /h \pst@number\pst@dimb 2 div def% the half of the height - /Radius wHalbe dup mul h dup mul add w div def - /x Radius wHalbe sub def + /Radius wHalbe 2 div dup mul h dup mul add wHalbe div def + /x Radius wHalbe 2 div add def /y 0 def - /angleA h x atan neg def + /angleA h x wHalbe sub atan neg def /angleB angleA neg def 0 h moveto - x y Radius 180 angleA add 180 angleB add arc - x neg y Radius angleA angleB arc + wHalbe 0 rlineto + x y Radius 180 angleA add 180 angleB add arc +% x neg y Radius angleA angleB arc + wHalbe neg 0 rlineto + 0 h dup add rlineto +} +% +\def\pslensCVG{\pst@object{pslensCVG}} +\def\pslensCVG@i#1#2{% + \begin@OpenObj + \pssetlength\pst@dima{#1}% + \pssetlength\pst@dimb{#2}% + \ifx\psk@optic@lensType\lensTypeCVG\addto@pscode{\pslensCVG@ii}% + \else\addto@pscode{\pslensPCVG@ii}\fi% + \end@OpenObj% +} +% +\def\pslensCVG@ii{% + /w \pst@number\pst@dima def% lensWidth + /wHalbe w 2 div def% half of the width + /h \pst@number\pst@dimb 2 div def% the half of the height + /Radius wHalbe dup mul h dup mul add w div def + /x Radius wHalbe sub def + /y 0 def + /angleA h x atan neg def + /angleB angleA neg def + 0 h moveto + x y Radius 180 angleA add 180 angleB add arc + x neg y Radius angleA angleB arc +} +\def\pslensPCVG@ii{% + /w \pst@number\pst@dima def% lensWidth + /wHalbe w 2 div def% half of the width + /h \pst@number\pst@dimb 2 div def% the half of the height + /Radius wHalbe dup mul h dup mul add w div def + /x Radius wHalbe sub def + /y 0 def + /angleA h x atan neg def + /angleB angleA neg def + 0 h neg moveto + 0 h dup add rlineto + x neg y Radius angleA angleB arc } % %22 juin 2001 / 25 december 2002 @@ -923,21 +947,21 @@ %Le dessin de la lentille % \def\lensCVG{% - \psscalebox{\psk@optic@lensScale}{% - \pscustom[linewidth=0.75\pslinewidth]{% - \pslensCVG{\psk@optic@lensWidth}{\psk@optic@lensHeight} - \fill[fillstyle=solid,fillcolor=BleuVerre] - }% + \psscalebox{\psk@optic@lensScale}{% + \pscustom[linewidth=0.75\pslinewidth]{% + \pslensCVG{\psk@optic@lensWidth}{\psk@optic@lensHeight} + \fill[fillstyle=solid,fillcolor=BleuVerre] }% + }% } % \def\lensDVG{% - \psscalebox{\psk@optic@lensScale}{% - \pscustom[linewidth=0.75\pslinewidth]{% - \pslensDVG{\psk@optic@lensWidth}{\psk@optic@lensHeight} - \fill[fillstyle=solid,fillcolor=BleuVerre]% - }% - }% + \psscalebox{\psk@optic@lensScale}{% + \pscustom[linewidth=0.75\pslinewidth]{% + \pslensDVG{\psk@optic@lensWidth}{\psk@optic@lensHeight} + \fill[fillstyle=solid,fillcolor=BleuVerre]% + }% + }% } %Sauvegarde des points pour le cas d'un %système à deux lentilles (26 juin 2001) @@ -1001,8 +1025,8 @@ \def\pst@mirrorCVGRay[#1](#2)(#3)#4{{% \psset{#1}% \ifx\psk@optic@mirrorType\mirrorType % CVG -\typeout{====>\mirrorType} -\typeout{====>\psk@optic@mirrorType} +%\typeout{====>\mirrorType} +%\typeout{====>\psk@optic@mirrorType} \pst@getcoor{#2}\pst@tempA \pst@getcoor{#3}\pst@tempB \pnode(!% @@ -1106,8 +1130,8 @@ } ifelse ){#4''} \else %--------------- A Spherical Mirror ----------------- -\typeout{====>\mirrorType} -\typeout{====>\psk@optic@mirrorType} +%\typeout{====>\mirrorType} +%\typeout{====>\psk@optic@mirrorType} \ABinterSPHLens(#2)(#3)(Center){tempRef0} \pst@getcoor{tempRef0}\pst@tempA \pst@getcoor{tempRef0'}\pst@tempB @@ -1728,9 +1752,289 @@ \fi }\ignorespaces} % +% Prism stuff initiated by Manuel 2006-07-26 +% +\define@key[psset]{pst-optic}{AnglePrism}{\edef\psk@Prism@AnglePrism{#1}} +\define@key[psset]{pst-optic}{AnglePlan1}{\edef\psk@Prism@AnglePlanOne{#1}} +\define@key[psset]{pst-optic}{AnglePlan2}{\edef\psk@Prism@AnglePlanTwo{#1}} +\define@key[psset]{pst-optic}{lambda}{\edef\psk@Prism@Lambda{#1}} +\define@key[psset]{pst-optic}{k}{\edef\psk@Prism@k{#1}} +\define@boolkey[psset]{pst-optic}[Pst@Prism@]{notations}[true]{} +% +\psset{AnglePrism=60,AnglePlan1=25,AnglePlan2=55,k=1,lambda=632.8,notations=true} +% +\def\psprism{\pst@object{psprism}} +\def\psprism@i{% + \begin@SpecialObj + \ifPst@Prism@notations + \psline{->}(0,8) + \uput[90](0,8){$y$} + \psline{->}(-6,0)(6,0) + \uput[0](6,0){$x$} + \fi + \pnode(0,0){O} + \pnode(! + /AnglePrism \psk@Prism@AnglePrism\space 2 div def + /AnglePlan1 \psk@Prism@AnglePlanOne\space def + /AnglePlan2 \psk@Prism@AnglePlanTwo\space def + /lambda \psk@Prism@Lambda\space def + % le point C1 sur la droite 1 + /C1x -6 def + /C1y 6 def + % le point C2 sur la droite 2 + /C2x 7 def + /C2y 5 def + % donne la distance C1E + /k \psk@Prism@k\space def + % + /g1x AnglePrism sin neg def % -sin(A/2) + /g1y AnglePrism cos def % cos(A/2) + /u1x AnglePlan1 sin neg def + /u1y AnglePlan1 cos neg def + % le point E émetteur + /E1x C1x k u1x mul add def + /E1y C1y k u1y mul add def + % + /n1x AnglePlan1 cos def + /n1y AnglePlan1 sin neg def + /Lambda {E1x g1y mul E1y g1x mul neg add + n1y g1x mul neg n1x g1y mul add + div neg} bind def + % point I1 + /i1x {E1x Lambda n1x mul add} bind def + /i1y {E1y Lambda n1y mul add} bind def + 0 0){Stockage_parametres_prism} + \pspolygon[fillstyle=gradient,gradbegin=cyan,gradend=white,gradangle=60,gradmidpoint=0.5](O)% + (! 7 90 AnglePrism add cos mul 7 90 AnglePrism add sin mul) + (! 7 90 AnglePrism sub cos mul 7 90 AnglePrism sub sin mul) + \pnode(! + % 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)) + % 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 + 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 + /alpha1 AnglePlan1 AnglePrism add def + /sinB1 alpha1 sin N div def + /B1 sinB1 arcsin def + /Delta1 AnglePrism B1 sub def + %%% + /g2x AnglePrism sin def + /g2y AnglePrism cos def + /d12x Delta1 cos def % d12x + /d12y Delta1 sin def % d12y + /Lambda2 {i1x g2y mul i1y g2x mul sub + d12y g2x mul d12x g2y mul sub + div} bind def + % point I2 + /i2x {i1x Lambda2 d12x mul add} bind def + /i2y {i1y Lambda2 d12y mul add} bind def + % + /B2 AnglePrism 2 mul B1 sub def + /sinA2 N B2 sin mul def + /alpha2 sinA2 asin def + /u2x AnglePlan2 sin def + /u2y AnglePlan2 cos neg def + /Delta2 alpha2 AnglePrism sub def + /d2x Delta2 cos def + /d2y Delta2 sin def + /DELTA u2x d2y mul neg u2y d2x mul add def + /DELTA_X i2x C2x sub d2y mul neg + i2y C2y sub d2x mul add def + /DELTA_Y u2x i2y C2y sub mul neg + u2y i2x C2x sub mul add def + /MU DELTA_X DELTA div def + /LAMBDA3 DELTA_Y DELTA div def + % le point R2 + /r2x C2x MU u2x mul add def + /r2y C2y MU u2y mul add def + /a_i {AnglePlan1 neg} bind def + /a_r {alpha2 AnglePrism sub} bind def + /tan_i {a_i tan} bind def + /tan_r {a_r tan} bind def + 0 0){factice} + \pnode(! C1x C1y){C1} + \pnode(! C2x C2y){C2} + \pnode(! E1x E1y){E1} + \pnode(! i1x i1y){P1} + \pnode(! i2x i2y){I2} + \pnode(! r2x r2y){R2} + \pnode(! /bQ {i1y i1x AnglePrism tan mul sub} bind def + /bQ' {i2y i2x AnglePrism tan mul add} bind def + /xQ {bQ' bQ sub 2 div AnglePrism tan div} bind def + /yQ {bQ bQ' add 2 div} bind def + xQ yQ){Q} + \pnode(! /bI {i1y i1x tan_i mul sub} bind def + /bI'{i2y i2x tan_r mul sub} bind def + /xI {bI bI' sub tan_r tan_i sub div} bind def + /yI {xI tan_i mul bI add} bind def + xI yI){I} + \pcline[linestyle=dashed,nodesepB=-2](P1)(I) + \pcline[linestyle=dashed,nodesepB=-2](I2)(I) + \pcline[linestyle=dashed,nodesepB=-1,nodesepA=-2](P1)(Q) + \pcline[linestyle=dashed,nodesepB=-1,nodesepA=-2](I2)(Q) + \rput(P1){% + \rput{30}(0,0){\psframe*(0,0)(0.2,0.2)} + \psarc{<-}(0,0){0.8}{!180 AnglePrism add alpha1 sub}{!180 AnglePrism add} + \uput{1}[! 180 AnglePrism add alpha1 2 div sub](0,0){$i_1$} + \psarc[linecolor=blue]{<-}(0,0){1}{!AnglePrism B1 sub}{!AnglePrism} + \uput{1.2}[! AnglePrism B1 2 div sub](0,0){$r_1$} + \uput{0.4}[90](0,0){$I_1$}} + \rput(I2){% + \rput{60}(0,0){\psframe*(0,0)(0.2,0.2)} + \psarc[linecolor=blue]{->}(0,0){0.8}{! AnglePrism neg 180 add}{!AnglePrism neg 180 add B2 add} + \uput{1}[!AnglePrism neg 180 add B2 2 div add](0,0){$r_2$} + \psarc{->}(0,0){1}{! AnglePrism neg}{!alpha2 AnglePrism sub} + \uput{1.2}[!alpha2 2 div AnglePrism sub](0,0){$i_2$} + \uput{0.4}[90](0,0){$I_2$}} + \psline[linecolor={[wave]{\psk@Prism@Lambda}},arrowscale=2]{->}(P1)(I2)(R2) + \psline[linecolor={[wave]{\psk@Prism@Lambda}}](E1)(P1) + \psline[linecolor={[wave]{\psk@Prism@Lambda}},arrowscale=2]{->}(E1)(!i1x E1x add 2 div i1y E1y add 2 div) + \psarc(0,0){0.8}{!90 AnglePrism sub}{!90 AnglePrism add} + \uput[90](0,0.8){$\widehat{A}$} + \psdot[dotstyle=o](O) + \psdot[dotstyle=o](I) + \psdot[dotstyle=o](Q) + \rput(I){\psarc{->}(0,0){1}{!a_i}{!a_r} + \uput{1.1}[!a_i a_r add 2 div](0,0){$\widehat{D}$}} + \ifPst@Prism@notations + \pcline[nodesepB=-2,nodesepA=-2](C1)(E1) + \uput[180](C1){$C_1$} + \uput[180](E1){$E_1$} + % + \pcline[nodesepB=-2,nodesepA=-2](C2)(R2) + \uput[-90](C2){$C_2$} + \uput[180](R2){$R_2$} + \rput(C1){\psline(0,2) + \psarc(0,0){1}{! 90 AnglePlan1 sub}{90} + \uput{1.1}[!90 AnglePlan1 2 div sub](0,0){$\rho_1$} + \psline[arrowinset=0,linewidth=2\pslinewidth]{->}(! + 90 AnglePlan1 sub cos neg 90 AnglePlan1 sub sin neg) + \uput[0](! 90 AnglePlan1 sub cos neg 90 AnglePlan1 sub sin neg){$\overrightarrow{u}_1$} + \psline[arrowinset=0,linewidth=2\pslinewidth]{->}(! AnglePlan1 neg cos AnglePlan1 neg sin) + \uput[90](! AnglePlan1 neg cos AnglePlan1 neg sin){$\overrightarrow{n}_1$}} + \rput(C2){\psline(0,2) + \psarc(0,0){1}{90}{! 90 AnglePlan2 add} + \uput{1.1}[!90 AnglePlan2 2 div add](0,0){$\rho_2$} + \psline[arrowinset=0,linewidth=2\pslinewidth]{->}(! AnglePlan2 cos AnglePlan2 sin) + \uput[! AnglePlan2](! AnglePlan2 cos AnglePlan2 sin){$\overrightarrow{n}_2$} + \psline[arrowinset=0,linewidth=2\pslinewidth]{->}(! 90 AnglePlan2 add cos 90 AnglePlan2 add sin) + \uput[-90](! 90 AnglePlan2 add cos 90 AnglePlan2 add sin){$\overrightarrow{u}_2$}} + \psdot[dotstyle=o](C1) + \psdot[dotstyle=o,linecolor={[wave]{\psk@Prism@Lambda}}](E1) + \psdot[dotstyle=o](C2) + \psdot[dotstyle=o](R2) + \fi% + \end@SpecialObj% +} +% +%% Commande \psprismColor +\def\psprismColor{\pst@object{psprismColor}} +\def\psprismColor@i{% + \begin@SpecialObj + \pnode(0,0){O} + \pnode(! + /AnglePrism \psk@Prism@AnglePrism\space 2 div def + /AnglePlan1 \psk@Prism@AnglePlanOne\space def + /AnglePlan2 \psk@Prism@AnglePlanTwo\space def + % le point C1 sur la droite 1 + /C1x -8 def + /C1y 7 def + % le point C2 sur la droite 2 + /C2x 11 def + /C2y 5 def + % donne la distance C1E1 + /k \psk@Prism@k\space def + % + /g1x AnglePrism sin neg def % -sin(A/2) + /g1y AnglePrism cos def % cos(A/2) + /u1x AnglePlan1 sin neg def + /u1y AnglePlan1 cos neg def + % le point E émetteur + /E1x C1x k u1x mul add def + /E1y C1y k u1y mul add def + % + /n1x AnglePlan1 cos def + /n1y AnglePlan1 sin neg def + /Lambda {E1x g1y mul E1y g1x mul neg add + n1y g1x mul neg n1x g1y mul add + div neg} bind def + % point I1 + /i1x {E1x Lambda n1x mul add} bind def + /i1y {E1y Lambda n1y mul add} bind def + 0 0){Stockage_parametres_prism} + \pspolygon[fillstyle=gradient,gradbegin=cyan,gradend=white,gradangle=60,gradmidpoint=0.5](O)% + (! 7 90 AnglePrism add cos mul 7 90 AnglePrism add sin mul) + (! 7 90 AnglePrism sub cos mul 7 90 AnglePrism sub sin mul) + \multido{\iLAMBDA=400+5}{80}{% + \pstVerb{/lambda \iLAMBDA\space def}% + \definecolor{prism}{wave}{\iLAMBDA}% + \pnode(! + % 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)) + % 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 + /alpha1 AnglePlan1 AnglePrism add def + /sinB1 alpha1 sin N div def + /B1 sinB1 asin def + /Delta1 AnglePrism B1 sub def + %%% + /g2x AnglePrism sin def + /g2y AnglePrism cos def + /d12x Delta1 cos def % d12x + /d12y Delta1 sin def % d12y + /Lambda2 {i1x g2y mul i1y g2x mul sub d12y g2x mul d12x g2y mul sub div} bind def + % point I2 + /i2x {i1x Lambda2 d12x mul add} bind def + /i2y {i1y Lambda2 d12y mul add} bind def + % + /B2 AnglePrism 2 mul B1 sub def + /sinA2 N B2 sin mul def + /alpha2 sinA2 asin def + /u2x AnglePlan2 sin def + /u2y AnglePlan2 cos neg def + /Delta2 alpha2 AnglePrism sub def + /d2x Delta2 cos def + /d2y Delta2 sin def + /s2x i2x C2x sub def + /s2y i2y C2y sub def + /dA d2x u2y mul d2y u2x mul sub def + /dM d2x s2y mul d2y s2x mul sub def +% le point R2 + /r2x C2x dM dA div u2x mul add def + /r2y C2y dM dA div u2y mul add def + 0 0){factice} + \pnode(! C1x C1y){C1} + \pnode(! C2x C2y){C2} + \pnode(! E1x E1y){E1} + \pnode(! i1x i1y){I1} + \pnode(! i2x i2y){I2} + \pnode(! r2x r2y){R2} + \psline[linecolor=prism](I1)(I2)(R2)} + \psline[linecolor=white,linewidth=0.5mm](E1)(I1) + \psline[linecolor=white,linewidth=0.5mm,arrowscale=2]{->}(E1)(!i1x E1x add 2 div i1y E1y add 2 div) + \end@SpecialObj% +} +% +% \def\resetOpticOptions{% hv 2006-07-20 \psset[pst-optic]{% - lensGlass=false,drawing=true, + lensGlass=false,drawing=true,,lensTwo,rightRay, 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, @@ -1740,11 +2044,11 @@ XO=0,YO=0,OA=-3,posStart=0,length=2,focus=2,AB=1,arrowOffset=0, nameO=O,spotO=225,nameAi=A',spotAi=90,nameBi=B',spotBi=270, nameFi=F',spotFi=270, - rayColor=red}% + rayColor=red,% + AnglePrism=60,AnglePlan1=25,AnglePlan2=55,k=1,lambda=632.8,notations=true}% % \gdef\mirrorType{CVG}% -% \gdef\lensType{CVG}% +% \gdef\lensTypeCVG{CVG}% } -% \catcode`\@=\PstAtCode\relax % %% END: pst-optic.tex |