(*Romain Fleury, EPFL, Avril 2020. Code pour visualiser la reflection et refraction des ondes EM à une interface entre deux milieux. θ est l'angle d'incidence. Il faut agrandir les quatre graphiques après avoir compilé.*)

Manipulate[{Graphics[{Thick,Blue,{Arrowheads[Large],Arrow[{{-(Sqrt[ϵr1 μr1])Cos[θ*Pi/180],-(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]},{0,0}}]},Thick,Black,{Arrowheads[Large],Arrow[{{0,0},{-(Sqrt[ϵr1 μr1])Cos[θ*Pi/180],(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]}}]},Green,{Arrowheads[Large],Arrow[{{0,0},{(Sqrt[ϵr2 μr2])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]],(Sqrt[ϵr2 μr2])Sin[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]]}}]},Dashed, Blue,{Arrowheads[Large],Arrow[{{-(Sqrt[ϵr1 μr1])Cos[θ*Pi/180],-(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]},{0,-(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]}}]},{Arrowheads[Large],Arrow[{{0,-(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]},{0,0}}]},Black,{Arrowheads[Large],Arrow[{{0,0},{-(Sqrt[ϵr1 μr1])Cos[θ*Pi/180],0}}]},{Arrowheads[Large],Arrow[{{-(Sqrt[ϵr1 μr1])Cos[θ*Pi/180],0},{-(Sqrt[ϵr1 μr1])Cos[θ*Pi/180],(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]}}]},
Green,{Arrowheads[Large],Arrow[{{(Sqrt[ϵr2 μr2])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]],0},{(Sqrt[ϵr2 μr2])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]],(Sqrt[ϵr1 μr1])Sin[θ*Pi/180]}}]},
Green,{Arrowheads[Large],Arrow[{{0,0},{(Sqrt[ϵr2 μr2])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]],0}}]},Blue, Dotted,Circle[{0,0},(Sqrt[ϵr1 μr1]),{-Pi,-Pi/2}],Black,Circle[{0,0},(Sqrt[ϵr1 μr1]),{Pi/2,Pi}],Green,Circle[{0,0},(Sqrt[ϵr2 μr2]),{0,Pi/2}]},
Axes->True,AxesLabel->{z,x},PlotRange->{{-1.5,1.5},{-1.5,1.5}},PlotLabel->{Incident: θ "°" , Transmis:ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]*180/Pi "°" }],
Plot[{100*(((Sqrt[((μr2)/(ϵr2))])Cos[t*Pi/180]-(Sqrt[((μr1)/(ϵr1))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[t*Pi/180]]])/((Sqrt[((μr2)/(ϵr2))])Cos[t*Pi/180]+(Sqrt[((μr1)/(ϵr1))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[t*Pi/180]]]))//Abs,100*(((Sqrt[((μr1)/(ϵr1))])Cos[t*Pi/180]-(Sqrt[((μr2)/(ϵr2))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[t*Pi/180]]])/((Sqrt[((μr1)/(ϵr1))])Cos[t*Pi/180]+(Sqrt[((μr2)/(ϵr2))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[t*Pi/180]]]))//Abs},{t,0,90},AxesLabel->{"Incidence (°) ","Reflection (%)"},PlotLabels->{Callout["TE",{Scaled[0.25],Above}],Callout["TM",{Scaled[0.25],Below}]},PlotLabel->{TE: 100.0*Abs[(((Sqrt[((μr2)/(ϵr2))])Cos[θ*Pi/180]-(Sqrt[((μr1)/(ϵr1))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]])/((Sqrt[((μr2)/(ϵr2))])Cos[θ*Pi/180]+(Sqrt[((μr1)/(ϵr1))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]])) ]"%" , TM: 100.0*Abs[(((Sqrt[((μr1)/(ϵr1))])Cos[θ*Pi/180]-(Sqrt[((μr2)/(ϵr2))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]])/((Sqrt[((μr1)/(ϵr1))])Cos[θ*Pi/180]+(Sqrt[((μr2)/(ϵr2))])Cos[ArcSin[(Sqrt[ϵr1 μr1])/(Sqrt[ϵr2 μr2])*Sin[θ*Pi/180]]]))] "%"},PlotRange->{{0,90},{0,100}},GridLines->{{{θ,Dashed}},{{-1,Orange},-.5,.5,{1,Orange}}}],
Show[Plot3D[Re[Exp[-I*(Sqrt[ϵr1 μr1])*2*Pi*(Cos[θ*Pi/180]*x+Sin[θ*Pi/180]*y)]+((1-((μr1)/(μr2))*((Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2]))/((Sqrt[ϵr1 μr1])*Cos[θ*Pi/180])))/(1+((μr1)/(μr2))*((Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2]))/((Sqrt[ϵr1 μr1])*Cos[θ*Pi/180]))))*Exp[-I*(Sqrt[ϵr1 μr1])*2*Pi*(-Cos[θ*Pi/180]*x+Sin[θ*Pi/180]*y)]],{x,-2,2},{y,-2,2},RegionFunction->Function[{x,y,z},x<0],PlotRange->{{-2,2},{-2,2}},ColorFunction->"BlueGreenYellow"],Plot3D[Re[((2/(1+((μr1)/(μr2))*((Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2]))/((Sqrt[ϵr1 μr1])*Cos[θ*Pi/180])))))*Exp[-I*2*Pi((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180]*y+Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2])*x)]],{x,-2,2},{y,-2,2},RegionFunction->Function[{x,y,z},x>0],PlotRange->Full,ColorFunction->"NeonColors"],PlotLabel->TE],
Show[Plot3D[Re[Exp[-I*(Sqrt[ϵr1 μr1])*2*Pi*(Cos[θ*Pi/180]*x+Sin[θ*Pi/180]*y)]+((1-((ϵr1)/(ϵr2))*((Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2]))/((Sqrt[ϵr1 μr1])*Cos[θ*Pi/180])))/(1+((ϵr1)/(ϵr2))*((Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2]))/((Sqrt[ϵr1 μr1])*Cos[θ*Pi/180]))))*Exp[-I*(Sqrt[ϵr1 μr1])*2*Pi*(-Cos[θ*Pi/180]*x+Sin[θ*Pi/180]*y)]],{x,-2,2},{y,-2,2},RegionFunction->Function[{x,y,z},x<0],PlotRange->{{-2,2},{-2,2}},ColorFunction->"BlueGreenYellow"],Plot3D[Re[((2/(1+((ϵr1)/(ϵr2))*((Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2]))/((Sqrt[ϵr1 μr1])*Cos[θ*Pi/180])))))*Exp[-I*2*Pi((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180]*y+Sign[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2](Sqrt[(ϵr2 μr2)^2-((Sqrt[ϵr1 μr1])*Sin[θ*Pi/180])^2])*x)]],{x,-2,2},{y,-2,2},RegionFunction->Function[{x,y,z},x>0],PlotRange->Full,ColorFunction->"NeonColors"],PlotLabel->TM]},{{θ,30},0,90},{{ϵr1,2},0,4},{{ϵr2,1},0,4},{{μr1,1},0,2},{{μr2,1},0,2}]