home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI01.ARJ / ictari.01 / ASSEMBLY / MANDEL / MANDINF.DOC < prev   
Text File  |  1992-03-04  |  3KB  |  64 lines

  1. The following is some info.  about the Mandelbrot set,  for those of  you
  2. who  know very little or  nothing  about   it.  I'm  not  a mathematician
  3. (thank god) so easy on the flames.   This is  info. that I gleaned myself
  4. while writing the program.
  5.  
  6.     =================================================================
  7.  
  8.      The formula used to calculate the set is simply:
  9.  
  10.      Z=Z^2+C        Where Z and C are complex numbers
  11.  
  12. Imagine a square,  on  the  complex  plane,  stretching  from (-2,-2i) to
  13. (2,2i).  The Mandelbrot set resides  in  this  square. Suppose we pick an
  14. arbitrary point in that set,  say (1,0.5i).  We  set  Z  to 0 and C to be
  15. equal to the coords of the point i.e.
  16.  
  17.      Z=0+0i              C=1+0.5i
  18.  
  19. We now perform the previously mentioned formula, i.e.
  20.  
  21.      Z=Z^2+C
  22.      Z=(0+0i)^2+1+0.5i
  23.      Z=1+0.5i
  24.  
  25. We  can continuously iterate this formula,   until  the value of  Z (i.e.
  26. it's modulus) zooms off towards infinity. i.e.
  27.  
  28.      Z=Z^2+C
  29.      Z=(1+0.5i)^2+1+0.5i
  30.      Z=1+0.25i^2+1i+1+0.5i
  31.      Z=1-0.25+i+1+0.5i
  32.      Z=1.75+1.5i
  33.  
  34. Mandelbrot observed that if the  modulus  of  Z  is  ever greater than or
  35. equal to 4,  then the  formula  will  move  towards infinity. i.e. in the
  36. above example
  37.  
  38.      Z=1.75+1.5i
  39.  
  40.      |Z|=1.75^2+1.5^2
  41.         =3.0625+2.25
  42.         =5.3125
  43.  
  44. Therefore,  after  2 iterations of  the  simple  formula we can  see that
  45. this particular example will zoom towards infinity.
  46.  
  47. What  we do to create the "pretty"  picture  of  the set is  to count how
  48. many iterations of the formula can be  performed to make the modulus of Z
  49. greater than or equal to 4.  This value is  then mapped  to  a colour and
  50. then displayed on screen,  to  create  a surprisingly interesting picture
  51. (you can now see why the  action  only   happens  in the square of side 4
  52. centred around  the  origin  [actually  the  circle  of  radius 2 centred
  53. around the  origin].)   Of  course   with   certain   values  of  C,  the
  54. formula  requires  many iterations before  it  reaches the above infinity
  55. criteria.  So, we have   a   limiting   number  of iterations to  prevent
  56. the  program calculating  for too long.   Initially the program is set to
  57. stop iterating  for a particular  point  at  100 iterations.  This  value
  58. can  be altered though.  If the  number  of  iterations at  a  point does
  59. actually  reach this limiting factor  then   it   is  coloured black,  to
  60. make it stand out from the other  points.  The  other pixels  are  simply
  61. coloured mod 14.  i.e.   a  pixel  that   took   7  iterations  will have
  62. colour 7,  a pixel that took 39  iterations will have colour 11 etc.
  63.  
  64.