(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 16808, 504] NotebookOptionsPosition[ 15643, 467] NotebookOutlinePosition[ 16037, 484] CellTagsIndexPosition[ 15994, 481] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[{ StyleBox["Visualizing an implicitly defined surface\n", "Section"], StyleBox["This is a plot of the surface ", "Subsection"], StyleBox["z=(sin(x)+cos(y))/(1+x^2+y^2)", "Subsection"], StyleBox["\n", "Text"] }], "Input", CellChangeTimes->{{3.46246389964536*^9, 3.462463931377871*^9}, { 3.462464010272235*^9, 3.462464046107359*^9}, {3.462464150488432*^9, 3.4624642499975147`*^9}, {3.462464287135469*^9, 3.462464299972993*^9}, { 3.4624644734579897`*^9, 3.462464539682302*^9}, {3.462464574719906*^9, 3.4624646481052094`*^9}, {3.462467246056759*^9, 3.462467253750005*^9}, { 3.4624786649532022`*^9, 3.462478751514797*^9}}], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "+", RowBox[{"Cos", "[", "y", "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{"1", "+", RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}]}], "-", "z"}], "\[Equal]", "0"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", ".5"}], ",", "1.75"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"x", ",", "y", ",", "z"}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.4624787121326427`*^9, 3.4624787129965363`*^9}, 3.4624797167858553`*^9}], Cell[TextData[{ StyleBox["We can pass a plane z = const through this and look at the curves \ we get. These are called traces", "Subsection"], " :" }], "Input", CellChangeTimes->{{3.462484130055233*^9, 3.462484149920331*^9}, { 3.462484206246488*^9, 3.462484206822858*^9}}, FormatType->"TextForm"], Cell[BoxData[ RowBox[{"Animate", "[", RowBox[{ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "+", RowBox[{"Cos", "[", "y", "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{"1", "+", RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}]}], "-", "z"}], "\[Equal]", "0"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", " ", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "6"}], ",", "6"}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", ".5"}], ",", "1.25", ",", ".0025"}], "}"}], ",", " ", RowBox[{"AnimationRate", "\[Rule]", "0.25"}], ",", RowBox[{"AnimationRunning", "\[Rule]", "False"}], ",", RowBox[{"AnimationRepetitions", "\[Rule]", "1"}], ",", " ", RowBox[{"AnimationDirection", "\[Rule]", "Forward"}]}], "]"}]], "Input", CellChangeTimes->{{3.4624853346782207`*^9, 3.462485338038171*^9}}], Cell[TextData[StyleBox["We can also draw all of those contours at once :", \ "Subsection"]], "Input", CellChangeTimes->{{3.462478454381159*^9, 3.4624784615893097`*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], "+", RowBox[{"Cos", "[", "y", "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{"1", "+", RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"Contours", "\[Rule]", "60"}], ",", RowBox[{"PlotPoints", "\[Rule]", "60"}], ",", RowBox[{"ClippingStyle", "\[Rule]", "Pink"}], ",", RowBox[{"MaxRecursion", "\[Rule]", "Automatic"}]}], "]"}]], "Input", CellChangeTimes->CompressedData[" 1:eJxTTMoPSmViYGAQBWIQ3Sh6d6HCmZeOAjl9S0D0pMWPVoDoI7FrV4LokOpP 20F0ppvpDhC97HfHXhB974vpMRDtcmfCORB9tMHnAog+33z2Goj+deLXTRB9 rXTTfRD9P/MOmPYJYXoDol9d5AfTTrMevQfRWzn9PoDon+U//oNo92fMQopA +tShj3FaQFq7wzQeRHvtz0sG0WXsTWA6kH1NBog2W78OTB/YND0XRC/QmF4A ov3Pms4D0d0BeWC64NyNJSC60vf4ChAddsNzLYjesjIcTHtOerAZRDspvt8O opU0fPeAzVu8E0wXLNt9AET3dDBdBdFWi3rugWiVAwdfgmgARxa6Hw== "]], Cell[TextData[{ "\n", StyleBox["Here are the plots of the \"standard models,\" and their traces:", "Section"], "\n", StyleBox["First: ", "Subsection"], StyleBox["x^2+y^2+z^2=1", "Subsection"] }], "Input", CellChangeTimes->{{3.462478481066351*^9, 3.4624785286253157`*^9}, { 3.462478578560953*^9, 3.462478585511697*^9}}, FormatType->"TextForm"], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}], "-", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", " ", RowBox[{"ClippingStyle", "\[Rule]", "Pink"}], ",", " ", RowBox[{"Contours", "\[Rule]", RowBox[{"Function", "[", RowBox[{"-", RowBox[{ RowBox[{"Range", "[", RowBox[{ RowBox[{"-", "2"}], ",", "0", ",", ".05"}], "]"}], "^", "2"}]}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.462478944132827*^9, 3.462479033256266*^9}, { 3.4624791083626013`*^9, 3.462479109574417*^9}, {3.4624794288318357`*^9, 3.462479433301962*^9}, {3.462484927466587*^9, 3.462484995401366*^9}, { 3.462485068580781*^9, 3.4624851087871513`*^9}}], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}], "+", RowBox[{"z", "^", "2"}]}], "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.462467330584609*^9, 3.462467376021801*^9}, { 3.462467411106633*^9, 3.46246741604034*^9}, 3.462479121797997*^9}], Cell[TextData[StyleBox["Next : -x^2 + y^2 + z^2 = 1", "Subsection"]], "Input", CellChangeTimes->{{3.4624790597839108`*^9, 3.462479071798271*^9}, { 3.462479142525558*^9, 3.462479146186677*^9}}, FormatType->"TextForm"], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"y", "^", "2"}], "-", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", " ", RowBox[{"ClippingStyle", "\[Rule]", "Pink"}], ",", " ", RowBox[{"Contours", "\[Rule]", RowBox[{"Function", "[", RowBox[{"-", RowBox[{ RowBox[{"Range", "[", RowBox[{ RowBox[{"-", "4"}], ",", "0", ",", ".25"}], "]"}], "^", "2"}]}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.462479052047475*^9, 3.462479054479491*^9}, { 3.4624792102767963`*^9, 3.462479265177175*^9}, {3.462479317571286*^9, 3.462479320281728*^9}, {3.462479437376*^9, 3.462479449041922*^9}, 3.462479584793063*^9, {3.462485148963275*^9, 3.462485151690215*^9}}], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"y", "^", "2"}], "+", RowBox[{"z", "^", "2"}]}], "\[Equal]", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{ 3.462479337986305*^9, {3.4624793910933867`*^9, 3.462479391880473*^9}}], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"Next", " ", ":", " ", RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], " ", "+", " ", RowBox[{"y", "^", "2"}], " ", "+", " ", RowBox[{"z", "^", "2"}]}]}], " ", "=", " ", RowBox[{"-", "1"}]}], "Subsection"]], "Input", CellChangeTimes->{{3.4624791669336567`*^9, 3.462479200842485*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"y", "^", "2"}], "+", "1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", " ", RowBox[{"ClippingStyle", "\[Rule]", "Pink"}], ",", " ", RowBox[{"Contours", "\[Rule]", RowBox[{"Function", "[", RowBox[{"-", RowBox[{ RowBox[{"Range", "[", RowBox[{ RowBox[{"-", "4"}], ",", "0", ",", ".25"}], "]"}], "^", "2"}]}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.4624794069444113`*^9, 3.462479413352174*^9}, { 3.462479451207197*^9, 3.462479457149781*^9}, {3.4624795003760643`*^9, 3.462479501748967*^9}, 3.46247958368255*^9, {3.462485166705546*^9, 3.462485169121461*^9}}], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"y", "^", "2"}], "+", RowBox[{"z", "^", "2"}]}], "\[Equal]", RowBox[{"-", "1"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{3.462479403494961*^9}], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"Next", " ", ":", " ", RowBox[{ RowBox[{"x", "^", "2"}], " ", "+", " ", RowBox[{"y", "^", "2"}], " ", "-", " ", "z"}]}], " ", "=", " ", "0"}], "Subsection"]], "Input", CellChangeTimes->{{3.462479537340917*^9, 3.462479548564694*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", " ", RowBox[{"ClippingStyle", "\[Rule]", "Pink"}], ",", " ", RowBox[{"Contours", "\[Rule]", RowBox[{"Function", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "4", ",", ".25"}], "]"}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.462479562859044*^9, 3.46247958231262*^9}, { 3.462485192912792*^9, 3.462485192952856*^9}}], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{ RowBox[{"z", "-", RowBox[{"x", "^", "2"}], "-", RowBox[{"y", "^", "2"}]}], "\[Equal]", "0"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"z", ",", "0", ",", "2"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"Next", " ", ":", " ", RowBox[{ RowBox[{"x", "^", "2"}], " ", "-", " ", RowBox[{"y", "^", "2"}], " ", "-", " ", "z"}]}], " ", "=", " ", "0"}], "Subsection"]], "Input", CellChangeTimes->{{3.462479607056435*^9, 3.462479607280301*^9}}], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{ RowBox[{"z", "-", RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], "\[Equal]", "0"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.462467650562149*^9, 3.462467677765551*^9}, { 3.462479621687436*^9, 3.4624796261274967`*^9}}], Cell[BoxData[ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"y", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"PlotPoints", "\[Rule]", "40"}], ",", " ", RowBox[{"ClippingStyle", "\[Rule]", "Pink"}], ",", " ", RowBox[{"Contours", "\[Rule]", RowBox[{"Function", "[", RowBox[{"Range", "[", RowBox[{ RowBox[{"-", "2"}], ",", "2", ",", ".25"}], "]"}], "]"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.462479658893841*^9, 3.462479664422632*^9}}], Cell[TextData[StyleBox["Here' s a sphere (orange) and a more general \ ellipsoid (blue) :", "Subsection"]], "Input", CellChangeTimes->{{3.462478540924069*^9, 3.462478557666307*^9}}, FormatType->"TextForm"], Cell[BoxData[ RowBox[{"ContourPlot3D", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}], "+", RowBox[{"z", "^", "2"}]}], "\[Equal]", "1"}], ",", RowBox[{ RowBox[{ RowBox[{"9", "*", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"4", "*", RowBox[{"y", "^", "2"}]}], "+", RowBox[{"z", "^", "2"}]}], "\[Equal]", "3"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1.75"}], ",", "1.75"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1.75"}], ",", "1.75"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "1.75"}], ",", "1.75"}], "}"}], ",", RowBox[{"Mesh", "\[Rule]", "None"}], ",", " ", RowBox[{"ContourStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Directive", "[", RowBox[{"Orange", ",", RowBox[{"Opacity", "[", "0.8", "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "30"}], "]"}]}], "]"}], ",", RowBox[{"Directive", "[", RowBox[{"Blue", ",", RowBox[{"Opacity", "[", "0.8", "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "30"}], "]"}]}], "]"}]}], "}"}]}], ",", RowBox[{"PlotPoints", "\[Rule]", "30"}]}], "]"}]], "Input", CellChangeTimes->{{3.462468035344673*^9, 3.4624680721418324`*^9}, { 3.4624681080336514`*^9, 3.462468167484798*^9}, {3.4624682567622843`*^9, 3.462468290415873*^9}, {3.462468353586773*^9, 3.462468405825165*^9}}] }, WindowSize->{640, 656}, WindowMargins->{{55, Automatic}, {Automatic, 18}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, FrontEndVersion->"7.0 for Mac OS X x86 (32-bit) (November 11, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 648, 11, 65, "Input"], Cell[1196, 33, 896, 28, 43, "Input"], Cell[2095, 63, 302, 7, 29, "Input"], Cell[2400, 72, 1287, 35, 73, "Input"], Cell[3690, 109, 169, 2, 29, "Input"], Cell[3862, 113, 1132, 29, 58, "Input"], Cell[4997, 144, 355, 10, 64, "Input"], Cell[5355, 156, 962, 25, 43, "Input"], Cell[6320, 183, 630, 18, 27, "Input"], Cell[6953, 203, 220, 3, 29, "Input"], Cell[7176, 208, 1001, 26, 43, "Input"], Cell[8180, 236, 608, 19, 27, "Input"], Cell[8791, 257, 365, 10, 31, "Input"], Cell[9159, 269, 959, 26, 43, "Input"], Cell[10121, 297, 577, 19, 27, "Input"], Cell[10701, 318, 299, 8, 31, "Input"], Cell[11003, 328, 718, 19, 43, "Input"], Cell[11724, 349, 461, 14, 27, "Input"], Cell[12188, 365, 299, 8, 31, "Input"], Cell[12490, 375, 599, 17, 27, "Input"], Cell[13092, 394, 717, 21, 43, "Input"], Cell[13812, 417, 207, 3, 29, "Input"], Cell[14022, 422, 1617, 43, 88, "Input"] } ] *) (* End of internal cache information *)