(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 7582, 174]*) (*NotebookOutlinePosition[ 8637, 210]*) (* CellTagsIndexPosition[ 8593, 206]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{Cell[TextData["Making Animations and Flipbooks"], "Title", Evaluatable->False, AspectRatioFixed->False], Cell[TextData[{ StyleBox["Mathematica", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->False, FontSlant->"Italic"], StyleBox[" code as it appeared in ", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->False], StyleBox["Mathematica", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->False, FontSlant->"Italic"], StyleBox[" in Education, \nVolume 1, No. 1, Fall 1991.", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->False] }], "Text", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->False]}, Open]], Cell[TextData[StyleBox[ "Carl Swenson\nDepartment of Mathematics\nSeattle University\n\ swenson@seattle.edu", Evaluatable->False, AspectRatioFixed->False, FontSlant->"Plain"]], "Subsubtitle", Evaluatable->False, AspectRatioFixed->False], Cell[TextData[ "(* function plot *)\nPlot[x^3-6x^2+9x+3, {x,0,4},\n\t\ PlotRange->{{-1,5},{-1,10}},\n\tPlotStyle->RGBColor[0,0,1]]"], "Input", AspectRatioFixed->True], Cell[TextData[ "(* circle and point graphics *)\nShow[ Graphics[ {Circle[{0,0},1],\n\t\ PointSize[.03],Point[{1,0}]}],\n\tAspectRatio->1]"], "Input", AspectRatioFixed->True], Cell[TextData[ "(* iteration by a For, b+= is the step *)\nFor[ b=.1, b<=4, b+=.25,\n\t\ Plot[x^3-6x^2+9x+3,{x,0,b},\n\tPlotRange ->{{-1,5},{-1,10}}]]\n\t"], "Input", AspectRatioFixed->False], Cell[TextData[ "(* iteration by a Do, creates a small wobble *)\nDo[\n\tShow[\n\t\tGraphics[ \ {Circle[{0,0},1],\n\t\t\t{GrayLevel[.1], Disk[{Cos[t],Sin[t]},.04]}}],\n \t\ AspectRatio->1,\n \tPlotRange->{-1.1, 1.1}],\n \t(* should be {{-1.1, \ 1.1},{-1.1, 1.1}} *)\n{t, 0., 2Pi, Pi/10}] \n"], "Input", AspectRatioFixed->True], Cell[TextData[ "(* iteration by a While, accumulates dots *)\ndots = {PointSize[.05]}; t=0.\n\ While[t<2Pi//N, \t(* t<2Pi will not work *)\n\tAppendTo[ dots, Point[ \ {Cos[t], Sin[t]}]];\n\tShow[ Graphics[{Circle[{0,0},1], dots}],\n \t\ AspectRatio->1];\n t+=Pi/10]"], "Input", AspectRatioFixed->True], Cell[TextData[ "(* pointwise to across-time function animation *)\nf[x_] := x^3-6x^2+9x+3 \ \t\t(* define the function *)\nxmin=-1; xmax=4.5; ymin=0; ymax=8.5\t(* axes \ ranges *) \nxlabel=\"x\"; ylabel=\"f(x)\"\t\t(* axes labels *)\nstart=0; \ stop=4; step=.25\t\t(* graph x controls *)\n\t\t\t\t\t\n(* Iterated copies: \ start/stop/step determines # of frames *)\nFor[ b=start,b<=stop,b+=step, \n\t\ Show[\n \t\tPlot[\t\t\t\t(* function graph *)\n \t\tf[x],{x,xmin,b},\n\t\t\ \tPlotRange ->{{xmin,xmax},{ymin,ymax}},\n\t\t\tAxesLabel ->{xlabel,ylabel},\n\ \t\t\tDisplayFunction -> Identity\t(* no display *)\n\t\t],\n\t\tGraphics[ \ PointSize[.03],\t\t(* points *)\n\t\t\tPoint[{b,0}],\n\t \t\tMap[ Point, \ Table[{x,f[x]}, {x,start,b,step}] ]\n \t\t],\n\t \tGraphics[ Dashing[{.01}],\t\ \t(* line and text *)\t\t \n\t\t\tLine[{{b,0},{b,f[b]}}],\n\t\t\tText[ \ StringForm[\"f(``) = ``\",b,N[f[b],3]],\n\t\t\t\t{xmin+2,ymax+.5},{-1,0}]\n\t\ \t],\n\t\tDisplayFunction ->$DisplayFunction\t(* display *)\n\t]\n] \n\t"], "Input", AspectRatioFixed->False], Cell[TextData[ "(* The Fundamental Theorem of Calculus 2.0 code *)\nf[x_] = 3x^2-12x+9\t\t\n\ integralf[x_] = Integrate[f[x],x]\nxmin = -1; xmax = 4.5; ymin = -4; ymax = \ 10.5\nxlabel = \"x\"; ylabel = \"f(x)\"\nstart = .25; stop = 4; step = .25; \ inc = .05\n\n(* function plot held for later display *)\nfunctionplot=\nPlot[ \ f[x], {x,xmin,xmax},\t\t\n\tPlotRange ->{{xmin,xmax}, {ymin,ymax}},\n\t\ AxesLabel ->{xlabel,ylabel},\n\tPlotStyle ->{{Thickness[.007], \ RGBColor[0,0,1]}},\n\tDisplayFunction ->Identity]\t(* Holds display *)\n\n(* \ area plot coordinate system for later display *)\nareaplot=\nPlot[ \ 0,{x,xmin,xmax},\t\t\n\tPlotRange ->{{xmin,xmax}, {ymin,ymax}},\n\tAxesLabel \ ->{xlabel,\"Area\"},\n\tDisplayFunction ->Identity]\n\t\t\n(* make table of \ function plots, hold display *)\ntableplots1=\nTable[ \n\tShow[\n\t \t\ functionplot,\n\t\tGraphics[ Dashing[{.01}], RGBColor[0,1,0],\n\t\t\tMap[ \ Line, Table[{{x,0}, {x,f[x]}},\n\t\t\t\t{x,start,b,inc}]]\n\t\t]\n\t],\n\ {b,start,stop,step}]\n\t\n(* make table of area point plots and hold display \ *)\ntableplots2=\t\t\nTable[\n\tShow[\n\t\tareaplot,\n\t\tGraphics[ \ PointSize[.02], RGBColor[0,1,0],\n\t\t \t\ Point[{b,integralf[b]-integralf[start]}] \n\t\t]\n\t],\n\ {b,start,stop,step}]\n\n(* Display framed pairs *)\nDo[\n\tShow[\n\t\t\ GraphicsArray[\n\t\t\t{{tableplots1[[i]]},{tableplots2[[i]]}}],\n\t\tFrame \ ->True, DisplayFunction ->$DisplayFunction\n\t],\n{i,1,16}]\n\n(* Generate \ last frame with all area points *)\nShow[\n\tGraphicsArray[\n\t\t\ {{tableplots1[[16]]},{Show[tableplots2]}}],\n\tFrame->True,DisplayFunction \ ->$DisplayFunction]"], "Input", AspectRatioFixed->True], Cell[TextData[ "(* Title page for Fundamental Theorem flipbook *)\ntitle=\nShow[\t\t\n\t\ Graphics[\n\t{\n\tText[FontForm[\n\t\t\"The\",\n\t\t\ {\"Times-Bold\",14.}],{1.75,9.0}],\n\tText[FontForm[\n\t\t\"Fundamental \ Theorem\",\n\t\t{\"Times-Bold\",14.}],{1.75,7.0}],\n\tText[FontForm[\n\t\t\ \"of Calculus\",\n\t\t{\"Times-Bold\",14.}],{1.75,5.0}],\n\tText[FontForm[\n\t\ \t\"Carl Swenson\",\n\t\t{\"Times-Bold\",12.}],{1.75,2.0}],\n\tText[FontForm[\ \n\t\t\"Seattle University\",\n\t\t{\"Times-Bold\",12.}],{1.75,0.0}],\n\t\ Text[FontForm[\n\t\t\"1991\",\n\t\t{\"Times-Bold\",9.}],{1.75,-2.0}]\n\t},\n\t\ PlotRange ->{{xmin,xmax},{ymin,ymax}},\t\n\tDisplayFunction ->Identity\n\t\t]\ \n]\n(* Generate title frame *)\nShow[\n\tGraphicsArray[\n\t{{title},\n\t \ {Show[{tableplots1[[16]],tableplots2}]}}],\n\tFrame->True,DisplayFunction \ ->$DisplayFunction]"], "Input", AspectRatioFixed->True] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 640}, {0, 460}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{520, 365}, WindowMargins->{{44, Automatic}, {Automatic, 31}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, MacintoshSystemPageSetup->"\<\ AVU/IFiQKFD000000V8nh09RAj0000000OXQ<097PXP0AP1Y06`0I@1^0642HSkP 0V97`0000001nR4@0TN2R000000000000000009R?^0000000000000000000000 00000000000000000000000000000000\>" ] (*********************************************************************** 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[1731, 51, 107, 2, 70, "Title", Evaluatable->False], Cell[1841, 55, 624, 22, 70, "Text", Evaluatable->False] }, Closed]], Cell[2477, 79, 246, 7, 70, "Subsubtitle", Evaluatable->False], Cell[2726, 88, 168, 3, 70, "Input"], Cell[2897, 93, 175, 3, 70, "Input"], Cell[3075, 98, 193, 3, 70, "Input"], Cell[3271, 103, 341, 5, 70, "Input"], Cell[3615, 110, 311, 5, 70, "Input"], Cell[3929, 117, 1063, 15, 70, "Input"], Cell[4995, 134, 1685, 24, 70, "Input"], Cell[6683, 160, 896, 13, 70, "Input"] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)