Skip to content

Instantly share code, notes, and snippets.

@ilg
Created September 10, 2010 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilg/573112 to your computer and use it in GitHub Desktop.
Save ilg/573112 to your computer and use it in GitHub Desktop.
Module[{cosineEscapeTime =
Compile[{{c, _Complex}},
Block[{z = c, n = 2, escapeRadius = 10 \[Pi],
maxIterations = 100},
While[And[Abs[z] <= escapeRadius, n < maxIterations],
z = Cos[z] + c; n++]; n]]},
DensityPlot[
cosineEscapeTime[x + I y], {x, -\[Pi], \[Pi]}, {y, -3, 3},
PlotPoints -> 250, AspectRatio -> 3/\[Pi],
ImageSize -> 300 (11 + 3.429/12)/6,
FrameTicks -> {{-\[Pi], 0, \[Pi]}, {-3, 0, 3}, None, None},
FrameTicksStyle ->
Directive[FontFamily -> "Myriad Pro", FontSize -> 32],
FrameStyle -> Directive[Thick],
ColorFunction -> (GrayLevel[1 - #] &)]]
Module[{cosineEscapeTime =
Compile[{{c, _Complex}},
Block[{z = c, n = 2, escapeRadius = 10 \[Pi],
maxIterations = 100},
While[And[Abs[z] <= escapeRadius, n < maxIterations],
z = Cos[z] + c; n++]; n]]},
DensityPlot[
cosineEscapeTime[x + I y], {x, .6, .61}, {y, .97, .98 + 0.0026},
PlotPoints -> 250, AspectRatio -> (20 + 10/12)/(18 + 5.143/12),
ImageSize -> 300 (18 + 5.143/12)/6,
FrameTicks -> {{0, .6, .61}, {0, .97, .98}, None, None},
FrameTicksStyle ->
Directive[FontFamily -> "Myriad Pro", FontSize -> 32],
FrameStyle -> Directive[Thick],
ColorFunction -> (GrayLevel[1 - #] &)]]
@ilg
Copy link
Author

ilg commented Sep 10, 2010

Mathematica code used to produce the graphics in a brief piece in the October 2010 issue of Points & Angles (the newsletter of the Metropolitan Mathematics Club of Chicago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment