home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fractal112 / !Fractal / Help / Sierpinski < prev    next >
Text File  |  1996-10-13  |  3KB  |  64 lines

  1.                                    Sierpinski
  2.                                    ~~~~~~~~~~
  3.  
  4.  
  5. What is Sierpinski?
  6. ---- -- -----------
  7. This function plots an infamous fractal function, the Sierpinski Triange, which
  8. is a collection of triangles within triangles within triangles... etc. etc.
  9. Although this sounds quite boring (like Bifurcation diagrams) this fractal has
  10. become a symbol of the evolving science of fractal geometry. No decent fractal
  11. plotter should be without one.
  12. Wot? There is one - in fact several - they can be plotted with IFSs, L-systems,
  13. and the list goes on and on. Sierpinski plots the triangle deterministically,
  14. i.e. performs an escape time algorithm:
  15. If M is a positive integer,
  16.     Sp,q = { a+p((c-a)/Mx), b+q((d-b)/My) } for p,q={0,0}{...,..},{Mx,My}.
  17. Which is easy to understand and contains no complex numbers (Don't ask).
  18.  
  19. Algorithm
  20. ---------
  21. while ((iter < maxiter) && (x*x+y*y < R))
  22. {
  23.     if (y > 0.5) then x = 2 * x : y = 2 * y - 1;
  24.     else if (x > 0.5) then x = 2 * x - 1 : y = 2 * y;
  25.     else x = 2 * x : y = 2 * y;
  26.     iter ++;
  27. }
  28.  
  29. Variables
  30. ---------
  31. As can be seen from the algorithm, R is the escape value - set it to 200 (the
  32. default) for a 3Dish effect, and 5 for a nice curvy look. MaxIter is the maximum
  33. number of iterations carried out, and may need to be increased as you zoom in.
  34. The picture will be plotted using floating point if the 'full precision maths'
  35. option is selected, otherwise integer maths (faster unless you are rich and
  36. have a co-processor) until it becomes inaccurate, at which stage the system will
  37. switch to double precision floating point maths anyway.
  38. Integer is about 150% of the speed of floating point on a co-processorless Arc.
  39. If you want to use this function from a script, it behaves in the standard
  40. !Fractal way. No specific commands are provided.
  41.  
  42. Copyright
  43. ---------
  44. The copyright of
  45.     RayCast, Stereogram, Sierpinski
  46. belongs to Neil A Carson. No part of the code may be used in any other program
  47. whatsoever without the author's permission.
  48. However, Mike Curnow's word is my word, so if he says you can do something with
  49. it, then it's fine by me.
  50. Source code is obtainable together with the source for the rest of Fractal
  51. (since it is not much use on its own) from Mike (with his permission) at the
  52. address below.
  53.  
  54. Author
  55. ------
  56. I can be contacted at:
  57.     1 Penn Close,
  58.      Abingdon,
  59.       Oxon OX14 2NX
  60.  
  61. Or on packet email, I am: neil@g7kqy.ampr.org [44.141.6.229]
  62.              (on ax25, Ben g7kqy@gb7avm may forward the odd message if you ask
  63.               him nicely).
  64.