(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' 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[ 10698, 433]*) (*NotebookOutlinePosition[ 11580, 463]*) (* CellTagsIndexPosition[ 11536, 459]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["IteratedMappings", "Title", ImageRegion->{{-0, 1}, {0, 1}}], Cell["By Theodore W. Gray, Doug Stein, and Jerry Glynn.", "Subsubtitle", ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ This Notebook implements a number of functions for making iterated \ affine map pictures. It is based on suggestions by Doug Stein, written by \ Theodore W. Gray, and critiqued by Jerry Glynn.\ \>", "Text", ImageRegion->{{-0, 1}, {0, 1}}], Cell[CellGroupData[{ Cell["Implementation", "Section", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell[CellGroupData[{ Cell["Preparation", "Subsection", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ Create the context representing the contents of this \ Notebook:\ \>", "Text", PageBreakAbove->False, InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ BeginPackage[\"IteratedMappings`\"]; EndPackage[];\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Load any needed packages:", "Text", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Needs[\"Graphics`Colors`\"];", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Declare all the globally visible symbols:", "Text", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ IteratedMapping; AffineMap;\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Begin private context:", "Text", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Begin[\"IteratedMappings`Private`\"];", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Declare all the private symbols:", "Text", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ `MapGraphics; `transformList; `transformCircle; `MG0;\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}] }, Closed]], Cell[CellGroupData[{ Cell["Definitions", "Subsection", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell[CellGroupData[{ Cell["MapGraphics", "Subsubsection", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["`parametricPlotOptions;", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["transformList[f_, list_] := Map[f, list];", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ transformCircle[f_, center_, {rx_, ry_}, \t\t\t\t{mint_, maxt_}] := Module[ \t{t}, \tParametricPlot[ \t\tf[{rx Cos[t], ry Sin[t]} + center], \t\t{t, N[mint], N[maxt]}, \t\tRelease[parametricPlotOptions] \t][[1,1,1,1]] ]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MapGraphics[Graphics[list_List, opts___], \t\t\tf_, options___] := \t( \tparametricPlotOptions = \t\tJoin[{DisplayFunction -> Identity}, options]; \tGraphics[ MG0[list, f], opts ] \t)\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["MG0[d_List, f_] := Map[ MG0[#, f]& , d ]", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["MG0[Point[d_List], f_] := Point[f[d]]", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["MG0[Line[d_List], f_] := Line[transformList[f, d]]", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Rectangle[{xmin_, ymin_}, {xmax_, ymax_}], f_] := \tMG0[Polygon[{ \t\t{xmin,ymin}, \t\t{xmin,ymax}, \t\t{xmax, ymax}, \t\t{xmax, ymin}}], f]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Polygon[d_List]] := \tMG0[Polygon[Join[d, First[d]]]] /; \t\tFirst[d] =!= Last[d]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Polygon[d_List], f_] := \tPolygon[transformList[f, d]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Circle[center_List, r_?NumberQ], f_] := \tLine[transformCircle[f, center, {r, r}, {0, 2Pi}]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Circle[center_List, r_?List], f_] := \tLine[transformCircle[f, center, r, {0, 2Pi}]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Circle[center_List, r_?NumberQ, range_List], f_] := \tLine[transformCircle[f, center, {r, r}, range]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Circle[center_List, r_?List, range_List], f_] := \tLine[transformCircle[f, center, r, range]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Disk[center_List, r_?NumberQ], f_] := \tPolygon[ \t\ttransformCircle[f, center, {r, r}, {0, 2Pi}]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Disk[center_List, r_?List], f_] := \tPolygon[transformCircle[f, center, r, {0, 2Pi}]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Disk[center_List, r_?NumberQ, range_List], f_] := \tPolygon[transformCircle[f, center, {r, r}, range]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Disk[center_List, r_?List, range_List], f_] := \tPolygon[transformCircle[f, center, r, range]]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Raster[array_, range_List:{{0,0}, {1,1}}, \t\t\t\t\t\t\t\tzrange___], f_] := \tRaster[array, f /@ range, zrange]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ MG0[Text[expr_, d_List, opts___], f_] := \tText[expr, f[d], opts]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["MG0[expr_, f_] := expr", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}] }, Closed]], Cell[CellGroupData[{ Cell["IteratedMapping", "Subsubsection", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["Clear[IteratedMapping];", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ Options[IteratedMapping] = \t{ \t\tAxes -> Automatic, \t\tAspectRatio -> Automatic, \t\tEpilog -> {} \t};\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["\<\ IteratedMapping[matrices_, iterations_, \t\t\t\tdomain_, options___] := Module[ \t{output, mapOptions, showOptions, grToGr}, \t \tmapOptions = Select[ \t\tJoin[{options}, Options[IteratedMapping]], \t\t( \t\t\t !FreeQ[#, PlotPoints] \t\t\t|| !FreeQ[#, PlotDivision] \t\t\t|| !FreeQ[#, MaxBend] \t\t)& \t]; \t \tshowOptions = Select[ \t\tJoin[{options}, Options[IteratedMapping]], \t\t( \t\t\t FreeQ[#, PlotPoints] \t\t\t&& FreeQ[#, PlotDivision] \t\t\t&& FreeQ[#, MaxBend] \t\t\t&& FreeQ[#, Epilog] \t\t)& \t]; \t \tgrToGr[gr_] := Graphics[Map[First, Map[ \t\tFunction[mm, MapGraphics[ \t\t\t\tgr, \t\t\t\tFunction[p, mm[[1]] . p + mm[[2]]], \t\t\t\tmapOptions \t\t\t]], \t\t\tFlatten[{matrices}] \t\t]]]; \t \toutput = Map[ \t\t\tFirst, \t\t\t{ \t\t\t\tNest[ \t\t\t\t\tgrToGr, \t\t\t\t\tGraphics[{domain}], \t\t\t\t\titerations \t\t\t\t] \t\t\t} \t\t]; \tepilog = Epilog /. {options} /. \t\t\tOptions[IteratedMapping]; \t \tShow[ \t\tGraphics[{output, epilog}], \t\tshowOptions \t] ]\ \>", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Finish", "Subsection", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["End private context:", "Text", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}], Cell["End[];", "Input", InitializationCell->True, AspectRatioFixed->False, ImageRegion->{{-0, 1}, {0, 1}}] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"5.2 for Macintosh", ScreenRectangle->{{0, 992}, {0, 746}}, AutoGeneratedPackage->Automatic, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{520, 624}, WindowMargins->{{44, Automatic}, {-4, Automatic}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 67, 1, 77, "Title"], Cell[1846, 56, 106, 1, 35, "Subsubtitle"], Cell[1955, 59, 251, 5, 38, "Text"], Cell[CellGroupData[{ Cell[2231, 68, 122, 3, 50, "Section", InitializationCell->True], Cell[CellGroupData[{ Cell[2378, 75, 122, 3, 70, "Subsection", InitializationCell->True], Cell[2503, 80, 202, 7, 70, "Text", PageBreakAbove->False, InitializationCell->True], Cell[2708, 89, 164, 6, 70, "Input", InitializationCell->True], Cell[2875, 97, 130, 3, 70, "Text", InitializationCell->True], Cell[3008, 102, 134, 3, 70, "Input", InitializationCell->True], Cell[3145, 107, 146, 3, 70, "Text", InitializationCell->True], Cell[3294, 112, 141, 6, 70, "Input", InitializationCell->True], Cell[3438, 120, 127, 3, 70, "Text", InitializationCell->True], Cell[3568, 125, 143, 3, 70, "Input", InitializationCell->True], Cell[3714, 130, 137, 3, 70, "Text", InitializationCell->True], Cell[3854, 135, 167, 8, 70, "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[4058, 148, 122, 3, 70, "Subsection", InitializationCell->True], Cell[CellGroupData[{ Cell[4205, 155, 125, 3, 70, "Subsubsection", InitializationCell->True], Cell[4333, 160, 129, 3, 70, "Input", InitializationCell->True], Cell[4465, 165, 147, 3, 70, "Input", InitializationCell->True], Cell[4615, 170, 334, 13, 70, "Input", InitializationCell->True], Cell[4952, 185, 299, 11, 70, "Input", InitializationCell->True], Cell[5254, 198, 146, 3, 70, "Input", InitializationCell->True], Cell[5403, 203, 143, 3, 70, "Input", InitializationCell->True], Cell[5549, 208, 156, 3, 70, "Input", InitializationCell->True], Cell[5708, 213, 261, 10, 70, "Input", InitializationCell->True], Cell[5972, 225, 200, 7, 70, "Input", InitializationCell->True], Cell[6175, 234, 173, 6, 70, "Input", InitializationCell->True], Cell[6351, 242, 210, 6, 70, "Input", InitializationCell->True], Cell[6564, 250, 202, 6, 70, "Input", InitializationCell->True], Cell[6769, 258, 219, 6, 70, "Input", InitializationCell->True], Cell[6991, 266, 211, 6, 70, "Input", InitializationCell->True], Cell[7205, 274, 216, 7, 70, "Input", InitializationCell->True], Cell[7424, 283, 203, 6, 70, "Input", InitializationCell->True], Cell[7630, 291, 220, 6, 70, "Input", InitializationCell->True], Cell[7853, 299, 212, 6, 70, "Input", InitializationCell->True], Cell[8068, 307, 232, 7, 70, "Input", InitializationCell->True], Cell[8303, 316, 180, 6, 70, "Input", InitializationCell->True], Cell[8486, 324, 128, 3, 70, "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[8651, 332, 129, 3, 70, "Subsubsection", InitializationCell->True], Cell[8783, 337, 129, 3, 70, "Input", InitializationCell->True], Cell[8915, 342, 220, 10, 70, "Input", InitializationCell->True], Cell[9138, 354, 1111, 55, 70, "Input", InitializationCell->True] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[10298, 415, 117, 3, 70, "Subsection", InitializationCell->True], Cell[10418, 420, 125, 3, 70, "Text", InitializationCell->True], Cell[10546, 425, 112, 3, 70, "Input", InitializationCell->True] }, Closed]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)