(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 4846, 159]*) (*NotebookOutlinePosition[ 5483, 181]*) (* CellTagsIndexPosition[ 5439, 177]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Creating an Animation", "Title"], Cell[TextData[{ "Basically all animations in ", StyleBox["Mathematica", FontSlant->"Italic"], " consist of a sequence of plots which when rendered in rapid succession \ give the appearance of motion. The easiest way to create an animation is to \ use the Table function. Here is an example using two dimensional graphics." }], "Text"], Cell[CellGroupData[{ Cell["2-D Example", "Section"], Cell[CellGroupData[{ Cell["Creating the plots", "Subsection"], Cell["\<\ First we evaluate the following cell. Note the inclusion of \"i\" \ in the argument to the Sin function. This is used to create the appearance of \ motion by shifting the plot a little further to the left for each value of i. \ This will create a sequence of plots.\ \>", "Text"], Cell[BoxData[ \(animation1\ = \ Table[Plot[Sin[x\ + \ 2\ i\ \[Pi]/24], {x, 0, 2\ \[Pi]}], {i, 1, 24}]\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Viewing the animation", "Subsection"], Cell["\<\ To view the above animation we select the second cell bracket \ (counting from the left) and double-click. This will collapse all of the \ cells in the plot to a single cell. Now, leaving that cell bracket selected \ you can use the Cell/Animate Selected Graphics command from the Cell menu or \ use the keyboard shortcut listed there.\ \>", "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["3-D Example", "Section"], Cell["\<\ To create the kind of animation suggested by your original notebook \ we use some of the Graphics packages. We start by loading the packages.\ \>", \ "Text"], Cell[BoxData[ \(<< Graphics`\)], "Input"], Cell["Next we generate the form we want to rotate.", "Text"], Cell[BoxData[ \(aa\ = \ SurfaceOfRevolution[Sin[x], {x, \(-\[Pi]\), \[Pi]}, RevolutionAxis\ \[Rule] \ {1, 0, 0}, Boxed\ \[Rule] \ False, Axes\ \[Rule] \ False]\)], "Input"], Cell["Now we find the ViewPoint for our plot.", "Text"], Cell[BoxData[ \(AbsoluteOptions[aa, ViewPoint]\)], "Input"], Cell["\<\ Now the idea is to create a sequence of ViewPoints which circle \ around the plot maintaining the same distance from the plot.\ \>", "Text"], Cell[BoxData[ \(dist\ = \ \@\(1.3\^2 + 2.4\^2\)\)], "Input"], Cell["\<\ Next we use the Table function to create a series of plots with \ different ViewPoints. The option SphericalRegion is used to maintain the size \ of the plot.\ \>", "Text"], Cell[BoxData[ \(Table[ Show[aa, ViewPoint \[Rule] \ {dist\ Cos[t], dist\ Sin[t], 2}, PlotRange\ \[Rule] \ {{\(-\ \[Pi]\), \ \[Pi]}, {\(-\ \[Pi]\), \ \ \[Pi]}, {\(-1\), 1}}, SphericalRegion\ \[Rule] \ True], {t, \[Pi]/12, 2\ \[Pi], \[Pi]/12}]\)], "Input"], Cell[CellGroupData[{ Cell["Viewing the Animation", "Subsection"], Cell["\<\ We can view the animation the same way we did for the 2-D case. We \ can control the speed and direction of the animation using the controls that \ appear on the lower left of the notebook when we start the animation.\ \>", \ "Text"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"4.1 for Macintosh", ScreenRectangle->{{0, 1280}, {0, 1002}}, WindowSize->{979, 713}, WindowMargins->{{9, Automatic}, {Automatic, 21}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1727, 52, 38, 0, 108, "Title"], Cell[1768, 54, 344, 7, 50, "Text"], Cell[CellGroupData[{ Cell[2137, 65, 30, 0, 56, "Section"], Cell[CellGroupData[{ Cell[2192, 69, 40, 0, 46, "Subsection"], Cell[2235, 71, 289, 5, 50, "Text"], Cell[2527, 78, 138, 3, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[2702, 86, 43, 0, 46, "Subsection"], Cell[2748, 88, 359, 6, 50, "Text"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3156, 100, 30, 0, 56, "Section"], Cell[3189, 102, 167, 4, 32, "Text"], Cell[3359, 108, 45, 1, 27, "Input"], Cell[3407, 111, 60, 0, 32, "Text"], Cell[3470, 113, 205, 4, 27, "Input"], Cell[3678, 119, 55, 0, 32, "Text"], Cell[3736, 121, 63, 1, 27, "Input"], Cell[3802, 124, 150, 3, 32, "Text"], Cell[3955, 129, 65, 1, 35, "Input"], Cell[4023, 132, 182, 4, 32, "Text"], Cell[4208, 138, 284, 5, 43, "Input"], Cell[CellGroupData[{ Cell[4517, 147, 43, 0, 46, "Subsection"], Cell[4563, 149, 243, 5, 50, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)