home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / fractals / 511 < prev    next >
Encoding:
Text File  |  1992-12-24  |  5.8 KB  |  111 lines

  1. Newsgroups: sci.fractals
  2. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!eff!world!mrob
  3. From: mrob@world.std.com (Robert P Munafo)
  4. Subject: Re: Fractal Witchcraft speed?
  5. Message-ID: <Bzr5v0.G53@world.std.com>
  6. Summary: I was successful in duplicating its speed; here's how:
  7. Keywords: Mandelbrot algorithm witchcraft iteration
  8. Organization: The World Public Access UNIX, Brookline, MA
  9. References: <1992Dec16.135708.13453@cs.tu-berlin.de> <twegner.724531754@mwunix>
  10. Date: Thu, 24 Dec 1992 07:23:23 GMT
  11. Lines: 98
  12.  
  13.  
  14. This is a response to Tim Wegner's description of his efforts to
  15. duplicate the Fractal Witchcraft "Synchronous Orbit Iteration"
  16. algorithm (which I will call SOI for brevity).
  17.  
  18. It's long, so here's the summary: well-implemented SOI uses
  19. curve-fitting and curve-based interpolation.  mu-molecules (a.k.a.
  20. islands or midgets) cause the distortion; skip to the bottom if you
  21. want to know why.
  22.  
  23. For those of you that don't get _Amygdala_ (and why don't you?? :-)
  24. here are some details from Steven Stoft's article that I feel I
  25. should mention. Stoft (who is one of _Witchcraft_'s creators)
  26. describes "the four corners of a square that more than covers the
  27. entire [desired] image" and instructs the reader to iterate the
  28. corners until "they begin to deviate slightly from a perfect square".
  29. Stoft suggests that an error amounting to 1/10 of the distance
  30. between adjecent pixels is a reasonable limit, beyond which one
  31. should break the square up into "16 smaller squares".  The
  32. coordinates of Steven's sample image are center_real =
  33. -0.1049775673880424, center_imag = 0.9270413637809322, size =
  34. 0.000000000012 = 1.2e-11, max_iterations = 10000.
  35.  
  36. I read this back in mid-September and immediately set out
  37. implementing the algorithm.  As per Stoft's description I measured
  38. the edge lengths of the iterated corners and went until the ratio of
  39. longest-edge to shortest-edge got bigger than (1 + (1/16 *
  40. 1/pixel_width)) where pixel_width is the width in pixels of my image.
  41. (I decided to cut off at 1/16 pixel rather than 1/10.)  This turns
  42. out to be just a first approximation and I shall call it the "Rhombus
  43. Method" because you are essentially tracking a rectangular array of
  44. iterated points and watching to see when it stops being a rhombus.
  45.  
  46. As you found, Tim, this method is woefully inadaquate.  The rhombus
  47. is a very poor model of the iterated point set.  Iterating the sample
  48. image, I got 270 iterations before having to split the first time, a
  49. total of 343 iterations before the second split, and 613 before the
  50. third.  (This is just a 160x160 pixel image; expect much fewer
  51. iterations for 640x480).  By comparison, the average number of
  52. iterations for the pixels in the final image is 5453.8.
  53.  
  54. The next method I tried is the "Quadrilateral Method".  I removed
  55. assumptions about edge lengths but required that interior points be
  56. closely approximated by linear interpolation.  To get an arbitrary
  57. point in the interior you must first interpolate along two edges to
  58. generate two intermediate points, then interpolate between these two
  59. points to get your desired point.  To use the Quadrilateral Method
  60. you must now iterate about 8 points: the four corners ("key points"),
  61. plus about four "test points": on each iteration you try to guess the
  62. values of the test points by interpolation and see how close your
  63. guess is to the actual iterates of the test points.
  64.  
  65. The Quadrilateral Method is quite an improvement, it turns out.  This
  66. time I got 541 iterations before the first split, then 1082, then
  67. 2160, 4320, 5130, 5385.  I split into 4 pieces each time, so the
  68. last step had 1024 pieces.
  69.  
  70. The next method involves the use of a curve-fitting function
  71. (quadratic, cubic, spline, take your pick) to model the four edges of
  72. the iterated point set.  The type of curve you pick must lend itself
  73. well to interpolating an arbitrary point inside the deformed set. 
  74. You must now iterate at least eight "key points" because each edge
  75. needs at least three key points to serve as the parameters for curve
  76. fitting, and you should iterate an equal number of "test points".
  77.  
  78. I did not implement a Curve Method because at this point in my work I
  79. discovered an extremely beautiful feature (nested imbedded Julia
  80. Sets) and have been creating QuickTime movies of them ever since. (An
  81. example of one of these, which I'd like to call the "Munafo Midget",
  82. is center_real = -1.769110375463767385, center_imag =
  83. +0.009020388228023440, size = 2.0e-17, max_iterations = 10000.  Zoom
  84. out to size = 1.0e-12 to see one imbedded Julia Set, and zoom out to
  85. size = 5.2e-10 to see the other. You really need to use the Distance
  86. Estimator method to do justice to these images.)
  87.  
  88. -> The math behind SOI (very informal: don't complain, sci.math folks!)
  89.  
  90. SOI is a lot of work for the computer.  The formulas used to implement
  91. SOI are essentially equivalent to the deriviative (or differential?)
  92. of the Mandelbrot iteration function.  For curve-fitting methods you
  93. are effectively iterating the second deriviative as well.  The set of
  94. points you are tracking bounces around the complex plane; on each
  95. iteration it is rotated and the edge furthest from the origin is
  96. stretched a little; at the same time a slight nonlinear curvature is
  97. introduced.  After P_min iterations (P_min being the period of the
  98. smallest-period mu-atom contained in the original rectangle) your
  99. iterated set will straddle the origin; when this happens you know
  100. that the next iteration will introduce a singularity.  (For example,
  101. the iterations-before-splitting in the Quadrilateral Method test
  102. above, 541, is the period of a mu-molecule located near, but not in,
  103. the image.
  104.  
  105. Because of this effect of mu-atoms on the iterate set distortion, SOI
  106. does not perform as well on images that contain low-period mu-atoms.
  107. This is the main reason why SOI works so poorly on low-magnification
  108. images.
  109.  
  110. Robert P. Munafo, mrob@world.std.com   (lost my signature file!)
  111.