<<peeters` ;
peeters`setGitDir["../project/figures/ece1228-electromagnetic-theory"]
fs=Style[#,FontSize->14]&;

Plots that demonstrate the angle for total internal reflection (from Snell’s law).

ClearAll[thetaT]

thetaT[i_, ni_, nt_] = ArcSin[ Sin[i] ni/nt ] ;
p[ n1_, n2_] := Plot[ thetaT[i, n1, n2], {i, 0, Pi/2}, AxesLabel->{"(Subscript[θ, i])", Row[{"(Subscript[θ, t]), (Subscript[n, 1])/(Subscript[n, 2]) = ", n1/n2}]}, Ticks -> {{0, Pi/8, Pi/4, Pi/2}, {0, Pi/8, Pi/4, Pi/2}} 
] ;

Manipulate[ 
p[n1, n2]
,{{n1, 1, "(Subscript[n, 1])"}, 1, 10},{{n2, 1, "(Subscript[n, 2])"}, 1, 10}]

(*p1 = p[ 1, 2] 
p2 = p[2, 1]*)
p3 = Plot[ {thetaT[i, 1,2],thetaT[i, 2,1]}, {i, 0, Pi/2}, AxesLabel->{"(Subscript[θ, i])"//fs, "(Subscript[θ, t])"//fs}, Ticks -> {{0, Pi/8, Pi/4, Pi/2}, {0, Pi/8, Pi/4, Pi/2}} ,
PlotStyle-> Thick,
PlotLegends->Placed[ {"(Subscript[n, i])/(Subscript[n, t]) = 1/2"//fs, "(Subscript[n, i])/(Subscript[n, t]) = 2"//fs}, {Left, Top}], PlotRange -> Full 
]

peeters`exportForLatex["reflectionForN2gtN1Fig1", p1]
peeters`exportForLatex["reflectionForN1gtN2TotalInternalReflectionFig2", p2]
peeters`exportForLatex["reflectionForBothFig3", p3]