Retour

prisme_xcolor_presentation02.tex

Télécharger le fichier Fichier PDF
\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{pstricks,pst-node,pst-char,pst-slpe,pst-grad,pst-math}
\usepackage{fancyvrb}
\usepackage{multido}
\usepackage{amsmath}
\usepackage{eqnarray}
\usepackage{listings}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\lstnewenvironment{example}[1][]{%
  \lstset{basicstyle=\footnotesize\ttfamily,columns=flexible,frame=single,%
    backgroundcolor=\color{yellow!20},xleftmargin=\fboxsep,%
    xrightmargin=\fboxsep,gobble=1,%
%    language=[LaTeX]TeX,keywordstyle=\color{blue},%
%    moretexcs=[1]{color,ProvidesPackage},%
%    moretexcs=[2]{onslide,pause,pdsetup,maketitle,tableofcontents},%
%    texcsstyle=[2]\color{red}%
    }\lstset{#1}}{}
\SpecialCoor
% les calculs sont ceux de Gernot Hoffmann
% dans http://www.fho-emden.de/~hoffmann/prism16072005.pdf
\title{L'utilisation du package \pscharpath[fillstyle=slopes,linestyle=none]{xcolor}
dans la représentation du phénomène de dispersion lumineuse}
\date{20 octobre 2\,005}
\author{Manuel Luque}
\begin{document}
\maketitle
\section{Déviation d'un rayon lumineux monochromatique}
Cette première partie traite de la construction du trajet d'un rayon lumineux monochromatique dans un prisme.
Le cahier de charges est le suivant, les grandeurs suivantes devant être paramétrables :
\begin{itemize}
  \item l'angle du prisme ;
  \item la direction du rayon incident ;
  \item le choix de la radiation par sa longueur d'onde en nm.
\end{itemize}
La construction doit s'adapter automatiquement à ces valeurs, ainsi que la couleur de la radiation\ldots cela va de soi.
 
La méthode de calculs adoptée est celle de Gernot Hoffmann qu'il détaille dans son document :
{\fcolorbox{red}{yellow!50}{\url{http://www.fho-emden.de/~hoffmann/prism16072005.pdf}}
\subsection{Calculs et constructions géométriques}
\newcommand\LAMBDA{632.8}
\shorthandoff{;:!?}
\begin{center}
\begin{pspicture}(-7,0)(7,9)
%\psset{unit=1.5}
\psline{->}(0,8)
\uput[90](0,8){$y$}
\psline{->}(-6,0)(6,0)
\uput[0](6,0){$x$}
\pnode(0,0){O}
\pnode(!
    /AnglePrisme 30 def % demi-angle au sommet du prisme
    /AnglePlan1 19 def  % angle du plan 1 avec la verticale
    /AnglePlan2 60 def  % angle du plan 2 avec la verticale
% 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
    /u 1.5 def
%
    /g1x AnglePrisme sin neg def % -sin(A/2)
    /g1y AnglePrisme cos def     %  cos(A/2)
    /u1x AnglePlan1 sin neg def
    /u1y AnglePlan1 cos neg def
% le point E émetteur
    /E1x C1x u u1x mul add def
    /E1y C1y u 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_prisme}
\pspolygon[fillstyle=gradient,gradbegin=cyan,gradend=white,gradangle=60,gradmidpoint=0.5](O)%
                                (! 7 90 AnglePrisme add cos mul 7 90 AnglePrisme add sin mul)
                                (! 7 90 AnglePrisme sub cos mul 7 90 AnglePrisme 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
    /lambda \LAMBDA\space def % en nm : 632.8 laser He-Ne du lycée
    /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 AnglePrisme add def
    /sinB1 alpha1 sin N div def
    /B1 sinB1 asin def
    /Delta1 AnglePrisme B1 sub def
%%%
    /g2x AnglePrisme sin def
    /g2y AnglePrisme 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 AnglePrisme 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 AnglePrisme 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 AnglePrisme 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 AnglePrisme tan mul sub} bind def
         /bQ' {i2y i2x AnglePrisme tan mul add} bind def
         /xQ {bQ' bQ sub 2 div AnglePrisme 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 AnglePrisme add alpha1 sub}{!180 AnglePrisme add}
    \uput{1}[! 180 AnglePrisme add alpha1 2 div sub](0,0){$i_1$}
    \psarc[linecolor=blue]{<-}(0,0){1}{!AnglePrisme B1 sub}{!AnglePrisme}
    \uput{1.2}[! AnglePrisme 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}{! AnglePrisme neg 180 add}{!AnglePrisme neg 180 add B2 add}
    \uput{1}[!AnglePrisme neg 180 add B2 2 div add](0,0){$r_2$}
    \psarc{->}(0,0){1}{! AnglePrisme neg}{!alpha2 AnglePrisme sub}
    \uput{1.2}[!alpha2 2 div AnglePrisme sub](0,0){$i_2$}
    \uput{0.4}[90](0,0){$I_2$}}
\psline[linecolor={[wave]{\LAMBDA}},arrowscale=2]{->}(P1)(I2)(R2)
\psline[linecolor={[wave]{\LAMBDA}}](E1)(P1)
\psline[linecolor={[wave]{\LAMBDA}},arrowscale=2]{->}(E1)(!i1x E1x add 2 div i1y E1y add 2 div)
\psarc(0,0){0.8}{!90 AnglePrisme sub}{!90 AnglePrisme 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}$}}
\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[20](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]{\LAMBDA}}](E1)
\psdot[dotstyle=o](C2)
\psdot[dotstyle=o](R2)
\end{pspicture}
\end{center}
\shorthandon{;:!?}
Le prisme défini par son demi-angle au sommet $A/2$ par la variable :
 
\begin{example}
    /AnglePrisme 30 def % demi-angle au sommet du prisme
\end{example}
 
 
L'émetteur $E_1$ est repéré par sa position sur un plan défini par l'angle $\rho_1$ qu'il fait avec la verticale.
La trace de ce plan est la droite $C_1E_1$. $C_1$ est une origine arbitraire :
\begin{example}
    /C1x -6 def % abscisse de C1
    /C1y  6 def % ordonnée de C1
\end{example}
La position de $E_1$ est réglée par le coefficient $u$ : $\overrightarrow{C_1E_1}=u\overrightarrow{u}_1$ :
\[
\overrightarrow{u_1}=\left[
\begin{array}{c}
-\cos(\rho_1)\\
-\sin(\rho_1)
\end{array}
\right]
\]
\begin{example}
    /u 1.5 def
    /u1x AnglePlan1 sin neg def
    /u1y AnglePlan1 cos neg def
    /E1x C1x u u1x mul add def  % abscisse de E1
    /E1y C1y u u1y mul add def  % ordonnée de E1
\end{example}
La normale à ce plan $\overrightarrow{n}_1$ qui sera la direction du rayon incident
 a pour coordonnées :
\[
\overrightarrow{n_1}=\left[
\begin{array}{r}
\cos(\rho_1)\\
-\sin(\rho_1)
\end{array}
\right]
\]
\begin{example}
    /n1x AnglePlan1 cos def
    /n1y AnglePlan1 sin neg def
\end{example}
L'équation paramétrique du rayon incident se déduit, $P(x,y)$ étant un point courant de la droite, de :
\[
\overrightarrow{E_1P}=\lambda\overrightarrow{n_1}
\]
\begin{eqnarray}
x&=&x_{E_1}+\lambda n_{1x}\label{ix1}\\
y&=&y_{E_1}+\lambda n_{1y}\label{iy1}
\end{eqnarray}
Il s'agit de déterminer l'intersection du rayon incident avec la face correspondante du prisme.
L'équation de celle-ci s'écrit :
\begin{eqnarray}
y=x\tan(90+\frac{A}{2})=-\frac{x}{\tan(A/2)}\label{iP1}
\end{eqnarray}
On détermine ainsi les coordonnées du point d'incidence $I_1$, en calculant d'abord $\lambda$ par substitution
des expressions de (\ref{ix1}) et (\ref{iy1}) dans l'équation~(\ref{iP1}) :
\[
y_{E_1}+\lambda n_{1y}=-\frac{x_{E_1}+\lambda n_{1x}}{\tan(A/2)}
\]
\[
y_{E_1}\tan(A/2)+\lambda n_{1y}\tan(A/2)=-(x_{E_1}+\lambda n_{1x})
\]
\[
\lambda \big(n_{1y}\tan(A/2)+n_{1x}\big)=-\big(x_{E_1}+y_{E_1}\tan(A/2)\big)
\]
\[
\lambda =-\frac{x_{E_1}+y_{E_1}\tan(A/2)}{n_{1y}\tan(A/2)+n_{1x}}
\]
\[
\lambda =-\frac{x_{E_1}\cos(A/2)+y_{E_1}\sin(A/2)}{n_{1y}\sin(A/2)+n_{1x}\cos(A/2)}
\]
On en déduit les coordonnées de $I_1$ avec (\ref{ix1}) et (\ref{iy1}).
\begin{example}
    /g1x AnglePrisme sin neg def % -sin(A/2)
    /g1y AnglePrisme cos def     %  cos(A/2)
    /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
\end{example}
$n$ étant l'indice de réfraction du verre pour cette radiation, $i_1$ l'angle d'incidence du rayon sur la face d'entrée
la loi de \textsc{Snell}-\textsc{Descartes} permet de calculer l'angle de réfraction $r_1$ dans le verre.
\[
\sin i_1=n\sin r_1 \Longrightarrow r_1=\arcsin\left(\frac{\sin i_1}{n}\right)
\]
\begin{example}
    /alpha1 AnglePlan1 AnglePrisme add def % i1
    /sinB1 alpha1 sin N div def % sin(r1)=sin(i1)/n
    /B1 sinB1 asin def % r1
\end{example}
Pour le calcul de l'indice du prisme $n$, j'utilise la formule de Sellmeier's que donne
Gernot Hoffmann pour du verre flint lourd :
\[
n^2=1+\frac{B_1\lambda^2}{\lambda^2-C_1}+\frac{B_2\lambda^2}{\lambda^2-C_2}+\frac{B_3\lambda^2}{\lambda^2-C_3}
\]
On détermine ensuite l'équation paramétrique de la droite $I_1I_2$,
avec $P(x,y)$ un point courant de la droite et $\overrightarrow{d_{12}}$ un vecteur directeur :
\[
\overrightarrow{d_{12}}=\left[
\begin{array}{r}
\cos(\delta_1)\\
\sin(\delta_1)
\end{array}
\right]
\]
avec $\delta_1=\frac{A}{2}-r_1$, qui est l'angle que fait $I_1I_2$ avec l'horizontale.
\[
\overrightarrow{I_1P}=\lambda\overrightarrow{d_{12}}
\]
\begin{eqnarray}
x&=&x_{I_1}+\lambda d_{12_x}\label{ix2}\\
y&=&y_{I_1}+\lambda d_{12_y}\label{iy2}
\end{eqnarray}
Le côté droit du prisme a pour équation :
\begin{eqnarray}
y=x\tan(90-\frac{A}{2})=\frac{x}{\tan(A/2)}\label{iP2}
\end{eqnarray}
On détermine les coordonnées du point d'intersection $I_2$ comme précédemment :
\[
y_{I_1}+\lambda d_{12_y}=\frac{x_{I_1}+\lambda d_{12_x}}{\tan(A/2)}
\]
\[
y_{I_1}\tan(A/2)+\lambda d_{12_y}\tan(A/2)=(x_{I_1}+\lambda d_{12_x})
\]
\[
\lambda \big(d_{12_y}\tan(A/2)-d_{12_x}\big)=\big(x_{I_1}-y_{I_1}\tan(A/2)\big)
\]
\[
\lambda =\frac{x_{I_1}-y_{I_1}\tan(A/2)}{d_{12_y}\tan(A/2)-d_{12_x}}
\]
\[
\lambda =\frac{x_{I_1}\cos(A/2)-y_{I_1}\sin(A/2)}{d_{12_y}\sin(A/2)-d_{12_x}\cos(A/2)}
\]
On en déduit les coordonnées de $I_2$ avec (\ref{ix2}) et (\ref{iy2}).
\begin{example}
    /g2x AnglePrisme sin def % sin(A/2)
    /g2y AnglePrisme cos def % cos(A/2)
    /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
\end{example}
La dernière étape consiste à calculer le rayon réfracté dans l'air et son intersection avec l'écran.
\[
n\sin r_2=\sin i_2\Longrightarrow i_2=\arcsin(n\sin r_2)
\]
\begin{example}
    /B2  AnglePrisme 2 mul B1 sub def % r2
    /sinA2 N B2 sin mul def           % sin(i2)=n*sin(r2)
    /alpha2 sinA2 asin def          % i2
\end{example}
L'angle que fait le rayon réfracté $I_2R_2$ avec l'horizontale vaut :
\[
\delta_2=i_2-\frac{A}{2}
\]
\begin{example}
    /Delta2 alpha2 AnglePrisme sub def
\end{example}
Le vecteur directeur de la droite $d_2$ :
\[
\overrightarrow{d_{2}}=\left[
\begin{array}{r}
\cos(\delta_2)\\
\sin(\delta_2)
\end{array}
\right]
\]
\begin{example}
    /d2x Delta2 cos def
    /d2y Delta2 sin def
\end{example}
On cherche l'équation de la droite $I_2R_2$
\[
\overrightarrow{I_2P}=\lambda\overrightarrow{d_{2}}
\]
\begin{eqnarray}
x&=&x_{I_2}+\lambda d_{2_x}\label{ix3}\\
y&=&y_{I_2}+\lambda d_{2_y}\label{iy3}
\end{eqnarray}
et son intersection avec l'écran, dont la position est déterminée par un point $C_2$ choisi arbitrairement et
l'angle qu'il fait avec la verticale $\rho_2$. Le vecteur directeur de cette droite est :
\[
\overrightarrow{u_{2}}=\left[
\begin{array}{r}
\sin(\rho_2)\\
-\cos(\rho_2)
\end{array}
\right]
\]
\begin{example}
    /u2x AnglePlan2 sin def
    /u2y AnglePlan2 cos neg def
\end{example}
\begin{eqnarray}
x&=&x_{C_2}+\mu u_{2_x}\label{ix4}\\
y&=&y_{C_2}+\mu u_{2_y}\label{iy4}
\end{eqnarray}
(\ref{ix3}), (\ref{iy3}), (\ref{ix4}), (\ref{iy4}) nous donnent un système en $\mu$ et $\lambda$ :
\[
\left\{
\begin{array}{rcl}
x_{C_2}+\mu u_{2_x}&=&x_{I_2}+\lambda d_{2_x}\\
y_{C_2}+\mu u_{2_y}&=&y_{I_2}+\lambda d_{2_y}
\end{array}
\right.
\]
\[
\left\{
\begin{array}{rcl}
\mu&=&\frac{-(x_{I_2}-x_{C_2})d_{2_y}+(y_{I_2}-y_{C_2})d_{2_x}}{-u_{2_x}d_{2_y}+u_{2_y}d_{2_x}}\\
\lambda&=&\frac{-u_{2_x}(y_{I_2}-y_{C_2})+u_{2_y}(x_{I_2}-x_{C_2})}{-u_{2_x}d_{2_y}+u_{2_y}d_{2_x}}\\
\end{array}
\right.
\]
\begin{example}
    /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
\end{example}
Tous les éléments du schéma ayant été calculés, les points se placent grâce à la puissance de \texttt{pst-node} :
\begin{example}
    \pnode(! C1x C1y){C1}
    \pnode(! C2x C2y){C2}
    \pnode(! E1x E1y){E1}
    \pnode(! i1x i1y){P1}
    \pnode(! i2x i2y){I2}
    \pnode(! r2x r2y){R2}
\end{example}
 
\newpage
\subsection{Le problème de physique}
\shorthandoff{;:!?}
\begin{center}
\begin{pspicture}(-7,0)(7,10)
\psset{unit=1.5}
\pnode(0,0){O}
\pnode(!
    /AnglePrisme 30 def
    /AnglePlan1 19 def
    /AnglePlan2 54 def
% le point C1 sur la droite 1
    /C1x -6 def
    /C1y 6 def
% le point C2 sur la droite 2
    /C2x 8 def
    /C2y 5 def
% donne la distance C1E1
    /u 1.5 def
%
    /g1x AnglePrisme sin neg def % -sin(A/2)
    /g1y AnglePrisme cos def     %  cos(A/2)
    /u1x AnglePlan1 sin neg def
    /u1y AnglePlan1 cos neg def
% le point E émetteur
    /E1x C1x u u1x mul add def
    /E1y C1y u 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_prisme}
\pspolygon[fillstyle=gradient,gradbegin=cyan,gradend=white,gradangle=60,gradmidpoint=0.5](O)%
        (! 7 90 AnglePrisme add cos mul 7 90 AnglePrisme add sin mul)
        (! 7 90 AnglePrisme sub cos mul 7 90 AnglePrisme sub sin mul)
\pnode(!
% Les datas
% Sellmeier's
% glass sf15
% 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
    /lambda \LAMBDA\space def % en nm : laser He-Ne du lycée
    /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 AnglePrisme add def
    /sinB1 alpha1 sin N div def
    /B1 sinB1 asin def
    /Delta1 AnglePrisme B1 sub def
%
    /g2x AnglePrisme sin def
    /g2y AnglePrisme 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  AnglePrisme 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 AnglePrisme 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 AnglePrisme 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){I1}
\pnode(! i2x i2y){I2}
\pnode(! r2x r2y){R2}
\pnode(! /bQ {i1y i1x AnglePrisme tan mul sub} bind def
         /bQ' {i2y i2x AnglePrisme tan mul add} bind def
         /xQ {bQ' bQ sub 2 div AnglePrisme 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](I1)(I)
\pcline[linestyle=dashed,nodesepB=-2](I2)(I)
\pcline[linestyle=dashed,nodesepB=-1,nodesepA=-2](I1)(Q)
\pcline[linestyle=dashed,nodesepB=-1,nodesepA=-2](I2)(Q)
\rput(I1){%
    \rput{30}(0,0){\psframe*(0,0)(0.2,0.2)}
    \psarc{<-}(0,0){0.8}{!180 AnglePrisme add alpha1 sub}{!180 AnglePrisme add}
    \uput{1}[! 180 AnglePrisme add alpha1 2 div sub](0,0){$i_1$}
    \psarc[linecolor=blue]{<-}(0,0){1}{!AnglePrisme B1 sub}{!AnglePrisme}
    \uput{1.2}[! AnglePrisme B1 2 div sub](0,0){$r_1$}
    \uput[-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}{! AnglePrisme neg 180 add}{!AnglePrisme neg 180 add B2 add}
    \uput{1}[!AnglePrisme neg 180 add B2 2 div add](0,0){$r_2$}
    \psarc{->}(0,0){1}{! AnglePrisme neg}{!alpha2 AnglePrisme sub}
    \uput{1.2}[!alpha2 2 div AnglePrisme sub](0,0){$i_2$}
    \uput[-90](0,0){$I_2$}}
\psline[linecolor={[wave]{\LAMBDA}},arrowscale=2]{->}(I1)(I2)(R2)
\psline[linecolor={[wave]{\LAMBDA}}](E1)(I1)
\psline[linecolor={[wave]{\LAMBDA}},arrowscale=2]{->}(E1)(!i1x E1x add 2 div i1y E1y add 2 div)
\psarc(0,0){0.8}{!90 AnglePrisme sub}{!90 AnglePrisme add}
\uput[90](0,0.8){$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){$D$}}
\end{pspicture}
\end{center}
\shorthandon{;:!?}
$n$ étant l'indice de réfraction du verre pour cette lumière, $i_1$ l'angle d'incidence du rayon sur la face d'entrée
la loi de \textsc{Snell}-\textsc{Descartes} permet de calculer l'angle de réfraction $r_1$ dans le verre.
\[
\sin i_1=n\sin r_1 \Longrightarrow r_1=\arcsin\left(\frac{\sin i_1}{n}\right)
\]
Le rayon lumineux subit ensuite une deuxième réfraction en $I_2$, lors du passage du verre dans l'air :
\[
n\sin r_2=\sin i_2 \Longrightarrow i_2=\arcsin\left(n\sin r_2\right)
\]
En $I_1$, le rayon est dévié d'un angle $i_1-r_1$, en $I_2$ de $i_2-r_2$ soit globalement de :
\[
D=i_1+i_2-(r_1+r_2)=i_1+i_2-A
\]
Cette déviation passe par un minimum lorsque $r_1=r_2=\dfrac{A}{2}$, ce qui permet d'en déduire la valeur que doit posséder
l'angle d'incidence d'entrée :
\[
\sin i_m=n\sin \frac{A}{2}\Longrightarrow i_m=48{,}6^{\textrm{o}} \quad(A=60{,}\ n=1,5)
\]
\newpage
\section{Dispersion d'un rayon de lumière blanche par le prisme}
Grâce à \verb+\multido+ il est possible de simuler très simplement le phénomène de dispersion lumineuse
en faisant variant la longueur d'onde dans le domaine visible :
\begin{example}
\multido{\iLAMBDA=400+5}{80}{%
  \pstVerb{/lambda \iLAMBDA\space def}%
\definecolor{prisme}{wave}{\iLAMBDA}%
\end{example}
\begin{center}
\psframebox[fillcolor=black,fillstyle=solid]{
\begin{pspicture}*(-7,-2)(7,8)
\pnode(0,0){O}
\pnode(!
    /AnglePrisme 30 def
    /AnglePlan1 19 def
    /AnglePlan2 54 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
    /u 1.5 def
%
    /g1x AnglePrisme sin neg def % -sin(A/2)
    /g1y AnglePrisme cos def     %  cos(A/2)
    /u1x AnglePlan1 sin neg def
    /u1y AnglePlan1 cos neg def
% le point E émetteur
    /E1x C1x u u1x mul add def
    /E1y C1y u 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_prisme}
\pspolygon[fillstyle=gradient,gradbegin=cyan,gradend=white,gradangle=60,gradmidpoint=0.5](O)%
        (! 7 90 AnglePrisme add cos mul 7 90 AnglePrisme add sin mul)
        (! 7 90 AnglePrisme sub cos mul 7 90 AnglePrisme sub sin mul)
\multido{\iLAMBDA=400+5}{80}{%
  \pstVerb{
    /lambda \iLAMBDA\space def
  }%
\definecolor{prisme}{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 AnglePrisme add def
    /sinB1 alpha1 sin N div def
    /B1 sinB1 asin def
    /Delta1 AnglePrisme B1 sub def
%%%
    /g2x AnglePrisme sin def
    /g2y AnglePrisme 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  AnglePrisme 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 AnglePrisme sub def
    /d2x Delta2 cos def
    /d2y Delta2 sin def
    /s2x i2x C2x sub def
    /s2y i2y C2y sub def
    /dA d2x u2y mul d2y u2x mul sub def
    /dM d2x s2y mul d2y s2x mul sub def
% le point R2
    /r2x C2x dM dA div u2x mul add def
    /r2y C2y dM dA div u2y mul add def
0 0){factice}
\pnode(! C1x C1y){C1}
\pnode(! C2x C2y){C2}
\pnode(! E1x E1y){E1}
\pnode(! i1x i1y){I1}
\pnode(! i2x i2y){I2}
\pnode(! r2x r2y){R2}
\psline[linecolor=prisme](I1)(I2)(R2)}
\psline[linecolor=white,linewidth=0.5mm](E1)(I1)
\psline[linecolor=white,linewidth=0.5mm,arrowscale=2]{->}(E1)(!i1x E1x add 2 div i1y E1y add 2 div)
\end{pspicture}}
\end{center}
\section{Extension possible}
À ce stade-là, on peut envisager une commande \verb+\prisme[...]+ où tous les paramètres
définis dans le cahier des charges pourront être facilement modifiés.
\end{document}