(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 19360, 480] NotebookOptionsPosition[ 18298, 440] NotebookOutlinePosition[ 18908, 464] CellTagsIndexPosition[ 18865, 461] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Intersecting Cylinders", "Section", CellFrameColor->RGBColor[ 0.6449835965514611, 0.758632791638056, 0.2516823071641108], FontColor->RGBColor[ 0.6449835965514611, 0.758632791638056, 0.2516823071641108]], Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[Alpha]", "=", " ", RowBox[{"N", "[", RowBox[{"Pi", "/", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"t1", "=", RowBox[{"{", RowBox[{ RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"Sin", "[", "u", "]"}], "v"}], ",", RowBox[{"Sin", "[", "u", "]"}], ",", RowBox[{"Cos", "[", "u", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"u", ",", "0", ",", "Pi"}], "}"}], ",", RowBox[{"{", RowBox[{"v", ",", RowBox[{"-", " ", RowBox[{"Tan", "[", "\[Alpha]", "]"}]}], ",", RowBox[{"Tan", "[", "\[Alpha]", "]"}]}], "}"}], ",", RowBox[{"Mesh", "\[Rule]", "None"}], ",", RowBox[{"BoundaryStyle", "\[Rule]", RowBox[{"Directive", "[", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "0"}], "]"}], "]"}]}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}], "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"t2", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0.7", ",", "0.4"}], "]"}], ",", RowBox[{"Translate", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Rotate", "[", RowBox[{ RowBox[{"Translate", "[", RowBox[{"t1", ",", RowBox[{"{", RowBox[{"0", ",", "open", ",", "0"}], "}"}]}], "]"}], ",", RowBox[{"i", " ", "2", " ", RowBox[{"Pi", "/", "n"}]}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "n"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "el"}], "}"}]}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"c1", "=", RowBox[{"Cylinder", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "0", ",", "0"}], "}"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"c2", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Rotate", "[", RowBox[{ RowBox[{"Cylinder", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "ext"}], ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"ext", ",", "0", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"i", " ", "2", " ", RowBox[{"Pi", "/", "n"}]}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "n"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Graphics3D", "[", RowBox[{ RowBox[{"{", RowBox[{"c2", ",", "t2"}], "}"}], ",", RowBox[{"SphericalRegion", "\[Rule]", "True"}], ",", RowBox[{"Boxed", "\[Rule]", "False"}], ",", RowBox[{"ViewAngle", "\[Rule]", "0.12"}], ",", RowBox[{"ImageSize", "\[Rule]", "380"}], ",", RowBox[{"ViewPoint", "\[Rule]", RowBox[{"{", RowBox[{"2", ",", RowBox[{"-", "4"}], ",", "3"}], "}"}]}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.2"}], ",", "3"}], "}"}]}], "}"}]}]}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ext", ",", "2.4", ",", "\"\\""}], "}"}], ",", "0.01", ",", "3"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "4", ",", "\"\\""}], "}"}], ",", "4", ",", "8", ",", "2", ",", "RadioButton"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"el", ",", "2", ",", "\"\\""}], "}"}], ",", "0", ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"open", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", "2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"TrackedSymbols", "\[Rule]", "Manipulate"}]}], "]"}]], "Input", CellChangeTimes->{{3.43220433746875*^9, 3.43220438759375*^9}, { 3.432204563703125*^9, 3.43220471596875*^9}, {3.4322047854375*^9, 3.432204864984375*^9}, {3.432204908*^9, 3.432205012125*^9}, { 3.43220511253125*^9, 3.432205121625*^9}, {3.432205189515625*^9, 3.43220520209375*^9}, {3.432205239828125*^9, 3.432205250015625*^9}, { 3.432205288140625*^9, 3.432205443765625*^9}, 3.432205562296875*^9, { 3.432205598578125*^9, 3.432205637109375*^9}, {3.432205747375*^9, 3.43220579940625*^9}, {3.432205831171875*^9, 3.432205835609375*^9}, { 3.432205879640625*^9, 3.432205888859375*^9}, 3.43220592590625*^9, { 3.432205998796875*^9, 3.43220603*^9}, {3.432206161*^9, 3.432206179328125*^9}, {3.4322062265625*^9, 3.432206236234375*^9}, { 3.432206271125*^9, 3.43220630396875*^9}, {3.432206335140625*^9, 3.43220633571875*^9}, {3.432206372875*^9, 3.432206397*^9}, { 3.43220644646875*^9, 3.432206575625*^9}, 3.432206739625*^9, { 3.43220678478125*^9, 3.432206785421875*^9}, 3.43221608890625*^9, { 3.4322161230625*^9, 3.43221614490625*^9}, {3.43221618984375*^9, 3.432216231375*^9}, {3.43221627009375*^9, 3.43221644553125*^9}, { 3.43221650946875*^9, 3.432216583828125*^9}, {3.432216631390625*^9, 3.432216659921875*^9}, {3.432216833703125*^9, 3.43221685096875*^9}, { 3.432216881078125*^9, 3.432216921828125*^9}, {3.432216953625*^9, 3.432217073140625*^9}, {3.43221712571875*^9, 3.43221720828125*^9}, { 3.432217306421875*^9, 3.4322173071875*^9}, {3.432217540046875*^9, 3.43221755771875*^9}, {3.432217600171875*^9, 3.432217601*^9}, { 3.43222011634375*^9, 3.432220291859375*^9}, {3.43222033521875*^9, 3.4322203655*^9}, {3.432220406515625*^9, 3.432220456625*^9}, { 3.4322205428125*^9, 3.43222062046875*^9}, {3.43222066925*^9, 3.432220720421875*^9}, {3.432220761859375*^9, 3.43222085615625*^9}, { 3.432220907359375*^9, 3.432221015578125*^9}, {3.432221777296875*^9, 3.432221829828125*^9}, {3.43222196896875*^9, 3.4322219750625*^9}, { 3.432222005453125*^9, 3.43222213228125*^9}, {3.432222221359375*^9, 3.432222254546875*^9}, 3.432222292296875*^9, {3.43222233940625*^9, 3.432222340390625*^9}, {3.4322223746875*^9, 3.4322223803125*^9}, { 3.432222417375*^9, 3.43222242125*^9}, {3.432297433859375*^9, 3.432297459890625*^9}, 3.432297507296875*^9, {3.432297546671875*^9, 3.43229759078125*^9}, {3.4322976261875*^9, 3.432297648*^9}, 3.432297880609375*^9, {3.432297975015625*^9, 3.432297989453125*^9}, { 3.432298041796875*^9, 3.432298079375*^9}, {3.432298166140625*^9, 3.43229816728125*^9}, {3.43229837221875*^9, 3.432298406*^9}, { 3.43229845796875*^9, 3.432298549578125*^9}, {3.43229859340625*^9, 3.43229861653125*^9}, {3.432298648515625*^9, 3.432298661828125*^9}, { 3.432298695890625*^9, 3.43229871646875*^9}, {3.432298750203125*^9, 3.4322987576875*^9}, {3.432298789703125*^9, 3.4322988178125*^9}, { 3.43229992921875*^9, 3.432299939953125*^9}, {3.43229999271875*^9, 3.432299993265625*^9}, {3.4323001134375*^9, 3.43230012484375*^9}, { 3.4323001904375*^9, 3.432300221375*^9}, {3.43230038884375*^9, 3.43230041*^9}, {3.432300445265625*^9, 3.43230044540625*^9}, { 3.43230090065625*^9, 3.4323009014375*^9}, {3.4323009683125*^9, 3.432300968984375*^9}, {3.43230109290625*^9, 3.432301095328125*^9}, { 3.43230117*^9, 3.432301170953125*^9}, {3.432301358671875*^9, 3.4323013593125*^9}, {3.432301391859375*^9, 3.43230142478125*^9}, { 3.43230145859375*^9, 3.43230145925*^9}, {3.43230156728125*^9, 3.43230157125*^9}, {3.43234820575*^9, 3.43234821634375*^9}, { 3.43236026840625*^9, 3.432360291578125*^9}, {3.4323603756875*^9, 3.432360376171875*^9}, {3.432360419890625*^9, 3.432360467265625*^9}, { 3.432360507*^9, 3.4323605365*^9}, {3.4323606326875*^9, 3.432360678421875*^9}, {3.432360719734375*^9, 3.43236072575*^9}, { 3.432360771921875*^9, 3.43236077709375*^9}, {3.43236091796875*^9, 3.4323609215625*^9}, {3.432360955953125*^9, 3.43236095696875*^9}, { 3.432361032109375*^9, 3.432361042484375*^9}, {3.432361086609375*^9, 3.43236113915625*^9}, {3.432361245203125*^9, 3.43236129046875*^9}, { 3.4323614296875*^9, 3.432361453015625*^9}, {3.432362943109375*^9, 3.432362943703125*^9}, {3.432363102078125*^9, 3.4323631029375*^9}, { 3.43236315025*^9, 3.43236315084375*^9}, {3.432363216*^9, 3.4323632179375*^9}, {3.432363259328125*^9, 3.4323632845*^9}, { 3.43236346728125*^9, 3.432363509359375*^9}, {3.432399062441473*^9, 3.4323990735045795`*^9}, {3.4324120175852737`*^9, 3.43241202602326*^9}}, CellID->90433392] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`el$$ = 2, $CellContext`ext$$ = 2.4, $CellContext`n$$ = 4, $CellContext`open$$ = 0, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`ext$$], 2.4, "extend cylinders"}, 0.01, 3}, {{ Hold[$CellContext`n$$], 4, "segments"}, 4, 8, 2}, {{ Hold[$CellContext`el$$], 2, "elevate intersection"}, 0, 2}, {{ Hold[$CellContext`open$$], 0, "open intersection"}, 0, 2}}, Typeset`size$$ = {380., {188., 192.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`ext$51789$$ = 0, $CellContext`n$51790$$ = 0, $CellContext`el$51791$$ = 0, $CellContext`open$51792$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`el$$ = 2, $CellContext`ext$$ = 2.4, $CellContext`n$$ = 4, $CellContext`open$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`ext$$, $CellContext`ext$51789$$, 0], Hold[$CellContext`n$$, $CellContext`n$51790$$, 0], Hold[$CellContext`el$$, $CellContext`el$51791$$, 0], Hold[$CellContext`open$$, $CellContext`open$51792$$, 0]}, "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`\[Alpha] = N[Pi/$CellContext`n$$]; $CellContext`t1 = { Part[ ParametricPlot3D[{Sin[$CellContext`u] $CellContext`v, Sin[$CellContext`u], Cos[$CellContext`u]}, {$CellContext`u, 0, Pi}, {$CellContext`v, - Tan[$CellContext`\[Alpha]], Tan[$CellContext`\[Alpha]]}, Mesh -> None, BoundaryStyle -> Directive[ RGBColor[0, 0, 0]]], 1]}; $CellContext`t2 = { RGBColor[1, 0.7, 0.4], Translate[ Table[ Rotate[ Translate[$CellContext`t1, { 0, $CellContext`open$$, 0}], ($CellContext`i 2) ( Pi/$CellContext`n$$), {0, 0, 1}], {$CellContext`i, $CellContext`n$$}], { 0, 0, $CellContext`el$$}]}; $CellContext`c1 = Cylinder[{{-3, 0, 0}, {3, 0, 0}}]; $CellContext`c2 = Table[ Rotate[ Cylinder[{{-$CellContext`ext$$, 0, 0}, {$CellContext`ext$$, 0, 0}}], ($CellContext`i 2) (Pi/$CellContext`n$$), {0, 0, 1}], {$CellContext`i, $CellContext`n$$}]; Graphics3D[{$CellContext`c2, $CellContext`t2}, SphericalRegion -> True, Boxed -> False, ViewAngle -> 0.12, ImageSize -> 380, ViewPoint -> {2, -4, 3}, PlotRange -> {{-5, 5}, {-5, 5}, {-1.2, 3}}]), "Specifications" :> {{{$CellContext`ext$$, 2.4, "extend cylinders"}, 0.01, 3}, {{$CellContext`n$$, 4, "segments"}, 4, 8, 2, ControlType -> RadioButton}, {{$CellContext`el$$, 2, "elevate intersection"}, 0, 2}, {{$CellContext`open$$, 0, "open intersection"}, 0, 2}}, "Options" :> {TrackedSymbols -> Manipulate}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{424., {268., 273.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->149692482], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 1}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.691905, 0.790311, 0.300252], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.691905, 0.790311, 0.300252]], Cell[TextData[{ "\"", ButtonBox["Intersecting Cylinders", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/IntersectingCylinders/"], None}, ButtonNote->"http://demonstrations.wolfram.com/IntersectingCylinders/"], "\"", " from ", ButtonBox["The Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/IntersectingCylinders/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/IntersectingCylinders/"], None}, ButtonNote->"http://demonstrations.wolfram.com/IntersectingCylinders/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[" ", "Text", CellFrame->{{0, 0}, {0, 1}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.691905, 0.790311, 0.300252], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.691905, 0.790311, 0.300252]], Cell[TextData[{ "Contributed by: ", ButtonBox["S\[AAcute]ndor Kabai", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=S%E1ndor+Kabai"]\ , None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=S%E1ndor+Kabai"] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6]], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " 6 system is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA 6 \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.865507, 0.90634, 0.680751], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[0.986023, 0.991363, 0.969818]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["The Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ IntersectingCylinders"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", WindowSize->{710, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Intersecting Cylinders - Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (May 21, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 214, 4, 70, "Section"], Cell[807, 29, 9487, 199, 70, "Input", CellID->90433392] }, Open ]], Cell[10309, 231, 3817, 76, 70, "Output", CellID->149692482], Cell[CellGroupData[{ Cell[14151, 311, 373, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[14527, 322, 904, 24, 70, "Text"], Cell[15434, 348, 337, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[15774, 359, 442, 14, 70, "Text"], Cell[CellGroupData[{ Cell[16241, 377, 829, 24, 70, "Text"], Cell[17073, 403, 1197, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature 9QN@xMgWFwH@tCDP9yoXCY4J *)