(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.1' 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[ 93720, 2281]*) (*NotebookOutlinePosition[ 94552, 2311]*) (* CellTagsIndexPosition[ 94478, 2305]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ StyleBox["Constructing Mathlets Quickly using LiveGraphics3D", FontSize->24, FontWeight->"Bold", FontVariations->{"Underline"->True}], "\nAccompanying ", StyleBox["Mathematica", FontSlant->"Italic"], " Code\n\n", StyleBox["Martin Kraus: Martin.Kraus@informatik.uni-stuttgart.de\nJonathan \ Rogness: rogness@math.umn.edu", FontSize->12] }], "Text", TextAlignment->Center, FontSize->16, FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[TextData[{ "This notebook contains ", StyleBox["Mathematica", FontSlant->"Italic"], " commands to create the more complicated examples in our article. It is \ not meant to replace the article, and most of the sections are devoid of any \ comments or explanations. See the article for more information." }], "Text"], Cell[CellGroupData[{ Cell["Initialization Cells", "Section"], Cell[TextData[{ "The following commands are used throughout the notebook to convert ", StyleBox["Mathematica", FontSlant->"Italic"], " graphics into LiveGraphics3D input files." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ StyleBox[\(LiveForm[graphics_, \ animOpts___]\ := \ \n\ \ \ Module[{graphics3d\ = \ Switch[graphics, \ _ContourGraphics, \ \n\ \ \ Graphics3D[ SurfaceGraphics[ graphics]], \ _DensityGraphics, \ \n\ \ \ Graphics3D[ SurfaceGraphics[ graphics]], \ _SurfaceGraphics, \ \n\ \ \ Graphics3D[ graphics], \ _, \ graphics] //. SequenceForm[x___] :> \n\ \ \ StringForm[ StringJoin[Table["\<``\>", \ {Length[{x}]}]], \ x]}, \ \n\ \ \ Switch[ graphics3d, \ _List, \ \(HoldForm[ShowAnimation]\)[\n\ \ \ Map[ LiveForm, \ graphics3d], \ InputForm[N[Flatten[{animOpts}]]]], \ \n\ \ \ _, \ InputForm[N[graphics3d]]]];\), FontFamily->"Courier", FontSize->13], "\n", StyleBox[\(LiveForm[graphics_, \ {var_, \ from_, \ to_, \ step_}, \ animOpts___]\ := \ \n\ \ \ \ Module[{}, \(HoldForm[Animate]\)[ LiveForm[graphics], \ \n\ \ \ \ InputForm[ N[{var, from, to, step}]], InputForm[N[Flatten[{animOpts}]]]]]; WriteLiveForm[filename_, \ graphics_, \ animOpts___]\ := \ \n\ \ \ \ Module[{ps, x}, \ ps = Unprotect[Real]; \ Format[x_Real, \ InputForm]\ := \ \n\ \ \ \ OutputForm[ NumberForm[x, \ 5, \ NumberFormat\ -> \ \((If[#3\ == \ "\<\>", \ #1, \ \n\ \ \ \ \ SequenceForm[#1, \ "\<*^\>", \ #3]]\ &)\)]]; \ Protect @@ ps; \n\ \ \ \ WriteString[filename, \ ToString[ LiveForm[graphics, \ animOpts], \n\ \ \ \ CharacterEncoding -> None]]; \ Close[filename]; \n\ \ \ \ ps = Unprotect[Real]; \ Format[x_Real, \ InputForm]\ =. ; \ Protect @@ ps;];\), FontFamily->"Courier", FontSize->13]}], "Input", CellLabel->"In[1]:=", InitializationCell->True], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(LiveForm\\)\\\" is similar to existing \ symbol \\\"\\!\\(LineForm\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[1]:="] }, Open ]], Cell["\<\ The following code defines a three dimensional arrow primitive \ which is used in some of the more advanced examples.\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ (* :Title: Three-Dimensional Arrow Graphics *) (* :Context: Arrow3D` *) (* :Author: Martin Kraus *) (* :Summary: This package introduces the functions Arrow3D[start, finish] and ArcArrow3D[center, axis1, axis2] to create three-dimensional (curved) arrows with flat arrowheads. *) (* :Package Version: 1.1 (December 97) *) (* :Mathematica Version: 3.0 *) (* :Copyright: Copyright 1997, Martin Kraus*) (* :History: November 1997 V 0.0 12/14/1997 added HeadPointColor and TailPointColor (V 1.1) *) (* :Keywords: \tArrow, Vector, Graphics *) (* :Sources: \tArrow.m *) (* :Limitations: *) (* :Discussion: *) BeginPackage[\"Arrow3D`\"] Arrow3D::usage= \"Arrow3D[start, finish, (opts)] generates several graphics primitives representing an arrow starting at start and ending at finish. There are arrowheads of length 0 by default, i.e. no arrowheads.\"; ArcArrow3D::usage= \"ArcArrow3D[center, axis1, axis2, (opts)] generates several graphics primitives representing an arc with arrowhead starting at center+axis1 and ending in the direction of center+axis2. There are arrowheads of length 0 by default, i.e. no arrowheads.\"; HeadLength::usage= \"HeadLength is an option to Arrow3D and ArcArrow3D. It describes the length of the arrowhead.\"; HeadWidth::usage= \"HeadWidth is an option to Arrow3D and ArcArrow3D. It describes the width of the arrowhead, relative to the length of the arrowhead (specified by HeadLength).\"; HeadCenter::usage= \"HeadCenter is an option to Arrow3D and ArcArrow3D. It describes the location of the center of the base of the arrowhead along the length of the arrow, as a factor of the length of the arrowhead. That is, if HeadCenter -> 0, the arrow will be two lines; if HeadCenter -> 1, the arrowhead will be a perfect triangle; otherwise, the arrowhead will be four-sided.\"; HeadTop::usage= \"HeadTop is an option to Arrow3D and ArcArrow3D. It describes the location of the top of the arrowhead along the length of the arrow. It may be used to leave some space at the top for a point, specified by HeadPointSize.\"; HeadPointSize::usage= \"HeadPointSize is an option to Arrow3D and ArcArrow3D. It describes the size of a point at the top of the arrow, relative to the width of the whole plot.\"; HeadPointColor::usage= \"HeadPointColor is an option to Arrow3D and ArcArrow3D. It specifys the color of a point at the top of the arrow. If set to Automatic the color of \ the arrow is used.\"; HeadBlockWidth::usage= \"HeadBlockWidth is an option to Arrow3D and ArcArrow3D. It describes the width of a line at the top of the arrowhead, perpendicular to the arrow.\"; HeadNormal::usage= \"HeadNormal is an option to Arrow3D and ArcArrow3D. It describes the normal direction of the arrowhead.\"; TailLength::usage= \"TailLength is an option to Arrow3D and ArcArrow3D. It works exactly like HeadLength, but for the tail of the arrow\"; TailWidth::usage= \"TailWidth is an option to Arrow3D and ArcArrow3D. It works exactly like HeadWidth, but for the tail of the arrow\"; TailCenter::usage= \"TailCenter is an option to Arrow3D and ArcArrow3D. It works exactly like HeadCenter, but for the tail of the arrow\"; TailTop::usage= \"TailTop is an option to Arrow3D It works exactly like HeadTop, but for the tail of the arrow\"; TailPointSize::usage= \"TailPointSize is an option to Arrow3D and ArcArrow3D. It works exactly like HeadPointSize, but for the tail of the arrow\"; TailPointColor::usage= \"TailPointColor is an option to Arrow3D and ArcArrow3D. It works exactly like HeadPointColor, but for the tail of the arrow\"; TailBlockWidth::usage= \"TailBlockWidth is an option to Arrow3D and ArcArrow3D. It works exactly like HeadBlockWidth, but for the tail of the arrow\"; TailNormal::usage= \"TailNormal is an option to Arrow3D and ArcArrow3D. It works exactly like HeadNormal, but for the tail of the arrow\"; GreaterPi::usage= \"GreaterPi is an option to ArcArrow3D. If set to True an angle greater than Pi is drawn, otherwise an angle less than Pi.\"; Begin[\"`Private`\"] (* The Arrow3D function *) Options[Arrow3D]= {HeadBlockWidth->0, HeadCenter->1, HeadLength->0, HeadNormal->{0,0,1}, HeadPointSize->0, HeadPointColor->Automatic, HeadTop->0, HeadWidth->0.5, TailBlockWidth->0, TailCenter->1, TailLength->0, TailNormal->{0,0,1}, TailPointSize->0, TailPointColor->Automatic, TailTop->0, TailWidth->0.5}; Arrow3D[a_,b_,opts___]:= Module[{g={},headPoint,tailPoint,abLength=N[Sqrt[(b-a).(b-a)]],abUnit, headPerp,headPerpLength,tailPerp,tailPerpLength,headBlockWidth, headCenter,headLength,headNormal,headPointSize,headPointColor, headTop,headWidth, tailBlockWidth,tailCenter,tailLength,tailNormal,tailPointSize,\ tailPointColor, tailTop,tailWidth}, {headBlockWidth,headCenter,headLength,headNormal, headPointSize,headPointColor,headTop,headWidth,tailBlockWidth,\ tailCenter, tailLength,tailNormal,tailPointSize,tailPointColor,tailTop, tailWidth}={HeadBlockWidth,HeadCenter,HeadLength,HeadNormal, HeadPointSize,HeadPointColor,HeadTop,HeadWidth,TailBlockWidth,\ TailCenter, TailLength,TailNormal,TailPointSize,TailPointColor,TailTop,\ TailWidth}//.{ opts}//.Options[Arrow3D];abUnit=(b-a)/abLength; headPerp=Cross[abUnit, N[headNormal]]; headPerpLength=Sqrt[N[headPerp.headPerp]]; If[headPerpLength==0.,headPerp=Cross[abUnit,N[{0.005163,0.005363,0.005724}\ +headNormal]]; headPerpLength=Sqrt[N[headPerp.headPerp]]]; headPerp=headPerp/headPerpLength; tailPerp=Cross[abUnit, N[tailNormal]]; tailPerpLength=Sqrt[N[tailPerp.tailPerp]]; If[tailPerpLength==0.,tailPerp=Cross[abUnit,N[{0.005163,0.005363,0.005724}\ +tailNormal]]; tailPerpLength=Sqrt[N[tailPerp.tailPerp]]]; tailPerp=tailPerp/tailPerpLength;headPoint=N[b-abUnit*headTop]; tailPoint=N[a+abUnit*tailTop]; g=Append[g,Line[{tailPoint+abUnit*tailLength*tailCenter, headPoint-abUnit*headLength*headCenter}]]; If[headPointSize>0.,g=Append[g,{If[headPointColor===Automatic,{},\ headPointColor], PointSize[headPointSize],Point[b]}]]; If[tailPointSize>0.,g=Append[g,{If[tailPointColor===Automatic,{},\ tailPointColor], PointSize[tailPointSize],Point[a]}]]; If[headBlockWidth>0., g=Append[g,Line[{headPoint+headPerp*headBlockWidth/2., headPoint-headPerp*headBlockWidth/2.}]]]; If[tailBlockWidth>0., g=Append[g,Line[{tailPoint+tailPerp*tailBlockWidth/2., tailPoint-tailPerp*tailBlockWidth/2.}]]]; If[headLength>0., g=Append[g,Polygon[{headPoint, headPoint-abUnit*headLength+headPerp*headWidth/2*headLength, headPoint-abUnit*headCenter*headLength, headPoint-abUnit*headLength-headPerp*headWidth/2*headLength}]]];\ If[tailLength>0., g=Append[g,Polygon[{tailPoint, tailPoint+abUnit*tailLength+tailPerp*tailWidth/2*tailLength, tailPoint+abUnit*tailCenter*tailLength, tailPoint+abUnit*tailLength-tailPerp*tailWidth/2*tailLength}]]];\ g]; (* The ArcArrow3D function *) Options[ArcArrow3D]= {PlotPoints->20, GreaterPi->False, HeadBlockWidth->0, HeadCenter->1, HeadLength->0, HeadNormal->{0,0,1}, HeadPointSize->0, HeadTop->0, HeadWidth->0.5, TailBlockWidth->0, TailCenter->1, TailLength->0, TailNormal->{0,0,1}, TailPointSize->0, TailTop->0, TailWidth->0.5}; ArcArrow3D[c_,a_,b_,opts___]:= Module[{bUnit,bx,bLength,x,xLength,y,yLength,fullAlpha,minAlpha,maxAlpha, plotPoints,greaterPi,headBlockWidth,headCenter,headLength,headNormal, headPointSize,headPointColor,headTop,headWidth,tailBlockWidth,\ tailCenter, tailLength,tailNormal,tailPointSize,tailPointColor,tailTop, tailWidth},{plotPoints,greaterPi,headBlockWidth,headCenter,headLength, headNormal,headPointSize,headPointColor,headTop,headWidth,\ tailBlockWidth, tailCenter,tailLength,tailNormal,tailPointSize,tailPointColor,tailTop,\ tailWidth}={PlotPoints,GreaterPi,HeadBlockWidth,HeadCenter,HeadLength,\ HeadNormal,HeadPointSize,HeadPointColor,HeadTop,HeadWidth,\ TailBlockWidth, TailCenter,TailLength,TailNormal,TailPointSize,TailPointColor,\ TailTop, TailWidth}/.{opts}/.Options[ArcArrow3D];x=a;xLength=Sqrt[N[x.x]]; bLength=Sqrt[N[b.b]];bUnit=b/bLength;y=N[Cross[Cross[x,bUnit],x]]; If[Sqrt[y.y]==0.,y=N[Cross[headNormal,x]]];y=y/Sqrt[y.y]*xLength; fullAlpha=ArcCos[N[bUnit.x]/xLength]; If[greaterPi===True,fullAlpha=2Pi-fullAlpha;y=-y]; minAlpha=(tailLength*tailCenter+tailTop)/xLength; maxAlpha=fullAlpha-(headLength*headCenter+headTop)/xLength;{ Line[Table[ c+x Cos[minAlpha+(maxAlpha-minAlpha)*i/plotPoints]+ y Sin[minAlpha+(maxAlpha-minAlpha)*i/plotPoints],{i,0, plotPoints}]], If[minAlpha==0.,{}, Arrow3D[c+x ,c+x Cos[minAlpha]+y Sin[minAlpha],HeadLength->0, HeadBlockWidth->0,HeadPointSize->0, HeadTop->0,TailBlockWidth->tailBlockWidth,TailCenter->tailCenter, TailLength->tailLength,TailNormal->tailNormal, TailPointSize->tailPointSize,TailPointColor->tailPointColor, TailTop->tailTop,TailWidth->tailWidth]], If[maxAlpha>=fullAlpha,{}, Arrow3D[c+x Cos[maxAlpha]+y Sin[maxAlpha], c+x Cos[fullAlpha]+y Sin[fullAlpha],HeadBlockWidth->headBlockWidth, HeadCenter->headCenter,HeadLength->headLength, HeadNormal->headNormal,HeadPointSize->headPointSize, HeadPointColor->headPointColor,HeadTop->headTop,TailLength->0, TailBlockWidth->0,TailPointSize->0,TailTop->0]]}]; End[] EndPackage[] \ \>", "Input", CellLabel->"In[3]:=", PageWidth->Infinity, InitializationCell->True, ShowSpecialCharacters->False, FormatType->InputForm], Cell[BoxData[ \("Arrow3D`"\)], "Output", CellLabel->"Out[15]="], Cell[BoxData[ \("Arrow3D`Private`"\)], "Output", CellLabel->"Out[35]="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(headBlockWidth\\)\\\" is similar to existing \ symbol \\\"\\!\\(HeadBlockWidth\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(headCenter\\)\\\" is similar to existing \ symbol \\\"\\!\\(HeadCenter\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(headLength\\)\\\" is similar to existing \ symbol \\\"\\!\\(HeadLength\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell1\\\"\\) will be suppressed during this \ calculation. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(bUnit\\)\\\" is similar to existing symbol \ \\\"\\!\\(abUnit\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(bLength\\)\\\" is similar to existing \ symbols \\!\\({abLength, Length}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\ \", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(xLength\\)\\\" is similar to existing \ symbols \\!\\({bLength, Length}\\). \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(yLength\\)\\\" is similar to existing \ symbols \\!\\({bLength, Length, xLength}\\). \\!\\(\\*ButtonBox[\\\"More\ \[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell\\\"\\) will be suppressed during this calculation. \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(plotPoints\\)\\\" is similar to existing \ symbol \\\"\\!\\(PlotPoints\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(greaterPi\\)\\\" is similar to existing \ symbol \\\"\\!\\(GreaterPi\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[3]:="], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell1\\\"\\) will be suppressed during this \ calculation. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[3]:="], Cell[BoxData[ \("Arrow3D`Private`"\)], "Output", CellLabel->"Out[44]="] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " Syntax Overview" }], "Section"], Cell[CellGroupData[{ Cell["Lists and Tables", "Subsection"], Cell[BoxData[ \(Table[i, {i, 0, 5}]\)], "Input", CellLabel->"In[64]:="], Cell[BoxData[ \(Table[i, {i, 0, 5, 2.5}]\)], "Input", CellLabel->"In[65]:="], Cell[BoxData[{ \(f[x_, y_] = x^2 - y^2\), "\[IndentingNewLine]", \(Table[{i, j, f[i, j]}, {i, \(-1\), 1}, {j, \(-1\), 1}]\)}], "Input", CellLabel->"In[66]:="] }, Open ]], Cell[CellGroupData[{ Cell["Graphics3D Objects", "Subsection"], Cell[CellGroupData[{ Cell["Line Primitive", "Subsubsection"], Cell[BoxData[{ \(\(f[t_] = {Cos[t], Sin[t], t/2};\)\), "\n", \(Line[Table[f[t], {t, 0, 2 Pi, 2 Pi/30. }]]\)}], "Input", CellLabel->"In[77]:="], Cell[BoxData[ \(Show[Graphics3D[%]]\)], "Input", CellLabel->"In[79]:="], Cell[BoxData[ \(WriteLiveForm["\", %]\)], "Input", CellLabel->"In[80]:="] }, Open ]], Cell[CellGroupData[{ Cell["Polygon Primitive", "Subsubsection"], Cell[BoxData[{ \(f[x_, y_] = x^2 - y^2\), "\n", \(dx = 0.1\), "\n", \(dy = 0.1\), "\n", \(Table[ Polygon[{{i, j, f[i, j]}, {i + dx, j, f[i + dx, j]}, {i + dx, j + dy, f[i + dx, j + dy]}, {i, j + dy, f[i, j + dy]}}], {i, \(-1\), 1 - dx/2, dx}, {j, \(-1\), 1 - dy/2, dy}]\)}], "Input", CellLabel->"In[86]:="], Cell[BoxData[ \(Show[Graphics3D[%]]\)], "Input", CellLabel->"In[90]:="], Cell[BoxData[ \(WriteLiveForm["\", \ Graphics3D[%]]\)], "Input", CellLabel->"In[91]:="] }, Open ]], Cell[CellGroupData[{ Cell["Putting it all Together", "Subsubsection"], Cell[BoxData[ \({Point[{0, 0, 0}], {RGBColor[0, 1, 0], PointSize[0.05], Point[{1, 2, 3}]}, Polygon[{{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}}], {EdgeForm[], FaceForm[RGBColor[1, 0, 0], RGBColor[0, 0, 1]], Polygon[{{0, 1, 1}, {\(-1\), 0, 1}, {\(-1\), 1, 1}}]}, {RGBColor[0, 1, 1], Thickness[0.05], Line[{{\(-1\), 1, 2}, {1, 1, 2}}]}}\)], "Input", CellLabel->"In[92]:="], Cell[BoxData[ \(Show[Graphics3D[%]]\)], "Input", CellLabel->"In[93]:="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Learning Example (Original Code)", "Subsection"], Cell[BoxData[{ \(\(f[x_, y_] = 2 y*Exp[\((\(-x^2\) - y^2)\)];\)\), "\n", \(xmin = \(-1\); xmax = 3; ymin = \(-2\); ymax = 1;\), "\n", \(\(n = 20;\)\), "\n", \(dx = \((xmax - xmin)\)/n; dy = \((ymax - ymin)\)/n;\)}], "Input"], Cell[BoxData[{ \(\(surface = {Table[ Polygon[{{i, j, f[i, j]}, {i + dx, j, f[i + dx, j]}, {i + dx, j + dy, f[i + dx, j + dy]}, {i, j + dy, f[i, j + dy]}}], {i, xmin, xmax - dx/2, dx}, {j, ymin, ymax - dy/2, dy}]};\)\), "\[IndentingNewLine]", \(\(badmesh = {GrayLevel[0.7], Table[Line[{{i, j, f[i, j]}, {i + dx, j, f[i + dx, j]}, {i + dx, j + dy, f[i + dx, j + dy]}, {i, j + dy, f[i, j + dy]}, {i, j, f[i, j]}}], {i, xmin, xmax - dx/2, dx}, {j, ymin, ymax - dy/2, dy}]};\)\), "\n", \(\(\(mesh = {GrayLevel[0.7], Table[Table[ Line[{{i, j, f[i, j]}, {i + dx, j, f[i + dx, j]}}], {i, xmin, xmax - dx/2, dx}], {j, ymin, ymax, dy}], Table[Table[ Line[{{i, j, f[i, j]}, {i, j + dy, f[i, j + dy]}}], {j, ymin, ymax - dy/2, dy}], {i, xmin, xmax, dx}]};\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(\(xSection = {RGBColor[0, 1, 0], Thickness[0.005], Table[Line[{{x, j, f[x, j]}, {x, j + dy, f[x, j + dy]}}], {j, ymin, ymax - dy, dy}]};\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(\(ySection = {RGBColor[0, 0, 1], Thickness[0.005], Table[Line[{{i, y, f[i, y]}, {i + dx, y, f[i + dx, y]}}], {i, xmin, xmax - dx, dx}]};\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(point = {RGBColor[1, 0, 0], PointSize[0.02], Point[{x, y, z}]};\)\)}], "Input"], Cell[CellGroupData[{ Cell["Polygons", "Subsubsection"], Cell[BoxData[ \(\(ShowLive[Graphics3D[surface, Boxed \[Rule] False]];\)\)], "Input"], Cell[BoxData[ \(\(WriteLive["\", Graphics3D[surface, Boxed \[Rule] False]];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Mesh", "Subsubsection"], Cell[BoxData[ \(\(mesh = {GrayLevel[0.7], Table[Table[ Line[{{i, j, f[i, j]}, {i + dx, j, f[i + dx, j]}}], {i, xmin, xmax - dx/2, dx}], {j, ymin, ymax, dy}], Table[Table[ Line[{{i, j, f[i, j]}, {i, j + dy, f[i, j + dy]}}], {j, ymin, ymax - dy/2, dy}], {i, xmin, xmax, dx}]};\)\)], "Input"], Cell[BoxData[ \(\(ShowLive[Graphics3D[mesh, Boxed \[Rule] False]];\)\)], "Input"], Cell[BoxData[ \(\(WriteLive["\", Graphics3D[mesh, Boxed \[Rule] False]];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Polygons Plus point", "Subsubsection"], Cell[BoxData[ \(\(ShowParametrized[Graphics3D[{surface, point}, Boxed \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"], Cell[BoxData[ \(\(WriteParametrized["\", Graphics3D[{surface, point}, Boxed \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Mesh plus point", "Subsubsection"], Cell[BoxData[ \(\(ShowParametrized[Graphics3D[{mesh, point}, Boxed \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> If[x < -1, -1, If[x > 3, 3, x]], y -> If[y < -2, \ -2, If[y > 1, 1, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"], Cell[BoxData[ \(\(WriteParametrized["\", Graphics3D[{mesh, point}, Boxed \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> If[x < -1, -1, If[x > 3, 3, x]], y -> If[y < -2, \ -2, If[y > 2, 2, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Mesh plus Sections", "Subsubsection"], Cell[BoxData[ \(\(ShowParametrized[ Graphics3D[{mesh, point, xSection, ySection}, Boxed \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> If[x < -1, -1, If[x > 3, 3, x]], y -> If[y < -2, \ -2, If[y > 1, 1, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"], Cell[BoxData[ \(\(WriteParametrized["\", Graphics3D[{mesh, point, xSection, ySection}, Boxed \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> If[x < -1, -1, If[x > 3, 3, x]], y -> If[y < -2, \ -2, If[y > 2, 2, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Tangent plane (plus mesh, sections and point)", "Subsubsection"], Cell[BoxData[ \(\(\( (*\ Create\ the\ tangent\ plane\ at\ the\ point\ {x, y, f[x, y]}\ \ \ \ *) \)\(\[IndentingNewLine]\)\( (*\ First\ use\ the\ partial\ derivatives\ to\ find\ two\ vectors\ *) \)\(\ \[IndentingNewLine]\)\( (*\ a\ and\ b\ for\ the\ parametrization\ *) \)\(\[IndentingNewLine]\)\(fx[ x_, y_] = D[f[x, y], x]; \ fy[x_, y_] = D[f[x, y], y];\[IndentingNewLine] \(a[x_, y_] = {1, 0, fx[x, y]};\)\[IndentingNewLine] \(b[x_, y_] = {0, 1, fy[x, y]};\)\[IndentingNewLine]\[IndentingNewLine] \(plane[s_, t_] = \(({x, y, z} + s*a[x, y] + t*b[x, y])\)*{1, 1, 1};\)\[IndentingNewLine]\[IndentingNewLine] (*\ Now\ creat\ the\ polygons\ *) \[IndentingNewLine] smin = \(-1\)/2; smax = 1/2; tmin = \(-1\)/2; tmax = 1/2;\[IndentingNewLine] n = 10; \ ds = \((smax - smin)\)/n; dt = \((tmax - tmin)\)/n;\[IndentingNewLine] \(tanplane = {FaceForm[GrayLevel[0.8]], Table[Polygon[{plane[i, j], plane[i + ds, j], plane[i + ds, j + dt], plane[i, j + dt]}], {i, smin, smax - ds/2, ds}, {j, tmin, tmax - dt/2, dt}]};\)\)\)\)], "Input"], Cell[BoxData[ \(\(ShowParametrized[ Graphics3D[{mesh, point, , xSection, ySection, tanplane}, Boxed \[Rule] False, Lighting \[Rule] False, BoxRatios \[Rule] {2, 2, 1}], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> If[x < -1, -1, If[x > 3, 3, x]], y -> If[y < -2, \ -2, If[y > 1, 1, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"], Cell[BoxData[ \(\(WriteParametrized["\", Graphics3D[{mesh, point, , xSection, ySection, tanplane}, Boxed \[Rule] False, Lighting \[Rule] False], IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> If[x < -1, -1, If[x > 3, 3, x]], y -> If[y < -2, \ -2, If[y > 2, 2, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Animated Version? (Hmm....)", "Subsubsection"], Cell[BoxData[ \(\(AnimateLive[ Graphics3D[{mesh, point, , xSection, ySection, tanplane}, Boxed \[Rule] False, Lighting \[Rule] False], {t, 0, 2 Pi}, IndVars -> "\<{x -> 1, y -> 0}\>", DepVars -> "\<{x -> Cos[t], x -> If[x < -1, -1, If[x > 3, 3, x]], y \ -> If[y < -2, -2, If[y > 2, 2, y]], z -> 2y*Exp[-x^2-y^2]}\>"];\)\)], "Input",\ CellLabel->"In[94]:="] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Introductory Example", "Section"], Cell[CellGroupData[{ Cell["Construction of the wireframe mesh", "Subsection"], Cell[BoxData[{ \(\(f[x_, y_] = 2 y*Exp[\(-x^2\) - y^2];\)\), "\n", \(xmin = \(-1\); xmax = 3;\), "\[IndentingNewLine]", \(ymin = \(-2\); ymax = 1;\[IndentingNewLine]\), "\[IndentingNewLine]", \(\(n = 20;\)\), "\n", \(\(dx = \((xmax - xmin)\)/n;\)\), "\n", \(\(\(dy = \((ymax - ymin)\)/n;\)\(\n\) \)\), "\[IndentingNewLine]", \(\(mesh = {GrayLevel[0.7], (*Make\ the\ line\ segments\ gray, not\ black*) \[IndentingNewLine]\[IndentingNewLine] (*This\ pair\ \ of\ nested\ Tables\ creates\ the\ cross\ sections\ y = j*) \[IndentingNewLine]Table[ (*Let\ the\ y - values\ vary*) \[IndentingNewLine]Table[ (*y\ fixed, now\ let\ x - values\ vary*) \[IndentingNewLine]Line[{{i, j, f[i, j]}, {i + dx, j, f[i + dx, j]}}], \[IndentingNewLine]{i, xmin, xmax - dx/2, dx}], {j, ymin, ymax, dy}], \[IndentingNewLine]\[IndentingNewLine] (*This\ pair\ of\ \ nested\ Tables\ creates\ the\ cross\ sections\ x = i*) \[IndentingNewLine]Table[ (*Let\ the\ x - values\ vary*) \[IndentingNewLine]Table[ (*x\ fixed, now\ let\ the\ y - values\ vary*) \[IndentingNewLine]Line[{{i, j, f[i, j]}, {i, j + dy, f[i, j + dy]}}], \[IndentingNewLine]{j, ymin, ymax - dy/2, dy}], {i, xmin, xmax, dx}]};\)\)}], "Input", CellLabel->"In[96]:="], Cell[BoxData[{ \(\(example = Graphics3D[mesh, Boxed \[Rule] False];\)\), "\n", \(WriteLiveForm["\", example]\)}], "Input", CellLabel->"In[103]:="] }, Open ]], Cell[CellGroupData[{ Cell["Adding the Point", "Subsection"], Cell[BoxData[ \(\(\( (*"\"\ is\ the\ same\ as\ in\ the\ previous\ example*) \)\(\ \(point = {RGBColor[1, 0, 0], PointSize[0.02], Point[{x, y, z}]};\)\n\[IndentingNewLine] \(example = Graphics3D[{mesh, point}, Boxed \[Rule] False];\)\n WriteLiveForm["\", example]\)\)\)], "Input", CellLabel->"In[105]:="] }, Open ]], Cell[CellGroupData[{ Cell["Adding the Cross Sections", "Subsection"], Cell[BoxData[ \(\(\( (*\ \("\"\ and\ "\"\ are\ the\ same\ as\ in\ the\ \ previous\ example\)\(,\)\ *) \)\( (*\ as\ are\ "\"\ "\"\ "\"\ "\"\ and\ so\ \ \(\(on\)\(.\)\)\ \ \ \ \ \ \ \ \ \ *) \)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\(\(xSection = {RGBColor[0, 1, 0], Thickness[0.005], Table[Line[{{x, j, f[x, j]}, {x, j + dy, f[x, j + dy]}}], {j, ymin, ymax - dy, dy}]};\)\n\[IndentingNewLine] \(ySection = {RGBColor[0, 0, 1], Thickness[0.005], Table[Line[{{i, y, f[i, y]}, {i + dx, y, f[i + dx, y]}}], {i, xmin, xmax - dx, dx}]};\)\n\[IndentingNewLine] \(example = Graphics3D[{mesh, point, xSection, ySection}, Boxed \[Rule] False];\)\n WriteLiveForm["\", example]\)\)\)], "Input", CellLabel->"In[108]:="] }, Open ]], Cell[CellGroupData[{ Cell["Adding the Tangent Plane", "Subsection"], Cell[BoxData[ \(\(\( (*\ "\"\ "\"\ "\"\ and\ \ \*"\"\"*) \)\(\[IndentingNewLine]\)\( (*\ the\ same\ as\ in\ the\ previous\ example, \ as\ are\ \ \ *) \)\(\[IndentingNewLine]\)\( (*"\"\ "\"\ \ "\"\ and\ so\ \(\(on\)\(.\)\)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\(\ \[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ Create\ the\ tangent\ plane\ at\ the\ point\ {x, y, f[x, y]}\ \ \ \ *) \)\( (*\ First\ use\ the\ partial\ derivatives\ to\ find\ two\ vectors\ *) \)\(\ \[IndentingNewLine]\)\( (*\ a\ and\ b\ for\ the\ parametrization\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(fx[x_, y_] = D[f[x, y], x]; \ \ \ \ (*\ Differentiate\ with\ respect\ to\ x\ *) \[IndentingNewLine]fy[x_, y_] = D[f[x, y], y]; \ \ \ (*\ Differentiate\ with\ respect\ to\ y\ *) \[IndentingNewLine]a[x_, y_] = {1, 0, fx[x, y]};\[IndentingNewLine] \(b[x_, y_] = {0, 1, fy[x, y]};\)\[IndentingNewLine]\[IndentingNewLine] (*\ Here\ is\ the\ parametric\ equation\ for\ the\ plane\ tangent\ \ \ *) \[IndentingNewLine] (*\ to\ the\ surface\ at\ the\ point\ {x, y, f[x, y]} . \ Recall\ that\ \ *) \[IndentingNewLine] (*\ the\ value\ of\ z = f[x, y]\ is\ automatically\ calculated\ by\ \ *) \n (*\ \ \(LiveGraphics3D\)\(.\)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ *) \[IndentingNewLine] \(plane[s_, t_] = {x, y, z} + s*a[x, y] + t*b[x, y];\)\n\[IndentingNewLine] (*Now\ create\ the\ polygons; let\ s\ and\ t\ range\ from - 1/2\ to\ 1/2*) \[IndentingNewLine] smin = \(-1\)/2; smax = 1/2; tmin = \(-1\)/2; tmax = 1/2;\[IndentingNewLine]\[IndentingNewLine] (*We' ll\ use\ a\ 10 x10\ grid\ for\ the\ parametrized\ plane*) \[IndentingNewLine] n = 10; ds = \((smax - smin)\)/n; dt = \((tmax - tmin)\)/ n;\[IndentingNewLine]\[IndentingNewLine] (*Use\ a\ Table\ to\ \ generate\ the\ list\ of\ 100\ polygons*) \[IndentingNewLine] \(tanplane = {FaceForm[GrayLevel[0.8]], Table[Polygon[{plane[i, j], (*4\ vertices\ for\ each*) \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ plane[i + ds, j], \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ plane[i + ds, j + dt], \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ plane[i, j + dt]}], \[IndentingNewLine]{i, smin, smax - ds/2, ds}, {j, tmin, tmax - dt/2, dt}]};\)\[IndentingNewLine]\n \(example = Graphics3D[{mesh, point, xSection, ySection, tanplane}, Boxed \[Rule] False, Lighting \[Rule] False];\)\n WriteLiveForm["\", example]\)\)\)], "Input", CellLabel->"In[112]:="] }, Open ]], Cell[CellGroupData[{ Cell["Including Text", "Subsection"], Cell[BoxData[ \(\(\( (*\ all\ but\ the\ last\ two\ commands\ are\ the\ same\ as\ in\ the\ \ previous\ example\ *) \)\(\(labels = {Text["\", {x, \(-2\), 0}, {1, 1}], Text["\", {3, y, 0}, {\(-1\), 1}]};\)\n\[IndentingNewLine] example = Graphics3D[{mesh, point, xSection, ySection, tanplane, labels}, Boxed \[Rule] False]\n WriteLiveForm["\", example]\)\)\)], "Input", CellLabel->"In[120]:="], Cell["To use a different font family and font size:", "Text"], Cell[BoxData[ \(\(labels = {Text[ StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 20], {x, \(-2\), 0}, {1, 1}], Text[StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 20], {3, y, 0}, {\(-1\), 1}]};\)\)], "Input"], Cell["To use bold or italic text:", "Text"], Cell[BoxData[ \(\(labels = {Text[ StyleForm[ StringForm["\<`1` = const.\>", StyleForm["\", FontSlant \[Rule] "\"]], FontFamily \[Rule] "\", FontSize \[Rule] 20], {x, \(-2\), 0}, {1, 1}], Text[StyleForm[ StringForm["\<`1` = const.\>", StyleForm["\", FontWeight \[Rule] "\"]], FontFamily \[Rule] "\", FontSize \[Rule] 20], {3, y, 0}, {\(-1\), 1}]};\)\)], "Input"], Cell[TextData[{ "To display the current values of ", StyleBox["x", FontWeight->"Bold"], " and ", StyleBox["y", FontWeight->"Bold"], ":" }], "Text"], Cell[BoxData[ \(\(labels = {Text[ StyleForm[StringForm["\<`1` = `2`\>", "\", x], FontFamily \[Rule] "\", FontSize \[Rule] 20], {x, \(-2\), 0}, {1, 1}], Text[StyleForm[StringForm["\", y], FontFamily \[Rule] "\", FontSize \[Rule] 20], {3, y, 0}, {\(-1\), 1}]};\)\)], "Input"], Cell["\<\ To truncate the number of digits displayed in the previous example. \ (Requires new definitions for DEPENDENT_VARIABLES.)\ \>", "Text"], Cell[BoxData[ \(\(labels = {Text[ StyleForm[StringForm["\<`1` = `2`\>", "\", xDisplay], FontFamily \[Rule] "\", FontSize \[Rule] 20], {x, \(-2\), 0}, {1, 1}], Text[StyleForm[StringForm["\", yDisplay], FontFamily \[Rule] "\", FontSize \[Rule] 20], {3, y, 0}, {\(-1\), 1}]};\)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Labeling Axes and Plots", "Subsection"], Cell[BoxData[ \(\(\( (*all\ but\ the\ last\ three\ commands\ are\ the\ same\ as\ in\ \ the\ previous\ example*) \)\(\(axeslabel = {StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 20], StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 20], StyleForm["\", FontFamily \[Rule] "\", FontSize \[Rule] 20]};\)\n\[IndentingNewLine] example = Graphics3D[{mesh, point, xSection, ySection, tanplane}, Boxed \[Rule] True, Axes \[Rule] True, AxesLabel \[Rule] axeslabel]\n WriteLiveForm["\", example]\)\)\)], "Input"], Cell[BoxData[ \(\(\( (*all\ but\ the\ last\ three\ commands\ are\ the\ same\ as\ in\ \ the\ previous\ example*) \)\(\(plotlabel = StyleForm[StringForm["\", z], FontFamily \[Rule] "\", FontSize \[Rule] 20];\)\n\[IndentingNewLine] example = Graphics3D[{mesh, point, xSection, ySection, tanplane}, Boxed \[Rule] False, PlotLabel \[Rule] plotlabel]\n WriteLiveForm["\", example]\)\)\)], "Input"], Cell[BoxData[ \(\(\( (*all\ but\ the\ last\ three\ commands\ are\ the\ same\ as\ in\ \ the\ previous\ example*) \)\(\(plotlabel = StyleForm[ StringForm["\", StyleForm["\", FontSlant \[Rule] "\"], Superscript["\", StringForm["\<-`1`-`2`\>", Superscript[ StyleForm["\", FontSlant \[Rule] "\"], "\<2\>"], Superscript[ StyleForm["\", FontSlant \[Rule] "\"], "\<2\>"]]], z], FontFamily \[Rule] "\", FontSize \[Rule] 20];\)\n\[IndentingNewLine] example = Graphics3D[{mesh, point, xSection, ySection, tanplane}, Boxed \[Rule] False, PlotLabel \[Rule] plotlabel]\n WriteLiveForm["\", example]\)\)\)], "Input"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Occlusions of Objects", "Section"], Cell[CellGroupData[{ Cell["Sphere with goodRing and badRing", "Subsection"], Cell[BoxData[{ \(\(\(f[r_, t_, p_] = {r*Sin[p] Cos[t], r*Sin[p] Sin[t], r*Cos[p]};\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(n = 20;\)\), "\[IndentingNewLine]", \(tmin = 0; tmax = 2 Pi; \ dt = \((tmax - tmin)\)/\((2 n)\);\), "\[IndentingNewLine]", \(pmin = 0; pmax = Pi; \ \ \ dp\ = \ \((pmax - pmin)\)/ n;\[IndentingNewLine]\), "\[IndentingNewLine]", \(\(sphere = {FaceForm[GrayLevel[0.7]], Table[Polygon[{f[1, i, j], f[1, i + dt, j], f[1, i + dt, j + dp], f[1, i, j + dp]}], {i, tmin, tmax - dt/2, dt}, {j, pmin, pmax - dp/2, dp}]};\)\)}], "Input", CellLabel->"In[123]:="], Cell[BoxData[{ \(\(badRing\ = \ {Thickness[0.01], RGBColor[0, 0, 1], Line[Table[ f[1.1, i, Pi/2], {i, tmin, tmax, dt}]]};\)\), "\[IndentingNewLine]", \(\(Show[ Graphics3D[{sphere, badRing}, Lighting \[Rule] False, Boxed \[Rule] False]];\)\)}], "Input", CellLabel->"In[128]:="], Cell[BoxData[{ \(\(goodRing\ = \ {Thickness[0.01], RGBColor[0, 0, 1], Table[Line[{f[1.1, i, Pi/2], f[1.1, i + dt, Pi/2]}], {i, tmin, tmax - dt/2, dt}]};\)\), "\[IndentingNewLine]", \(\(Show[ Graphics3D[{sphere, goodRing}, Lighting \[Rule] False, Boxed \[Rule] False]];\)\)}], "Input", CellLabel->"In[132]:="], Cell[BoxData[ \(\(WriteLive["\", Graphics3D[{sphere, badRing}, Lighting \[Rule] False, Boxed \[Rule] False]];\)\)], "Input"], Cell[BoxData[ \(\(WriteLive["\", Graphics3D[{sphere, goodRing}, Lighting \[Rule] False, Boxed \[Rule] False]];\)\)], "Input", CellLabel->"In[39]:="], Cell[BoxData[{ \(ByteCount[badRing]\), "\[IndentingNewLine]", \(ByteCount[goodRing]\)}], "Input", CellLabel->"In[140]:="] }, Open ]], Cell[CellGroupData[{ Cell["Cyclic Occlusions with Lines", "Subsection"], Cell[BoxData[ \(\(\( (*\ A\ Graphics3D\ object\ consisting\ of\ four\ Lines\ which\ \ \[IndentingNewLine]\ \ shows\ occlusions\ errors\ for\ certain\ view\ points\ \ *) \)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(Graphics3D[{Thickness[ 0.05], RGBColor[1, 0, 0], Line[{{\(-2\), \(-1\), \(-1\)}, {2, \(-1\), 1}}], RGBColor[0, 1, 0], Line[{{1, \(-2\), \(-1\)}, {1, 2, 1}}], RGBColor[0, 0, 1], Line[{{2, 1, \(-1\)}, {\(-2\), 1, 1}}], RGBColor[1, 0, 1], Line[{{\(-1\), 2, \(-1\)}, {\(-1\), \(-2\), 1}}]}, PlotRange \[Rule] {{\(-2\), 2}, {\(-2\), 2}, {\(-1\), 1}}, ViewPoint \[Rule] {0, 0, 4}, ViewVertical \[Rule] {0, 1, 0}, Boxed \[Rule] False]\)\)\)], "Input", CellLabel->"In[142]:="], Cell[BoxData[ \(Show[%]\)], "Input"], Cell[BoxData[ \(\(\( (*A\ Graphics3D\ object\ consisting\ of\ eight\ Lines\ which\ \ \[IndentingNewLine]shows\ cyclic\ occlusions\ for\ certain\ view\ points*) \)\ \(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(Graphics3D[{Thickness[0.05], RGBColor[1, 0, 0], Line[{{\(-2\), \(-1\), \(-1\)}, {0, \(-1\), 0}}], Line[{{0, \(-1\), 0}, {2, \(-1\), 1}}], RGBColor[0, 1, 0], Line[{{1, \(-2\), \(-1\)}, {1, 0, 0}}], Line[{{1, 0, 0}, {1, 2, 1}}], RGBColor[0, 0, 1], Line[{{2, 1, \(-1\)}, {0, 1, 0}}], Line[{{0, 1, 0}, {\(-2\), 1, 1}}], RGBColor[1, 0, 1], Line[{{\(-1\), 2, \(-1\)}, {\(-1\), 0, 0}}], Line[{{\(-1\), 0, 0}, {\(-1\), \(-2\), 1}}]}, PlotRange \[Rule] {{\(-2\), 2}, {\(-2\), 2}, {\(-1\), 1}}, ViewPoint \[Rule] {0, 0, 4}, ViewVertical \[Rule] {0, 1, 0}, Boxed \[Rule] False]\)\)\)], "Input", CellLabel->"In[146]:="], Cell[BoxData[ \(Show[%]\)], "Input", CellLabel->"In[147]:="] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Overlapping Triangles", "Section"], Cell[BoxData[{ \(\(triangle1\ = \ {FaceForm[SurfaceColor[RGBColor[1, 0, 0]]], Polygon[{{0, 1, 0}, {0, 2, 0}, {2, 2, 2}}]};\)\), "\[IndentingNewLine]", \(\(triangle2\ = \ {FaceForm[SurfaceColor[RGBColor[0, 1, 0]]], Polygon[{{1, 2, 0}, {2, 2, 0}, {2, 0, 2}}]};\)\), "\[IndentingNewLine]", \(\(triangle3\ = \ {FaceForm[SurfaceColor[RGBColor[0, 0, 1]]], Polygon[{{2, 1, 0}, {2, 0, 0}, {0, 0, 2}}]};\)\)}], "Input", CellLabel->"In[37]:="], Cell[BoxData[{ \(\(triangle1\ = \ {FaceForm[RGBColor[1, 0, 0]], Polygon[{{0, 0, 0}, {0, 1, 0}, {1, 1, 1}}]};\)\), "\[IndentingNewLine]", \(\(triangle2\ = \ {FaceForm[RGBColor[0, 1, 0]], Polygon[{{0, 1, 0}, {1, 1, 0}, {1, 0, 1}}]};\)\), "\[IndentingNewLine]", \(\(triangle3\ = \ {FaceForm[RGBColor[0, 0, 1]], Polygon[{{1, 0, 0}, {1, 0, 0}, {0, 0, 1}}]};\)\)}], "Input", CellLabel->"In[33]:="], Cell[BoxData[{ \(\(triangle1\ = Polygon[{{0, 1, 0}, {0, 2, 0}, {2, 2, 2}}];\)\), "\[IndentingNewLine]", \(\(triangle2\ = Polygon[{{1, 2, 0}, {2, 2, 0}, {2, 0, 2}}];\)\), "\[IndentingNewLine]", \(\(triangle3\ = \ Polygon[{{2, 1, 0}, {2, 0, 0}, {0, 0, 2}}];\)\)}], "Input", CellLabel->"In[41]:="], Cell[BoxData[{ \(\(triangle1\ = Polygon[{{0, 1, 0}, {0, 3, 0}, {3, 3, 3}}];\)\), "\[IndentingNewLine]", \(\(triangle2\ = Polygon[{{1, 3, 0}, {3, 3, 0}, {3, 0, 3}}];\)\), "\[IndentingNewLine]", \(\(triangle3\ = \ Polygon[{{3, 2, 0}, {3, 0, 0}, {0, 0, 3}}];\)\), "\[IndentingNewLine]", \(\(triangle4\ = \ Polygon[{{0, 0, 0}, {2, 0, 0}, {0, 3, 3}}];\)\)}], "Input", CellLabel->"In[66]:="], Cell[BoxData[ \(\(ShowLive[ Graphics3D[{triangle1, triangle2, triangle3, triangle4}]];\)\)], "Input", CellLabel->"In[71]:="] }, Closed]], Cell[CellGroupData[{ Cell["Stereo Images", "Section"], Cell[BoxData[ \(Needs["\"]\)], "Input", CellLabel->"In[155]:="], Cell[BoxData[ \(\(Show[Polyhedron[Icosahedron], Boxed \[Rule] False, ViewPoint \[Rule] { .9, .65, 1.3}, ViewVertical \[Rule] {\(- .25\), \(-1\), 0.5}];\)\)], "Input", CellLabel->"In[156]:=", CellTags->"S5.41.1"] }, Closed]], Cell[CellGroupData[{ Cell["Advanced Examples", "Section"], Cell[CellGroupData[{ Cell["Simson Line", "Subsection"], Cell[BoxData[ \(\(\( (*\ {ax, ay}, \ {bx, by}, \ {cx, cy}\ are\ the\ vertices\ of\ a\ triangle, \ {x, y}\ is\ a\ input\ point\ that\ is\ projected\ onto\ the\ circum\ \ circle\ *) \)\(\ \)\(\[IndentingNewLine]\)\(independentVariables\ = \ {x\ \ -> \ 1.5, \ y\ -> \ 0.9, \ ax\ -> \ 0. , \ ay\ -> \ 0. , \ \n\ \ \ bx\ -> \ 1. , \ by\ -> \ .7, \ cx\ -> \ 1.6, \ cy\ -> \ \(-0.9\)};\)\)\)], "Input", CellLabel->"In[157]:="], Cell[BoxData[ \(\(\( (*\ Circumcircle\ returns\ {{x, y}, r}\ to\ specify\ the\ center\ and\ radius\ of\ the\ circum\ circle\ \ of\ the\ triangle\ specified\ by\ {x1, y1}, \ {x2, y2}, \ {x3, y3}\ *) \)\(\ \)\(\n\)\(Circumcircle[{{x1_, \ y1_}, \ {x2_, \ y2_}, \ {x3_, \ y3_}}]\ := \ \n\ \ \ Module[{a\ = \ Det[{{x1, \ y1, \ 1}, \ {x2, \ y2, \ 1}, \ {x3, \ y3, \ 1}}], \ \n\ \ \ \ \ \ d\ = \ \(-1\)/ 2\ Det[{{x1^2\ + \ y1^2, \ y1, \ 1}, \ {x2^2\ + \ y2^2, \ y2, \ 1}, \ \n\ \ \ \ \ \ \ \ \ {x3^2\ + \ y3^2, \ y3, \ 1}}], \ \n\ \ \ \ \ \ f\ = \ 1/2\ Det[{{x1^2\ + \ y1^2, \ x1, \ 1}, \ {x2^2\ + \ y2^2, \ x2, \ 1}, \ \n\ \ \ \ \ \ \ \ \ {x3^2\ + \ y3^2, \ x3, \ 1}}], \ \n\ \ \ \ \ \ g\ = \ \(-Det[{{x1^2\ + \ y1^2, \ x1, \ y1}, \ {x2^2\ + \ y2^2, \ x2, \ y2}, \ \n\ \ \ \ \ \ \ \ \ {x3^2\ + \ y3^2, \ x3, \ y3}}]\)}, \ \n\ \ \ \ \ \ {{\(-d\)/a, \ \(-f\)/a}, \ Sqrt[\((f^2\ + \ d^2)\)/a^2\ - \ g/a]}];\)\)\)], "Input", CellLabel->"In[158]:="], Cell[BoxData[ \(\(\( (*\ projectToLine\ returns\ the\ closest\ 2 D\ point\ to\ x\ on\ the\ line\ through\ a\ and\ b\ *) \)\(\ \[IndentingNewLine]\)\(projectToLine[x_, \ a_, \ b_]\ := \ \n\ \ \ Module[{}, \ a\ + \ \((b\ - \ a)\)*\((x\ - \ a)\) . \((b\ - \ a)\)/\((\((b\ - \ a)\) . \((b\ - \ a)\))\)];\)\)\)], "Input", CellLabel->"In[159]:="], Cell[BoxData[ \(\(\( (*\ pa, \ pb, \ pc\ are\ the\ projections\ of\ {px, \ py}\ to\ the\ edges\ of\ the\ triangle\ specified\ by\ {ax, \ ay}, \ {bx, \ by}, \ {cx, \ cy}\ *) \)\(\[IndentingNewLine]\)\(pc\ = \ projectToLine[{px, \ py, \ 0}, \ {ax, \ ay, \ 0}, {bx, \ by, \ 0}]; pa\ = \ projectToLine[{px, \ py, \ 0}, \ {bx, \ by, \ 0}, {cx, \ cy, \ 0}]; pb\ = \ projectToLine[{px, \ py, \ 0}, \ {cx, \ cy, \ 0}, {ax, \ ay, \ 0}];\)\)\)], "Input", CellLabel->"In[160]:="], Cell[BoxData[ \(\(\( (*\ circ\ is\ of\ the\ form\ {{x, y}, r}\ specifying\ the\ circum\ circle\ of\ our\ triangle\ *) \)\(\n\)\ \(circ\ = \ Circumcircle[{{ax, \ ay}, \ {bx, \ by}, \ {cx, \ cy}}];\)\)\)], "Input", CellLabel->"In[161]:="], Cell[BoxData[ RowBox[{\( (*\ dependent\ \(variables : \ \[IndentingNewLine]{ccx, ccy}\ and\ ccr\ are\ the\ center\ and\ radius\ of\ the\ \ circum\ circle\); \ \[IndentingNewLine]angle\ is\ the\ angle\ between\ the\ x\ \ axis\ and\ a\ line\ from\ the\ center\ of\ the\ circum\ circle\ to\ {x, y}; \[IndentingNewLine]{px, py}\ is\ {x, y}\ projected\ to\ the\ circum\ circle; \[IndentingNewLine]{pax, pay}, \ {pbx, pby}, \ {pcx, pcy}\ are\ the\ coordinates\ of\ pa, \ pb, \ pc; \[IndentingNewLine]lab, \ lac, \ lcb\ are\ distances\ between\ pa, \ pb, \ and\ pc; \[IndentingNewLine]{sax, say}\ and\ {sbx, sby}\ are\ the\ coordinates\ of\ the\ two\ most\ distance\ points\ \ out\ of\ pa, \ pb, \ and\ pc\ *) \), "\[IndentingNewLine]", StyleBox["\n", FontFamily->"Courier", FontSize->13], StyleBox[\(dependentVariables\ = \ {ccx\ -> \ circ[\([1, \ 1]\)], \ ccy\ -> \ circ[\([1, \ 2]\)], \ \n\ \ \ ccr\ -> \ circ[\([2]\)], \ \n\ \ \ angle\ -> \ ArcTan[x\ - \ ccx, \ y\ - \ ccy], \ \n\ \ \ px\ -> \ ccx\ + \ ccr*Cos[angle], \ py\ -> \ ccy\ + \ ccr*Sin[angle], \n\ \ \ x\ -> \ px, \ y\ -> \ py, \ \n\ \ \ pax\ -> \ pa[\([1]\)], \ pay\ -> \ pa[\([2]\)], \ \n\ \ \ pbx\ -> \ pb[\([1]\)], \ pby\ -> \ pb[\([2]\)], \ \n\ \ \ pcx\ -> \ pc[\([1]\)], \ pcy\ -> \ pc[\([2]\)], \ \n\ \ \ lab\ -> \ Sqrt[\(({pax, \ pay, \ 0}\ - \ {pbx, \ pby, \ 0})\) . \n\ \ \ \ \ \ \(({pax, \ pay, \ 0}\ - \ {pbx, \ pby, \ 0})\)], \ \n\ \ \ lac\ -> \ Sqrt[\(({pax, \ pay, \ 0}\ - \ {pcx, \ pcy, \ 0})\) . \n\ \ \ \ \ \ \(({pax, \ pay, \ 0}\ - \ {pcx, \ pcy, \ 0})\)], \n\ \ \ lcb\ -> \ Sqrt[\(({pcx, \ pcy, \ 0}\ - \ {pbx, \ pby, \ 0})\) . \n\ \ \ \ \ \ \(({pcx, \ pcy, \ 0}\ - \ {pbx, \ pby, \ 0})\)], \ \n\ \ \ sax\ -> \ If[lac\ > \ lcb, \ If[lac\ > \ lab, \ pax, \ pax], \ If[lcb\ > \ lab, \ pcx, \ pax]], \ \n\ \ \ say\ -> \ If[lac\ > \ lcb, \ If[lac\ > \ lab, \ pay, \ pay], \ If[lcb\ > \ lab, \ pcy, \ pay]], \ \n\ \ \ sbx\ -> \ If[lac\ > \ lcb, \ If[lac\ > \ lab, \ pcx, \ pbx], \ If[lcb\ > \ lab, \ pbx, \ pbx]], \ \n\ \ \ sby\ -> \ If[lac\ > \ lcb, \ If[lac\ > \ lab, \ pcy, \ pby], \ If[lcb\ > \ lab, \ pby, \ pby]]};\), FontFamily->"Courier", FontSize->13]}]], "Input", CellLabel->"In[162]:="], Cell[BoxData[ \(dependentVariables // InputForm\)], "Input", CellLabel->"In[163]:="], Cell[BoxData[ \(\(\( (*\ edges\ of\ the\ triangle\ and\ input\ points\ \ *) \)\(\[IndentingNewLine]\)\(triangle\ = {{Thickness[0.01], \ Line[{{ax, \ ay, \ 0}, \ {bx, \ by, \ 0}, \ {cx, \ cy, \ 0}, {ax, \ ay, \ 0}}]}, {RGBColor[1, 0, 0], PointSize[0.03], \ Point[{x, \ y, \ 0.1}], Point[{ax, \ ay, \ 0.1}], \ Point[{bx, \ by, \ 0.1}], \ Point[{cx, \ cy, \ 0.1}]}};\)\)\)], "Input", CellLabel->"In[164]:="], Cell[BoxData[ \(\(\( (*\ projected\ points\ and\ lines\ between\ them\ and\ extrapolating\ the\ \ line\ *) \)\(\[IndentingNewLine]\)\(projectedPoints = {Thickness[0.005], PointSize[0.03], \ \n\ \ \ Point[{pax, \ pay, \ 0}], \ Point[{pbx, \ pby, \ 0}], \ \n\ \ \ Point[{pcx, \ pcy, \ 0}], \ Line[{{px, \ py, \ 0}, \ {pax, \ pay, \ 0}}], \ \n\ \ \ Line[{{px, \ py, \ 0}, \ {pbx, \ pby, \ 0}}], \ \n\ \ \ Line[{{px, \ py, \ 0}, \ {pcx, \ pcy, \ 0}}], \ {Thickness[0.01], \ Line[{{sax\ + \ 2*\((sax\ - \ sbx)\), \ say\ + \ 2*\((say\ - \ sby)\), \ 0}, \ \n\ \ \ \ \ \ {sbx\ + \ 2*\((sbx\ - \ sax)\), \ sby\ + \ 2*\((sby\ - \ say)\), \ 0}}]}};\)\)\)], "Input", CellLabel->"In[165]:="], Cell[BoxData[ \(\(\( (*\ circum\ circle\ *) \)\(\[IndentingNewLine]\)\(circumcircle\ = \ {Thickness[0.005], Line[Table[{ccx, \ ccy, \ 0}\ + ccr*{Cos[phi], \ Sin[phi], \ 0}, {phi, \ 0. , \ 2\ Pi\ + \ 0.00001, \ 2\ Pi/64. }]]};\)\)\)], "Input", CellLabel->"In[166]:="], Cell[BoxData[ \(\(\( (*\ assemble\ everything\ *) \)\(\[IndentingNewLine]\)\(\(simson\ = \ Graphics3D[{triangle, \ projectedPoints, \ \ circumcircle}, \ Boxed\ -> \ False, ViewPoint\ -> \ {0, \ 0, \ 1000}, ViewVertical\ -> \ {0, \ 1, \ 0}, \ PlotRange\ -> \ {{\(-0.5\), \ 2.0}, \ {\(-1.5\), \ 1}, \ {\(-1\), \ 1}}];\)\(\n\) \)\)\)], "Input", CellLabel->"In[167]:="], Cell[BoxData[ \(\(\( (*\ when\ we\ show\ the\ graphics\ this\ way, \ the\ point\ {x, y}\ is\ not\ set\ to\ {px, py}; \ this\ is\ different\ in\ LiveGraphics3D\ \ *) \)\(\[IndentingNewLine]\)\(Show[ simson //. \ Join[independentVariables, \ dependentVariables]];\)\)\)], "Input", CellLabel->"In[168]:="], Cell[BoxData[ \(\(WriteLiveForm["\", simson];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Spirograph", "Subsection"], Cell[BoxData[ \(\(\( (*\ independent\ \(variables : \ current\ time\ t\); \ \[IndentingNewLine]time\ of\ last\ time\ \ step; \ coordinates\ of\ point\ on\ outer\ circle\ {xR, yR}; \[IndentingNewLine]center\ of\ inner\ circle\ {xr, \ yr}; \[IndentingNewLine]point\ on\ inner\ circle\ {xrho, yrho}\ which\ is\ traced\ *) \)\(\ \ \)\(\[IndentingNewLine]\)\(independentVariables\ = \ {t \[Rule] 0, told \[Rule] 0, xR \[Rule] 10, yR \[Rule] 0, xr \[Rule] 8, yr \[Rule] 0, xrho \[Rule] 9, yrho \[Rule] 0};\)\)\)], "Input", CellLabel->"In[169]:="], Cell[BoxData[ \(\(\( (*\ dependent\ \(variables : \ R\ is\ the\ radius\ of\ the\ outer\ circle\); \[IndentingNewLine]r\ \ is\ the\ radius\ of\ the\ inner\ circle, \ we\ ensure\ ratios\ \(r : R\) = 6 : n\ with\ an\ integer\ n; \[IndentingNewLine]{xrh, yrh}\ is\ the\ center\ of\ the\ inner\ circle\ according\ to\ the\ \ new\ r\ and\ R\ for\ the\ last\ time\ step; \[IndentingNewLine]rho\ is\ the\ \ distance\ of\ the\ traced\ point\ to\ the\ center\ of\ the\ inner\ circle, \ we\ compute\ it\ as\ the\ distance\ between\ {xrho, yrho}\ from\ the\ last\ time\ frame\ to\ {xrh, yrh}\ \((for\ consistency\ we\ had\ to\ compute\ {xrh, yrh}\ for\ the\ told)\); \[IndentingNewLine]Rsubr\ and\ Rdivr\ \ are\ just\ abbreviations\ for\ R - r\ and\ R/r; \[IndentingNewLine]{xR, yR}, \ {xr, yr}, \ {xrho, yrho}\ is\ recomputed\ for\ the\ current\ r, \ R, \ and\ t; \[IndentingNewLine]the\ current\ value\ of\ t\ is\ stored\ in\ \ told\ *) \)\(\[IndentingNewLine]\)\(dependentVariables = {R \[Rule] Sqrt[xR*xR + yR*yR], r \[Rule] 6*R/Round[ 6*R/Sqrt[\((xR - xr)\)*\((xR - xr)\) + \((yR - yr)\)*\((yR - yr)\)]], xrh \[Rule] \((R - r)\) Cos[told], yrh \[Rule] \((R - r)\) Sin[told], rho \[Rule] Sqrt[\((xrh - xrho)\)*\((xrh - xrho)\) + \((yrh - yrho)\)*\((yrh - yrho)\)], Rsubr \[Rule] R - r, Rdivr \[Rule] R/r*Sign[r - R - 0.000000001], xR \[Rule] R\ Cos[t], yR \[Rule] R\ Sin[t], xr \[Rule] \((R - r)\) Cos[t], yr \[Rule] \((R - r)\) Sin[t], xrho \[Rule] xr + rho\ Cos[Rdivr\ t], yrho \[Rule] yr + rho\ Sin[Rdivr\ t], told \[Rule] t};\)\)\)], "Input", CellLabel->"In[170]:="], Cell[BoxData[ \(dependentVariables // InputForm\)], "Input", CellLabel->"In[171]:="], Cell[BoxData[ \(\(\( (*\ lines\ and\ points\ for\ interaction\ \ *) \)\(\[IndentingNewLine]\)\(skeleton = {Thickness[0.005], Line[{{0, 0, 0}, {xR, yR, 0}}], Line[{{xr, yr, 0}, {xrho, yrho, 0}}], PointSize[0.03], Point[{0, 0, 0}], RGBColor[1, 0, 0], Point[{xR, yR, 0.1}], Point[{xr, yr, 0.1}], Point[{xrho, yrho, 0.1}]};\)\)\)], "Input", CellLabel->"In[172]:="], Cell[BoxData[ \(\(\( (*\ the\ outer\ circle\ *) \)\(\[IndentingNewLine]\)\(circleR = N[Line[Table[{R*Cos[i], R*Sin[i], 0}, {i, 0, 2 Pi, 2 Pi/64}]]];\)\)\)], "Input", CellLabel->"In[173]:="], Cell[BoxData[ \(\(\( (*\ the\ inner\ circle\ *) \)\(\[IndentingNewLine]\)\(circler = N[Line[Table[{xr + r*Cos[i], yr + r*Sin[i], 0}, {i, 0, 2 Pi, 2 Pi/64}]]];\)\)\)], "Input", CellLabel->"In[174]:="], Cell[BoxData[ \(\(\( (*\ the\ trace\ of\ the\ point\ for\ 6\ periods\ of\ 2\ Pi, \ which\ is\ enough\ because\ we\ have\ ensured\ the\ ratio\ \(r : R\) = 6 : n*) \)\(\[IndentingNewLine]\)\(trace = {Thickness[0.01], N[Line[Table[{Rsubr*Cos[i], Rsubr*Sin[i], 0} + {rho\ Cos[Rdivr\ i], rho\ Sin[Rdivr\ i], 0}, {i, 0, 6*2\ Pi, 2\ Pi/64}]]]};\)\)\)], "Input", CellLabel->"In[175]:="], Cell[BoxData[ \(\(\( (*\ assemble\ everything\ *) \)\(\[IndentingNewLine]\)\(spiro = \ Graphics3D[{skeleton, circleR, circler, trace}, \ Boxed\ -> \ False, ViewPoint\ -> \ {0, \ 0, \ 1000}, ViewVertical\ -> \ {0, \ 1, \ 0}];\)\)\)], "Input", CellLabel->"In[176]:="], Cell[BoxData[ \(\(Show[ spiro //. \ Join[independentVariables, \ dependentVariables]];\)\)], "Input", CellLabel->"In[177]:="], Cell[BoxData[ \(\(WriteLiveForm["\", spiro, {t, 0, 6. *2\ Pi, 0.1}];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Frenet-Serret formulas", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ functions\ to\ define\ a\ vector\ symbol, \ say\ "\", \ as\ {vx, vy, vz}; \ and\ to\ either\ define\ independent\ variables\ or\ dependent\ \ variables\ for\ these\ coordinates\ *) \)\(\[IndentingNewLine]\)\(\ \ \)\(\ \[IndentingNewLine]\)\(\(defineVector[name_String] := Module[{}, Evaluate[Symbol[name]] = {Symbol[name <> "\"], Symbol[name <> "\"], Symbol[name <> "\"]}];\)\[IndentingNewLine]\ \[IndentingNewLine] \(defineVector[list_List] := Map[defineVector, list];\)\[IndentingNewLine]\[IndentingNewLine] \(independentVariablesForVector[name_String, value_List] := {Symbol[name <> "\"] \[Rule] value[\([1]\)], Symbol[name <> "\"] \[Rule] value[\([2]\)], Symbol[name <> "\"] \[Rule] value[\([3]\)]};\)\[IndentingNewLine]\[IndentingNewLine] \(dependentVariablesForVector[name_String, \ expr_] := Module[{namex = Symbol[name <> "\"], namey = Symbol[name <> "\"], namez = Symbol[name <> "\"]}, {namex \[Rule] expr[\([1]\)], namey \[Rule] expr[\([2]\)], namez \[Rule] expr[\([3]\)]}];\)\)\)\)], "Input", CellLabel->"In[46]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(namex\\)\\\" is similar to existing symbol \ \\\"\\!\\(name\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[46]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(namey\\)\\\" is similar to existing symbols \ \\!\\({name, namex}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[46]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(namez\\)\\\" is similar to existing symbols \ \\!\\({name, namex, namey}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[46]:="] }, Open ]], Cell[BoxData[ \(\(\( (*\ set\ default\ length\ of\ arrow\ heads\ \ *) \)\(\[IndentingNewLine]\)\(SetOptions[Arrow3D, HeadLength \[Rule] 0.2];\)\)\)], "Input", CellLabel->"In[50]:="], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ control\ vertices\ of\ a\ cubic\ Bezier\ curve\ b0, \ b1, \ b2, \ b3, \ point\ on\ the\ curve\ x, \ derivatives\ dxdt, \ ddxddt, \ dddxdddt, \ tangent\ vector, \ curvature\ vector, \ binormal\ vector, \ and\ a\ temporary\ vector\ vb1 . \ each\ vector\ is\ defined\ as\ a\ list\ of\ three\ coordinates, \ e . g . \ b0\ as\ {b0x, \ b0y, \ b0z}\ *) \)\(\ \ \)\(\[IndentingNewLine]\)\(defineVector[{"\", \ "\", "\", "\", "\", "\", "\", \ "\", "\", "\", "\", "\"}]\)\)\)], "Input", CellLabel->"In[51]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dxdtx\\)\\\" is similar to existing symbol \ \\\"\\!\\(dxdt\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dxdty\\)\\\" is similar to existing symbols \ \\!\\({dxdt, dxdtx}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dxdtz\\)\\\" is similar to existing symbols \ \\!\\({dxdt, dxdtx, dxdty}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(ddxddtx\\)\\\" is similar to existing symbol \ \\\"\\!\\(ddxddt\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(ddxddty\\)\\\" is similar to existing \ symbols \\!\\({ddxddt, ddxddtx}\\). \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell\\\"\\) will be suppressed during this calculation. \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dddxdddtx\\)\\\" is similar to existing \ symbol \\\"\\!\\(dddxdddt\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[51]:="], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell1\\\"\\) will be suppressed during this \ calculation. \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[51]:="], Cell[BoxData[ \({{b0x, b0y, b0z}, {b1x, b1y, b1z}, {b2x, b2y, b2z}, {b3x, b3y, b3z}, {xx, xy, xz}, {dxdtx, dxdty, dxdtz}, {ddxddtx, ddxddty, ddxddtz}, {dddxdddtx, dddxdddty, dddxdddtz}, {vtx, vty, vtz}, {vmx, vmy, vmz}, {vbx, vby, vbz}, {vb1x, vb1y, vb1z}}\)], "Output", CellLabel->"Out[51]="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ Bezier\ curve\ b[t], \ and\ derivatives\ db[t], \ ddb[t], \ dddb[ t]\ *) \)\(\[IndentingNewLine]\)\(\(bernstein[i_, n_, t_] := Binomial[n, i] t^i\ \((1 - t)\)^\((n - i)\);\)\[IndentingNewLine] b[t_] := Sum[bernstein[i, 3, t]*Symbol["\" <> ToString[i]], {i, 0, 3}]; db[t_] = D[b[t], t];\[IndentingNewLine] \(ddb[t_] = D[b[t], {t, 2}];\)\[IndentingNewLine] \(dddb[t_] = D[b[t], {t, 3}];\)\)\)\)], "Input", CellLabel->"In[52]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dddb\\)\\\" is similar to existing symbol \\\ \"\\!\\(ddb\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\ \\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[52]:="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ points\ on\ the\ Bezier\ curve\ \ *) \)\(\[IndentingNewLine]\)\(\(iMax = 64;\)\[IndentingNewLine] \(bpoints = Table[{0, 0, \(-0.001\)} + b[i/iMax + 0.0000001], {i, 0, iMax}];\)\)\)\)], "Input", CellLabel->"In[56]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(iMax\\)\\\" is similar to existing symbol \\\ \"\\!\\(Max\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\ \\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[56]:="] }, Open ]], Cell[BoxData[ \(\(\( (*\ define\ initial\ values\ for\ the\ control\ vertices\ *) \)\(\ \[IndentingNewLine]\)\(independentVariables = Flatten[{independentVariablesForVector["\", {\(-0.5\), 1.0, \(-0.5\)}], independentVariablesForVector["\", {\(-0.5\), 0.8, 0.0}], independentVariablesForVector["\", {1.5, 0.4, 0. }], independentVariablesForVector["\", {1.5, 1.0, \(-0.5\)}], t \[Rule] 0.3}];\)\)\)], "Input", CellLabel->"In[58]:="], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ compute\ dependent\ variables, \ in\ particular\ curvature\ kappa\ and\ torsion\ tau\ *) \)\(\ \[IndentingNewLine]\)\(dependentVariables = Flatten[{t \[Rule] Max[0, Min[t, 1]], dependentVariablesForVector["\", b[t]], dependentVariablesForVector["\", db[t]], dependentVariablesForVector["\", ddb[t]], dependentVariablesForVector["\", dddb[t]], dependentVariablesForVector["\", dxdt/Sqrt[dxdt . dxdt]], dependentVariablesForVector["\", Cross[dxdt, ddxddt]], dependentVariablesForVector["\", vb1/Sqrt[vb1 . vb1]], dependentVariablesForVector["\", Cross[vb, vt]], kappa \[Rule] Sqrt[vb1 . vb1]/Sqrt[\((dxdt . dxdt)\)^3], tau \[Rule] Det[{dxdt, ddxddt, dddxdddt}]/\((vb1 . vb1)\)}];\)\)\)], "Input",\ CellLabel->"In[59]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dependentVariables\\)\\\" is similar to \ existing symbol \\\"\\!\\(DependentVariables\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[59]:="] }, Open ]], Cell[BoxData[ \(\(\( (*\ symbols\ for\ labels\ *) \)\(\[IndentingNewLine]\)\(\(itt := StyleForm["\", FontSlant \[Rule] "\"];\)\[IndentingNewLine] \(bfb := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfc := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfm := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfn := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bft := \ StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfx := \ StyleForm["\", FontWeight \[Rule] "\"];\)\)\)\)], "Input", CellLabel->"In[60]:="], Cell[BoxData[ \(\(\( (*\ put\ everything\ together\ *) \)\(\[IndentingNewLine]\)\(frenet := Graphics3D[{{PointSize[0.04], RGBColor[0. , 1, 0. ], Point[b0], Point[b1], Point[b2], Point[b3], Point[{t, 0, 0.01}], GrayLevel[0], PointSize[0.02], Point[{0, 0, 0}], Point[{1, 0, 0}], Point[x]}, {Thickness[0.01], GrayLevel[0], Line[bpoints]}, {Thickness[0.005], GrayLevel[0. ], Line[{b0 + {0, 0, \(-0.01\)}, b1 + {0, 0, \(-0.01\)}, b2 + {0, 0, \(-0.01\)}, b3 + {0, 0, \(-0.01\)}}], Thickness[0.005], GrayLevel[0], Line[{{0, 0, 0}, {t - 0.01, 0, 0}}], Line[{{t + 0.01, 0, 0}, {1, 0, 0}}]}, {Thickness[0.01], EdgeForm[], GrayLevel[0], Arrow3D[x, x + vt], Arrow3D[x, x + vb], Arrow3D[x, x + vm], GrayLevel[0.6], Arrow3D[x + vt, x + vt + kappa\ vm], Arrow3D[x + vb, x + vb - tau\ vm], Arrow3D[x + vm, x + vm + tau\ vb], Arrow3D[x + vm, x + vm - kappa\ vt], Arrow3D[x + vm, x + vm + tau\ vb - kappa\ vt], Thickness[0.0025], Line[{x + vm - kappa\ vt, x + vm + tau\ vb - kappa\ vt, x + vm + tau\ vb}]}, {Text[itt, {t, 0, 0.01}, {0, 1.5}], Text["\<0\>", {0, 0, 0}, {0, 1.5}], Text["\<1\>", {1, 0, 0}, {0, 1.5}], Text[StringForm["\<````````\>", bfx, "\<(\>", itt, "\<)\>"], x, {0, 1.5}], Text[bft, x + vt, {\(-1.1\), 1.5}], Text[bfb, x + vb, {\(-1.2\), \(-1.2\)}], Text[bfm, x + vm, {\(-1.2\), 0}], Text[StringForm["\<````\>", "\<-\[Tau] \>", bfm], x + vb - tau\ vm, {1. , \(-1.3\)}], Text[StringForm["\<````\>", "\<\[Kappa] \>", bfm], x + vt + kappa\ vm, {0. , \(-1.3\)}], Text[StringForm["\<````\>", "\<-\[Kappa] \>", bft], x + vm - kappa\ vt, {1. , 0}], Text[StringForm["\<````\>", "\<\[Tau] \>", bfb], x + vm + tau\ vb, {\(-0.9\), \(-1.1\)}]}}, ViewPoint \[Rule] {0, 0, 4}, ViewVertical \[Rule] {0, 1, 0}, SphericalRegion \[Rule] True, PlotRange \[Rule] {{\(-1\), 2}, {\(-0.5\), 1.5}, {\(-0.1\), 0.1}}, Boxed \[Rule] False, Axes \[Rule] False, Ticks \[Rule] Automatic, Lighting \[Rule] False, AxesLabel \[Rule] {"\", "\", "\"}, TextStyle \[Rule] {FontFamily \[Rule] "\", FontSize \[Rule] 24}]\)\)\)], "Input", CellLabel->"In[67]:="], Cell[BoxData[ \(WriteLiveForm["\", frenet]\)], "Input", CellLabel->"In[68]:="] }, Closed]], Cell[CellGroupData[{ Cell["Curvature of a Curve on a Surface", "Subsection"], Cell[BoxData[ \(\(SetOptions[Arrow3D, HeadLength \[Rule] 0.15];\)\)], "Input", CellLabel->"In[69]:="], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ vectors, \ in\ particular\ control\ vertices\ for\ the\ Bezier\ patch, \ and\ vectors\ characterizing\ a\ curve\ and\ a\ surface\ at\ a\ point\ \ *) \)\(\[IndentingNewLine]\)\(defineVector[{"\", "\", "\", \ "\", "\", "\", \ "\", "\", "\", "\", \ "\", "\", "\", "\", "\", "\", \ "\", "\", "\", "\", "\", "\"}];\)\)\)], \ "Input", CellLabel->"In[70]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(b00x\\)\\\" is similar to existing symbols \ \\!\\({b00, b0x}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[70]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(b00y\\)\\\" is similar to existing symbols \ \\!\\({b00, b00x, b0y}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[70]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(b00z\\)\\\" is similar to existing symbols \ \\!\\({b00, b00x, b00y, b0z}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[70]:="], Cell[BoxData[ RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output of \ \\!\\(General :: \\\"spell\\\"\\) will be suppressed during this calculation. \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[70]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(normal\\)\\\" is similar to existing symbol \ \\\"\\!\\(Normal\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[70]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(normalx\\)\\\" is similar to existing symbol \ \\\"\\!\\(normal\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[70]:="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ Bezier\ patch\ *) \)\(\[IndentingNewLine]\)\(\(bernstein[i_, n_, t_] := Binomial[n, i] t^i\ \((1 - t)\)^\((n - i)\);\)\[IndentingNewLine] \(b[u_, v_] := Sum[bernstein[i, 2, u]*bernstein[j, 2, v]* Symbol["\" <> ToString[i] <> ToString[j]], {i, 0, 2}, {j, 0, 2}];\)\[IndentingNewLine] \(dbdu[u_, v_] = D[b[u, v], u];\)\[IndentingNewLine] \(dbdv[u_, v_] = D[b[u, v], v];\)\)\)\)], "Input", CellLabel->"In[71]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(dbdv\\)\\\" is similar to existing symbol \\\ \"\\!\\(dbdu\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[71]:="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ curve\ and\ its\ derivatives\ in\ parameter\ space\ u, v\ *) \)\(\[IndentingNewLine]\)\(\(u[t_] := u*\((1 - t)\)^2 + 2*udu*t \((1 - t)\) + uddu*t*t;\)\[IndentingNewLine] \(v[t_] := v*\((1 - t)\)^2 + 2*vdv*t \((1 - t)\) + vddv*t*t;\)\[IndentingNewLine] \(db[t_] = D[b[u[t], v[t]], t];\)\[IndentingNewLine] \(ddb[t_] = D[b[u[t], v[t]], {t, 2}];\)\[IndentingNewLine] \(dddb[t_] = D[b[u[t], v[t]], {t, 3}];\)\)\)\)], "Input", CellLabel->"In[75]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(uddu\\)\\\" is similar to existing symbol \\\ \"\\!\\(udu\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\ \\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[75]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(vddv\\)\\\" is similar to existing symbol \\\ \"\\!\\(vdv\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\ \\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[75]:="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ points\ of\ curves\ for\ the\ graphics\ *) \)\(\ \[IndentingNewLine]\)\(\(iMax = 32;\)\[IndentingNewLine] \(ba0points = Table[b[i/iMax + 10. ^\(-10\), 10. ^\(-10\)], {i, 0, iMax}];\)\[IndentingNewLine] \(ba1points = Table[b[i/iMax + 10. ^\(-10\), 1 + 10. ^\(-10\)], {i, 0, iMax}];\)\[IndentingNewLine] \(b0apoints = Table[b[10. ^\(-10\), i/iMax + 10. ^\(-10\)], {i, 0, iMax}];\)\[IndentingNewLine] \(b1apoints = Table[b[1 + 10. ^\(-10\), i/iMax + 10. ^\(-10\)], {i, 0, iMax}];\)\[IndentingNewLine] \(bavpoints = Table[b[i/iMax + 10. ^\(-10\), v], {i, 0, iMax}];\)\[IndentingNewLine] \(buapoints = Table[b[u, i/iMax + 10. ^\(-10\)], {i, 0, iMax}];\)\[IndentingNewLine] \(upoints = Table[{u[2\ i/iMax + 10. ^\(-10\)], v[2\ i/iMax + 10. ^\(-10\)], 0}, {i, \(-iMax\)/4, iMax/2}];\)\[IndentingNewLine] \(btpoints = Table[b[u[2\ i/iMax + 10. ^\(-10\)], v[2\ i/iMax + 10. ^\(-10\)]], {i, \(-iMax\)/4, iMax/2}];\)\)\)\)], "Input", CellLabel->"In[80]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(b0apoints\\)\\\" is similar to existing \ symbol \\\"\\!\\(ba0points\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[80]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(b1apoints\\)\\\" is similar to existing \ symbol \\\"\\!\\(ba1points\\)\\\". \ \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\ \\\", ButtonFrame->None, ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], \ "Message", CellLabel->"From In[80]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(upoints\\)\\\" is similar to existing symbol \ \\\"\\!\\(bpoints\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[80]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(btpoints\\)\\\" is similar to existing \ symbol \\\"\\!\\(bpoints\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[80]:="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ define\ osculating\ circles\ *) \)\(\[IndentingNewLine]\)\(\(iMax = 64;\)\[IndentingNewLine] \(cpoints = Table[N[vc + rho*Cos[2\ Pi\ i/iMax]*vm + rho*Sin[2\ Pi\ i/iMax]*vt], {i, 0, iMax}];\)\[IndentingNewLine] \(cnpoints = Table[N[vcn + rhon*Cos[2\ Pi\ i/iMax]*normal + rhon*Sin[2\ Pi\ i/iMax]*vt], {i, 0, iMax}];\)\)\)\)], "Input", CellLabel->"In[89]:="], Cell[BoxData[ RowBox[{\(General::"spell"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(cpoints\\)\\\" is similar to existing \ symbols \\!\\({bpoints, upoints}\\). \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\ \", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[89]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(cnpoints\\)\\\" is similar to existing \ symbol \\\"\\!\\(cpoints\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[89]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(rhon\\)\\\" is similar to existing symbol \\\ \"\\!\\(rho\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", ButtonStyle->\ \\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[89]:="] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ set\ independent\ variables; \ {u, v}, {udu, vdv}\ and\ {uddu, vddv}\ are\ control\ vertices\ of\ a\ Bezier\ curve\ in\ the\ u, v\ parameter\ space\ \ \ *) \)\(\[IndentingNewLine]\)\(independentVariables = Flatten[{u \[Rule] 0.2, v \[Rule] 0.5, uOld \[Rule] 0.2, vOld \[Rule] 0.5, \[IndentingNewLine]udu \[Rule] 0.35, vdv \[Rule] 0.7, \[IndentingNewLine]uddu \[Rule] 0.45, vddv \[Rule] 0.9, \[IndentingNewLine]independentVariablesForVector["\",\ {\(-3\), 0.5, 0. }], independentVariablesForVector["\", {\(-2.5\), 0.5, 0.5}], independentVariablesForVector["\", {\(-2\), 0.2, 1}], independentVariablesForVector["\", {\(-2.7\), 0.9, \(-0.3\)}], independentVariablesForVector["\", {\(-2.1\), \(-1.5\), \ \(-0.5\)}], independentVariablesForVector["\", {\(-1.5\), 0.3, 0.8}], independentVariablesForVector["\", {\(-2. \), 1.0, \(-1.5\)}], independentVariablesForVector["\", {\(-1.5\), 1.2, \(-1. \)}], independentVariablesForVector["\", {\(-0.5\), 0.6, \(-0.5\)}]}];\)\)\)], "Input", CellLabel->"In[92]:="], Cell[BoxData[ RowBox[{\(General::"spell1"\), \(\(:\)\(\ \)\), "\<\"Possible spelling \ error: new symbol name \\\"\\!\\(vOld\\)\\\" is similar to existing symbol \\\ \"\\!\\(uOld\\)\\\". \\!\\(\\*ButtonBox[\\\"More\[Ellipsis]\\\", \ ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \ ButtonData:>\\\"General::spell1\\\"]\\)\"\>"}]], "Message", CellLabel->"From In[92]:="] }, Open ]], Cell[BoxData[ \(\(\( (*\ set\ dependent\ variables\ \ *) \)\(\[IndentingNewLine]\)\(\((dependentVariables = Flatten[{\[IndentingNewLine]u \[Rule] Max[0, Min[1, u]], \[IndentingNewLine]v \[Rule] Max[0, Min[1, v]], \[IndentingNewLine]udu \[Rule] If[u == uOld, udu, \((u - uOld)\) + udu], \[IndentingNewLine]vdv \[Rule] If[v \[Equal] vOld, vdv, \((v - vOld)\) + vdv], \[IndentingNewLine]uddu \[Rule] If[u \[Equal] uOld, uddu, \((u - uOld)\) + uddu], \[IndentingNewLine]vddv \[Rule] If[v \[Equal] vOld, vddv, \((v - vOld)\) + vddv], \[IndentingNewLine]du \[Rule] udu - u, \[IndentingNewLine]dv \[Rule] vdv - v, \[IndentingNewLine]ddu \[Rule] uddu - udu, \[IndentingNewLine]ddv \[Rule] vddv - vdv, \[IndentingNewLine]uOld \[Rule] u, \[IndentingNewLine]vOld \[Rule] v, \[IndentingNewLine]dependentVariablesForVector["\", b[u, v]], dependentVariablesForVector["\", dbdu[u, v]], dependentVariablesForVector["\", dbdv[u, v]], dependentVariablesForVector["\", Cross[xu, xv]/Sqrt[Cross[xu, xv] . Cross[xu, xv]]], dependentVariablesForVector["\", db[0]], dependentVariablesForVector["\", ddb[0]], dependentVariablesForVector["\", dddb[0]], dependentVariablesForVector["\", dxdt/Sqrt[dxdt . dxdt]], dependentVariablesForVector["\", Cross[dxdt, ddxddt]], dependentVariablesForVector["\", vb1/Sqrt[vb1 . vb1]], dependentVariablesForVector["\", Cross[vb, vt]], kappa \[Rule] Sqrt[vb1 . vb1]/Sqrt[\((dxdt . dxdt)\)^3], rho \[Rule] Sqrt[\((dxdt . dxdt)\)^3]/Sqrt[vb1 . vb1], dependentVariablesForVector["\", x + rho\ vm], \[IndentingNewLine]cosphi \[Rule] vm . normal, \[IndentingNewLine]rhon \[Rule] rho/cosphi, \ \[IndentingNewLine]dependentVariablesForVector["\", x + rhon\ normal]}])\);\)\)\)], "Input", CellLabel->"In[93]:="], Cell[BoxData[ \(\(\( (*\ symbols\ for\ labels\ *) \)\(\[IndentingNewLine]\)\(\(itt := StyleForm["\", FontSlant \[Rule] "\"];\)\[IndentingNewLine] \(itu := StyleForm["\", FontSlant \[Rule] "\"];\)\[IndentingNewLine] \(itv := StyleForm["\", FontSlant \[Rule] "\"];\)\[IndentingNewLine] \(bfb := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfc := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfm := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfn := StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfu := \ StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bft := \ StyleForm["\", FontWeight \[Rule] "\"];\)\[IndentingNewLine] \(bfx := \ StyleForm["\", FontWeight \[Rule] "\"];\)\)\)\)], "Input", CellLabel->"In[94]:="], Cell[BoxData[ \(\(\( (*\ put\ everything\ together\ *) \)\(\[IndentingNewLine]\)\(curvature := Graphics3D[{{PointSize[0.02], RGBColor[0. , 1, 0. ], Point[b00], Point[b01], Point[b02], Point[b10], Point[b11], Point[b12], Point[b20], Point[b21], Point[b22], PointSize[0.04], Point[{u, v, 0.00001}], Point[{udu, vdv, 0.00001}], Point[{uddu, vddv, 0.00001}], GrayLevel[0], PointSize[0.02], Point[x]}, {Thickness[0.0025], GrayLevel[0], Line[ba0points], Line[ba1points], Line[b0apoints], Line[b1apoints], Line[bavpoints], Line[buapoints], Thickness[0.005], Line[btpoints]}, {Thickness[0.0025], Line[{{0, 0, 0}, {1, 0, 0}}], Line[{{0, 1, 0}, {1, 1, 0}}], Line[{{0, 0, 0}, {0, 1, 0}}], Line[{{1, 0, 0}, {1, 1, 0}}], Line[{{u, 0, 0}, {u, v, 0}}], Line[{{u, v, 0}, {u, 1, 0}}], Line[{{0, v, 0}, {u, v, 0}}], Line[{{u, v, 0}, {1, v, 0}}], Thickness[0.005], Line[upoints]}, {Thickness[0.0025], Line[{b00, b01}], Line[{b01, b02}], Line[{b10, b11}], Line[{b11, b12}], Line[{b20, b21}], Line[{b21, b22}], Line[{b00, b10}], Line[{b10, b20}], Line[{b01, b11}], Line[{b11, b21}], Line[{b02, b12}], Line[{b12, b22}]}, {Thickness[0.01], EdgeForm[], GrayLevel[0], Arrow3D[x, x + normal]}, {Thickness[0.005], EdgeForm[], GrayLevel[0], Arrow3D[b00 - 0.5 \((b01 - b00)\), b00 - 0.5 \((b01 - b00)\) + 0.5 \((b10 - b00)\)], Text[itu, b00 - 0.5 \((b01 - b00)\) + 0.5 \((b10 - b00)\), {\(-1.4\), 0.5}], Arrow3D[b00 - 0.5 \((b10 - b00)\), b00 - 0.5 \((b10 - b00)\) + 0.5 \((b01 - b00)\)], Text[itv, b00 - 0.5 \((b10 - b00)\) + 0.5 \((b01 - b00)\), {\(-1.3\), \(-1.3\)}]}, {Text[bfx, x, {1.2, 0.9}], Text[bfn, x + normal, {\(-1.2\), 1.1}], Text[bfu, {u, v, 0}, {\(-1.3\), 1.1}], Text[StringForm["\<````-plane\>", itu, itv], {0.5, 0, 0}, {0, 1.2}]}, {Thickness[0.008], EdgeForm[], GrayLevel[0], Arrow3D[x, x + vt], Text[bft, x + vt, {\(-1.1\), 1.1}], Arrow3D[x, x + vm], Text[bfm, x + vm, {2. , 0. }], GrayLevel[0], PointSize[0.02], Point[vc], Thickness[0.005], Line[{x + vm, vc}], Text[bfc, vc, {\(-1.2\), \(-1.4\)}], Thickness[0.005], GrayLevel[0.6], Line[cpoints], GrayLevel[0.6], PointSize[0.02], Point[vcn], Thickness[0.005], Line[{x + normal, vcn}], Text[Subscript[bfc, "\"], vcn, {\(-1. \), \(-1.1\)}], Thickness[0.005], GrayLevel[0.6], Line[cnpoints]}}, ViewPoint \[Rule] {0, 0, 4}, ViewVertical \[Rule] {0, 1, 0}, SphericalRegion \[Rule] True, PlotRange \[Rule] {{\(-3. \), 1.0}, {\(-0.1\), 1.1}, {\(-1.1\), 1.1}}, Boxed \[Rule] False, Axes \[Rule] False, Lighting \[Rule] False, Ticks \[Rule] Automatic, AxesLabel \[Rule] {"\", "\", "\"}, TextStyle \[Rule] {FontFamily \[Rule] "\", FontSize \[Rule] 24}]\)\)\)], "Input", CellLabel->"In[104]:="], Cell[BoxData[ \(WriteLiveForm["\", curvature]\)], "Input"] }, Closed]] }, Closed]] }, FrontEndVersion->"5.1 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 717}}, AutoGeneratedPackage->None, WindowSize->{680, 684}, WindowMargins->{{196, Automatic}, {0, Automatic}}, StyleDefinitions -> "ArticleModern.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->{ "S5.41.1"->{ Cell[47383, 1256, 238, 5, 45, "Input", CellTags->"S5.41.1"]} } *) (*CellTagsIndex CellTagsIndex->{ {"S5.41.1", 94381, 2298} } *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 494, 16, 138, "Text"], Cell[2251, 69, 331, 7, 46, "Text"], Cell[CellGroupData[{ Cell[2607, 80, 39, 0, 63, "Section"], Cell[2649, 82, 199, 5, 27, "Text"], Cell[CellGroupData[{ Cell[2873, 91, 2024, 37, 405, "Input", InitializationCell->True], Cell[4900, 130, 393, 6, 70, "Message"] }, Open ]], Cell[5308, 139, 141, 3, 27, "Text"], Cell[CellGroupData[{ Cell[5474, 146, 9958, 278, 4617, "Input", InitializationCell->True], Cell[15435, 426, 69, 2, 70, "Output"], Cell[15507, 430, 77, 2, 70, "Output"], Cell[15587, 434, 407, 7, 70, "Message"], Cell[15997, 443, 399, 7, 70, "Message"], Cell[16399, 452, 399, 7, 70, "Message"], Cell[16801, 461, 362, 6, 70, "Message"], Cell[17166, 469, 388, 6, 70, "Message"], Cell[17557, 477, 393, 6, 70, "Message"], Cell[17953, 485, 394, 7, 70, "Message"], Cell[18350, 494, 401, 6, 70, "Message"], Cell[18754, 502, 361, 6, 70, "Message"], Cell[19118, 510, 399, 7, 70, "Message"], Cell[19520, 519, 397, 7, 70, "Message"], Cell[19920, 528, 362, 6, 70, "Message"], Cell[20285, 536, 77, 2, 70, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[20411, 544, 103, 4, 37, "Section"], Cell[CellGroupData[{ Cell[20539, 552, 38, 0, 54, "Subsection"], Cell[20580, 554, 77, 2, 45, "Input"], Cell[20660, 558, 82, 2, 45, "Input"], Cell[20745, 562, 169, 3, 65, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[20951, 570, 40, 0, 54, "Subsection"], Cell[CellGroupData[{ Cell[21016, 574, 39, 0, 43, "Subsubsection"], Cell[21058, 576, 155, 3, 65, "Input"], Cell[21216, 581, 77, 2, 45, "Input"], Cell[21296, 585, 99, 2, 45, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[21432, 592, 42, 0, 43, "Subsubsection"], Cell[21477, 594, 355, 8, 125, "Input"], Cell[21835, 604, 77, 2, 45, "Input"], Cell[21915, 608, 114, 2, 45, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[22066, 615, 48, 0, 43, "Subsubsection"], Cell[22117, 617, 430, 8, 125, "Input"], Cell[22550, 627, 77, 2, 45, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[22676, 635, 54, 0, 54, "Subsection"], Cell[22733, 637, 244, 4, 103, "Input"], Cell[22980, 643, 1603, 29, 357, "Input"], Cell[CellGroupData[{ Cell[24608, 676, 33, 0, 43, "Subsubsection"], Cell[24644, 678, 88, 1, 37, "Input"], Cell[24735, 681, 113, 2, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[24885, 688, 29, 0, 43, "Subsubsection"], Cell[24917, 690, 377, 7, 117, "Input"], Cell[25297, 699, 85, 1, 37, "Input"], Cell[25385, 702, 107, 2, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[25529, 709, 44, 0, 43, "Subsubsection"], Cell[25576, 711, 200, 3, 53, "Input"], Cell[25779, 716, 230, 4, 53, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[26046, 725, 40, 0, 43, "Subsubsection"], Cell[26089, 727, 275, 4, 69, "Input"], Cell[26367, 733, 302, 5, 69, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[26706, 743, 43, 0, 43, "Subsubsection"], Cell[26752, 745, 304, 5, 85, "Input"], Cell[27059, 752, 325, 5, 85, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27421, 762, 70, 0, 28, "Subsubsection"], Cell[27494, 764, 1197, 23, 251, "Input"], Cell[28694, 789, 382, 6, 75, "Input"], Cell[29079, 797, 369, 6, 75, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[29485, 808, 53, 0, 28, "Subsubsection"], Cell[29541, 810, 401, 8, 75, "Input"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[30003, 825, 39, 0, 37, "Section"], Cell[CellGroupData[{ Cell[30067, 829, 56, 0, 54, "Subsection"], Cell[30126, 831, 1527, 27, 445, "Input"], Cell[31656, 860, 169, 3, 65, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[31862, 868, 38, 0, 54, "Subsection"], Cell[31903, 870, 352, 6, 125, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[32292, 881, 47, 0, 54, "Subsection"], Cell[32342, 883, 878, 15, 245, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[33257, 903, 46, 0, 54, "Subsection"], Cell[33306, 905, 2967, 52, 725, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[36310, 962, 36, 0, 54, "Subsection"], Cell[36349, 964, 515, 11, 125, "Input"], Cell[36867, 977, 61, 0, 27, "Text"], Cell[36931, 979, 325, 5, 65, "Input"], Cell[37259, 986, 43, 0, 27, "Text"], Cell[37305, 988, 550, 11, 125, "Input"], Cell[37858, 1001, 165, 8, 27, "Text"], Cell[38026, 1011, 390, 7, 85, "Input"], Cell[38419, 1020, 146, 3, 27, "Text"], Cell[38568, 1025, 404, 7, 105, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[39009, 1037, 45, 0, 54, "Subsection"], Cell[39057, 1039, 665, 11, 185, "Input"], Cell[39725, 1052, 514, 9, 145, "Input"], Cell[40242, 1063, 922, 19, 185, "Input"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[41213, 1088, 40, 0, 37, "Section"], Cell[CellGroupData[{ Cell[41278, 1092, 54, 0, 54, "Subsection"], Cell[41335, 1094, 695, 14, 205, "Input"], Cell[42033, 1110, 349, 8, 65, "Input"], Cell[42385, 1120, 365, 7, 85, "Input"], Cell[42753, 1129, 158, 3, 45, "Input"], Cell[42914, 1134, 185, 4, 45, "Input"], Cell[43102, 1140, 132, 3, 65, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[43271, 1148, 50, 0, 54, "Subsection"], Cell[43324, 1150, 767, 13, 165, "Input"], Cell[44094, 1165, 40, 1, 45, "Input"], Cell[44137, 1168, 909, 14, 205, "Input"], Cell[45049, 1184, 66, 2, 45, "Input"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[45164, 1192, 40, 0, 37, "Section"], Cell[45207, 1194, 519, 9, 85, "Input"], Cell[45729, 1205, 477, 9, 85, "Input"], Cell[46209, 1216, 370, 9, 85, "Input"], Cell[46582, 1227, 491, 12, 105, "Input"], Cell[47076, 1241, 151, 4, 45, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[47264, 1250, 32, 0, 37, "Section"], Cell[47299, 1252, 81, 2, 45, "Input"], Cell[47383, 1256, 238, 5, 45, "Input", CellTags->"S5.41.1"] }, Closed]], Cell[CellGroupData[{ Cell[47658, 1266, 36, 0, 37, "Section"], Cell[CellGroupData[{ Cell[47719, 1270, 33, 0, 54, "Subsection"], Cell[47755, 1272, 477, 8, 105, "Input"], Cell[48235, 1282, 1247, 19, 245, "Input"], Cell[49485, 1303, 459, 10, 85, "Input"], Cell[49947, 1315, 556, 11, 125, "Input"], Cell[50506, 1328, 285, 7, 65, "Input"], Cell[50794, 1337, 2921, 48, 565, "Input"], Cell[53718, 1387, 90, 2, 45, "Input"], Cell[53811, 1391, 489, 9, 105, "Input"], Cell[54303, 1402, 853, 14, 185, "Input"], Cell[55159, 1418, 327, 7, 105, "Input"], Cell[55489, 1427, 446, 9, 125, "Input"], Cell[55938, 1438, 343, 7, 85, "Input"], Cell[56284, 1447, 78, 1, 45, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[56399, 1453, 32, 0, 32, "Subsection"], Cell[56434, 1455, 620, 11, 125, "Input"], Cell[57057, 1468, 1905, 35, 325, "Input"], Cell[58965, 1505, 90, 2, 45, "Input"], Cell[59058, 1509, 417, 8, 105, "Input"], Cell[59478, 1519, 230, 5, 65, "Input"], Cell[59711, 1526, 240, 5, 65, "Input"], Cell[59954, 1533, 451, 7, 145, "Input"], Cell[60408, 1542, 312, 6, 85, "Input"], Cell[60723, 1550, 152, 4, 45, "Input"], Cell[60878, 1556, 109, 2, 45, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[61024, 1563, 44, 0, 32, "Subsection"], Cell[CellGroupData[{ Cell[61093, 1567, 1289, 24, 305, "Input"], Cell[62385, 1593, 387, 6, 14, "Message"], Cell[62775, 1601, 387, 6, 29, "Message"], Cell[63165, 1609, 394, 6, 29, "Message"] }, Open ]], Cell[63574, 1618, 203, 5, 65, "Input"], Cell[CellGroupData[{ Cell[63802, 1627, 667, 11, 125, "Input"], Cell[64472, 1640, 387, 6, 14, "Message"], Cell[64862, 1648, 387, 6, 29, "Message"], Cell[65252, 1656, 394, 6, 29, "Message"], Cell[65649, 1664, 391, 6, 14, "Message"], Cell[66043, 1672, 395, 7, 29, "Message"], Cell[66441, 1681, 362, 6, 14, "Message"], Cell[66806, 1689, 395, 6, 29, "Message"], Cell[67204, 1697, 363, 6, 14, "Message"], Cell[67570, 1705, 326, 5, 82, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[67933, 1715, 517, 10, 125, "Input"], Cell[68453, 1727, 385, 6, 14, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[68875, 1738, 288, 7, 85, "Input"], Cell[69166, 1747, 385, 6, 14, "Message"] }, Open ]], Cell[69566, 1756, 542, 10, 145, "Input"], Cell[CellGroupData[{ Cell[70133, 1770, 963, 17, 225, "Input"], Cell[71099, 1789, 416, 7, 29, "Message"] }, Open ]], Cell[71530, 1799, 835, 22, 185, "Input"], Cell[72368, 1823, 2570, 44, 465, "Input"], Cell[74941, 1869, 98, 2, 45, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[75076, 1876, 55, 0, 32, "Subsection"], Cell[75134, 1878, 107, 2, 45, "Input"], Cell[CellGroupData[{ Cell[75266, 1884, 540, 9, 105, "Input"], Cell[75809, 1895, 383, 6, 14, "Message"], Cell[76195, 1903, 389, 6, 29, "Message"], Cell[76587, 1911, 395, 6, 29, "Message"], Cell[76985, 1919, 362, 6, 14, "Message"], Cell[77350, 1927, 390, 6, 14, "Message"], Cell[77743, 1935, 391, 6, 14, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[78171, 1946, 525, 11, 145, "Input"], Cell[78699, 1959, 386, 6, 14, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[79122, 1970, 546, 11, 145, "Input"], Cell[79671, 1983, 385, 6, 14, "Message"], Cell[80059, 1991, 385, 6, 14, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[80481, 2002, 1212, 29, 225, "Input"], Cell[81696, 2033, 398, 7, 29, "Message"], Cell[82097, 2042, 398, 7, 29, "Message"], Cell[82498, 2051, 392, 6, 14, "Message"], Cell[82893, 2059, 393, 6, 29, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[83323, 2070, 458, 10, 105, "Input"], Cell[83784, 2082, 394, 6, 29, "Message"], Cell[84181, 2090, 393, 6, 29, "Message"], Cell[84577, 2098, 385, 6, 14, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[84999, 2109, 1342, 25, 305, "Input"], Cell[86344, 2136, 386, 6, 14, "Message"] }, Open ]], Cell[86745, 2145, 2401, 41, 565, "Input"], Cell[89149, 2188, 1154, 31, 245, "Input"], Cell[90306, 2221, 3304, 53, 665, "Input"], Cell[93613, 2276, 79, 1, 45, "Input"] }, Closed]] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)