(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 143637, 3331] NotebookOptionsPosition[ 143141, 3311] NotebookOutlinePosition[ 143513, 3327] CellTagsIndexPosition[ 143470, 3324] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"locator", "'"}], "s", " ", "vertical", " ", "position", " ", "for", " ", "the", " ", "incident", " ", RowBox[{"height", " ", "'"}], RowBox[{"d", "'"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "horizontal", " ", "position", " ", "for", " ", "the", " ", "ray"}], "-", RowBox[{"line", " ", RowBox[{"thickness", " ", "'"}], RowBox[{"th", "'"}], " ", "between", " ", "0", " ", "and", " ", ".01"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"ref", "=", "1"}], ";", RowBox[{"(*", "\"\\"", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{"Qangle", ",", RowBox[{"Which", "[", RowBox[{ RowBox[{"nr", "==", "0"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "1.0"}], "}"}]}], ",", RowBox[{"nr", "\[Equal]", "1"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.86"}], "}"}]}], ",", RowBox[{"nr", "\[Equal]", "2"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.946"}]}], "}"}]}], ",", RowBox[{"nr", "\[Equal]", "3"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.973"}]}], "}"}]}], ",", RowBox[{"nr", "\[Equal]", "4"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.98337"}], "}"}]}], ",", RowBox[{"nr", "\[Equal]", "5"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.988627"}], "}"}]}], ",", RowBox[{"nr", "\[Equal]", "6"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.99172"}]}], "}"}]}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"d", "=", RowBox[{"h", "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"nRays", "=", RowBox[{"If", "[", RowBox[{"ray1", ",", "1"}], "]"}]}], ";"}], "*)"}], "\[IndentingNewLine]", RowBox[{"th", "=", RowBox[{ FractionBox[".01", "3"], " ", RowBox[{"(", RowBox[{ RowBox[{"h", "[", RowBox[{"[", "1", "]"}], "]"}], "+", "5"}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"r01", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"r02", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n0"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"nr", "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"r03", "=", RowBox[{"r02", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r02", "-", "r01"}], "]"}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"r03", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r02"}], "]"}], "[", "r01", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r04", "=", RowBox[{"r03", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r03", "-", "r02"}], "]"}]}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "2"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"r03", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r02"}], "]"}], "[", "r01", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r04", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r03"}], "]"}], "[", "r02", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r05", "=", RowBox[{"r04", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r04", "-", "r03"}], "]"}]}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "3"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"r03", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r02"}], "]"}], "[", "r01", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r04", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r03"}], "]"}], "[", "r02", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r05", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r04"}], "]"}], "[", "r03", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r06", "=", RowBox[{"r05", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r05", "-", "r04"}], "]"}]}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "4"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"r03", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r02"}], "]"}], "[", "r01", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r04", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r03"}], "]"}], "[", "r02", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r05", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r04"}], "]"}], "[", "r03", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r06", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r05"}], "]"}], "[", "r04", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r07", "=", RowBox[{"r06", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r06", "-", "r05"}], "]"}]}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "5"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"r03", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r02"}], "]"}], "[", "r01", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r04", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r03"}], "]"}], "[", "r02", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r05", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r04"}], "]"}], "[", "r03", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r06", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r05"}], "]"}], "[", "r04", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r07", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r06"}], "]"}], "[", "r05", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r08", "=", RowBox[{"r07", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r07", "-", "r06"}], "]"}]}]}]}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "6"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"r03", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r02"}], "]"}], "[", "r01", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r04", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r03"}], "]"}], "[", "r02", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r05", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r04"}], "]"}], "[", "r03", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r06", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r05"}], "]"}], "[", "r04", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r07", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r06"}], "]"}], "[", "r05", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r08", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}]}], ",", "r07"}], "]"}], "[", "r06", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"r09", "=", RowBox[{"r08", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n0"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r08", "-", "r07"}], "]"}]}]}]}]}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"nr", "\[Equal]", "0"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r3", "=", RowBox[{"r2", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r2", "-", "r1"}], "]"}]}]}]}]}], " ", "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r3", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r2"}], "]"}], "[", "r1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r4", "=", RowBox[{"r3", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r3", "-", "r2"}], "]"}]}]}]}]}], " ", "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"1.4", "r3"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "2"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r3", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r2"}], "]"}], "[", "r1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r4", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r3"}], "]"}], "[", "r2", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"the", " ", "end"}], " ", "*)"}], RowBox[{"r5", "=", RowBox[{"r4", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r4", "-", "r3"}], "]"}]}]}]}]}], "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r1", "/", "3"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r2", "/", "3"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r3", "/", "3"}], ",", RowBox[{"1.4", "r3"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r4", "/", "3"}], ",", RowBox[{"1.4", "r4"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r5", "/", "3"}], ",", RowBox[{"1.4", "r5"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "3"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r3", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r2"}], "]"}], "[", "r1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r4", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r3"}], "]"}], "[", "r2", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r5", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r4"}], "]"}], "[", "r3", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"the", " ", "end"}], " ", "*)"}], RowBox[{"r6", "=", RowBox[{"r5", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r5", "-", "r4"}], "]"}]}]}]}]}], "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r1", "/", "3"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r2", "/", "3"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r3", "/", "3"}], ",", RowBox[{"1.4", "r3"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r4", "/", "3"}], ",", RowBox[{"1.4", "r4"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r5", "/", "3"}], ",", RowBox[{"1.4", "r5"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r6", "/", "3"}], ",", RowBox[{"1.4", "r6"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "4"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r3", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r2"}], "]"}], "[", "r1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r4", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r3"}], "]"}], "[", "r2", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r5", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r4"}], "]"}], "[", "r3", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r6", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r5"}], "]"}], "[", "r4", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"the", " ", "end"}], " ", "*)"}], RowBox[{"r7", "=", RowBox[{"r6", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r6", "-", "r5"}], "]"}]}]}]}]}], "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r1", "/", "3"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r2", "/", "3"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r3", "/", "3"}], ",", RowBox[{"1.4", "r3"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r4", "/", "3"}], ",", RowBox[{"1.4", "r4"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r5", "/", "3"}], ",", RowBox[{"1.4", "r5"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r6", "/", "3"}], ",", RowBox[{"1.4", "r6"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r7", "/", "3"}], ",", RowBox[{"1.4", "r7"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "5"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"r3", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r2"}], "]"}], "[", "r1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r4", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r3"}], "]"}], "[", "r2", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r5", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r4"}], "]"}], "[", "r3", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r6", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r5"}], "]"}], "[", "r4", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r7", "=", RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r6"}], "]"}], "[", "r5", "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"the", " ", "end"}], " ", "*)"}], RowBox[{"r8", "=", RowBox[{"r7", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r7", "-", "r6"}], "]"}]}]}]}]}], "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r1", "/", "3"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r2", "/", "3"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r3", "/", "3"}], ",", RowBox[{"1.4", "r3"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r4", "/", "3"}], ",", RowBox[{"1.4", "r4"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r5", "/", "3"}], ",", RowBox[{"1.4", "r5"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r6", "/", "3"}], ",", RowBox[{"1.4", "r6"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r7", "/", "3"}], ",", RowBox[{"1.4", "r7"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r8", "/", "3"}], ",", RowBox[{"1.4", "r8"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "6"}], ",", "\[IndentingNewLine]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Lighter", "[", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", ".6"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", "Blue", ",", RowBox[{"Circle", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "th", "]"}], ",", RowBox[{"GrayLevel", "[", ".7", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"mother", " ", "ray", " ", "starts"}], " ", "..."}], " ", "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "7"}], ",", "d"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"penetrates", " ", "..."}], " ", "*)"}], RowBox[{"r1", "=", RowBox[{"{", RowBox[{ RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}], ",", "d"}], "}"}]}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"unweaves", " ", "to", " ", "children", " ", "rays"}], " ", "..."}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"n", "=", RowBox[{ RowBox[{"ref", " ", RowBox[{"(", RowBox[{ RowBox[{"indexLength", "[", "\[Lambda]", "]"}], "-", "1.338"}], ")"}]}], "+", "n0"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"ref", "\[Equal]", "0"}], "||", RowBox[{"nRays", "\[Equal]", "1"}]}], ",", RowBox[{"Hue", "[", RowBox[{"0.8", RowBox[{ RowBox[{"(", RowBox[{"n0", "-", "1.332"}], ")"}], "/", "0.011"}]}], "]"}], ",", RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\[Lambda]", "]"}]}], "]"}]}], ",", RowBox[{"Line", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"refraction", " ", RowBox[{"I", "."}]}], " ", "*)"}], RowBox[{"r1", ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "backreflection", " ", "*)"}], RowBox[{"r2", "=", RowBox[{"backReflection1", "[", RowBox[{"d", ",", "n"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r3", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r2"}], "]"}], "[", "r1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r4", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r3"}], "]"}], "[", "r2", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r5", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r4"}], "]"}], "[", "r3", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r6", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r5"}], "]"}], "[", "r4", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r7", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r6"}], "]"}], "[", "r5", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", "*)"}], RowBox[{"r8", "=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"2", " ", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", "r7"}], "]"}], "[", "r6", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"the", " ", "end"}], " ", "*)"}], RowBox[{"r9", "=", RowBox[{"r8", "+", RowBox[{"10", " ", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}], "-", RowBox[{"ArcSin", "[", "d", "]"}]}], "]"}], "[", RowBox[{"r8", "-", "r7"}], "]"}]}]}]}]}], "}"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"\[Lambda]", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "400"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "550", ",", "680"}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", "1", ",", RowBox[{"280", "/", RowBox[{"(", RowBox[{"nRays", "-", "1"}], ")"}]}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Thickness", "[", "0.001", "]"}], ",", "Black", ",", "Dashed", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r1", "/", "3"}], ",", RowBox[{"1.4", "r1"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r2", "/", "3"}], ",", RowBox[{"1.4", "r2"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r3", "/", "3"}], ",", RowBox[{"1.4", "r3"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r4", "/", "3"}], ",", RowBox[{"1.4", "r4"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r5", "/", "3"}], ",", RowBox[{"1.4", "r5"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r6", "/", "3"}], ",", RowBox[{"1.4", "r6"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r7", "/", "3"}], ",", RowBox[{"1.4", "r7"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r8", "/", "3"}], ",", RowBox[{"1.4", "r8"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"r9", "/", "3"}], ",", RowBox[{"1.4", "r9"}]}], "}"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", "1.8"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "1.2"}], "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"ImageSize", "\[Rule]", "600"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"Axes", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Prolog", "\[Rule]", RowBox[{"If", "[", RowBox[{ RowBox[{"inf", "&&", " ", RowBox[{"(", RowBox[{ RowBox[{"Abs", "[", RowBox[{"n0", "-", "1.338"}], "]"}], "<", "0.001"}], ")"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"nr", "\[Equal]", "0"}], ",", "\"\\"", " ", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "1"}], ",", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "2"}], ",", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "3"}], ",", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "4"}], ",", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "5"}], ",", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "6"}], ",", "\"\\""}], " ", "\[IndentingNewLine]", "]"}], ",", "16", ",", "Bold"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5"}], ",", "1.1"}], "}"}]}], " ", "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Which", "[", RowBox[{ RowBox[{"inf", "&&", RowBox[{"nr", "\[Equal]", "1"}]}], ",", "\"\\"", ",", RowBox[{"inf", "&&", RowBox[{"nr", "\[Equal]", "2"}]}], ",", "\"\\"", ",", "True", ",", "\"\<\>\""}], "]"}], ",", "16", ",", "Bold"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5"}], ",", "1.1"}], "}"}]}], " ", "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{"Gray", ",", RowBox[{"If", "[", RowBox[{"inf", ",", RowBox[{"Text", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Which", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"nr", "\[Equal]", "0"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(0\)]\) = \>\"", "<>", " ", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"-", RowBox[{"(", RowBox[{ RowBox[{"r03", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r02", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "/", RowBox[{"(", RowBox[{ RowBox[{"r03", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r02", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", " ", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}], " ", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "1"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(1\)]\) = \>\"", "<>", " ", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"r04", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r03", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"r04", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r03", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", " ", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}], " ", ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "2"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(2\)]\) = \>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"r05", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r04", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"r05", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r04", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", " ", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "3"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(3\)]\) = \>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"-", RowBox[{"(", RowBox[{ RowBox[{"r06", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r05", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "/", RowBox[{"(", RowBox[{ RowBox[{"r06", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r05", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", " ", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "4"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(4\)]\) = \>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"-", RowBox[{"(", RowBox[{ RowBox[{"r07", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r06", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "/", RowBox[{"(", RowBox[{ RowBox[{"r07", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r06", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", " ", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "5"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(5\)]\) = \>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"r08", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r07", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"r08", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r07", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", " ", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"nr", "\[Equal]", "6"}], ",", RowBox[{ "\"\<\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(6\)]\) = \>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{ RowBox[{ RowBox[{"180", "/", "Pi"}], " ", RowBox[{"ArcTan", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"r09", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"r08", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"r09", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"r08", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "]"}]}], ",", "0.01"}], "]"}], "]"}], "<>", "\"\<\[Degree]\>\"", "<>", "\"\< y=\>\"", "<>", RowBox[{"ToString", "[", RowBox[{"Round", "[", RowBox[{"d", ",", "0.001"}], "]"}], "]"}]}]}], "\[IndentingNewLine]", " ", "]"}], ",", "16", ",", "Bold"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.5"}], ",", "0.5"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"source", "[", RowBox[{"h", ",", "0.1"}], "]"}]}], "\[IndentingNewLine]", "}"}]}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"h", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3.8"}], ",", RowBox[{"(*", RowBox[{"3", "-", RowBox[{"2", "nr"}]}], "*)"}], " ", "0.75"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", RowBox[{"-", " ", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.5"}], ",", "1"}], "}"}], ",", "Locator"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Row", "[", RowBox[{"{", RowBox[{"(*", RowBox[{ RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ref", ",", "1", ",", "\"\\""}], "}"}], ",", "0", ",", "5", ",", "1", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}], ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "]"}], ","}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"nRays", ",", "20", ",", "\"\\""}], "}"}], ",", "1", ",", "50", ",", "1", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}], ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n0", ",", "1.338", ",", "\"\\""}], "}"}], ",", "0.76", ",", "2", ",", "0.002", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}], ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}], ",", " ", RowBox[{"Enabled", "\[Rule]", "True"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n0", ",", "1.338", ",", "\"\<\>\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1.338", "\[Rule]", " ", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "11"}], "]"}]}], ",", " ", RowBox[{"1.5", "\[Rule]", " ", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", " ", "11"}], "]"}]}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "Setter"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"inf", ",", " ", "False", ",", " ", "\"\< info\>\""}], "}"}], ",", " ", RowBox[{"{", RowBox[{"True", ",", " ", "False"}], "}"}]}], "}"}], "]"}]}], "\[IndentingNewLine]", "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Row", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"nr", ",", "1", ",", "\"\< rainbow\>\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"0", "\[Rule]", "\"\<0\>\""}], ",", RowBox[{"1", "\[Rule]", "\"\<1\>\""}], ",", RowBox[{"2", "\[Rule]", "\"\<2\>\""}], ",", RowBox[{"3", "\[Rule]", "\"\<3\>\""}], ",", RowBox[{"4", "\[Rule]", "\"\<4\>\""}], ",", RowBox[{"5", "\[Rule]", "\"\<5\>\""}], ",", RowBox[{"6", "\[Rule]", "\"\<6\>\""}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "Setter"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "Qangle", ",", " ", "False", ",", " ", "\"\< crucial angle\>\""}], "}"}], ",", " ", RowBox[{"{", RowBox[{"True", ",", " ", "False"}], "}"}]}], "}"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n0", ",", "1.338", ",", "\"\< colour \>\""}], "}"}], ",", RowBox[{"{", RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"1.33", "/", "1.00022"}], "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\<\:0406\:0427\>\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", RowBox[{"RGBColor", "[", RowBox[{"0.2", ",", "0", ",", "0"}], "]"}]}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ","}], "*)"}], RowBox[{ RowBox[{ RowBox[{"1.3312", "/", "1.00022"}], "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", "Red"}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ",", RowBox[{"1.3335", "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", "Orange"}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ",", RowBox[{"1.3342", "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", "Yellow"}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ",", RowBox[{"1.338", "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], " ", ",", RowBox[{"{", RowBox[{"Bold", ",", "Green"}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ",", RowBox[{"1.340", "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", RowBox[{"Hue", "[", "0.53", "]"}]}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ",", RowBox[{"1.3415", "\[Rule]", RowBox[{"Style", "[", " ", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", RowBox[{"Hue", "[", "0.7", "]"}]}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}], ",", RowBox[{ RowBox[{"1.3435", "/", "1.00028"}], "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"Bold", ",", RowBox[{"Hue", "[", "0.88", "]"}]}], "}"}], ",", "Black"}], "]"}], ",", "13"}], "]"}]}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "Setter"}], ",", RowBox[{"Enabled", "\[Rule]", RowBox[{ RowBox[{"nRays", "\[Equal]", "1"}], " ", "&&", " ", RowBox[{ RowBox[{"Abs", "[", RowBox[{"n0", "-", "1.338"}], "]"}], "<", "0.01"}]}]}]}], "}"}], "]"}]}], "\[IndentingNewLine]", "}"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Initialization", "\[RuleDelayed]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"source", "[", RowBox[{ RowBox[{"{", RowBox[{"x0_", ",", "y0_"}], "}"}], ",", "r0_"}], "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"Hue", "[", "0.12", "]"}], ",", RowBox[{"Disk", "[", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", "r0"}], "]"}], ",", RowBox[{"Thickness", "[", "0.002", "]"}], ",", RowBox[{"Arrowheads", "[", "0.02", "]"}], ",", " ", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x0", "+", RowBox[{"3", "r0"}]}], ",", "y0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x0", "-", RowBox[{"2", "r0"}]}], ",", "y0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{"x0", ",", RowBox[{"y0", "+", RowBox[{"2", "r0"}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{"x0", ",", RowBox[{"y0", "-", RowBox[{"2", "r0"}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x0", "-", RowBox[{"1.6", "r0"}]}], ",", RowBox[{"y0", "-", RowBox[{"1.6", "r0"}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x0", "+", RowBox[{"1.6", "r0"}]}], ",", RowBox[{"y0", "-", RowBox[{"1.6", "r0"}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x0", "-", RowBox[{"1.6", "r0"}]}], ",", RowBox[{"y0", "+", RowBox[{"1.6", "r0"}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x0", ",", "y0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"x0", "+", RowBox[{"1.6", "r0"}]}], ",", RowBox[{"y0", "+", RowBox[{"1.6", "r0"}]}]}], "}"}]}], "}"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "water", " ", "refractive", " ", "index", " ", "as", " ", "a", " ", "function", " ", "of", " ", "wavelength"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"indexLength", "=", RowBox[{"Interpolation", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"303.4", ",", RowBox[{"1.3581", "/", "1.0003"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"380", ",", RowBox[{"1.3447", "/", "1.0003"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"396.847", ",", RowBox[{"1.3435", "/", "1.00029"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"434.047", ",", RowBox[{"1.3404", "/", "1.00029"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"486.134", ",", RowBox[{"1.3372", "/", "1.00028"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"589.3", ",", RowBox[{"1.3330", "/", "1.00028"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"656.281", ",", RowBox[{"1.3312", "/", "1.00027"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"700", ",", RowBox[{"1.3303", "/", "1.00027"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"1256", ",", RowBox[{"1.321", "/", "1.00026"}]}], "}"}]}], "\[IndentingNewLine]", "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "point", " ", "of", " ", "reflection", " ", "off", " ", "the", " ", "raindrop", " ", "back"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"backReflection1", "=", RowBox[{"Compile", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"d", ",", "_Real"}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", "_Real"}], "}"}]}], "}"}], ",", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"\[Alpha]", "=", RowBox[{"ArcSin", "[", "d", "]"}]}], ",", RowBox[{"\[Beta]", "=", RowBox[{"ArcSin", "[", RowBox[{"d", "/", "n"}], "]"}]}], ",", RowBox[{"x1", "=", RowBox[{"-", SqrtBox[ RowBox[{"1", "-", SuperscriptBox["d", "2"]}]]}]}], ",", RowBox[{"y1", "=", "d"}], ",", RowBox[{"k1", "=", RowBox[{"Tan", "[", RowBox[{"\[Alpha]", "-", "\[Beta]"}], "]"}]}], ",", "x2"}], "}"}], ",", RowBox[{ RowBox[{"x2", "=", FractionBox[ RowBox[{ RowBox[{"k1", RowBox[{"(", RowBox[{ RowBox[{"k1", " ", "x1"}], "+", "y1"}], ")"}]}], "+", SqrtBox[ RowBox[{"1", "+", SuperscriptBox["k1", "2"], "-", SuperscriptBox[ RowBox[{"(", RowBox[{ RowBox[{"k1", " ", "x1"}], "+", "y1"}], ")"}], "2"]}]]}], RowBox[{"1", "+", SuperscriptBox["k1", "2"]}]]}], ";", " ", RowBox[{"{", RowBox[{"x2", ",", RowBox[{"y1", "-", RowBox[{"k1", RowBox[{"(", RowBox[{"x2", "-", "x1"}], ")"}]}]}]}], "}"}]}]}], "]"}]}], "]"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "}"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Bookmarks", "\[Rule]", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "0"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "1.0"}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "1"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.86"}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "2"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.946"}]}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "3"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.973"}]}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "4"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.98337"}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "5"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.988627"}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "6"}], ",", RowBox[{"n0", "=", "1.338"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.99172"}]}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "1"}], ",", RowBox[{"n0", "=", "1.5"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", "0.765"}], "}"}]}]}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"\"\\"", "\[RuleDelayed]", RowBox[{"{", RowBox[{ RowBox[{"ref", "=", "1"}], ",", RowBox[{"nRays", "=", "20"}], ",", RowBox[{"nr", "=", "2"}], ",", RowBox[{"n0", "=", "1.5"}], ",", RowBox[{"h", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "3.9"}], ",", RowBox[{"-", "0.922"}]}], "}"}]}]}], "}"}]}]}], "\[IndentingNewLine]", "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"TrackedSymbols", "\[RuleDelayed]", RowBox[{"{", RowBox[{ "ref", ",", "nRays", ",", "nr", ",", "inf", ",", "h", ",", "n0", ",", "ray1", ",", "Qangle"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.8523018894849586`*^9, 3.852301890914966*^9}, { 3.8523020612880907`*^9, 3.852302071632349*^9}, {3.852302325360301*^9, 3.852302353615351*^9}, {3.8523024414788647`*^9, 3.8523024462870536`*^9}, { 3.852302500928356*^9, 3.8523025202478547`*^9}, {3.85230297420893*^9, 3.85230297683184*^9}, {3.8523030172554736`*^9, 3.852303018486791*^9}, 3.852303057433977*^9, {3.852360189854925*^9, 3.852360261409026*^9}, { 3.852360399946803*^9, 3.8523604049964285`*^9}, {3.85236073340736*^9, 3.852360795950137*^9}, {3.852372573363985*^9, 3.852372577825804*^9}, { 3.852372692934688*^9, 3.8523726957965465`*^9}, {3.8523727693626013`*^9, 3.852372802500614*^9}, {3.852372846301908*^9, 3.8523728668004265`*^9}, { 3.8523729409177146`*^9, 3.852373129091015*^9}, {3.852373163868681*^9, 3.852373232980096*^9}, {3.852373307385129*^9, 3.8523733900623937`*^9}, { 3.8523734651689024`*^9, 3.8523735028191833`*^9}, {3.852373837327418*^9, 3.85237388244305*^9}, 3.8523739832704325`*^9, 3.852374071684373*^9, { 3.8523741087393413`*^9, 3.8523742289525084`*^9}, {3.8523743569354153`*^9, 3.8523744183378534`*^9}, {3.8523744827262273`*^9, 3.852374488002766*^9}, { 3.8523745393654394`*^9, 3.8523745438491955`*^9}, {3.85238576280484*^9, 3.8523857914591656`*^9}, {3.8523858444359093`*^9, 3.852385850154506*^9}, { 3.8523858993289275`*^9, 3.8523859027151237`*^9}, {3.852385935942317*^9, 3.85238597398007*^9}, {3.8523860042075634`*^9, 3.85238605358943*^9}, 3.8523861999132447`*^9, {3.8523863757653685`*^9, 3.852386413710727*^9}, { 3.852386570741761*^9, 3.8523865760078154`*^9}, {3.8523866232664366`*^9, 3.852386624463397*^9}, {3.8523867043978415`*^9, 3.852386734420628*^9}, { 3.852386794378282*^9, 3.8523868179952035`*^9}, {3.852386945326378*^9, 3.8523869945271096`*^9}, {3.8523871427671585`*^9, 3.8523872022289314`*^9}, {3.852387243471314*^9, 3.85238727512764*^9}, { 3.8523927845201445`*^9, 3.8523927904901953`*^9}, 3.861873407252461*^9, { 3.8618734475753775`*^9, 3.861873452674515*^9}, 3.861873486150879*^9, { 3.861873527296505*^9, 3.8618736057939525`*^9}, {3.861873676181676*^9, 3.8618737670819664`*^9}, {3.8618738032609034`*^9, 3.8618738098808355`*^9}, {3.861873871323444*^9, 3.8618739500503855`*^9}, { 3.8618739826757727`*^9, 3.861873988354165*^9}, {3.8618740359517813`*^9, 3.861874040709693*^9}, {3.861874085984336*^9, 3.8618741494664755`*^9}, { 3.861874180494548*^9, 3.86187425866518*^9}, {3.861874460994584*^9, 3.861874471860334*^9}, {3.8618745306189556`*^9, 3.8618745418269587`*^9}, { 3.861877200010751*^9, 3.8618772091578393`*^9}, 3.861877338141003*^9}, CellID->22838252,ExpressionUUID->"e34a958f-bacf-4786-9251-b61b18ad9f99"], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`h$$ = {-3.9, -0.946}, $CellContext`inf$$ = True, $CellContext`n0$$ = 1.338, $CellContext`nr$$ = 2, $CellContext`nRays$$ = 20, $CellContext`Qangle$$ = True, Typeset`show$$ = True, Typeset`bookmarkList$$ = { "\"rainbow 0\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 0, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, 1.}}, "\"rainbow 1\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 1, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, 0.86}}, "\"rainbow 2\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 2, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, -0.946}}, "\"rainbow 3\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 3, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, -0.973}}, "\"rainbow 4\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 4, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, 0.98337}}, "\"rainbow 5\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 5, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, 0.988627}}, "\"rainbow 6\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 6, $CellContext`n0$$ = 1.338, $CellContext`h$$ = {-3.9, -0.99172}}, "\"rainbow 1 for glass sphere\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 1, $CellContext`n0$$ = 1.5, $CellContext`h$$ = {-3.9, 0.765}}, "\"rainbow 2 for glass sphere\"" :> {$CellContext`ref = 1, $CellContext`nRays$$ = 20, $CellContext`nr$$ = 2, $CellContext`n0$$ = 1.5, $CellContext`h$$ = {-3.9, -0.922}}}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`h$$], {-3.8, 0.75}}, {-4, -1}, {-2.5, 1}}, {{ Hold[$CellContext`nRays$$], 20, "number of rays"}, 1, 50, 1}, {{ Hold[$CellContext`n0$$], 1.338, "refraction coefficient"}, 0.76, 2, 0.002}, {{ Hold[$CellContext`n0$$], 1.338, ""}, { 1.338 -> Style["Water", 11], 1.5 -> Style["Glass", 11]}}, {{ Hold[$CellContext`inf$$], False, " info"}, {True, False}}, { Hold[ Row[{ Manipulate`Place[1], Manipulate`Place[2], Manipulate`Place[3], Manipulate`Place[4]}]], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`nr$$], 1, " rainbow"}, { 0 -> "0", 1 -> "1", 2 -> "2", 3 -> "3", 4 -> "4", 5 -> "5", 6 -> "6"}}, {{ Hold[$CellContext`Qangle$$], False, " crucial angle"}, { True, False}}, {{ Hold[$CellContext`n0$$], 1.338, " colour "}, Dynamic[{1.3312/1.00022 -> Style["red", If[$CellContext`nRays$$ == 1, {Bold, Red}, Black], 13], 1.3335 -> Style["orange", If[$CellContext`nRays$$ == 1, {Bold, Orange}, Black], 13], 1.3342 -> Style["yellow", If[$CellContext`nRays$$ == 1, {Bold, Yellow}, Black], 13], 1.338 -> Style["green", If[$CellContext`nRays$$ == 1, {Bold, Green}, Black], 13], 1.34 -> Style["blue", If[$CellContext`nRays$$ == 1, {Bold, Hue[0.53]}, Black], 13], 1.3415 -> Style["indigo", If[$CellContext`nRays$$ == 1, {Bold, Hue[0.7]}, Black], 13], 1.3435/1.00028 -> Style["violet", If[$CellContext`nRays$$ == 1, {Bold, Hue[0.88]}, Black], 13]}]}, { Hold[ Row[{ Manipulate`Place[5], Manipulate`Place[6], Manipulate`Place[7]}]], Manipulate`Dump`ThisIsNotAControl}}, Typeset`size$$ = {900., {244., 253.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`h$1069822$$ = {0, 0}, $CellContext`nRays$1069823$$ = 0, $CellContext`n0$1069824$$ = 0, $CellContext`inf$1069825$$ = False, $CellContext`nr$1069826$$ = False, $CellContext`Qangle$1069827$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 2, StandardForm, "Variables" :> {$CellContext`h$$ = {-3.8, 0.75}, $CellContext`inf$$ = False, $CellContext`n0$$ = 1.338, $CellContext`nr$$ = 1, $CellContext`nRays$$ = 20, $CellContext`Qangle$$ = False}, "ControllerVariables" :> { Hold[$CellContext`h$$, $CellContext`h$1069822$$, {0, 0}], Hold[$CellContext`nRays$$, $CellContext`nRays$1069823$$, 0], Hold[$CellContext`n0$$, $CellContext`n0$1069824$$, 0], Hold[$CellContext`inf$$, $CellContext`inf$1069825$$, False], Hold[$CellContext`nr$$, $CellContext`nr$1069826$$, False], Hold[$CellContext`Qangle$$, $CellContext`Qangle$1069827$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> ($CellContext`ref = 1; If[$CellContext`Qangle$$, Which[$CellContext`nr$$ == 0, $CellContext`h$$ = {-3.9, 1.}, $CellContext`nr$$ == 1, $CellContext`h$$ = {-3.9, 0.86}, $CellContext`nr$$ == 2, $CellContext`h$$ = {-3.9, -0.946}, $CellContext`nr$$ == 3, $CellContext`h$$ = {-3.9, -0.973}, $CellContext`nr$$ == 4, $CellContext`h$$ = {-3.9, 0.98337}, $CellContext`nr$$ == 5, $CellContext`h$$ = {-3.9, 0.988627}, $CellContext`nr$$ == 6, $CellContext`h$$ = {-3.9, -0.99172}]]; $CellContext`d = Part[$CellContext`h$$, 2]; $CellContext`th = (0.01/3) ( Part[$CellContext`h$$, 1] + 5); $CellContext`r01 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}; $CellContext`r02 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n0$$]; Which[$CellContext`nr$$ == 0, $CellContext`r03 = $CellContext`r02 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r02 - $CellContext`r01], \ $CellContext`nr$$ == 1, $CellContext`r03 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r02][$CellContext`r01]; $CellContext`r04 = $CellContext`r03 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r03 - $CellContext`r02], \ $CellContext`nr$$ == 2, $CellContext`r03 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r02][$CellContext`r01]; $CellContext`r04 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r03][$CellContext`r02]; $CellContext`r05 = $CellContext`r04 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r04 - $CellContext`r03], \ $CellContext`nr$$ == 3, $CellContext`r03 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r02][$CellContext`r01]; $CellContext`r04 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r03][$CellContext`r02]; $CellContext`r05 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r04][$CellContext`r03]; $CellContext`r06 = $CellContext`r05 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r05 - $CellContext`r04], \ $CellContext`nr$$ == 4, $CellContext`r03 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r02][$CellContext`r01]; $CellContext`r04 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r03][$CellContext`r02]; $CellContext`r05 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r04][$CellContext`r03]; $CellContext`r06 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r05][$CellContext`r04]; $CellContext`r07 = $CellContext`r06 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r06 - $CellContext`r05], \ $CellContext`nr$$ == 5, $CellContext`r03 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r02][$CellContext`r01]; $CellContext`r04 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r03][$CellContext`r02]; $CellContext`r05 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r04][$CellContext`r03]; $CellContext`r06 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r05][$CellContext`r04]; $CellContext`r07 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r06][$CellContext`r05]; $CellContext`r08 = $CellContext`r07 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r07 - $CellContext`r06], \ $CellContext`nr$$ == 6, $CellContext`r03 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r02][$CellContext`r01]; $CellContext`r04 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r03][$CellContext`r02]; $CellContext`r05 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r04][$CellContext`r03]; $CellContext`r06 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r05][$CellContext`r04]; $CellContext`r07 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r06][$CellContext`r05]; $CellContext`r08 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n0$$], \ $CellContext`r07][$CellContext`r06]; $CellContext`r09 = $CellContext`r08 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n0$$] - ArcSin[$CellContext`d]][$CellContext`r08 - $CellContext`r07]]; Graphics[ Which[$CellContext`nr$$ == 0, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = \ $CellContext`r2 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r2 - \ $CellContext`r1]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{{0, 0}, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{{0, 0}, 1.4 $CellContext`r2}]]}, $CellContext`nr$$ == 1, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r2][$CellContext`r1], $CellContext`r4 = $CellContext`r3 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r3 - \ $CellContext`r2]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{{0, 0}, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{{0, 0}, 1.4 $CellContext`r2}]], If[$CellContext`inf$$, Line[{{0, 0}, 1.4 $CellContext`r3}]]}, $CellContext`nr$$ == 2, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r2][$CellContext`r1], $CellContext`r4 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r3][$CellContext`r2], $CellContext`r5 = $CellContext`r4 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r4 - \ $CellContext`r3]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{$CellContext`r1/3, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{$CellContext`r2/3, 1.4 $CellContext`r2}]], If[$CellContext`inf$$, Line[{$CellContext`r3/3, 1.4 $CellContext`r3}]], If[$CellContext`inf$$, Line[{$CellContext`r4/3, 1.4 $CellContext`r4}]], If[$CellContext`inf$$, Line[{$CellContext`r5/3, 1.4 $CellContext`r5}]]}, $CellContext`nr$$ == 3, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r2][$CellContext`r1], $CellContext`r4 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r3][$CellContext`r2], $CellContext`r5 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r4][$CellContext`r3], $CellContext`r6 = $CellContext`r5 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r5 - \ $CellContext`r4]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{$CellContext`r1/3, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{$CellContext`r2/3, 1.4 $CellContext`r2}]], If[$CellContext`inf$$, Line[{$CellContext`r3/3, 1.4 $CellContext`r3}]], If[$CellContext`inf$$, Line[{$CellContext`r4/3, 1.4 $CellContext`r4}]], If[$CellContext`inf$$, Line[{$CellContext`r5/3, 1.4 $CellContext`r5}]], If[$CellContext`inf$$, Line[{$CellContext`r6/3, 1.4 $CellContext`r6}]]}, $CellContext`nr$$ == 4, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r2][$CellContext`r1], $CellContext`r4 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r3][$CellContext`r2], $CellContext`r5 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r4][$CellContext`r3], $CellContext`r6 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r5][$CellContext`r4], $CellContext`r7 = $CellContext`r6 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r6 - \ $CellContext`r5]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{$CellContext`r1/3, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{$CellContext`r2/3, 1.4 $CellContext`r2}]], If[$CellContext`inf$$, Line[{$CellContext`r3/3, 1.4 $CellContext`r3}]], If[$CellContext`inf$$, Line[{$CellContext`r4/3, 1.4 $CellContext`r4}]], If[$CellContext`inf$$, Line[{$CellContext`r5/3, 1.4 $CellContext`r5}]], If[$CellContext`inf$$, Line[{$CellContext`r6/3, 1.4 $CellContext`r6}]], If[$CellContext`inf$$, Line[{$CellContext`r7/3, 1.4 $CellContext`r7}]]}, $CellContext`nr$$ == 5, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r2][$CellContext`r1], $CellContext`r4 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r3][$CellContext`r2], $CellContext`r5 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r4][$CellContext`r3], $CellContext`r6 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r5][$CellContext`r4], $CellContext`r7 = Evaluate[ RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r6][$CellContext`r5]], $CellContext`r8 = $CellContext`r7 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r7 - \ $CellContext`r6]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{$CellContext`r1/3, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{$CellContext`r2/3, 1.4 $CellContext`r2}]], If[$CellContext`inf$$, Line[{$CellContext`r3/3, 1.4 $CellContext`r3}]], If[$CellContext`inf$$, Line[{$CellContext`r4/3, 1.4 $CellContext`r4}]], If[$CellContext`inf$$, Line[{$CellContext`r5/3, 1.4 $CellContext`r5}]], If[$CellContext`inf$$, Line[{$CellContext`r6/3, 1.4 $CellContext`r6}]], If[$CellContext`inf$$, Line[{$CellContext`r7/3, 1.4 $CellContext`r7}]], If[$CellContext`inf$$, Line[{$CellContext`r8/3, 1.4 $CellContext`r8}]]}, $CellContext`nr$$ == 6, { Lighter[ ColorData["Legacy"]["LightSkyBlue"], 0.6], Disk[{0, 0}, 1], Blue, Circle[{0, 0}, 1], Thickness[$CellContext`th], GrayLevel[0.7], Line[{{-7, $CellContext`d}, $CellContext`r1 = {- Sqrt[1 - $CellContext`d^2], $CellContext`d}}], Table[{$CellContext`n = $CellContext`ref \ ($CellContext`indexLength[$CellContext`\[Lambda]] - 1.338) + $CellContext`n0$$; If[ Or[$CellContext`ref == 0, $CellContext`nRays$$ == 1], Hue[0.8 (($CellContext`n0$$ - 1.332)/0.011)], ColorData["VisibleSpectrum"][$CellContext`\[Lambda]]], Line[{$CellContext`r1, $CellContext`r2 = \ $CellContext`backReflection1[$CellContext`d, $CellContext`n], $CellContext`r3 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r2][$CellContext`r1], $CellContext`r4 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r3][$CellContext`r2], $CellContext`r5 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r4][$CellContext`r3], $CellContext`r6 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r5][$CellContext`r4], $CellContext`r7 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r6][$CellContext`r5], $CellContext`r8 = RotationTransform[ 2 ArcSin[$CellContext`d/$CellContext`n], \ $CellContext`r7][$CellContext`r6], $CellContext`r9 = $CellContext`r8 + 10 RotationTransform[ ArcSin[$CellContext`d/$CellContext`n] - ArcSin[$CellContext`d]][$CellContext`r8 - \ $CellContext`r7]}]}, {$CellContext`\[Lambda], If[$CellContext`nRays$$ == 1, 550, 400], If[$CellContext`nRays$$ == 1, 550, 680], If[$CellContext`nRays$$ == 1, 1, 280/($CellContext`nRays$$ - 1)]}], Thickness[0.001], Black, Dashed, If[$CellContext`inf$$, Line[{$CellContext`r1/3, 1.4 $CellContext`r1}]], If[$CellContext`inf$$, Line[{$CellContext`r2/3, 1.4 $CellContext`r2}]], If[$CellContext`inf$$, Line[{$CellContext`r3/3, 1.4 $CellContext`r3}]], If[$CellContext`inf$$, Line[{$CellContext`r4/3, 1.4 $CellContext`r4}]], If[$CellContext`inf$$, Line[{$CellContext`r5/3, 1.4 $CellContext`r5}]], If[$CellContext`inf$$, Line[{$CellContext`r6/3, 1.4 $CellContext`r6}]], If[$CellContext`inf$$, Line[{$CellContext`r7/3, 1.4 $CellContext`r7}]], If[$CellContext`inf$$, Line[{$CellContext`r8/3, 1.4 $CellContext`r8}]], If[$CellContext`inf$$, Line[{$CellContext`r9/3, 1.4 $CellContext`r9}]]}], PlotRange -> {{-4, 1.8}, {-2, 1.2}}, ImageSize -> 600, AspectRatio -> Automatic, Axes -> False, Prolog -> If[ And[$CellContext`inf$$, Abs[$CellContext`n0$$ - 1.338] < 0.001], Text[ Style[ Which[$CellContext`nr$$ == 0, "Maximal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(0\)]\)=83.27\ \[Degree] (y=1) n=1.338", $CellContext`nr$$ == 1, "Maximal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(1\)]\)=41.36\ \[Degree] (y=0.86) n=1.338", $CellContext`nr$$ == 2, "Minimal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(2\)]\)=52.21\ \[Degree] (y=-0.946) n=1.338", $CellContext`nr$$ == 3, "Maximal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(3\)]\)=39.88\ \[Degree] (y=-0.973) n=1.338 (observed in Sun direction)", $CellContext`nr$$ == 4, "Minimal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(4\)]\)=46.04\ \[Degree] (y=0.983) n=1.338 (observed in Sun direction)", $CellContext`nr$$ == 5, "Maximal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(5\)]\)=48.72\ \[Degree] (y=0.989) n=1.338", $CellContext`nr$$ == 6, "Minimal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(6\)]\)=35.65\ \[Degree] (y=0.992) n=1.338"], 16, Bold], {-1.5, 1.1}], Text[ Style[ Which[ And[$CellContext`inf$$, $CellContext`nr$$ == 1], "Maximal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(1\)]\)=22.84\ \[Degree] (y=0.765) n=1.5 (glass sphere)", And[$CellContext`inf$$, $CellContext`nr$$ == 2], "Maximal \!\(\*SubscriptBox[\(\[CurlyPhi]\), \(1\)]\)=86.87\ \[Degree] (y=-0.922) n=1.5 (glass sphere)", True, ""], 16, Bold], {-1.5, 1.1}]], Epilog -> {Gray, If[$CellContext`inf$$, Text[ Style[ Which[$CellContext`nr$$ == 0, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(0\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(-(Part[$CellContext`r03, 2] - Part[$CellContext`r02, 2]))/(Part[$CellContext`r03, 1] - Part[$CellContext`r02, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]], $CellContext`nr$$ == 1, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(1\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(Part[$CellContext`r04, 2] - Part[$CellContext`r03, 2])/(Part[$CellContext`r04, 1] - Part[$CellContext`r03, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]], $CellContext`nr$$ == 2, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(2\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(Part[$CellContext`r05, 2] - Part[$CellContext`r04, 2])/(Part[$CellContext`r05, 1] - Part[$CellContext`r04, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]], $CellContext`nr$$ == 3, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(3\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(-(Part[$CellContext`r06, 2] - Part[$CellContext`r05, 2]))/(Part[$CellContext`r06, 1] - Part[$CellContext`r05, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]], $CellContext`nr$$ == 4, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(4\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(-(Part[$CellContext`r07, 2] - Part[$CellContext`r06, 2]))/(Part[$CellContext`r07, 1] - Part[$CellContext`r06, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]], $CellContext`nr$$ == 5, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(5\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(Part[$CellContext`r08, 2] - Part[$CellContext`r07, 2])/(Part[$CellContext`r08, 1] - Part[$CellContext`r07, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]], $CellContext`nr$$ == 6, StringJoin["\!\(\*SubscriptBox[\(\[CurlyPhi]\), \(6\)]\) = ", ToString[ Round[(180/Pi) ArcTan[(Part[$CellContext`r09, 2] - Part[$CellContext`r08, 2])/(Part[$CellContext`r09, 1] - Part[$CellContext`r08, 1])], 0.01]], "\[Degree]", " y=", ToString[ Round[$CellContext`d, 0.001]]]], 16, Bold], {-2.5, 0.5}]], $CellContext`source[$CellContext`h$$, 0.1]}]), "Specifications" :> {{{$CellContext`h$$, {-3.8, 0.75}}, {-4, -1}, {-2.5, 1}, ControlType -> Locator}, {{$CellContext`nRays$$, 20, "number of rays"}, 1, 50, 1, Appearance -> "Labeled", ImageSize -> Tiny, ControlPlacement -> 1}, {{$CellContext`n0$$, 1.338, "refraction coefficient"}, 0.76, 2, 0.002, Appearance -> "Labeled", ImageSize -> Tiny, Enabled -> True, ControlPlacement -> 2}, {{$CellContext`n0$$, 1.338, ""}, { 1.338 -> Style["Water", 11], 1.5 -> Style["Glass", 11]}, ControlType -> Setter, ControlPlacement -> 3}, {{$CellContext`inf$$, False, " info"}, {True, False}, ControlPlacement -> 4}, Row[{ Manipulate`Place[1], Manipulate`Place[2], Manipulate`Place[3], Manipulate`Place[4]}], {{$CellContext`nr$$, 1, " rainbow"}, { 0 -> "0", 1 -> "1", 2 -> "2", 3 -> "3", 4 -> "4", 5 -> "5", 6 -> "6"}, ControlType -> Setter, ControlPlacement -> 5}, {{$CellContext`Qangle$$, False, " crucial angle"}, {True, False}, ControlPlacement -> 6}, {{$CellContext`n0$$, 1.338, " colour "}, Dynamic[{1.3312/1.00022 -> Style["red", If[$CellContext`nRays$$ == 1, {Bold, Red}, Black], 13], 1.3335 -> Style["orange", If[$CellContext`nRays$$ == 1, {Bold, Orange}, Black], 13], 1.3342 -> Style["yellow", If[$CellContext`nRays$$ == 1, {Bold, Yellow}, Black], 13], 1.338 -> Style["green", If[$CellContext`nRays$$ == 1, {Bold, Green}, Black], 13], 1.34 -> Style["blue", If[$CellContext`nRays$$ == 1, {Bold, Hue[0.53]}, Black], 13], 1.3415 -> Style["indigo", If[$CellContext`nRays$$ == 1, {Bold, Hue[0.7]}, Black], 13], 1.3435/1.00028 -> Style["violet", If[$CellContext`nRays$$ == 1, {Bold, Hue[0.88]}, Black], 13]}], ControlType -> Setter, Enabled -> Dynamic[ And[$CellContext`nRays$$ == 1, Abs[$CellContext`n0$$ - 1.338] < 0.01]], ControlPlacement -> 7}, Row[{ Manipulate`Place[5], Manipulate`Place[6], Manipulate`Place[7]}]}, "Options" :> { TrackedSymbols :> {$CellContext`ref, $CellContext`nRays$$, \ $CellContext`nr$$, $CellContext`inf$$, $CellContext`h$$, $CellContext`n0$$, \ $CellContext`ray1, $CellContext`Qangle$$}}, "DefaultOptions" :> {}], ImageSizeCache->{982., {340., 349.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`source[{ Pattern[$CellContext`x0, Blank[]], Pattern[$CellContext`y0, Blank[]]}, Pattern[$CellContext`r0, Blank[]]] := { Hue[0.12], Disk[{$CellContext`x0, $CellContext`y0}, $CellContext`r0], Thickness[0.002], Arrowheads[0.02], Arrow[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0 + 3 $CellContext`r0, $CellContext`y0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0 - 2 $CellContext`r0, $CellContext`y0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0, \ $CellContext`y0 + 2 $CellContext`r0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0, \ $CellContext`y0 - 2 $CellContext`r0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0 - 1.6 $CellContext`r0, $CellContext`y0 - 1.6 $CellContext`r0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0 + 1.6 $CellContext`r0, $CellContext`y0 - 1.6 $CellContext`r0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0 - 1.6 $CellContext`r0, $CellContext`y0 + 1.6 $CellContext`r0}}], Line[{{$CellContext`x0, $CellContext`y0}, {$CellContext`x0 + 1.6 $CellContext`r0, $CellContext`y0 + 1.6 $CellContext`r0}}]}; $CellContext`indexLength = Interpolation[{{303.4, 1.3581/1.0003}, {380, 1.3447/1.0003}, { 396.847, 1.3435/1.00029}, {434.047, 1.3404/1.00029}, { 486.134, 1.3372/1.00028}, {589.3, 1.333/1.00028}, { 656.281, 1.3312/1.00027}, {700, 1.3303/1.00027}, { 1256, 1.321/1.00026}}]; $CellContext`backReflection1 = Compile[{{$CellContext`d, Blank[Real]}, {$CellContext`n, Blank[Real]}}, Block[{$CellContext`\[Alpha] = ArcSin[$CellContext`d], $CellContext`\[Beta] = ArcSin[$CellContext`d/$CellContext`n], $CellContext`x1 = - Sqrt[1 - $CellContext`d^2], $CellContext`y1 = $CellContext`d, \ $CellContext`k1 = Tan[$CellContext`\[Alpha] - $CellContext`\[Beta]], \ $CellContext`x2}, $CellContext`x2 = ($CellContext`k1 ($CellContext`k1 \ $CellContext`x1 + $CellContext`y1) + Sqrt[1 + $CellContext`k1^2 - ($CellContext`k1 $CellContext`x1 + \ $CellContext`y1)^2])/( 1 + $CellContext`k1^2); {$CellContext`x2, $CellContext`y1 - \ $CellContext`k1 ($CellContext`x2 - $CellContext`x1)}]]}; Typeset`initDone$$ = True), SynchronousInitialization->True, UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$}, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{ 3.86192662731578*^9},ExpressionUUID->"f8397756-22c2-4a21-b6b5-194e14e643a2"] }, {2}]] }, WindowSize->{1904, 997}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification:>1.5 Inherited, FrontEndVersion->"11.1 for Microsoft Windows (64-bit) (March 13, 2017)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 103954, 2501, 13192, "Input", "ExpressionUUID" -> \ "062cbeea-5af4-4238-be56-a8b4874ec563", CellID->22838252], Cell[104537, 2525, 38591, 783, 714, "Output", "ExpressionUUID" -> \ "f8397756-22c2-4a21-b6b5-194e14e643a2"] }, {2}]] } ] *)