home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / DGRAF / FRAIN196.ZIP / FRACT196.FRM < prev    next >
Text File  |  1997-05-03  |  26KB  |  841 lines

  1. comment {
  2.  
  3.   This formula file, released with Fractint 19.6, contains the new versions
  4.   of all the Fractint.frm formulas that use conditional statements, followed
  5.   by the original version commented out.
  6.  
  7. }
  8.  
  9. {--- BRADLEY BEACHAM -----------------------------------------------------}
  10.  
  11. OK-32 { ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  12.    z = y = x = pixel , k = 1 + p1 , test = 5 + p2 :
  13.    a = fn1(z)
  14.    IF (a <= y)
  15.       b = y
  16.    ELSE
  17.       b = x
  18.    ENDIF
  19.    x = y , y = z , z = a*k + b
  20.    |z| <= test
  21.    }
  22.  
  23. ; Original version
  24. ; OK-32 {
  25. ;  z = y = x = pixel, k = 1 + p1:
  26. ;   a = fn1(z)
  27. ;   b = (a <= y) * ((a * k) + y)
  28. ;   e = (a > y) * ((a * k) + x)
  29. ;   x = y
  30. ;   y = z
  31. ;   z = b + e
  32. ;    |z| <= (5 + p2)
  33. ;  }
  34.  
  35. OK-34 { ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  36.    z = pixel , c = fn1(pixel) * p1 , test = 10 + p2 :
  37.    x = abs(real(z)) , y = abs(imag(z))
  38.    IF (x <= y)
  39.       z = fn2(z) + y + c
  40.    ELSE
  41.       z = fn2(z) + x + c
  42.    ENDIF
  43.    |z| <= test
  44.    }
  45.  
  46. ; Original version
  47. ; OK-34 {
  48. ;  z = pixel, c = (fn1(pixel) * p1):
  49. ;   x = abs(real(z))
  50. ;   y = abs(imag(z))
  51. ;   a = (x <= y) * (fn2(z) + y + c)
  52. ;   b = (x > y) * (fn2(z) + x + c)
  53. ;   z = a + b
  54. ;    |z| <= (10 + p2)
  55. ;  }
  56.  
  57. OK-35 { ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  58.    z = pixel, k = 1 + p1 , test = 10 + p2 :
  59.    v = fn1(z) , x = z*v , y = z/v
  60.    IF (|x| <= |y|)
  61.       z = fn2((z + y) * k * v) + v
  62.    ELSE
  63.       z = fn2((z + x) * k * v) + v
  64.    ENDIF
  65.    |z| <= test
  66.    }
  67.  
  68. ; Original version
  69. ; OK-35 {
  70. ;  z = pixel, k = 1 + p1:
  71. ;   v = fn1(z)
  72. ;   x = (z*v)
  73. ;   y = (z/v)
  74. ;   a = (|x| <= |y|) * ((z + y) * k)
  75. ;   b = (|x| > |y|) * ((z + x) * k)
  76. ;   z = fn2((a + b) * v) + v
  77. ;    |z| <= (10 + p2)
  78. ;  }
  79.  
  80. Larry { ; Mutation of 'Michaelbrot' and 'Element'
  81.    ; Original formulas by Michael Theroux [71673,2767]
  82.    ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  83.    ; For 'Michaelbrot', set FN1 & FN2 =IDENT and P1 & P2 = default
  84.    ; For 'Element', set FN1=IDENT & FN2=SQR and P1 & P2 = default
  85.    ; p1 = Parameter (default 0.5,0), real(p2) = Bailout (default 4)
  86.    z = pixel
  87.    ; The next line sets c=default if p1=0, else c=p1
  88.    IF (real(p1) || imag(p1))
  89.       c = p1
  90.    ELSE
  91.       c = 0.5
  92.    ENDIF
  93.    ; The next line sets test=4 if real(p2)<=0, else test=real(p2)
  94.    IF (real(p2) <= 0)
  95.       test = 4
  96.    ELSE
  97.       test = real(p2)
  98.    ENDIF
  99.    :
  100.    z = fn1(fn2(z*z)) + c
  101.    |z| <= test
  102.    }
  103.  
  104. ; Original version
  105. ; Larry { ; Mutation of 'Michaelbrot' and 'Element'
  106. ;  ; Original formulas by Michael Theroux [71673,2767]
  107. ;  ; For 'Michaelbrot', set FN1 & FN2 =IDENT and P1 & P2 = default
  108. ;  ; For 'Element', set FN1=IDENT & FN2=SQR and P1 & P2 = default
  109. ;  ; p1 = Parameter (default 0.5,0), real(p2) = Bailout (default 4)
  110. ;  z = pixel
  111. ;  ; The next line sets c=default if p1=0, else c=p1
  112. ;  c = ((0.5,0) * (|p1|<=0) + p1)
  113. ;  ; The next line sets test=4 if real(p2)<=0, else test=real(p2)
  114. ;  test = (4 * (real(p2)<=0) + real(p2) * (0<p2)):
  115. ;   z = fn1(fn2(z*z)) + c
  116. ;    |z| <= test
  117. ;  }
  118.  
  119. Moe { ; Mutation of 'Zexpe'.
  120.    ; Original formula by Lee Skinner [75450,3631]
  121.    ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  122.    ; For 'Zexpe', set FN1 & FN2 = IDENT and P1 = default
  123.    ; real(p1) = Bailout (default 100)
  124.    s = exp(1.,0.), z = pixel, c = fn1(pixel)
  125.    ; The next line sets test=100 if real(p1)<=0, else test=real(p1)
  126.    IF (real(p1) <= 0)
  127.       test = 100
  128.    ELSE
  129.       test = real(p1)
  130.    ENDIF
  131.    :
  132.    z = fn2(z)^s + c
  133.    |z| <= test
  134.    }
  135.  
  136. ; Original version
  137. ; Moe { ; Mutation of 'Zexpe'.
  138. ;  ; Original formula by Lee Skinner [75450,3631]
  139. ;  ; For 'Zexpe', set FN1 & FN2 =IDENT and P1 = default
  140. ;  ; real(p1) = Bailout (default 100)
  141. ;  s = exp(1.,0.), z = pixel, c = fn1(pixel)
  142. ;  ; The next line sets test=100 if real(p1)<=0, else test=real(p1)
  143. ;  test = (100 * (real(p1)<=0) + real(p1) * (0<p1)):
  144. ;   z = fn2(z)^s + c
  145. ;    |z| <= test
  146. ;  }
  147.  
  148. Groucho { ; Mutation of 'Fish2'.
  149.    ; Original formula by Dave Oliver via Tim Wegner
  150.    ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  151.    ; For 'Fish2', set FN1 & FN2 =IDENT and P1 & P2 = default
  152.    ; p1 = Parameter (default 1,0), real(p2) = Bailout (default 4)
  153.    z = c = pixel
  154.    ; The next line sets k=default if p1=0, else k=p1
  155.    IF (real(p1) || imag(p1))
  156.       k = p1
  157.    ELSE
  158.       k = 1
  159.    ENDIF
  160.    ; The next line sets test=4 if real(p2)<=0, else test=real(p2)
  161.    IF (real(p2) <= 0)
  162.       test = 4
  163.    ELSE
  164.       test = real(p2)
  165.    ENDIF
  166.    :
  167.    z1 = c^(fn1(z)-k)
  168.    z = fn2(((c*z1)-k)*(z1))
  169.    |z| <= test
  170.    }
  171.  
  172. ; Original version
  173. ; Groucho { ; Mutation of 'Fish2'.
  174. ;  ; Original formula by Dave Oliver via Tim Wegner
  175. ;  ; For 'Fish2', set FN1 & FN2 =IDENT and P1 & P2 = default
  176. ;  ; p1 = Parameter (default 1,0), real(p2) = Bailout (default 4)
  177. ;  z = c = pixel
  178. ;  ; The next line sets k=default if p1=0, else k=p1
  179. ;  k = ((1,0) * (|p1|<=0) + p1)
  180. ;  ; The next line sets test=4 if real(p2)<=0, else test=real(p2)
  181. ;  test = (4 * (real(p2)<=0) + real(p2) * (0<p2)):
  182. ;   z1 = c^(fn1(z)-k)
  183. ;   z = fn2(((c*z1)-k)*(z1))
  184. ;    |z| <= test
  185. ;  }
  186.  
  187. Zeppo { ; Mutation of 'Liar4'.
  188.    ; Original formula by Chuck Ebbert [76306,1226]
  189.    ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  190.    ; For 'Liar4' set FN1 & FN2 =IDENT and P1 & P2 = default
  191.    ; p1 & p2 = Parameters (default 1,0 and 0,0)
  192.    z = pixel
  193.    ; The next line sets p=default if p1=0, else p=p1
  194.    IF (real(p1) || imag(p1))
  195.       p = p1
  196.    ELSE
  197.       p = 1
  198.    ENDIF
  199.    :
  200.    z = fn1(1-abs(imag(z)*p-real(z))) +          \
  201.        flip(fn2(1-abs(1-real(z)-imag(z)))) - p2
  202.    |z| <= 1
  203.    }
  204.  
  205. ; Original version
  206. ; Zeppo { ; Mutation of 'Liar4'.
  207. ;  ; Original formula by Chuck Ebbert [76306,1226]
  208. ;  ; For 'Liar4' set FN1 & FN2 =IDENT and P1 & P2 = default
  209. ;  ; p1 & p2 = Parameters (default 1,0 and 0,0)
  210. ;  z = pixel
  211. ;  ; The next line sets p=default if p1=0, else p=p1
  212. ;  p = (1 * (|p1|<=0) + p1):
  213. ;   z =fn1(1-abs(imag(z)*p-real(z)))+flip(fn2(1-abs(1-real(z)-imag(z))))-p2
  214. ;    |z| <= 1
  215. ;  }
  216.  
  217. inandout02 { ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  218.   ;p1 = Parameter (default 0), real(p2) = Bailout (default 4)
  219.   ;The next line sets test=4 if real(p2)<=0, else test=real(p2)
  220.    IF (p2 <= 0)
  221.       test = 4
  222.    ELSE
  223.       test = real(p2)
  224.    ENDIF
  225.    z = oldz = pixel , moldz = mz = |z| :
  226.    IF (mz <= moldz)
  227.       oldz = z , moldz = mz , z = fn1(z) + p1 , mz = |z|  ;IN
  228.    ELSE
  229.       oldz = z , moldz = mz , z = fn2(z) + p1 , mz = |z|  ;OUT
  230.    ENDIF
  231.    mz <= test
  232.    }
  233.  
  234. ; Original version
  235. ; inandout02 {
  236. ;  ;p1 = Parameter (default 0), real(p2) = Bailout (default 4)
  237. ;  ;The next line sets test=4 if real(p2)<=0, else test=real(p2)
  238. ;  test = (4 * (real(p2)<=0) + real(p2) * (0<p2))
  239. ;  z = oldz = pixel:
  240. ;   a = (|z| <= |oldz|) * (fn1(z)) ;IN
  241. ;   b = (|oldz| < |z|) * (fn2(z))  ;OUT
  242. ;   oldz = z
  243. ;   z = a + b + p1
  244. ;    |z| <= test
  245. ;  }
  246.  
  247. inandout03 { ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  248.   ;p1 = Parameter (default 0), real(p2) = Bailout (default 4)
  249.   ;The next line sets test=4 if real(p2)<=0, else test=real(p2)
  250.    IF (p2 <= 0)
  251.       test = 4
  252.    ELSE
  253.       test = real(p2)
  254.    ENDIF
  255.    z = oldz = c = pixel , moldz = mz = |z| :
  256.    IF (mz <= moldz)
  257.       c = fn1(c)       ;IN
  258.    ELSE
  259.       c = fn1(z * p1)  ;OUT
  260.    ENDIF
  261.    oldz = z , moldz = mz
  262.    z = fn2(z*z) + c , mz = |z|
  263.    mz <= test
  264.    }
  265.  
  266. ; Original version
  267. ; inandout03 {
  268. ;  ;p1 = Parameter (default 0), real(p2) = Bailout (default 4)
  269. ;  ;The next line sets test=4 if real(p2)<=0, else test=real(p2)
  270. ;  test = (4 * (real(p2)<=0) + real(p2) * (0<p2))
  271. ;  z = oldz = c = pixel:
  272. ;   a = (|z| <= |oldz|) * (c)    ;IN
  273. ;   b = (|oldz| < |z|)  * (z*p1) ;OUT
  274. ;   c = fn1(a + b)
  275. ;   oldz = z
  276. ;   z = fn2(z*z) + c
  277. ;    |z| <= test
  278. ;  }
  279.  
  280. inandout04 { ; Modified for if..else logic 3/21/97 by Sylvie Gallet
  281.   ;p1 = Parameter (default 1), real(p2) = Bailout (default 4)
  282.    ; The next line sets k=default if p1=0, else k=p1
  283.    IF (real(p1) || imag(p1))
  284.       k = p1
  285.    ELSE
  286.       k = 1
  287.    ENDIF
  288.    ; The next line sets test=4 if real(p2)<=0, else test=real(p2)
  289.    IF (real(p2) <= 0)
  290.       test = 4
  291.    ELSE
  292.       test = real(p2)
  293.    ENDIF
  294.    z = oldz = c = pixel , mz = moldz = |z|
  295.    :
  296.    IF (mz > moldz)
  297.       c = c*k
  298.    ENDIF
  299.    oldz = z , moldz = mz , z = fn1(z*z) + c , mz = |z|
  300.    mz <= test
  301.    }
  302.  
  303. ; Original version
  304. ; inandout04 {
  305. ;  ;p1 = Parameter (default 1), real(p2) = Bailout (default 4)
  306. ;  ;The next line sets k=default if p1=0, else k=p1
  307. ;  k = ((1) * (|p1|<=0) + p1)
  308. ;  ;The next line sets test=4 if real(p2)<=0, else test=real(p2)
  309. ;  test = (4 * (real(p2)<=0) + real(p2) * (0<p2))
  310. ;  z = oldz = c = pixel:
  311. ;   a = (|z| <= |oldz|) * (c)   ;IN
  312. ;   b = (|oldz| < |z|)  * (c*k) ;OUT
  313. ;   c = a + b
  314. ;   oldz = z
  315. ;   z = fn1(z*z) + c
  316. ;    |z| <= test
  317. ;  }
  318.  
  319. comment {
  320.   In this formula, a running count of the iterations is kept. After a
  321.   specified iteration number has been reached, the algorithm is changed.
  322.   }
  323.  
  324. shifter01 { ; After shift, switch from z*z to z*z*z
  325.             ; Bradley Beacham  [74223,2745]
  326.             ; Modified for if..else logic 3/18/97 by Sylvie Gallet
  327.    ; P1 = shift value, P2 varies bailout value
  328.    z = c = pixel , iter = 1 , shift = p1 , test = 4 + p2 :
  329.    IF (iter <= shift)
  330.       z = z*z + c
  331.    ELSE
  332.       z = z*z*z + c
  333.    ENDIF
  334.    iter = iter + 1
  335.    |z| < test
  336.    }
  337.  
  338. ; Original version
  339. ; shifter01 { ; After shift, switch from z*z to z*z*z
  340. ;            ; Bradley Beacham  [74223,2745]
  341. ;  ; P1 = shift value, P2 varies bailout value
  342. ;  z = c = pixel, iter = 1, shift = p1, test = 4 + p2:
  343. ;   lo = (z*z) * (iter <= shift)
  344. ;   hi = (z*z*z) * (shift < iter)
  345. ;   iter = iter + 1
  346. ;   z = lo + hi + c
  347. ;    |z| < test
  348. ;  }
  349.  
  350. {--- ROBERT W. CARR ------------------------------------------------------}
  351.  
  352. COMMENT {
  353.   This formula is based on Sylvie Gallet's Five-Mandels formula.
  354.   Though it shouldn't produce a symmetrical image, a modification of pixel
  355.   forces symmetry around the Y axis.
  356.   }
  357.  
  358. Carr2289 (YAXIS) { ; Modified Sylvie Gallet frm. [101324,3444],1996
  359.                    ; Modified for if..else logic 3/17/97 by Sylvie Gallet
  360.    ; 0 < real(p1) < imag(p1) < real(p2) < imag(p2) < maxiter, periodicity=0
  361.    pixel = -abs(real(pixel)) + flip(imag(pixel))
  362.    c = pixel + pixel - flip(0.001/pixel) - conj(0.01/pixel)
  363.    z = zorig = pixel - conj(asin(pixel+pixel+0.32))
  364.    d1 = flip(-0.0005935/pixel) , d4 = 4 * d1 , d5 = d1 + d4
  365.    bailout = 4 , iter = 0 :
  366.    IF (iter == p1)
  367.       z = c = 1.5 * zorig + d5
  368.    ELSEIF (iter == imag(p1))
  369.       z = c = 2.25 * zorig + d5
  370.    ELSEIF (iter == p2)
  371.       z = c = 3.375 * zorig + d5
  372.    ELSEIF (iter == imag(p2))
  373.       z = c = 5.0625 * zorig + d5
  374.    ELSE
  375.       z = z + d4 , c = c + d4
  376.    ENDIF
  377.    z = z*z + c
  378.    iter = iter + 1
  379.    abs(z) <= bailout
  380.    }
  381.  
  382. ; Original version
  383. ; Carr2289 (YAXIS) {; Modified Sylvie Gallet frm. [101324,3444],1996
  384. ;  ; 0 < real(p1) < imag(p1) < real(p2) < imag(p2) < maxiter, periodicity=0
  385. ;  pixel = -abs(real(pixel)) + flip(imag(pixel))
  386. ;  c = pixel + pixel - flip(0.001/pixel) - conj(0.01/pixel)
  387. ;  z = pixel - conj(asin(pixel+pixel+0.32))
  388. ;  d1 = flip(-0.0005935/pixel) , d4 = 4*d1
  389. ;  z1 = 1.5*z+d1 , z2 = 2.25*z+d1 , z3 = 3.375*z+d1 , z4 = 5.0625*z+d1
  390. ;  l1 = real(p1) , l2 = imag(p1) , l3 = real(p2) , l4 = imag(p2)
  391. ;  bailout = 16 , iter = 0 :
  392. ;   t1 = iter==l1 , t2 = iter==l2 , t3 = iter==l3 , t4 = iter==l4
  393. ;   t = 1 - (t1||t2||t3||t4) , ct = z1*t1 + z2*t2 + z3*t3 + z4*t4 + d4
  394. ;   z = z*t + ct , c = c*t + ct
  395. ;   z = z*z + c
  396. ;   iter = iter + 1
  397. ;    |real(z)| <= bailout
  398. ;  }
  399.  
  400. {--- SYLVIE GALLET -------------------------------------------------------}
  401.  
  402. comment {
  403.   Because of its large size, this formula requires Fractint version 19.3 or
  404.   later to run.
  405.   It uses Newton's formula applied to the equation z^6-1 = 0 and, in the
  406.   foreground, spells out the word 'FRACTINT'.
  407.   }
  408.  
  409. Fractint {; Sylvie Gallet [101324,3444], 1996
  410.           ; Modified for if..else logic 3/21/97 by Sylvie Gallet
  411.           ; requires 'periodicity=0'
  412.    z = pixel-0.025 , x = real(z) , y = imag(z) , text = 0
  413.    IF (y > -0.225 && y < 0.225)
  414.       x1 = x*1.8 , x3 = 3*x
  415.       ty2 = y < 0.025 && y > -0.025 || y > 0.175
  416.       IF ( x < -1.2 || ty2 && x > -1.25 && x < -1 )
  417.          text = 1
  418.       ELSEIF ( x < -0.9 || ty2 && x > -0.95 && x < -0.8                  \
  419.                || (cabs(sqrt(|z+(0.8,-0.1)|)-0.1) < 0.025 && x > -0.8)   \
  420.                || (y < -x1-1.44 && y > -x1-1.53 && y < 0.025) )
  421.          text = 1
  422.       ELSEIF ( y > x3+1.5 || y > -x3-1.2 || (y > -0.125 && y < -0.075)   \
  423.                && y < x3+1.65 && y < -x3-1.05 )
  424.          text = 1
  425.       ELSEIF ( cabs(sqrt(|z+0.05|)-0.2) < 0.025 && x < 0.05 )
  426.          text = 1
  427.       ELSEIF ( (x > 0.225 && x < 0.275 || y > 0.175) && x > 0.1 && x < 0.4 )
  428.          text = 1
  429.       ELSEIF ( x > 0.45 && x < 0.5 )
  430.          text = 1
  431.       ELSEIF ( x < 0.6 || x > 0.8 || ((y > -x1+1.215) && (y < -x1+1.305))  \
  432.                && x > 0.55 && x < 0.85 )
  433.          text = 1
  434.       ELSEIF ( x > 1.025 && x < 1.075 || y > 0.175 && x > 0.9 && x < 1.2 )
  435.          text = 1
  436.       ENDIF
  437.    ENDIF
  438.    z = 1 + (0.0,-0.65) / (pixel+(0.0,.75))
  439.    :
  440.    IF (text == 0)
  441.       z2 = z*z , z4 = z2*z2 , n = z4*z2-1 , z = z-n/(6*z4*z)
  442.       IF (|n| >= 0.0001)
  443.          continue = 1
  444.       ELSE
  445.          continue = 0
  446.       ENDIF
  447.    ENDIF
  448.    continue
  449.    }
  450.  
  451. ; Original version
  452. ; Fractint {; Sylvie Gallet [101324,3444], 1996
  453. ;          ; requires 'periodicity=0'
  454. ;  z = pixel-0.025 , x=real(z) , y=imag(z) , x1=x*1.8 , x3=3*x
  455. ;  ty2 = ( (y<0.025) && (y>-0.025) ) || (y>0.175)
  456. ;  f = ( (x<-1.2) || ty2 ) && ( (x>-1.25) && (x<-1) )
  457. ;  r = ( (x<-0.9) || ty2 ) && ( (x>-0.95) && (x<-0.8) )
  458. ;  r = r || ((cabs(sqrt(|z+(0.8,-0.1)|)-0.1)<0.025) && (x>-0.8))
  459. ;  r = r || (((y<(-x1-1.44)) && (y>(-x1-1.53))) && (y<0.025))
  460. ;  a = (y>(x3+1.5)) || (y>(-x3-1.2)) || ((y>-0.125) && (y<-0.075))
  461. ;  a = a && ((y<(x3+1.65)) && (y<(-x3-1.05)))
  462. ;  c = (cabs(sqrt(|z+0.05|)-0.2)<0.025) && (x<0.05)
  463. ;  t1 = ((x>0.225) && (x<0.275) || (y>0.175)) && ((x>0.1) && (x<0.4))
  464. ;  i = (x>0.45) && (x<0.5)
  465. ;  n = (x<0.6) || (x>0.8) || ((y>-x1+1.215) && (y<-x1+1.305))
  466. ;  n = n && (x>0.55) && (x<0.85)
  467. ;  t2 = ((x>1.025) && (x<1.075) || (y>0.175)) && ((x>0.9) && (x<1.2))
  468. ;  test = 1 - (real(f||r||a||c||t1||i||n||t2)*real(y>-0.225)*real(y<0.225))
  469. ;  z = 1+(0.0,-0.65)/(pixel+(0.0,.75)) :
  470. ;   z2 = z*z , z4 = z2*z2 , n = z4*z2-1 , z = z-n/(6*z4*z)
  471. ;    (|n|>=0.0001) && test
  472. ;  }
  473.  
  474. comment {
  475.   Five-Mandels shows five Mandelbrot sets that fit into each other.
  476.   It uses the following algorithm:
  477.     z=c=pixel
  478.     FOR iter:=0 to l1-1
  479.       IF the orbit of z*z + c escapes THEN end
  480.         ELSE
  481.           z:=z1
  482.           FOR iter:=L1+1 to l2-1
  483.             IF the orbit of z*z + z1 escapes THEN end
  484.               ELSE
  485.                 z:=z2
  486.                 FOR iter:=L2+1 to l3-1
  487.                   ...
  488.   To work correctly, this formula requires the use of periodicity=0.
  489.   }
  490.  
  491. Five-Mandels (XAXIS) {; Sylvie Gallet [101324,3444], 1996
  492.    ; 0 < real(p1) < imag(p1) < real(p2) < imag(p2) < maxiter, periodicity=0
  493.    ; Modified for if..else logic 3/17/97 by Sylvie Gallet
  494.    c = z = zorig = pixel
  495.    bailout = 16 , iter = 0 :
  496.    IF (iter == p1)
  497.       z = c = 1.5 * zorig
  498.    ELSEIF (iter == imag(p1))
  499.       z = c = 2.25 * zorig
  500.    ELSEIF (iter == p2)
  501.       z = c = 3.375 * zorig
  502.    ELSEIF (iter == imag(p2))
  503.       z = c = 5.0625 * zorig
  504.    ENDIF
  505.    z = z*z + c
  506.    iter = iter + 1
  507.    |z| <= bailout
  508.    }
  509.  
  510. ; Original version
  511. ; Five-Mandels (XAXIS) {; Sylvie Gallet [101324,3444], 1996
  512. ;  ; 0 < real(p1) < imag(p1) < real(p2) < imag(p2) < maxiter, periodicity=0
  513. ;  c = z = pixel
  514. ;  z1 = 1.5*z , z2 = 2.25*z , z3 = 3.375*z , z4 = 5.0625*z
  515. ;  l1 = real(p1) , l2 = imag(p1) , l3 = real(p2) , l4 = imag(p2)
  516. ;  bailout = 16 , iter = 0 :
  517. ;   t1 = (iter==l1) , t2 = (iter==l2) , t3 = (iter==l3) , t4 = (iter==l4)
  518. ;   t = 1-(t1||t2||t3||t4) , ct = z1*t1 + z2*t2 + z3*t3 + z4*t4
  519. ;   z = z*t + ct , c = c*t + ct
  520. ;   z = z*z + c
  521. ;   iter = iter+1
  522. ;    |z| <= bailout
  523. ;  }
  524.  
  525. comment {
  526.   The following formula draws the graphs of 4 real functions at a time.
  527.   }
  528.  
  529. Graph { ; Sylvie Gallet [101324,3444], 1996
  530.         ; Modified for if..else logic 3/17/97 by Sylvie Gallet
  531.    ; 2 parameters: curves thickness = real(p1)
  532.    ;                 axes thickness = imag(p1)
  533.    ; choose for example real(p1) = 0.002 and imag(p1) = 0.001
  534.    epsilon = abs(real(p1)) , axes = abs(imag(p1))
  535.    z = 0 , x = round(real(pixel)/epsilon) * epsilon
  536.    IF ((|real(pixel)| <= axes) || (|imag(pixel)| <= axes))
  537.       z = z + 1
  538.    ENDIF
  539.    IF (|x + flip(fn1(x))-pixel| <= epsilon)
  540.       z = z + 2
  541.    ENDIF
  542.    IF (|x + flip(fn2(x))-pixel| <= epsilon)
  543.       z = z + 4
  544.    ENDIF
  545.    IF (|x + flip(fn3(x))-pixel| <= epsilon)
  546.       z = z + 8
  547.    ENDIF
  548.    IF (|x + flip(fn4(x))-pixel| <= epsilon)
  549.       z = z + 16
  550.    ENDIF
  551.    IF (z == 0)
  552.       z = z + 100
  553.    ENDIF
  554.    :
  555.    z = z - 1
  556.    z > 0
  557.    }
  558.  
  559. ; Original version
  560. ; Graph { ; Sylvie Gallet [101324,3444], 1996
  561. ;  ; 2 parameters: curves thickness = real(p1)
  562. ;  ;                 axes thickness = imag(p1)
  563. ;  ; choose for example real(p1) = 0.002 and imag(p1) = 0.001
  564. ;  epsilon = abs(real(p1)) , axes = abs(imag(p1))
  565. ;  x = round(real(pixel)/epsilon) * epsilon
  566. ;  z1 = x + flip(fn1(x)) , z2 = x + flip(fn2(x))
  567. ;  z3 = x + flip(fn3(x)) , z4 = x + flip(fn4(x))
  568. ;  testaxes = (|real(pixel)|<=axes) || (|imag(pixel)|<=axes)
  569. ;  testfn1 = 2*(|z1-pixel|<=epsilon) , testfn2 = 4*(|z2-pixel|<=epsilon)
  570. ;  testfn3 = 8*(|z3-pixel|<=epsilon) , testfn4 = 16*(|z4-pixel|<=epsilon)
  571. ;  z = testaxes + testfn1 + testfn2 + testfn3 + testfn4
  572. ;  z = z + 100*(z==0) :
  573. ;   z = z - 1
  574. ;    z > 0
  575. ;  }
  576.  
  577. comment {
  578.   The following formula overlays a Mandel and a reverse-Mandel, using a
  579.   checkerboard dithering invisible at very high resolutions.
  580.   Since it uses the new predefined variable "whitesq", it's now resolution
  581.   independent and the image can be interrupted, saved and restored.
  582.   Panning an even number of pixels is now possible.
  583.   }
  584.  
  585. JD-SG-04-1 { ; Sylvie Gallet [101324,3444], 1996
  586.    ; On an original idea by Jim Deutch [104074,3171]
  587.    ; Modified for if..else logic 3/21/97 by Sylvie Gallet
  588.    ; use p1 and p2 to adjust the inverted Mandel
  589.    ; 16-bit Pseudo-HiColor
  590.    IF (whitesq)
  591.       z = c = pixel
  592.    ELSE
  593.       z = c = p1 / (pixel+p2)
  594.    ENDIF
  595.    :
  596.    z = z*z + c
  597.    |z| < 4
  598.    }
  599.  
  600. ; Original version
  601. ; JD-SG-04-1 { ; Sylvie Gallet [101324,3444], 1996
  602. ;  ; On an original idea by Jim Deutch [104074,3171]
  603. ;  ; use p1 and p2 to adjust the inverted Mandel
  604. ;  ; 16-bit Pseudo-HiColor
  605. ;  z = c = pixel * whitesq + (p1 / (pixel+p2)) * (whitesq==0) :
  606. ;   z = z*z + c
  607. ;    |z| < 4
  608. ;  }
  609.  
  610. comment {
  611.   These formula overlay 3 or 4 fractals.
  612.   }
  613.  
  614. ptc+mjn { ; Sylvie Gallet [101324,3444], 1996
  615.           ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  616.           ; 24-bit Pseudo-TrueColor
  617.           ; Mandel: z^2 + c , Julia: z^2 + p1 , Newton: z^p2 - 1 = 0
  618.    cr = real(scrnpix) + imag(scrnpix)
  619.    r = cr - 3 * trunc(cr / real(3)) , z = pixel
  620.    IF (r == 0)
  621.       c = pixel , b1 = 256
  622.    ELSEIF (r == 1)
  623.       c = p1 , b1 = 256
  624.    ELSE
  625.       c = 0 , b2 = 0.000001 , ex = p2 - 1
  626.    ENDIF
  627.    :
  628.    IF (r == 2)
  629.       zd = z^ex , n = zd*z - 1
  630.       z = z - n / (p2*zd) , continue = (|n| >= b2)
  631.    ELSE
  632.       z = z*z + c , continue = (|z| <= b1)
  633.    ENDIF
  634.    continue
  635.    }
  636.  
  637. ; Original version
  638. ; ptc+mjn { ; Sylvie Gallet [101324,3444], 1996
  639. ;          ; 24-bit Pseudo-TrueColor
  640. ;          ; Mandel: z^2 + c , Julia: z^2 + p1 , Newton: z^p2 - 1 = 0
  641. ;  cr = real(scrnpix) + imag(scrnpix)
  642. ;  r = cr - 3 * trunc(cr / real(3))
  643. ;  z = pixel , b1 = 256 , b2 = 0.000001 , ex = p2 - 1
  644. ;  c = pixel * (r==0) + p1 * (r==1) :
  645. ;   zd = z^ex , zn = zd*z , n = zn - 1 , d = p2 * zd
  646. ;   z = (z*z + c) * (r!=2) + (z - n/d) * (r==2)
  647. ;    ((|z| <= b1) && (r!=2)) || ((|n| >= b2 ) && (r==2))
  648. ;  }
  649.  
  650. ptc+4mandels { ; Sylvie Gallet [101324,3444], 1996
  651.                ; 32-bit Pseudo-TrueColor
  652.                ; Modified for if..else logic 3/21/97 by Sylvie Gallet
  653.    cr = real(scrnpix) + 2*imag(scrnpix)
  654.    r = cr - 4 * trunc(cr / 4)
  655.    IF (r == 0)
  656.       z = c = pixel
  657.    ELSEIF (r == 1)
  658.       z = c = pixel * p1
  659.    ELSEIF (r == 2)
  660.       z = c = pixel * p2
  661.    ELSE
  662.       z = c = pixel * p3
  663.    ENDIF
  664.    :
  665.    z = z * z + c
  666.    |z| <= 4
  667.    }
  668.  
  669. ; Original version
  670. ; ptc+4mandels { ; Sylvie Gallet [101324,3444], 1996
  671. ;               ; 32-bit Pseudo-TrueColor
  672. ;  cr = real(scrnpix) + 2*imag(scrnpix)
  673. ;  r = cr - 4 * trunc(cr / 4)
  674. ;  c = r == 0 , c1 = p1 * (r == 1)
  675. ;  c2 = p2 * (r == 2) , c3 = p3 * (r == 3)
  676. ;  z = c = pixel * (c + c1 + c2 + c3) :
  677. ;   z = z * z + c
  678. ;    |z| <= 4
  679. ;  }
  680.  
  681. Gallet-8-21 { ; Sylvie Gallet [101324,3444], Apr 1997
  682.               ; Requires periodicity = 0 and decomp = 256
  683.               ; p1 = parameter for a Julia set (0 for the Mandelbrot set)
  684.               ; 0 < real(p2) , 0 < imag(p2)
  685.    im2 = imag(p2)
  686.    IF (p1 || imag(p1))
  687.       c = p1
  688.    ELSE
  689.       c = pixel
  690.    ENDIF
  691.    z = -1 , zn = pixel , zmin = zmin0 = abs(real(p2))
  692.    cmax = trunc(abs(real(p3)))
  693.    IF (cmax < 2)
  694.       cmax = 2
  695.    ENDIF
  696.    k = flip(6.28318530718/(zmin*real(cmax))) , cnt = -1
  697.    :
  698.    cnt = cnt + 1
  699.    IF (cnt == cmax)
  700.       cnt = 0
  701.    ENDIF
  702.    zn = zn*zn + c , znc = cabs(im2*real(zn) + flip(imag(zn)))
  703.    IF (znc < zmin)
  704.       zmin = znc , z = exp((cnt*zmin0 + zmin)*k)
  705.    ENDIF
  706.    znc <= 4
  707.    }
  708.  
  709. {--- JONATHAN OSUCH ------------------------------------------------------}
  710.  
  711. BirdOfPrey (XAXIS_NOPARM) { ; Optimized by Sylvie Gallet
  712.   z = p1 :
  713.    z = cosxx(sqr(z) + pixel) + pixel
  714.     |z| <= 4
  715.   }
  716.  
  717. ; Original version
  718. ; BirdOfPrey(XAXIS_NOPARM) {
  719. ;  z=p1, x=1:
  720. ;   (x<10)*(z=sqr(z)+pixel)
  721. ;   (10<=x)*(z=cosxx(z)+pixel)
  722. ;   x=x+1
  723. ;    |z|<=4
  724. ;  }
  725.  
  726. FractalFenderC (XAXIS_NOPARM) { ; Spectacular!
  727.    ; Modified for if..else logic 3/18/97 by Sylvie Gallet
  728.    z = p1 , x = |z| :
  729.    IF (1 < x)
  730.       z = cosh(z) + pixel
  731.    ENDIF
  732.    z = sqr(z) + pixel , x = |z|
  733.    x <= 4
  734.    }
  735.  
  736. ; Original version
  737. ; FractalFenderC(XAXIS_NOPARM) {;Spectacular!
  738. ;  z=p1,x=|z|:
  739. ;   (z=cosh(z)+pixel)*(1<x)+(z=z)*(x<=1)
  740. ;   z=sqr(z)+pixel,x=|z|
  741. ;    x<=4
  742. ;  }
  743.  
  744. {--- TERREN SUYDAM -------------------------------------------------------}
  745.  
  746. comment {
  747.   These formulas are designed to create tilings based on the Mandel or Julia
  748.   formulas that can be used as HTML page or Windows backgrounds.
  749.   Zoom in on a favorite spot on Mandel or Julia. Write down the center and
  750.   magnification for that particular view. If it's a Julia, write down
  751.   the real & imag. parameter as well.
  752.   The numbers you write down will be parameters to the fractal type
  753.   TileMandel or TileJulia.
  754.   - For both, paramter p1 is the center of the image you want to tile.
  755.   - The real part of p2 is the magnification (the default is 1/3).
  756.   - The imag. part is the number of tiles you want to be drawn (the default
  757.     is 3).
  758.   - For TileJulia, p3 is the Julia parameter.
  759.      These formulas need 'periodicity=0'.
  760.   }
  761.  
  762. TileMandel { ; Terren Suydam (terren@io.com), 1996
  763.              ; modified by Sylvie Gallet [101324,3444]
  764.              ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  765.    ; p1 = center = coordinates for a good Mandel
  766.    ; 0 <= real(p2) = magnification. Default for magnification is 1/3
  767.    ; 0 <= imag(p2) = numtiles. Default for numtiles is 3
  768.    center = p1
  769.    IF (p2 > 0)
  770.       mag = real(p2)
  771.    ELSE
  772.       mag = 1/3
  773.    ENDIF
  774.    IF (imag(p2) > 0)
  775.       numtiles = imag(p2)
  776.    ELSE
  777.       numtiles = 3
  778.    ENDIF
  779.    omega = numtiles*2*pi/3
  780.    x = asin(sin(omega*real(pixel))) , y = asin(sin(omega*imag(pixel)))
  781.    z = c = (x+flip(y)) / mag + center :
  782.    z = z*z + c
  783.    |z| <= 4
  784.    }
  785.  
  786. ; Original version
  787. ; TileMandel { ; Terren Suydam (terren@io.com), 1996
  788. ;             ; modified by Sylvie Gallet [101324,3444]
  789. ;  ; p1 = center = coordinates for a good Mandel
  790. ;  ; 0 <= real(p2) = magnification. Default for magnification is 1/3
  791. ;  ; 0 <= imag(p2) = numtiles. Default for numtiles is 3
  792. ;  center = p1 , mag = real(p2)*(p2>0) + (p2<=0)/3
  793. ;  numtiles = imag(p2)*(flip(p2)>0) + 3*(flip(p2)<=0)
  794. ;  omega = numtiles*2*pi/3
  795. ;  x = asin(sin(omega*real(pixel))) , y = asin(sin(omega*imag(pixel)))
  796. ;  z = c = (x+flip(y)) / mag + center :
  797. ;   z = z*z + c
  798. ;    |z| <= 4
  799. ;  }
  800.  
  801. TileJulia { ; Terren Suydam (terren@io.com), 1996
  802.             ; modified by Sylvie Gallet [101324,3444]
  803.             ; Modified for if..else logic 3/19/97 by Sylvie Gallet
  804.    ; p1 = center = coordinates for a good Julia
  805.    ; 0 <= real(p2) = magnification. Default for magnification is 1/3
  806.    ; 0 <= imag(p2) = numtiles. Default for numtiles is 3
  807.    ; p3 is the Julia set parameter
  808.    center = p1
  809.    IF (p2 > 0)
  810.       mag = real(p2)
  811.    ELSE
  812.       mag = 1/3
  813.    ENDIF
  814.    IF (imag(p2) > 0)
  815.       numtiles = imag(p2)
  816.    ELSE
  817.       numtiles = 3
  818.    ENDIF
  819.    omega = numtiles*2*pi/3
  820.    x = asin(sin(omega*real(pixel))) , y = asin(sin(omega*imag(pixel)))
  821.    z = (x+flip(y)) / mag + center :
  822.    z = z*z + p3
  823.    |z| <= 4
  824.    }
  825.  
  826. ; Original version
  827. ; TileJulia { ; Terren Suydam (terren@io.com), 1996
  828. ;            ; modified by Sylvie Gallet [101324,3444]
  829. ;  ; p1 = center = coordinates for a good Julia
  830. ;  ; 0 <= real(p2) = magnification. Default for magnification is 1/3
  831. ;  ; 0 <= imag(p2) = numtiles. Default for numtiles is 3
  832. ;  ; p3 is the Julia set parameter
  833. ;  center = p1 , mag = real(p2)*(p2>0) + (p2<=0)/3
  834. ;  numtiles = imag(p2)*(flip(p2)>0) + 3*(flip(p2)<=0)
  835. ;  omega = numtiles*2*pi/3
  836. ;  x = asin(sin(omega*real(pixel))) , y = asin(sin(omega*imag(pixel)))
  837. ;  z = (x+flip(y)) / mag + center :
  838. ;   z = z*z + p3
  839. ;    |z| <= 4
  840. ;  }
  841.