(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' 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[ 12287, 379]*) (*NotebookOutlinePosition[ 13210, 410]*) (* CellTagsIndexPosition[ 13166, 406]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Initialization", "Section", AspectRatioFixed->False, ImageRegion->{{0, 1}, {0, 1}}, FontFamily->"Arial", FontSize->36], Cell["You need to be in a directory that makes sense to you:", "Text"], Cell[BoxData[ \(\(SetDirectory["\"];\)\)], "Input", InitializationCell->True], Cell["\<\ The next two functions are useful when you go to write the gifs to the \ directory.\ \>", "Text"], Cell[BoxData[{ \(\(Clear[filename];\)\), "\n", \(filename[ k_]\ := \ "\"\ \ <> \ \ ToString[ k]\ \ <> \ \ "\<.gif\>"\)}], "Input", InitializationCell->True], Cell[BoxData[{ \(\(Clear[filewriter];\)\), "\n", \(filewriter[ t_]\ := \ \((Display[ filename[t], \ #, \ "\"]; \ #)\)\ &\)}], "Input", InitializationCell->True], Cell["Here are a bunch of 3D functions that I use a lot:", "Text"], Cell[BoxData[ \(distance[pt1_, pt2_] := Sqrt[\((pt1[\([1]\)] - pt2[\([1]\)])\)^2\ + \ \((pt1[\([2]\)] - pt2[\([2]\)])\)^2\ + \ \((pt1[\([3]\)]\ - pt2[\([3]\)])\)^2]\)], "Input", InitializationCell->True], Cell[BoxData[ \(totaldistance[points_] := Sum[distance[points[\([i]\)], points[\([i - 1]\)]], {i, 2, Length[points]}]\)], "Input", InitializationCell->True], Cell["amblight = GrayLevel[0.3];", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell["lightsrc = {{{-0.25,1,1}, GrayLevel[1]}};", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell["\<\ standardviewpoint = {3.780, 1.765, 0.779}; viewpoint = standardviewpoint;\ \>", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell[CellGroupData[{ Cell["\<\ axes[xmax_,ymax_,zmax_]:= Graphics3D[{ Thickness[0.003], Line[{{0,0,0},{xmax,0,0}}], Line[{{0,0,0},{0,ymax,0}}], Line[{{0,0,0},{0,0,zmax}}] }]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{0, 1}, {0, 1}}], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(axes\\)\\\" is similar to existing symbol \\\ \"\\!\\(Axes\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell["\<\ axes[{x,xmin_,xmax_}, {y,ymin_,ymax_}, {z,zmin_,zmax_}]:= Graphics3D[{ Thickness[0.003], Line[{{xmin,0,0},{xmax,0,0}}], Line[{{0,ymin,0},{0,ymax,0}}], Line[{{0,0,zmin},{0,0,zmax}}] }]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{0, 1}, {0, 1}}], Cell[CellGroupData[{ Cell["xticklen = 0.1; yticklen = 0.2; zticklen = 0.1;", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(yticklen\\)\\\" is similar to existing \ symbol \\\"\\!\\(xticklen\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(zticklen\\)\\\" is similar to existing \ symbols \\!\\({xticklen, yticklen}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\ \\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell["\<\ xtick[x_]:= Graphics3D[{Thickness[0.003], Line[{{x,-xticklen,0},{x,xticklen,0}}] }];\ \>", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell["\<\ ytick[y_]:= Graphics3D[{Thickness[0.003], Line[{{-yticklen,y,0},{yticklen,y,0}}] }];\ \>", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell["\<\ ztick[z_]:= Graphics3D[{Thickness[0.003], Line[{{0,-zticklen,z},{0,zticklen,z}}] }];\ \>", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell["\<\ Note that the only difference in the next two lists is the definition of \ DisplayFunction:\ \>", "Text"], Cell["\<\ show3dopts = {Boxed->False, Axes->None, DisplayFunction->$DisplayFunction, ViewPoint -> viewpoint, AmbientLight -> amblight, LightSources -> lightsrc, PlotRange -> All};\ \>", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}], Cell["\<\ writegifs3dopts[n_]:= {Boxed->False, Axes->None, DisplayFunction->filewriter[n], ViewPoint -> viewpoint, AmbientLight -> amblight, LightSources -> lightsrc, PlotRange -> All};\ \>", "Input", InitializationCell->True, ImageRegion->{{0, 1}, {0, 1}}] }, Closed]], Cell[CellGroupData[{ Cell["Helix-like curve", "Section", AspectRatioFixed->False, ImageRegion->{{0, 1}, {0, 1}}, FontFamily->"Arial", FontSize->36], Cell["Here we make the curve and some tick marks:", "Text"], Cell["t1 = 0.0;", "Input", ImageRegion->{{0, 1}, {0, 1}}], Cell["t2 = 4*Pi;", "Input", ImageRegion->{{0, 1}, {0, 1}}], Cell["\<\ xmin = -1.2; xmax = 1.2; ymin = -1.2; ymax = 1.2; zmin = 0.0; zmax = 32.0;\ \>", "Input", ImageRegion->{{0, 1}, {0, 1}}], Cell["xticks = Table[xtick[i],{i,Ceiling[xmin],Floor[xmax]}];", "Input", ImageRegion->{{0, 1}, {0, 1}}], Cell["yticks = Table[ytick[i],{i,Ceiling[ymin],Floor[ymax]}];", "Input", ImageRegion->{{0, 1}, {0, 1}}], Cell["zticks = Table[ztick[i],{i,0,30,5}];", "Input", ImageRegion->{{0, 1}, {0, 1}}], Cell[BoxData[ \(f[t_] := {Cos[t], Sin[t], \((2/3)\) t^\((3/2)\)}\)], "Input"], Cell[BoxData[ \(\(curve = ParametricPlot3D[ Append[f[t], {RGBColor[0, 0, 1], Thickness[0.005]}], {t, t1, t2}];\)\)], "Input"], Cell["These last two computations determine the arc length :", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Integrate[Sqrt[1 + t], {t, 0, 4\ Pi}]\)], "Input"], Cell[BoxData[ \(2\/3\ \((\(-1\) + \((1 + 4\ \[Pi])\)\^\(3/2\))\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(N[Integrate[Sqrt[1 + t], {t, 0, 4 Pi}]]\)], "Input"], Cell[BoxData[ \(32.64560555067126`\)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Make animation for Quicktime", "Section", FontFamily->"Arial", FontSize->36], Cell["\<\ This Do statement makes the frames in the animation. You can animate the \ results inside of Mathematica to get some idea of what the Quicktime \ animation will look like.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(Do[\[IndentingNewLine]pts = Table[f[t], {t, t1, t2, \((t2 - t1)\)/n}]; \[IndentingNewLine]gpts\ = \ Graphics3D[{PointSize[0.02], Map[Point, pts]}]; \[IndentingNewLine]lines\ = \ Graphics3D[{RGBColor[1, 0, 0], Thickness[0.004], Line[pts]}]; \ \[IndentingNewLine]Show[\[IndentingNewLine]axes[{x, xmin, xmax}, {y, ymin, ymax}, {z, zmin, zmax}], \[IndentingNewLine]curve, gpts, lines, \[IndentingNewLine]xticks, yticks, zticks, \[IndentingNewLine]show3dopts, \[IndentingNewLine]ImageSize \ \[Rule] {600, 375}, \[IndentingNewLine]BoxRatios \[Rule] {1, 1, .75}, \[IndentingNewLine]DefaultFont \[Rule] \ {"\", 18}, \[IndentingNewLine]PlotLabel \[Rule] "\" <> ToString[ PaddedForm[n, 3]]\ <> "\<\n approx length =\>"\ \ PaddedForm[ N[totaldistance[pts]], {4, 2}]\[IndentingNewLine]];, \[IndentingNewLine]{n, 10, 50}\[IndentingNewLine]];\)\(\[IndentingNewLine]\) \)\)], "Input"], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(gpts\\)\\\" is similar to existing symbol \\\ \"\\!\\(pts\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\ \\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message"] }, Open ]], Cell["\<\ Once you are happy with the results above, copy the Do statement and change \ show3dopts to writegifs3dopts. Also, it helps if you put the gifs in a new \ directory. Then it is easier to clean up.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SetDirectory["\"]\)], "Input"], Cell[BoxData[ \("C:\\Documents and Settings\\Paul\\my \ documents\\MAA-NES_Project_NeXT\\gifs"\)], "Output"] }, Open ]], Cell[BoxData[ \(\(Do[\[IndentingNewLine]pts = Table[f[t], {t, t1, t2, \((t2 - t1)\)/n}]; \[IndentingNewLine]gpts\ = \ Graphics3D[{PointSize[0.02], Map[Point, pts]}]; \[IndentingNewLine]lines\ = \ Graphics3D[{RGBColor[1, 0, 0], Thickness[0.004], Line[pts]}]; \ \[IndentingNewLine]Show[\[IndentingNewLine]axes[{x, xmin, xmax}, {y, ymin, ymax}, {z, zmin, zmax}], \[IndentingNewLine]curve, gpts, lines, \[IndentingNewLine]xticks, yticks, zticks, \[IndentingNewLine]writegifs3dopts[ n - 9], \[IndentingNewLine]ImageSize \[Rule] {600, 375}, \[IndentingNewLine]BoxRatios \[Rule] {1, 1, .75}, \[IndentingNewLine]DefaultFont \[Rule] \ {"\", 18}, \[IndentingNewLine]PlotLabel \[Rule] "\" <> ToString[ PaddedForm[n, 3]]\ <> "\<\n approx length =\>"\ \ PaddedForm[ N[totaldistance[pts]], {4, 2}]\[IndentingNewLine]];, \[IndentingNewLine]{n, 10, 50}\[IndentingNewLine]];\)\)], "Input"], Cell["You are now ready to make an animation using Quicktime Pro.", "Text"] }, Closed]] }, FrontEndVersion->"5.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 679}}, AutoGeneratedPackage->Automatic, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{979, 626}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, StyleDefinitions -> "Default.nb" ] (******************************************************************* 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[1776, 53, 132, 4, 92, "Section"], Cell[1911, 59, 70, 0, 33, "Text"], Cell[1984, 61, 152, 3, 30, "Input", InitializationCell->True], Cell[2139, 66, 107, 3, 33, "Text"], Cell[2249, 71, 196, 5, 50, "Input", InitializationCell->True], Cell[2448, 78, 199, 5, 50, "Input", InitializationCell->True], Cell[2650, 85, 66, 0, 33, "Text"], Cell[2719, 87, 253, 5, 30, "Input", InitializationCell->True], Cell[2975, 94, 180, 4, 30, "Input", InitializationCell->True], Cell[3158, 100, 104, 2, 30, "Input", InitializationCell->True], Cell[3265, 104, 119, 2, 30, "Input", InitializationCell->True], Cell[3387, 108, 159, 5, 48, "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[3571, 117, 410, 10, 120, "Input", InitializationCell->True], Cell[3984, 129, 356, 5, 22, "Message"] }, Open ]], Cell[4355, 137, 461, 12, 156, "Input", InitializationCell->True], Cell[CellGroupData[{ Cell[4841, 153, 125, 2, 30, "Input", InitializationCell->True], Cell[4969, 157, 364, 5, 22, "Message"], Cell[5336, 164, 367, 5, 22, "Message"] }, Open ]], Cell[5718, 172, 212, 6, 66, "Input", InitializationCell->True], Cell[5933, 180, 212, 6, 66, "Input", InitializationCell->True], Cell[6148, 188, 212, 6, 66, "Input", InitializationCell->True], Cell[6363, 196, 115, 3, 33, "Text"], Cell[6481, 201, 342, 10, 138, "Input", InitializationCell->True], Cell[6826, 213, 348, 10, 138, "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[7211, 228, 134, 4, 62, "Section"], Cell[7348, 234, 59, 0, 33, "Text"], Cell[7410, 236, 59, 1, 30, "Input"], Cell[7472, 239, 60, 1, 30, "Input"], Cell[7535, 242, 132, 5, 66, "Input"], Cell[7670, 249, 105, 1, 30, "Input"], Cell[7778, 252, 105, 1, 30, "Input"], Cell[7886, 255, 86, 1, 30, "Input"], Cell[7975, 258, 81, 1, 30, "Input"], Cell[8059, 261, 161, 4, 30, "Input"], Cell[8223, 267, 70, 0, 33, "Text"], Cell[CellGroupData[{ Cell[8318, 271, 70, 1, 30, "Input"], Cell[8391, 274, 82, 1, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8510, 280, 73, 1, 30, "Input"], Cell[8586, 283, 52, 1, 29, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[8687, 290, 86, 2, 62, "Section"], Cell[8776, 294, 195, 4, 33, "Text"], Cell[CellGroupData[{ Cell[8996, 302, 1193, 23, 370, "Input"], Cell[10192, 327, 355, 5, 22, "Message"] }, Open ]], Cell[10562, 335, 220, 4, 52, "Text"], Cell[CellGroupData[{ Cell[10807, 343, 57, 1, 30, "Input"], Cell[10867, 346, 112, 2, 29, "Output"] }, Open ]], Cell[10994, 351, 1199, 23, 350, "Input"], Cell[12196, 376, 75, 0, 33, "Text"] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)