Cell[CellGroupData[{Cell[BoxData[ RowBox[{ RowBox[{"RadiationPattern", "[", RowBox[{ "Lpwl_", ",", "mesh_", ",", "opac_", ",", "step_", ",", "pg_"}], "]"}], ":=", RowBox[{"Quiet", "[", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "fun", ",", "max", ",", "xy", ",", "yz", ",", "zx", ",", "box", ",", "ci", ",", "sf", ",", "cf"}], "}"}], ",", " ", RowBox[{ RowBox[{"fun", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"(", RowBox[{"Pi", " ", "Lpwl"}], ")"}], " ", RowBox[{"Cos", "[", "t", "]"}]}], "]"}], "-", RowBox[{"Cos", "[", RowBox[{"Pi", " ", "Lpwl"}], "]"}]}], ")"}], "]"}], "/", RowBox[{"Sin", "[", "t", "]"}]}], "===", "Indeterminate"}], ",", RowBox[{"Abs", "[", RowBox[{"Pi", " ", "Lpwl", " ", RowBox[{"Sin", "[", RowBox[{"Pi", " ", "Lpwl", " ", RowBox[{"Cos", "[", "t", "]"}]}], "]"}], " ", RowBox[{ RowBox[{"Sin", "[", "t", "]"}], "/", RowBox[{"Cos", "[", "t", "]"}]}]}], "]"}], ",", RowBox[{ RowBox[{"Abs", "[", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"(", RowBox[{"Pi", " ", "Lpwl"}], ")"}], " ", RowBox[{"Cos", "[", "t", "]"}]}], "]"}], "-", RowBox[{"Cos", "[", RowBox[{"Pi", " ", "Lpwl"}], "]"}]}], ")"}], "]"}], "/", RowBox[{"Sin", "[", "t", "]"}]}]}], " ", "]"}], ",", " ", RowBox[{"{", RowBox[{"t", ",", " ", "0", ",", "Pi", ",", RowBox[{"Pi", "/", "180"}]}], "}"}]}], "]"}]}], ";", " ", RowBox[{"max", "=", RowBox[{"Max", "[", "fun", "]"}]}], ";", " ", RowBox[{ RowBox[{"EE", "[", RowBox[{"Len_", ",", "t_"}], "]"}], "=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"(", RowBox[{"Pi", " ", "Len"}], ")"}], " ", RowBox[{"Cos", "[", "t", "]"}]}], "]"}], "-", RowBox[{"Cos", "[", RowBox[{"Pi", " ", "Len"}], "]"}]}], ")"}], "]"}], "/", RowBox[{"Sin", "[", "t", "]"}]}], "===", "Indeterminate"}], ",", RowBox[{"Abs", "[", RowBox[{"Pi", " ", "Len", " ", RowBox[{"Sin", "[", RowBox[{"Pi", " ", "Len", " ", RowBox[{"Cos", "[", "t", "]"}]}], "]"}], " ", RowBox[{ RowBox[{"Sin", "[", "t", "]"}], "/", RowBox[{"Cos", "[", "t", "]"}]}]}], "]"}], ",", RowBox[{ RowBox[{"Abs", "[", RowBox[{"(", RowBox[{ RowBox[{"Cos", "[", RowBox[{ RowBox[{"(", RowBox[{"Pi", " ", "Len"}], ")"}], " ", RowBox[{"Cos", "[", "t", "]"}]}], "]"}], "-", RowBox[{"Cos", "[", RowBox[{"Pi", " ", "Len"}], "]"}]}], ")"}], "]"}], "/", RowBox[{"Sin", "[", "t", "]"}]}]}], "]"}]}], ";", " ", RowBox[{"sf", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"Sin", "[", "i", "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", " ", "0", ",", " ", RowBox[{"2", "Pi"}], ",", " ", RowBox[{"Pi", "/", "180"}]}], "}"}]}], "]"}]}], ";", " ", RowBox[{"cf", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"Cos", "[", "i", "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", " ", "0", ",", " ", RowBox[{"2", "Pi"}], ",", " ", RowBox[{"Pi", "/", "180"}]}], "}"}]}], "]"}]}], ";", " ", RowBox[{"xy", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"sf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "91", "]"}], "]"}], "/", "max"}]}], ",", RowBox[{ RowBox[{"cf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "91", "]"}], "]"}], "/", "max"}]}], ",", "0"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "1", ",", "361"}], "}"}]}], "]"}], "]"}]}], "}"}]}], ";", " ", RowBox[{"yz", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", " ", RowBox[{ RowBox[{"sf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}], ",", RowBox[{ RowBox[{"cf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}]}], " ", "}"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "1", ",", "181"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{ RowBox[{"-", RowBox[{"sf", "[", RowBox[{"[", "i", "]"}], "]"}]}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}], ",", RowBox[{ RowBox[{"cf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}]}], " ", "}"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "1", ",", "181"}], "}"}]}], "]"}], "]"}]}], "}"}]}], ";", " ", RowBox[{"zx", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "1", ",", "0"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"sf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}], ",", "0", ",", RowBox[{ RowBox[{"cf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "1", ",", "181"}], "}"}]}], "]"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"sf", "[", RowBox[{"[", "i", "]"}], "]"}]}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}], ",", "0", ",", RowBox[{ RowBox[{"cf", "[", RowBox[{"[", "i", "]"}], "]"}], " ", RowBox[{ RowBox[{"fun", "[", RowBox[{"[", "i", "]"}], "]"}], "/", "max"}]}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", "1", ",", "181"}], "}"}]}], "]"}], "]"}]}], "}"}]}], ";", " ", RowBox[{"box", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2", ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "}"}]}], ";", " ", RowBox[{"ci", "=", RowBox[{"{", RowBox[{"Line", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "f", "]"}], ",", RowBox[{"Sin", "[", "f", "]"}], ",", "0"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"f", ",", "0", ",", " ", RowBox[{"2", "Pi"}], ",", RowBox[{"Pi", "/", "36"}]}], "}"}]}], "]"}], "]"}], "}"}]}], ";", " ", RowBox[{"Show", "[", " ", RowBox[{ RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"GrayLevel", "[", "0.5", "]"}], ",", RowBox[{"Translate", "[", RowBox[{"ci", ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", RowBox[{"-", "2"}]}], "}"}]}], "]"}], ",", RowBox[{"Translate", "[", RowBox[{ RowBox[{"Rotate", "[", RowBox[{"ci", ",", RowBox[{"Pi", "/", "2"}], ",", " ", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2"}], ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"Translate", "[", RowBox[{ RowBox[{"Rotate", "[", RowBox[{"ci", ",", RowBox[{"Pi", "/", "2"}], ",", " ", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0"}], "}"}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "0", ",", "0"}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"Thin", ",", RowBox[{"GrayLevel", "[", "0.5", "]"}], ",", RowBox[{"GraphicsComplex", "[", RowBox[{"box", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "8", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "5", ",", "6", ",", "2"}], "}"}]}], "}"}], "]"}]}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0", ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"1.", ",", "0", ",", RowBox[{"-", "2"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "2"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1.", ",", RowBox[{"-", "2"}], ",", "0"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "1", ",", "0"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1."}], ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1.", ",", RowBox[{"-", "2"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", RowBox[{"-", "1."}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "1.", ",", "0"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "1."}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2"}], ",", "1."}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "0", ",", RowBox[{"-", "1."}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "0", ",", "1."}], "}"}]}], "}"}], "]"}]}], "}"}]}], "}"}], "]"}], ",", " ", RowBox[{"SphericalPlot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"EE", "[", RowBox[{"Lpwl", ",", "t"}], "]"}], "/", "max"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"t", ",", " ", "0", ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"f", ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}], ",", RowBox[{"PlotPoints", "->", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"180", "/", "step"}], ")"}], "+", "1"}], ",", RowBox[{ RowBox[{"(", RowBox[{"360", "/", "step"}], ")"}], "+", "1"}]}], "}"}]}], ",", RowBox[{"Mesh", "->", "mesh"}], ",", RowBox[{"MeshStyle", "->", RowBox[{"GrayLevel", "[", "0.75", "]"}]}], ",", RowBox[{"PlotStyle", "->", RowBox[{"Directive", "[", RowBox[{ RowBox[{"Opacity", "[", "opac", "]"}], ",", RowBox[{"GrayLevel", "[", "0.25", "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "10"}], "]"}]}], "]"}]}], ",", RowBox[{"PerformanceGoal", "->", "pg"}]}], "]"}], ",", RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Directive", "[", RowBox[{"Red", ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "10"}], "]"}]}], "]"}], ",", RowBox[{"Arrowheads", "[", ".05", "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"Tube", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1.8", ",", "0", ",", "0"}], "}"}]}], "}"}], ",", "0.015"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Directive", "[", RowBox[{"Green", ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "10"}], "]"}]}], "]"}], ",", RowBox[{"Arrowheads", "[", ".05", "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"Tube", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1.8", ",", "0"}], "}"}]}], "}"}], ",", "0.015"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Directive", "[", RowBox[{"Blue", ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "10"}], "]"}]}], "]"}], ",", RowBox[{"Arrowheads", "[", ".05", "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"Tube", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1.8"}], "}"}]}], "}"}], ",", "0.015"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Directive", "[", RowBox[{"Yellow", ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "10"}], "]"}]}], "]"}], ",", RowBox[{"EdgeForm", "[", "]"}], ",", RowBox[{"Sphere", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", "0.05"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"mesh", "=!=", "None"}], ",", " ", "Thick", ",", "Thin"}], "]"}], ",", "xy", ",", "yz", ",", "zx"}], "}"}], ",", RowBox[{"Translate", "[", RowBox[{"xy", ",", " ", RowBox[{"{", RowBox[{"0", ",", "0", ",", RowBox[{"-", "2"}]}], "}"}]}], "]"}], ",", RowBox[{"Translate", "[", RowBox[{"yz", ",", " ", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "0", ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"Translate", "[", RowBox[{"zx", ",", " ", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "2"}], ",", "0"}], "}"}]}], "]"}]}], "}"}]}], "}"}], "]"}], ",", " ", RowBox[{"Lighting", "->", "\"\\""}], ",", RowBox[{"Boxed", "->", "False"}], ",", RowBox[{"Axes", "->", "False"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "2.1"}], ",", "2.1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.1"}], ",", "2.1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2.1"}], ",", "2.1"}], "}"}]}], "}"}]}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"400", ",", "400"}], "}"}]}], ",", RowBox[{"ViewPoint", "->", RowBox[{"{", RowBox[{"1", ",", "1", ",", "1"}], "}"}]}]}], "]"}]}]}], "]"}], "]"}]}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{{3.435167686953125*^9, 3.43516778003125*^9}, { 3.43516781484375*^9, 3.435167839390625*^9}, {3.4351678748125*^9, 3.435168130265625*^9}, {3.435168169828125*^9, 3.43516824296875*^9}, {3.4351682829375*^9, 3.435168567953125*^9}, { 3.4351686456875*^9, 3.43516876565625*^9}, {3.43516885409375*^9, 3.43516887696875*^9}, {3.435168977796875*^9, 3.435168980234375*^9}, {3.4351690779375*^9, 3.435169264484375*^9}, {3.4352022239375*^9, 3.435202266328125*^9}, {3.435202403203125*^9, 3.4352024366875*^9}, {3.435202467703125*^9, 3.435202491015625*^9}, {3.435202647421875*^9, 3.435202652421875*^9}, {3.435202751703125*^9, 3.435202796109375*^9}, {3.43520535946875*^9, 3.4352053686875*^9}, { 3.43520601759375*^9, 3.43520601934375*^9}, {3.43520717325*^9, 3.435207195625*^9}, {3.435207254234375*^9, 3.435207260078125*^9}, { 3.435209789671875*^9, 3.43520986209375*^9}, {3.435209927703125*^9, 3.4352099281875*^9}, {3.43521303275*^9, 3.435213068609375*^9}, { 3.435213266265625*^9, 3.43521326784375*^9}, {3.435215710390625*^9, 3.435215714828125*^9}, 3.43521584265625*^9, {3.4352925170625*^9, 3.43529255559375*^9}, {3.435292618296875*^9, 3.435292630953125*^9}, {3.4363651466875*^9, 3.436365180625*^9}, { 3.43637231340625*^9, 3.436372314171875*^9}, 3.43637463825*^9, { 3.436374798375*^9, 3.4363748000625*^9}, {3.436374857609375*^9, 3.43637490296875*^9}, {3.43642451140625*^9, 3.436424623328125*^9}, {3.4364246689375*^9, 3.436424685421875*^9}, {3.43642489884375*^9, 3.436424912515625*^9}, {3.43645356625*^9, 3.436453566828125*^9}, { 3.436453964625*^9, 3.436453967203125*^9}, 3.436545799671875*^9, 3.436615642203125*^9, {3.436676100203125*^9, 3.4366761294375*^9}, { 3.43667793909375*^9, 3.43667799546875*^9}, {3.43668961428125*^9, 3.4366897020625*^9}, {3.436689756265625*^9, 3.436689757859375*^9}, {3.43670173121875*^9, 3.436701754484375*^9}, {3.4398117945625*^9, 3.439811797796875*^9}, {3.439813004765625*^9, 3.439813015109375*^9}, {3.4398241908125*^9, 3.439824195859375*^9}, {3.4398243828125*^9, 3.439824391484375*^9}, {3.439909391390625*^9, 3.43990939825*^9}, { 3.439991795796875*^9, 3.439991805171875*^9}, { 3.4401849457290754`*^9, 3.4401849457790804`*^9}, 3.760745889721663*^9}, CellID->30239376], Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"RadiationPattern", "[", RowBox[{ "Lpwl", ",", "mesh", ",", "opac", ",", "step", ",", "pg"}], "]"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Lpwl", ",", "0.1", ",", "\"\\""}], "}"}], ",", "0.1", ",", "10.", ",", "0.1", ",", RowBox[{"Appearance", "->", "\"\\""}], ",", RowBox[{"ControlPlacement", "->", "Top"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"mesh", ",", "None", ",", "\"\\""}], " ", "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"None", "->", "\"\\""}], ",", RowBox[{"15", "->", "\"\\""}], ",", " ", RowBox[{"Full", "->", "\"\\""}]}], "}"}], ",", RowBox[{"ControlType", "->", "RadioButtonBar"}], ",", RowBox[{"ControlPlacement", "->", "Top"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"opac", ",", "1", ",", "\"\\""}], "}"}], ",", RowBox[{"Range", "[", RowBox[{"0", ",", "1", ",", "0.1"}], "]"}]}], "}"}], ",", "\"\<\>\"", ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"step", ",", "3", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ "10", ",", "9", ",", "6", ",", "5", ",", "4", ",", "3", ",", "2", ",", "1"}], "}"}]}], "}"}], ",", "\"\<\>\"", ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"pg", ",", "\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}], ",", RowBox[{"ControlType", "->", "PopupMenu"}]}], "}"}], ",", " ", RowBox[{"FrameMargins", "->", "None"}], ",", RowBox[{"Alignment", "->", RowBox[{"{", RowBox[{"Center", ",", "Center"}], "}"}]}], ",", RowBox[{"ContinuousAction", "->", "False"}], ",", " ", RowBox[{"ControlPlacement", "->", "Left"}], ",", RowBox[{"AutorunSequencing", "->", RowBox[{"{", "1", "}"}]}], ",", RowBox[{"SaveDefinitions", "->", "True"}], ",", RowBox[{"TrackedSymbols", "->", "True"}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, 3.439909566984375*^9, {3.439991850109375*^9, 3.43999185715625*^9}, {3.43999334821875*^9, 3.43999335265625*^9}, 3.440184954021905*^9, 3.4401875018712096`*^9, { 3.4401876646837096`*^9, 3.4401876729024596`*^9}, { 3.4401889634180846`*^9, 3.4401889967930846`*^9}, { 3.4403377233174095`*^9, 3.4403377236274405`*^9}, 3.760745889718327*^9}, CellID->155207050], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`Lpwl$$ = 0.1, $CellContext`mesh$$ = None, $CellContext`opac$$ = 1, $CellContext`pg$$ = "Speed", $CellContext`step$$ = 3, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`Lpwl$$], 0.1, "L/\[Lambda]"}, 0.1, 10., 0.1}, {{ Hold[$CellContext`mesh$$], None, "mesh"}, { None -> "none", 15 -> "automatic", Full -> "full"}}, {{ Hold[$CellContext`opac$$], 1, "opacity"}, {0., 0.1, 0.2, 0.30000000000000004`, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.}}, { Hold[""], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`step$$], 3, "step [Degree]"}, {10, 9, 6, 5, 4, 3, 2, 1}}, { Hold[""], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`pg$$], "Speed", "goal"}, { "Speed", "Quality"}}}, Typeset`size$$ = {400., {198., 202.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`Lpwl$22925$$ = 0, $CellContext`mesh$22926$$ = False, $CellContext`opac$22927$$ = 0, $CellContext`step$22928$$ = 0, $CellContext`pg$22929$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`Lpwl$$ = 0.1, $CellContext`mesh$$ = None, $CellContext`opac$$ = 1, $CellContext`pg$$ = "Speed", $CellContext`step$$ = 3}, "ControllerVariables" :> { Hold[$CellContext`Lpwl$$, $CellContext`Lpwl$22925$$, 0], Hold[$CellContext`mesh$$, $CellContext`mesh$22926$$, False], Hold[$CellContext`opac$$, $CellContext`opac$22927$$, 0], Hold[$CellContext`step$$, $CellContext`step$22928$$, 0], Hold[$CellContext`pg$$, $CellContext`pg$22929$$, 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`RadiationPattern[$CellContext`Lpwl$$, \ $CellContext`mesh$$, $CellContext`opac$$, $CellContext`step$$, \ $CellContext`pg$$], "Specifications" :> {{{$CellContext`Lpwl$$, 0.1, "L/\[Lambda]"}, 0.1, 10., 0.1, Appearance -> "Labeled", ControlPlacement -> Top}, {{$CellContext`mesh$$, None, "mesh"}, { None -> "none", 15 -> "automatic", Full -> "full"}, ControlType -> RadioButtonBar, ControlPlacement -> Top}, {{$CellContext`opac$$, 1, "opacity"}, {0., 0.1, 0.2, 0.30000000000000004`, 0.4, 0.5, 0.6000000000000001, 0.7000000000000001, 0.8, 0.9, 1.}}, "", {{$CellContext`step$$, 3, "step [Degree]"}, {10, 9, 6, 5, 4, 3, 2, 1}}, "", {{$CellContext`pg$$, "Speed", "goal"}, { "Speed", "Quality"}, ControlType -> PopupMenu}}, "Options" :> { FrameMargins -> None, Alignment -> {Center, Center}, ContinuousAction -> False, ControlPlacement -> Left, AutorunSequencing -> {1}, TrackedSymbols -> True}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{543., {245., 251.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`RadiationPattern[ Pattern[$CellContext`Lpwl, Blank[]], Pattern[$CellContext`mesh, Blank[]], Pattern[$CellContext`opac, Blank[]], Pattern[$CellContext`step, Blank[]]] := Quiet[ Module[{$CellContext`fun, $CellContext`max, $CellContext`xy, \ $CellContext`yz, $CellContext`zx, $CellContext`box, $CellContext`ci, \ $CellContext`sf, $CellContext`cf}, $CellContext`fun = Table[ If[ Abs[Cos[(Pi $CellContext`Lpwl) Cos[$CellContext`t]] - Cos[Pi $CellContext`Lpwl]]/Sin[$CellContext`t] === Indeterminate, Abs[((Pi $CellContext`Lpwl) Sin[(Pi $CellContext`Lpwl) Cos[$CellContext`t]]) ( Sin[$CellContext`t]/Cos[$CellContext`t])], Abs[Cos[(Pi $CellContext`Lpwl) Cos[$CellContext`t]] - Cos[Pi $CellContext`Lpwl]]/ Sin[$CellContext`t]], {$CellContext`t, 0, Pi, Pi/ 180}]; $CellContext`max = Max[$CellContext`fun]; $CellContext`EE[ Pattern[$CellContext`Len, Blank[]], Pattern[$CellContext`t, Blank[]]] = If[Abs[Cos[(Pi $CellContext`Len) Cos[$CellContext`t]] - Cos[Pi $CellContext`Len]]/Sin[$CellContext`t] === Indeterminate, Abs[((Pi $CellContext`Len) Sin[(Pi $CellContext`Len) Cos[$CellContext`t]]) ( Sin[$CellContext`t]/Cos[$CellContext`t])], Abs[Cos[(Pi $CellContext`Len) Cos[$CellContext`t]] - Cos[ Pi $CellContext`Len]]/ Sin[$CellContext`t]]; $CellContext`sf = Table[ N[ Sin[$CellContext`i]], {$CellContext`i, 0, 2 Pi, Pi/ 180}]; $CellContext`cf = Table[ N[ Cos[$CellContext`i]], {$CellContext`i, 0, 2 Pi, Pi/ 180}]; $CellContext`xy = { RGBColor[0, 0, 1], Line[ Table[{Part[$CellContext`sf, $CellContext`i] ( Part[$CellContext`fun, 91]/$CellContext`max), Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, 91]/$CellContext`max), 0}, {$CellContext`i, 1, 361}]]}; $CellContext`yz = { RGBColor[1, 0, 0], Line[ Table[{0, Part[$CellContext`sf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]], Line[ Table[{0, (-Part[$CellContext`sf, $CellContext`i]) ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]]}; $CellContext`zx = { RGBColor[0, 1, 0], Line[ Table[{Part[$CellContext`sf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), 0, Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]], Line[ Table[{(-Part[$CellContext`sf, $CellContext`i]) ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), 0, Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]]}; $CellContext`box = {{-2, -2, -2}, {-2, 2, -2}, {2, 2, -2}, {2, -2, -2}, {-2, -2, 2}, {-2, 2, 2}, {2, 2, 2}, {2, -2, 2}}; $CellContext`ci = { Line[ Table[{ Cos[$CellContext`f], Sin[$CellContext`f], 0}, {$CellContext`f, 0, 2 Pi, Pi/ 36}]]}; Show[ Graphics3D[{{ GrayLevel[0.5], Translate[$CellContext`ci, {0, 0, -2}], Translate[ Rotate[$CellContext`ci, Pi/2, {1, 0, 0}], {0, -2, 0}], Translate[ Rotate[$CellContext`ci, Pi/2, {0, 1, 0}], {-2, 0, 0}]}, {Thin, GrayLevel[0.5], GraphicsComplex[$CellContext`box, Line[{{1, 2, 3, 4}, {1, 4, 8, 5}, {1, 5, 6, 2}}]]}, { RGBColor[1, 0, 0], Line[{{-1, 0, -2}, {1., 0, -2}}], Line[{{-1, -2, 0}, {1., -2, 0}}]}, { RGBColor[0, 1, 0], Line[{{0, -1., -2}, {0, 1., -2}}], Line[{{-2, -1., 0}, {-2, 1., 0}}]}, { RGBColor[0, 0, 1], Line[{{0, -2, -1.}, {0, -2, 1.}}], Line[{{-2, 0, -1.}, {-2, 0, 1.}}]}}], SphericalPlot3D[ Evaluate[$CellContext`EE[$CellContext`Lpwl, \ $CellContext`t]/$CellContext`max], {$CellContext`t, 0, Pi}, {$CellContext`f, 0, 2 Pi}, PlotPoints -> { 180/$CellContext`step + 1, 360/$CellContext`step + 1}, Mesh -> $CellContext`mesh, MeshStyle -> GrayLevel[0.75], PlotStyle -> Directive[ Opacity[$CellContext`opac], GrayLevel[0.25], Specularity[White, 10]], PerformanceGoal -> "Speed"], Graphics3D[{{ Directive[Red, Specularity[White, 10]], Arrowheads[0.05], Arrow[ Tube[{{0, 0, 0}, {1.8, 0, 0}}, 0.015]]}, { Directive[Green, Specularity[White, 10]], Arrowheads[0.05], Arrow[ Tube[{{0, 0, 0}, {0, 1.8, 0}}, 0.015]]}, { Directive[Blue, Specularity[White, 10]], Arrowheads[0.05], Arrow[ Tube[{{0, 0, 0}, {0, 0, 1.8}}, 0.015]]}, { Directive[Yellow, Specularity[White, 10]], EdgeForm[], Sphere[{0, 0, 0}, 0.05]}, {{ If[$CellContext`mesh =!= None, Thick, Thin], $CellContext`xy, $CellContext`yz, \ $CellContext`zx}, Translate[$CellContext`xy, {0, 0, -2}], Translate[$CellContext`yz, {-2, 0, 0}], Translate[$CellContext`zx, {0, -2, 0}]}}], Lighting -> "Neutral", Boxed -> False, Axes -> False, PlotRange -> {{-2.1, 2.1}, {-2.1, 2.1}, {-2.1, 2.1}}, ImageSize -> {400, 400}, ViewPoint -> {1, 1, 1}]]], $CellContext`RadiationPattern[ Pattern[$CellContext`Lpwl, Blank[]], Pattern[$CellContext`mesh, Blank[]], Pattern[$CellContext`opac, Blank[]], Pattern[$CellContext`step, Blank[]], Pattern[$CellContext`pg, Blank[]]] := Quiet[ Module[{$CellContext`fun, $CellContext`max, $CellContext`xy, \ $CellContext`yz, $CellContext`zx, $CellContext`box, $CellContext`ci, \ $CellContext`sf, $CellContext`cf}, $CellContext`fun = Table[ If[ Abs[Cos[(Pi $CellContext`Lpwl) Cos[$CellContext`t]] - Cos[Pi $CellContext`Lpwl]]/Sin[$CellContext`t] === Indeterminate, Abs[((Pi $CellContext`Lpwl) Sin[(Pi $CellContext`Lpwl) Cos[$CellContext`t]]) ( Sin[$CellContext`t]/Cos[$CellContext`t])], Abs[Cos[(Pi $CellContext`Lpwl) Cos[$CellContext`t]] - Cos[Pi $CellContext`Lpwl]]/ Sin[$CellContext`t]], {$CellContext`t, 0, Pi, Pi/ 180}]; $CellContext`max = Max[$CellContext`fun]; $CellContext`EE[ Pattern[$CellContext`Len, Blank[]], Pattern[$CellContext`t, Blank[]]] = If[Abs[Cos[(Pi $CellContext`Len) Cos[$CellContext`t]] - Cos[Pi $CellContext`Len]]/Sin[$CellContext`t] === Indeterminate, Abs[((Pi $CellContext`Len) Sin[(Pi $CellContext`Len) Cos[$CellContext`t]]) ( Sin[$CellContext`t]/Cos[$CellContext`t])], Abs[Cos[(Pi $CellContext`Len) Cos[$CellContext`t]] - Cos[ Pi $CellContext`Len]]/ Sin[$CellContext`t]]; $CellContext`sf = Table[ N[ Sin[$CellContext`i]], {$CellContext`i, 0, 2 Pi, Pi/ 180}]; $CellContext`cf = Table[ N[ Cos[$CellContext`i]], {$CellContext`i, 0, 2 Pi, Pi/ 180}]; $CellContext`xy = { RGBColor[0, 0, 1], Line[ Table[{Part[$CellContext`sf, $CellContext`i] ( Part[$CellContext`fun, 91]/$CellContext`max), Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, 91]/$CellContext`max), 0}, {$CellContext`i, 1, 361}]]}; $CellContext`yz = { RGBColor[1, 0, 0], Line[ Table[{0, Part[$CellContext`sf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]], Line[ Table[{0, (-Part[$CellContext`sf, $CellContext`i]) ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]]}; $CellContext`zx = { RGBColor[0, 1, 0], Line[ Table[{Part[$CellContext`sf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), 0, Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]], Line[ Table[{(-Part[$CellContext`sf, $CellContext`i]) ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max), 0, Part[$CellContext`cf, $CellContext`i] ( Part[$CellContext`fun, \ $CellContext`i]/$CellContext`max)}, {$CellContext`i, 1, 181}]]}; $CellContext`box = {{-2, -2, -2}, {-2, 2, -2}, {2, 2, -2}, {2, -2, -2}, {-2, -2, 2}, {-2, 2, 2}, {2, 2, 2}, {2, -2, 2}}; $CellContext`ci = { Line[ Table[{ Cos[$CellContext`f], Sin[$CellContext`f], 0}, {$CellContext`f, 0, 2 Pi, Pi/ 36}]]}; Show[ Graphics3D[{{ GrayLevel[0.5], Translate[$CellContext`ci, {0, 0, -2}], Translate[ Rotate[$CellContext`ci, Pi/2, {1, 0, 0}], {0, -2, 0}], Translate[ Rotate[$CellContext`ci, Pi/2, {0, 1, 0}], {-2, 0, 0}]}, {Thin, GrayLevel[0.5], GraphicsComplex[$CellContext`box, Line[{{1, 2, 3, 4}, {1, 4, 8, 5}, {1, 5, 6, 2}}]]}, { RGBColor[1, 0, 0], Line[{{-1, 0, -2}, {1., 0, -2}}], Line[{{-1, -2, 0}, {1., -2, 0}}]}, { RGBColor[0, 1, 0], Line[{{0, -1., -2}, {0, 1., -2}}], Line[{{-2, -1., 0}, {-2, 1., 0}}]}, { RGBColor[0, 0, 1], Line[{{0, -2, -1.}, {0, -2, 1.}}], Line[{{-2, 0, -1.}, {-2, 0, 1.}}]}}], SphericalPlot3D[ Evaluate[$CellContext`EE[$CellContext`Lpwl, \ $CellContext`t]/$CellContext`max], {$CellContext`t, 0, Pi}, {$CellContext`f, 0, 2 Pi}, PlotPoints -> { 180/$CellContext`step + 1, 360/$CellContext`step + 1}, Mesh -> $CellContext`mesh, MeshStyle -> GrayLevel[0.75], PlotStyle -> Directive[ Opacity[$CellContext`opac], GrayLevel[0.25], Specularity[White, 10]], PerformanceGoal -> $CellContext`pg], Graphics3D[{{ Directive[Red, Specularity[White, 10]], Arrowheads[0.05], Arrow[ Tube[{{0, 0, 0}, {1.8, 0, 0}}, 0.015]]}, { Directive[Green, Specularity[White, 10]], Arrowheads[0.05], Arrow[ Tube[{{0, 0, 0}, {0, 1.8, 0}}, 0.015]]}, { Directive[Blue, Specularity[White, 10]], Arrowheads[0.05], Arrow[ Tube[{{0, 0, 0}, {0, 0, 1.8}}, 0.015]]}, { Directive[Yellow, Specularity[White, 10]], EdgeForm[], Sphere[{0, 0, 0}, 0.05]}, {{ If[$CellContext`mesh =!= None, Thick, Thin], $CellContext`xy, $CellContext`yz, \ $CellContext`zx}, Translate[$CellContext`xy, {0, 0, -2}], Translate[$CellContext`yz, {-2, 0, 0}], Translate[$CellContext`zx, {0, -2, 0}]}}], Lighting -> "Neutral", Boxed -> False, Axes -> False, PlotRange -> {{-2.1, 2.1}, {-2.1, 2.1}, {-2.1, 2.1}}, ImageSize -> {400, 400}, ViewPoint -> {1, 1, 1}]]], $CellContext`EE[ Pattern[$CellContext`Len, Blank[]], Pattern[$CellContext`t, Blank[]]] = Abs[-Cos[$CellContext`Len Pi] + Cos[($CellContext`Len Pi) Cos[$CellContext`t]]] Csc[$CellContext`t], Attributes[Thick] = {ReadProtected}, Attributes[PlotRange] = {ReadProtected}}; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.760745889718596*^9}, CellID->730060753] }, {3}]]