Total Internal Reflection

refractions={1->"vacuum",1.002->"air",1.31->"water ice",1.33->"water",1.36->"ethanol",1.491->"acrylic glass",1.516->"rock salt",1.525->"crown glass",1.61->"flint glass",2.419->"diamond"};

Manipulate[With[{a=aa Degree},With[{catf=Abs[Sin[a]]< Min[{r1,r2}]/Max[{r1,r2}]},
With[{outvec=If[r1>r2,
If[catf,3Pi/2+ArcSin[Sin[a](r1/r2)],Pi/2-a],
3Pi/2+ArcSin[Sin[a](r1/r2)]]},Graphics[{
GrayLevel[.5+.33/r1],Polygon[1.5{{-1,0},{-1,1},{1,1},{1,0}}],
GrayLevel[.5+.33/r2],Polygon[1.5{{-1,0},{-1,-1},{1,-1},{1,0}}],
Lighter[Orange,.5],
Disk[{0,0},1,{Min[Pi/2+a,Pi/2],Max[Pi/2,Min[Pi/2+a,Pi]]}],
Lighter[Cyan,.5],Disk[{0,0},1,
If[r1>r2,
If[a<0,
If[catf,{outvec,3Pi/2},{Pi/2,outvec}],If[catf,{3Pi/2,outvec},{outvec,Pi/2}]],
If[a<0,
{outvec,3Pi/2},{3Pi/2,outvec}]]],
Magenta,Arrow[{{0,0},-1.5 {Cos[Pi/2+a],Sin[Pi/2+a]}}],Thick,Red,Line[1.5{{-1,0},{1,0}}],
Green,Line[1.5{{0,1},{0,-1}}],
Blue,Arrow[{{Cos[Pi/2+a],Sin[Pi/2+a]},{0,0}}],Arrow[{{0,0},{Cos[outvec],Sin[outvec]}}]}]]]],{{r1,1.,"refraction above"},1,3,Appearance->"Labeled"},
{{r1,1.,"medium"},refractions},{{r2,1.33,"refraction below"},1,3,Appearance->"Labeled",ControlPlacement->Bottom},{{r2,1.33,"medium"},refractions,ControlPlacement->Bottom},{{aa,66,Dynamic@Column[{"incoming angle",aa},Center]},-90,90,ControlType->VerticalSlider,ImageSize->Large,ControlPlacement->Left},SaveDefinitions->True,AutorunSequencing->{1,3,5}]

CAPTION

A ray of light is bent on passing from air to a liquid because its wavefront moves more slowly in water than in air. This change in angle is proportional to the propagation velocities, which are often specified by giving the refractive indices of the materials. By definition, a vacuum has a refractive index of 1.

In passing from a slow to a fast medium, total reflection will occur if the angle between the incoming ray and the normal vector of the boundary surface is larger than the critical angle. In that case the incoming angle is equal to the outgoing angle.

The red line indicates the surface boundary which is hit by a ray, and the green line shows its normal vector. The angle between the ray and the surface normal is shown as an orange disk segment. The angle between refracted or reflected rays and the surface normal is shown as a cyan disk segment.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Total Internal Reflection" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/TotalInternalReflection/

Contributed by: Michael Schreiber

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »