(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 37541, 1069]*) (*NotebookOutlinePosition[ 40421, 1171]*) (* CellTagsIndexPosition[ 39984, 1150]*) (*WindowFrame->Normal*) Notebook[{ Cell["\[Copyright] 2004 K. Sutner ", "SmallText"], Cell[CellGroupData[{ Cell["Turtle Graphics", "Title", CellTags->"c:1"], Cell[CellGroupData[{ Cell["Stack Turtle", "Section", CellTags->"c:2"], Cell[TextData[{ "The following implementation has an additional stack: can store and \ restore positions.\n(Easier than lifting the pen and back-tracking). \n\n\ Actions: \n\td\tdraw\n\tg\tgo, but don't draw\n\tt\tturn\n\ts\tstore\n\tr\t\ restore\n\tx\tany other formal variables\n\t\nFirst three are parametrized \ and truly functional, next two use a stack as side-effect. \nAdditional \ variables can be used in the r/w system, do not affect state.\n\nCan use \ 2-stage process:\n\n\t\[Bullet] use any r/w system,\n\t\[Bullet] translate \ into turtle code.\n\t\n\t\t\nActions are on ", Cell[BoxData[ \(TraditionalForm\`\[DoubleStruckCapitalR]\^2\[Cross]\ \ \[DoubleStruckCapitalR]\ \[Cross]\ \[DoubleStruckCapitalB]\)]], ": points in the plane , angles, and pen up/down information. \nAngles \ are in degrees for simplicity. " }], "Text"], Cell[TextData[{ "Turtle programs have header ", StyleBox["TP", "Input"], ".\nCan use ", StyleBox["NonCommutativeMultiply", "Input"], " to repeat turtle programs.\n\n", StyleBox["PlotTP", "Input"], " automatically repeats program to closure unless option ", StyleBox["Full->False", "Input"], " is specified. " }], "Text"], Cell[CellGroupData[{ Cell["The basic actions and pretty printing", "Subsubsection", CellTags->"c:3"], Cell[BoxData[{ \(\(ClearAll[TP, d, g, t, s, r, Action, $turtlestack];\)\), "\[IndentingNewLine]", \(\(Attributes[TP] = {Flat, OneIdentity};\)\), "\[IndentingNewLine]", \(\(oneDeg\ = \ N[Degree];\)\), "\[IndentingNewLine]", \(\(TP\ /: \ n_Integer\ ** \ p_TP\ := \ TP @@ Table[p, {n}];\)\), "\[IndentingNewLine]", \(\(TP\ \ /: \ \ z_\ \ p_TP\ \ := \ \(z # &\)\ /@ \ p;\)\), "\[IndentingNewLine]", \(\(d\ /: \ \ z_\ d[x_]\ := \ d[z\ x];\)\), "\[IndentingNewLine]", \(\(g\ /: \ \ z_\ g[x_]\ := \ g[z\ x];\)\), "\[IndentingNewLine]", \(\(t\ \ /: \ z_\ \ t[x_]\ := \ t[x];\)\), "\[IndentingNewLine]", \(\(s\ \ /: \ z_\ \ s[]\ := \ s[];\)\), "\[IndentingNewLine]", \(\(r\ /: \ \ z_\ r[]\ := \ r[];\)\)}], "Input"], Cell[BoxData[{ \(\(Format[d[z_]]\ := \ DisplayForm[\ SubscriptBox[d, NumberForm[z, {10, 2}]]];\)\), "\[IndentingNewLine]", \(Format[g[z_]]\ := \ DisplayForm[\ SubscriptBox[g, NumberForm[z, {10, 2}]]]\), "\[IndentingNewLine]", \(Format[t[z_]]\ := \ DisplayForm[\ SubscriptBox[t, NumberForm[z, {10, 2}]]]\), "\[IndentingNewLine]", \(Format[s[]]\ := \ DisplayForm[\ "\"]\), "\[IndentingNewLine]", \(Format[r[]]\ := \ DisplayForm[\ "\"]\)}], "Input"], Cell[BoxData[ \(\($turtlestack\ = \ {};\)\)], "Input"], Cell[BoxData[ \(\(\(ClearAll[Action]\[IndentingNewLine] \(Action[\ {xy_, phi_, pn_}, d[z_]] := Chop[{\ xy + z\ {Cos[phi\ oneDeg], Sin[phi\ oneDeg]}, phi, True\ }];\)\[IndentingNewLine] \(Action[{xy_, phi_, pn_}, g[z_]] := Chop[{xy + z {Cos[phi\ oneDeg], Sin[phi\ oneDeg]}, phi, False\ }];\)\[IndentingNewLine] \(Action[{xy_, phi_, pn_}, t[psi_]] := Chop[{xy, Mod[phi + psi, 360], pn}];\)\[IndentingNewLine] \(Action[{xy_, phi_, pn_}, s[]\ ] := \((\ PrependTo[\ $turtlestack, \ {xy, phi, pn}\ ]; \ {xy, phi, pn}\ )\);\)\[IndentingNewLine] \(Action[{xy_, phi_, pn_}, r[]] := \ \[IndentingNewLine]\t With[\ {st\ = \ First[$turtlestack]}, \[IndentingNewLine]\t\t\t$turtlestack\ = \ \ Rest[$turtlestack]; \ st\ ];\)\ \t\[IndentingNewLine] \(Action[{xy_, phi_, pn_}, _\ ] := {xy, phi, pn};\)\)\(\ \)\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["The Rewrite Operations, Generating Turtle Code", "Subsubsection", CellTags->"c:4"], Cell[BoxData[{ \(ClearAll[GenerateTP]\), "\[IndentingNewLine]", \(\(GenerateTP[\ ax_TP, rules_, n_Integer] := Nest[\ \((#\ /. \ rules)\) &, ax, n\ ];\)\), "\n", \(\(GenerateTP[\ ax_TP, rules_, n_Integer, \ trans_\ ] := \[IndentingNewLine]Nest[\ \((#\ /. \ rules)\) &, ax, n\ ]\ /. \ trans;\)\)}], "Input"], Cell[BoxData[ \(\(\(\n\)\(TurtleRun[ pp_TP]\ := \ \[IndentingNewLine]\((\ \[IndentingNewLine]\t\ $turtlestack\ = \ {}; \ \[IndentingNewLine]\t List @@ FoldList[\ Action, \ {{0, 0}, 0, False}, \ pp\ ]\ \[IndentingNewLine])\);\)\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Turtle Code to Graphics", "Subsubsection", CellTags->"c:5"], Cell["\<\ Need to add options to fine-tune graphics: color as well as size. \ \>", "Text"], Cell["<< Utilities`FilterOptions`;", "Input"], Cell[BoxData[{ \(Clear[TurtleAnalyze]\), "\[IndentingNewLine]", \(\(TurtleAnalyze[p_TP]\ := \ TurtleAnalyze[TurtleRun[p]];\)\), "\[IndentingNewLine]", \(\(TurtleAnalyze[ L_List]\ := \[IndentingNewLine]Module[\ {x, phi}, \[IndentingNewLine]\t{x, phi}\ = \ Drop[Last[L], \(-1\)]; \[IndentingNewLine]\t{\ x, \ If[\ EvenQ[Numerator[phi/180]], Denominator[phi/180\ ], 2 Denominator[phi/180]]}\[IndentingNewLine]];\)\)}], "Input"], Cell[BoxData[{ \(\(\(killRuns[L_List]\ := \ First\ /@ \ Split[L];\)\(\[IndentingNewLine]\) \)\), "\[IndentingNewLine]", \(\(\(RunToLines[ L_List]\ := \ \[IndentingNewLine]Module[\ {LL, LLL}, \[IndentingNewLine]\t\tLL\ = \ Flatten[Cases[\ Partition[\ L, \ 2, \ 1\ ], \ {_, {__, True}}], 1]; \[IndentingNewLine]\t\tLLL\ = \ Split[\ LL, \ \ Implies[#1[\([3]\)], #2[\([3]\)]] &\ ]; \ \[IndentingNewLine]\t\tLine\ /@ \ \(killRuns\ /@ \ Map[\ First, \ LLL, \ {2}\ ]\)\[IndentingNewLine]];\)\(\n\) \)\)}], "Input"], Cell[BoxData[ \(\($defpointsize\ = \ 0.012;\)\)], "Input"], Cell[BoxData[{ \(ClearAll[RunToPoints]\), "\[IndentingNewLine]", \(\(Options[ RunToPoints] = {PlotStyle :> {{Blue, $defpointsize}, {Red, \ $defpointsize}}};\)\), "\[IndentingNewLine]", \(RunToPoints[\ L_List, opts___?OptionQ\ ]\ := \ \[IndentingNewLine]Module[\ {rt, rf, ps}, \[IndentingNewLine]\t ps\ = \ \(PlotStyle\ /. \ {opts}\)\ /. \ Options[RunToPoints]; \[IndentingNewLine]\t ps = Switch[ ps, \[IndentingNewLine]\t_? ColorQ, {{ps, $defpointsize}, {Red, 1.2 $defpointsize}}, \[IndentingNewLine]\t{_? ColorQ}, {{ps[\([1]\)], $defpointsize}, {Red, 1.2 $defpointsize}}, \[IndentingNewLine]\t_Real, {{Blue, ps}, {Red, $defpointsize}}, \[IndentingNewLine]\t{_Real, \ _Real}, {{Blue, ps[\([1]\)]}, {Red, ps[\([2]\)]}}, \[IndentingNewLine]\t{_? ColorQ, _Real}, {ps, {Red, 1.2\ ps[\([2]\)]}}, \[IndentingNewLine]\t{_?ColorQ, _? ColorQ}, {{ps[\([1]\)], $defpointsize}, {ps[\([2]\)], 1.2 $defpointsize}}, \[IndentingNewLine]\t_, ps]; \[IndentingNewLine]\t ps = MapAt[PointSize, ps, {{1, 2}, {2, 2}}]; \[IndentingNewLine]\[IndentingNewLine]\t rt\ = \ First\ /@ \ Cases[\ L, {__, True}]; \[IndentingNewLine]\t rf\ = \ First\ /@ \ Cases[\ L, {__, False}]; \[IndentingNewLine]\t Flatten[{\ ps[\([1]\)], Point /@ rt, \ ps[\([2]\)], \ Point /@ \ rf}]\[IndentingNewLine]]\)}], "Input"], Cell[BoxData[ \(\(\(ClearAll[PlotTP]\[IndentingNewLine] \(Options[PlotTP] = {Full \[Rule] True, ShowPoints \[Rule] False, PreOpts \[Rule] {}};\)\[IndentingNewLine] \(PlotTP[\ pp_TP, \ opts___?OptionQ\ ]\ := \ \[IndentingNewLine]Module[\ {rr, pts, preop}, \[IndentingNewLine]\t\tIf[\ \(Full\ \ /. \ {opts}\)\ \ /. \ Options[PlotTP], \[IndentingNewLine]\t\t\trep\ = \ Last@TurtleAnalyze[pp], \ \[IndentingNewLine]\t\t\trep\ = \ 1\ ]; \[IndentingNewLine]\t\trr\ = \ TurtleRun[\ rep ** pp]; \[IndentingNewLine]\t\tIf[\ \(ShowPoints\ \ /. \ \ {opts}\)\ /. \ Options[PlotTP], \ \[IndentingNewLine]\t\t\tpts\ = \ RunToPoints[\ rr, FilterOptions[\ RunToPoints, {opts}\ ]], \[IndentingNewLine]\t\t\tpts\ = \ \ {}\ ]; \[IndentingNewLine]\t\tpreop\ = \ \(PreOpts\ /. \ {opts}\)\ /. \ Options[PlotTP]; \[IndentingNewLine]\t\tShow[\ \ \[IndentingNewLine]\t\t\tGraphics[\ Flatten@Join[preop, \ pts, \[IndentingNewLine]\t\t\t\t{Blue, RunToLines[rr]}\ ], \ AspectRatio \[Rule] 1\ ], \[IndentingNewLine]\t\t\t\t\tFilterOptions[\ Graphics, {opts}\ ]\ ]\[IndentingNewLine]];\)\)\(\ \)\)\)], \ "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Repetition", "Section", CellTags->"c:6"], Cell[CellGroupData[{ Cell["Spirolaterals", "Subsection", CellTags->"c:7"], Cell[TextData[{ "Basic segment: \nGo straight ", Cell[BoxData[ \(TraditionalForm\`k\)]], " times according to a given list of distances, between steps turn ", Cell[BoxData[ \(TraditionalForm\`\[Phi]\)]], " or ", Cell[BoxData[ \(TraditionalForm\`\(-\[Phi]\)\)]], " according to given list.\n\nAngles are in degrees, not radians!\n" }], "Text"], Cell[BoxData[{ \(Clear[Splat, phi]\), "\n", \(\(Splat[phi_, k_Integer, sign_List: {}] := \ Splat[\ phi, Range[k], sign];\)\), "\[IndentingNewLine]", \(\(Splat[phi_, dist_List, sign_List: {}]\ := \ \[IndentingNewLine]Module[\ {rep}, \ \[IndentingNewLine]\t spl\ = \ \[IndentingNewLine]TP @@ Flatten@\[IndentingNewLine]Table[\ {d[dist[\([i]\)]], If[MemberQ[sign, i], t[phi], t[\(-phi\)]\ ]}, {i, Length[dist]}]\[IndentingNewLine]];\)\)}], "Input"], Cell[BoxData[ \(\(repetition[phi_]\ := \ \[IndentingNewLine]\t With[\ {pp = phi/360}, {\ \ Numerator[pp], \ Denominator[pp]}];\)\)], "Input"], Cell[BoxData[ \(\(Splat[\ 90, {1, 1, 1, 1}] // \ PlotTP;\)\)], "Input"], Cell[BoxData[ \(\(Splat[\ 60, {1, 1, 1, 1}] // \ PlotTP;\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[Splat[\ 120, {1, 1, 1}], \ AspectRatio \[Rule] Automatic];\)\)], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[15, 30];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p, \ Full \[Rule] False, \ ShowPoints \[Rule] True\ ];\)\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ Splat[\ 90, 3], \ AspectRatio \[Rule] Automatic];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ Splat[\ 90, 7], \ AspectRatio \[Rule] Automatic];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ Splat[\ 90, 15], \ AspectRatio \[Rule] Automatic];\)\)], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 150, 5];\)\), "\n", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 20, 5];\)\), "\n", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 72, \ 3];\)\), "\n", \(\(PlotTP[\ p, \ ShowPoints \[Rule] True\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 72, \ 5\ ];\)\), "\n", \(\(PlotTP[\ 5 ** p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 60, 5];\)\), "\n", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 120, 5];\)\), "\n", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 45, \ {1, 2, \ 1, \ 2, \ 1}\ ]\ ;\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 90, 25, {13}\ ]\ ;\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 90, 25, {24}\ ]\ ;\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[165, 30];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[170, 50];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ 2 ** p, \ Full \[Rule] False];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[10, 50];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[165, 90];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[15, 90];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[160, 20];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[150, 20];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[150, 5];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[150, 10];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[150, 15];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[150, 16];\)\), "\[IndentingNewLine]", \(\(PlotTP[\ p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 60, \ 7, {1}];\)\), "\[IndentingNewLine]", \(\(PlotTP[p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 60, \ 7, {7}];\)\), "\[IndentingNewLine]", \(\(PlotTP[p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 30, \ 25, {1}];\)\), "\[IndentingNewLine]", \(\(PlotTP[p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 30, \ 25, {13}];\)\), "\[IndentingNewLine]", \(\(PlotTP[p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 150, \ 25, {13}];\)\), "\[IndentingNewLine]", \(\(PlotTP[p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 30, 19, {1, 5, 17}];\)\), "\[IndentingNewLine]", \(\(PlotTP[p];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["N-Gons", "Subsection", CellTags->"c:8"], Cell[BoxData[{ \(\(MakeNGon[1] = TP[d[1]];\)\), "\[IndentingNewLine]", \(MakeNGon[n_Integer?\((# > 1 &)\)] := \ Splat[360/n, Table[1, {n}]]; MakeTurnGon[LL_List] := TP @@ Append[Flatten@Thread[{Table[d[1], {Length[LL]}], t /@ LL}], d[1]];\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ MakeNGon[12]\ ];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ MakeNGon[12], \ Full \[Rule] True, \ PlotStyle \[Rule] .04\ ];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ MakeNGon[12], \ \[IndentingNewLine]Full \[Rule] True, \ PlotStyle \[Rule] {{Cyan, .04}, {Red, .05}}, PreOpts \[Rule] {Thickness[0.02]}\ ];\)\)], "Input"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(rl\ = d[1]\ \[Rule] \ TP[t[\(-90\)], d[1], t[90], d[1], t[90], d[1]]\)\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ MakeNGon[8], \ rl, \ 5\ ]];\)\)], "Input"], Cell[BoxData[ \(repetition[\ 45\ 6]\)], "Input"], Cell[BoxData[{ \(\(p\ = \ Splat[\ 45, \ {1, 2, \ 1, 1, \ 2, \ 1}\ ]\ ;\)\), "\[IndentingNewLine]", \(\(PlotTP[\ \ 4 ** p\ ];\)\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ 4 ** p, \ rl, \ 4\ ]];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[4 ** p, \ rl, \ 4\ ], Full \[Rule] True, \ PlotStyle \[Rule] \ {{Blue, .02}, {Cyan, .04}}];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Make gifs", "Subsection", CellTags->"c:9"], Cell[BoxData[{ \(Clear[list2string, saveSplat]\), "\n", \(\(list2string[{}] = "\<\>";\)\), "\n", \(list2string[L_List]\ := StringJoin @@ Flatten[\ {\ ToString[First[L]], \ \({"\<.\>", ToString[#]} &\)\ /@ \ Rest[L]\ }\ ]\), "\n", \(saveSplat[\ phi_, \ k_, \ n_, \ L_List: {}\ , opts___?OptionQ\ ]\ := \[IndentingNewLine]Module[\ {gr}, \ gr\ = \ PlotTP[n ** Splat[phi, k, L], opts]; \ \[IndentingNewLine]\t\tDisplay[ StringJoin["\", ToString[phi], "\<.\>", ToString[k], "\<.\>", list2string[L], "\<.gif\>"], gr, "\"]\[IndentingNewLine]]\)}], "Input"], Cell[BoxData[ \(\(saveSplat[\ 90, \ 25, \ 4\ , \ {13}];\)\)], "Input"], Cell[BoxData[ \(\(saveSplat[\ 90, \ 25, \ 4\ , \ {24}];\)\)], "Input"], Cell[BoxData[ \(\(saveSplat[\ 30, \ 11, \ 12\ , \ {1, 2}];\)\)], "Input"], Cell[BoxData[ \(\(saveSplat[\ 120, \ 5, 3];\)\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Recursion", "Section", CellTags->"c:10"], Cell["\<\ Note: These are not in good shape and should be cleaned up. Using the 2-level r/w should simplify some examples quite a bit. \ \>", "Text"], Cell[CellGroupData[{ Cell["Koch Snow", "Subsection", CellTags->"c:11"], Cell[BoxData[{ \(ax\ = \ TP[\ d[1]\ ]\), "\n", \(rl\ = \ d[1]\ \[Rule] \ \ TP[\ d[1], t[60], d[1], t[\(-120\)], d[1], \ t[60], \ d[1]]\), "\n", \(\(p\ = \ GenerateTP[\ \ ax, \ rl, \ 5\ ];\)\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ p, \ AspectRatio \[Rule] \ .4, Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ MakeNGon[6], \ rl, \ 4\ ];\)\), "\n", \(\(PlotTP[\ p, Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell["Use scaling. ", "Text"], Cell[BoxData[{ \(\(ax\ = \ TP[\ d[1]\ ];\)\), "\[IndentingNewLine]", \(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[\ d[1], s[], t[90], d[ .9], r[], \ d[1]]\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ ax, \ rl, \ 6\ ];\)\), "\n", \(\(\(PlotTP[\ p, \ AspectRatio \[Rule] 1/GoldenRatio\ ];\)\(\[IndentingNewLine]\) \)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ MakeNGon[8], \ rl, \ 5\ ];\)\), "\n", \(\(PlotTP[\ p, Frame \[Rule] True, \ FrameTicks \[Rule] False];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Peano", "Subsection", CellTags->"c:12"], Cell["\<\ Use cw (clockwise) and cc (counterclockwise) as abbreviations in \ level 1 r/w-system. Probably should always do this unless scaling is used.\ \>", "Text"], Cell[BoxData[ \(\(Clear[cw, cc, x, y];\)\)], "Input"], Cell[BoxData[ \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[x], \ \[IndentingNewLine]\t{\ x\ \[Rule] \ TP[x, d, y, d, x, cc, d, cc, y, d, x, d, y, cw, d, cw, x, d, y, d, x], \ \[IndentingNewLine]\t y \[Rule] TP[y, d, x, d, y, cw, d, cw, x, d, y, d, x, cc, d, cc, y, d, x, d, y]}, \ \[IndentingNewLine]\t 4, \[IndentingNewLine]\t{\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], d \[Rule] \ d[1]\ }\[IndentingNewLine]\ \ ];\)\)], "Input"], Cell[BoxData[ \(DeleteCases[\ p, \ x | y]\ // \ Length\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False, \ PreOpts \[Rule] {Thickness[0.005]}\ ];\)\)], "Input"], Cell["Exactly why are the next two the same???", "Text"], Cell[BoxData[{ \(\(ax\ = \ TP[d, cc, d, cc, d, cc, d];\)\), "\n", \(\(p1\ = \ GenerateTP[\ \ ax, \ \[IndentingNewLine]\t{\ d\ \[Rule] \ TP[d, d, cc, d, cc, d, cc, d, cc, \ d, d]}, \ \[IndentingNewLine]\t 4, \[IndentingNewLine]\t{\ cc \[Rule] \ t[90], cw \[Rule] \ t[90], d \[Rule] \ d[1]\ }\[IndentingNewLine]\ \ ];\)\), "\n", \(\(p2\ = \ GenerateTP[\ \ ax, \ \[IndentingNewLine]\t{\ d\ \[Rule] \ TP[d, d, cc, d, cw, d, cc, d, cc, \ d, d]}, \ \[IndentingNewLine]\t 4, \[IndentingNewLine]\t{\ cc \[Rule] \ t[90], cw \[Rule] \ t[90], d \[Rule] \ d[1]\ }\[IndentingNewLine]\ \ ];\)\)}], "Input"], Cell[BoxData[ \(p1 === p2\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ p1, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)], "Input"], Cell["This is boring:", "Text"], Cell[BoxData[{ \(\(ax\ = \ MakeNGon[4];\)\), "\n", \(\(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[\ d[1], t[90], d[1], t[90], d[1], t[90], d[1], t[90], d[2]];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ ax, \ rl, \ 4\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell["Note the scaling in the last component.", "Text"], Cell[BoxData[{ \(\(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[\ s[], d[1], t[90], d[1], t[90], d[1], r[], d[2]];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ ax, \ rl, \ 5\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell["\<\ But this ain't: various scaling parameters in first and last move.\ \ \>", "Text"], Cell[BoxData[{ \(\(a\ = \ \(b\ = \ 2\);\)\), "\n", \(\(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[\ d[a], t[90], d[1], t[90], d[1], t[90], d[1], t[90], d[b]];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ ax, \ rl, \ 4\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell["Any guesses? Wrong!", "Text"], Cell[BoxData[{ \(a\ = \ 1; \ b\ = \ 2.3;\), "\n", \(\(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[\ d[a], t[90], d[1], t[90], d[1], t[90], d[1], t[90], d[b]];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ ax, \ rl, \ 5\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell["Non-scaling, from St. Mandelbrot. ", "Text"], Cell[BoxData[{ \(\(rl\ = \ \ d\ \[RuleDelayed] \ TP[\ d, \ cc, \ d, \ cw, \ d, \ cw, \ d, \ cw, \ d, \ cc, d, cc, d, cw, d, cc, d];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ TP[d], \ rl, 1, {\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], d \[Rule] \ d[1]\ }\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ TP[d], \ rl, \ 4, {\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], d \[Rule] \ d[1]\ }\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell["But:", "Text"], Cell[BoxData[{ \(\(rl\ = \ \ d\ \[RuleDelayed] \ TP[\ d, \ cc, \ d, \ cw, \ d, \ cw, \ d, \ cw, \ d, \ cc, d, cc, d, cc, d, cw, d];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ TP[d], \ rl, \ 4, {\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], d \[Rule] \ d[1]\ }\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(rl\ = \ \ d\ \[RuleDelayed] \ TP[\ d, \ cc, \ d, \ cw, \ d, \ cw, \ d, \ cc, \ d\ ];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ TP[d], \ rl, \ 4, {\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], d \[Rule] \ d[1]\ }\ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False, AspectRatio \[Rule] 1/GoldenRatio\ ];\)\)}], "Input"], Cell["Two generators. Are they really needed?", "Text"], Cell[BoxData[{ \(Clear[x, y]\), "\[IndentingNewLine]", \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[x], \ \[IndentingNewLine]\t{\ x\ :> \ TP[cw/2, y, cc, x, cw/2], \ \[IndentingNewLine]\t y :> TP[cc/2, x, cw, y, cw/2]}, \ \[IndentingNewLine]\t 11, \[IndentingNewLine]\t{\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], x \[Rule] \ d[1], y \[Rule] d[1]\ }\[IndentingNewLine]\ \ ];\)\), "\n", \(\(PlotTP[p];\)\)}], "Input"], Cell["Ouch!", "Text"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[x], \ \[IndentingNewLine]\t{\ x\ :> \ TP[cw/2, y, cc, x, cw/2], \ \[IndentingNewLine]\t y :> TP[cc/2, x, cw, y, cc/2]}, \ \[IndentingNewLine]\t 8, \[IndentingNewLine]\t{\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], x \[Rule] \ d[1], y \[Rule] d[1]\ }\[IndentingNewLine]\ \ ];\)\), "\n", \(\(PlotTP[p];\)\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[x], \ \[IndentingNewLine]\t{\ x\ :> \ TP[cw/2, x, cc, y, cw/2], \ \[IndentingNewLine]\t y :> TP[cc/2, x, cw, y, cc/2]}, \ \[IndentingNewLine]\t 12, \[IndentingNewLine]\t{\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], x \[Rule] \ d[1], y \[Rule] d[1]\ }\[IndentingNewLine]\ \ ];\)\), "\n", \(\(PlotTP[p];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Dragon", "Subsection", CellTags->"c:13"], Cell["\<\ Use 2-stage rewrite system for convenience. First system is purely directional (N,E,S,W instructions). Is there a better way of translating this into a TP than brute force \ substitutions as below? \ \>", "Text"], Cell[BoxData[ \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[0], \ \[IndentingNewLine]\t{\ 0\ \[Rule] \ TP[0, 1], \ 1 \[Rule] TP[2, 1], \ 2 \[Rule] TP[2, 3], \ 3 \[Rule] TP[0, 3]}, \ \[IndentingNewLine]\t 11, \[IndentingNewLine]\t{\ 0 \[Rule] d[1], \ 1 \[Rule] \ TP[t[90], d[1], t[\(-90\)]], \ \[IndentingNewLine]\t 2 \[Rule] \ TP[t[180], d[1], t[\(-180\)]], \ 3 \[Rule] \ TP[t[\(-90\)], d[1], t[90]]\ }\[IndentingNewLine]\ \ ];\)\)], "Input"], Cell[BoxData[ \(p\ // \ Length\)], "Input"], Cell[BoxData[ \(\(PlotTP[p, Frame \[Rule] True, FrameTicks \[Rule] None];\)\)], "Input"], Cell[BoxData[{ \(\(ax\ = MakeNGon[6];\)\), "\[IndentingNewLine]", \(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[t[30], d[1], t[\(-60\)], \ d[1], t[60], d[1], t[\(-30\)]]\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ MakeNGon[3], \ rl, \ 5\ ];\)\), "\n", \(\(PlotTP[\ p, Frame \[Rule] True, \ FrameTicks \[Rule] False];\)\)}], "Input"], Cell[BoxData[{ \(\(phi\ = \ 360/4;\)\), "\[IndentingNewLine]", \(rl\ = \ \ d[1]\ \[RuleDelayed] \ TP[t[phi/2], d[1], t[\(-phi\)], \ d[1], t[phi], d[1], t[\(-phi\)/2]]\)}], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ MakeNGon[5], \ rl, \ 5\ ];\)\), "\n", \(\(PlotTP[\ p, Frame \[Rule] True, \ FrameTicks \[Rule] False];\)\)}], "Input"], Cell[BoxData[ \(rl\ = \ \ d[1]\ \[RuleDelayed] \ TP[d[1], t[90], \ d[1], t[\(-90\)], d[1], t[\(-90\)], d[1], d[1], t[90], d[1], t[90], d[1], t[\(-90\)], d[1]]\)], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ TP[d[1]], \ rl, 4\ ];\)\), "\n", \(\(PlotTP[\ p, Frame \[Rule] True, \ FrameTicks \[Rule] False];\)\)}], "Input"], Cell[BoxData[ \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[0], \ \[IndentingNewLine]\t{\ 0\ \[Rule] \ TP[0, 1], \ 1 \[Rule] TP[1, 2], \ 2 \[Rule] TP[2, 0], \ 3 \[Rule] TP[1, 3]}, \ \[IndentingNewLine]\t 10, \[IndentingNewLine]\t{\ 0 \[Rule] d[1], \ 1 \[Rule] \ TP[t[90], d[1], t[\(-90\)]], \ \[IndentingNewLine]\t 2 \[Rule] \ TP[t[180], d[1], t[\(-180\)]], \ 3 \[Rule] \ TP[t[\(-90\)], d[1], t[90]]\ }\[IndentingNewLine]\ \ ];\)\)], "Input"], Cell[BoxData[ \(p\ // \ Length\)], "Input"], Cell[BoxData[ \(\(PlotTP[p, Frame \[Rule] True, FrameTicks \[Rule] None];\)\)], "Input"], Cell["\<\ Is there anything interesting with replacements by 3 pieces? \ \>", \ "Text"], Cell[BoxData[ \(PP\ = \ Permutations[Range[0, 3]]\)], "Input"], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\(pick\ = \ {9, 11, 23};\)\[IndentingNewLine] \(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\tTP[0], \ \[IndentingNewLine]\t Apply[\ TP, \ Thread[\ Range[0, 3] -> Thread@PP[\([pick]\)]], {2}], \ \[IndentingNewLine]\t 7, \[IndentingNewLine]\t{\ 0 \[Rule] d[1], \ 1 \[Rule] \ TP[t[90], d[1], t[\(-90\)]], \ \[IndentingNewLine]\t 2 \[Rule] \ TP[t[180], d[1], t[\(-180\)]], \ 3 \[Rule] \ TP[t[\(-90\)], d[1], t[90]]\ }\[IndentingNewLine]\ \ ];\)\n \(PlotTP[p, Frame \[Rule] True, FrameTicks \[Rule] None];\)\)\)\)], "Input"], Cell[BoxData[{ \(\(pick\ = \ {10, 11, 23};\)\), "\[IndentingNewLine]", \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\tTP[0], \ \[IndentingNewLine]\t Apply[\ TP, \ Thread[\ Range[0, 3] -> Thread@PP[\([pick]\)]], {2}], \ \[IndentingNewLine]\t 7, \[IndentingNewLine]\t{\ 0 \[Rule] d[1], \ 1 \[Rule] \ TP[t[90], d[1], t[\(-90\)]], \ \[IndentingNewLine]\t 2 \[Rule] \ TP[t[180], d[1], t[\(-180\)]], \ 3 \[Rule] \ TP[t[\(-90\)], d[1], t[90]]\ }\[IndentingNewLine]\ \ ];\)\), "\n", \(\(PlotTP[p, Frame \[Rule] True, FrameTicks \[Rule] None];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["H-Curves", "Subsection", CellTags->"c:14"], Cell["\<\ Use cw (clockwise) and cc (counterclockwise) as abbreviations in \ level 1 r/w-system. \ \>", "Text"], Cell[BoxData[{ \(\(Clear[cw, cc, x, y];\)\), "\n", \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[x], \ \[IndentingNewLine]\t{\ x\ \[Rule] \ TP[cw, y, d, cc, x, d, x, cc, d, y, cw], \ \[IndentingNewLine]\t y \[Rule] TP[cc, x, d, cw, y, d, y, cw, d, x, cc]}, \ \[IndentingNewLine]\t 4, \[IndentingNewLine]\t{\ cw \[Rule] t[90], cc \[Rule] \ t[\(-90\)], d \[Rule] \ d[1]\ }\[IndentingNewLine]\ \ ];\)\)}], "Input"], Cell[BoxData[ \(\(gr\ = \ PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ ];\)\)], "Input"], Cell["Display[\"hilbert4.eps\",gr,\"EPS\"]", "Input"], Cell[BoxData[ \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False, \ \[IndentingNewLine]PreOpts \[Rule] {Thickness[0.005]}, Full \[Rule] True\ , PlotStyle \[Rule] Cyan];\)\)], "Input"], Cell[BoxData[{ \(\(ax\ = \ TP[\ s[], d[1], r[], t[180], \ d[1]\ ];\)\), "\[IndentingNewLine]", \(\(rl\ = \ \ d[z_]\ \[RuleDelayed] \ z\ TP[\ d[1], s[], t[90], d[ .7], r[], s[], t[\(-90\)], d[ .7], r[]];\)\)}], "Input"], Cell[BoxData[ \(\(\(\ \)\(GenerateTP[\ ax, \ rl, 2\ ]\)\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ \ GenerateTP[\ ax, \ rl, \ 7\ ]\ ];\)\)], "Input"], Cell[BoxData[{ \(ax\ = \ TP[\ s[], d[1], r[], t[180], \ d[1]\ ]\), "\[IndentingNewLine]", \(rl\ = \ \ \ \ d[z_]\ \[RuleDelayed] \ TP[\ d[1], s[], t[45], d[ .5], r[], s[], t[\(-45\)], d[ .5], r[]]\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ ax, rl, 7]\ ];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ ax, rl, 7], Full \[Rule] True, PlotStyle \[Rule] {0.02, 0.08}\ ];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Ferns", "Subsection", CellTags->"c:15"], Cell[BoxData[{ \(ax\ = \ TP[\ d[1]\ ]\), "\[IndentingNewLine]", \(rl\ = \ \ d[z_] \[RuleDelayed] \ z\ TP[\ d[1], s[], t[25], d[ .6], r[], s[], t[\(-25\)], d[ .6], r[]]\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ ax, rl, 6]\ ];\)\)], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ ax, rl, 6], PlotRange \[Rule] All\ ];\)\)], "Input"], Cell[BoxData[{ \(ax\ = \ TP[\ d[1]\ ]\), "\[IndentingNewLine]", \(rl\ = \ \ d[z_]\ \[RuleDelayed] \ TP[\ d[1], s[], t[25], d[1], r[], d[ .8], s[], t[\(-25\)], d[1], r[], d[1]]\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ ax, rl, 6]\ ];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Sierpinski", "Subsection", CellTags->"c:16"], Cell[BoxData[{ \(\(ax\ = \ TP[\ d[1], t[120], d[1], t[120], d[1], t[120]\ ];\)\), "\n", \(\(rl\ = \ {\ d[z_]\ \[RuleDelayed] \ z\ \ TP[\ ax, g[2]], \[IndentingNewLine]\t g[z_]\ \[RuleDelayed] \ g[2\ z]\ };\)\), "\n", \(\(PlotTP[\ GenerateTP[\ ax, rl, 6]\ ];\)\)}], "Input"], Cell[BoxData[ \(\(PlotTP[\ GenerateTP[\ ax, rl, 6], \ Full \[Rule] True, \ PlotStyle \[Rule] \ {{White, .01}, {Yellow, .05}}\ ];\)\)], "Input"], Cell[BoxData[{ \(\(rl\ = \ {\ d[z_]\ \[RuleDelayed] \ z\ \ TP[\ ax, g[3]], \[IndentingNewLine]\t g[z_]\ \[RuleDelayed] \ g[2\ z]\ };\)\), "\n", \(\(PlotTP[\ GenerateTP[\ ax, rl, 6]\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(rl\ = \ {\ d[z_]\ \[RuleDelayed] \ z\ \ TP[\ ax, g[1]], \[IndentingNewLine]\t g[z_]\ \[RuleDelayed] \ g[2.5\ z]\ };\)\), "\n", \(\(PlotTP[\ GenerateTP[\ ax, rl, 6]\ ];\)\)}], "Input"], Cell[BoxData[{ \(\(rl\ = \ {\ d[z_]\ \[RuleDelayed] \ z\ \ TP[\ ax, g[3]], \[IndentingNewLine]\t g[z_]\ \[RuleDelayed] \ g[1.5 z]\ };\)\), "\n", \(\(PlotTP[\ GenerateTP[\ ax, rl, 6]\ ];\)\)}], "Input"], Cell[BoxData[{ \(ax\ = \ TP[\ d[1]\ ]\), "\[IndentingNewLine]", \(rl\ = \ {\ \ d[z_]\ \[RuleDelayed] \ z\ \ TP[\ s[], t[60], g[1], t[180], d[1], r[], s[], t[60], g[1], t[\(-60\)], d[1], r[], s[], g[2], t[120], d[1], r[]], \[IndentingNewLine]\t\tg[z_]\ \[RuleDelayed] \ g[2 z]\ }\)}], "Input"], Cell[BoxData[ \(\(\(\ \)\(\(PlotTP[\ GenerateTP[\ ax, rl, 6]];\)\(\[IndentingNewLine]\) \)\)\)], "Input"], Cell[BoxData[ \(\(\(\ \)\(\(PlotTP[\ GenerateTP[\ ax, rl, 6], Full \[Rule] True\ ];\)\(\[IndentingNewLine]\) \)\)\)], "Input"], Cell[BoxData[{ \(ax\ = \ TP[\ d[1]\ ]\), "\[IndentingNewLine]", \(rl2\ = \ {\ \ d[z_]\ \[RuleDelayed] \ z\ \ TP[\ s[], t[60], g[1], t[180], d[1], r[], s[], t[60], g[1], t[\(-60\)], d[1], r[], s[], g[2], t[120], d[1], r[]], \[IndentingNewLine]\t\tg[z_]\ \[RuleDelayed] \ g[1.9 z]\ }\)}], "Input"], Cell[BoxData[ \(\(\(\ \)\(PlotTP[\ GenerateTP[\ ax, rl2, 6], \ Full \[Rule] True, \ PlotStyle \[Rule] \ {{White, .01}, {Cyan, .04}}\ ];\)\)\)], "Input"], Cell[BoxData[ \(\(ax\ = \ TP[\ d[1], t[120], g[1], t[120], g[1], t[120]\ ];\)\)], "Input"], Cell[BoxData[{ \(\(p\ = \ GenerateTP[\ \ \[IndentingNewLine]\t TP[x], \ \[IndentingNewLine]\t{\ x\ \[Rule] \ TP[\ ax, .5\ TP[\ s[], x, \ r[], s[], g[1], x, r[], s[], t[60], g[1], t[\(-60\)], x, r[]]]}, \ \[IndentingNewLine]\t 6\[IndentingNewLine]\ \ ];\)\), "\n", \(\(PlotTP[\ p, \ Frame \[Rule] True, \ FrameTicks \[Rule] False\ , \ Full \[Rule] True];\)\)}], "Input"] }, Closed]] }, Closed]] }, Closed]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowToolbars->{}, WindowSize->{1016, 740}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrintingPageRange->{Automatic, Automatic}, PrintingOptions->{"PaperSize"->{612, 792}, "PaperOrientation"->"Portrait", "PostScriptOutputFile":>FrontEnd`FileName[{$RootDirectory, "home", "sutner", \ "class", "MFCS", "151"}, "Turtle.nb.ps", CharacterEncoding -> "iso8859-1"], "Magnification"->1}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, Magnification->1.5, StyleDefinitions -> "Default.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{ "c:1"->{ Cell[1828, 55, 51, 1, 145, "Title", CellTags->"c:1"]}, "c:2"->{ Cell[1904, 60, 50, 1, 111, "Section", CellTags->"c:2"]}, "c:3"->{ Cell[3184, 93, 81, 1, 39, "Subsubsection", CellTags->"c:3"]}, "c:4"->{ Cell[5661, 150, 90, 1, 39, "Subsubsection", CellTags->"c:4"]}, "c:5"->{ Cell[6431, 171, 67, 1, 39, "Subsubsection", CellTags->"c:5"]}, "c:6"->{ Cell[10858, 270, 48, 1, 111, "Section", CellTags->"c:6"]}, "c:7"->{ Cell[10931, 275, 54, 1, 58, "Subsection", CellTags->"c:7"]}, "c:8"->{ Cell[15968, 444, 47, 1, 58, "Subsection", CellTags->"c:8"]}, "c:9"->{ Cell[17473, 493, 50, 1, 58, "Subsection", CellTags->"c:9"]}, "c:10"->{ Cell[18570, 528, 48, 1, 111, "Section", CellTags->"c:10"]}, "c:11"->{ Cell[18797, 538, 51, 1, 58, "Subsection", CellTags->"c:11"]}, "c:12"->{ Cell[20047, 578, 47, 1, 58, "Subsection", CellTags->"c:12"]}, "c:13"->{ Cell[27141, 772, 48, 1, 44, "Subsection", CellTags->"c:13"]}, "c:14"->{ Cell[31637, 895, 50, 1, 44, "Subsection", CellTags->"c:14"]}, "c:15"->{ Cell[33711, 960, 47, 1, 44, "Subsection", CellTags->"c:15"]}, "c:16"->{ Cell[34496, 988, 52, 1, 44, "Subsection", CellTags->"c:16"]} } *) (*CellTagsIndex CellTagsIndex->{ {"c:1", 38653, 1098}, {"c:2", 38729, 1101}, {"c:3", 38807, 1104}, {"c:4", 38890, 1107}, {"c:5", 38974, 1110}, {"c:6", 39058, 1113}, {"c:7", 39138, 1116}, {"c:8", 39220, 1119}, {"c:9", 39302, 1122}, {"c:10", 39385, 1125}, {"c:11", 39467, 1128}, {"c:12", 39551, 1131}, {"c:13", 39635, 1134}, {"c:14", 39719, 1137}, {"c:15", 39803, 1140}, {"c:16", 39887, 1143} } *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 49, 0, 41, "SmallText"], Cell[CellGroupData[{ Cell[1828, 55, 51, 1, 145, "Title", CellTags->"c:1"], Cell[CellGroupData[{ Cell[1904, 60, 50, 1, 111, "Section", CellTags->"c:2"], Cell[1957, 63, 860, 14, 571, "Text"], Cell[2820, 79, 339, 10, 121, "Text"], Cell[CellGroupData[{ Cell[3184, 93, 81, 1, 39, "Subsubsection", CellTags->"c:3"], Cell[3268, 96, 802, 13, 246, "Input"], Cell[4073, 111, 548, 12, 131, "Input"], Cell[4624, 125, 59, 1, 39, "Input"], Cell[4686, 128, 938, 17, 292, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[5661, 150, 90, 1, 39, "Subsubsection", CellTags->"c:4"], Cell[5754, 153, 355, 6, 108, "Input"], Cell[6112, 161, 282, 5, 154, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6431, 171, 67, 1, 39, "Subsubsection", CellTags->"c:5"], Cell[6501, 174, 92, 3, 71, "Text"], Cell[6596, 179, 45, 0, 38, "Input"], Cell[6644, 181, 515, 9, 200, "Input"], Cell[7162, 192, 619, 12, 223, "Input"], Cell[7784, 206, 63, 1, 39, "Input"], Cell[7850, 209, 1588, 28, 499, "Input"], Cell[9441, 239, 1368, 25, 407, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[10858, 270, 48, 1, 111, "Section", CellTags->"c:6"], Cell[CellGroupData[{ Cell[10931, 275, 54, 1, 58, "Subsection", CellTags->"c:7"], Cell[10988, 278, 374, 11, 146, "Text"], Cell[11365, 291, 548, 10, 223, "Input"], Cell[11916, 303, 167, 3, 62, "Input"], Cell[12086, 308, 75, 1, 39, "Input"], Cell[12164, 311, 75, 1, 39, "Input"], Cell[12242, 314, 111, 2, 39, "Input"], Cell[12356, 318, 171, 3, 62, "Input"], Cell[12530, 323, 104, 2, 39, "Input"], Cell[12637, 327, 104, 2, 39, "Input"], Cell[12744, 331, 105, 2, 39, "Input"], Cell[12852, 335, 98, 2, 62, "Input"], Cell[12953, 339, 97, 2, 62, "Input"], Cell[13053, 343, 126, 2, 62, "Input"], Cell[13182, 347, 106, 2, 62, "Input"], Cell[13291, 351, 97, 2, 62, "Input"], Cell[13391, 355, 98, 2, 62, "Input"], Cell[13492, 359, 162, 4, 62, "Input"], Cell[13657, 365, 125, 2, 62, "Input"], Cell[13785, 369, 125, 2, 62, "Input"], Cell[13913, 373, 112, 2, 62, "Input"], Cell[14028, 377, 139, 2, 62, "Input"], Cell[14170, 381, 111, 2, 62, "Input"], Cell[14284, 385, 112, 2, 62, "Input"], Cell[14399, 389, 111, 2, 62, "Input"], Cell[14513, 393, 112, 2, 62, "Input"], Cell[14628, 397, 112, 2, 62, "Input"], Cell[14743, 401, 111, 2, 62, "Input"], Cell[14857, 405, 112, 2, 62, "Input"], Cell[14972, 409, 112, 2, 62, "Input"], Cell[15087, 413, 112, 2, 62, "Input"], Cell[15202, 417, 117, 2, 62, "Input"], Cell[15322, 421, 117, 2, 62, "Input"], Cell[15442, 425, 118, 2, 62, "Input"], Cell[15563, 429, 119, 2, 62, "Input"], Cell[15685, 433, 120, 2, 62, "Input"], Cell[15808, 437, 123, 2, 62, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15968, 444, 47, 1, 58, "Subsection", CellTags->"c:8"], Cell[16018, 447, 284, 5, 108, "Input"], Cell[16305, 454, 62, 1, 39, "Input"], Cell[16370, 457, 118, 2, 39, "Input"], Cell[16491, 461, 204, 3, 85, "Input"], Cell[16698, 466, 173, 3, 85, "Input"], Cell[16874, 471, 86, 1, 39, "Input"], Cell[16963, 474, 52, 1, 39, "Input"], Cell[17018, 477, 172, 4, 62, "Input"], Cell[17193, 483, 81, 1, 39, "Input"], Cell[17277, 486, 159, 2, 62, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[17473, 493, 50, 1, 58, "Subsection", CellTags->"c:9"], Cell[17526, 496, 696, 14, 223, "Input"], Cell[18225, 512, 74, 1, 39, "Input"], Cell[18302, 515, 74, 1, 39, "Input"], Cell[18379, 518, 77, 1, 39, "Input"], Cell[18459, 521, 62, 1, 39, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[18570, 528, 48, 1, 111, "Section", CellTags->"c:10"], Cell[18621, 531, 151, 3, 71, "Text"], Cell[CellGroupData[{ Cell[18797, 538, 51, 1, 58, "Subsection", CellTags->"c:11"], Cell[18851, 541, 239, 5, 85, "Input"], Cell[19093, 548, 137, 2, 39, "Input"], Cell[19233, 552, 180, 3, 62, "Input"], Cell[19416, 557, 29, 0, 46, "Text"], Cell[19448, 559, 186, 3, 62, "Input"], Cell[19637, 564, 192, 4, 85, "Input"], Cell[19832, 570, 178, 3, 62, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[20047, 578, 47, 1, 58, "Subsection", CellTags->"c:12"], Cell[20097, 581, 168, 4, 75, "Text"], Cell[20268, 587, 57, 1, 40, "Input"], Cell[20328, 590, 588, 12, 184, "Input"], Cell[20919, 604, 72, 1, 40, "Input"], Cell[20994, 607, 110, 2, 40, "Input"], Cell[21107, 611, 148, 2, 40, "Input"], Cell[21258, 615, 56, 0, 48, "Text"], Cell[21317, 617, 765, 15, 280, "Input"], Cell[22085, 634, 42, 1, 40, "Input"], Cell[22130, 637, 111, 2, 40, "Input"], Cell[22244, 641, 31, 0, 48, "Text"], Cell[22278, 643, 364, 7, 112, "Input"], Cell[22645, 652, 55, 0, 48, "Text"], Cell[22703, 654, 312, 6, 88, "Input"], Cell[23018, 662, 93, 3, 48, "Text"], Cell[23114, 667, 365, 7, 112, "Input"], Cell[23482, 676, 37, 0, 48, "Text"], Cell[23522, 678, 364, 7, 112, "Input"], Cell[23889, 687, 50, 0, 48, "Text"], Cell[23942, 689, 433, 9, 88, "Input"], Cell[24378, 700, 276, 6, 64, "Input"], Cell[24657, 708, 20, 0, 48, "Text"], Cell[24680, 710, 435, 9, 88, "Input"], Cell[25118, 721, 429, 8, 88, "Input"], Cell[25550, 731, 55, 0, 48, "Text"], Cell[25608, 733, 519, 10, 232, "Input"], Cell[26130, 745, 21, 0, 48, "Text"], Cell[26154, 747, 473, 9, 208, "Input"], Cell[26630, 758, 474, 9, 208, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27141, 772, 48, 1, 44, "Subsection", CellTags->"c:13"], Cell[27192, 775, 224, 6, 120, "Text"], Cell[27419, 783, 578, 11, 177, "Input"], Cell[28000, 796, 48, 1, 39, "Input"], Cell[28051, 799, 92, 1, 39, "Input"], Cell[28146, 802, 213, 4, 61, "Input"], Cell[28362, 808, 176, 3, 61, "Input"], Cell[28541, 813, 212, 4, 61, "Input"], Cell[28756, 819, 176, 3, 61, "Input"], Cell[28935, 824, 197, 3, 61, "Input"], Cell[29135, 829, 171, 3, 61, "Input"], Cell[29309, 834, 578, 11, 177, "Input"], Cell[29890, 847, 48, 1, 39, "Input"], Cell[29941, 850, 92, 1, 39, "Input"], Cell[30036, 853, 87, 3, 45, "Text"], Cell[30126, 858, 67, 1, 39, "Input"], Cell[30196, 861, 706, 14, 246, "Input"], Cell[30905, 877, 695, 13, 222, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[31637, 895, 50, 1, 44, "Subsection", CellTags->"c:14"], Cell[31690, 898, 113, 3, 46, "Text"], Cell[31806, 903, 554, 12, 200, "Input"], Cell[32363, 917, 130, 3, 39, "Input"], Cell[32496, 922, 53, 0, 38, "Input"], Cell[32552, 924, 230, 4, 62, "Input"], Cell[32785, 930, 265, 5, 62, "Input"], Cell[33053, 937, 74, 1, 39, "Input"], Cell[33130, 940, 81, 1, 39, "Input"], Cell[33214, 943, 248, 5, 62, "Input"], Cell[33465, 950, 73, 1, 39, "Input"], Cell[33541, 953, 133, 2, 39, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[33711, 960, 47, 1, 44, "Subsection", CellTags->"c:15"], Cell[33761, 963, 214, 4, 64, "Input"], Cell[33978, 969, 73, 1, 40, "Input"], Cell[34054, 972, 105, 2, 40, "Input"], Cell[34162, 976, 221, 4, 64, "Input"], Cell[34386, 982, 73, 1, 40, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[34496, 988, 52, 1, 44, "Subsection", CellTags->"c:16"], Cell[34551, 991, 321, 6, 112, "Input"], Cell[34875, 999, 158, 2, 40, "Input"], Cell[35036, 1003, 233, 4, 88, "Input"], Cell[35272, 1009, 235, 4, 88, "Input"], Cell[35510, 1015, 235, 4, 88, "Input"], Cell[35748, 1021, 358, 6, 88, "Input"], Cell[36109, 1029, 113, 2, 64, "Input"], Cell[36225, 1033, 143, 3, 64, "Input"], Cell[36371, 1038, 361, 6, 88, "Input"], Cell[36735, 1046, 167, 2, 40, "Input"], Cell[36905, 1050, 104, 2, 40, "Input"], Cell[37012, 1054, 489, 10, 160, "Input"] }, Closed]] }, Closed]] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)