comment { Copyright © 1999-2018 by Mark Townsend. Fractal Formulas for Ultra Fractal 2.0 and above Last update 24 October 2018 ; This work is licensed under a Creative Commons ; Attribution-NonCommercial-ShareAlike 4.0 International License. ; http://creativecommons.org/licenses/by-nc-sa/4.0/ } mt-fractalia-1 { ; Mark Townsend, 9 Feb 1999 ; ; This formula is from Clifford A. Pickover's ; book "Keys to Infinity". It's hard to find ; interesting spots just by entering random ; parameters, so I've implemented six versions ; of the formula in a loop of switches. ; init: z = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) float a = real(@ag) float g = imag(@ag) float b = real(@bh) float h = imag(@bh) float c = real(@ci) float i = imag(@ci) float d = real(@dj) float j = imag(@dj) float e1 = real(@ek) float k = imag(@ek) float f = real(@fl) float l = imag(@fl) loop: xx = x x = a + (b * x) + (c * x^2) + (d * x * y) + (e1 * y) + (f * y^2) y = g + (h * xx) + (i * xx^2) + (j * xx * y) + (k * y) + (l * y^2) z = x + flip(y) bailout: |z| < @bailout default: title = "Fractalia I" maxiter = 1000 param ag caption = "a and g" default = (0,0) endparam param bh caption = "b and h" default = (1,-0.2) endparam param ci caption = "c and i" default = (0.5,0.8) endparam param dj caption = "d and j" default = (0.4,0.9) endparam param ek caption = "e and k" default = (-0.7,-0.7) endparam param fl caption = "f and l" default = (0.9,-0.2) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-fractalia-2" bailout = bailout ag = ag bh = #pixel ci = ci dj = dj ek = ek fl = fl } mt-fractalia-2 { ; Mark Townsend, 9 Feb 1999 ; ; This formula is from Clifford A. Pickover's ; book "Keys to Infinity". ; init: z = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) float a = real(@ag) float g = imag(@ag) float b = real(@bh) float h = imag(@bh) float c = real(@ci) float i = imag(@ci) float d = real(@dj) float j = imag(@dj) float e1 = real(@ek) float k = imag(@ek) float f = real(@fl) float l = imag(@fl) loop: xx = x x = a + (b * x) + (c * x^2) + (d * x * y) + (e1 * y) + (f * y^2) y = g + (h * xx) + (i * xx^2) + (j * xx * y) + (k * y) + (l * y^2) z = x + flip(y) bailout: |z| < @bailout default: title = "Fractalia II" maxiter = 1000 param ag caption = "a and g" default = (0,0) endparam param bh caption = "b and h" default = (1,-0.2) endparam param ci caption = "c and i" default = (0.5,0.8) endparam param dj caption = "d and j" default = (0.4,0.9) endparam param ek caption = "e and k" default = (-0.7,-0.7) endparam param fl caption = "f and l" default = (0.9,-0.2) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-fractalia-3" bailout = bailout ag = ag bh = bh ci = #pixel dj = dj ek = ek fl = fl } mt-fractalia-3 { ; Mark Townsend, 9 Feb 1999 ; ; This formula is from Clifford A. Pickover's ; book "Keys to Infinity". ; init: z = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) float a = real(@ag) float g = imag(@ag) float b = real(@bh) float h = imag(@bh) float c = real(@ci) float i = imag(@ci) float d = real(@dj) float j = imag(@dj) float e1 = real(@ek) float k = imag(@ek) float f = real(@fl) float l = imag(@fl) loop: xx = x x = a + (b * x) + (c * x^2) + (d * x * y) + (e1 * y) + (f * y^2) y = g + (h * xx) + (i * xx^2) + (j * xx * y) + (k * y) + (l * y^2) z = x + flip(y) bailout: |z| < @bailout default: title = "Fractalia III" maxiter = 1000 param ag caption = "a and g" default = (0,0) endparam param bh caption = "b and h" default = (1,-0.2) endparam param ci caption = "c and i" default = (0.5,0.8) endparam param dj caption = "d and j" default = (0.4,0.9) endparam param ek caption = "e and k" default = (-0.7,-0.7) endparam param fl caption = "f and l" default = (0.9,-0.2) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-fractalia-4" bailout = bailout ag = ag bh = bh ci = ci dj = #pixel ek = ek fl = ll } mt-fractalia-4 { ; Mark Townsend, 9 Feb 1999 ; ; This formula is from Clifford A. Pickover's ; book "Keys to Infinity". ; init: z = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) float a = real(@ag) float g = imag(@ag) float b = real(@bh) float h = imag(@bh) float c = real(@ci) float i = imag(@ci) float d = real(@dj) float j = imag(@dj) float e1 = real(@ek) float k = imag(@ek) float f = real(@fl) float l = imag(@fl) loop: xx = x x = a + (b * x) + (c * x^2) + (d * x * y) + (e1 * y) + (f * y^2) y = g + (h * xx) + (i * xx^2) + (j * xx * y) + (k * y) + (l * y^2) z = x + flip(y) bailout: |z| < @bailout default: title = "Fractalia IV" maxiter = 1000 param ag caption = "a and g" default = (0,0) endparam param bh caption = "b and h" default = (1,-0.2) endparam param ci caption = "c and i" default = (0.5,0.8) endparam param dj caption = "d and j" default = (0.4,0.9) endparam param ek caption = "e and k" default = (-0.7,-0.7) endparam param fl caption = "f and l" default = (0.9,-0.2) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-fractalia-5" bailout = bailout ag = ag bh = bh ci = ci dj = dj ek = #pixel fl = fl } mt-fractalia-5 { ; Mark Townsend, 9 Feb 1999 ; ; This formula is from Clifford A. Pickover's ; book "Keys to Infinity". ; init: z = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) float a = real(@ag) float g = imag(@ag) float b = real(@bh) float h = imag(@bh) float c = real(@ci) float i = imag(@ci) float d = real(@dj) float j = imag(@dj) float e1 = real(@ek) float k = imag(@ek) float f = real(@fl) float l = imag(@fl) loop: xx = x x = a + (b * x) + (c * x^2) + (d * x * y) + (e1 * y) + (f * y^2) y = g + (h * xx) + (i * xx^2) + (j * xx * y) + (k * y) + (l * y^2) z = x + flip(y) bailout: |z| < @bailout default: title = "Fractalia V" maxiter = 1000 param ag caption = "a and g" default = (0,0) endparam param bh caption = "b and h" default = (1,-0.2) endparam param ci caption = "c and i" default = (0.5,0.8) endparam param dj caption = "d and j" default = (0.4,0.9) endparam param ek caption = "e and k" default = (-0.7,-0.7) endparam param fl caption = "f and l" default = (0.9,-0.2) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-fractalia-6" bailout = bailout ag = ag bh = bh ci = ci dj = dj ek = ek fl = #pixel } mt-fractalia-6 { ; Mark Townsend, 9 Feb 1999 ; ; This formula is from Clifford A. Pickover's ; book "Keys to Infinity". ; init: z = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) float a = real(@ag) float g = imag(@ag) float b = real(@bh) float h = imag(@bh) float c = real(@ci) float i = imag(@ci) float d = real(@dj) float j = imag(@dj) float e1 = real(@ek) float k = imag(@ek) float f = real(@fl) float l = imag(@fl) loop: xx = x x = a + (b * x) + (c * x^2) + (d * x * y) + (e1 * y) + (f * y^2) y = g + (h * xx) + (i * xx^2) + (j * xx * y) + (k * y) + (l * y^2) z = x + flip(y) bailout: |z| < @bailout default: title = "Fractalia VI" maxiter = 1000 param ag caption = "a and g" default = (0,0) endparam param bh caption = "b and h" default = (1,-0.2) endparam param ci caption = "c and i" default = (0.5,0.8) endparam param dj caption = "d and j" default = (0.4,0.9) endparam param ek caption = "e and k" default = (-0.7,-0.7) endparam param fl caption = "f and l" default = (0.9,-0.2) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-fractalia-1" bailout = bailout ag = #pixel bh = bh ci = ci dj = dj ek = ek fl = fl } mt-newton-fz-m { ; Mark Townsend, 1 Mar 1999 ; ; Relaxed Newton's method for f(z)+z^n-c ; init: c = #pixel float h = 0.0001 z = fz = zh = oldz = 0 loop: oldz = z zh = z + h fz = @f(z) + z^@n - c z = z - @r * fz / (1 / h * (@f(zh) + zh^@n - c - fz)) bailout: ; I could test fz since we're trying to ; find the solution to fz = 0, but this ; works better with my log smoothing. |z - oldz| > @epsilon default: title = "Newton Function I" center = (-1.5,0) periodicity = 0 param n caption = "Exponent" default = 0.0 endparam param r caption = "Relaxation" default = (1,0) hint = "The suggested range is 0 @epsilon default: title = "Newton Function I Julia" periodicity = 0 param c caption = "Julia seed" default = (0,-1) endparam param n caption = "Exponent" default = 3.0 endparam param r caption = "Relaxation" default = (1,0) hint = "The suggested range is 0 @epsilon default: title = "Newton Error" maxiter = 1000 periodicity = 0 param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam func fn caption = "Transform" default = sqr() hint = "This determines the starting point for z." endfunc switch: type = "mt-newton-error-j" c = #pixel epsilon = epsilon } mt-newton-error-j { ; Mark Townsend, 5 Mar 1999 ; ; This formula is the result of an error while ; trying to implement Newton's method for ; z+(z*c-1)^3 ; init: z = #pixel float h = 0.0001 fz = fzd = oldz = 0 loop: oldz = z fz = z + (z * @c - 1)^3 fzd = 1 / h * (z + ((z + h) * @c - 1)^3 - fz) z = z - fz / fzd bailout: |z - oldz| > @epsilon default: title = "Newton Error Julia" maxiter = 1000 periodicity = 0 param c caption = "Julia seed" default = (-0.5,0) endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam switch: type = "mt-newton-error-m" epsilon = epsilon } mt-secant-zncz { ; Mark Townsend, 6 Mar 1999 ; ; I think I have the Secant method right, ; thanks to an anonymous formula called ; "Secant_z4-1" in the Orgform collection. ; Here I use it on the same expression that ; the Cayley formulas use. ; init: z = #pixel oz = @f(z) fz = fzd = oldz = 0 loop: oldz = z fzd = oz ^ @n - @c * oz + @c - 1 fz = z^@n - @c * z + @c - 1 z = z - fz * (z - oz) / (fz - fzd) oz = oldz bailout: |fz| > @epsilon default: title = "Secant I" periodicity = 0 param c caption = "Julia seed" default = (0,0) endparam param n caption = "Exponent" default = 3.0 endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value" endparam func f caption = "Transform" hint = "This determines how the second initital value \ is derived from the first." default = sin() endfunc switch: type = "mt-secant-zncz" epsilon = epsilon n = n c = #pixel f = f } mt-magnet-II-m { ; Mark Townsend, 16 Mar 1999 ; ; Magnetism Model II from "The Beauty of ; Fractals". This implementation allows you ; to select the "critical value", in other ; words the starting point for z. When z ; starts at sqr(1-q) the resulting set seems ; to be a better "catalogue" of the Julia sets. ; init: q = #pixel if @v == 0 z = 0 else z = sqr(1 - q) endif loop: z = ((z^3+3*(q-1)*z+(q-1)*(q-2))/(3*z^2+3*(q-2)*z+q^2-3*q+3))^2 bailout: |z| < @bailout && |z - 1| > @epsilon default: title = "Magnetism Model II" magn = 0.75 center = (1,0) maxiter = 1000 param v caption = "Critical value" enum = "0" "Sqr(1-q)" default = 1 hint = "This determines the starting point for z." endparam param bailout caption = "Bailout value" default = 1000.0 hint = "This is the bailout value for divergent orbits." endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value for convergent orbits." endparam switch: type = "mt-magnet-II-j" q = #pixel bailout = bailout epsilon = epsilon } mt-magnet-II-j { ; Mark Townsend, 16 Mar 1999 ; ; Magnetism Model II from "The Beauty of ; Fractals" ; init: z = #pixel oldz = 0 loop: oldz = z z = ((z^3+3*(@q-1)*z+(@q-1)*(@q-2))/(3*z^2+3*(@q-2)*z+@q^2-3*@q+3))^2 bailout: |z| < @bailout && |z - oldz| > @epsilon default: title = "Magnetism Model II Julia" maxiter = 1000 magn = 0.125 center = (-1.7,0) periodicity = 0 param q caption = "Julia seed" default = (0,0) endparam param bailout caption = "Bailout value" default = 1000.0 hint = "This is the bailout value for divergent orbits." endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value for convergent orbits." endparam switch: type = "mt-magnet-II-m" bailout = bailout epsilon = epsilon } mt-bof-newton-I-m { ; Mark Townsend, 18 Mar 1999 ; ; Modified Newton's method for ; (z-1)*(z+c)*(z^2+1), from "The Beauty of ; Fractals". ; init: z = 0 c = #pixel float h = 0.0001 fz = zh = oldz = 0 loop: oldz = z zh = z + h fz = (z - 1) * (z + c) * (z^2 + 1) fzd = 1 / h *((zh - 1) * (zh + c) *(zh^2 + 1) - fz) z = z - fz /(fzd + flip(@s)) bailout: |z - oldz| > @epsilon default: title = "Bof Newton I" magn = 0.75 maxiter = 1000 periodicity = 0 param s caption = "Parameter (s)" default = 0.0 hint = "The suggested range is 0 @epsilon default: title = "Bof Newton I Julia" maxiter = 1000 periodicity = 0 param c caption = "Julia seed" default = (0.5,0) endparam param s caption = "Parameter (s)" default = -0.5 hint = "The suggested range is 0 @epsilon default: title = "Bof Newton II" magn = 0.7 maxiter = 1000 periodicity = 0 param s caption = "Parameter (s)" default = 0.0 hint = "The suggested range is 0 @epsilon default: title = "Bof Newton II Julia" maxiter = 1000 periodicity = 0 param c caption = "Julia seed" default = (0.5,0) endparam param s caption = "Parameter (s)" default = 0.0 hint = "The suggested range is 0 @epsilon default: title = "Newton Twist" periodicity = 0 param c caption = "Disturbance" default = (1,1) hint = "The best way to set this value is with \ the Switch feature." endparam param n caption = "Exponent" default = 4.0 hint = "The practical effect of this parameter is \ to change the number of spiral arms." endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam switch: type = "mt-newton-twist" n = n c = #pixel epsilon = epsilon } mt-attractor-julia { ; Mark Townsend, 29 Mar 1999 ; ; Julia sets that bail out when the orbit reaches ; (hopefully) a periodic attractor. I iterate the ; critical point z = (0,0) before the main loop ; and test against the resulting value. In the ; hope of speeding the process up I include ; the option to give up the search when z ; grows too large. ; init: w = 0 u = #pixel int iter = 0 if @no_bail while iter < @max w = w^2 + @c iter = iter + 1 endwhile else while (iter <= @max) && (|u| < 10) w = w^2 + @c u = u^2 + @c iter = iter + 1 endwhile endif z = #pixel loop: z = z^2 + @c bailout: |w - z| > @epsilon && |z| < @bailout default: title = "Attractor Julia" maxiter = 1000 periodicity = 0 param c caption = "Julia seed" default = (-0.12,0.74) endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value for convergent orbits." endparam param bailout caption = "Bailout value" default = 100.0 hint = "This is the bailout value for divergent orbits." endparam param max caption = "Search maxiter" default = 100 hint = "The is the maxiter value for the attractor \ search." endparam param no_bail caption = "Every pixel" default = false hint = "This determines whether to bailout of the attractor \ search when z grows too large. Enable this when the \ image is mainly inside." endparam switch: type = "mt-attractor-m" max = max epsilon = epsilon bailout = bailout no_bail = no_bail } mt-attractor-m { ; Mark Townsend, 29 Mar 1999 ; ; This is just the Mandelbrot set to use as a ; switch to my "Attractor Julia" formula. It ; includes dummy parameters to retain the ; values for the other formula. ; init: z = 0 c = #pixel loop: z = z^2 + c bailout: |z| < @bailout default: title = "Attractor Mandelbrot" center = (-0.5,0) param bailout caption = "Bailout value" default = 100.0 endparam param epsilon caption = "Epsilon" default = 0.0001 hint = "This is a dummy parameter so that the value is not \ lost when switching to and from the Julia sets" endparam param maxiter caption = "Search maxiter" default = 100 hint = "This is a dummy parameter so that the value is not \ lost when switching to and from the Julia sets" endparam param no_bail caption = "Every pixel" default = false hint = "This is a dummy parameter so that the value is not \ lost when switching to and from the Julia sets" endparam switch: type = "mt-attractor-julia" max = max c = #pixel epsilon = epsilon bailout = bailout no_bail = no_bail } mt-newton-onef-m { ; Mark Townsend, 21 Mar 1999 ; ; Newton's method for 1+f(c*z)-c^2 ; init: z = 0 c = #pixel float h = 0.0001 fz = oldz = 0 loop: oldz = z fz = 1 + @f(c * z) - c^2 z = z - fz / (1 / h * ((1 + @f(c * (z + h)) - c^2) - fz)) bailout: |z - oldz| > @epsilon default: title = "Newton Function II" periodicity = 0 param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam func f caption = "Function" default = tanh() endfunc switch: type = "mt-newton-onef-j" c = #pixel f = f epsilon = epsilon } mt-newton-onef-j { ; Mark Townsend, 21 Mar 1999 ; ; Newton's method for 1+f(c*z)-c^2 ; init: z = #pixel float h = 0.0001 fz = oldz = 0 loop: oldz = z fz = 1 + @f(@c * z) - @c^2 z = z - fz / (1 / h*((1 + @f(@c * (z + h)) - @c^2) - fz)) bailout: |z - oldz| > @epsilon default: title = "Newton Function II Julia" periodicity = 0 param c caption = "Julia seed" default = (0,-1) endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam func f caption = "Function" default = sin() endfunc switch: type = "mt-newton-onef-m" f = f epsilon = epsilon } mt-pseudo-magnet { ; Mark Townsend, 8 Apr 1999 ; ; This started out as an attempt to write a ; Newton method fractal from memory. The ; result seems more like a Magnet fractal ; init: ; As ugly as it is, this is about the best ; map of the Julia sets that I could find. z = (@n-1)^(1/@n) c = #pixel loop: z = z - (z^@n - c) / (@n * z) bailout: |z| < @bailout default: title = "Pseudo Magnet" magn = 0.12 center = (1.5,0) maxiter = 1000 param n caption = "Power" default = 3.0 endparam param bailout caption = "Bailout value" default = 1000.0 hint = "This is the bailout value for divergent orbits." endparam switch: type = "mt-pseudo-magnet-j" c = #pixel n =n bailout = bailout epsilon = epsilon } mt-pseudo-magnet-j { ; Mark Townsend, 8 Apr 1999 ; ; This started out as an attempt to write a ; Newton method fractal from memory. The ; result seems more like a Magnet fractal ; init: z = #pixel oldz = 0 loop: oldz = z z = z - (z^@n - @c) / (@n * z) bailout: |z - oldz| > @epsilon && |z| < @bailout default: title = "Pseudo Magnet Julia" magn = 0.4 center = (1.5,0) periodicity = 0 maxiter = 1000 param c caption = "Julia seed" default = (0,0) endparam param n caption = "Power" default = 3.0 endparam param bailout caption = "Bailout value" default = 1000.0 hint = "This is the bailout value for divergent orbits." endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value for convergent orbits." endparam switch: type = "mt-pseudo-magnet" n = n bailout = bailout epsilon = epsilon } mt-newton-9904a-m { ; Mark Townsend, 5 Apr 1999 ; ; Modified Newton's method for (z-1)*(z+c)*(z^2+c). ; init: z = 0 c = #pixel float h = 0.0001 fz = zh = oldz = 0 loop: oldz = z zh = z + h fz = (z - 1) * (z + c) * (z^2 + c) fzd = 1 / h *((zh - 1) * (zh + c) *(zh^2 + c) - fz) z = z - fz /(fzd + flip(@s)) bailout: |z - oldz| > @epsilon default: title = "Newton 9904a" magn = 0.6 maxiter = 1000 periodicity = 0 param s caption = "Parameter (s)" default = 0.0 hint = "Suggested range is 0 @epsilon default: title = "Newton 9904a Julia" maxiter = 1000 periodicity = 0 param c caption = "Julia seed" default = (0.42,.36) endparam param s caption = "Parameter (s)" default = 0.0 hint = "Suggested range is 0 @epsilon default: title = "Newton Mset 1" maxiter = 3000 periodicity = 0 param epsilon caption = "Epsilon" default = 1e-6 endparam switch: type = "mt-newton4-julia" epsilon = epsilon c = #pixel } mt-martin { ; Mark Townsend, 7 May 1999 ; ; Formulas devised by Barry Martin. I found ; them in A. K. Dewdney's "The Armchair ; Universe". They're usually mapped in a ; different way (look at the Fractint ; "Martin" fractal type). ; init: z = 0 p = @fn1(#pixel) float x = real(p) float y = imag(p) float a = @a float xx = 0 loop: xx = x x = y - sin(x) y = a - xx z = @fn2(x + flip(y)) bailout: ; All inside true default: title = "Martin" maxiter = 20 magn = 0.1 param a caption = "Parameter (a)" default = 3.14159 endparam func fn1 caption = "Pre function" default = ident() endfunc func fn2 caption = "Post function" default = ident() endfunc } mt-hopalong { ; Mark Townsend, 8 May 1999 ; ; Formulas devised by Barry Martin. I found ; them in A. K. Dewdney's "The Armchair ; Universe." ; init: z = 0 p = @fn1(#pixel) float x = real(p) float y = imag(p) float xx = 0 int iter = 0 float sgnx = 0 loop: iter = iter + 1 if x < 0 sgnx = -1 else sgnx = 1 endif xx = x x = y - sgnx * (abs(@b * x - @c))^0.5 y = @a - xx z = @fn2(x + flip(y)) bailout: ; All outside but only after a ; certain number of iterations iter < #maxiter default: title = "Hopalong" maxiter = 20 magn = 0.5 param a caption = "Parameter (a)" default = -3.14 endparam param b caption = "Parameter (b)" default = 0.3 endparam param c caption = "Parameter (c)" default = 0.3 endparam func fn1 caption = "Pre function" default = ident() endfunc func fn2 caption = "Post function" default = ident() endfunc } mt-bifunctional-m { ; Mark Townsend, 11 Jun 1999 init: z = 0 c = #pixel float x = 0 float y = 0 loop: x = real(z) y = imag(z) z = @fn1(x) + flip(@fn2(y)) z = z^@n + c bailout: |z| < @bailout default: title = "Bifunctional Mset" param n caption = "Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam func fn1 caption = "Real function" default = sinh() endfunc func fn2 caption = "Imaginary function" default = ident() endfunc switch: type = "mt-bifunctional-j" bailout = bailout c = #pixel fn1 = fn1 fn2 = fn2 n = n } mt-bifunctional-j { ; Mark Townsend, 11 Jun 1999 init: z = #pixel float x = 0 float y = 0 loop: float x = real(z) float y = imag(z) z = @fn1(x) + flip(@fn2(y)) z = z^@n + @c bailout: |z| < @bailout default: title = "Bifunctional Julia" param c caption = "Julia seed" default = (0,0) endparam param n caption = "Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam func fn1 caption = "Real function" default = sinh() endfunc func fn2 caption = "Imaginary function" default = ident() endfunc switch: type = "mt-bifunctional-m" bailout = bailout fn1 = fn1 fn2 = fn2 n = n } mt-gen-celtic-j { ; Mark Townsend, 24 Jun 1999 ; ; From a formula by Paul Carlson ; init: z = #pixel loop: z = z^@n z = z - @fn1(real(z)) + @fn2(real(z)) - @c bailout: |z| < @bailout default: title = "Generalized Celtic Julia" param @c caption = "Julia seed" default = (0,0) endparam param n caption = "Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam func fn1 caption = "First function" default = ident() endfunc func fn2 caption = "Second function" default = abs() endfunc switch: type = "mt-gen-celtic-m" bailout = bailout n = n fn1 = fn1 fn2 = fn2 } mt-gen-celtic-m { ; Mark Townsend, 24 Jun 1999 ; ; From a formula by Paul Carlson ; init: c = #pixel z = 0 loop: z = z^@n z = z - @fn1(real(z)) + @fn2(real(z)) - c bailout: |z| < @bailout default: title = "Generalized Celtic Mset" param n caption = "Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam func fn1 caption = "First function" default = ident() endfunc func fn2 caption = "Second function" default = abs() endfunc switch: type = "mt-gen-celtic-j" c = #pixel n = n bailout = bailout fn1 = fn1 fn2 = fn2 } mt-990625a-m { ; Mark Townsend, 25 Jun 1999 init: z = 0 c = #pixel loop: z = z - z^@n + c bailout: |z| < @bailout default: title = "990625a Mset" param n caption = "Exponent" default = 4.0 endparam param bailout caption = "Bailout value" default = 100.0 endparam switch: type = "mt-990625a-j" c = #pixel bailout = bailout n = n } mt-990625a-j { ; Mark Townsend, 25 Jun 1999 init: z = #pixel loop: z = z - z^@n + @c bailout: |z| < @bailout default: title = "990625a Julia" param c caption = "Julia seed" default = (0,0) endparam param n caption = "Exponent" default = 4.0 endparam param bailout caption = "Bailout value" default = 100.0 endparam switch: type = "mt-990625a-m" bailout = bailout n = n } mt-990625b-j { ; Mark Townsend, 25 Jun 1999 init: z = #pixel loop: z = z^@n + @fn1(real(z) / imag(z)) - @c bailout: |z| < @bailout default: title = "990625b Julia" param c caption = "Julia seed" default = (0,0) endparam param n caption = "Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 100.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "mt-990625b-m" bailout = bailout n = n fn1 = fn1 } mt-990625b-m { ; Mark Townsend, 25 Jun 1999 init: z = #pixel c = #pixel loop: z = z^@n + @fn1(real(z) / imag(z)) - c bailout: |z| < @bailout default: title = "990625b Mset" param n caption = "Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 100.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "mt-990625b-j" bailout = bailout n = n c = #pixel fn1 = fn1 } mt-ifs-dragon-j { ; Mark Townsend, 3 Jun 1999 ; ; Escape time IFS fractal - this one is from ; Fractint.ifs. Modified from a Fractint formula ; created with IfsInv (program by Ramiro Perez). ; init: a0 = 0.82407, b0 = 0.28148, c0 = -0.21235, d0 = 0.86420 a1 = 0.08827, b1 = 0.52099, c1 = -0.46389, d1 = -0.37778 al0 = 0.77193, k0 = 1.59554, l0 = 0.49085 al1 = 0.20833, k1 = 4.51450, l1 = -1.07895 float op0 = 0 float op1 = 0 z = #pixel loop: x = real(z) y = imag(z) o0 = (d0 *x - b0 * y + k0) / al0 + flip((-c0 * x + a0 * y + l0) / al0) op0 = |o0 - @c| o1 = (d1 * x - b1 * y + k1) / al1 + flip((-c1 * x + a1 * y + l1) / al1) op1 = |o1 - @c| if (op0 <= op1) z = o0 else z = o1 endif bailout: |z| <= @bailout default: title = "IFS Dragon Julia" center = (0,4) magn = 0.2 param bailout caption = "Bailout value" default = 1000.0 endparam param c caption = "Julia seed" default = (0,0) endparam switch: type = "mt-ifs-dragon-m" bailout = bailout } mt-ifs-dragon-m { ; Mark Townsend, 3 Jun 1999 ; ; Escape time IFS fractal - this one is from ; Fractint.ifs. Modified from a Fractint formula ; created with IfsInv (program by Ramiro Perez). ; init: a0 = 0.82407, b0 = 0.28148, c0 = -0.21235, d0 = 0.86420 a1 = 0.08827, b1 = 0.52099, c1 = -0.46389, d1 = -0.37778 al0 = 0.77193, k0 = 1.59554, l0 = 0.49085 al1 = 0.20833, k1 = 4.51450, l1 = -1.07895 z = #pixel loop: x = real(z) y = imag(z) o0 = (d0 *x - b0 * y + k0) / al0 + flip((-c0 * x + a0 * y + l0) / al0) op0 = |o0 - #pixel| o1 = (d1 * x - b1 * y + k1) / al1 + flip((-c1 * x + a1 * y + l1) / al1) op1 = |o1 - #pixel| if (op0 <= op1) z = o0 else z = o1 endif bailout: |z| <= @bailout default: title = "IFS Dragon Mset" center = (-2.5,3) magn = 0.2 param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ifs-dragon-j" bailout = bailout c = #pixel } mt-ifs-gills-j { ; Mark Townsend, 31 May 1999 init: a0 = -0.21053, b0 = -0.93117, c0 = -0.31579, d0 = 0.21862 a1 = 0.89474, b1 = -0.23482, d1=0.84615, al0 = -0.34008 k0 = -6.00400, l0 = -2.53258, al1 = 0.75709, k1 = -0.82044 l1 = -0.99777 z = #pixel loop: x = real(z) y = imag(z) o0 = (d0 * x - b0 * y + k0) / al0 + flip((-c0 * x + a0 * y + l0) / al0) op0 = |o0 - @c| o1 = (d1 * x - b1 * y + k1) / al1 + flip((a1 * y + l1) / al1) op1 = |o1 - @c| if (op0 <= op1) z = o0 else z = o1 endif bailout: |z| <= @bailout default: title = "IFS Gills Julia" center = (-2,4) magn = 0.1 param c caption = "Julia seed" default = (0,0) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ifs-03-m" bailout = bailout } mt-ifs-gills-m { ; Mark Townsend, 31 May 1999 init: a0 = -0.21053, b0 = -0.93117, c0 = -0.31579, d0 = 0.21862 a1 = 0.89474, b1 = -0.23482, d1 = 0.84615, al0 = -0.34008 k0 = -6.00400, l0 = -2.53258, al1 = 0.75709, k1 = -0.82044 l1=-0.99777 z = #pixel loop: x = real(z) y = imag(z) o0 = (d0 * x - b0 * y + k0) / al0 + flip((-c0 * x + a0 * y + l0) / al0) op0 = |o0 - #pixel| o1 = (d1 * x - b1 * y + k1) / al1 + flip((a1 * y + l1) / al1) op1 = |o1 - #pixel| if (op0 <= op1) z = o0 else z = o1 endif bailout: |z| <= @bailout default: title = "IFS Gills Mset" center = (-2,4) magn = 0.1 param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ifs-03-j" bailout = bailout c = #pixel } mt-ifs-leaf-j { ; Mark Townsend, 31 May 1999 ; ; Escape time IFS fractal - designed with Fdesign ; (program by Doug Nelson) and modified from a ; Fractint formula created with IfsInv (program by ; Ramiro Perez). ; init: a0 = 0.74546, b0 = -0.36460, c0 = 0.40606, d0 = 0.51996 a1 = -0.42424, b1 = 0.65969, c1 = -0.17576, d1 = -0.41768 al0 = 0.53566, k0 = -0.89714, l0 = -2.47193 al1 = 0.29314, k1 = 4.62115, l1 = 2.78720 z = #pixel loop: x = real(z) y = imag(z) o0 = (d0 * x - b0 * y + k0) / al0 + flip((-c0 * x + a0 * y + l0) / al0) op0 = |o0 - @c| o1 = (d1 * x - b1 * y + k1) / al1 + flip((-c1 * x + a1 * y + l1) / al1) op1 = |o1 - @c| if (op0 <= op1) z = o0 else z = o1 endif bailout: |z| <= @bailout default: title = "IFS Leaf Julia" center = (-0.5,5) magn = 0.2 param @c caption = "Julia seed" default = (0,7) endparam param @bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ifs-leaf-m" bailout = bailout } mt-ifs-leaf-m { ; Mark Townsend, 31 May 1999 ; ; Escape time IFS fractal - designed with Fdesign ; (program by Doug Nelson) and modified from a ; Fractint formula created with IfsInv (program by ; Ramiro Perez). ; init: a0 = 0.74546, b0 = -0.36460, c0 = 0.40606, d0 = 0.51996 a1 = -0.42424, b1 = 0.65969, c1 = -0.17576, d1 = -0.41768 al0 = 0.53566, k0 = -0.89714, l0 = -2.47193 al1 = 0.29314, k1 = 4.62115, l1 = 2.78720 z = #pixel loop: x = real(z) y = imag(z) o0 = (d0 * x - b0 * y + k0) / al0 + flip((-c0 * x + a0 * y + l0) / al0) op0 = |o0 - #pixel| o1 = (d1 * x - b1 * y + k1) / al1 + flip((-c1 * x + a1 * y + l1) / al1) op1 = |o1 - #pixel| if (op0 <= op1) z = o0 else z = o1 endif bailout: |z| <= @bailout default: title = "IFS Leaf Mset" center = (-0.5,5) magn = 0.2 param @bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ifs-leaf-j" bailout = bailout c = #pixel } mt-vine { ; Mark Townsend, 26 Jun 1999 ; ; More variations of Pickover's Popcorn. I took ; the formulas from the sorce code of Rudy Rucker's ; program Vine. ; init: z = 0 float x = real(#pixel) float y = imag(#pixel) float xx = 0 float newx = 0 float newy = 0 int iter = 0 int i = 0 loop: iter = iter + 1 xx = x if @flavor == 0 x = x - @h * sin(y + sin(@a * y )) y = y + @h * sin(xx + sin(@a * xx)) elseif @flavor == 1 x = x - @h * sin(y^@b + sin(@a * y)) y = y + @h * sin(xx^@b + sin(@a * xx)) elseif @flavor == 2 x = x - @h * sin(y + sin(@a * (y + sin(@a * y)))) y = y + @h * sin(xx + sin(@a * (xx + sin(@a * xx)))) else newx = y newy = x i = 0 while i < @flavor i = i + 1 newx = y + sin(@a * newx) newy = x + sin(@a * newy) endwhile x = x - @h * sin(newx) y = y + @h * sin(newy) endif z = x + flip(y) bailout: iter < #maxiter default: title = "Vine" maxiter = 20 magn = 0.15 param flavor caption = "Flavor" default = 0 min = 0 endparam param a caption = "Alpha" default = 2.7 endparam param b caption = "Beta" default = 2.0 hint = "This parameter has an effect only with a \ flavor of 2" endparam param h caption = "Step size" default = 0.1 endparam } mt-sign-i-j { ; Mark Townsend, 26 Jun 1999 init: z = #pixel loop: if real(z) < 0 signx = -1 else signx = 1 endif z = z^2 + signx * @c bailout: |z| < @bailout default: title = "Sign I Julia" param c caption = "Julia seed" default = (0,0) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-sign-i-m" bailout = bailout } mt-sign-i-m { ; Mark Townsend, 26 Jun 1999 init: z = 0 loop: if real(z) < 0 signx = -1 else signx = 1 endif z = z^2 + signx * #pixel bailout: |z| < @bailout default: title = "Sign I Mset" param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-sign-i-j" bailout = bailout c = #pixel } mt-sign-ii-j { ; Mark Townsend, 26 Jun 1999 init: z = #pixel loop: if real(z) < 0 signx = -1 else signx = 1 endif z = signx * z^2 + @c bailout: |z| < @bailout default: title = "Sign II Julia" param c caption = "Julia seed" default = (0,0) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-sign-ii-m" bailout = bailout } mt-sign-ii-m { ; Mark Townsend, 26 Jun 1999 init: z = 0 loop: if real(z) < 0 signx = -1 else signx = 1 endif z = signx * z^2 + #pixel bailout: |z| < @bailout default: title = "Sign II Mset" param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-sign-ii-j" bailout = bailout c = #pixel } mt-biomorph-I-j { ; Mark Townsend, 13 Jul 1999 init: z = #pixel loop: z = @fn1(z) + e^z + @c bailout: |real(z)| < @bailout default: title = "Biomorph I Julia" param c caption = "Julia seed" default = (0,0) endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-biomorph-I-m" fn1 = fn1 bailout = bailout } mt-biomorph-I-m { ; Mark Townsend, 13 Jul 1999 init: z = 0 loop: z = @fn1(z) + e^z + #pixel bailout: |real(z)| < @bailout default: title = "Biomorph I Mset" param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-biomorph-I-j" fn1 = fn1 c = #pixel bailout = bailout } mt-biomorph-II-j { ; Mark Townsend, 13 Jul 1999 init: z = #pixel loop: z = z^z + z^(@n) + @c bailout: |real(z)| < @bailout default: title = "Biomorph II Julia" param c caption = "Julia seed" default = (0,0) endparam param n caption = "Coefficient" default = 5.0 endparam param bailout caption = "Bailout value" default = 10.0 endparam switch: type = "mt-biomorph-II-m" n = n bailout = bailout } mt-biomorph-II-m { ; Mark Townsend, 13 Jul 1999 init: z = 0 loop: z = z^z + z^(@n) + #pixel bailout: |z| < @bailout default: title = "Biomorph II Mset" param n caption = "Coefficient" default = 6.0 endparam param bailout caption = "Bailout value" default = 10.0 endparam switch: type = "mt-biomorph-II-j" c = #pixel n = n bailout = bailout } mt-dynamic { ; Mark Townsend, 6 Jul 1999 init: x = real(#pixel) y = imag(#pixel) a = real(@a) b = imag(@a) xx = 0 int iter = 0 loop: iter = iter + 1 xx = x x = x - a * @fn1(y) y = y - b * @fn2(xx) z = x + flip(y) bailout: iter < #maxiter default: title = "Dynamic" maxiter = 20 magn = 0.15 param a caption = "Parameter" default = (1,1) endparam } mt-ring-j { ; Mark Townsend, 11 Jul 1999 init: z = #pixel s = 0 loop: z = z^@n + @c + s s = |cabs(z)-@rad| bailout: |z| < @bailout default: title = "Ring Julia" param c caption = "Julia seed" default = (0,0) endparam param n caption = "Exponent" default = 2.0 endparam param rad caption = "Radius" default = 0.5 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ring-m" rad = rad n = n bailout = bailout } mt-ring-m { ; Mark Townsend, 11 Jul 1999 init: z = 0 s = 0 loop: z = z^@n + #pixel + s s = |cabs(z)-@rad| bailout: |z| < @bailout default: title = "Ring Mset" param n caption = "Exponent" default = 2.0 endparam param rad caption = "Radius" default = 0.5 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-ring-j" rad = rad n = n bailout = bailout c = #pixel } mt-newton4-julia { ; Mark Townsend, 20 Jul 1999 ; ; Julia version of Newton Mset 1, from the Paul Carlson ; formula. ; init: c = @c #z = #pixel loop: z2 = z * z z3 = z * z2 z4 = z * z3 err = (z4 + (c - 1)*z2 - c) / (4 * z3 + 2*(c - 1) * z) z = z - err bailout: |Err| > @epsilon default: title = "Newton Julia" maxiter = 3000 periodicity = 0 param c caption = "Julia seed" default = (0,0) endparam param epsilon caption = "Epsilon" default = 1e-6 endparam switch: type = "CNewtonMset1" epsilon = epsilon } mt-990725a { ; Mark Townsend 25 Jul 1999 init: z = 0 int iter = 0 loop: z = z^iter + iter * #pixel iter = iter + 1 bailout: |z| < @bailout default: title = "990725a" param bailout caption = "Bailout value" default = 1000.0 endparam } mt-modulate-j { ; Mark Townsend, 25 Jul 1999 init: z = #pixel int iter = 0 loop: iter = iter + 1 z = z^2 + ((iter % @m)* @c) bailout: |z| < @bailout default: title = "Modulate Julia" param c caption = "Julia seed" default = (-0.7,0) endparam param m caption = "Modulate" default = 3 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-modulate-m" m = m bailout = bailout } mt-990801a-j { ; Mark Townsend, 1 Aug 1999 init: z = #pixel loop: z = z^@e1 - z^@e2 + @c bailout: |z| < @bailout default: title = "990801a Julia" param c caption = "Julia seed" default = (0,0) endparam param e1 caption = "First exponent" default = 2.0 endparam param e2 caption = "Second exponent" default = -2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-990801a-m" e1 = e1 e2 = e2 bailout = bailout } mt-990801a-m { ; Mark Townsend, 1 Aug 1999 init: z = 0 c = #pixel loop: z = z^@e1 - z^@e2 + c bailout: |z| < @bailout default: title = "990801a Mset" param e1 caption = "First exponent" default = 2.0 endparam param e2 caption = "Second exponent" default = -2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-990801a-j" e1 = e1 e2 = e2 bailout = bailout c = #pixel } mt-modulate-m { ; Mark Townsend, 25 Jul 1999 init: z = 0 int iter = 0 loop: iter = iter + 1 z = z^2 + ((iter % @m)* #pixel) bailout: |z| < @bailout default: title = "Modulate Mset" param m caption = "Modulate" default = 3 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-modulate-j" m = m c = #pixel bailout = bailout } mt-990807a-m { ; Mark Townsend, Aug 7 1999 init: z = 0 c = #pixel loop: z = @fn1(c*z^@e1) + @fn2(z^@e2) + c bailout: |z| < @bailout default: title = "990807a Mset" param e1 caption = "First exponent" default = 4.0 endparam param e2 caption = "Second exponent" default = 2.0 endparam func fn1 default = ident() endfunc func fn2 default = ident() endfunc param bailout caption = "Bailout value" default = 1000.0 endparam func fn1 caption = "First Function" default = ident() endfunc func fn2 caption = "Second Function" default = ident() endfunc switch: type = "mt-990807a-j" e1 = e1 e2 = e2 fn1 = fn1 fn2 = fn2 bailout = bailout c = #pixel } mt-990807a-j { ; Mark Townsend, Aug 7 1999 init: z = #pixel c = @c loop: z = @fn1(c*z^@e1) + @fn2(z^@e2) + c bailout: |z| < @bailout default: title = "990807a Julia" param c caption = "Julia seed" default = (-0.6,0.43) endparam param e1 caption = "First exponent" default = 4.0 endparam param e2 caption = "Second exponent" default = 2.0 endparam func fn1 caption = "First Function" default = ident() endfunc param bailout caption = "Bailout value" default = 1000.0 endparam func fn2 caption = "Second Function" default = ident() endfunc switch: type = "mt-990807a-m" e1 = e1 e2 = e2 fn1 = fn1 fn2 = fn2 bailout = bailout } mt-990807b-m { ; Mark Townsend, Aug 7 1999 init: z = 0 c = #pixel loop: z = @fn1(c*z^@e1) + @fn2(-c*z^@e2) + c bailout: |z| < @bailout default: title = "990807b Mset" param e1 caption = "First exponent" default = 3.0 endparam param e2 caption = "Second exponent" default = 1.0 endparam func fn1 default = ident() endfunc func fn2 default = ident() endfunc param bailout caption = "Bailout value" default = 1000.0 endparam func fn1 caption = "First Function" default = ident() endfunc func fn2 caption = "Second Function" default = ident() endfunc switch: type = "mt-990807b-j" e1 = e1 e2 = e2 fn1 = fn1 fn2 = fn2 bailout = bailout c = #pixel } mt-990807b-j { ; Mark Townsend, Aug 7 1999 init: z = #pixel c = @c loop: z = @fn1(c*z^@e1) + @fn2(-c*z^@e2) + c bailout: |z| < @bailout default: title = "990807b Julia" param c caption = "Julia seed" default = (1.2,0) endparam param e1 caption = "First exponent" default = 3.0 endparam param e2 caption = "Second exponent" default = 1.0 endparam func fn1 caption = "First Function" default = ident() endfunc param bailout caption = "Bailout value" default = 1000.0 endparam func fn2 caption = "Second Function" default = ident() endfunc switch: type = "mt-990807b-m" e1 = e1 e2 = e2 fn1 = fn1 fn2 = fn2 bailout = bailout } mt-druid-m { ; Mark Townsend, 29 Oct 1999 ; ; Switching between iterations of the Celtic Julia ; and the Standard Julia ; init: c = #pixel z = 0 int iter = @first loop: if iter % 2 == 0 z = z^@m + c else z = z^@n z = z - real(z) + abs(real(z)) + c endif iter = iter + 1 bailout: |z| < @bailout default: title = "Druid Mset" center = (-0.5, 0) param @first caption = "First set" enum = "Mandelbrot" "Celtic" endparam param m caption = "Standard Exponent" default = 2.0 endparam param n caption = "Celtic Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-druid-j" c = #pixel n = n m = m bailout = bailout first = first } mt-druid-j { ; Mark Townsend, 29 Oct 1999 ; ; Switching between iterations of the Celtic Julia ; and the Standard Julia ; init: z = #pixel int iter = @first loop: if iter % 2 == 0 z = z^@m + @c else z = z^@n z = z - real(z) + abs(real(z)) + @c endif iter = iter + 1 bailout: |z| < @bailout default: title = "Druid Julia" param first caption = "First set" enum = "Julia" "Celtic" endparam param @c caption = "Julia seed" default = (0,0) endparam param m caption = "Standard Exponent" default = 2.0 endparam param n caption = "Celtic Exponent" default = 2.0 endparam param bailout caption = "Bailout value" default = 1000.0 endparam switch: type = "mt-druid-m" bailout = bailout n = n m = m first = first } mt-advanced-gnarl { ; Mark Townsend, 17 Nov 1999 ; ; Last update 15 December 1999 ; init: z = 0 bool test = true float m = 590872612825179551336102196593.0 float a = 1322939 float c = 7336919 float ar1 = trunc(real(@a_seed)) float ar2 = trunc(imag(@a_seed)) float br1 = trunc(real(@b_seed)) float br2 = trunc(imag(@b_seed)) float gr1 = trunc(real(@g_seed)) float gr2 = trunc(imag(@g_seed)) float seqr = @seqseed float acoef1 = real(@a1) float bcoef1 = real(@b1) float gcoef1 = real(@g1) float acoef2 = real(@a2) float bcoef2 = real(@b2) float gcoef2 = real(@g2) float ra1 = imag(@a1) float rb1 = imag(@b1) float rg1 = imag(@g1) float ra2 = imag(@a2) float rb2 = imag(@b2) float rg2 = imag(@g2) int iter = 0 float xx = 0 float x = real(#pixel) float y = imag(#pixel) loop: ; "Random" numbers. if imag(@a1) != 0 ar1 = (a * ar1 + c) % m acoef1 = real(@a1) + (ar1 / m) * ra1 endif if imag(@b1) != 0 br1 = (a * br1 + c) % m bcoef1 = real(@b1) + (br1 / m) * rb1 endif if imag(@g1) != 0 gr1 = (a * gr1 + c) % m gcoef1 = real(@g1) + (gr1 / m) * rg1 endif if imag(@a2) != 0 ar2 = (a * ar2 + c) % m acoef2 = real(@a2) + (ar2 / m) * ra2 endif if imag(@b2) != 0 br2 = (a * br2 + c) % m bcoef2 = real(@b2) + (br2 / m) * rb2 endif if imag(@g2) != 0 gr2 = (a * gr2 + c) % m gcoef2 = real(@g2) + (gr2 / m) * rg2 endif if @seq == 0 ; Iteration test = iter % real(@mv) < imag(@mv) elseif @seq == 1 ; Random seqr = (a * seqr + c) % m if seqr % 2 == 0 test = true else test = false endif elseif @seq == 2 ; First formula test = true elseif @seq == 3 ; Second formula test = false endif xx = x if test x = x - @h * real(@af1(acoef1 * y + \ @bf1(bcoef1 * (y + @gf1(gcoef1 * y))))) y = y + @h * real(@af1(acoef1 * xx +\ @bf1(bcoef1 * (xx + @gf1(gcoef1 * xx))))) else x = x - @h * real(@af2(acoef2 * y + \ @bf2(bcoef2 * (y + @gf2(gcoef2 * y))))) y = y + @h * real(@af2(acoef2 * xx + \ @bf2(bcoef2 * (xx + @gf2(gcoef2 * xx))))) endif z = x + flip(y) iter = iter + 1 bailout: iter < #maxiter default: title = "Advanced Gnarl" helpfile = "mt.hlp" helptopic = "Advanced Gnarl" $IFDEF VER30 precision = 12 $ENDIF maxiter = 20 magn = 0.5 param seq caption = "Sequence" enum = "Modulation" "Random" "First formula" \ "Second formula" endparam param mv caption = "Modulation" default = (10,5) min = (1,0) endparam param a1 caption = "A 1" default = (1.0,0) endparam param b1 caption = "B 1" default = (3.0,0) endparam param g1 caption = "G 1" default = (2.0,0) endparam param a2 caption = "A 2" default = (1.0,0) endparam param b2 caption = "B 2" default = (3.0,0) endparam param g2 caption = "G 2" default = (2.0,0) endparam param h caption = "Step size" default = 0.1 endparam param a_seed caption = "A seed" default = (3539,9923) endparam param b_seed caption = "B seed" default = (6373,8191) endparam param g_seed caption = "G seed" default = (1277,4583) endparam param seqseed caption = "Sequence seed" default = 2017 endparam func af1 caption = "A 1" default = sin() endfunc func bf1 caption = "B 1" default = sin() endfunc func gf1 caption = "G 1" default = sin() endfunc func af2 caption = "A 2" default = cos() endfunc func bf2 caption = "B 2" default = cos() endfunc func gf2 caption = "G 2" default = cos() endfunc } mt-latoocarfian-ii { ; Mark Townsend 18 Dec 1999 init: float xnew = 0 float ynew = 0 float a = real(@ab) float b = imag(@ab) float c = real(@cd) float d = imag(@cd) float x = real(#pixel) float y = imag(#pixel) loop: xnew = sin(y * b) + c * sin(x * b) ynew = sin(x * a) + d * sin(y * a) x = xnew y = ynew #z = x + flip(y) bailout: |#z - #pixel| > @epsilon default: title = "Latööcarfian II" magn = 0.5 param ab caption = "(a, b)" default = (-0.966918, 2.879879) endparam param cd caption = "(c, d)" default = (0.765145, 0.744728) endparam param epsilon caption = "Epsilon" default = 1.0 endparam } mt-latoocarfian-iii { ; Mark Townsend 19 Dec 1999 ; ; The Latööcarfian equations from Pickover's book ; "Chaos in Wonderland". Use Damien M. Jones' "Sampling" ; for the Inside coloring method. ; init: float xnew = 0 float ynew = 0 float a = real(@ab) float b = imag(@ab) float c = real(@cd) float d = imag(@cd) float x = 0.1 float y = 0.1 loop: xnew = sin(y * b) + c * sin(x * b) ynew = sin(x * a) + d * sin(y * a) x = xnew y = ynew #z = x + flip(y) bailout: true default: title = "Latööcarfian III" param ab caption = "(a, b)" default = (-0.966918, 2.879879) endparam param cd caption = "(c, d)" default = (0.765145, 0.744728) endparam } mt-popcorn { ; Mark Townsend, 8 May 1999 ; ; This is another gift to us from Clifford ; Pickover. I found the equation in A. K. ; Dewdney's "The Magic Machine." This formula ; is similar to Popcorn Julia, except that I ; don't impose a bailout condition. ; ; Last update on 30 December 1999 ; init: z = 0 p = @fn1(#pixel / @scale) float x = real(p) float y = imag(p) float xx = 0 int iter = 0 loop: iter = iter + 1 xx = x x = x - @h * sin(y + tan(3 * y)) y = y - @h * sin(xx + tan(3 * xx)) z = @fn2(x + flip(y)) bailout: ; All outside but only after a ; certain number of iterations iter < #maxiter default: title = "Popcorn" maxiter = 20 magn = 0.5 param h caption = "Step Size" default = 0.05 endparam param scale caption = "Scale" default = 1.0 endparam func fn1 caption = "Pre function" default = ident() endfunc func fn2 caption = "Post function" default = ident() endfunc } mt-gnarl { ; Mark Townsend, 15 Aug 1999 ; ; Yet more variations of Pickover's Popcorn. ; ; Last update on 31 December 1999 ; init: z = 0 p = #pixel / @scale float x = real(p) float y = imag(p) float xx = 0 int iter = 0 loop: iter = iter + 1 xx = x x = x - @h * real(@fn1(y + @fn2(@a * (y + @fn3(@b * y))))) y = y + @h * real(@fn1(xx + @fn2(@a * (xx + @fn3(@b * xx))))) z = x + flip(y) bailout: iter < #maxiter default: title = "Gnarl" maxiter = 20 magn = 0.15 param a caption = "Alpha" default = 2.7 endparam param b caption = "Beta" default = 2.7 endparam param h caption = "Step size" default = 0.1 endparam param scale caption = "Scale" default = 1.0 endparam func fn1 caption = "First Function" default = sin() endfunc func fn2 caption = "Second Function" default = sin() endfunc func fn3 caption = "Third Function" default = sin() endfunc } mt-popcorn-mset { ; Mark Townsend, 30 January 2000 ; ; An "Mset" version of Pickover's Popcorn. ; init: z = 0 float cr = real(#pixel) float ci = imag(#pixel) float x = real(@start) float y = imag(@start) float xx = 0 int iter = 0 loop: iter = iter + 1 xx = x x = x - @h * sin(y + tan(cr * y)) y = y - @h * sin(xx + tan(ci * xx)) z = @fn2(x + flip(y)) bailout: ; All outside but only after a ; certain number of iterations iter < #maxiter default: title = "Popcorn Mset" maxiter = 20 magn = 0.25 param start caption = "Starting Point" default = (1,0.75) endparam param h caption = "Step Size" default = 0.05 endparam } mt-gnarl-mset { ; Mark Townsend, 30 January 1999 ; ; Mset version of Gnarl. ; init: z = 0 float a = real(#pixel) float b = imag(#pixel) float x = real(@start) float y = imag(@start) float xx = 0 int iter = 0 loop: iter = iter + 1 xx = x x = x - @h * real(@fn1(y + @fn2(a * (y + @fn3(b * y))))) y = y + @h * real(@fn1(xx + @fn2(a * (xx + @fn3(b * xx))))) z = x + flip(y) bailout: iter < #maxiter default: title = "Gnarl Mset" maxiter = 20 magn = 0.25 param start caption = "Starting Point" default = (2.7, 2.7) endparam param h caption = "Step size" default = 0.1 endparam func fn1 caption = "First Function" default = sin() endfunc func fn2 caption = "Second Function" default = sin() endfunc func fn3 caption = "Third Function" default = sin() endfunc } mt-reverse { ; Mark Townsend, 7 May 2000 init: z = #pixel oldz = 0 loop: oldz = z z = sqrt(z - @c) bailout: |z - oldz| > @bailout default: title = "Reverse" periodicity = 0 param c caption = "Julia Seed" endparam param bailout caption = "Bailout Value" default = 1e-6 endparam switch: type = "mt-reverse" c = #pixel bailout = bailout } mt-zeepop-j { ; Mark Townsend, 7 May 2000 init: z = #pixel oldz = 0 loop: oldz = z z = z - @h * @fn1(z + @fn2(@c * z)) bailout: |z| < @bailout && |z - oldz| > @epsilon default: title = "Zeepop Julia" periodicity = 0 param c caption = "Julia Seed" default = (3,0) endparam param h caption = "Step Size" default = (0.1,0) endparam param bailout caption = "Bailout Value" default = 100.0 endparam param epsilon caption = "Epsilon" default = 1e-6 endparam func fn1 caption = "Function #1" default = sin() endfunc func fn2 caption = "Function #1" default = tan() endfunc switch: type = "mt-zeepop-m" h = h fn1 = fn1 fn2 = fn2 bailout = bailout epsilon = epsilon } mt-zeepop-m { ; Mark Townsend, 7 May 2000 init: c = #pixel z = sqr(1 - #pixel) oldz = 0 loop: oldz = z z = z - @h * @fn1(z + @fn2(c * z)) bailout: |z - oldz| > @epsilon default: title = "Zeepop Mset" periodicity = 0 param h caption = "Step Size" default = (0.1,0) endparam param bailout caption = "Bailout Value" default = 100 endparam param epsilon caption = "Epsilon" default = 1e-6 endparam func fn1 caption = "Function #1" default = sin() endfunc func fn2 caption = "Function #1" default = tan() endfunc switch: type = "mt-zeepop-j" c = #pixel h = h fn1 = fn1 fn2 = fn2 bailout = bailout epsilon = epsilon } mt-barnsleyish-j { ; Mark Townsend, 12 May 2000 init: z = #pixel loop: if real(z) >= @threshold z = @fn1(z + 1) * -@c else z = @fn1(z - 1) * @c endif bailout: |z| < @bailout default: title = "Barnsleyish Julia" param c caption = "Julia Seed" default = (0.8, 1.05) endparam param threshold caption = "Threshold" default = 0.0 endparam param bailout caption = "Bailout Value" default = 4.0 endparam func fn1 caption = "Function" default = cos() endfunc switch: type = "mt-barnsleyish-m" bailout = bailout threshold = threshold fn1 = fn1 } mt-barnsleyish-m { ; Mark Townsend, 12 May 2000 init: z = 0 loop: if real(z) >= @threshold z = @fn1(z + 1) * -#pixel else z = @fn1(z - 1) * #pixel endif bailout: |z| < @bailout default: title = "Barnsleyish Mset" param threshold caption = "Threshold" default = 0.0 endparam param bailout caption = "Bailout Value" default = 4.0 endparam func fn1 caption = "Function" default = cos() endfunc switch: type = "mt-barnsleyish-j" bailout = bailout threshold = threshold c = #pixel fn1 = fn1 } mt-rudys-cubic { ; Mark Townsend, 17 May 2001 ; From a Fractint formula that I wrote in January 1999 init: #z = #pixel k3 = @p2 * 3 loop: #z = @fn1(#z^3) - k3 * #z + @c bailout: |#z|< @bailout default: title = "Rudy's Cubic (Julia)" param c caption = "Julia Seed" default = (0.3, 0.6) endparam param p2 caption = "Coefficient" default = (0.36, 0.18) endparam param bailout caption = "Bailout Value" default = 1e20 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "mt-rudys-cubic-m" bailot = balout p2 = #pixel fn1 = fn1 } mt-rudys-cubic-m { ; Mark Townsend, 17 May 2001 ; From a Fractint formula that I wrote in January 1999 init: #z = #pixel k3 = @p2 * 3 loop: #z = @fn1(#z^3) - k3 * #z + #pixel bailout: |#z|< @bailout default: title = "Rudy's Cubic (Mandelbrot)" param p2 caption = "Coefficient" endparam param bailout caption = "Bailout Value" default = 100.0 endparam func fn1 caption = "Function" default = ident() endfunc switch: type = "mt-rudys-cubic" bailot = balout p2 = p2 c = #pixel fn1 = fn1 } mt-jewel-newton-j { ; Mark Townsend, 30 April 2008 init: z = #pixel float h = 0.0001 oldz = 0 loop: oldz = z zh = z + h z = z - (z^@p_power + z + @c) / (1 / h * ((zh^@p_power + zh + @c) - (z^@p_power + z + @c))) bailout: |z - oldz| > @epsilon default: title = "Jewel Newton Julia" maxiter = 1000 periodicity = 0 param c caption = "Seed" default = (-0.83, 1.44) endparam param p_power caption = "Power" default = 4 min = 3 endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam switch: type = "mt-jewel-newton-m" p_power = p_power epsilon = epsilon } mt-jewel-newton-m { ; Mark Townsend, 30 April 2008 init: z = 0 c = #pixel float h = 0.0001 oldz = 0 loop: oldz = z zh = z + h z = z - (z^@p_power + z + c) / (1 / h * ((zh^@p_power + zh + c) - (z^@p_power + z + c))) bailout: |z - oldz| > @epsilon default: title = "Jewel Newton" magn = 0.7 maxiter = 1000 periodicity = 0 param p_power caption = "Power" default = 4 min = 3 endparam param epsilon caption = "Epsilon" default = 1e-6 hint = "This is the bailout value." endparam switch: type = "mt-jewel-newton-j" c = #pixel p_power = p_power epsilon = epsilon } mt-dynamical-systems { ; Mark Townsend, September 2018 init: import "mt.ulb" MT_DynamicalFunction XFunc = new @XFuncParam MT_DynamicalFunction YFunc = new @YFuncParam z = 0 float xx = real(#pixel) float yy = imag(#pixel) float xnew = 0 float ynew = 0 int iter = 0 float n = 0 ; dummy for noise param loop: iter = iter + 1 if @dual_functions xnew = xx - @h * XFunc.f(yy, xx, n) ynew = yy + @h * YFunc.f(xx, yy, n) else xnew = xx - @h * XFunc.f(yy, xx, n) ynew = yy + @h * XFunc.f(xx, yy, n) endif xx = xnew yy = ynew z = xx + flip(yy) bailout: iter < #maxiter default: title = "Dynamical Systems" maxiter = 20 magn = 0.5 param h caption = "Step Size" default = 0.05 min = 0.00001 endparam bool param dual_functions caption = "Dual Functions" default = false endparam MT_DynamicalFunction param XFuncParam caption = "X Function" endparam MT_DynamicalFunction param YFuncParam caption = "Y Function" visible = @dual_functions endparam }