diff options
Diffstat (limited to 'graphics/pstricks/contrib/pst-optic')
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/Changes | 32 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/README | 25 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib | 125 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf | bin | 0 -> 446888 bytes | |||
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex | 1327 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/latex/pst-optic.sty | 7 | ||||
-rw-r--r-- | graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex | 2022 |
7 files changed, 3538 insertions, 0 deletions
diff --git a/graphics/pstricks/contrib/pst-optic/Changes b/graphics/pstricks/contrib/pst-optic/Changes new file mode 100644 index 0000000000..1983e9e73a --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/Changes @@ -0,0 +1,32 @@ +---- pst-optic.tex +1.02 2016-07-10 - added option onlyrays, preset to false +1.01 2010-07-23 - bugfixes for \psset[pst-optic,pstricks] +1.00 2009-02-10 - new style opticalAxis to allow different line styles + - cosmetic changes to the code and the documentation +0.97 2007-01-07 - new option rayWidth for psprism +0.96 2006-08-03 - new macros for setting a prism + - new option for a plan convex and + divergent lens +0.95 2006-07-20 - fix spurious blanks + - use \def instead of \edef + for the keyval definitions + - some improvements to the code +0.94 2005-10-28 using \psscalebox to prevent clashes with graphicx + needs pstricks.tex > 1.10 +0.93 2004-11-25 \ignorespaces for all macros +0.92 2004-11-08 spurious blank +0.91 2004-10-23 use pst-xkey instead of pst-key + +---- pst-optic.sty + 2004-11-09 new version to get a TeX output of the used version + +---- pst-optic-doc.tex + 2009-02-10 new documentation + 2005-10-24 the parallel line image was wrong + 2005-05-18 small update to some examples + +---- pst-optic-examples.tex + 2009-02-10 new documentation + 2005-05-18 small update to some examples + +
\ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-optic/README b/graphics/pstricks/contrib/pst-optic/README new file mode 100644 index 0000000000..ae99fe4a5b --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/README @@ -0,0 +1,25 @@ +%% Package `pst-optic.tex' +%% +%% Manuel Luque <Mluque5130@aol.com> (France) +%% Herbert Voss <hvoss@tug.org> (Germany) +%% +%% 2016-07-10 +%% + +Save the files + +pst-optic.sty +pst-optic.tex + +in any place, where latex or any other TeX program will find it. +If you like to get the documentation file in another format run + +latex pst-optic-doc.tex +biber pst-optic.doc +latex pst-optic-doc.tex +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. + diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib new file mode 100644 index 0000000000..f45040c1fe --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib @@ -0,0 +1,125 @@ +@STRING{tugboat = {TUGboat} } +@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } + +@Book{companion, + author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Dennis Roegel and Herbert Vo\ss}, + title = {The {\LaTeX} {G}raphics {C}ompanion}, + publisher = {{Addison-Wesley Publishing Company}}, + edition = 2, + year = {2007}, + address = {Boston, Mass.} +} + +@Article{girou:01:, + author = {Denis Girou}, + title = {Pr\'esentation de {PST}ricks}, + journal = {Cahier {GUT}enberg}, + year = 1994, + volume = {16}, + month = apr, + pages = {21-70} +} + +@Article{girou:02:, + author = {{Timothy Van} Zandt and Denis Girou}, + title = {Inside {PST}ricks}, + journal = TUGboat, + year = 1994, + volume = {15}, + month = sep, + pages = {239-246} +} + +@Book{PostScript, + Author = {Kollock, Nikolai G.}, + Title = {Post{S}cript richtig eingesetzt: vom {K}onzept zum + praktischen {E}insatz}, + Publisher = {IWT}, + Address = {Vaterstetten}, + year = 1989, +} + +@ctan{multido, + Title = {\texttt{multido.tex} - a loop macro, that supports fixed-point addition}, + Author = {{Timothy Van} Zandt}, + url = {/macros/generic/multido.tex}, + year = 1997 +} + +@Book{PSTricks2, + author = {Herbert Vo\ss{}}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {7}, + publisher = {DANTE -- Lehmanns}, + year = {2016}, + address = {Heidelberg/Hamburg} +} + +@Book{PSTricksE, + author = {Herbert Vo\ss{}}, + title = {\texttt{PSTricks} -- {G}raphics and {P}ost{S}cript for \LaTeX}, + edition = {1}, + publisher = {UIT}, + year = {2011}, + address = {Cambridge -- UK} +} + +@Book{LTXquick, + author = {Herbert Vo\ss{}}, + title = {{\LaTeX} quick reference}, + edition = {1}, + publisher = {UIT}, + year = {2012}, + address = {Cambridge -- UK} +} + +@Book{presentations, + author = {Herbert Vo\ss}, + title = {Presentations with \LaTeX}, + edition = {1}, + publisher = {DANTE -- Lehmanns Media}, + year = {2012}, + address = {Heidelberg/Berlin} +} + + +@Book{tbt, + author = {Victor Eijkhout}, + title = {\TeX\ by Topic -- {A} \TeX{}nician Reference}, + edition = {1}, + publisher = {DANTE -- lehmanns media}, + year = {2014}, + address = {Heidelberg/Berlin} +} + + + +@Article{dtk02.1:voss:mathematischen, + author = {Herbert Vo{\ss}}, + title = {Die mathematischen {F}unktionen von {P}ostscript}, + journal = dtk, + year = 2002, + volume = {1/02}, + altvolume = 1, + 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 + Sinne ist. Au{\ss}erdem wird h{\"a}ufig vergessen, dass + sich mit den \PS-Funktionen viele Dinge erledigen lassen, + bei denen sonst auf externe Programme zur{\"u}ckgegriffen + wird. Dies wird im Folgenden f{\"u}r die mathematischen + Funktionen im Zusammenhang mit dem Paket \texttt{pst-plot} + gezeigt. } +} + +@ctan{pstlens:2001, + Title = {PST-lens - {\PS} macros for Generic TeX}, + Author = {Denis Girou and Manuel Luque}, + url = {/graphics/pstricks/contrib/pst-lens/}, + year = 2001, +} + diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf Binary files differnew file mode 100644 index 0000000000..5af7957040 --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex new file mode 100644 index 0000000000..60ed1261f6 --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex @@ -0,0 +1,1327 @@ +%% $Id: pst-func-doc.tex 64 2008-12-08 22:14:27Z herbert $ +\documentclass[11pt,english,BCOR10mm,DIV13,bibliography=totoc,parskip=false,smallheadings + headexclude,footexclude,oneside]{pst-doc} +\usepackage[utf8]{inputenc} +\usepackage{pst-text} +\usepackage{pst-optic} +\let\pstOpticFV\fileversion +\lstset{pos=t,wide=true,language=PSTricks,basicstyle=\footnotesize\ttfamily} +\let\belowcaptionskip\abovecaptionskip +% +\usepackage[style=dtk]{biblatex} +\addbibresource{\jobname.bib} + +\begin{document} + +\title{\texttt{pst-optic}} +\subtitle{Lenses and Mirrors; v.\pstOpticFV} + +\author{Manuel Luque \\Herbert Vo\ss} +\docauthor{Herbert Vo\ss} +\date{\today} +\def\bgImage{\begin{pspicture*}(-0.5,-4)(8,4) + \rput(0,0){\mirrorCVG[mirrorHeight=8,mirrorDepth=4,drawing=false]} + \multido{\rY=-4.00+0.25}{33}{% + \mirrorCVGRay[linewidth=0.5pt,mirrorHeight=8, + mirrorDepth=4](10,\rY)(1,\rY){Dummy}} +\end{pspicture*}} + +\maketitle + +\tableofcontents + +\clearpage + +\begin{abstract} +\noindent +\LPack{pst-optic} loads by default the following packages: +\LPack{pstricks}, \LPack{pst-node}, \LPack{pst-plot}, \LPack{pst-3d}, +\LPack{pst-grad}, \LPack{pst-math}, \LPack{multido}, and \LPack{pst-xke}. +All should be already part of your local \TeX\ installation. If not, or in case +of having older versions, go to \url{http://www.CTAN.org/} and load the newest version. + +\vfill\noindent +Thanks to: \\ +Jean-C\^ome Charpentier, +Arnaud Schmittbuhl. +\end{abstract} + +\section{General Options} + +All options are by default document wide valid but not supported by all macros. +Table~\ref{tab:generalOptions} shows the general ones. Others are shown in +Table~\ref{tab:defaultLens} and \ref{tab:defaultSpiegel}. + +\begin{table}[!htb] +\centering +\caption{General options and the defaults}\label{tab:generalOptions} +\begin{tabular}{@{}l l l @{}} + \emph{Option} & \emph{Name} & \emph{Default}\\\hline + Left value of the picture in cm & \Lkeyword{xLeft} & -7.5\\ + Right value of the picture in cm & \Lkeyword{xRight} & 7.5\\ + Lowest value of the picture in cm & \Lkeyword{xBottom} & -3\\ + Highest value of the picture in cm & \Lkeyword{xTop} & 3\\ + x-Offset & \Lkeyword{XO} & 0\\ + y-Offset & \Lkeyword{YO} & 0\\ + 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\\ + Node F as string & \Lkeyword{nameF} & F\\ + Angle F in degrees & \Lkeyword{spotF} & 270\\ + Node O as string & \Lkeyword{nameO} & O\\ + Angle O in degrees & \Lkeyword{spotO} & 225\\ + Node A' as string & \Lkeyword{nameAi} & A'\\ + Angle A' in degrees & \Lkeyword{spotAi} & 90\\ + Node B' as string & \Lkeyword{nameBi} & B'\\ + Angle B' in degrees & \Lkeyword{spotBi} & 270\\ + Node F' as string & \Lkeyword{nameFi} & B'\\ + Angle F' in degrees & \Lkeyword{spotFi} & 270\\ + Ray color & \Lkeyword{rayColor} & black\\\hline +\end{tabular} +\end{table} + +\Lcs{pst-optic} puts the lens and mirror macros in an own \Lenv{pspicture} environment. +The star version enables the clipping option of \LPack{pstricks}: + +\begin{lstlisting}[style=syntax] +\begin{pspicture}*(xLeft,yBottom)(xRight,yTop) + \lens[focus=2,OA=-3,AB=1,XO=0,YO=0,xLeft=-7.5,xRight=7.5,yBottom=-3,yTop=3] +\end{pspicture} +\end{lstlisting} + + + +If you need other values for the \Lenv{pspicture} environment, then use the \Lcs{rput} +command to place the macro at any position. + +\begin{LTXexample} +\begin{pspicture}[showgrid=true](-5,-2.2)(7,4) +\rput(1.5,1.5){% + \lens[lensType=DVG,lensGlass,lensWidth=0.5,rayColor=red, + focus=-2,AB=2,spotAi=270,spotBi=90]} +\end{pspicture} +\end{LTXexample} + +\subsection{\nxLcs{resetOpticOptions}} +The Macro \Lcs{resetOpticOptions} resets all \LPack{pst-optic} options to the default value. + +\subsection{Optical axis line style} +\LPack{pst-optic} definies a line style \Lnotation{opticalAxis} with the predefines values +of: +\begin{lstlisting}[style=syntax] +\newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=black,linestyle=solid} +\end{lstlisting} + +It can be overwritten in the same way with \Lcs{newpsstyle}. + +\begin{LTXexample} +\newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=blue,linestyle=dashed} +\lens +\end{LTXexample} + +\newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=black,linestyle=solid}% reset the changes + +\clearpage +\section{Lenses} + +There are macros for the convergent and divergent lens +\begin{BDef} +\Lcs{lens}\OptArgs\\ +\Lcs{lensCVG}\OptArgs\% \textbf{C}on\textbf{v}er\textbf{g}ent (Collecting lens ) -- default\\ +\Lcs{lensDVG}\OptArgs\% \textbf{D}i\textbf{v}er\textbf{g}ent (Scatter lens ) +\end{BDef} + +\subsection{The Coordinates of the predefined Nodes} + +The following figure shows the coordinates of the predefined nodes (see Table~\ref{tab:generalOptions}). + +\resizebox{\textwidth}{!}{% +\begin{pspicture*}(-8,-3.25)(8,3.25) +\rput(0,0){% + \lens[drawing=false] + \psline[linewidth=1pt](xLeft)(xRight) + \qdisk(A){1.5pt} + \qdisk(B){1.5pt} + \qdisk(A'){1.5pt}\qdisk(B'){1.5pt} + \qdisk(F){1.5pt}\qdisk(F'){1.5pt} + \qdisk(O){1.5pt}\qdisk(I){1.5pt} + \qdisk(I'){1.5pt}\qdisk(I1){1.5pt} + \qdisk(I2){1.5pt} + \uput[270](A){A}\uput[90](B){B}\uput[270](F){F}\uput[0](I){I} + \uput[0](I'){$\mathrm{I'}$}\uput[270](F'){$\mathrm{F'}$} + \uput[270](B'){$\mathrm{B'}$}\uput[90](A'){$\mathrm{A'}$} + \uput[180](I1){I1}\uput[0](I2){I2}} + \psgrid[subgriddiv=0,griddots=4,gridlabels=7pt] +\end{pspicture*}} +\captionof{figure}{Coodinates of the predefined Nodes}\label{fig:nodes} + +\subsection{The Lens Type} + +\begin{LTXexample}[wide=false] +\lens[lensType=CVG] +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Collecting lens}\label{fig:defaultCVG} + +\begin{LTXexample}[wide=false] +\lens[lensType=PCVG] +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Plan Collecting lens} + +\enlargethispage{2ex} + +\begin{LTXexample}[wide=false] +\psscalebox{0.75}{\lens[lensType=DVG,focus=-2,spotAi=270,spotBi=90]} +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Scatter lens}\label{fig:defaultDVG} + +\begin{LTXexample}[wide=false] +\lens[lensType=PDVG,focus=-2,spotAi=270,spotBi=90] +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Plan Scatter lens} + +\clearpage + +Using \Lcs{lens}\OptArg{\Lkeyword{lensType}=\ldots} gives the in figures \ref{fig:defaultCVG} and +\ref{fig:defaultDVG} shown lenses with the default values from Table~\ref{tab:defaultLens}. + + + + +\begin{table}[!htb] +\centering +\begin{minipage}{\columnwidth} +\centering +\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 height in cm & \Lkeyword{lensHeight} & 5cm\\ + Lense width in cm & \Lkeyword{lensWidth} & 0.5cm\footnotemark\\ + vertical scale (obsolet) & \Lkeyword{lensScale} & 1\\ + View the lens & \Lkeyword{lensGlass} & \false\\ + show onyl the rays & \Lkeyword{onlyrays} & \false\\ + Second lens & \Lkeyword{lensTwo} & \false\\ + Focus in cm & \Lkeyword{focus} & 2\\ + Distance $\mathrm{\overline{OA}}$& \Lkeyword{OA} & -4\\ + Distance $\mathrm{\overline{AB}}$& \Lkeyword{AB} & 1.5\\ + Lens color & \Lkeyword{lenscolor} & \black\\ + Arrow length in cm & \Lkeyword{lensarrowsize} & 0.2\\ + Arrow inset in cm & \Lkeyword{lensarrowinset} & 0.5\\ +\end{tabular} +\footnotetext{\textsuperscript{1} only for \Lkeyset{lensGlass=true}, otherwise set to \texttt{2\textbackslash pslinewidth}} +\end{minipage} +\end{table} + +The origin of the coordinate system is by default vertically and horinzontally symmetric. +If you want to place the lens at another coordinates then define your own +\Lenv{pspicture}-environment and use the \Lcs{rput}-command: + +\begin{lstlisting}[style=syntax] +\begin{pspicture}(-7.5,-3)(7.5,3) + \rput(x,y){\lens[...]} +\begin{pspicture} +\begin{pspicture*}(-7.5,-3)(7.5,3) + \rput(x,y){\lens[...]} +\begin{pspicture*} +\end{lstlisting} + +The star version enables the clipping option. + + + +\subsection{\nxLcs{Transform}} + +The \Lcs{Transform}-macro renames all existing nodes in names with an additional +,,1``. Table~\ref{tab:Transform} shows a list of all nodes. +\Lcs{Transform} also defines a new node \verb|factice|\index{factice@\texttt{factice}} with the coordinates +\verb|(XO1,YO1)|. The renaming of all nodes makes it easier to handle objects with more than one lens. +With the option \Lkeyset{lensTwo=true} it is possible to chain the different rays of the lenses +(Figure~\ref{fig:lensTwoC}). + +\begin{table}[!htb] +\addtolength{\tabcolsep}{-2pt} +\caption{Renaming of the nodes after calling the macro \nxLcs{Transform}}\label{tab:Transform} +\centering +{\ttfamily\begin{tabular}{@{}l|lllllllllllll @{}} +\emph{old} & A & B & A' & B' & O & F & F' & I & I' & XO & YO & OA' & A'B'\\\hline +\emph{new} &A1& B1& A'1& B'1& O1& F1& F'1& I1& I'1& XO1& YO1& O1A1'& A'1B'1 +\end{tabular}} +\end{table} + + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-7.5,-2.75)(7.5,3) +\rput(0,0){\lens[lensScale=0.6,XO=-4,focus=1,OA=-2,lensGlass, lensWidth=0.5]} +\rput(0,0){\lens[lensScale=1.2,XO=2,focus=2,lensGlass,lensWidth=0.5]} +\end{pspicture*} +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Definition of two unchained lenses} + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-7.5,-2.75)(7.5,3) +\rput(0,0){\lens[lensScale=0.6,XO=-4,focus=1,OA=-2,lensGlass, lensWidth=0.5]} +\Transform +\rput(0,0){\lens[lensScale=1.2,XO=2,focus=2,lensTwo=true,lensGlass,lensWidth=0.5]} +\end{pspicture*} +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Definition of two chained lenses} + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-7.5,-2.75)(7.5,3) +\rput(0,0){\lens[lensScale=0.6,XO=-4,nameF=F_1,nameA=A_1,nameB=B_1, + nameFi=F'_1,nameAi={ },nameBi={},nameO=O_1,focus=1,OA=-2,lensGlass, lensWidth=0.5]} +\pspolygon[style=rayuresJaunes,linestyle=none](B)(I)(B')(I')(B) +\Transform +\rput(0,0){\lens[lensScale=1.2,XO=2,focus=2,nameA=A'_1,spotA=90,nameB=B'_1,spotB=270, + nameO=O_2,nameAi=A'_2,spotAi=270,nameBi=B'_2,spotBi=90,nameF=F_2,nameFi=F'_2, + lensTwo=true,lensGlass,lensWidth=0.5]} +\pspolygon[style=rayuresJaunes,linestyle=none](B)(I)(B')(I')(B) +\end{pspicture*} +\end{LTXexample} +\vspace*{-2ex} +\captionof{figure}{Definition of two chained lenses and an additional modification of the node labels.}\label{fig:lensTwoC} + +\clearpage + +\subsection{\nxLcs{rayInterLens}} + +This macro is only useful for a two-lens-system. Figure~\ref{fig:RayInter} shows such a system. +The nodes \Lnotation{B1}, \Lnotation{I11}, \Lnotation{F'1}, and \Lnotation{B'1} are predefined +by the \Lcs{lens}-macro. To draw the two rays +from the left lense via the node \Lnotation{B'1} to the second lens, we need the coordinates of these +points. \Lcs{rayInterLense} defines such nodes. The Syntax: + +\begin{BDef} +\Lcs{rayInterLense}\Largr{StartNode}\Largr{IntermediatNode}\Largr{LensDistance}\Largb{LensNode} +\end{BDef} + +Two parallel lines are drawn with the \Lcs{Parallel}-Macro. + +\begin{LTXexample} +\begin{pspicture*}(-7.5,-4)(7.5,4) +\rput(0,0){\lens[focus=1.5,OA=-2,AB=0.6,XO=-5,lensGlass,yBottom=-4,yTop=4,drawing=false, + lensWidth=0.5,lensScale=0.5,nameF=F_1,nameFi=F'_1]} +\psline[linewidth=1pt](xLeft)(xRight) +\Transform +\rput(0,0){\lens[focus=2,XO=4,lensGlass,yBottom=-4,yTop=4,drawing=false,lensWidth=0.5, + lensHeight=7,nameF=F_2,nameFi=F'_2,spotF=90,spotFi=90]} +\psline{->}(A1)(B1)\psline{->}(A'1)(B'1) +\psset{linecolor=red} +\uput[45](B1){B1} \uput[90](O){O} \uput[225](O1){O1} \uput[45](I11){I11} \uput[45](B'1){$B'_1$} +\rayInterLens(I11)(B'1){4}{Inter1L2} \rayInterLens(O1)(B'1){4}{Inter2L2} +\uput[350](Inter1L2){Inter1L2} +\psline(B1)(I11)(B'1)(Inter1L2) \psline(B1)(O1)(B'1)(Inter2L2) +\Parallel(B'1)(O)(Inter2L2){B2inftyRigth} \Parallel(B'1)(O)(Inter1L2){B3inftyRigth} +\psset{length=-2,linestyle=dashed} +\Parallel(B'1)(O)(Inter2L2){B2inftyLeft} \Parallel(B'1)(O)(Inter1L2){B3inftyLeft} +\psline[linestyle=dotted, linewidth=2pt,linecolor=black]{->}(0,-4)(0,+4) +\end{pspicture*} +\end{LTXexample} +\captionof{figure}{Demonstration of \nxLcs{rayInterLens}\label{fig:RayInter}} + + + + + +\subsection{\nxLcs{telescope}} + +Figure~\ref{fig:defaultTele} shows the configuration of a telescope and Table~\ref{tab:defaultSpiegel} +the special options for the \Lcs{telescop}-Macro. + + +\begin{LTXexample}[wide=false] +\telescope +\end{LTXexample} +\captionof{figure}{\nxLcs{telescope}-Macro}\label{fig:defaultTele} + + + +\section{Mirrors} + +\subsection{options} +Figure~\ref{fig:Spiegel} shows the available mirrors and Table~\ref{tab:defaultSpiegel} the possible options. + + + + +\begin{table}[!htb] +\centering +\caption{List of options for mirrors with the predefines values}\label{tab:defaultSpiegel} +\begin{tabularx}{\linewidth}{@{} >{\RaggedRight}X l l @{}} +\emph{Option} & \emph{Name} & \emph{Default}\\\hline +Left value of the picture in cm & \Lkeyword{xLeft} & -0.5\\ +Right value of the picture in cm & \Lkeyword{xRight} & 11\\ +Lowest value of the picture in cm & \Lkeyword{xBottom} & -6\\ +Highest value of the picture in cm & \Lkeyword{xTop} & 2.5\\ +Mirror height in cm & \Lkeyword{mirrorHeight} & 5\\ +Mirror depth in cm & \Lkeyword{mirrorDepth} & 1\\ +Mirror width in cm & \Lkeyword{mirrorWidth} & 0.25\\ +Mirror color & \Lkeyword{mirrorColor} & lightgray\\ +Ray color & \Lkeyword{rayColor} & black\\ +Focus in cm +(only together with the option \Lkeyword{posMirrorTwo} senseful) & \Lkeyword{mirrorFocus} & 8\\ +Position of the 2. mirror in cm & \Lkeyword{posMirrorTwo} & 8\\ +Inclination of the 2. mirror in degrees & \Lkeyword{mirrorTwoAngle} & 45\\ +Draw lines & \Lkeyword{drawing} & true\\ +\end{tabularx} +\end{table} + + +\begin{LTXexample}[width=4cm,pos=l] +\begin{pspicture*}[showgrid=true](-1,-3)(3,3) +\rput(0,0){\mirrorCVG[mirrorColor=gray,drawing=false]} +\psaxes[linestyle=dashed,linecolor=red,linewidth=1pt,arrows=->](0,0)(-1,-3)(3,3) +\qdisk(Focus){2pt} \rput(Focus){\rput(0,0.25){Focus}} +\pcline[arrows=|-|](-0.75,-2.5)(-0.75,2.5)\ncput*[nrot=:U]{mirrorHeight} +\pcline[arrows=|-|](0,2.75)(1,2.75) \rput[l](1.1,2.75){mirrorDepth} +\pcline[arrows=|-|](1,-2.75)(0.75,-2.75) \rput[l](1.1,-2.75){mirrorWidth} +\rput[l](1,-1){mirrorColor} +\psline{<-}(0.2,-1)(0.8,-1) +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[width=5cm,pos=l] +\begin{pspicture*}[showgrid=true](-4,-3)(1,3) +\rput(0,0){\mirrorDVG[mirrorColor=gray,drawing=false]} +\psaxes[linestyle=dashed,linecolor=red,linewidth=1pt,arrows=->](0,0)(-4,-3)(1,3) +\qdisk(Focus){2pt} \rput(Focus){\rput(0,0.25){Focus}} +\pcline[arrows=|-|](.5,-2.5)(.5,2.5) \ncput*[nrot=:U]{mirrorHeight} +\pcline[arrows=|-|](-1.25,2.75)(-.25,2.75) \rput[r](-1.3,2.75){mirrorDepth} +\pcline[arrows=|-|](-1.25,-2.75)(-1,-2.75) \rput[r](-1.3,-2.75){mirrorWidth} +\rput[r](-2,-2){mirrorColor} \psline{->}(-2,-2)(-0.9,-2) +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[width=4cm,pos=l] +\begin{pspicture}[showgrid=true](-2,-2)(2,2) +\pnode(-1.5,-1.5){M1} \pnode(1,1){M2} +\uput[-90](M1){$\mathrm{M_1}$}\uput[90](M2){$\mathrm{M_2}$} +\pnode(-1.5,1.5){A} +\planMirrorRay(A)(M1)(M2){A'} +\psline[linewidth=5pt](M1)(M2)\pscircle*(A){2pt} +\uput[0](A){A} \uput[0](A'){$\mathrm{A'}$} +\pscircle*(A'){2pt} \psline[linestyle=dashed](A)(A') +\end{pspicture} +\end{LTXexample} +\captionof{figure}{The different mirror macros: a) \nxLcs{mirrorCVG} b) \nxLcs{mirrorDVG} c) +\nxLcs{planMirrorRay}}\label{fig:Spiegel}\label{fig:planMirror} + +\subsection{\nxLcs{mirrorCVG}} + +Figure~\ref{fig:mirrorCVG} shows the default for the \Lcs{mirrorCVG}-macro with the +predefined nodes anf three default rays. + + +\begin{LTXexample}[width=7cm,pos=l] +\begin{pspicture*}[showgrid=true](-1,-3)(6,3) + \rput(0,0){\mirrorCVG[rayColor=red]} +\end{pspicture*} +\end{LTXexample} +\captionof{figure}{Parabolic Mirror \nxLcs{mirrorCVG}}\label{fig:mirrorCVG} + +\begin{LTXexample}[width=8.5cm,pos=l] +\begin{pspicture*}(-0.5,-4)(8,4) + \rput(0,0){\mirrorCVG[mirrorHeight=8,mirrorDepth=4,drawing=false]} + \multido{\rY=-4.00+0.25}{33}{% + \mirrorCVGRay[linewidth=0.5pt,mirrorHeight=8, + mirrorDepth=4](10,\rY)(1,\rY){Dummy}} +\end{pspicture*} +\end{LTXexample} +\captionof{figure}{Example}\label{fig:CVGAnwendung} + + +\clearpage + +\section{\nxLcs{mirrorDVG}} + +%Figure~\ref{fig:mirrorDVG} shows the defaults for the macro \Lcs{mirrorDVG}-Makros. + + +\begin{LTXexample}[width=7cm,pos=l] +\begin{pspicture*}[showgrid=true](-2,-2.6)(5,3) + \rput(0,0){\mirrorDVG[rayColor=red]} +\end{pspicture*} +\end{LTXexample} +\vspace{-10mm} +\captionof{figure}{\nxLcs{mirrorDVG}}\label{fig:mirrorDVG} + + +\enlargethispage{13mm} + +\begin{LTXexample}[wide] +\begin{pspicture*}[showgrid=true](-4,-4)(6,4) +\rput(0,0){\mirrorCVG[drawing=false,mirrorDepth=0.75,mirrorHeight=7]} +\qdisk(Focus){2pt} \rput(6,2.5){\eye} +\pnode(1.75,-1.5){A}\pnode(1.75,1){B}\psline[arrows=->,linewidth=4pt](A)(B) +\uput{0.2}[0](2,0){\Huge G} \psset{linecolor=red} +\mirrorCVGRay[rayColor=red,mirrorHeight=7,mirrorDepth=0.75](A)(0,-0.9){P1} +\psOutLine[length=3](P1)(P1'){PEnd}\psBeforeLine[length=5,linestyle=dashed](P1)(P1'){PBegin} +\mirrorCVGRay[rayColor=red,mirrorHeight=7,mirrorDepth=0.75](A)(0,-0.2){P2} +\psOutLine[length=3](P2)(P2''){PEnd}\psBeforeLine[length=5,linestyle=dashed](P2)(P2'){PBegin} +% +\mirrorCVGRay[rayColor=red,mirrorHeight=7,mirrorDepth=0.75](B)(0,2.75){P3} +\psOutLine[length=3](P3)(P3'){PEnd}\psBeforeLine[length=5,linestyle=dashed](P3)(P3'){PBegin} +\mirrorCVGRay[rayColor=red,mirrorHeight=7,mirrorDepth=0.75](B)(0,1.8){P4} +\psOutLine[length=3](P4)(P4'){PEnd}\psBeforeLine[length=5,linestyle=dashed](P4)(P4'){PBegin} +\ABinterCD(P3)(P3')(P4)(P4'){A'}\ABinterCD(P1)(P1')(P2)(P2'){B'} +\psline[arrows=->,linewidth=4pt,linestyle=dashed](B')(A') +\nodeBetween(A')(B'){G''}\uput{0}[0](G''){\Huge G'} +\end{pspicture*} +\end{LTXexample} +\captionof{figure}{Example as a magnifier}\label{fig:DVGAnwendung} + +\clearpage + +\subsection{Drawing Rays in the Mirror Macros} + +There are two different macros for drawing rays: + + + + +\begin{BDef} +\Lcs{mirrorCVGRay}\OptArgs\Largr{Node1}\Largr{Node2}\Largb{MirrorNode}\\ +\Lcs{mirrorDVGRay}\OptArgs\Largr{Node1}\Largr{Node2}\Largr{MirrorNode} +\end{BDef} + +The \Lnotation{MirrorNode} maybe : + +\begin{tabularx}{\textwidth}{l|X} +\Lnotation{MirrorNode} & first point on the mirror\\ +\Lnotation{MirrorNode'} & end node or second point on the mirror if one more reflection happens\\ +\Lnotation{MirrorNode''} & end node for a second reflection +\end{tabularx} + +If there are only one reflection, then \Lnotation{MirrorNode'} and \Lnotation{MirrorNode''} are the same. + +\subsection{\nxLcs{planMirrorRay}} + +The \Lcs{planMirrorRay}-Macro caculates the coordinates of a mirrored point. In +Figure~\ref{fig:planMirror} is a given node \verb|A|, whereas \verb|A'| is calculated by the macro. The syntax is: + +\begin{BDef} +\Lcs{planMirrorRay}\Largr{Mirrorbegin}\Largr{Mirrorend}\Largr{Originalpoint}\Largb{New point} +\end{BDef} + +The macro doesn't draw any lines, only the coordinates of the new point are saved by the new node name. + +\subsection{\nxLcs{symPlan}} + +\verb|\symPlan| allows to mirroring complete plain graphical objects along a virtual center line. Figure \ref{fig:symPlan} shows that this mirroring is a mathematical one and not a physical one. For more examples look at \cite{pstoptic:2001}. The syntax is: + +\begin{BDef} +\Lcs{symPlan}\Largr{node1}\Largr{node2}\Largb{graphic object} +\end{BDef} + +The two nodes define the mirror axis and the graphics object is in most cases a user defined macro, f.ex: +This example needs the package \LPack{pst-text} for the \Lcs{pstextpath} macro. + +\begin{center} +\begin{LTXexample}[wide=false] +\newcommand{\dtk}{\pstextpath(0,0){% + \psplot[linestyle=none]{0}{8}{x sqrt sqrt 2 mul}}% + {\Large Die \TeX{}nische Kom\"odie von DANTE}} +\begin{pspicture}(-4.5,-2.5)(2.5,5) +\pnode(-4,-2){M1} \uput[-90](M1){M1} +\pnode(4,4){M2}\uput[90](M2){M2} +\psline[linewidth=5\pslinewidth,linecolor=lightgray](M1)(M2) +\rput(-3.5,-1.75){\dtk} +\symPlan(M1)(M2){\rput(-3.5,-1.75){\dtk}} +\end{pspicture} +\end{LTXexample} +\captionof{figure}{Demonstration of the \nxLcs{symPlan}-Macro} \label{fig:symPlan} +\end{center} + +\clearpage + +\subsection{Beam Light} + +This macro is useful for the demonstration of high and low beam light. The syntax for this macro is: + +\begin{BDef} +\Lcs{beamLight}\OptArgs +\end{BDef} + +The predefined options especially for the \Lenv{pspicture}-coordinates are +\begin{lstlisting}[style=syntax] +\psset[pst-optic]{xLeft=-5,xRight=5,yBottom=-5,yTop=5,drawing=false}% the default +\end{lstlisting} + +You can place this macro with the \Lcs{rput}-command at any place in your own \Lenv{pspicture}-environment. + +\begin{minipage}[b]{0.35\textwidth} +\begin{LTXexample} +\begin{pspicture}(-1,-3)(3,3) + \rput(0,0){\beamLight} +\end{pspicture} +\end{LTXexample} +\captionof{figure}{\nxLcs{beamLight} without any Options} +\end{minipage}\hfill% +\begin{minipage}[b]{0.5\textwidth} +\centering +\begin{LTXexample} +\begin{pspicture}(-1,-5.5)(5,5.5) +\rput(0,0){\beamLight[mirrorDepth=4.75, + mirrorWidth=0.1,mirrorHeight=10, + linecolor=lightgray]} +\end{pspicture} +\end{LTXexample} +\captionof{figure}{\nxLcs{beamLight} with Options} +\end{minipage} + + +\clearpage + +\section{Refraction} + +\section{\nxLcs{refractionRay}} +The syntax is + +\begin{BDef} +\Lcs{refractionRay}\Largr{A}\Largr{B}\Largr{C}\Largr{D}\Largb{n1}\Largb{n2}\Largb{EndNode} +\end{BDef} + + +The macro uses the law of Snell + +\begin{align} +\frac{n_1}{n_2}&=\frac{\sin \beta}{\sin \alpha}\label{snell} +\end{align} + +where the $n_1$ and $n_2$ are the refraction numbers with the predefined values + +\begin{align} + n_1 &= 1 \\ + n_2 &= 1.41 +\end{align} + +and $\alpha$ the incoming abd $\beta$ the outgoing angle of the ray. + +The refractionnumbers have the internal names \Lnotation{refractA} and \Lnotation{refractB}. + +A total reflection instead of a refraction is possible, +when the ray starts in a medium with a higher refrectionnumber. This happens when +$\sin\beta>1$ in Equ.~\ref{snell}. In this case we have $\alpha =\beta$, a +total reflection. + + +\begin{LTXexample}[width=5cm,pos=l,wide=false] +\begin{pspicture}[showgrid=true](5,5) +\pnode(0.5,1.5){A}\qdisk(A){2pt}\uput[90](A){A} +\pnode(2,3){B}\qdisk(B){2pt}\uput[90](B){B} +\psline[linewidth=1.5pt,linecolor=red]{->}(A)(B) +\pnode(3,5){C}\qdisk(C){2pt}\uput[225](C){C} +\pnode(4,0){D}\qdisk(D){2pt}\uput[135](D){D} +\pspolygon[fillstyle=solid,fillcolor=lightgray, + linecolor=lightgray](C)(D)(5,0)(5,5)(C) +\psline[linewidth=1.5pt,linecolor=red](C)(D) +\rput(2,2){\Large$n_1$} \rput(4.5,2){\Large$n_2$} +\refractionRay(A)(B)(C)(D){1}{4}{E} +\psline[linestyle=dashed,linecolor=red](B)(E) +\psline[linestyle=dashed,linecolor=red](E)(E') +\qdisk(E){2pt}\uput[-20](E){E} +\qdisk(E'){2pt}\uput[-90](E'){E'} +\end{pspicture} +\end{LTXexample} + +The macro needs the values for the four nodes, the two refractionnumbers and the name for +the end node. As you can see in the figure the end node of the ray is the intermediate +point between the linear ray and the linear medium. The end node of the refracted ray has +the same name with an additional single quotation mark. In the figure the macro was called as + +\begin{BDef} +\Lcs{refractionRay}\Largr{A}\Largr{B}\Largr{C}\Largr{D}\Largb{1}\Largb{4}\Largb{E} +\end{BDef} + +\begin{align}n_1&<n_2\end{align} + + +It is no problem to draw a ray which is going straight through another medium. +It can be done by using the macro twice as shown in the following examples. + + +\subsection{Total Reflection} + + +\begin{LTXexample}[width=5cm,pos=l,wide=false] +\begin{pspicture}[showgrid=true](5,5) +\pnode(0.5,1.5){A}\pnode(2,3){B} +\pnode(3,5){C} \pnode(4,0){D} +\pspolygon[fillstyle=solid,fillcolor=lightgray, + linecolor=lightgray](C)(D)(0,0)(0,5)(C) +\qdisk(A){2pt}\uput[90](A){A} +\qdisk(B){2pt}\uput[90](B){B} +\qdisk(C){2pt}\uput[225](C){C} +\qdisk(D){2pt}\uput[135](D){D} +\psline[linewidth=1.5pt,linecolor=red]{->}(A)(B) +\psline[linewidth=1.5pt,linecolor=red](C)(D) +\rput(2,2){\Large$n_1$}\rput(4.5,2){\Large$n_2$} +\refractionRay(A)(B)(C)(D){4}{1}{E} +\psline[linestyle=dashed,linecolor=red](B)(E) +\psline[linestyle=dashed,linecolor=red](E)(E') +\qdisk(E){2pt}\uput[-20](E){E} +\qdisk(E'){2pt}\uput[-90](E'){E'} +\end{pspicture} +\end{LTXexample} + + +In the figure the macro was called as + +\begin{lstlisting}[style=syntax] +\refractionRay(A)(B)(C)(D){4}{1}{E} +\end{lstlisting} + +\begin{align}n_1&>n_2\end{align} + + + +\section{Prism} +This command allows to simulate the deviation of a mono-chromatic +light ray with a prism. There are only few parameters. The indicated +values are the default ones. + +\smallskip\noindent +\begin{tabularx}{\linewidth}{@{} l X l @{}} +\emph{name} & \emph{meaning} & \emph{default} \\\hline +\Lkeyword{AnglePrism} & The angle to the top of prism. & 60\\ +\Lkeyword{AnglePlan1} & The angle between the plane (1), where the tranmitter takes + place, and the vertical. Negative values are allowed. & 25 \\ +\Lkeyword{AnglePlan2} & The angle between the plane (2) (the screen), and the vertical. + Negative values are allowed. & 55\\ +\Lkeyword{k} & Position of transmitter relative to choosen origin $C_1$ on the + plane : $\overrightarrow{C_1E_1} = k\overrightarrow{u_1}$. & 1 \\ +\Lkeyword{lambda} & The wavelength , in nm. & 632.8 \\ +\Lkeyword{notations} & The plane where transmitting source takes place, with all + indications, origin, angle, etc., as well as the screen are + displayed by default. This can be useful in order to finalize a + figure, but it is possible to deactivate this feature with the + option. & \false\\\hline +\end{tabularx} + +\bigskip +With \Lkeyword{AnglePlan1} the incident ray direction can be changed. The incidence spot changes according to \Lkeyword{k}. + +The outline of processing we have adopted is the Gernot Hoffmann +one. For more details look into the document: +\url{http://www.fho-emden.de/~hoffmann/prism16072005.pdf} + +\subsection{Figure with default values and construction indications} + + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-8,0)(8,8) +\psprism +\end{pspicture*} +\end{LTXexample} + + +\subsection{Figure with default values, without construction indications} + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-8,0)(8,6) +\psprism[notations=false] +\end{pspicture*} +\end{LTXexample} + +\subsection{Color matches wavelength} + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-8,0)(8,8) +\psprism[lambda=530]% +\end{pspicture*} +\end{LTXexample} + + + +Note: we have not planned physical impossibilities. When $r_2$ is greater +than the limit angle, there is no transmission in air, and it's +impossible to calculate $i_2$. Then, we have a PostScript message: + + + + +\begin{lstlisting} +Displaying page 1 +Displaying page 2 +Displaying page 3 +Displaying page 4 +Error: /rangecheck in --sqrt-- +Operand stack: + alpha2 -1.02701 -0.0547467 +\end{lstlisting} +We remind you that \Lkeyword{alpha2} is $i_2$. + +For instance, \Lkeyword{AnglePrism}=65, other default parameters remains unchanged. + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-7,-0.2)(7,8) +\psprism[AnglePrism=65] +\end{pspicture*} +\end{LTXexample} + +It will become right when we change the incident ray slope: + +\begin{LTXexample}[wide=false] +\begin{pspicture*}(-8,-0.2)(8,8) +\psprism[AnglePrism=65,AnglePlan1=51,k=-1.5] +\end{pspicture*} +\end{LTXexample} + +We choose \Lkeyword{k}=-1.5 in order to have a incident ray +which strikes (?) the input side roudly in its center. But, in these +particular cases, the physicist know-how is important (\emph{bis repetita}). Isn't it? + + + +\section{Spherical Optic} + + +\subsection{\nxLcs{lensSPH}} +The syntax is + +\begin{BDef} +\Lcs{lensSPH}\OptArgs +\end{BDef} + + +It changes some default values for the options to: + + +\begin{center} +\begin{tabular}{@{} lll @{}} +\textbf{meaning} & \textbf{name} & \textbf{default}\\\hline +Object Distance in cm & \Lkeyword{OA} & -7 \\ +Lens Height in cm & \Lkeyword{lensHeight} & 6 \\ +Lens Width in cm & \Lkeyword{lensWidth} & 1.5\\ +Refraction Number $n_2$ & \Lkeyword{refractB} & 2 +\end{tabular} +\end{center} + + + +\subsubsection{Convergent Lens} +Without any option it draws a spherical convergent lens. \Lcs{lensSPH} is equivilant to +\Lcs{lensSPH}\Largs{\Lkeyset{lensType=CVG}}. + +\begin{LTXexample}[wide=false] +\lensSPH +\end{LTXexample} + +\subsubsection{Divergent Lens} + +The syntax is + +\begin{BDef} +\Lcs{lensSPH}\OptArg{\Lkeyset{lensType=DVG},\ldots} +\end{BDef} + +It draws a spherical divergent lens: + +\begin{LTXexample}[wide=false] +\lensSPH[lensType=DVG,lensWidth=0.5] +\end{LTXexample} + +It changes some default values for the options in the same way as for the convergent lens. + + +\subsection{Options} + +The macro uses the law of Snell + +\begin{align} +\frac{n_1}{n_2}&=\frac{\sin \beta}{\sin \alpha} +\end{align} + +where the $n_1$ and $n_2$ are the refraction numbers with the predefined values + +\begin{align} + n_1 &= 1 \\ + n_2 &= 1.41 +\end{align} + +and $\alpha$ the incoming abd $\beta$ the outgoing angle of the ray. + +The refractionnumbers have the internal names \Lnotation{refractA} and \Lnotation{refractB}. + +\clearpage + +\section{\nxLcs{mirrorCVG}} + +The syntax is + +\begin{BDef} +\Lcs{mirrorCVG}\OptArg{\Lkeyset{mirrorType=SPH}} +\end{BDef} + + + +\resetOpticOptions +\begin{LTXexample}[wide=false] +\mirrorCVG[mirrorType=SPH] +\end{LTXexample} + +Without the option \Lkeyset{mirrorType=SPH} you'll get a parabolic mirror, which is the default. + +\section{\nxLcs{mirrorDVG}} + +The syntax is + +\begin{BDef} +\Lcs{mirrorDVG}\OptArg{\Lkeyset{mirrorType=SPH}} +\end{BDef} + + +\begin{LTXexample}[wide=false] +\mirrorDVG[mirrorType=SPH] +\end{LTXexample} + +Without the option \Lkeyset{mirrorType=SPH} you'll get a parabolic mirror (option PARA). + +\section{\nxLcs{ABinterSPHLens}} + +The syntax is + + + +\begin{LTXexample}[wide=false] +\begin{pspicture}[showgrid=true](-6,-3)(6,3) +\rput(0,0){\lensSPH[lensType=CVG,lensHeight=8,lensWidth=3,drawing=false]} +\qdisk(Center){2pt}\uput[-90](Center){Center} +\qdisk(Center'){2pt}\uput[-90](Center'){Center'} +\pnode(-5,1){A}\qdisk(A){2pt}\uput[90](A){A} +\pnode(-3,0){B}\qdisk(B){2pt}\uput[90](B){B} +\psline[linewidth=1.5pt,linecolor=red]{->}(A)(B) +\pnode(5,-2.5){C}\qdisk(C){2pt}\uput[90](C){C} +\pnode(3,-2){D}\qdisk(D){2pt}\uput[90](D){D} +\psline[linewidth=1.5pt,linecolor=red]{->}(C)(D) +\rput(-4.5,2){\Large $n_1$}\rput(0,2){\Large $n_2$}\rput(4.5,2){\Large $n_1$} +\ABinterSPHLens(A)(B)(Center'){E}\ABinterSPHLens(C)(D)(Center){F} +\psline[linestyle=dashed,linecolor=red](B)(E) +\psline[linestyle=dashed,linecolor=red](D)(F) +\qdisk(E){2pt}\uput[-20](E){E}\qdisk(F){2pt}\uput[-90](F){F} +\end{pspicture} +\end{LTXexample} +The macro needs two nodes for the rays, the coordinates/nodes of the center/middle of the +sperical lens and a name of the intermediate node.In the figure the macro was called as + + +\begin{lstlisting}[style=syntax] +\ABinterSPHLens(A)(B)(Center'){E} +\ABinterSPHLens(C)(D)(Center){F} +\end{lstlisting} + + + +\section{\nxLcs{lensSPHRay}} + +The syntax is + +\begin{BDef} +\Lcs{lensSPHRay}\OptArgs\Largr{A}\Largr{B}\Largb{refractA}\Largb{refractB}\Largb{NodeName} +\end{BDef} + +This macro calculates the coordinates of the given ray $\overline{\mathrm{AB}}$ on its way +into the lens. The only possible option \Lkeyword{rightRay}=\false|\true\footnote{Default is \texttt{false}} +enables rays from the right to the left. There are still some problems with this option but try it out. + +\begin{LTXexample} +\begin{pspicture*}[showgrid=true](-5,-3)(7,3) +\rput(0,0){\lensSPH[lensType=CVG,lensHeight=8,lensWidth=3,drawing=false]} +\qdisk(Center){2pt}\uput[-90](Center){Center} +\qdisk(Center'){2pt}\uput[-90](Center'){Center'} +\pnode(-4,1){A}\qdisk(A){2pt}\uput[90](A){A} +\pnode(-2,0.5){B}\qdisk(B){2pt}\uput[90](B){B} +\rput(-4.5,2.5){\Large $n_1$}\rput(0,2.5){\Large $n_2=1.5$}\rput(4,2.5){\Large $n_1=1$} +\multido{\rA=3+-0.5,\rB=2.5+-0.5}{9}{% + \lensSPHRay[rightRay=false](-4,\rA)(-2,\rB){1}{1.5}{F} + \psline[linewidth=1.5pt,linecolor=red]{->}(-4,\rA)(F) + \psline[linestyle=dashed,linecolor=red](-4,\rA)(F)(F')(F'') + \psOutLine[linestyle=dashed,linecolor=red,length=4.5](F')(F''){FEnd}} +\psline[linewidth=1.5pt,linecolor=blue]{->}(A)(B) +\lensSPHRay[lensType=CVG](A)(B){1}{1.5}{E} +\psline[linestyle=dashed,linecolor=blue](B)(E)(E')(E'') +\qdisk(E){2pt}\uput[-20](E){E}\qdisk(E'){2pt}\uput[-20](E'){E'} +\qdisk(E''){2pt}\uput[-20](E''){E''} +\end{pspicture*} +\end{LTXexample} + +And the same with $n_2=3$: +\begin{LTXexample} +\begin{pspicture*}[showgrid=true](-5,-3)(7,3) +\rput(0,0){\lensSPH[lensType=CVG,lensHeight=8,lensWidth=3,drawing=false]} +\qdisk(Center){2pt}\uput[-90](Center){Center} +\qdisk(Center'){2pt}\uput[-90](Center'){Center'} +\pnode(-4,1){A}\qdisk(A){2pt}\uput[90](A){A} +\pnode(-2,0.5){B}\qdisk(B){2pt}\uput[90](B){B} +\rput(-4.5,2.5){\Large $n_1$}\rput(0,2.5){\Large $n_2=3$}\rput(4,2.5){\Large $n_1=1$} +\multido{\rA=3+-0.5,\rB=2.5+-0.5}{11}{% + \lensSPHRay[rightRay=false](-4,\rA)(-2,\rB){1}{3}{F} + \psline[linewidth=1.5pt,linecolor=red]{->}(-4,\rA)(F) + \psline[linestyle=dashed,linecolor=red](-4,\rA)(F)(F')(F'') + \psOutLine[linestyle=dashed,linecolor=red](F')(F''){FEnd}} +\psline[linewidth=1.5pt,linecolor=blue]{->}(A)(B) +\lensSPHRay[lensType=CVG](A)(B){1}{3}{E} +\psline[linestyle=dashed,linecolor=blue](B)(E)(E')(E'') +\qdisk(E){2pt}\uput[-20](E){E}\qdisk(E'){2pt}\uput[-20](E'){E'} +\qdisk(E''){2pt}\uput[-20](E''){E''} +\end{pspicture*} +\end{LTXexample} + + +\clearpage + +\section{\nxLcs{reflectionRay}} + +The syntax is + +\begin{BDef} +\Lcs{reflectionRay}\OptArgs\Largr{A}\Largr{B}\Largb{NodeName} +\end{BDef} + +This macro calculates the coordinates of the given ray $\overline{\mathrm{AB}}$ +on its way out of the mirror. The only senseful option is \Lkeyset{mirrorType=CVG} or \Lkeyset{mirrorType=DVG}. +The most important fact is that the point \verb|B| must be the one on the mirror. +If you do not know it's coordinates you can use the macro +\verb|ABinterSPHLens[lensType=CVG](A1)(A2)(Center){NodeName)|, which calculates the coordinates of the intermediate point. + + + +\begin{LTXexample} +\begin{pspicture*}[showgrid=true](-1,-3)(6,3) +\rput(0,0){% + \mirrorCVG[mirrorType=SPH,mirrorHeight=5,mirrorWidth=0.2,yBottom=-3,yTop=3,drawing=false,mirrorDepth=3] + \qdisk(Center){2pt}\qdisk(Focus){2pt}\uput[-90](Center){Center}\uput[-90](Focus){F} + \psline(O)(xRight)} +\ABinterSPHLens(5,1)(3,1)(Center){C} +\reflectionRay[mirrorType=CVG-SPH](5,1)(C){D} +\qdisk(5,1){2pt}\uput[-90](5,1){A}\qdisk(3,1){2pt}\uput[-90](3,1){B} +\qdisk(C){2pt}\uput[180](C){C}\qdisk(D){2pt}\uput[45](D){D} +\psset{linewidth=1.5pt,linecolor=red,arrows=->} +\psline(5,1)(3,1)\psline(3,1)(C)\psline(C)(D) +\end{pspicture*} +\end{LTXexample} + + + +\clearpage +\subsection{Refraction at a Spherical surface} + +Construction for finding the position of the image point P' of a point object P formed by refraction at a sperical surface. + + +\begin{LTXexample} +\begin{pspicture*}[showgrid=true](-10,-4)(3,4) +\rput(0,0){% + \lensSPH[lensType=CVG,lensHeight=12,lensWidth=10,yBottom=-6,yTop=6,xLeft=-6,xRight=6,drawing=false]} +\psset{linecolor=red,linewidth=1.5pt,dotstyle=|} +\pnode(-9,0){P}\psdots(P)\uput[-90](P){P}\psline(P)(xRight) +\lensSPHRay(P)(-5,2){1}{9}{Q} \psline(P)(Q)(Q') \psdots(Q)\uput[90](Q){B} +\ABinterCD(Q)(Q')(0,0)(5,0){P'}\psdots(Q')\uput[-90](P'){P'} +\psline[linewidth=0.5pt,linecolor=black](Center')(Q)\psline[linewidth=0.5pt,linecolor=black](Q)(Q|0,0) +\psdots(Center')\uput[-90](Center'){C} +\end{pspicture*} +\end{LTXexample} + + +\clearpage +Construction for determining the height of an image formed by refraction at a sperical surface. + +\begin{LTXexample} +\begin{pspicture*}[showgrid=true](-13,-3)(3,5) +\rput(0,0){% + \lensSPH[lensType=CVG,lensHeight=12,lensWidth=10,yBottom=-4,yTop=4,xLeft=-5,xRight=5,drawing=false]} +\psset{linecolor=red,linewidth=1.5pt,dotstyle=|} +\pnode(-12,0){P}\psdots(P)\uput[-90](P){P}\pnode(-12,4){Q}\psdots(Q)\uput[90](Q){Q} +\psline[linecolor=blue,linewidth=3pt,arrows=->](P)(Q)\psline(P)(xRight) +\lensSPHRay(Q)(Center'){1}{9}{S1}\lensSPHRay(Q)(-5,0){1}{9}{S2}% +\psline(Q)(S1')\psline(Q)(S2)(S2')\ABinterCD(Q)(S1')(S2)(S2'){Q'}\pnode(Q'|0,0){P'} +\psline[linecolor=blue,linewidth=3pt,arrows=->](P')(Q') +\uput[90](P'){P'}\uput[-90](Q'){Q'}\psdots(Center')\uput[90](Center'){C} +\end{pspicture*} +\end{LTXexample} + + +\section{Utility Macros} + +\subsection{\nxLcs{eye}} + +Syntax: + +\begin{BDef} +\Lcs{eye} +\end{BDef} +There are no Options for this symbol of an human eye (Figure~\ref{fig:auge}). +Use the \Lcs{rput}-macro to put the eye elsewhere. + +\begin{LTXexample}[width=2cm,pos=l,wide=false] +\begin{pspicture}(-1,-0.75)(1,0.75) + \rput(1,0){\eye} +\end{pspicture} +\end{LTXexample} + +\section{\nxLcs{Arrows}} + +Syntax wirh the following options: + +\begin{BDef} +\Lcs{Arrows}\OptArgs\Largr{NodeA}\Largr{NodeB} +\end{BDef} + +\begin{center} +\begin{tabular}{@{} l l l @{}} +\emph{Option} & \emph{Name} & \emph{Standard}\\\hline +Offset for arrow start in cm & \Lkeyword{posStart} & 0\\ +Length of the arrow in cm & \Lkeyword{length} & 2\\\hline +\end{tabular} +\end{center} + + + + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-3,-3)(3,3) +\psset{linecolor=red} +\Arrows[posStart=2,length=4](-3,-3)(3,3) +\qdisk(-3,-3){2pt}\uput[45](-3,-3){A} +\qdisk(3,3){2pt}\uput[-90](3,3){B} +\psset{linecolor=green} +\Arrows[linewidth=3pt,length=2](0,-3)(0,0.5) +\qdisk(0,-3){2pt}\uput[45](0,-3){A} +\qdisk(0,0.5){2pt}\uput[-90](0,0.5){B} +\psset{linecolor=blue} +\Arrows[linewidth=5pt,linestyle=dashed](3,0)(2,3) +\qdisk(3,0){2pt}\uput[-90](3,0){A} +\qdisk(2,3){2pt}\uput[-90](2,3){B} +\psset{linecolor=black} +\Arrows[posStart=1,linewidth=5pt,linestyle=dotted, + length=3](-3,2)(1,2) +\qdisk(-3,2){2pt}\uput[-45](-3,2){A} +\qdisk(1,2){2pt}\uput[-90](1,2){B} +\end{pspicture} +\end{LTXexample} + + + +\section{\nxLcs{psOutLine} and \nxLcs{psBeforeLine}} + +Syntax: + +\begin{BDef} +\Lcs{psOutLine}\OptArgs\Largr{NodeA}\Largr{NodeB}\Largb{EndNode}\\ +\Lcs{psBeforeLine}\OptArgs\Largr{NodeA}\Largr{NodeB}\Largb{StartNode} +\end{BDef} + +The only special option is \Lkeyword{length}=\Larga{value}. All other which are possible for +\Lcs{psline} can be used, too. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-3,-3)(3,3) +\psset{linecolor=red, linewidth=1.5pt} +\psOutLine[length=3](-2,-2)(0,0){End} +\qdisk(-2,-2){2pt}\uput[80](-2,-2){A} +\qdisk(0,0){2pt}\uput[-45](0,0){B} +\qdisk(2.12,2.12){2pt}\uput[90](2.12,2.12){END} +% +\psset{linecolor=blue} +\psBeforeLine[length=3](1,0)(3,2){START} +\qdisk(3,2){2pt}\uput[80](3,2){B} +\qdisk(1,0){2pt}\uput[-45](1,0){A} +\qdisk(-1.12,-2.12){2pt}\uput[-90](-1.12,-2.12){START} +\end{pspicture} +\end{LTXexample} + +\section{\nxLcs{Parallel}} + +Syntax: + +\begin{BDef} +\Lcs{Parallel}\OptArgs\Largr{NodeA}\Largr{NodeB}\Largr{StartNode}\Largb{End node} +\end{BDef} + +The only special option for \Lcs{Parallel} is \Lkeyword{length}=\Larga{value}. +The nodes \verb|nodeA| and \verb|nodeB| are known nodes of a given line +and \verb|Start node| is the given node of a parallel line. \verb|End node| is +the name of the calculated line end. + +\begin{LTXexample} +\begin{pspicture*}[showgrid=true](-5,-3.5)(5,3.5) +\pnode(2,-2){FF}\qdisk(FF){1.5pt} \pnode(-5,5){A} \pnode(0,0){O} +\multido{\nCountA=-2.4+0.4}{9}{% + \Parallel[linecolor=red,length=9](O)(A)(0,\nCountA){P1} + \psline[linecolor=red](0,\nCountA)(FF) + \psOutLine[linecolor=red,length=9](0,\nCountA)(FF){P2}} +\psline[linecolor=blue](A)(FF) +\psOutLine[linecolor=blue,length=5](A)(FF){END1} +\rput(0,0){\lens[yBottom=-3.5,yTop=3.5,lensGlass,lensHeight=6.5,drawing=false, + spotFi=315,lensWidth=0.5] + \psline[linewidth=1pt](xLeft)(xRight) + \psline[length=2,linewidth=2pt,arrows=->](F')(FF)} +\end{pspicture*} +\end{LTXexample} + + +\section{\nxLcs{ABinterCD} and \Lcs{nodeBetween}} + +This macro is used by the \Lcs{telescop} macro. It determines the intersection +point of two lines, in this case a ray and the mirror axis. +The following figure shows a part of figure~\ref{fig:defaultTele}. Given are +the points A, B (focus), C/D (mirror axis). We need the point E to draw the other +rays for the ocular, which can be done with the \Lcs{ABinterCD} macro. The syntax is: + + +\begin{BDef} +\Lcs{ABinterCD}\Largr{A}\Largr{B}\Largr{C}\Largr{D}\Largb{E}\\ +\Lcs{nodeBetween}\Largr{A}\Largr{B}\Largb{C} +\end{BDef} + +\begin{LTXexample} +\begin{pspicture*}(-0.5,-2.25)(9,2.25) +\rput(0,0){\mirrorCVG[mirrorHeight=4,mirrorWidth=0.25,mirrorDepth=0.25,drawing=false]} +\mirrorCVGRay[mirrorHeight=4,mirrorWidth=0.25,mirrorDepth=0.25,drawing=false](8,1.25)(2,1.25){A} +\psline[linewidth=0.5\pslinewidth](9,0) +\rput{-45}(6,0){\mirrorTwo} +\qdisk(A){2pt}\uput[30](A){A}\pnode(8,0){B}\qdisk(B){2pt}\uput[-45](B){B} +\pnode(! 6 1 45 cos mul sub 1 45 sin mul){C} +\qdisk(C){2pt}\uput[90](C){C}\pnode(! 6 1 45 cos mul add 1 45 sin mul neg){D} +\uput[-45](D){D}\qdisk(D){2pt}\psline[linestyle=dashed](A)(B) +\ABinterCD(A)(B)(C)(D){Inter1}\qdisk(A){2pt} +\nodeBetween(A)(B){M}\qdisk(M){2pt} +{\psset{linecolor=red} +\qdisk(Inter1){2pt}\uput[220](Inter1){E}\uput[220](M){M}} +\end{pspicture*} +\end{LTXexample} + +\section{\nxLcs{rotateNode}} +The syntax is + +\begin{BDef} +\Lcs{rotateNode}\Largb{NodeName}\Largb{Degrees} +\end{BDef} + +The coordinates of the node \verb|A| are changed to the new ones. Negative values are possible for rotating clockwise. + +\begin{LTXexample}[width=4cm,pos=l] +\begin{pspicture}[showgrid=true](4,4) +\pnode(3,1){A}\qdisk(A){2pt}\uput[20](A){A} +\rotateNode(A){45} +\qdisk(A){2pt}\uput[20](A){A} +\psarc[linecolor=red, + linewidth=0.5pt]{->}(0,0){3.16}{19.47}{64.47} +\end{pspicture} +\end{LTXexample} + + +\section{\nxLcs{rotateTriangle}} +The syntax is + +\begin{BDef} +\Lcs{rotateNode}\Largb{NodeNameA}\Largb{NodeNameB}\Largb{NodeNameC}\Largb{Degrees} +\end{BDef} + +The coordinates of the nodes \verb|A,B,C| are changed to the new ones. Negative values are possible for rotating clockwise. + +\begin{LTXexample}[width=5cm,pos=l] +\begin{pspicture}[showgrid=true](-1,0)(4,4) +\pnode(1,1){A}\pnode(3,1){B}\pnode(2,3){C} +\qdisk(A){2pt}\uput[180](A){A}\qdisk(B){2pt}\uput[0](B){B} +\qdisk(C){2pt}\uput[90](C){C} +\psline(A)(B)(C)(A) \rotateTriangle(A)(B)(C){45} +\qdisk(A){2pt}\uput[180](A){A}\qdisk(B){2pt}\uput[0](B){B} +\qdisk(C){2pt}\uput[90](C){C}\psline[linecolor=red](A)(B)(C)(A) +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){3.16}{19.47}{64.47} +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){1.41}{45}{90} +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){3.61}{56.31}{101.31} +\end{pspicture} +\end{LTXexample} + + + +\section{\nxLcs{rotateFrame}} +The syntax is + +\begin{BDef} +\Lcs{rotateFrame}\Largb{NodeNameA}\Largb{NodeNameB}\Largb{NodeNameC}\Largb{NodeNameD}\Largb{Degrees} +\end{BDef} + +The coordinates of the nodes \verb|A,B,C,D| are changed to the new ones. Negative values are possible for rotating clockwise. + +\begin{LTXexample}[width=6cm,pos=l] +\begin{pspicture}[showgrid=true](-2,0)(4,5) +\pnode(1,1){A}\pnode(3,1){B}\pnode(3,3){C}\pnode(1,3){D} +\qdisk(A){2pt}\uput[180](A){A}\qdisk(B){2pt}\uput[0](B){B} +\qdisk(C){2pt}\uput[90](C){C} \qdisk(D){2pt}\uput[180](D){D} +\psline(A)(B)(C)(D)(A) +\rotateFrame(A)(B)(C)(D){45} +\qdisk(A){2pt}\uput[180](A){A}\qdisk(B){2pt}\uput[0](B){B} +\qdisk(C){2pt}\uput[90](C){C} \qdisk(D){2pt}\uput[180](D){D} +\psline[linecolor=red](A)(B)(C)(D)(A) +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){3.16}{19.47}{64.47} +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){1.41}{45}{90} +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){4.24}{45}{90} +\psarc[linecolor=red,linewidth=0.5pt]{->}(0,0){3.16}{71.57}{116.57} +\end{pspicture} +\end{LTXexample} + + +\section{\nxLcs{arrowLine}} +The syntax is + +\begin{BDef} +\Lcs{arrowLine}\OptArgs\Largr{Start}\Largr{End}\Largb{ArrowNumber} +\end{BDef} + +Draws a line from \verb|Start| to \verb|End| with \verb|ArrowNumber| arrows inside. + +\begin{LTXexample}[width=4cm,pos=l] +\begin{pspicture}[showgrid=true](4,4) +\arrowLine[linecolor=red](0,0)(4,3){3} +\arrowLine[linecolor=green,arrowsize=6pt,arrows=-|](0,0)(3,1){2} +\arrowLine[linecolor=blue,arrowOffset=0.75,arrowsize=6pt](4,0)(0,3){3} +\end{pspicture} +\end{LTXexample} + + +\subsection{Options} + +A special option is \Lkeyword{arrowOffset}, which makes it possible to draw lines with +different arrows. By default the arrows are placed symetrically. This can be moved by +\Lkeyword{arrowOffset}. Additionally all other valid options for pslines are possible her, too. + +\begin{LTXexample}[width=4cm,pos=l] +\begin{pspicture}[showgrid=true](4,2) +\arrowLine[arrowsize=6pt,linecolor=red](0,0.5)(4,0.5){3} +\arrowLine[arrowsize=6pt,linecolor=red, + arrows=<-](0,1)(4,1){3} +\arrowLine[arrowsize=6pt,linecolor=red](0,1.5)(4,1.5){3} +\arrowLine[arrowsize=6pt,linecolor=blue,arrows=<-, + arrowOffset=0.2](0,1.5)(4,1.5){3} +\end{pspicture} +\end{LTXexample} + + + +\clearpage +\section{List of all optional arguments for \texttt{pst-optic}} + +\xkvview{family=pst-optic,columns={key,type,default}} + + + + +\bgroup +\raggedright +\nocite{*} +\printbibliography +\egroup + +\printindex + + +\end{document} diff --git a/graphics/pstricks/contrib/pst-optic/latex/pst-optic.sty b/graphics/pstricks/contrib/pst-optic/latex/pst-optic.sty new file mode 100644 index 0000000000..5cab95a102 --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/latex/pst-optic.sty @@ -0,0 +1,7 @@ +\RequirePackage{pstricks} +\ProvidesPackage{pst-optic}[2004/10/18 package wrapper for + pst-optic.tex (hv)] +\input{pst-optic.tex} +\ProvidesFile{pst-optic.tex} + [\filedate\space v\fileversion\space `PST-optic' (ML,hv)] +\endinput diff --git a/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex b/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex new file mode 100644 index 0000000000..c9906a52b4 --- /dev/null +++ b/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex @@ -0,0 +1,2022 @@ +%% +%% This is file `pst-optic.tex', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-optic.tex' +%% +%% Manuel Luque <Mluque5130@aol.com> (France) +%% Herbert Voss <voss@perce.de> (Germany) +%% +%% 2010-07-23 +%% +%% 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. +%% +%% DESCRIPTION: +%% `pst-optic' is a PSTricks package to define lenses and mirrors +%% +\csname PSTopticLoaded\endcsname +\let\PSTopticLoaded\endinput +% 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{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 +\pst@addfams{pst-optic} +\SpecialCoor +% +%%%%%%%%%%%%%%%%%% Macrolist %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% \def\Arrows[#1](#2)(#3) +%% \def\psOutLine[#1](#2)(#3)#4 +%% \def\psBeforeLine[#1](#2)(#3)#4 +%% \def\ABinterCD(#1)(#2)(#3)(#4)#5 +%% \def\Parallel[#1](#2)(#3)(#4)#5 +%% \def\arrowLine[#1](#2)(#3)#4 +%% \def\nodeBetween(#1)(#2)#3 +%% \def\rotateNode(#1)#2 +%% \def\rotateTriangle(#1)(#2)(#3)#4 +%% \def\rotateFrame(#1)(#2)(#3)(#4)#5 +%% \def\lensSPH[#1] +%% \def\lensSPHRay[#1](#2)(#3)#4#5#6 +%% \def\ABinterSPHLens(#1)(#2)(#3)#4 +%% \def\lens[#1] +%% \def\pslensDVG +%% \def\pslensDVG@i#1#2 +%% \def\pslensDVG@ii +%% \def\pslensCVG +%% \def\pslensCVG@ii +%% \def\lensCVG +%% \def\lensDVG +%% \def\Transform +%% \def\rayInterLens(#1)(#2)#3#4 +%% \def\mirrorCVGRay[#1](#2)(#3)#4 +%% \def\mirrorCVG[#1] +%% \def\mirrorDVG[#1] +%% \def\mirrorDVGRay[#1](#2)(#3)#4 +%% \def\beamLight[#1] +%% \def\mirrorTwo +%% \def\telescope[#1] +%% \def\planMirrorRay(#1)(#2)(#3)#4 +%% \def\symPlan(#1)(#2) +%% \def\refractionRay[#1](#2)(#3)(#4)(#5)#6#7#8 +%% \def\reflectionRay[#1](#2)(#3)#4 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ---------------- the if's ----------------- +% +\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,onlyrays=false} +% +% ------- the global definitions for the pspicture frame ------ +% +\define@key[psset]{pst-optic}{xLeft}[-7.5]{\def\psk@optic@xLeft{#1}} +\define@key[psset]{pst-optic}{xRight}[7.5]{\def\psk@optic@xRight{#1}} +\define@key[psset]{pst-optic}{yBottom}[-3.0]{\def\psk@optic@yBottom{#1}} +\define@key[psset]{pst-optic}{yTop}[3.0]{\def\psk@optic@yTop{#1}} +\psset[pst-optic]{xLeft=-7.5,xRight=7.5,yBottom=-3.0,yTop=3.0} +% +% ---------------- the lenses ----------------- +% +\define@key[psset]{pst-optic}{lensType}[CVG]{\def\psk@optic@lensType{#1}}% CVG|DVG|PCVG|PDVG +\define@key[psset]{pst-optic}{lensColor}[lightgray]{\def\psk@optic@lensColor{#1}} +\define@key[psset]{pst-optic}{lensWidth}[0.5]{\def\psk@optic@lensWidth{#1}}% the thichness of the lens +\define@key[psset]{pst-optic}{lensDepth}[1]{\def\psk@optic@lensDepth{#1}} +\define@key[psset]{pst-optic}{lensHeight}[5]{\def\psk@optic@lensHeight{#1}}% the TOTAL height of the lens +\define@key[psset]{pst-optic}{lensScale}[1]{\def\psk@optic@lensScale{#1}}% more or less obsolete +\define@key[psset]{pst-optic}{lensArrowSize}[0.2]{\def\psk@optic@lensArrowSize{#1}}% for the AB,... Arrows +\define@key[psset]{pst-optic}{lensArrowInset}[0.5]{\def\psk@optic@lensArrowInset{#1}} +\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} +% +% ---------------- the mirrors ----------------- +% +\define@key[psset]{pst-optic}{mirrorType}[CVG]{\def\psk@optic@mirrorType{#1}}% PLAN|PARAbolic|SPHerical +\define@key[psset]{pst-optic}{mirrorDepth}[1]{\def\psk@optic@mirrorDepth{#1}} +\define@key[psset]{pst-optic}{mirrorHeight}[5]{\def\psk@optic@mirrorHeight{#1}}% it's the TOTAL height +\define@key[psset]{pst-optic}{mirrorWidth}[0.25]{\def\psk@optic@mirrorWidth{#1}} +\define@key[psset]{pst-optic}{mirrorColor}[lightgray]{\def\psk@optic@mirrorColor{#1}} +\define@key[psset]{pst-optic}{mirrorFocus}[8]{\def\psk@optic@mirrorFocus{#1}} +\define@key[psset]{pst-optic}{posMirrorTwo}[6]{\def\psk@optic@posMirrorTwo{#1}}% a sencond mirror? (telescope) +\define@key[psset]{pst-optic}{mirrorTwoAngle}[45]{\def\psk@optic@mirrorTwoAngle{#1}}% the angle for the 2. plan mirror (telescope) +\def\mirrorType{CVG} +\psset[pst-optic]{mirrorType=CVG,mirrorDepth=1,mirrorHeight=5,mirrorWidth=0.25, + mirrorFocus=8,mirrorTwoAngle=45,posMirrorTwo=6,mirrorColor=lightgray} +% +% -------------- the refrectionnumbers ------------- +% +\define@key[psset]{pst-optic}{refractA}[1]{\def\psk@optic@refractA{#1}} +\define@key[psset]{pst-optic}{refractB}[1.41]{\def\psk@optic@refractB{#1}} +\psset[pst-optic]{refractA=1,refractB=1.41} +% +% -------------- the length and node definitions ------------- +% +\define@key[psset]{pst-optic}{XO}[0]{\def\psk@optic@XO{#1}}% the X-offset +\define@key[psset]{pst-optic}{YO}[0]{\def\psk@optic@YO{#1}}% the y-offset +\define@key[psset]{pst-optic}{posStart}[0]{\def\psk@optic@posStart{#1}}% where the arrows start +\define@key[psset]{pst-optic}{length}[2]{\def\psk@optic@length{#1}}% the length of the before|outlines +\define@key[psset]{pst-optic}{focus}[2]{\def\psk@optic@focus{#1}}% for lenses/mirrors with a fixed focus +\define@key[psset]{pst-optic}{AB}[1]{\def\psk@optic@AB{#1}}% the length of the object arrow +\define@key[psset]{pst-optic}{OA}[-3]{\def\psk@optic@OA{#1}}% the xcoordinate of the object arrow +\define@key[psset]{pst-optic}{arrowOffset}[0]{\def\psk@optic@arrowOffset{#1}}%offset for \arrowLine +% +\psset[pst-optic]{XO=0,YO=0,OA=-3,posStart=0,length=2,focus=2,AB=1,arrowOffset=0} +% +\define@key[psset]{pst-optic}{nameA}[A]{\def\psk@optic@nameA{#1}}% start of the object arrow +\define@key[psset]{pst-optic}{spotA}[270]{\def\psk@optic@spotA{#1}}% where to draw the label +\define@key[psset]{pst-optic}{nameB}[B]{\def\psk@optic@nameB{#1}} +\define@key[psset]{pst-optic}{spotB}[90]{\def\psk@optic@spotB{#1}} +\define@key[psset]{pst-optic}{nameF}[F]{\def\psk@optic@nameF{#1}} +\define@key[psset]{pst-optic}{spotF}[270]{\def\psk@optic@spotF{#1}} +\define@key[psset]{pst-optic}{nameO}[O]{\def\psk@optic@nameO{#1}} +\define@key[psset]{pst-optic}{spotO}[225]{\def\psk@optic@spotO{#1}} +\define@key[psset]{pst-optic}{nameAi}[A']{\def\psk@optic@nameAi{#1}} +\define@key[psset]{pst-optic}{spotAi}[90]{\def\psk@optic@spotAi{#1}} +\define@key[psset]{pst-optic}{nameBi}[B']{\def\psk@optic@nameBi{#1}} +\define@key[psset]{pst-optic}{spotBi}[270]{\def\psk@optic@spotBi{#1}} +\define@key[psset]{pst-optic}{nameFi}[F']{\def\psk@optic@nameFi{#1}} +\define@key[psset]{pst-optic}{spotFi}[270]{\def\psk@optic@spotFi{#1}} +% +\psset[pst-optic]{nameA=A,spotA=270,nameB=B,spotB=90,nameF=F,spotF=270, + nameO=O,spotO=225,nameAi=A',spotAi=90,nameBi=B',spotBi=270, + nameFi=F',spotFi=270} +% +% -------------------- colors/fillstyles ------------------- +% +\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} +\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 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% posStart=Starting point +% length= Arrow length. +\def\Arrows{\@ifnextchar[{\pst@Arrows}{\pst@Arrows[]}} +\def\pst@Arrows[#1](#2)(#3){{% + \psset{#1}% + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pnode(!% + /StartArrow \psk@optic@posStart\space def + /LengthArrow \psk@optic@length\space def + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + /denominateur XB XA sub def + /numerateur YB YA sub def + /angleDirectionAB numerateur denominateur Atan def + /XD StartArrow angleDirectionAB cos mul XA add def + /YD StartArrow angleDirectionAB sin mul YA add def + /XF XD LengthArrow angleDirectionAB cos mul add def + /YF YD LengthArrow angleDirectionAB sin mul add def + XD YD ){ArrowStart}% + \pnode(! XF YF){ArrowEnd}% + \psset{arrows=->}% + \psline[#1](ArrowStart)(ArrowEnd)% +}\ignorespaces} +% +% draw a line (===) outside: #2-----#3=======#4 +% +\def\psOutLine{\@ifnextchar[{\pst@ToDrawOut}{\pst@ToDrawOut[]}} +\def\pst@ToDrawOut[#1](#2)(#3)#4{{% + \psset{#1}% + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pnode(!% + /LengthArrow \psk@optic@length\space def + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + /denominateur XB XA sub def + /numerateur YB YA sub def + /angleDirectionAB numerateur denominateur Atan def + /Xend XB LengthArrow angleDirectionAB cos mul add def + /Yend YB LengthArrow angleDirectionAB sin mul add def + Xend Yend){#4} + \psline[#1](#3)(#4) +}} +% +% draw a line (===) before: #4========#2-----#3 +% +\def\psBeforeLine{\@ifnextchar[{\pst@BeforeLine}{\pst@BeforeLine[]}} +\def\pst@BeforeLine[#1](#2)(#3)#4{{% + \psset{#1}% + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pnode(!% + /LengthArrow \psk@optic@length\space def + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + /denominateur XB XA sub def + /numerateur YB YA sub def + /angleDirectionAB numerateur denominateur Atan def + /Xstart XA LengthArrow angleDirectionAB cos mul sub def + /Ystart YA LengthArrow angleDirectionAB sin mul sub def + Xstart Ystart){#4} + \psline[#1](#4)(#2)% +}\ignorespaces} +% +% intersection de deux droites +% 2 juillet 2001/ rewritten 2003-01-27 Herbert +% +\def\ABinterCD(#1)(#2)(#3)(#4)#5{% + \pst@getcoor{#1}\pst@tempA + \pst@getcoor{#2}\pst@tempB + \pst@getcoor{#3}\pst@tempc + \pst@getcoor{#4}\pst@tempd +\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 + /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 + /dY1 YB YA sub def + /dX1 XB XA sub def + /dY2 YD YC sub def + /dX2 XD XC sub def + dX1 abs 0.01 lt { + /m2 dY2 dX2 div def + XA dup XC sub m2 mul YC add + }{ + dX2 abs 0.01 lt { + /m1 dY1 dX1 div def + XC dup XA sub m1 mul YA add + }{% + /m1 dY1 dX1 div def + /m2 dY2 dX2 div def + m1 XA mul m2 XC mul sub YA sub YC add m1 m2 sub div dup + XA sub m1 mul YA add + } ifelse + } ifelse ){#5} +} +% +% draw a parallel line +% #2---------#3 +% #4----------#5(new) +\def\Parallel{\@ifnextchar[{\pst@Parallel}{\pst@Parallel[]}} +\def\pst@Parallel[#1](#2)(#3)(#4)#5{{% + \psset{#1}% + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pst@getcoor{#4}\pst@tempc + \pnode(!% + /LengthArrow \psk@optic@length\space def + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /YB exch \pst@number\psyunit div def + /XB exch \pst@number\psxunit div def + \pst@tempc /YC exch \pst@number\psyunit div def + /XC exch \pst@number\psxunit div def + /denominateur XB XA sub def + /numerateur YB YA sub def + /angleDirectionAB numerateur denominateur Atan def + /XstartParallel XC LengthArrow angleDirectionAB cos mul add def + /YstartParallel YC LengthArrow angleDirectionAB sin mul add def + XstartParallel YstartParallel){#5} + \psline[#1](#4)(#5) +}} +% +% arrowLine[options](A)(B){n} +% #2---->---->---->---->----#3 #4-arrows inside +\def\arrowLine{\@ifnextchar[{\pst@arrowLine}{\pst@arrowLine[]}} +\def\pst@arrowLine[#1](#2)(#3)#4{{% + \psset{arrowsize=4pt,arrows=->}% the defaults + \psset{#1}% + \def\pst@optic@n{#4} + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \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 + /dY YB YA sub \pst@optic@n\space 1 add div def + /dX XB XA sub \pst@optic@n\space 1 add div def + /Alpha dY dX atan def + /dYOffset \psk@optic@arrowOffset\space Alpha sin mul def + /dXOffset \psk@optic@arrowOffset\space Alpha cos mul def + XA YA ){tempArrowC} + \multido{\i=1+1}{#4}{% + \pnode(!% + XA dX \i\space mul add dXOffset add + YA dY \i\space mul add dYOffset add){tempArrowB} + \psline(tempArrowC)(tempArrowB) + \pnode(tempArrowB){tempArrowC} + } + \psline[arrows=-](tempArrowB)(#3) +}\ignorespaces} +% +% #1------#3------#2 +\def\nodeBetween(#1)(#2)#3{% Herbert 2003/01/05 + \pst@getcoor{#1}\pst@tempA + \pst@getcoor{#2}\pst@tempB + \pnode(!% + /XA \pst@tempA pop \pst@number\psxunit div def + /YA \pst@tempA exch pop \pst@number\psyunit div def + /XB \pst@tempB pop \pst@number\psxunit div def + /YB \pst@tempB exch pop \pst@number\psyunit div def + XB XA add 2 div YB YA add 2 div){#3} +} +% +% rotateNode(A) +% (A) the node +% #2 the angle +% Herbert Voss <voss@perce.de> 2003-01-26 +\def\rotateNode{\pst@rotateNode} +\def\pst@rotateNode(#1)#2{{% + \pst@getcoor{#1}\pst@tempA + \def\pst@optic@angle{#2} % the rotating angle + \pnode(!% + /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 + /AlphaOld YA XA atan def + /AlphaNew AlphaOld \pst@optic@angle\space add def + r AlphaNew cos mul r AlphaNew sin mul + } ifelse ){temp} + \pnode(temp){#1} +}\ignorespaces} +% +\def\rotateTriangle{\pst@rotateTriangle} +\def\pst@rotateTriangle(#1)(#2)(#3)#4{{% + \rotateNode(#1){#4} + \rotateNode(#2){#4} + \rotateNode(#3){#4} +}\ignorespaces} +% +\def\rotateFrame{\pst@rotateFrame} +\def\pst@rotateFrame(#1)(#2)(#3)(#4)#5{{% + \rotateNode(#1){#5} + \rotateNode(#2){#5} + \rotateNode(#3){#5} + \rotateNode(#4){#5} +}\ignorespaces} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% L E N S E S % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% A spherical lens is drawn only with a spherical bow +% +\def\lensSPH{\@ifnextchar[{\pst@lensSPH}{\pst@lensSPH[]}} +\def\pst@lensSPH[#1]{{% + \psset[pst-optic]{lensType=CVG,OA=-7,% + lensHeight=6,% + lensWidth=1.5,% + refractB=2} + \ifx\relax#1\relax \else\psset[pst-optic,pstricks]{#1}\fi + \begin{pspicture*}(\psk@optic@xLeft ,\psk@optic@yBottom ) + (\psk@optic@xRight ,\psk@optic@yTop) + \pnode(! \psk@optic@xLeft\space 0){xLeft} + \pnode(! \psk@optic@xRight\space 0){xRight} + \pstVerb{% + /Height \psk@optic@lensHeight\space 2.0 div def + /Depth \psk@optic@lensDepth\space def + /Width \psk@optic@lensWidth\space def + /Width2 Width 2.0 div def + } + \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 + /YM 0 def + XM YM){Center} + \else% DVG ? + \pnode(!% + /radius Depth dup mul Height dup mul add Depth div 2.0 div def + /XM Width2 radius add neg def + /YM 0 def + XM YM){Center} + \fi +% and vice versa + \pnode(! XM neg 0){Center'} + \pnode(!% + /AB \psk@optic@AB\space def + /OA \psk@optic@OA\space def + /XO \psk@optic@XO\space def + /YO \psk@optic@YO\space def + OA XO add YO){A} + \pnode(! OA XO add AB YO add){B} + \pnode(! XO YO){O} + \pnode(! XO AB YO add){I} + \begingroup% for the fill option + \psset{fillstyle=solid,% + fillcolor=\psk@optic@lensColor,% + linecolor=\psk@optic@lensColor% + } + \rput(! XO YO){% + \ifx\psk@optic@lensType\lensTypeCVG% CVG + \pscustom{% + \parametricplot{\psk@optic@lensHeight}{-\psk@optic@lensHeight}{% + /arg t radius 2.0 mul div def + 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 + cos 1 sub radius mul neg Width2 sub neg + t 2.0 div + } + \fill + }% + \else + \pscustom{% + % (d+w/2,h/2)->(d-w,h/2) + \psline(! Depth Width2 add Height)(! Depth Width2 add neg Height) + % (-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 + t 2.0 div + } + % (-d-w/2,-h/2)(d+w/2,-h/2) + \psline(! Depth Width2 add neg Height neg)(! Depth Width2 add Height neg) + % (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 + t 2.0 div + } + \fill + } + \fi% + }% + \endgroup + \ifPst@drawing + % optical axes + \psline[style=opticalAxis](xLeft)(xRight) + \psset{dotstyle=|} + \psdots(Center') + \uput[-90](Center'){Center'} + \psdots(Center) + \uput[-90](Center){Center} + \psset{linecolor=\psk@optic@rayColor} + \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) + \ifx\psk@optic@lensType\lensTypeCVG + % the parallel ray + \lensSPHRay[lensType=CVG]% + (B)(I){\psk@optic@refractA}{\psk@optic@refractB}{PSPH} + \ABinterCD(PSPH')(PSPH'')(O)(xRight){F'} + \pst@getcoor{F'}\pst@tempf + \pnode(!% + /XF \pst@tempf pop \pst@number\psxunit div neg def + /YF \pst@tempf exch pop \pst@number\psyunit div def + XF YF){F} + \psline(B)(PSPH)(PSPH')(F') + \psOutLine[length=5](PSPH')(F'){PEnd} + % the center ray + \lensSPHRay[lensType=CVG]% + (B)(O){\psk@optic@refractA}{\psk@optic@refractB}{OSPH} + \ABinterCD(PSPH')(PSPH'')(OSPH')(OSPH''){B'} + \pnode(B'|0,0){A'} + \psOutLine[length=5](OSPH')(OSPH''){OEnd} + \psline(B)(OSPH)(OSPH')(OEnd) + % the focus ray + \lensSPHRay[lensType=CVG]% + (B)(F){\psk@optic@refractA}{\psk@optic@refractB}{FSPH} + \psOutLine[length=10](FSPH')(FSPH''){FEnd} + \psline(B)(FSPH)(FSPH')(FEnd) + \else % the DVG part + % the parallel ray + \lensSPHRay[lensType=DVG]% + (B)(I){\psk@optic@refractA}{\psk@optic@refractB}{PSPH} + \ABinterCD(PSPH')(PSPH'')(O)(xRight){F} + \pst@getcoor{F}\pst@tempf + \pnode(!% + /XF \pst@tempf pop \pst@number\psxunit div def + /YF \pst@tempf exch pop \pst@number\psyunit div def + XF neg YF){F'} + \psOutLine[linestyle=dashed,length=5](F)(PSPH'){PEnd'} + \psOutLine[linestyle=dashed,length=5](PEnd')(PSPH'){PEnd} + \psline(B)(PSPH)(PSPH') + % the center ray + \lensSPHRay[lensType=DVG]% + (B)(O){\psk@optic@refractA}{\psk@optic@refractB}{OSPH} + \ABinterCD(PSPH')(PSPH'')(OSPH')(OSPH''){B'} + \pnode(B'|0,0){A'} + \psOutLine(PSPH')(B'){PEnd} + \psline(B)(OSPH)(OSPH') + \psOutLine[linestyle=dashed,length=5](OSPH)(OSPH'){OEnd} + % the focus ray + \lensSPHRay[lensType=DVG]% + (B)(F'){\psk@optic@refractA}{\psk@optic@refractB}{FSPH} + \psline(B)(FSPH)(FSPH')(FSPH'') + \psOutLine[length=5](FSPH')(FSPH''){FEnd} + \psOutLine[linestyle=dashed,length=5](FSPH'')(FSPH'){FEnd'} + \psline[linestyle=dashed](FSPH')(F') + \fi + \psdots(F') + \uput[\psk@optic@spotFi](F'){$\mathrm{\psk@optic@nameFi}$} + \uput[\psk@optic@spotF](F){$\mathrm{\psk@optic@nameF}$} + \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A')(B') + \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% ifdrawing +\end{pspicture*}% +}\ignorespaces} +% +% Herbert Voss 2003/02/02 +% [#1] : lensType=CVG/DVG +% (#2)(#3): the ray coordinates +% #4 #5: the refraction numbers IN and OUT +% #6: the intersection point +% +\def\lensSPHRay{\@ifnextchar[{\pst@lensSPHRay}{\pst@lensSPHRay[]}} +\def\pst@lensSPHRay[#1](#2)(#3)#4#5#6{{% + \psset[pst-optic,pstricks]{#1} + \ifx\psk@optic@lensType\lensTypeCVG% CVG + \ifPst@rightRay + \ABinterSPHLens(#2)(#3)(Center){#6} + \else + \ABinterSPHLens(#2)(#3)(Center'){#6} + \fi + \else + \ABinterSPHLens(#2)(#3)(Center){#6} + \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\lensTypeCVG% CVG + \ifPst@rightRay + \ABinterSPHLens(#6)(tempSPHRay')(Center'){#6'} + \else + \ABinterSPHLens(#6)(tempSPHRay')(Center){#6'} + \fi + \else + \ABinterSPHLens(#6)(tempSPHRay')(Center'){#6'} + \fi +% \psline(! Y mT sub X 1 sub neg)(! Y mT add X 1 add neg) + \refractionRay(#6)(#6')(! Y mT sub X 1 sub neg)% + (! Y mT add X 1 add neg){#5}{#4}{tempSPHRay} + \pnode(tempSPHRay'){#6''} +}\ignorespaces} +% +% Intersection Point of ray and sperical lense +% 2003-02-03 Herbert +% (#1)(#2): the ray coordinates +% (#3): The center of the sperical +% #4: the intersection point +% +\def\ABinterSPHLens(#1)(#2)(#3)#4{% + \pst@getcoor{#1}\pst@tempA + \pst@getcoor{#2}\pst@tempB + \pst@getcoor{#3}\pst@tempm + % calculate the intersection point. we change the coordinates + \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 + /YB \pst@tempB pop \pst@number\psxunit div def + /XB \pst@tempB exch pop \pst@number\psyunit div neg def + /YM \pst@tempm pop \pst@number\psxunit div def + /XM \pst@tempm exch pop \pst@number\psyunit div neg def +% /radius YM abs Width2 add def + /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 + /X XA def + /XSecond XA 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 + /m dY dX div def + /m21 m dup mul 1 add def + /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 + /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 + Y X neg + } ifelse){#4} + \else% DVG + \pnode(!% + /YA \pst@tempA pop \pst@number\psxunit div def + /XA \pst@tempA exch pop \pst@number\psyunit div neg def + /YB \pst@tempB pop \pst@number\psxunit div def + /XB \pst@tempB exch pop \pst@number\psyunit div neg def + /YM \pst@tempm pop \pst@number\psxunit div def + /XM \pst@tempm exch pop \pst@number\psyunit div neg def +% /radius YM abs Width2 add def + /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 + /X XA def + /mT XA radius dup mul XA dup mul sub Sqrt div YM 0 lt {neg}if def + /XSecond XA def + Y X neg + }{ + /dY YB YA sub def + /m dY dX div def + /m21 m dup mul 1 add def + /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 + /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 + Y X neg + } ifelse){#4} + \fi + \pnode(! YSecond XSecond neg){#4'} +%\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 +\def\lens{\@ifnextchar[{\pst@lens}{\pst@lens[]}} +\def\pst@lens[#1]{{% + \psset[pst-optic]{xLeft=-7.5,xRight=7.5,yBottom=-3,yTop=3}% + \psset[pst-optic,pstricks]{#1}% + \pst@killglue% +% trace les rayons +% calcule la position de l'image + \begin{pspicture*}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop) + \pnode(! \psk@optic@xLeft\space 0){xLeft}% + \pnode(! \psk@optic@xRight\space 0){xRight}% + \ifPst@lensTwo + \pnode(!% + /OF' \psk@optic@focus\space def + %/AB \psk@optic@AB\space def + /AB A'1B'1 def + %/OA \psk@optic@OA\space def + /XO \psk@optic@XO\space def + /YO \psk@optic@YO\space def + /OA XO neg XO1 add O1A1' add def + /TesT OA OF' add def + TesT 0 eq {/OA OF' neg 0.001 add def} if + /OA' OA OF' mul OA OF' add div def + /Gamma OA' OA div def + /A'B' Gamma AB mul def + OA' XO add YO){A'}% + \pnode(! OA XO add YO){A}% + \pnode(! OA XO add AB YO add){B} + \pnode(! OF' XO add YO){F'} + \pnode(! OF' neg XO add YO){F} + \pnode(! OA' XO add A'B' YO add){B'} + \pnode(! XO YO){O} + \pnode(! XO AB YO add){I} + \pnode(! XO A'B' YO add){I'} + \pnode(! \psk@optic@xRight\space A'B' YO add){I1} + \pnode(! \psk@optic@xRight\space neg A'B' YO add){I2} + \else% + \pnode(!% + /OF' \psk@optic@focus\space def + /AB \psk@optic@AB\space def + /OA \psk@optic@OA\space def + /XO \psk@optic@XO\space def + /YO \psk@optic@YO\space def + /TesT OA OF' add def + TesT 0 eq {/OA OF' neg 0.001 add def} if + /OA' OA OF' mul OA OF' add div def + /Gamma OA' OA div def + /A'B' Gamma AB mul def + OA' XO add YO){A'} + \pnode(! OA XO add YO){A}% + \pnode(! OA XO add AB YO add){B}% + \pnode(! OF' XO add YO){F'}% + \pnode(! OF' neg XO add YO){F}% + \pnode(! OA' XO add A'B' YO add){B'}% + \pnode(! XO YO){O}% + \pnode(! XO AB YO add){I}% + \pnode(! XO A'B' YO add){I'}% + \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 + \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\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]% + (! XO -0.5 \psk@optic@lensHeight\space mul + \psk@optic@lensScale\space mul YO add)% + (! XO 0.5 \psk@optic@lensHeight\space mul + \psk@optic@lensScale\space mul YO add)% + \fi% + \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 + \end{pspicture*}% +}\ignorespaces} +% +% 25 december 2002 Herbert <voss@perce.de> +% make the lenses dynamical to width _and_ height +% \pslens calculates the radius and the angles from the given values +% of lensWidth and lensHeight and draws the lens with it's origin (0,0) +% +\def\pslensDVG{\pst@object{pslensDVG}} +\def\pslensDVG@i#1#2{% + \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 + /wHalbe w 2 div def% half of the width + /h \pst@number\pst@dimb 2 div def% the half of the height + /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 wHalbe sub atan neg def + /angleB angleA neg def + wHalbe h moveto + x y Radius 180 angleA add 180 angleB add arc + x neg y Radius angleA angleB arc + wHalbe h lineto +} +\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 2 div dup mul h dup mul add wHalbe div def + /x Radius wHalbe 2 div add def + /y 0 def + /angleA h x wHalbe sub atan neg def + /angleB angleA neg def + 0 h moveto + 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 +%Choisir la forme et la taille de la lentille +%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] + }% + }% +} +% +\def\lensDVG{% + \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) +\def\Transform{% + \pnode(A){A1} + \pnode(B){B1} + \pnode(A'){A'1} + \pnode(B'){B'1} + \pnode(O){O1} + \pnode(F){F1} + \pnode(F'){F'1} + \pnode(I){I11} + \pnode(I'){I'1} + \pnode(!% + /XO1 XO def + /YO1 YO def + /O1A1' OA' def + /A'1B'1 A'B' def + XO1 YO1){factice} +} +% +%intersection d'un rayon avec une lentille +\def\rayInterLens(#1)(#2)#3#4{{% + \pst@getcoor{#1}\pst@tempA + \pst@getcoor{#2}\pst@tempB + \pnode(!% + /LengthArrow \psk@optic@length\space def + \pst@tempA /YE1 exch \pst@number\psyunit div def + /XE1 exch \pst@number\psxunit div def + \pst@tempB /YB1 exch \pst@number\psyunit div def + /XB1 exch \pst@number\psxunit div def + /XO2 #3 def + /YO2 YB1 YE1 sub + XB1 XE1 sub div + XO2 XE1 sub + mul + YE1 add + def + XO2 YO2){#4} +}} +% +%eye du philatéliste +\def\eye{% + \psarc[linewidth=2pt](0,2.5){2.5}{215}{270}% + \psarc[linewidth=2pt](0,-2.5){2.5}{90}{140}% + \psarc(-2.5,0){1}{-30}{30}% + \psarc(0,0){1.75}{160}{200} + \psclip{% + \pscircle[linestyle=none](0,0){1.75}} + \pscircle[fillstyle=solid,fillcolor=lightgray](-2.5,0){0.9} + \endpsclip% +} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% M I R R O R S % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\def\mirrorCVGRay{\@ifnextchar[{\pst@mirrorCVGRay}{\pst@mirrorCVGRay[]}}% Herbert 2003/01/05 +\def\pst@mirrorCVGRay[#1](#2)(#3)#4{{% + \ifx\relax#1\relax \else\psset[pst-optic,pstricks]{#1}\fi% + \ifx\psk@optic@mirrorType\mirrorType % CVG +%\typeout{====>\mirrorType} +%\typeout{====>\psk@optic@mirrorType} + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pnode(!% + \psk@optic@mirrorHeight\space dup mul 16 div + \psk@optic@mirrorDepth\space div XO add YO){Focus} + \pnode(!% + /Xmax \psk@optic@mirrorHeight\space 2 div def + /Ymax \psk@optic@mirrorDepth\space def + /A 2 \psk@optic@mirrorHeight\space div dup mul Ymax mul def + /XA \pst@tempA exch pop \pst@number\psyunit div neg def + /YA \pst@tempA pop \pst@number\psxunit div def + /XB \pst@tempB exch pop \pst@number\psyunit div neg def + /YB \pst@tempB pop \pst@number\psxunit div def + 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 + /Xp m2a Root add XA sub def + /Xn m2a Root sub XA sub def + /YSp m Xp mul YA add def + /XSp Xp XA add neg def + /YSn m Xn mul YA add def + /XSn Xn XA add neg def + YA 0 eq {0 0}{XB XA lt {YSn XSn}{YSp XSp} ifelse} ifelse} ifelse) {#4} + \pst@getcoor{#2}\pst@tempc% the starting point + \pst@getcoor{#4}\pst@tempA% the point on the mirror + \pnode(!% + /XA \pst@tempA exch pop \pst@number\psyunit div neg def + /YA \pst@tempA pop \pst@number\psxunit div def + /XC \pst@tempc exch pop \pst@number\psyunit div neg def + /YC \pst@tempc pop \pst@number\psxunit div def +% Mittelpunktsstrahl? + XA abs 0.01 lt YA abs 0.01 lt and {% + /NoMoreReflection true def + YC XC + }{% + /DY YA YC sub def + /DX XA XC sub def +% Steigung der Tangente im Punkt (XA|YA) y'=2ax + /mRay A XA mul 2 mul def +% zugehoeriger Steigungswinkel alpha=arctan y' + /Alpha mRay 2 div 0.5 atan def +% das dazugehoerige Lot + /AlphaPerp 1.0 neg mRay atan def +% Winkel des einfallenden Strahls + /Beta DY DX atan def +% Winkel des ausfallenden Strahls + /BetaStrich AlphaPerp 2 mul Beta sub def +% senkrechte Steigung? cos BetaStrich = 0 + BetaStrich cos abs 0.1 lt {% + /NoMoreReflection true def + Ymax 2 mul XA neg + }{% +% Steigung + /m BetaStrich sin BetaStrich cos div def +% Steigung, ab der kein Schnittpunkt mehr stattfindet + /mMax 2 A mul Xmax mul def + m abs mMax gt { +% no more second reflection + /NoMoreReflection true def + Ymax 2 mul dup YA sub m div XA add neg + }{ +% moegliche 2. Reflektion + /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 + /X1 m2a Root add def + /X2 m2a Root sub def +% be sure, that we get the right point + /X XA X1 sub abs 0.01 gt {X1}{X2} ifelse def + /Y A X dup mul mul def + Y X neg + } ifelse + } ifelse + } ifelse){#4'} + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#4'}\pst@tempB + \pst@getcoor{#4}\pst@tempc + \pnode(!% + /XB \pst@tempB exch pop \pst@number\psyunit div neg def + /YB \pst@tempB pop \pst@number\psxunit div def + NoMoreReflection + {YB XB neg}{% + /XC \pst@tempc exch pop \pst@number\psyunit div neg def + /YC \pst@tempc pop \pst@number\psxunit div def + /XAtemp \pst@tempA exch pop \pst@number\psyunit div neg def + /YAtemp \pst@tempA pop \pst@number\psxunit div def + /m1 2 A mul XB mul def + /Alpha2 m1 abs 0.01 lt {90}{1 neg m1 atan} ifelse def + /Beta XB XC sub abs 0.01 gt + {YC YB sub XC XB sub atan} + {90} ifelse def + /Gamma Alpha2 Beta sub def + /Delta Alpha2 Gamma add def + Delta cos abs 0.01 gt {% + /mDelta Delta sin Delta cos div def + /X YAtemp YB sub mDelta div XB add neg def}{% + /X XB neg def} ifelse + m1 abs 0.01 lt {YAtemp XAtemp}{YAtemp X} ifelse + } ifelse ){#4''} + \else +%--------------- A Spherical Mirror ----------------- +%\typeout{====>\mirrorType} +%\typeout{====>\psk@optic@mirrorType} + \ABinterSPHLens(#2)(#3)(Center){tempRef0} + \pst@getcoor{tempRef0}\pst@tempA + \pst@getcoor{tempRef0'}\pst@tempB + \pnode(!% + \pst@tempA /Y1 exch \pst@number\psyunit div def + /X1 exch \pst@number\psxunit div def + \pst@tempB /Y2 exch \pst@number\psyunit div def + /X2 exch \pst@number\psxunit div def + X1 X2 lt {X1 Y1}{X2 Y2}ifelse ){#4} + \reflectionRay[#1](#2)(#4){tempRef1} +% we try if we have another intermediate point + \ABinterSPHLens(#4)(tempRef1)(Center){tempRef2} + \pst@getcoor{#4}\pst@tempA + \pst@getcoor{tempRef2}\pst@tempB + \pst@getcoor{tempRef2'}\pst@tempc + \pnode(!% + \pst@tempA /YP exch \pst@number\psyunit div def + /XP exch \pst@number\psxunit div def + \pst@tempB /Y1 exch \pst@number\psyunit div def + /X1 exch \pst@number\psxunit div def + \pst@tempc /Y2 exch \pst@number\psyunit div def + /X2 exch \pst@number\psxunit div def + XP X1 sub abs 0.01 gt {X1 Y1}{X2 Y2} ifelse ){#4'} + \reflectionRay[#1](tempRef1)(#4'){#4''} + \psset[pst-optic]{mirrorType=CVG}% restore + \fi + \ifPst@drawing + \psline[#1](#2)(#4) + \psline[#1](#4)(#4') + \psline[#1](#4')(#4'') + \fi +}\ignorespaces} +% +% +\def\mirrorCVG{\@ifnextchar[{\pst@mirrorCVG}{\pst@mirrorCVG[]}}% Herbert Voss 2003/01/05 +\def\pst@mirrorCVG[#1]{{% + \psset[pst-optic]{AB=1.25,OA=4.5,XO=0,YO=0,xLeft=-5,xRight=5,yBottom=-3,yTop=3, + mirrorHeight=5,mirrorDepth=1,mirrorWidth=0.2}% + \ifx\relax#1\relax \else\psset[pst-optic,pstricks]{#1}\fi% + \def\mirrorType{CVG}% + \begin{pspicture}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop) + \pnode(\psk@optic@xLeft, 0){xLeft} + \pnode(\psk@optic@xRight, 0){xRight} + \pstVerb{ + /Height \psk@optic@mirrorHeight\space 2.0 div def + /Depth \psk@optic@mirrorDepth\space def + /Width \psk@optic@mirrorWidth\space def + /AB \psk@optic@AB\space def + /OA \psk@optic@OA\space def + /XO \psk@optic@XO\space def + /YO \psk@optic@YO\space def + /radius Height dup mul Depth dup mul add 2 div Depth div def + } + \pnode(! OA XO add YO){A} + \pnode(! OA XO add AB YO add){B} + \pnode(! XO YO){O} + \ifx\psk@optic@mirrorType\mirrorType % CVG + \pnode(! + \psk@optic@mirrorHeight\space dup mul 16 div + \psk@optic@mirrorDepth\space div XO add YO){Focus} + \else % SPH + \pnode(! radius XO add YO){Center} + \pnode(! radius 2 div XO add YO){Focus} + \fi + \pscustom[fillstyle=solid,fillcolor=\psk@optic@mirrorColor, + linecolor=\psk@optic@mirrorColor]{% + % (d,h/2)->(d-w,h/2) + \psline(!% + \psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div)(!% + \psk@optic@mirrorDepth\space \psk@optic@mirrorWidth\space sub + \psk@optic@mirrorHeight\space 2 div) + % (-w/2,h/2)->(-w/2,-h/2) + \ifx\psk@optic@mirrorType\mirrorType % CVG or SPH + \parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{% + 2 \psk@optic@mirrorHeight\space div dup mul \psk@optic@mirrorDepth\space mul + t 2 exp 4 div mul \psk@optic@mirrorWidth\space sub t 2 div } + \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 } + \fi + % (d-w,-h/2)(d,-h/2) + \psline(!% + \psk@optic@mirrorDepth\space \psk@optic@mirrorWidth\space sub + \psk@optic@mirrorHeight\space 2 div neg)(!% + \psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div neg) + % (w/2,-h/2)->(w/2,h/2) + \ifx\psk@optic@mirrorType\mirrorType % CVG or SPH + \parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{ + 2 \psk@optic@mirrorHeight\space div dup mul \psk@optic@mirrorDepth\space mul + 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 } + \fi + \fill + }% + \ifPst@drawing + \psline[style=opticalAxis](O)(xRight) + \ifx\psk@optic@mirrorType\mirrorType\qdisk(Center){1.5pt}\uput{0.2}[-90](Center){Center}\fi + \qdisk(Focus){2pt}\uput[0](Focus){F} + \psline[linewidth=3\pslinewidth]{->}(A)(B) + \psset{linewidth=\pslinewidth,linecolor=\psk@optic@rayColor,arrows=>} + \uput[0](A){A} + \uput[0](B){B} + \pnode(! 1 \psk@optic@AB\space){Dummy} + \mirrorCVGRay[drawing=false](B)(Dummy){PR} + \psOutLine[length=\psk@optic@OA](PR)(PR'){PR''} + \nodeBetween(B)(PR){Dummy} + \psline(B)(Dummy) + \psline(Dummy)(PR) + \nodeBetween(PR)(PR''){Dummy} + \psline(PR)(Dummy) + \psline(Dummy)(PR'') +% + \mirrorCVGRay[drawing=false](B)(0, 0){MR} + \psOutLine[length=\psk@optic@OA](MR)(MR'){MR''} + \nodeBetween(B)(MR){Dummy} + \psline(B)(Dummy) + \psline(Dummy)(MR) + \nodeBetween(MR)(MR'){Dummy} + \psline(MR)(Dummy) + \psline(Dummy)(MR') +% + \mirrorCVGRay[drawing=false](B)(Focus){FR} + \psOutLine[length=\psk@optic@OA](FR)(FR'){FR''} + \nodeBetween(B)(FR){Dummy} + \psline(B)(Dummy) + \psline(Dummy)(FR) + \nodeBetween(FR)(FR'){Dummy} + \psline(FR)(Dummy) + \psline(Dummy)(FR') +% + \ABinterCD(PR)(PR')(FR)(FR'){B'} + \pnode( B'|0,0 ){A'} + \psline[linecolor=black,linewidth=3\pslinewidth,arrows=->](A')(B') + \uput[45](A'){A'} + \uput[-45](B'){B'} + \fi + \end{pspicture}% +}\ignorespaces} +% +% +\def\mirrorDVG{\@ifnextchar[{% Herbert Voss 2003/01/05 + \pst@mirrorDVG}{\pst@mirrorDVG[]}} +\def\pst@mirrorDVG[#1]{{% + \psset[pst-optic]{% the defaults + AB=1.25,OA=4,XO=0,YO=0,xLeft=-5,xRight=5,yBottom=-3,yTop=3,% + mirrorHeight=5,mirrorDepth=1,mirrorWidth=0.2,mirrorType=DVG}% + \def\mirrorType{DVG}% + \psset[pst-optic,pstricks]{#1}% + \pstVerb{ + /Height \psk@optic@mirrorHeight\space 2 div def + /Depth \psk@optic@mirrorDepth\space def + /Width \psk@optic@mirrorWidth\space def + /radius Height dup mul Depth dup mul add 2 div Depth div def + /AB \psk@optic@AB\space def + /OA \psk@optic@OA\space def + /XO \psk@optic@XO\space def + /YO \psk@optic@YO\space def + } + \begin{pspicture}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop) + \pnode(! \psk@optic@xLeft\space 0){xLeft} + \pnode(! \psk@optic@xRight\space 0){xRight} + \pnode(! OA XO add YO){A} + \pnode(! OA XO add AB YO add){B} + \pnode(! XO YO){O} + \ifx\psk@optic@mirrorType\mirrorType % DVG + \pnode(! Height dup mul 4 div Depth div XO add YO){Focus} + \else % SPH + \pnode(! radius neg XO add YO){Center} + \pnode(! radius 2 div XO add YO){Focus} + \fi + \pscustom[fillstyle=solid,% + fillcolor=\psk@optic@mirrorColor,% + linecolor=\psk@optic@mirrorColor]{% + % (d,h/2)->(d-w,h/2) + \psline(! Depth neg Height)(! Depth Width add neg Height) + % (-w/2,h/2)->(-w/2,-h/2) + \ifx\psk@optic@mirrorType\mirrorType + \parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{% + 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 } + \fi + % (d-w,-h/2)(d,-h/2) + \psline(! Depth Width add neg Height neg)(! Depth neg Height neg)% + % (w/2,-h/2)->(w/2,h/2) + \ifx\psk@optic@mirrorType\mirrorType + \parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{% + 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 } + \fi + \fill% + } + \ifPst@drawing + \psline[style=opticalAxis](xLeft)(xRight) + \qdisk(Center){2pt}\uput[-90](Center){C} + \qdisk(Focus){2pt}\uput{0.25}[-90](Focus){F} + \psline[linewidth=3\pslinewidth,arrowinset=0]{->}(A)(B) + \psset{linewidth=1.5\pslinewidth,linecolor=\psk@optic@rayColor,arrows=->} + \uput{0.15}[0](A){A} + \uput{0.15}[0](B){B} +% + \mirrorDVGRay[drawing=false](B)(0,\psk@optic@AB){PR} +% mirrorType=\psk@optic@mirrorType,drawing=false](B)(0,\psk@optic@AB){PR} + \qdisk(PR){1.5pt}\uput{0.2}[180](PR){PR} + \qdisk(PR'){1.5pt}\uput{0.2}[0](PR'){PR'} + \nodeBetween(B)(PR){PDummy} + \psline(B)(PDummy) + \psline(PDummy)(PR) + \psline[arrows=-, linestyle=dotted](Focus)(PR) + \psOutLine[arrows=-,linestyle=dotted](P)(Focus){PBegin} + \psline(PR)(PR') +% + \mirrorDVGRay[drawing=false](B)(! 0 0){MR} +% mirrorType=\psk@optic@mirrorType,% + \qdisk(MR){1.5pt}\uput{0.2}[180](MR){MR} + \qdisk(MR'){1.5pt}\uput{0.2}[0](MR'){MR'} + \nodeBetween(B)(! 0 0){MDummy} + \psline(B)(MDummy) + \psline(MDummy)(! 0 0) + \psline(MR)(MR') +% + \mirrorDVGRay[drawing=false](B)(Focus){FR} +% mirrorType=\psk@optic@mirrorType,% + \qdisk(FR){1.5pt}\uput{0.2}[180](FR){FR} + \qdisk(FR'){1.5pt}\uput{0.2}[0](FR'){FR'} + \nodeBetween(B)(FR){Dummy} + \psline(B)(Dummy) + \psline(Dummy)(FR) + \psline(FR)(FR') + \psline[arrows=-,linestyle=dotted](Focus)(FR) + \psOutLine[arrows=-, linestyle=dotted](FR)(Focus){PBegin} + \fi + \end{pspicture}% +}\ignorespaces} +% +\def\mirrorDVGRay{\@ifnextchar[{\pst@mirrorDVGRay}{\pst@mirrorDVGRay[]}}% Herbert Voss 2003/01/05 +\def\pst@mirrorDVGRay[#1](#2)(#3)#4{{% + \psset[pst-optic,pstricks]{#1}% + \pnode(!% + \psk@optic@mirrorHeight\space dup mul 16 div + \psk@optic@mirrorDepth\space div neg 0){Focus} + \ifx\psk@optic@mirrorType\mirrorType % DVG or Spherical + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pnode(!% + /A 2 \psk@optic@mirrorHeight\space div dup mul \psk@optic@mirrorDepth\space mul neg def + /XA \pst@tempA exch pop \pst@number\psyunit div neg def + /YA \pst@tempA pop \pst@number\psxunit div def + /XB \pst@tempB exch pop \pst@number\psyunit div neg def + /YB \pst@tempB pop \pst@number\psxunit div def + XB abs 0.001 lt YB abs 0.001 lt and { 0 0 }{ + XB XA sub abs 0.01 lt + {A XA dup mul mul XA neg}{ + /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 + /X1 m2a Root add def + /X2 m2a Root sub def + /X XB X1 sub abs XB X2 sub abs lt + {X1}{X2} ifelse def + /Y A X dup mul mul def + X abs Xmax lt + {Y X neg} + {A Xmax dup mul mul Xmax neg} ifelse + } ifelse + } ifelse){#4} + % #4 is the point on the mirror + \pst@getcoor{#2}\pst@tempC% the starting point + \pst@getcoor{#4}\pst@tempA% the point on the mirror + \pst@getcoor{Focus}\pst@tempf% the point on the mirror + \pnode(! + /XA \pst@tempA exch pop \pst@number\psyunit div neg def + /YA \pst@tempA pop \pst@number\psxunit div def + /XC \pst@tempC exch pop \pst@number\psyunit div neg def + /YC \pst@tempC pop \pst@number\psxunit div def + XA abs 0.001 lt YA abs 0.001 lt and + {YC XC}{ + /YF \pst@tempf pop \pst@number\psxunit div def + /DY YA YC sub def + /DX XA XC sub def + /Alpha A XA mul 0.5 atan def + /Delta 180 DY DX atan sub Alpha 2 mul add def + Delta round cvi 90 mod 0 eq {YC XA neg}{ + /m DX abs 0.01 lt + {YA YF sub XA div} + {Delta sin Delta cos div} ifelse def + /X \psk@optic@length\space Delta cos mul neg XA add def + /Y \psk@optic@length\space Delta sin mul neg YA add def + Y X neg + } ifelse + } ifelse){#4'}% second point on the mirror + \else +%--------------- A Spherical Mirror ----------------- + \ABinterSPHLens(#2)(#3)(Center){tempRef0} + \pst@getcoor{tempRef0}\pst@tempA + \pst@getcoor{tempRef0'}\pst@tempB + \pnode(!% + \pst@tempA /Y1 exch \pst@number\psyunit div def + /X1 exch \pst@number\psxunit div def + \pst@tempB /Y2 exch \pst@number\psyunit div def + /X2 exch \pst@number\psxunit div def + X1 X2 gt {X1 Y1}{X2 Y2}ifelse ){#4} + \reflectionRay[mirrorType=SPH](#2)(#4){tempRef1} + \pnode(tempRef1){#4'} + \fi + \ifPst@drawing + \psline[#1](#2)(#4)(#4') + \fi +}\ignorespaces} +% + +% HEadlight Herbert <voss@perce.de> 2003/01/23 +% +\def\beamLight{\@ifnextchar[{\pst@beamLight}{\pst@beamLight[]}} +\def\pst@beamLight[#1]{{% + \psset[pst-optic]{xLeft=-5,xRight=5,yBottom=-5,yTop=5,% + drawing=false}% the defaults + \psset[pst-optic,pstricks]{#1}% +\begin{pspicture*}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop) + \rput(0,0){% + \mirrorCVG[#1]% + } + \psline[linewidth=0.1cm]% + (!\psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div neg)% + (!\psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div) + \psset{linewidth=0.75mm,fillstyle=solid} + \psline(-1.1,1)(0.2,1) + \psline(-1.1,-1)(0.2,-1) + \pscurve(0.2,0.75)(1.6,1.5)(3,1)(3.5,0)(3,-1)(1.6,-1.5)(0.2,-0.75) + \psframe(-1.1,-0.85)(0.2,0.85) + \psframe(0.2,-0.3)(0.5,0.3) + \psline(-1.1,-0.85)(-1.4,-0.6)(-1.4,0.6)(-1.1,0.85) + \psline(0,0)(2.9,0)(2.9,0.5)(0.9,0.5)(0.9,0)% + \psline(3.0,0)(3.0,-0.3)(2.5,-0.3)(2.2,0.15)(2,-0.15)% + (1.8,0.15)(1.6,-0.15)(1.4,0.15)(1.2,-0.15)(1,0.15)% + \psline[linecolor=black,linewidth=0.5pt,linestyle=dashed](-1.75,0)(10,0) +\end{pspicture*}% +}\ignorespaces} +% +% +%Telescope +%2 juillet 2001 +% +\def\mirrorTwo{% + \psframe[linestyle=none,% + fillstyle=vlines,% + hatchwidth=0.5\pslinewidth,% + hatchsep=3\pslinewidth](-1,0)(1,0.2) + \psline[linewidth=1.5\pslinewidth](-1,0)(1,0)% +} +% +\def\telescope{\@ifnextchar[{\pst@telescope}{\pst@telescope[]}} +\def\pst@telescope[#1]{{% + \psset[pst-optic]{xLeft=-0.5,xRight=11,yBottom=-6,yTop=2}% the default + \def\@tempa{#1}% + \ifx\@tempa\@empty\else\psset[pst-optic,pstricks]{#1}\fi% + \pstVerb{% + /mirrorFocus \psk@optic@mirrorFocus\space def + /Coeff mirrorFocus 4 mul def + /mirrorTwoAngle \psk@optic@mirrorTwoAngle\space def + /posMirrorTwo \psk@optic@posMirrorTwo\space def + }% +% +\begin{pspicture*}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop) + \rput(0,0){% + \mirrorCVG[% + mirrorHeight=4,% + mirrorWidth=0.25,% + mirrorDepth=0.25,% + drawing=false]% + } + \pnode(! \psk@optic@xLeft\space 0){xLeft} + \pnode(! \psk@optic@xRight\space 0){xRight} + \psline[linewidth=0.5\pslinewidth](11,0) + \pnode(! 1.5 dup mul Coeff div 1.5){P1} + \pnode(! 1.5 dup mul Coeff div 1.5 neg){P2} + \pnode(! mirrorFocus 0){mirrorFocusNode} + \pnode(! posMirrorTwo 1 mirrorTwoAngle cos mul sub + 1 mirrorTwoAngle sin mul){UpMirror2} + \pnode(! posMirrorTwo 1 mirrorTwoAngle cos mul add + 1 mirrorTwoAngle sin mul neg){DownMirror2} + \ABinterCD(P1)(mirrorFocusNode)(UpMirror2)(DownMirror2){Inter1} + \ABinterCD(P2)(mirrorFocusNode)(UpMirror2)(DownMirror2){Inter2} + \pnode(!% + \psk@optic@posMirrorTwo\space posMirrorTwo mirrorFocus sub){ocularFocusNode} + {% + \psset{linecolor=red} + \Arrows[arrows=->,arrowsize=0.2](11,1.5)(P1) + \Arrows[arrows=->,arrowsize=0.2](P1)(Inter1) +% + \Arrows[arrows=->>,arrowsize=0.2](11,-1.5)(P2) + \Arrows[arrows=->>,arrowsize=0.2](P2)(Inter2) + \psline[linestyle=dashed](Inter2)(mirrorFocusNode) + \pnode(! 5 \psk@optic@posMirrorTwo\space 2 sub neg){ocularLeft} + \pnode(! 7 \psk@optic@posMirrorTwo\space 2 sub neg){ocularRight} + \ABinterCD(Inter1)(ocularFocusNode)(ocularLeft)(ocularRight){FO1} + \ABinterCD(Inter2)(ocularFocusNode)(ocularLeft)(ocularRight){FO2} + \Arrows[arrows=->>,arrowsize=0.2,length=1](Inter2)(FO2) + \psline(11,-1.5)(P2)(Inter2)(FO2) + \Arrows[arrows=->,arrowsize=0.2](Inter1)(ocularFocusNode) + \psline[linestyle=dashed](Inter1)(mirrorFocusNode) + \psline(11,1.5)(P1)(Inter1)(FO1) + } + \rput{-\psk@optic@mirrorTwoAngle}(\psk@optic@posMirrorTwo,0){\mirrorTwo} + \uput[90](mirrorFocusNode){$\mathrm{F_1}$} + \uput[180](ocularFocusNode){$\mathrm{F_2}$} + \rput{90}(!% + \psk@optic@posMirrorTwo\space + \psk@optic@posMirrorTwo\space 2 sub neg){% + \psscalebox{0.5 0.4}{\lens[lensWidth=0.4,lensGlass=true,drawing=false]}} + \pnode(0,2){Aux1} + \pnode(0,-2){Aux2} + \Parallel[length=1](Aux1)(Aux2)(FO1){Eye1} + \Parallel[length=1](Aux1)(Aux2)(FO2){Eye2} + {% + \psset{linecolor=red,arrowsize=0.2,length=0.7} + \psline[linecolor=red](FO1)(Eye1) + \psline[linecolor=red](FO2)(Eye2) + \Arrows[arrows=->](FO1)(Eye1) + \Arrows[arrows=->>](FO2)(Eye2)% + } + \rput{-90}(!% + \psk@optic@posMirrorTwo\space + \psk@optic@posMirrorTwo\space neg){\psscalebox{0.6}{\eye}} +\end{pspicture*}% +}\ignorespaces} +% +%Images et réflexions sur un miroir plan +%(#1) coordonnées du point objet (XA,YA) +%(#2) coordonnées d'une extrémité du miroir (X1,Y1) +%(#3) coordonnées de l'autre extrémité du miroir (X2,Y2) +%{#4} nom de l'image A' +% +\def\planMirrorRay(#1)(#2)(#3)#4{{% +\pst@getcoor{#1}\pst@tempA +\pst@getcoor{#2}\pst@tempB +\pst@getcoor{#3}\pst@tempc +\pnode(!% + \pst@tempA /YA exch \pst@number\psyunit div def + /XA exch \pst@number\psxunit div def + \pst@tempB /Y1 exch \pst@number\psyunit div def + /X1 exch \pst@number\psxunit div def + \pst@tempc /Y2 exch \pst@number\psyunit div def + /X2 exch \pst@number\psxunit div def + /Dx X2 X1 sub def + /Dy Y2 Y1 sub def + /xH XA Dx Dx mul mul + X1 Dy Dy mul mul + add + YA Y1 sub Dx Dy mul mul + add + Dx Dx mul Dy Dy mul add + div + def + /yH YA Dy Dy mul mul + Y1 Dx Dx mul mul + add + XA X1 sub Dx Dy mul mul + add + Dx dup mul Dy dup mul add + div + 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 + xA' yA' moveto + xH yH rlineto + xA' yA'){#4} +}\ignorespaces} +% +% 2002/12/27 +% +\def\symPlan(#1)(#2){\pst@killglue\pst@makebox{\symPlan@(#1)(#2)}}% +\def\symPlan@(#1)(#2){{% + \pst@getcoor{#1}\pst@tempA% + \pst@getcoor{#2}\pst@tempB% + \leavevmode + \hbox{% + \pnode(!% + \pst@tempA /Y1 exch def + /X1 exch def + \pst@tempB /Y2 exch def + /X2 exch def + /DX X2 X1 sub def + /DY Y2 Y1 sub def + /D12 DX dup mul DY dup mul add def + /ax 2 DX dup mul mul D12 div 1 sub def + /by 2 DX DY mul mul D12 div def + /cx by def + /dy 2 DY dup mul mul D12 div 1 sub def + /tx X1 DY dup mul mul + Y1 DX DY mul mul sub + 2 mul + D12 div + def + /ty Y1 DX dup mul mul + X1 DX DY mul mul sub + 2 mul + D12 div + def + X1 Y1){Factice}% + \pst@Verb{% + { [ax by cx dy tx ty] concat + } tx@3Ddict begin TMChange end }% + \box\pst@hbox + \pst@Verb{ tx@3Ddict begin TMRestore end }}% +}\ignorespaces} +% +% refractionRay[options](A)(B)(C)(D){rNoA}{rNoB}{E} +% (A)(B) the ray nodes +% (C)(D) the nodes of the other material +% {rNoA}{rNoB} the refraction numbers +% {E} the intermediate node of the ray and the material +% {E'} the end node of the ray +% +% Herbert Voss <voss@perce.de> 2003-01-26 +% +\def\refractionRay{\@ifnextchar[{\pst@refractionRay}{\pst@refractionRay[]}} +\def\pst@refractionRay[#1](#2)(#3)(#4)(#5)#6#7#8{{% + \psset[pst-optic,pstricks]{#1} + \pst@getcoor{#2}\pst@tempA + \pst@getcoor{#3}\pst@tempB + \pst@getcoor{#4}\pst@tempc + \pst@getcoor{#5}\pst@tempd + \ABinterCD(#2)(#3)(#4)(#5){#8} +%\psset{linecolor=black} +%\qdisk(#8){2pt} +% #8 is the point on the material + \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 + /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 + /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 + /YP \pst@tempp exch pop \pst@number\psyunit div def + /XP \pst@tempp pop \pst@number\psxunit div def + /dY1 YP YA sub def + /dX1 XP XA sub def + /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 + /GammaStrich 90 Gamma sub def +% the angle of the incoming ray + /AlphaStrich dY1 dX1 atan def +% the same relative to the material + /Alpha 90 AlphaStrich sub Gamma add def +% the angle of the outgoing ray relative to the material +% 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{ + /Root 1 sinBeta dup mul sub Sqrt def + /Beta sinBeta Root atan def + }{ + /Beta 180 Alpha sub def + } ifelse +% the same absolute + /BetaStrich 90 Gamma sub Beta add def +% Determine the intermediate point + XP BetaStrich cos sub + YP BetaStrich sin add ){#8'} +%\qdisk(#8){5pt} +}\ignorespaces} +% +% Herbert Voss <voss@perce.de> 2003-02-10 +% +% reflectionRay[options](A)(B){C} +% options: the type of +% (A)(B) the ray nodes +% {C} the intermediate node of the ray and the material +% {C'} the end node of the reflected ray +% +\def\reflectionRay{\@ifnextchar[{\pst@reflectionRay}{\pst@reflectionRay[]}} +\def\pst@reflectionRay[#1](#2)(#3)#4{{% + \psset[pst-optic,pstricks]{#1} + \pst@getcoor{#2}\pst@tempA% the starting point + \pst@getcoor{#3}\pst@tempp% the point on the mirror + \pst@getcoor{Center}\pst@tempc% the center/focus of the mirror + \ifx\psk@optic@mirrorType\mirrorType% Parabolic + \else% Spherical + \pnode(!% + /XA \pst@tempA exch pop \pst@number\psyunit div neg def + /YA \pst@tempA pop \pst@number\psxunit div def + /XC \pst@tempc exch pop \pst@number\psyunit div neg def + /YC \pst@tempc pop \pst@number\psxunit div def + /XP \pst@tempp exch pop \pst@number\psyunit div neg def + /YP \pst@tempp pop \pst@number\psxunit div def + /dY1 YA YP sub def + /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 + /Gamma XP signum mul root atan 180 sub def +% the angle of the incoming ray + /AlphaStrich dY1 dX1 atan 180 sub def +% the same relative to the material + /Alpha 90 AlphaStrich sub Gamma add def +% the angle of the outgoing ray absolute +% /BetaStrich Alpha 2 mul AlphaStrich sub def + /BetaStrich Gamma Alpha add 90 sub def +% Determine the intermediate point + YP BetaStrich sin add XP BetaStrich cos add neg){#4} + \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[pst-optic]{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[linewidth=\psk@optic@rayWidth,linecolor={[wave]{\psk@Prism@Lambda}},arrowscale=2]{->}(P1)(I2)(R2) + \psline[linewidth=\psk@optic@rayWidth,linecolor={[wave]{\psk@Prism@Lambda}}](E1)(P1) + \psline[linewidth=\psk@optic@rayWidth,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[linewidth=\psk@optic@rayWidth,linecolor=prism](I1)(I2)(R2)} + \psline[linewidth=\psk@optic@rayWidth,linecolor=\psk@optic@rayColor,linewidth=0.5mm](E1)(I1) + \psline[linewidth=\psk@optic@rayWidth,linecolor=\psk@optic@rayColor,linewidth=0.5mm,arrowscale=2]{->}(E1)(!i1x E1x add 2 div i1y E1y add 2 div) + \end@SpecialObj% +} +% +% +\def\resetOpticOptions{% hv 2006-07-20 + \newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=black,linestyle=solid} + \psset[pst-optic]{% + 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, + mirrorType=CVG,mirrorDepth=1,mirrorHeight=5,mirrorWidth=0.25, + mirrorFocus=8,mirrorTwoAngle=45,posMirrorTwo=6,mirrorColor=lightgray, + refractA=1,refractB=1.41, + 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,% + AnglePrism=60,AnglePlan1=25,AnglePlan2=55,k=1,lambda=632.8,notations=true, + rayWidth=\pslinewidth}% +% \gdef\mirrorType{CVG}% +% \gdef\lensTypeCVG{CVG}% +} +\catcode`\@=\PstAtCode\relax +% +%% END: pst-optic.tex +\endinput |