home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 November / Chip_2001-11_cd1.bin / sharewar / chaospro / cpro302.exe / FRACTINT.CFM < prev    next >
Encoding:
Text File  |  2001-07-21  |  1.2 KB  |  52 lines

  1. barnsleyj2 {
  2. parameter complex start;
  3. parameter int test;
  4. parameter real bailout;
  5.  
  6.     void init(void)
  7.     {
  8.         z = pixel;
  9.     }
  10.     void loop(void)
  11.     {
  12.         if  (real(z) * imag(start) + real(start) * imag(z) >= 0)
  13.         {
  14.             z = (z - 1) * start;
  15.         }
  16.         else
  17.         {
  18.  
  19.             z = (z + 1) * start;
  20.         }
  21.     }
  22.     bool bailout(void)
  23.     {
  24.         return((test == 0 && |z| <= bailout) ||                                         (test == 1 && sqr(real(z)) <= bailout) ||                                (test == 2 && sqr(imag(z)) <= bailout) ||                                (test == 3 && (sqr(real(z)) <= bailout && sqr(imag(z)) < bailout)) ||   (test == 4 && (sqr(real(z)) <= bailout || sqr(imag(z)) < bailout)) ||   (test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= bailout)) ||          (test == 6 && (sqr(real(z) + imag(z)) <= bailout)));
  25.     }
  26.     void description(void)
  27.     {
  28.         this.title = "Barnsley 2 (Julia)";
  29.         this.maxiter = 149;
  30.    
  31.         start.caption = "Parameter";
  32.         start.default = (0.6, 1.1);
  33.   
  34.    
  35.         test.caption = "Bailout Test";
  36.         test.default = 0;
  37.         test.enum = "mod\nreal\nimag\nor\nand\nmanh\nmanr";
  38.   
  39.     
  40.         bailout.caption = "Bailout value";
  41.         bailout.default = 4.0;
  42.         bailout.min = 1.0;
  43.   
  44.  
  45.   
  46.   
  47.   
  48.     }
  49. }
  50.  
  51.  
  52.