{"id":5078,"date":"2013-08-23T17:51:12","date_gmt":"2013-08-23T16:51:12","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=5078"},"modified":"2013-08-23T17:51:12","modified_gmt":"2013-08-23T16:51:12","slug":"fractals-from-iterating-sines","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=5078","title":{"rendered":"Fractals from iterating sines"},"content":{"rendered":"<p>In a <a href=\"http:\/\/www.johndcook.com\/blog\/2013\/08\/22\/iterating-sines\/\">recent blog-post<\/a>, John Cook, considered when series such as the following converged for a given complex number z<\/p>\n<p>z<sub>1<\/sub> = sin(z)<br \/>\nz<sub>2<\/sub> = sin(sin(z))<br \/>\nz<sub>3<\/sub> = sin(sin(sin(z)))<\/p>\n<p>John&#8217;s article discussed a theorem that answered the question for a few special cases and this got me thinking: What would the complete set of solutions look like? Since I was halfway through my commute to work and had nothing better to do, I thought I&#8217;d find out.<\/p>\n<p>The following Mathematica code considers points in the square portion of the complex plane where both real and imaginary parts range from -8 to 8. If the sequence converges for a particular point, I colour it black.<\/p>\n<pre>LaunchKernels[4]; (*Set up for 4 core parallel compute*)\r\nParallelEvaluate[SetSystemOptions[\"CatchMachineUnderflow\" -&gt; False]];\r\nconvTest[z_, tol_, max_] := Module[{list},\r\n  list = Quiet[\r\n    NestWhileList[Sin[#] &amp;, z, (Abs[#1 - #2] &gt; tol &amp;), 2, max]];\r\n  If[\r\n   Length[list] &lt; max &amp;&amp; NumericQ[list[[-1]]]\r\n   , 1, 0]\r\n  ]\r\nstep = 0.005;\r\nextent = 8;\r\nAbsoluteTiming[\r\n data = ParallelMap[convTest[#, 10*10^-4, 1000] &amp;,\r\n    Table[x + I y, {y, -extent, extent, step}, {x, -extent, extent,\r\n      step}]\r\n    , {2}];]\r\nArrayPlot[data]<\/pre>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" alt=\"Sine Fractal\" src=\"https:\/\/www.walkingrandomly.com\/images\/mathematica9\/sinfractal.png\" \/><\/p>\n<p>I quickly emailed John to tell him of my discovery but on actually getting to work I discovered that the above fractal is actually very well known. There&#8217;s even a <a href=\"http:\/\/mathworld.wolfram.com\/FixedPoint.html\">colour version<\/a> on Wolfram&#8217;s MathWorld site.\u00a0 Still, it was a fun discovery while it lasted<\/p>\n<p><strong>Other WalkingRandomly posts like this one:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.walkingrandomly.com\/?p=294\">Complex PowerTowers<\/a><\/li>\n<li><a href=\"https:\/\/www.walkingrandomly.com\/?p=626\">Quadraflakes, Pentaflakes, Hexaflakes and more<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In a recent blog-post, John Cook, considered when series such as the following converged for a given complex number z z1 = sin(z) z2 = sin(sin(z)) z3 = sin(sin(sin(z))) John&#8217;s article discussed a theorem that answered the question for a few special cases and this got me thinking: What would the complete set of solutions [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[46,6,8],"tags":[],"class_list":["post-5078","post","type-post","status-publish","format-standard","hentry","category-fractals","category-general-math","category-mathematica"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-1jU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5078"}],"version-history":[{"count":7,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5078\/revisions"}],"predecessor-version":[{"id":5087,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5078\/revisions\/5087"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}