ContinuedFractions { init: z = @init(#pixel) complex w = 0 loop: if (@iterfunc(z) != 0) w = z z = @a + @b/@iterfunc(z) endif bailout: (|z| < 1E20) && (@iterfunc(z) != 0) && !(@test1 && |z - w| < @convergence) switch: type = "ContinuedFractionsJulia" seed = #pixel init = @init bailout = @bailout a = @a b = @b test1 = @test1 convergence = @convergence iterfunc = @iterfunc default: param bailout caption = "Bail Out" default = 1E20 endparam param a caption = "a" default = (1.0,0.0) endparam param b caption = "b" default = (1.0, 0.0) endparam param test1 caption = "Convergence Test" default = false hint = "Turn this to test whether or not the formula converges for a given value of z." endparam param convergence caption = "Convergence Value" default = 1E-5 hint = "When the difference between successive iterations of z fall below this value, bail out" endparam func init caption = "Initial function" default = ident() hint = "This function is applied to z first." endfunc func iterfunc caption = "Iterated function" default = ident() hint = "this function is applied at every step in the iteration." endfunc periodicity = 0 maxiter = 100 title = "Continued Fractions" } ContinuedFractionsJulia { init: z = @init(#pixel) complex w = 0 loop: if (@iterfunc(z) + @seed != 0) w = z z = @a + @b/(@iterfunc(z) + @seed) endif bailout: (|z| < 1E20) && (@iterfunc(z) + @seed != 0) && !(@test1 && |z - w| < @convergence) default: param bailout caption = "Bail Out" default = 1E20 endparam param seed caption ="Seed" hint = "Vary this number to choose different Julia sets." default = (1.0, 0.0) endparam param a caption = "a" default = (1.0,0.0) endparam param b caption = "b" default = (1.0, 0.0) endparam param test1 caption = "Convergence Test" default = false hint = "Turn this to test whether or not the formula converges for a given value of z." endparam param convergence caption = "Convergence Value" default = 1E-5 hint = "When the difference between successive iterations of z fall below this value, bail out" endparam func init caption = "Initial Function" default = ident() hint = "This function is applied to z first." endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at each iteration." endfunc title = "Continued Fractions Julia" periodicity = 0 } ContinuedFractionsV2 { init: z = @init(#pixel) complex w = 0 bool continueon = true loop: if (@iterfunc(z) != 0) w = z z = @a + @b/@iterfunc(z) endif if @test1 && |z-w| <= @convergence continueon = false endif bailout: (|z| < 1E20) && (@iterfunc(z) != 0) && continueon switch: type = "ContinuedFractionsJulia1" seed = #pixel init = @init bailout = @bailout b = @b test1 = @test1 convergence = @convergence iterfunc = @iterfunc default: param bailout caption = "Bail Out" default = 1E20 endparam param a caption = "a" default = (1.0,0.0) endparam param b caption = "b" default = (1.0, 0.0) endparam param test1 caption = "Convergence Test" default = true hint = "Turn this to test whether or not the formula converges for a given value of z." endparam param convergence caption = "Convergence Value" default = 1E-3 hint = "When the difference between successive iterations of z fall below this value, bail out" endparam func init caption = "Initial function" default = ident() hint = "This function is applied to z first." endfunc func iterfunc caption = "Iterated function" default = ident() hint = "this function is applied at every step in the iteration." endfunc periodicity = 0 maxiter = 100 title = "Continued Fractions V2.0" } ContinuedFractionsJulia1 { init: z = @init(#pixel) complex w = 0 bool continueon = true loop: if (@iterfunc(z) != 0) w = z z = @seed + @b/(@iterfunc(z)) endif if @test1 && |z-w| < @convergence continueon = false endif bailout: (|z| < 1E20) && (@iterfunc(z) != 0) && continueon switch: type = "ContinuedFractionsJulia2" seed = @seed seed2 = #pixel init = @init bailout = @bailout test1 = @test1 convergence = @convergence iterfunc = @iterfunc default: param bailout caption = "Bail Out" default = 1E20 endparam param seed caption ="Seed" hint = "Vary this number to choose different Julia sets." default = (1.0, 0.0) endparam param b caption = "b" default = (1.0, 0.0) endparam param test1 caption = "Convergence Test" default = false hint = "Turn this to test whether or not the formula converges for a given value of z." endparam param convergence caption = "Convergence Value" default = 1E-5 hint = "When the difference between successive iterations of z fall below this value, bail out" endparam func init caption = "Initial Function" default = ident() hint = "This function is applied to z first." endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at each iteration." endfunc title = "Continued Fractions Julia 1" periodicity = 0 } ContinuedFractionsJulia2 { init: z = @init(#pixel) complex w = 0 bool continueon = true loop: if (@iterfunc(z) != 0) w = z z = @seed + @seed2/(@iterfunc(z)) endif if @test1 && |z-w| < @convergence continueon=false endif bailout: (|z| < 1E20) && (@iterfunc(z) != 0) && continueon default: param bailout caption = "Bail Out" default = 1E20 endparam param seed caption ="Seed 1" hint = "Vary this number to choose different Julia sets." default = (1.0, 0.0) endparam param seed2 caption = "Seed 2" default = (1.0, 0.0) endparam param test1 caption = "Convergence Test" default = false hint = "Turn this to test whether or not the formula converges for a given value of z." endparam param convergence caption = "Convergence Value" default = 1E-3 hint = "When the difference between successive iterations of z fall below this value, bail out" endparam func init caption = "Initial Function" default = ident() hint = "This function is applied to z first." endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at each iteration." endfunc title = "Continued Fractions Julia 2" periodicity = 0 } CF3 { init: complex x0 = @a complex x1 = @b complex y0 = @c complex y1 = @d complex mult = @init(#pixel) complex x2 = (0,0) complex y2 = (0,0) complex w = (0,0) int convCount = 0 float convBailout = 0.0 if @ConvType == 0 convCount = 3 convBailout = 1E-4 elseif @ConvType == 1 convCount = 5 convBailout = 1E-6 else convCount = 7 convBailout = 1E-8 endif w = 0 float olddelta = 1E20 int count = 0 bool continueon = true loop: w = z x2 = @f1(mult*x1 + x0) y2 = @f2(mult*y1 + y0) if (x2 != 0) z = y2/x2 endif float delta = |z - w| if delta <= olddelta count = count + 1 else count = 0 endif olddelta = delta x0 = x1 x1 = x2 y0 = y1 y1 = y2 if (delta <= convBailout && count >= convCount) || delta < 1E-20 continueon = false endif bailout: |z| < 1E20 && |x0| < 1E20 && |x1| < 1E20 && |y0| < 1E20 && |y1| < 1E20 && x2 != 0 && continueon switch: type = "CF3-Julia1" seed1 = #pixel b = @b c = @c d = @d init = @init convType = @convType maxiter = maxiter periodicity = periodicity f1 = @f1 f2 = @f2 default: title = "CF3" periodicity = 0 maxiter = 100 param a caption ="A" default = (0.0, 0.0) endparam param b caption = "B" default = (1.0, 0.0) endparam param c caption = "C" default = (1.0,0.0) endparam param d caption = "D" default = (1.0,0.0) endparam func init caption = "Initial Function" default = abs() endfunc func f1 caption = "F1" default = ident() endfunc func f2 caption = "F2" default = ident() endfunc param ConvType caption = "Convergence Type" enum = "Loose" "Strict" "Strictest" default = 0 endparam } CF3-Julia1 { init: complex x0 = @seed1 complex x1 = @b complex y0 = @c complex y1 = @d complex mult = @init(#pixel) complex x2 = (0,0) complex y2 = (0,0) complex w = (0,0) int convCount = 0 float convBailout = 0.0 if @ConvType == 0 convCount = 3 convBailout = 1E-4 elseif @ConvType == 1 convCount = 5 convBailout = 1E-6 else convCount = 7 convBailout = 1E-8 endif w = 0 complex olddelta = 1E20 int count = 0 bool continueon = true loop: w = z x2 = @f1(mult*x1 + x0) y2 = @f2(mult*y1 + y0) if (x2 != 0) z = y2/x2 endif delta = |z - w| if delta <= olddelta count = count + 1 else count = 0 endif olddelta = delta x0 = x1 x1 = x2 y0 = y1 y1 = y2 if (delta <= convBailout && count >= convCount) || delta < 1E-20 continueon = false endif bailout: |z| < 1E20 && |x0| < 1E20 && |x1| < 1E20 && |y0| < 1E20 && |y1| < 1E20 && x2 != 0 && continueon switch: type = "CF3-Julia2" seed1 = @seed1 seed2 = #pixel c = @c d = @d init = @init convType = @convType maxiter = maxiter periodicity = periodicity f1 = @f1 f2 = @f2 default: title = "CF3-Julia1" periodicity = 0 maxiter = 100 param seed1 caption ="Seed 1" default = (0.0, 0.0) endparam param b caption = "B" default = (1.0, 0.0) endparam param c caption = "C" default = (1.0,0.0) endparam param d caption = "D" default = (1.0,0.0) endparam func init caption = "Initial Function" default = abs() endfunc func f1 caption = "F1" default = ident() endfunc func f2 caption = "F2" default = ident() endfunc param ConvType caption = "Convergence Type" enum = "Loose" "Strict" "Strictest" default = 0 endparam } CF3-Julia2 { init: complex x0 = @seed1 complex x1 = @seed2 complex y0 = @c complex y1 = @d complex mult = @init(#pixel) complex x2 = (0,0) complex y2 = (0,0) complex w = (0,0) int convCount = 0 float convBailout = 0.0 if @ConvType == 0 convCount = 3 convBailout = 1E-4 elseif @ConvType == 1 convCount = 5 convBailout = 1E-6 else convCount = 7 convBailout = 1E-8 endif w = 0 complex olddelta = 1E20 int count = 0 bool continueon = true loop: w = z x2 = @f1(mult*x1 + x0) y2 = @f2(mult*y1 + y0) if (x2 != 0) z = y2/x2 endif delta = |z - w| if delta <= olddelta count = count + 1 else count = 0 endif olddelta = delta x0 = x1 x1 = x2 y0 = y1 y1 = y2 if (delta <= convBailout && count >= convCount) || delta < 1E-20 continueon = false endif bailout: |z| < 1E20 && |x0| < 1E20 && |x1| < 1E20 && |y0| < 1E20 && |y1| < 1E20 && x2 != 0 && continueon switch: type = "CF3-Julia3" seed1 = @seed1 seed2 = @seed2 seed3 = #pixel d = @d init = @init convType = @convType maxiter = maxiter periodicity = periodicity f1 = @f1 f2 = @f2 default: title = "CF3-Julia2" periodicity = 0 maxiter = 100 param seed1 caption ="Seed 1" default = (0.0, 0.0) endparam param seed2 caption = "Seed 2" default = (1.0, 0.0) endparam param c caption = "C" default = (1.0,0.0) endparam param d caption = "D" default = (1.0,0.0) endparam func init caption = "Initial Function" default = abs() endfunc func f1 caption = "F1" default = ident() endfunc func f2 caption = "F2" default = ident() endfunc param ConvType caption = "Convergence Type" enum = "Loose" "Strict" "Strictest" default = 0 endparam } CF3-Julia3 { init: complex x0 = @seed1 complex x1 = @seed2 complex y0 = @seed3 complex y1 = @d complex mult = @init(#pixel) complex x2 = (0,0) complex y2 = (0,0) complex w = (0,0) int convCount = 0 float convBailout = 0.0 if @ConvType == 0 convCount = 3 convBailout = 1E-4 elseif @ConvType == 1 convCount = 5 convBailout = 1E-6 else convCount = 7 convBailout = 1E-8 endif w = 0 complex olddelta = 1E20 int count = 0 bool continueon = true loop: w = z x2 = @f1(mult*x1 + x0) y2 = @f2(mult*y1 + y0) if (x2 != 0) z = y2/x2 endif delta = |z - w| if delta <= olddelta count = count + 1 else count = 0 endif olddelta = delta x0 = x1 x1 = x2 y0 = y1 y1 = y2 if (delta <= convBailout && count >= convCount) || delta < 1E-20 continueon = false endif bailout: |z| < 1E20 && |x0| < 1E20 && |x1| < 1E20 && |y0| < 1E20 && |y1| < 1E20 && x2 != 0 && continueon switch: type = "CF3-Julia4" seed1 = @seed1 seed2 = @seed2 seed3 = @seed3 seed4 = #pixel init = @init convType = @convType maxiter = maxiter periodicity = periodicity f1 = @f1 f2 = @f2 default: title = "CF3-Julia3" periodicity = 0 maxiter = 100 param seed1 caption ="Seed 1" default = (0.0, 0.0) endparam param seed2 caption = "Seed 2" default = (1.0, 0.0) endparam param seed3 caption = "Seed 3" default = (1.0,0.0) endparam param d caption = "D" default = (1.0,0.0) endparam func init caption = "Initial Function" default = abs() endfunc func f1 caption = "F1" default = ident() endfunc func f2 caption = "F2" default = ident() endfunc param ConvType caption = "Convergence Type" enum = "Loose" "Strict" "Strictest" default = 0 endparam } CF3-Julia4 { init: complex x0 = @seed1 complex x1 = @seed2 complex y0 = @seed3 complex y1 = @seed4 complex mult = @init(#pixel) complex x2 = (0,0) complex y2 = (0,0) complex w = (0,0) int convCount = 0 float convBailout = 0.0 if @ConvType == 0 convCount = 3 convBailout = 1E-4 elseif @ConvType == 1 convCount = 5 convBailout = 1E-6 else convCount = 7 convBailout = 1E-8 endif w = 0 complex olddelta = 1E20 int count = 0 bool continueon = true loop: w = z x2 = @f1(mult*x1 + x0) y2 = @f2(mult*y1 + y0) if (x2 != 0) z = y2/x2 endif delta = |z - w| if delta <= olddelta count = count + 1 else count = 0 endif olddelta = delta x0 = x1 x1 = x2 y0 = y1 y1 = y2 if (delta <= convBailout && count >= convCount) || delta < 1E-20 continueon = false endif bailout: |z| < 1E20 && |x0| < 1E20 && |x1| < 1E20 && |y0| < 1E20 && |y1| < 1E20 && x2 != 0 && continueon default: title = "CF3-Julia4" periodicity = 0 maxiter = 100 param seed1 caption ="Seed 1" default = (0.0, 0.0) endparam param seed2 caption = "Seed 2" default = (1.0, 0.0) endparam param seed3 caption = "Seed 3" default = (1.0,0.0) endparam param seed4 caption = "Seed 4" default = (1.0,0.0) endparam func init caption = "Initial Function" default = abs() endfunc func f1 caption = "F1" default = ident() endfunc func f2 caption = "F2" default = ident() endfunc param ConvType caption = "Convergence Type" enum = "Loose" "Strict" "Strictest" default = 0 endparam } CantorBoostMandel { ;Based on Damien Jones' Orbit Boost init: z = 0 bool found = false int k = 0 float r = 0 float den = 0 int i = 1 int j = 1 int rem = 0 float realcoord = 0.0 float imagcoord = 0.0 int range = 2 complex cc = (0.0,0.0) float left = real(@center) - @radius float bottom = imag(@center) - @radius float d = 0 float iradius = 0 float r2 = 0 loop: found = false k = 0 i = 1 j = 1 range = 2 z = (@iterfunc(z))^@p + #pixel while k < @iters && !found den = 6*3^k if k != 0 range = range*3 endif r = @radius/den r2 = r*r iradius = 1/r i = 1 while i < range j = 1 if (i % 3) != 0 while j < range if (j % 3) != 0 realcoord = 2*i*@radius/range + left imagcoord = 2*j*@radius/range + bottom cc = realcoord + flip(imagcoord) d = |z - cc| if d < r2 found = true endif endif if found j = range else j = j + 2 endif endwhile endif if found i = range else i = i + 2 endif endwhile if !found k = k + 1 endif endwhile if found && @orbittype == 0 rem = k % 4 if rem == 0 IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ENDIF elseif rem == 1 IF (@boostmode2 == 1); displace (addition) z = z + @boostamount2 ELSEIF (@boostmode2 == 2); orbit origin (multiply) z = z * @boostamount2 ELSEIF (@boostmode2 == 3); orbit boost (multiply) z = (z-cc) * @boostamount2 + cc ELSEIF (@boostmode2 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 6); exponentiate origin (exponent) z = z ^ @boostamount2 ELSEIF (@boostmode2 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount2 + cc ELSEIF (@boostmode2 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode2 == 9); pass through z = z + 2*(z-cc)*@boostamount2 ELSEIF (@boostmode2 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount2 ENDIF elseif rem == 2 IF (@boostmode3 == 1); displace (addition) z = z + @boostamount3 ELSEIF (@boostmode3 == 2); orbit origin (multiply) z = z * @boostamount3 ELSEIF (@boostmode3 == 3); orbit boost (multiply) z = (z-cc) * @boostamount3 + cc ELSEIF (@boostmode3 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 6); exponentiate origin (exponent) z = z ^ @boostamount3 ELSEIF (@boostmode3 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount3 + cc ELSEIF (@boostmode3 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode3 == 9); pass through z = z + 2*(z-cc)*@boostamount3 ELSEIF (@boostmode3 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount3 ENDIF else IF (@boostmode4 == 1); displace (addition) z = z + @boostamount4 ELSEIF (@boostmode4 == 2); orbit origin (multiply) z = z * @boostamount4 ELSEIF (@boostmode4 == 3); orbit boost (multiply) z = (z-cc) * @boostamount4 + cc ELSEIF (@boostmode4 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 6); exponentiate origin (exponent) z = z ^ @boostamount4 ELSEIF (@boostmode4 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount4 + cc ELSEIF (@boostmode4 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode4 == 9); pass through z = z + 2*(z-cc)*@boostamount4 ELSEIF (@boostmode4 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount4 ENDIF endif endif if !found && @orbittype == 1 r = @radius cc = @center iradius = 1.0/r IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ENDIF endif bailout: |z| < @bailout switch: seed = #pixel boostmode1 = @boostmode1 boostamount1 = @boostamount1 boostmode2 = @boostmode2 boostamount2 = @boostamount2 boostmode3 = @boostmode3 boostamount3 = @boostamount3 boostmode4 = @boostmode4 boostamount4 = @boostamount4 init = @init p = @p iterfunc = @iterfunc bailout = @bailout center = @center radius = @radius type = "CantorBoostJulia" orbittype = @orbittype iters = @iters default: param center caption = "Center" default = (-0.75,0) endparam param radius caption = "Radius" default = 3.0 endparam param orbittype caption = "Type" enum = "Inside" "Outside" endparam param p caption = "Power" default = (2,0) hint = "Default is Mandelbrot set" endparam param iters caption = "Iterations" default = 2 endparam param bailout caption = "Bail Out" default = 1.0E20 endparam func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." endfunc func init caption = "Initial Function" default = ident() hint = "This function is applied only at the beginning." endfunc param boostmode1 caption = "Boost Mode 1" default = 1 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters the largest circle of the Cantor Set." endparam param boostamount1 caption = "Boost Amount 1" default = (0.5,0.0) hint = "This is the amount to boost for the main circle of the Cantor Set." endparam param boostmode2 caption = "Boost Mode 2" default = 10 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters one of the 4 smaller circles of the Cantor Set." endparam param boostamount2 caption = "Boost Amount 2" default = (2,0.0) hint = "This is the amount to boost for the next 4 smaller circles." endparam param boostmode3 caption = "Boost Mode 3" default = 3 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters one of the 16 smaller circles." endparam param boostamount3 caption = "Boost Amount 3" default = (3,0) hint = "This is the amount to boost for the 16 smaller circles." endparam param boostmode4 caption = "Boost Mode 4" default = 4 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters one of the 64 smaller circles." endparam param boostamount4 caption = "Boost Amount 4" default = (4,0) hint = "This is the amount to boost for the 64 smaller circles." endparam title = "CantorBoostMandel" maxiter = 100 periodicity = 0 } CantorBoostJulia { init: z = @init(#pixel) bool found = false int k = 0 complex c = @seed float r = 0 float den = 0 int i = 1 int j = 1 int rem = 0 float realcoord = 0.0 float imagcoord = 0.0 int range = 2 complex cc = (0.0,0.0) float left = real(@center) - @radius float bottom = imag(@center) - @radius float d = 0 float iradius = 0 float r2 = 0 loop: found = false i = 1 j = 1 k = 0 range = 2 z = (@iterfunc(z))^@p + c while k < @iters && !found den = 6*3^k if k != 0 range = range*3 endif r = @radius/den r2 = r*r iradius = 1/r i = 1 while i < range j = 1 if i % 3 != 0 while j < range if (j % 3 != 0) realcoord = 2*i*@radius/range + left imagcoord = 2*j*@radius/range + bottom cc = realcoord + flip(imagcoord) d = |z - cc| if d < r2 found = true endif endif if found j = range else j = j + 2 endif endwhile endif if found i = range else i = i + 2 endif endwhile if !found k = k + 1 endif endwhile if found && @orbittype == 0 rem = k % 4 if rem == 0 IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ENDIF elseif rem == 1 IF (@boostmode2 == 1); displace (addition) z = z + @boostamount2 ELSEIF (@boostmode2 == 2); orbit origin (multiply) z = z * @boostamount2 ELSEIF (@boostmode2 == 3); orbit boost (multiply) z = (z-cc) * @boostamount2 + cc ELSEIF (@boostmode2 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 6); exponentiate origin (exponent) z = z ^ @boostamount2 ELSEIF (@boostmode2 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount2 + cc ELSEIF (@boostmode2 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode2 == 9); pass through z = z + 2*(z-cc)*@boostamount2 ELSEIF (@boostmode2 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount2 ENDIF elseif rem == 2 IF (@boostmode3 == 1); displace (addition) z = z + @boostamount3 ELSEIF (@boostmode3 == 2); orbit origin (multiply) z = z * @boostamount3 ELSEIF (@boostmode3 == 3); orbit boost (multiply) z = (z-cc) * @boostamount3 + cc ELSEIF (@boostmode3 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 6); exponentiate origin (exponent) z = z ^ @boostamount3 ELSEIF (@boostmode3 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount3 + cc ELSEIF (@boostmode3 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode3 == 9); pass through z = z + 2*(z-cc)*@boostamount3 ELSEIF (@boostmode3 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount3 ENDIF else IF (@boostmode4 == 1); displace (addition) z = z + @boostamount4 ELSEIF (@boostmode4 == 2); orbit origin (multiply) z = z * @boostamount4 ELSEIF (@boostmode4 == 3); orbit boost (multiply) z = (z-cc) * @boostamount4 + cc ELSEIF (@boostmode4 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 6); exponentiate origin (exponent) z = z ^ @boostamount4 ELSEIF (@boostmode4 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount4 + cc ELSEIF (@boostmode4 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode4 == 9); pass through z = z + 2*(z-cc)*@boostamount4 ELSEIF (@boostmode4 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount4 ENDIF endif endif if !found && @orbittype == 1 r = @radius cc = @center iradius = 1.0/r IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ENDIF endif bailout: |z| < @bailout default: param seed caption = "Julia Seed" default = (0,-1) endparam param center caption = "Center" default = (0,0) endparam param radius caption = "Radius" default = 2.0 endparam param orbittype caption = "Type" enum = "Inside" "Outside" endparam param p caption = "Power" default = (2,0) hint = "Default is Mandelbrot set" endparam param iters caption = "Iterations" default = 3 endparam param bailout caption = "Bail Out" default = 1.0E20 endparam func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." endfunc func init caption = "Initial Function" default = ident() hint = "This function is applied only at the beginning." endfunc param boostmode1 caption = "Boost Mode 1" default = 1 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters the largest circle of the Cantor Set." endparam param boostamount1 caption = "Boost Amount 1" default = (1,0) hint = "This is the amount to boost for the main circle of the Cantor Set." endparam param boostmode2 caption = "Boost Mode 2" default = 2 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters one of the 4 smaller circles of the Cantor Set." endparam param boostamount2 caption = "Boost Amount 2" default = (2,0) hint = "This is the amount to boost for the next 4 smaller circles." endparam param boostmode3 caption = "Boost Mode 3" default = 3 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters one of the 16 smaller circles." endparam param boostamount3 caption = "Boost Amount 3" default = (3,0) hint = "This is the amount to boost for the 16 smaller circles." endparam param boostmode4 caption = "Boost Mode 4" default = 4 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" hint = "Sets the type of effect when the orbit enters one of the 64 smaller circles." endparam param boostamount4 caption = "Boost Amount 4" default = (4,0) hint = "This is the amount to boost for the 64 smaller circles." endparam title = "CantorBoostJulia" maxiter = 100 periodicity = 0 } CantorBoostMandel-UF3 { ;Based on Damien Jones' Orbit Boost ;Calculates a 2D equivalent of the Cantor Middle Third Set ;depending on which circle an iteration falls into, the formula boosts it global: float left = real(@center) - @radius float bottom = imag(@center) - @radius float right = real(@center) + @radius float top = imag(@center) + @radius ; float radius2 = @radius*@radius complex candr[round((1-4^@iters)/(-3)),4] ;this matrix will hold the set of centers and radii int k = 0 int idx = 0 float den = 0 int range = 2 float r1 = 0 int i = 1 int j = 1 int inc = 2 float realcoord = 0.0 float imagcoord = 0.0 while k < @iters den = 3^(k+1) i = 1 if k != 0 range = range*3 endif r1 = @radius/den while i < range j = 1 if (i % 3) != 0 while j < range if (j % 3) != 0 realcoord = i/range*(right-left) + left imagcoord = j/range*(top-bottom) + bottom int idx3 = 0 complex newcenter = realcoord + flip(imagcoord) bool found2 = false while idx3 < idx if realcoord != real(candr[idx3,0]) if cabs(realcoord - real(candr[idx3,0])) <= real(candr[idx3,1]) found2 = true endif endif if imagcoord != imag(candr[idx3,0]) if cabs(imagcoord - imag(candr[idx3,0])) <= real(candr[idx3,1]) found2 = true endif endif idx3 = idx3 + 1 endwhile if !found2 candr[idx,0] = newcenter candr[idx,1] = r1 candr[idx,2] = r1*r1 candr[idx,3] = k % 4 idx = idx + 1 endif endif j = j + inc endwhile endif i = i + inc endwhile k = k + 1 endwhile int totaliters = idx init: z = 0 bool found = false int rem = 0 complex cc = (0.0,0.0) float d = 0 float iradius = 0 float r = 0 float r2 = 0 loop: found = false int idx2 = 0 z = (@iterfunc(z))^@p + #pixel complex relz = z - @center if abs(real(relz)) <= @radius && abs(imag(relz)) <= @radius while idx2 < totaliters && !found r = real(candr[idx2,1]) r2 = real(candr[idx2,2]) iradius = 1/r d = | z - candr[idx2,0] | if d < r2 found = true endif if !found idx2 = idx2 + 1 endif endwhile endif if found && @orbittype == 0 rem = round(real(candr[idx2,3])) if rem == 0 IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ELSEIF (@boostmode1 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount1 ENDIF elseif rem == 1 IF (@boostmode2 == 1); displace (addition) z = z + @boostamount2 ELSEIF (@boostmode2 == 2); orbit origin (multiply) z = z * @boostamount2 ELSEIF (@boostmode2 == 3); orbit boost (multiply) z = (z-cc) * @boostamount2 + cc ELSEIF (@boostmode2 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 6); exponentiate origin (exponent) z = z ^ @boostamount2 ELSEIF (@boostmode2 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount2 + cc ELSEIF (@boostmode2 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode2 == 9); pass through z = z + 2*(z-cc)*@boostamount2 ELSEIF (@boostmode2 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount2 ELSEIF (@boostmode2 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount2 ENDIF elseif rem == 2 IF (@boostmode3 == 1); displace (addition) z = z + @boostamount3 ELSEIF (@boostmode3 == 2); orbit origin (multiply) z = z * @boostamount3 ELSEIF (@boostmode3 == 3); orbit boost (multiply) z = (z-cc) * @boostamount3 + cc ELSEIF (@boostmode3 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 6); exponentiate origin (exponent) z = z ^ @boostamount3 ELSEIF (@boostmode3 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount3 + cc ELSEIF (@boostmode3 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode3 == 9); pass through z = z + 2*(z-cc)*@boostamount3 ELSEIF (@boostmode3 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount3 ELSEIF (@boostmode3 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount3 ENDIF else IF (@boostmode4 == 1); displace (addition) z = z + @boostamount4 ELSEIF (@boostmode4 == 2); orbit origin (multiply) z = z * @boostamount4 ELSEIF (@boostmode4 == 3); orbit boost (multiply) z = (z-cc) * @boostamount4 + cc ELSEIF (@boostmode4 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 6); exponentiate origin (exponent) z = z ^ @boostamount4 ELSEIF (@boostmode4 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount4 + cc ELSEIF (@boostmode4 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode4 == 9); pass through z = z + 2*(z-cc)*@boostamount4 ELSEIF (@boostmode4 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount4 ELSEIF (@boostmode4 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount4 ENDIF endif endif if !found && @orbittype == 1 r = @radius cc = @center iradius = 1.0/r IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ELSEIF (@boostmode1 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount1 ENDIF endif bailout: |z| < @bailout switch: seed = #pixel boostmode1 = @boostmode1 boostamount1 = @boostamount1 boostmode2 = @boostmode2 boostamount2 = @boostamount2 boostmode3 = @boostmode3 boostamount3 = @boostamount3 boostmode4 = @boostmode4 boostamount4 = @boostamount4 init = @init p = @p iterfunc = @iterfunc bailout = @bailout center = @center radius = @radius type = "CantorBoostJulia-UF3" orbittype = @orbittype iters = @iters default: param center caption = "Center" default = (-0.75,0) endparam param radius caption = "Radius" default = 3.0 endparam param orbittype caption = "Type" enum = "Inside" "Outside" endparam param p caption = "Power" default = (2,0) hint = "Default is Mandelbrot set" endparam param iters caption = "Sub-Divisions" default = 2 min = 1 endparam param bailout caption = "Bail Out" default = 1.0E20 endparam func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." endfunc func init caption = "Initial Function" default = ident() hint = "This function is applied only at the beginning." endfunc param boostmode1 caption = "Boost Mode 1" default = 1 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters the largest circle of the Cantor Set." endparam param boostamount1 caption = "Boost Amount 1" default = (0.5,0.0) hint = "This is the amount to boost for the main circle of the Cantor Set." endparam param boostmode2 caption = "Boost Mode 2" default = 10 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters one of the 4 smaller circles of the Cantor Set." visible = @iters > 1 endparam param boostamount2 caption = "Boost Amount 2" default = (2,0.0) hint = "This is the amount to boost for the next 4 smaller circles." visible = @iters > 1 endparam param boostmode3 caption = "Boost Mode 3" default = 3 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters one of the 16 smaller circles." visible = @iters > 2 endparam param boostamount3 caption = "Boost Amount 3" default = (3,0) hint = "This is the amount to boost for the 16 smaller circles." visible = @iters > 2 endparam param boostmode4 caption = "Boost Mode 4" default = 4 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters one of the 64 smaller circles." visible = @iters > 3 endparam param boostamount4 caption = "Boost Amount 4" default = (4,0) hint = "This is the amount to boost for the 64 smaller circles." visible = @iters > 3 endparam title = "CantorBoostMandel-UF3" maxiter = 100 periodicity = 0 method = multipass } CantorBoostJulia-UF3 { ;Based on Damien Jones' Orbit Boost ;Calculates a 2D equivalent of the Cantor Middle Third Set ;depending on which circle an iteration falls into, the formula boosts it global: float left = real(@center) - @radius float bottom = imag(@center) - @radius float right = real(@center) + @radius float top = imag(@center) + @radius ; float radius2 = @radius*@radius complex candr[round((1-4^@iters)/(-3)),4] ;this matrix will hold the set of centers and radii int k = 0 int idx = 0 float den = 0 int range = 2 float r1 = 0 int i = 1 int j = 1 int inc = 2 float realcoord = 0.0 float imagcoord = 0.0 while k < @iters den = 3^(k+1) i = 1 if k != 0 range = range*3 endif r1 = @radius/den while i < range j = 1 if (i % 3) != 0 while j < range if (j % 3) != 0 realcoord = i/range*(right-left) + left imagcoord = j/range*(top-bottom) + bottom int idx3 = 0 complex newcenter = realcoord + flip(imagcoord) bool found2 = false while idx3 < idx if realcoord != real(candr[idx3,0]) if cabs(realcoord - real(candr[idx3,0])) <= real(candr[idx3,1]) found2 = true endif endif if imagcoord != imag(candr[idx3,0]) if cabs(imagcoord - imag(candr[idx3,0])) <= real(candr[idx3,1]) found2 = true endif endif idx3 = idx3 + 1 endwhile if !found2 candr[idx,0] = newcenter candr[idx,1] = r1 candr[idx,2] = r1*r1 candr[idx,3] = k % 4 idx = idx + 1 endif endif j = j + inc endwhile endif i = i + inc endwhile k = k + 1 endwhile int totaliters = idx init: z = #pixel bool found = false int rem = 0 complex cc = (0.0,0.0) float d = 0 float iradius = 0 float r = 0 float r2 = 0 loop: found = false int idx2 = 0 z = (@iterfunc(z))^@p + @seed complex relz = z - @center if abs(real(relz)) <= @radius && abs(imag(relz)) <= @radius while idx2 < totaliters && !found r = real(candr[idx2,1]) r2 = real(candr[idx2,2]) iradius = 1/r d = | z - candr[idx2,0] | if d < r2 found = true endif if !found idx2 = idx2 + 1 endif endwhile endif if found && @orbittype == 0 rem = round(real(candr[idx2,3])) if rem == 0 IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ELSEIF (@boostmode1 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount1 ENDIF elseif rem == 1 IF (@boostmode2 == 1); displace (addition) z = z + @boostamount2 ELSEIF (@boostmode2 == 2); orbit origin (multiply) z = z * @boostamount2 ELSEIF (@boostmode2 == 3); orbit boost (multiply) z = (z-cc) * @boostamount2 + cc ELSEIF (@boostmode2 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount2 ELSEIF (@boostmode2 == 6); exponentiate origin (exponent) z = z ^ @boostamount2 ELSEIF (@boostmode2 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount2 + cc ELSEIF (@boostmode2 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode2 == 9); pass through z = z + 2*(z-cc)*@boostamount2 ELSEIF (@boostmode2 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount2 ELSEIF (@boostmode2 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount2 ENDIF elseif rem == 2 IF (@boostmode3 == 1); displace (addition) z = z + @boostamount3 ELSEIF (@boostmode3 == 2); orbit origin (multiply) z = z * @boostamount3 ELSEIF (@boostmode3 == 3); orbit boost (multiply) z = (z-cc) * @boostamount3 + cc ELSEIF (@boostmode3 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount3 ELSEIF (@boostmode3 == 6); exponentiate origin (exponent) z = z ^ @boostamount3 ELSEIF (@boostmode3 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount3 + cc ELSEIF (@boostmode3 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode3 == 9); pass through z = z + 2*(z-cc)*@boostamount3 ELSEIF (@boostmode3 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount3 ELSEIF (@boostmode3 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount3 ENDIF else IF (@boostmode4 == 1); displace (addition) z = z + @boostamount4 ELSEIF (@boostmode4 == 2); orbit origin (multiply) z = z * @boostamount4 ELSEIF (@boostmode4 == 3); orbit boost (multiply) z = (z-cc) * @boostamount4 + cc ELSEIF (@boostmode4 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount4 ELSEIF (@boostmode4 == 6); exponentiate origin (exponent) z = z ^ @boostamount4 ELSEIF (@boostmode4 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount4 + cc ELSEIF (@boostmode4 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode4 == 9); pass through z = z + 2*(z-cc)*@boostamount4 ELSEIF (@boostmode4 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount4 ELSEIF (@boostmode4 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount4 ENDIF endif endif if !found && @orbittype == 1 r = @radius cc = @center iradius = 1.0/r IF (@boostmode1 == 1); displace (addition) z = z + @boostamount1 ELSEIF (@boostmode1 == 2); orbit origin (multiply) z = z * @boostamount1 ELSEIF (@boostmode1 == 3); orbit boost (multiply) z = (z-cc) * @boostamount1 + cc ELSEIF (@boostmode1 == 4); flip out (reverse distance) d = 2*r/sqrt(d)-1 z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 5); repel (reverse distance squared) d = 1-sqr(1-r/sqrt(d)) z = cc + (z-cc)*d*@boostamount1 ELSEIF (@boostmode1 == 6); exponentiate origin (exponent) z = z ^ @boostamount1 ELSEIF (@boostmode1 == 7); exponentiate boost (exponent) z = (z-cc) ^ @boostamount1 + cc ELSEIF (@boostmode1 == 8); invert z = conj(iradius/(z-cc)) + cc ELSEIF (@boostmode1 == 9); pass through z = z + 2*(z-cc)*@boostamount1 ELSEIF (@boostmode1 == 10); pass through 2 z = z + 2*(cc-z)/cabs(cc-z)*r*@boostamount1 ELSEIF (@boostmode1 == 11) ;counterclockwise turn complex newz = -imag(z-cc)+ flip(real(z-cc)) z = z + newz*@boostamount1 ENDIF endif bailout: |z| < @bailout switch: seed = #pixel boostmode1 = @boostmode1 boostamount1 = @boostamount1 boostmode2 = @boostmode2 boostamount2 = @boostamount2 boostmode3 = @boostmode3 boostamount3 = @boostamount3 boostmode4 = @boostmode4 boostamount4 = @boostamount4 init = @init p = @p iterfunc = @iterfunc bailout = @bailout center = @center radius = @radius type = "CantorBoostJulia-UF3" orbittype = @orbittype iters = @iters default: param seed caption = "Julia Seed" endparam param center caption = "Center" default = (-0.75,0) endparam param radius caption = "Radius" default = 3.0 endparam param orbittype caption = "Type" enum = "Inside" "Outside" endparam param p caption = "Power" default = (2,0) hint = "Default is Mandelbrot set" endparam param iters caption = "Sub-Divisions" default = 2 min = 1 endparam param bailout caption = "Bail Out" default = 1.0E20 endparam func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." endfunc func init caption = "Initial Function" default = ident() hint = "This function is applied only at the beginning." endfunc param boostmode1 caption = "Boost Mode 1" default = 1 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters the largest circle of the Cantor Set." endparam param boostamount1 caption = "Boost Amount 1" default = (0.5,0.0) hint = "This is the amount to boost for the main circle of the Cantor Set." endparam param boostmode2 caption = "Boost Mode 2" default = 10 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters one of the 4 smaller circles of the Cantor Set." visible = @iters > 1 endparam param boostamount2 caption = "Boost Amount 2" default = (2,0.0) hint = "This is the amount to boost for the next 4 smaller circles." visible = @iters > 1 endparam param boostmode3 caption = "Boost Mode 3" default = 3 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters one of the 16 smaller circles." visible = @iters > 2 endparam param boostamount3 caption = "Boost Amount 3" default = (3,0) hint = "This is the amount to boost for the 16 smaller circles." visible = @iters > 2 endparam param boostmode4 caption = "Boost Mode 4" default = 4 enum = "none" "displace" "orbit origin" "orbit boost" "flip out" "repel" \ "exponentiate origin" "exponentiate boost" "invert" "pass through" \ "pass through 2" "turn cc" hint = "Sets the type of effect when the orbit enters one of the 64 smaller circles." visible = @iters > 3 endparam param boostamount4 caption = "Boost Amount 4" default = (4,0) hint = "This is the amount to boost for the 64 smaller circles." visible = @iters > 3 endparam title = "CantorBoostJulia-UF3" maxiter = 100 periodicity = 0 method = multipass } ContinuedFractions-UF3-V1.0 { ; Mark Hammond, 8-28-02 ; Another formula based on the ideas of continued fractions ; In this one we compute the continued fraction expansion of a number ; to a user specified number of terms. ; The formula then becomes f(z) = a1 + 1/(a2 + 1/(a3 -...))) - target global: complex expansion[@numterms] complex target = (0.0,0.0) int totalterms=0 if @typeof == 0 target = #pi elseif @typeof == 1 target = exp(1.0) elseif @typeof == 2 if imag(@userdef) != 0 target = abs(real(@userdef))/abs(imag(@userdef)) else target = real(@userdef)*1.0E10 endif elseif @typeof == 3 target = 1.0 int idx = 0 while idx < @numterms target = 1 + 1.0/target idx = idx + 1 endwhile else target = @usercomplex endif target = abs(@targetfunc(target^@power)) complex newtarget=target while totalterms < @numterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile int convCount = 0 float convDelta = 0.0 if @attractors if @convcheck == 0 convCount = 3 convDelta = 1.0E-3 elseif @convcheck == 1 convCount = 5 convDelta = 1.0E-6 elseif @convcheck == 2 convCount = 7 convDelta = 1.0E-9 else convCount = 9 convDelta = 1.0E-12 endif endif init: z = @init(#pixel) int i = totalterms - 1 complex newz = z int count = 0 float olddelta=1.0E20 complex oldz = z bool done = false if @flavor == 3 || @flavor == 4 if z != 0 z = 1.0/z else i = -1 z = target endif endif loop: done = false if @flavor == 2 if z != 0 z = 1.0/z else z = target i = 0 endif endif if (@flavor == 3 || @flavor == 4) && i >= 0 int newi = 0 if @useoneterm if @termtouse <= @numterms - 1 newi = @termtouse else newi = @numterms - 1 endif else newi=i endif if @flavorDReversed newi = totalterms - 1 - i endif newz = @iterfunc(z) + @seed if newz != 0 if @flavor == 3 z = expansion[newi] + 1.0/newz else z = expansion[newi] + target/newz endif i = i - 1 else i = 0 endif else while i >= 0 newz = @iterfunc(z) + @seed if newz != 0 z = expansion[i] + 1.0/newz else z = target endif i = i - 1 endwhile endif if (@flavor == 3 || @flavor == 4) && i == 0 done = true endif if @flavor == 0 z = z - target endif if @attractors float delta = |z - oldz| if delta <= olddelta && delta <= convDelta count = count + 1 else count = 0 endif if count >= convCount done = true endif if @convcheck == 3 && delta == 0 done = true endif olddelta = delta oldz = z endif bailout: |z| < @bailout && !done default: param numterms caption = "Number of Terms" hint = "Number of terms in the continued fraction expansion of the target number." default = 15 min = 1 endparam param typeof caption = "Type" enum = "Apple Pie" "Eeeeee" "What I want" "Golden Mean" "Complex" default = 0 Hint = "Apple Pie = Use pi^power as a target value. \ Eeeee = use e^power as a target value \ What I want = User defined fraction raised to power is target. \ Complex = User chosen complex number raised to power is target." endparam param flavor caption = "Flavor" enum = "A" "B" "C" "D" "E" default = 3 endparam param flavorDReversed caption = "Flavor reversed." default = false visible = @flavor == 3 || @flavor == 4 endparam param useoneterm caption = "Use One Term" default = true visible = (@flavor == 3 || @flavor == 4) && !@flavorDReversed hint = "Uses an arbitray term of the continued fraction expansion vs all." endparam param termtouse caption = "Term To Use" default = 0 hint = "Which term of the fraction to use" min = 0 visible = @useoneterm endparam param power caption = "Power" default = 1.0 hint = "Target number is raised to this power before performing expansion." endparam param userdef caption = "User Defined Number" default = (610.0, 377.0) hint = "Use your favorite fraction here." visible = @typeof == 2 endparam param usercomplex caption = "Complex Value" default = (3.14159, 0.01) hint = "This value is used to generate the continued fraction expansion." visible = @typeof == 4 endparam param seed caption = "Seed" default = (0.0, 0.0) hint = "Perturbs the fractal." endparam func targetfunc caption = "Target function" default = ident() hint = "Function is applied to target number before computing continued fraction expansion." endfunc param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" endparam func init caption = "Initial function" default = ident() hint = "This function is applied to each pixel before loop." endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." endfunc func fracfunc caption = "Fraction Function" default = ident() hint = "This function is applied to every term in the continued fraction expansion." endfunc param attractors caption = "Attractors" default = false hint = "If turned on the formula will bail out when it detects a point converging." endparam param convcheck caption = "Convergence Checking" enum = "Loose" "Strict" "Strictest" "Even Stricter" hint = "Determines how formula decides an attractor." visible = @attractors endparam maxiter = 32 title = "ContinuedFractions-UF3-V1.0" periodicity = 0 method = multipass switch: ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. type = "ContinuedFractions-UF3-V1.0" seed = #pixel maxiter = maxiter precision = precision periodicity = periodicity typeof = @typeof flavor = @flavor power = @power userdef = @userdef targetfunc = @targetfunc bailout = @bailout init = @init iterfunc = @iterfunc attractors = @attractors convcheck = @convcheck fracfunc = @fracfunc flavorDReversed = @flavorDReversed useoneterm = @useoneterm termtouse = @termtouse method = method } CF4 { ; Here, you can describe the fractal formula. This text ; will appear in the browsers as comments. ; For more information about fractal formulas, look up ; "writing fractal formulas" in the online help index. init: ; The code in this section is executed once per pixel, before ; the iteration loop is entered. It should set up variables ; used in the loop: section. bool done = false z = #pixel complex w = z float convBailout = 0.0 int convCount = 0 int count = 0 if @myAttractor if @myConvergence == 0 convCount = 3 convBailout = 1.0E-4 elseif @myConvergence == 1 convCount = 5 convBailout = 1.0E-7 else convCount = 7 convBailout = 1.0E-9 endif endif float oldDelta = 1.0E20 complex oldz = z int count = 0 loop: ; The code in this section is repeatedly executed, until ; either the maximum iteration count has been reached (then ; the pixel being computed is considered to be inside), or ; the boolean expression in the bailout: section becomes ; false (then the pixel is considered to be outside). done = false if @myRounding == 0 w = trunc(z) elseif @myRounding == 1 w = round(z) elseif @myRounding == 2 w = ceil(z) else w = floor(z) endif z = z - w complex newz = @iterfunc(z) if newz != 0 z = recip(newz) else done = true endif if @myAttractor float delta = |z - oldz| if delta <= olddelta && delta < convBailout count = count + 1 else count = 0 endif if count >= convCount done = true endif olddelta = delta oldz = z endif bailout: ; This section should contain a boolean expression, such as ; |z| < 4. When this expression becomes false, the iteration ; loop is stopped, and the pixel is considered to be outside. |z| < @myBailout && !done default: ; This section contains default settings that make the ; fractal formula and its parameters easier to use. title = "CF4" param myBailout caption = "Bail Out" default = 1.0E20 endparam param myRounding caption = "Rounding Type" enum = "trunc" "round" "ceil" "floor" default = 0 endparam param myAttractor caption = "Attractors" default = true endparam param myConvergence caption = "Convergence type" enum = "Loose" "Strict" "Strictest" default = 1 endparam func iterfunc caption = "Iterated function" default = ident() endfunc switch: ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. } NthRootOfP { ;Here is a formula for computing the nth root of a number P. ;Based on a formula from the book The 5th Arithmetical Operation ;by Domingo Leon Gomez Morin ;1st Julia Set switches on P and N global: ; This section is executed once per image. This is a good ; place for initializing variables and precalculating tables. ; Variables declared here will be read-only in the rest of ; the coloring algorithm. complex c = 2*(@myN-1.0) complex a = c*@myP complex b = @myP*@myP init: ; The code in this section is executed once per pixel, before ; the iteration loop is entered. It should set up variables ; used in the loop: section. z = @init(#pixel) float delta = 1.0E20 complex oldz = z loop: ; The code in this section is repeatedly executed, until ; either the maximum iteration count has been reached (then ; the pixel being computed is considered to be inside), or ; the boolean expression in the bailout: section becomes ; false (then the pixel is considered to be outside). complex den = z^c + a*z^(@myN-1.0) if den != 0 z = @iterfunc((a*z^@myN + b)/den) delta = |z-oldz| oldz = z else delta = @bailout endif bailout: ; This section should contain a boolean expression, such as ; |z| < 4. When this expression becomes false, the iteration ; loop is stopped, and the pixel is considered to be outside. delta > @bailout default: ; This section contains default settings that make the ; fractal formula and its parameters easier to use. title = "NthRootOfP" param myP caption = "P" default = (3.14159265358979323846264338,0.0) endparam param myN caption = "N" default = (2.0,0.0) endparam param bailout caption = "BailOut" default = 1.0E-20 endparam func init caption = "Initial function" default = ident() hint = "Applied once for each pixel." endfunc func iterfunc caption = "Iterated function" default = ident() hint = "Applied each time through the loop." endfunc periodicity = 0 maxiter = 250 precision = 0 method = multipass switch: ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. type = "NthRootOfP-Julia1" myP = #pixel myN = @myN bailout = @bailout init = @init iterfunc = @iterfunc periodicity = periodicity maxiter = maxiter method = method } NthRootOfP-Julia1 { ;Here is a formula for computing the nth root of a number P. ;Based on a formula from the book The 5th Arithmetical Operation ;by Domingo Leon Gomez Morin ;1st Julia Set switches on P ;2nd Julia Set switches on N global: ; This section is executed once per image. This is a good ; place for initializing variables and precalculating tables. ; Variables declared here will be read-only in the rest of ; the coloring algorithm. complex c = 2*(@myN-1.0) complex a = c*@myP complex b = @myP*@myP init: ; The code in this section is executed once per pixel, before ; the iteration loop is entered. It should set up variables ; used in the loop: section. z = @init(#pixel) float delta = 1.0E20 complex oldz = z loop: ; The code in this section is repeatedly executed, until ; either the maximum iteration count has been reached (then ; the pixel being computed is considered to be inside), or ; the boolean expression in the bailout: section becomes ; false (then the pixel is considered to be outside). complex den = z^c + a*z^(@myN-1.0) if den != 0 z = @iterfunc((a*z^@myN + b)/den) delta = |z-oldz| oldz = z else delta = @bailout endif bailout: ; This section should contain a boolean expression, such as ; |z| < 4. When this expression becomes false, the iteration ; loop is stopped, and the pixel is considered to be outside. delta > @bailout default: ; This section contains default settings that make the ; fractal formula and its parameters easier to use. title = "NthRootOfP-Julia1" param myP caption = "P" default = (3.14159265358979323846264338,0.0) endparam param myN caption = "N" default = (2.0,0.0) endparam param bailout caption = "BailOut" default = 1.0E-20 endparam func init caption = "Initial function" default = ident() hint = "Applied once for each pixel." endfunc func iterfunc caption = "Iterated function" default = ident() hint = "Applied each time through the loop." endfunc periodicity = 0 maxiter = 250 method = multipass switch: ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. type = "NthRootOfP-Julia2" myP = @myP myN = #pixel bailout = @bailout init = @init iterfunc = @iterfunc maxiter = maxiter periodicity = periodicity } NthRootOfP-Julia2 { ;Here is a formula for computing the nth root of a number P. ;Based on a formula from the book The 5th Arithmetical Operation ;by Domingo Leon Gomez Morin ;1st Julia Set switches on P ;2nd Julia Set switches on N global: ; This section is executed once per image. This is a good ; place for initializing variables and precalculating tables. ; Variables declared here will be read-only in the rest of ; the coloring algorithm. complex c = 2*(@myN-1.0) complex a = c*@myP complex b = @myP*@myP init: ; The code in this section is executed once per pixel, before ; the iteration loop is entered. It should set up variables ; used in the loop: section. z = @init(#pixel) float delta = 1.0E20 complex oldz = z loop: ; The code in this section is repeatedly executed, until ; either the maximum iteration count has been reached (then ; the pixel being computed is considered to be inside), or ; the boolean expression in the bailout: section becomes ; false (then the pixel is considered to be outside). complex den = z^c + a*z^(@myN-1.0) if den != 0 z = @iterfunc((a*z^@myN + b)/den) + @seed delta = |z-oldz| oldz = z else delta = @bailout endif bailout: ; This section should contain a boolean expression, such as ; |z| < 4. When this expression becomes false, the iteration ; loop is stopped, and the pixel is considered to be outside. delta > @bailout default: ; This section contains default settings that make the ; fractal formula and its parameters easier to use. title = "NthRootOfP-Julia2" param myP caption = "P" default = (3.14159265358979323846264338,0.0) endparam param myN caption = "N" default = (2.0,0.0) endparam param bailout caption = "BailOut" default = 1.0E-20 endparam param seed caption = "Seed" default = (0.0, 0.0) hint = "Perturbs the set." endparam func init caption = "Initial function" default = ident() hint = "Applied once for each pixel." endfunc func iterfunc caption = "Iterated function" default = ident() hint = "Applied each time through the loop." endfunc periodicity = 0 maxiter = 250 method = multipass switch: ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. type = "NthRootOfP-Julia2" myP = @myP myN = @myN seed = #pixel bailout = @bailout init = @init iterfunc = @iterfunc maxiter = maxiter periodicity = periodicity } PascalTriangle { ;Here is a formula for computing the root of a number P. ;Based on a formula from the book The 5th Arithmetical Operation ;I'm not sure how N relates to P, but using N=6 results in the square root of P ;by Domingo Leon Gomez Morin ;1st Julia Set switches on P ;2nd Julia Set switches on N global: ; This section is executed once per image. This is a good ; place for initializing variables and precalculating tables. ; Variables declared here will be read-only in the rest of ; the coloring algorithm. complex myCoef[@myN+1] int idx = @myN float NFact = 1.0 while idx > 1 NFact = NFact*idx idx = idx - 1 endwhile idx = 0 while idx < @myN+1 float iF1 = 1.0 float iF2 = 1.0 int idx2 = idx int idx3 = @myN-idx while idx2 > 1 iF1 = iF1 * idx2 idx2 = idx2 - 1 endwhile while idx3 > 1 iF2 = iF2 * idx3 idx3 = idx3 - 1 endwhile if idx % 2 == 0 myCoef[idx] = NFact/(iF1*iF2)*@myP^((@myN-idx)/2.0) else myCoef[idx] = NFact/(iF1*iF2)*@myP^((@myN+1-idx)/2.0) endif idx = idx+1 endwhile init: z = @init(#pixel) complex oldz = z float delta=1.0E20 loop: int i = 0 complex den = (0.0,0.0) complex num = (0.0,0.0) while i < @myN+1 if i % 2 == 0 den = den + myCoef[i]*z^i else num = num + myCoef[i]*z^i endif i = i + 1 endwhile if den != 0 z = @iterfunc(num/den) delta = |z - oldz| oldz = z else delta = @bailout endif bailout: delta > @bailout default: title = "PascalTriangle" param myN caption = "N" default = 6 endparam param myP caption = "P" default = (1.6180339887498948482, 0.0) endparam param bailout caption = "BailOut" default = 1.0E-20 endparam func init caption = "Init" default = ident() hint = "Applied once to each pixel." endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "Applied every time through the loop" endfunc periodicity = 0 maxiter = 250 method = multipass switch: type = "PascalTriangle-Julia1" myP = #pixel myN = @myN bailout = @bailout init = @init iterfunc = @iterfunc precision = precision periodicity = periodicity maxiter = maxiter method = method } PascalTriangle-Julia1 { ;Here is a formula for computing the root of a number P. ;Based on a formula from the book The 5th Arithmetical Operation ;I'm not sure how N relates to P, but using N=6 results in the square root of P ;by Domingo Leon Gomez Morin ;1st Julia Set switches on P ;2nd Julia Set switches on N global: ; This section is executed once per image. This is a good ; place for initializing variables and precalculating tables. ; Variables declared here will be read-only in the rest of ; the coloring algorithm. complex myCoef[@myN+1] int idx = @myN float NFact = 1.0 while idx > 1 NFact = NFact*idx idx = idx - 1 endwhile idx = 0 while idx < @myN+1 float iF1 = 1.0 float iF2 = 1.0 int idx2 = idx int idx3 = @myN+1-idx while idx2 > 1 iF1 = iF1 * idx2 idx2 = idx2 - 1 endwhile while idx3 > 1 iF2 = iF2 * idx3 idx3 = idx3 - 1 endwhile if idx % 2 == 0 myCoef[idx] = NFact/(iF1*iF2)*@myP^((@myN-idx)/2.0) else myCoef[idx] = NFact/(iF1*iF2)*@myP^((@myN+1-idx)/2.0) endif idx = idx+1 endwhile init: z = @init(#pixel) complex oldz = z float delta=1.0E20 loop: int i = 0 complex den = (0.0,0.0) complex num = (0.0,0.0) while i < @myN+1 if i % 2 == 0 den = den + myCoef[i]*z^i else num = num + myCoef[i]*z^i endif i = i + 1 endwhile if den != 0 z = @iterfunc(num/den) + @seed delta = |z - oldz| oldz = z else delta = @bailout endif bailout: delta > @bailout default: title = "PascalTriangle-Julia1" param myN caption = "N" default = 6 endparam param myP caption = "P" default = (1.6180339887498948482, 0.0) endparam param bailout caption = "BailOut" default = 1.0E-20 endparam param seed caption = "Seed" default = (0.0,0.0) hint = "Perturbs the set by adding this value at each iteration." endparam func init caption = "Init" default = ident() hint = "Applied once to each pixel." endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "Applied every time through the loop" endfunc periodicity = 0 maxiter = 250 precision = 0 method = multipass switch: type = "PascalTriangle-Julia1" myP = @myP seed = #pixel bailout = @bailout init = @init iterfunc = @iterfunc precision = precision periodicity = periodicity maxiter = maxiter method = method } ContinuedFractions-UF3-V2.0 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: int maxterms = #maxiter if @wraparound maxterms = @numterms + 1 endif complex expansion[#maxiter+1] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < maxterms - 1 && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: bool done = false int i = totalterms - 1 z = #pixel if @typeof <= 1 if z != 0 z = 1.0/z else i = -1 endif endif z = @init(z^@initpower) complex c = z complex newz = z complex oldz = z float delta = 1.0E20 loop: done = false if @typeof <= 2 && i >= 0 int newi = i if @variant1 == 1 newi = totalterms - 1 - i elseif @variant1 == 2 if @termtouse <= totalterms newi = @termtouse else newi = totalterms - 1 endif endif newz = @iterfunc(z^@iterpower) if @typeof == 0 if newz != 0 z = expansion[newi] + 1.0/newz else done = true endif elseif @typeof == 1 if newz != 0 z = expansion[newi] + target/newz else done = true endif elseif @typeof == 2 z = expansion[newi] + newz + c else complex sum = 0 int m = 0 while m < totalterms if expansion[m] != 0 sum = sum + (1.0/expansion[m])^z endif m = m + 1 endwhile z = sum endif i = i - 1 if i < 0 if @wraparound i = totalterms - 1 else done = true endif endif if @convCheck delta = | z - oldz | if delta < @convBailout done = true endif oldz = z endif endif bailout: |z| < @bailout && !done default: param typeof caption = "Type" enum = "I" "II" "Mandelbrot" "Zeta-Like" default = 0 Hint = "Type I: z = a[i] + 1/z where a[i] is the ith term of the CF expansion of the seed. \ Type II: z = a[i] + target/z where a[i] is the ith term of the CF expansion of target.\ Type III: Mandelbrot z = z^p + c + a[i]\ Type Zeta-Like = z = a[1]^z + a[2]^z + ... + a[n]^z" endparam param wraparound caption = "Wrap Around" default = false visible = @typeof <= 3 endparam param numterms caption = "Number of Terms" default = 5 visible = @wraparound && @typeof <= 3 endparam param showfract caption = "Show Fraction Parameters" default = true hint = "If on shows all parameters that affect the C.F. expansion." endparam param showform caption = "Show Formula Parameters" default = true hint = "If on, shows all parameters that affect the iterated formula." endparam param variant1 caption = "Variant 1" enum = "All terms" "Reverse Terms" "1 Term" default = 0 hint = "For types where there is a single calculation in each iteration \ this determines how many to use." visible = @showfract endparam param termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 && @showfract endparam param normalize caption = "Normalize Expansion" default = false hint = "If on, it divides each term in the CF expansion by the largest length of any term in the list." visible = @showfract endparam param normalfactor caption = "Normalization factor" default = (1.0,0.0) hint = "After normalizing multiplies each term by this much." visible = @showfract && @normalize endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." visible = @showfract endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." visible = @showfract endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." visible = @showfract endparam func fracfunc caption = "Fraction Function" default = ident() hint = "This function is applied to every term in the continued fraction expansion." visible = @showfract endfunc param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." visible = @showform endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." visible = @showform endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" visible = @showform endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." visible = @showform endparam param convBailout caption = "Convergence Bailout" default = 1.0E-10 hint = "Bails out if difference between two successive iterations is below this number." visible = @convCheck && @showform endparam func init caption = "Initial function" default = ident() hint = "This function is applied to each pixel before loop." visible = @showform endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." visible = @showform endfunc maxiter = 15 title = "ContinuedFractions-UF3-V2.0" periodicity = 0 method = multipass switch: ;first switch is on the seed that is used to generate the CF expansion type = "ContinuedFractions-UF3-V2.0-Julia1" method = method periodicity = periodicity maxiter = maxiter seed = #pixel precision = precision typeof = @typeof variant1 = @variant1 termtouse = @termtouse seedfunc = @seedfunc seedpower = @seedpower initpower = @initpower iterpower = @iterpower bailout = @bailout init = @init iterfunc = @iterfunc fracfunc = @fracfunc convCheck = @convCheck convBailout = @convBailout normalize = @normalize normalfactor = @normalfactor wraparound = @wraparound numterms = @numterms } ContinuedFractions-UF3-V2.0-Julia1 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: int maxterms = #maxiter if @wraparound maxterms = @numterms + 1 endif complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < maxterms - 1 && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: int i = totalterms - 1 z = #pixel if @typeof <= 1 if z != 0 z = 1.0/z else i = -1 endif endif z = @init(z^@initpower) complex c = z complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof <= 3 && i >= 0 int newi = i if @variant1 == 1 newi = totalterms - 1 - i elseif @variant1 == 2 if @termtouse <= totalterms newi = @termtouse else newi = totalterms - 1 endif endif newz = @iterfunc(z^@iterpower) if @typeof == 0 if newz != 0 z = expansion[newi] + 1.0/newz else done = true endif elseif @typeof == 1 if newz != 0 z = expansion[newi] + target/newz else done = true endif elseif @typeof == 2 z = expansion[newi] + newz + c else complex sum = 0 int m = 0 while m < totalterms if expansion[m] != 0 sum = sum + (1.0/expansion[m])^z endif m = m + 1 endwhile z = sum endif i = i - 1 if i < 0 if @wraparound i = totalterms - 1 else done = true endif endif if @convCheck delta = | z - oldz | if delta < @convBailout done = true endif oldz = z endif endif bailout: |z| < @bailout && !done default: param typeof caption = "Type" enum = "I" "II" "Mandelbrot" "Zeta-Like" default = 0 Hint = "Type I: z = a[i] + 1/z where a[i] is the ith term of the CF expansion of the seed. \ Type II: z = a[i] + target/z where a[i] is the ith term of the CF expansion of target.\ Type Mandelbrot z = a[i] + z^p + c" endparam param wraparound caption = "Wrap Around" default = false visible = @typeof <= 3 endparam param numterms caption = "Number of Terms" default = 5 min = 0 visible = @wraparound && @typeof <= 3 hint = "Must be less than max iterations." endparam param showfract caption = "Show Fraction Parameters" default = true hint = "If on shows all parameters that affect the C.F. expansion." endparam param showform caption = "Show Formula Parameters" default = true hint = "If on, shows all parameters that affect the iterated formula." endparam param variant1 caption = "Variant 1" enum = "All terms" "Reverse Terms" "1 Term" default = 0 hint = "For types where there is a single calculation in each iteration \ this determines how many to use." visible = @showfract endparam param termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 && @showfract endparam param normalize caption = "Normalize Expansion" default = false hint = "If on, it divides each term in the CF expansion by the largest length of any term in the list." visible = @showfract endparam param normalfactor caption = "Normalization factor" default = (1.0,0.0) hint = "After normalizing multiplies each term by this much." visible = @showfract && @normalize endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." visible = @showfract endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." visible = @showfract endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." visible = @showfract endparam func fracfunc caption = "Fraction Function" default = ident() hint = "This function is applied to every term in the continued fraction expansion." visible = @showfract endfunc param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." visible = @showform endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." visible = @showform endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" visible = @showform endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." visible = @showform endparam param convBailout caption = "Convergence Bailout" default = 1.0E-10 hint = "Bails out if difference between two successive iterations is below this number." visible = @convCheck && @showform endparam func init caption = "Initial function" default = ident() hint = "This function is applied to each pixel before loop." visible = @showform endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." visible = @showform endfunc maxiter = 15 title = "ContinuedFractions-UF3-V2.0-Julia1" periodicity = 0 method = multipass switch: ;This switch is on the power applied at each iteration type = "ContinuedFractions-UF3-V2.0-Julia2" method = method periodicity = periodicity maxiter = maxiter seed = @seed precision = precision typeof = @typeof variant1 = @variant1 termtouse = @termtouse seedfunc = @seedfunc seedpower = @seedpower initpower = @initpower iterpower = #pixel bailout = @bailout init = @init iterfunc = @iterfunc fracfunc = @fracfunc convCheck = @convCheck convBailout = @convBailout normalize = @normalize normalfactor = @normalfactor wraparound = @wraparound numterms = @numterms } ContinuedFractions-UF3-V2.0-Julia2 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: int maxterms = #maxiter if @wraparound maxterms = @numterms + 1 endif complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < maxterms - 1 && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: int i = totalterms - 1 z = #pixel if @typeof <= 1 if z != 0 z = 1.0/z else i = -1 endif endif z = @init(z^@initpower) complex c = z complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof <= 3 && i >= 0 int newi = i if @variant1 == 1 newi = totalterms - 1 - i elseif @variant1 == 2 if @termtouse <= totalterms newi = @termtouse else newi = totalterms - 1 endif endif newz = @iterfunc(z^@iterpower) if @typeof == 0 if newz != 0 z = expansion[newi] + 1.0/newz else done = true endif elseif @typeof == 1 if newz != 0 z = expansion[newi] + target/newz else done = true endif elseif @typeof == 2 z = expansion[newi] + c + newz else complex sum = 0 int m = 0 while m < totalterms if expansion[m] != 0 sum = sum + (1.0/expansion[m])^z endif m = m + 1 endwhile z = sum endif i = i - 1 if i < 0 if @wraparound i = totalterms - 1 else done = true endif endif if @convCheck delta = | z - oldz | if delta < @convBailout done = true endif oldz = z endif endif bailout: |z| < @bailout && !done default: param typeof caption = "Type" enum = "I" "II" "Mandelbrot" "Zeta-Like" default = 0 Hint = "Type I: z = a[i] + 1/z where a[i] is the ith term of the CF expansion of the seed. \ Type II: z = a[i] + target/z where a[i] is the ith term of the CF expansion of target.\ Type III: z = z^p + a[i] + c" endparam param wraparound caption = "Wrap Around" default = false visible = @typeof <= 3 endparam param numterms caption = "Number of Terms" default = 5 min = 0 visible = @wraparound && @typeof <= 3 hint = "Must be less than max iterations." endparam param showfract caption = "Show Fraction Parameters" default = true hint = "If on shows all parameters that affect the C.F. expansion." endparam param showform caption = "Show Formula Parameters" default = true hint = "If on, shows all parameters that affect the iterated formula." endparam param variant1 caption = "Variant 1" enum = "All terms" "Reverse Terms" "1 Term" default = 0 hint = "For types where there is a single calculation in each iteration \ this determines how many to use." visible = @showfract endparam param termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use. Range = 0 to #maxiter" min = 0 visible = @variant1 == 2 && @showfract endparam param normalize caption = "Normalize Expansion" default = false hint = "If on, it divides each term in the CF expansion by the largest length of any term in the list." visible = @showfract endparam param normalfactor caption = "Normalization factor" default = (1.0,0.0) hint = "After normalizing multiplies each term by this much." visible = @showfract && @normalize endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." visible = @showfract endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." visible = @showfract endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." visible = @showfract endparam func fracfunc caption = "Fraction Function" default = ident() hint = "This function is applied to every term in the continued fraction expansion." visible = @showfract endfunc param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." visible = @showform endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." visible = @showform endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" visible = @showform endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." visible = @showform endparam param convBailout caption = "Convergence Bailout" default = 1.0E-10 hint = "Bails out if difference between two successive iterations is below this number." visible = @convCheck && @showform endparam func init caption = "Initial function" default = ident() hint = "This function is applied to each pixel before loop." visible = @showform endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." visible = @showform endfunc maxiter = 15 title = "ContinuedFractions-UF3-V2.0-Julia2" periodicity = 0 method = multipass switch: ;This switch is on the perturbation at each iteration type = "ContinuedFractions-UF3-V2.0-Julia3" method = method periodicity = periodicity maxiter = maxiter seed = @seed seed2 = #pixel precision = precision typeof = @typeof variant1 = @variant1 termtouse = @termtouse seedfunc = @seedfunc seedpower = @seedpower initpower = @initpower iterpower = @iterpower bailout = @bailout init = @init iterfunc = @iterfunc fracfunc = @fracfunc convCheck = @convCheck convBailout = @convBailout normalize = @normalize normalfactor = @normalfactor wraparound = @wraparound numterms = @numterms } ContinuedFractions-UF3-V2.0-Julia3 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: int maxterms = #maxiter if @wraparound maxterms = @numterms + 1 endif complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < maxterms - 1 && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: int i = totalterms - 1 z = #pixel if @typeof <= 1 if z != 0 z = 1.0/z else i = -1 endif endif z = @init(z^@initpower) complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof <= 3 && i >= 0 int newi = i if @variant1 == 1 newi = totalterms - 1 - i elseif @variant1 == 2 if @termtouse <= totalterms newi = @termtouse else newi = totalterms - 1 endif endif newz = @iterfunc(z^@iterpower) if @typeof <= 1 if newz != 0 z = expansion[newi] + @seed2/newz else done = true endif elseif @typeof == 2 z = expansion[newi] + newz + @seed2 else complex sum = 0 int m = 0 while m < totalterms if expansion[m] != 0 sum = sum + (1.0/expansion[m])^z endif m = m + 1 endwhile z = sum + @seed2 endif i = i - 1 if i < 0 if @wraparound i = totalterms - 1 else done = true endif endif if @convCheck delta = | z - oldz | if delta < @convBailout done = true endif oldz = z endif endif bailout: |z| < @bailout && !done default: param typeof caption = "Type" enum = "I" "II" "Mandelbrot" "Zeta-Like" default = 0 Hint = "Type I: z = a[i] + 1/z where a[i] is the ith term of the CF expansion of the seed. \ Type II: z = a[i] + target/z where a[i] is the ith term of the CF expansion of target.\ Type Mandelbrot z = a[i] + z^p + seed2" endparam param wraparound caption = "Wrap Around" default = false visible = @typeof <= 3 endparam param numterms caption = "Number of Terms" default = 5 min = 0 visible = @wraparound && @typeof <= 3 hint = "Cannot be more than max iterations." endparam param variant1 caption = "Variant 1" enum = "All terms" "Reverse Terms" "1 Term" default = 0 hint = "For types where there is a single calculation in each iteration \ this determines how many to use." endparam param showfract caption = "Show Fraction Parameters" default = true hint = "If on shows all parameters that affect the C.F. expansion." endparam param showform caption = "Show Formula Parameters" default = true hint = "If on, shows all parameters that affect the iterated formula." endparam param termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 && @showfract min = 0 endparam param normalize caption = "Normalize Expansion" default = false hint = "If on, it divides each term in the CF expansion by the largest length of any term in the list." visible = @showfract endparam param normalfactor caption = "Normalization factor" default = (1.0,0.0) hint = "After normalizing multiplies each term by this much." visible = @showfract && @normalize endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." visible = @showfract endparam param seed2 caption = "Seed 2" default = (1.0,0) hint = "Formula is a[i] + seed2/z for types I and II" visible = @showfract endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." visible = @showfract endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." visible = @showfract endparam func fracfunc caption = "Fraction Function" default = ident() hint = "This function is applied to every term in the continued fraction expansion." visible = @showfract endfunc param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." visible = @showform endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." visible = @showform endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" visible = @showform endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." visible = @showform endparam param convBailout caption = "Convergence Bailout" default = 1.0E-10 hint = "Bails out if difference between two successive iterations is below this number." visible = @convCheck && @showform endparam func init caption = "Initial function" default = ident() hint = "This function is applied to each pixel before loop." visible = @showform endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." visible = @showform endfunc maxiter = 15 title = "ContinuedFractions-UF3-V2.0-Julia3" periodicity = 0 method = multipass switch: ;This switch is on the power applied at each iteration type = "ContinuedFractions-UF3-V2.0-Julia4" method = method periodicity = periodicity maxiter = maxiter seed = @seed seed2 = @seed2 seed3 = #pixel precision = precision typeof = @typeof variant1 = @variant1 termtouse = @termtouse seedfunc = @seedfunc seedpower = @seedpower initpower = @initpower iterpower = @iterpower bailout = @bailout init = @init iterfunc = @iterfunc fracfunc = @fracfunc convCheck = @convCheck convBailout = @convBailout normalize = @normalize normalfactor = @normalfactor wraparound = @wraparound numterms = @numterms } ContinuedFractions-UF3-V2.0-Julia4 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: int maxterms = #maxiter if @wraparound maxterms = @numterms + 1 endif complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < maxterms - 1 && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: int i = totalterms - 1 z = #pixel if @typeof <= 1 if z != 0 z = 1.0/z else i = -1 endif endif z = @init(z^@initpower) complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof <= 3 && i >= 0 int newi = i if @variant1 == 1 newi = totalterms - 1 - i elseif @variant1 == 2 if @termtouse <= totalterms newi = @termtouse else newi = totalterms - 1 endif endif newz = @iterfunc(z^@iterpower) if @typeof <= 1 if newz != 0 z = expansion[newi] + @seed2/newz + @seed3 else done = true endif elseif @typeof == 2 z = expansion[newi] + newz + @seed3 else complex sum = 0 int m = 0 while m < totalterms if expansion[m] != 0 sum = sum + (1.0/expansion[m])^z endif m = m + 1 endwhile z = sum+@seed2 endif i = i - 1 if i < 0 if @wraparound i = totalterms - 1 else done = true endif endif if @convCheck delta = | z - oldz | if delta < @convBailout done = true endif oldz = z endif endif bailout: |z| < @bailout && !done default: param typeof caption = "Type" enum = "I" "II" "Mandelbrot" "Zeta-Like" default = 0 Hint = "Type I: z = a[i] + 1/z where a[i] is the ith term of the CF expansion of the seed. \ Type II: z = a[i] + target/z where a[i] is the ith term of the CF expansion of target.\ Type Mandelbrot: z = a[i] + z^p + seed3" endparam param wraparound caption = "Wrap Around" default = false visible = @typeof <= 3 endparam param numterms caption = "Number of Terms" default = 5 min = 0 visible = @wraparound && @typeof <= 3 hint = "Must be less than max iterations." endparam param showfract caption = "Show Fraction Parameters" default = true hint = "If on shows all parameters that affect the C.F. expansion." endparam param showform caption = "Show Formula Parameters" default = true hint = "If on, shows all parameters that affect the iterated formula." endparam param variant1 caption = "Variant 1" enum = "All terms" "Reverse Terms" "1 Term" default = 0 hint = "For types where there is a single calculation in each iteration \ this determines how many to use." visible = @showfract endparam param termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 && @showfract min = 0 endparam param normalize caption = "Normalize Expansion" default = false hint = "If on, it divides each term in the CF expansion by the largest length of any term in the list." visible = @showfract endparam param normalfactor caption = "Normalization factor" default = (1.0,0.0) hint = "After normalizing multiplies each term by this much." visible = @showfract && @normalize endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." visible = @showfract endparam param seed2 caption = "Seed 2" default = (1.0,0) hint = "Formula is a[i] + seed2/z for types I and II" visible = @showfract endparam param seed3 caption = "Seed 3" default = (0.0, 0.0) hint = "This perturbs each iteration." visible = @showfract endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." visible = @showfract endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." visible = @showfract endparam func fracfunc caption = "Fraction Function" default = ident() hint = "This function is applied to every term in the continued fraction expansion." visible = @showfract endfunc param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." visible = @showform endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." visible = @showform endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" visible = @showform endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." visible = @showform endparam param convBailout caption = "Convergence Bailout" default = 1.0E-10 hint = "Bails out if difference between two successive iterations is below this number." visible = @convCheck && @showform endparam func init caption = "Initial function" default = ident() hint = "This function is applied to each pixel before loop." visible = @showform endfunc func iterfunc caption = "Iterated Function" default = ident() hint = "This function is applied at every step of the loop." visible = @showform endfunc maxiter = 15 title = "ContinuedFractions-UF3-V2.0-Julia4" periodicity = 0 method = multipass switch: ;This switch is on the power applied at each iteration type = "ContinuedFractions-UF3-V2.0" method = method periodicity = periodicity maxiter = maxiter seed = #pixel seed2 = @seed2 seed3 = @seed3 precision = precision typeof = @typeof variant1 = @variant1 termtouse = @termtouse seedfunc = @seedfunc seedpower = @seedpower initpower = @initpower iterpower = @iterpower bailout = @bailout init = @init iterfunc = @iterfunc fracfunc = @fracfunc convCheck = @convCheck convBailout = @convBailout normalize = @normalize normalfactor = @normalfactor wraparound = @wraparound numterms = @numterms } WorkingTitle { ;Mark Hammond, 9-1-02 ;This Formula takes a seed number and applies the basic Mandelbrot formula to that ;before any other calculations. It stores them in an array for use during the loop ;At each iteration the corresponding element in the array is added on to the basic formula ;The first switch changes the seed. ;The second switch is a traditional julia switch global: complex boost[#maxiter] int i=0 float maxlen=0.0 complex myZ = (0,0) complex newRot = exp(flip(@myrotation*#pi/180.0)) if @usebailout int m = 0 while m < #maxiter boost[m] = (0.0,0.0) m = m + 1 endwhile while i < #maxiter && |myZ| < @orbitbailout myZ = myZ^@seedpower + @seed boost[i] = myZ*@myfactor*newRot float len=cabs(boost[i]) if len > maxlen maxlen = len endif i = i + 1 endwhile else while i < #maxiter myZ = myZ^@seedpower + @seed boost[i] = myZ*@myfactor*newRot float len=cabs(boost[i]) if len > maxlen maxlen = len endif i = i + 1 endwhile endif if @normalize int k = 0 while k < #maxiter boost[k] = boost[k]/maxlen*@normalfactor k = k + 1 endwhile endif init: int idx = 0 int newidx = 0 z = 0 loop: newidx = idx if @reverse newidx = #maxiter-1-idx endif complex additive = boost[newidx] if @orbitver if |z - @orbitcenter| > @orbitradius additive = 0 endif endif z = z^@iterpower + #pixel + additive idx = idx + 1 bailout: |z| < @bailout default: periodicity = 0 method = multipass title = "WorkingTitle" param seedpower caption = "Seed Power" default = (2.0,0.0) hint = "This power determines the orbit of the seed number (2 is traditional mandelbrot orbit)" endparam param iterpower caption = "Iterated Power" default = (2.0, 0.0) hint = "Power applied at each iteration (2 is traditional mandelbrot power)" endparam param seed caption = "Seed" default = (-.75,0.001) hint = "This determines the boost amount at each iteration." endparam param myfactor caption = "Seed Factor" default = (1.0,0.0) hint = "Every term in the seeds orbit is multiplied by this number." endparam param myrotation caption = "Seed rotation" default = 0.0 hint = "Every term in the seeds orbit is rotated by this many degrees." endparam param reverse caption = "Reverse Sequence?" default = true hint = "Reverses the order in which the terms are added to the formula." endparam param normalize caption = "Normalize" default = false hint = "Divides all numbers in the seeds orbit by the max length of all the points in the orbit." endparam param normalfactor caption = "Normalizing Factor" default = (1.0,0.0) hint = "Multiplies all points in the sequence by this value after normalization." visible = @normalize endparam param usebailout caption = "Check For Seed bailout?" default = true hint = "If on, then use only the terms of the seeds orbit whose length \ is below the seed bail out value." endparam param orbitbailout caption = "Seed Bailout" default = 4.0 visible = @usebailout endparam param bailout caption = "Bailout" default = 128.0 hint = "Traditional bailout" endparam param orbitver caption = "Orbit Version" default = false hint = "If on, the boost is applied if and only if z falls within a circle of radius r" endparam param orbitcenter caption = "Orbit Center" default = (0,0) visible = @orbitver hint = "Center of orbit circle." endparam param orbitradius caption = "Orbit radius" default = 1.0 hint = "Only apply boost if |z - center| < radius" visible = @orbitver endparam switch: type = "WorkingTitle-Julia1" seed = #pixel iterpower = @iterpower seedpower = @seedpower method = method periodicity = periodicity normalize = @normalize normalfactor = @normalfactor usebailout = @usebailout orbitbailout = @orbitbailout orbitver = @orbitver orbitradius = @orbitradius orbitcenter = @orbitcenter myfactor = @myfactor myrotation = @myrotation reverse = @reverse bailout = @bailout } WorkingTitle-Julia1 { ;Mark Hammond, 9-1-02 ;This is the first switch for the WorkingTitle formula ;This Formula takes seed number and applies basic Mandelbrot formula to that ;Generates an array of values, at each iteration the corresponding entry in the array is added. global: complex boost[#maxiter] int i = 0 float maxlen=0.0 complex myZ = (0,0) complex newRot = exp(flip(@myrotation*#pi/180.0)) if @usebailout int m = 0 while m < #maxiter boost[m] = (0.0,0.0) m = m + 1 endwhile while i < #maxiter && |myZ| < @orbitbailout myZ = myZ^@seedpower + @seed boost[i] = myZ*@myfactor*newRot float len=cabs(boost[i]) if len > maxlen maxlen = len endif i = i + 1 endwhile else while i < #maxiter myZ = myZ^@seedpower + @seed boost[i] = myZ*@myfactor*newRot float len=cabs(boost[i]) if len > maxlen maxlen = len endif i = i + 1 endwhile endif if @normalize int k = 0 while k < #maxiter boost[k] = boost[k]/maxlen*@normalfactor k = k + 1 endwhile endif init: int idx = 0 int newidx = 0 z = 0 loop: newidx = idx if @reverse newidx = #maxiter-1-idx endif complex additive = boost[newidx] if @orbitver if |z - @orbitcenter| > @orbitradius additive = 0 endif endif z = z^@iterpower + #pixel + additive idx = idx + 1 bailout: |z| < @bailout default: periodicity = 0 method = multipass title = "WorkingTitle-Julia1" param seedpower caption = "Seed Power" default = (2.0,0.0) hint = "This power determines the orbit of the seed number (2 is traditional mandelbrot orbit)" endparam param iterpower caption = "Iterated Power" default = (2.0, 0.0) hint = "Power applied at each iteration (2 is traditional mandelbrot power)" endparam param seed caption = "Seed" default = (-.75,0.001) hint = "This determines the boost amount at each iteration." endparam param myfactor caption = "Seed Factor" default = (1.0,0.0) hint = "Every term in the seeds orbit is multiplied by this number." endparam param myrotation caption = "Seed rotation" default = 0.0 hint = "Every term in the seeds orbit is rotated by this many degrees." endparam param reverse caption = "Reverse Sequence?" default = true hint = "Reverses the order in which the terms are added to the formula." endparam param normalize caption = "Normalize" default = false hint = "Divides all numbers in the seeds orbit by the max length of all the points in the orbit." endparam param usebailout caption = "Check For Seed bailout?" default = true hint = "If on, then use only the terms of the seeds orbit whose length \ is below the seed bail out value." endparam param orbitbailout caption = "Seed Bailout" default = 4.0 visible = @usebailout endparam param bailout caption = "Bailout" default = 128.0 hint = "Traditional bailout" endparam param normalfactor caption = "Normalizing Factor" default = (1.0,0.0) hint = "Multiplies all points in the sequence by this value after normalization." visible = @normalize endparam param orbitver caption = "Orbit Version" default = false hint = "If on, the boost is applied if and only if z falls within a circle of radius r" endparam param orbitcenter caption = "Orbit Center" default = (0,0) visible = @orbitver hint = "Center of orbit circle." endparam param orbitradius caption = "Orbit radius" default = 1.0 hint = "Only apply boost if |z - center| < radius" visible = @orbitver endparam switch: type = "WorkingTitle-Julia2" seed = seed seed2 = #pixel iterpower = @iterpower seedpower = @seedpower method = method periodicity = periodicity normalize = @normalize normalfactor = @normalfactor usebailout = @usebailout orbitbailout = @orbitbailout orbitver = @orbitver orbitradius = @orbitradius orbitcenter = @orbitcenter reverse = @reverse myfactor = @myfactor myrotation = @myrotation bailout = @bailout } WorkingTitle-Julia2 { ;Mark Hammond, 9-1-02 ;Second switch for WorkingTitle formula ;Formula takes seed number and applies basic Mandelbrot formula to that ;Generates an array of values, at each iteration the corresponding entry in the array is added. global: complex boost[#maxiter] complex newRot = exp(flip(@myrotation*#pi/180.0)) int i=0 complex myZ = (0,0) complex additive = @seed if @variant == 1 myZ = @seed additive = @seed2 endif float maxlen = 0.0 if @usebailout int m = 0 while m < #maxiter boost[m] = (0.0,0.0) m = m + 1 endwhile while i < #maxiter && |myZ| < @orbitbailout myZ = myZ^@seedpower + additive boost[i] = myZ*@myfactor*newRot float len=cabs(boost[i]) if len > maxlen maxlen = len endif i = i + 1 endwhile else while i < #maxiter myZ = myZ^@seedpower + @seed boost[i] = myZ*@myfactor*newRot float len=cabs(boost[i]) if len > maxlen maxlen = len endif i = i + 1 endwhile endif if @normalize int k = 0 while k < #maxiter boost[k] = boost[k]/maxlen*@normalfactor k = k + 1 endwhile endif init: int idx = 0 int newidx = 0 z = #pixel loop: newidx = idx if @reverse newidx = #maxiter-1-idx endif complex myAdditive = boost[newidx] if @orbitver if |z - @orbitcenter| > @orbitradius myAdditive = 0 endif endif z = z^@iterpower + @seed2 + myAdditive idx = idx + 1 bailout: |z| < @bailout default: periodicity = 0 method = multipass title = "WorkingTitle-Julia2" param variant caption = "Variant" enum = "Mandelbrot" "Julia" default = 0 endparam param seedpower caption = "Seed Power" default = (2.0,0.0) hint = "This power determines the orbit of the seed number (2 is traditional mandelbrot orbit)" endparam param iterpower caption = "Iterated Power" default = (2.0, 0.0) hint = "Power applied at each iteration (2 is traditional mandelbrot power)" endparam param seed caption = "Seed" default = (-.75,0.001) hint = "This determines the boost amount at each iteration." endparam param myfactor caption = "Seed Factor" default = (1.0,0.0) hint = "Every term in the seeds orbit is multiplied by this number." endparam param myrotation caption = "Seed rotation" default = 0.0 hint = "Every term in the seeds orbit is rotated by this many degrees." endparam param seed2 caption = "Seed 2" default = (0,0) hint = "Traditional Julia seed" endparam param reverse caption = "Reverse Sequence?" default = true hint = "Reverses the order in which the terms are added to the formula." endparam param usebailout caption = "Check For Seed bailout?" default = true hint = "If on, then use only the terms of the seeds orbit whose length \ is below the seed bail out value." endparam param orbitbailout caption = "Seed Bailout" default = 4.0 visible = @usebailout endparam param bailout caption = "Bailout" default = 128.0 hint = "Traditional bailout" endparam param normalize caption = "Normalize" default = false hint = "Divides all numbers in the seeds orbit by the max length of all the points in the orbit." endparam param normalfactor caption = "Normalizing Factor" default = (1.0,0.0) hint = "Multiplies all points in the sequence by this value after normalization." visible = @normalize endparam param orbitver caption = "Orbit Version" default = false hint = "If on, the boost is applied if and only if z falls within a circle of radius r" endparam param orbitcenter caption = "Orbit Center" default = (0,0) visible = @orbitver hint = "Center of orbit circle." endparam param orbitradius caption = "Orbit radius" default = 1.0 hint = "Only apply boost if |z - center| < radius" visible = @orbitver endparam switch: type = "WorkingTitle-Julia2" seed = seed seed2 = #pixel iterpower = @iterpower seedpower = @seedpower method = method periodicity = periodicity normalize = @normalize normalfactor = @normalfactor usebailout = @usebailout orbitbailout = @orbitbailout orbitver = @orbitver orbitradius = @orbitradius orbitcenter = @orbitcenter reverse = @reverse myfactor = @myfactor myrotation = @myrotation bailout = @bailout } CurveBoostMandel { ; Here, you can describe the fractal formula. This text ; will appear in the browsers as comments. ; For more information about fractal formulas, look up ; "writing fractal formulas" in the online help index. global: complex boost[#maxiter] int i = 0 float thetadelta = 2*#pi/#maxiter float theta = 0.0 float radiusSpiral = 0.0 float radiusdelta = @radius/#maxiter while i < #maxiter if @curve == 0 boost[i] = @myAspect*@radius*cos(theta) + @radius*flip(sin(theta))+@circcenter elseif @curve == 1 boost[i] = radiusSpiral*cos(@myFrequency*theta) + radiusSpiral*flip(sin(@myFrequency*theta))+@circcenter else radiusSpiral = @ca*cos(@cf*theta) + @sa*sin(@sf*theta) boost[i]= radiusSpiral*cos(@myFrequency*theta) + radiusSpiral*flip(sin(@myFrequency*theta))+@circcenter endif radiusSpiral = radiusSpiral + radiusdelta theta = theta + thetadelta i = i + 1 endwhile init: int idx = 0 int newidx = idx z = 0 int count = 0 loop: newidx = idx if @direction == 1 newidx = #maxiter - 1 - idx endif complex perturb = boost[newidx] if @skipiters != 0 if (count % (@skipiters+1)) != 0 perturb = 0 endif count = count + 1 endif z = z^@p + #pixel + perturb idx = idx + 1 bailout: |z| < @bailout default: title = "CurveBoostMandel" periodicity = 0 method = multipass #maxiter = 100 param curve caption = "Curve Type" enum = "Circle/Ellipse" "Spiral" "Rose Curve" hint = "Type of curve used to boost the set at every iteration." endparam param radius caption = "Radius" default = 0.5 hint = "For circles this is the radius used." visible = @curve == 0 || @curve == 1 endparam param myAspect caption = "Aspect Ratio" default = 1.0 hint = "1.0 = circle, > 1.0 = ellipse longer than wide, < 1.0 = ellipse taller than wide." visible = @curve == 0 endparam param circcenter caption = "Curve Center" default = (0.0,0.0) hint = "This is the center of the curve." endparam param myFrequency caption = "Frequency of Spiral/Rose Curve" default = 4.0 visible = @curve == 1 || @curve == 2 endparam param ca caption = "Cosine Amplitude" default = 1.0 hint = "Amplitude of cosine term." visible = @curve == 2 endparam param cf caption = "Cosine Frequency" default = 2.0 visible = @curve == 2 endparam param sa caption = "Sine Amplitude" default = 1.0 visible = @curve == 2 endparam param sf caption = "Sine Frequency" default = 2.0 visible = @curve == 2 endparam param direction caption = "Direction" enum = "Forward" "Reverse" default = 0 hint = "If a circle, forward = counter-clockwise, reverse = clockwise." endparam param p caption = "Power" default = (2.0, 0.0) hint = "mandelbrot power" endparam param skipiters caption = "Iterations to skip" default = 0 endparam param bailout caption = "Bailout" default = 1.0E20 endparam switch: type = "CurveBoostJulia" p = @p seed = #pixel bailout = @bailout method = method periodicity = periodicity radius = @radius curve = @curve circcenter = @circcenter myAspect = @myAspect direction = @direction myFrequency = @myFrequency ca = @ca sa = @sa sf = @sf cf = @cf skipiters = @skipiters } CurveBoostJulia { ; Here, you can describe the fractal formula. This text ; will appear in the browsers as comments. ; For more information about fractal formulas, look up ; "writing fractal formulas" in the online help index. global: complex boost[#maxiter] int i = 0 float thetadelta = 2*#pi/#maxiter float theta = 0 float radiusSpiral = 0 float radiusdelta = @radius/#maxiter while i < #maxiter if @curve == 0 boost[i] = @myAspect*@radius*cos(theta) + @radius*flip(sin(theta))+@circcenter elseif @curve == 0 boost[i] = radiusSpiral*cos(@myFrequency*theta) + radiusSpiral*flip(sin(@myFrequency*theta))+@circcenter else radiusSpiral = @ca*cos(@cf*theta) + @sa*sin(@sf*theta) boost[i]= radiusSpiral*cos(@myFrequency*theta) + radiusSpiral*flip(sin(@myFrequency*theta))+@circcenter endif radiusSpiral = radiusSpiral + radiusdelta theta = theta + thetadelta i = i + 1 endwhile init: int idx = 0 int newidx = idx z = #pixel int count=0 loop: newidx = idx if @direction == 1 newidx = #maxiter - 1 - idx endif complex perturb = boost[newidx] if @skipiters != 0 if (count % (@skipiters+1)) != 0 perturb = 0 endif count = count + 1 endif z = z^@p + @seed + perturb idx = idx + 1 bailout: |z| < @bailout default: title = "CurveBoostJulia" periodicity = 0 method = multipass #maxiter = 100 param curve caption = "Curve Type" enum = "Circle/Ellipse" "Spiral" "Rose Curve" hint = "Type of curve used to boost the set at every iteration." endparam param radius caption = "Radius" default = 0.5 hint = "For circles this is the radius used." visible = @curve == 0 || @curve == 1 endparam param circcenter caption = "Curve Center" default = (0.0,0.0) hint = "This is the center of the curve." endparam param myAspect caption = "Aspect Ratio" default = 1.0 hint = "1.0 = circle, > 1.0 = ellipse longer than wide, < 1.0 = ellipse taller than wide." visible = @curve == 0 endparam param myFrequency caption = "Frequency of Spiral" default = 4.0 visible = @curve == 1 || @curve == 2 endparam param ca caption = "Cosine Amplitude" default = 1.0 hint = "Amplitude of cosine term." visible = @curve == 2 endparam param cf caption = "Cosine Frequency" default = 2.0 visible = @curve == 2 endparam param sa caption = "Sine Amplitude" default = 1.0 visible = @curve == 2 endparam param sf caption = "Sine Frequency" default = 2.0 visible = @curve == 2 endparam param direction caption = "Direction" enum = "Forward" "Reverse" default = 0 hint = "If a circle, forward = counter-clockwise, reverse = clockwise." endparam param p caption = "Power" default = (2.0, 0.0) hint = "mandelbrot power" endparam param seed caption = "Seed" default = (0.0,0.0) hint = "Julia Seed." endparam param skipiters caption = "Iterations to skip" default = 0 endparam param bailout caption = "Bailout" default = 1.0E20 endparam switch: type = "CurveBoostJulia" p = @p seed = #pixel bailout = @bailout method = method periodicity = periodicity radius = @radius curve = @curve myAspect = @myAspect circcenter = @circcenter direction = @direction myFrequency = @myFrequency ca = @ca sa = @sa cf = @cf sf = @sf } MandelVector { init: z = 0 loop: z = z^@p + #pixel complex vec = (0,0) if @variant == 0 vec = -real(z) + flip(imag(z)) else vec = -imag(z) + flip(real(z)) endif if @normalize vec = vec/cabs(vec) endif float multiplier = 1.0 if @fadeout float delta = |z - @fadecenter| if delta < @faderadius multiplier = (@faderadius - delta)/@faderadius else multiplier = 0 endif endif z = z + @factor*vec*multiplier bailout: |z| < @bailout default: param variant caption = "Variant" enum = "Original" "Swirl" default = 1 endparam param p caption = "Power" default = (2.0,0.0) endparam param normalize caption = "Normalize" default = true endparam param factor caption = "Factor" default = (0.5,0) endparam param fadeout caption = "Fade Out?" default = true hint = "If on then the affect of the vector field becomes less and less\ the farther away from the fade center." endparam param fadecenter caption = "Fade Out Center" default = (0,0) visible = @fadeout hint = "the farther away the orbit point is from the center, the less the\ affect of the vector field." endparam param faderadius caption = "Fade out radius" default = 4.0 visible = @fadeout endparam param bailout caption = "Bailout" default = 128 endparam title = "MandelVector" switch: type = "JuliaVector" p = @p seed = #pixel bailout = @bailout factor = @factor normalize = @normalize fadeout = @fadeout fadecenter = @fadecenter faderadius = @faderadius variant = @variant } JuliaVector { init: z = #pixel loop: z = z^@p + @seed complex vec = (0.0,0.0) if @variant == 0 vec = -real(z) + flip(imag(z)) else vec = -imag(z) + flip(real(z)) endif float multiplier = 1.0 if @normalize vec = vec/cabs(vec) endif if @fadeout float delta = |z - @fadecenter| if delta < @faderadius multiplier = (@faderadius - delta)/@faderadius else multiplier = 0 endif endif z = z + @factor*vec*multiplier bailout: |z| < @bailout default: param variant caption = "Variant" enum = "Original" "Swirl" default = 1 endparam param p caption = "Power" default = (2.0,0.0) endparam param seed caption = "Julia Seed" default = (-.75,0) endparam param normalize caption = "Normalize" default = true endparam param factor caption = "Factor" default = (0.5,0) endparam param fadeout caption = "Fade Out?" default = true hint = "If on then the affect of the vector field becomes less and less\ the farther away from the fade center." endparam param fadecenter caption = "Fade Out Center" default = (0,0) visible = @fadeout hint = "the farther away the orbit point is from the center, the less the\ affect of the vector field." endparam param faderadius caption = "Fade out radius" default = 4.0 visible = @fadeout endparam param bailout caption = "Bailout" default = 4 endparam title = "JuliaVector" periodicity = 0 switch: type = "JuliaVector" p = @p seed = @seed bailout = @bailout factor = #pixel normalize = @normalize fadeout = @fadeout fadecenter = @fadecenter faderadius = @faderadius variant = @variant } WeirdMandel { ;Alternates applying the Lambda function with the standard mandelbrot on each iteration global: init: int i = 0 z = @mandelstart if @reverse i = 1 z = @lambdastart endif loop: if i == 0 z = z^@p1 + #pixel else z = #pixel*z*(1.0-z)^(@p2-1.0) endif i = 1-i bailout: |z| < @bailout default: param p1 caption = "Mandelbrot Power" default = (2,0) hint = "typical mandelbrot power." endparam param p2 caption = "Lambda Power" default = (2,0) hint = "Power for the lambda fractal." endparam param mandelstart caption = "Mandelbrot Start" default = (0,0) endparam param lambdastart caption = "Lambda Start" default = (0.5,0.0) endparam param reverse caption = "Reverse Application" default = false hint = "toggle this to reverse the order in which the formulas are applied" endparam param bailout caption = "Bailout" default = 128.0 endparam title = "WeirdMandel" method = multipass periodicity = 0 maxiter = 250 switch: type = "WeirdMandel-Julia" p1 = @p1 p2 = @p2 seed = #pixel bailout = @bailout reverse = @reverse ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. } WeirdMandel-Julia { ;On even iterations the mandelbrot formula is applied ;on odd iterations the julia formula is applied global: init: int i = 0 z = #pixel if @reverse i = 1 endif loop: if i == 0 z = z^@p1 + @seed else z = @seed*z*(1.0-z)^(@p2-1.0) endif i = 1-i bailout: |z| < @bailout default: param p1 caption = "Mandelbrot Power" default = (2,0) hint = "typical mandelbrot power." endparam param p2 caption = "Lambda Power" default = (2,0) hint = "Power for the lambda fractal." endparam param reverse caption = "Reverse Application" default = false hint = "toggle this to reverse the order in which the formulas are applied" endparam param seed caption = "Seed" default = (0,0) endparam param bailout caption = "Bailout" default = 128.0 endparam title = "WeirdMandel-Julia" periodicity = 0 maxiter = 250 method = multipass switch: type = "WeirdMandel-Julia2" p1 = @p1 p2 = @p2 seed = @seed seed2 = #pixel bailout = @bailout reverse = @reverse } WeirdMandel-Julia2 { ;On even iterations the mandelbrot formula is applied ;on odd iterations the julia formula is applied global: init: int i = 0 z = #pixel if @reverse i = 1 endif loop: if i == 0 z = z^@p1 + @seed else z = @seed2*z*(1.0-z)^(@p2-1.0) endif i = 1-i bailout: |z| < @bailout default: param p1 caption = "Mandelbrot Power" default = (2,0) hint = "typical mandelbrot power." endparam param p2 caption = "Lambda Power" default = (2,0) hint = "Power for the lambda fractal." endparam param reverse caption = "Reverse Application" default = false hint = "toggle this to reverse the order in which the formulas are applied" endparam param seed caption = "Seed" default = (-.5,0) endparam param seed2 caption = "Seed 2" default = (-.75,0) endparam param bailout caption = "Bailout" default = 128.0 endparam title = "WeirdMandel-Julia2" periodicity = 0 method = multipass maxiter = 250 switch: type = "WeirdMandel-Julia2" p1 = @p1 p2 = @p2 seed = @seed seed2 = #pixel bailout = @bailout reverse = @reverse } AnotherJulia { global: init: z = #pixel loop: if z != 0 z = @seed*(z^@p- @p/z^@p) endif bailout: |z| < @bailout default: param p caption = "Power" default = (2.0,0.0) endparam param bailout caption = "Bailout" default = 1.0E20 endparam param seed caption = "Seed" default = (-.75,0.01) endparam periodicity = 0 method = multipass maxiter = 250 title = "AnotherJulia" switch: type = "AnotherJulia" periodicity = periodicity method = method p = @p bailout = @bailout seed = #pixel } AnotherMandel { global: init: z = #pixel complex c = #pixel loop: if z != 0 z = c*(z^@p- @p/z^@p) endif bailout: |z| < @bailout default: param p caption = "Power" default = (2.0,0.0) endparam param bailout caption = "Bailout" default = 1.0E20 endparam periodicity = 0 method = multipass maxiter = 250 title = "AnotherMandel" switch: type = "AnotherJulia" periodicity = periodicity method = method p = @p bailout = @bailout seed = #pixel } SymmetricIcon { ; Taken from the book Symmetry in Chaos global: init: z = #pixel complex oldz = z float delta = 1.0E20 int j = 0 while j < @transients if z != 0 z = z*(real(@Lambda) + real(@Alpha)*|z| + real(@Beta)*real(z^@N)+ flip(real(@Omega)))+real(@Gamma)*z^(-@N-1) endif j = j + 1 endwhile loop: if z != 0 z = z*(real(@Lambda) + real(@Alpha)*|z| + real(@Beta)*real(z^@N)+ flip(real(@Omega)))+real(@Gamma)*z^(-@N-1) endif delta = |z-oldz| oldz = z bailout: |z| < @bailout && delta > @convBailout default: param N caption = "N" default = 6 hint = "determines symmetry of the fractal." endparam param Lambda caption = "Lambda" default = (-2.7,0) endparam param Alpha caption = "Alpha" default = (5.0,0) endparam param Beta caption = "Beta" default = (1.5,0) endparam param Gamma caption = "Gamma" default = (1.0,0) endparam param Omega caption = "Omega" default = (0.0,0.0) endparam param bailout caption = "Bailout" default = 1.0E20 endparam param convBailout caption = "Convergence Bailout" default = 1.0E-20 endparam param transients caption = "Transients" default = 100 endparam title = "SymmetricIcon" } WeirdMandel2 { ;Alternates applying the Lambda function with the standard mandelbrot on each iteration ;Just like the WeirdMandel, though this one allows the user to mix and match the lambda ;and mandelbrot a bit using the "alpha" term global: init: if @myalpha > 0.5 z = @mandelstart else z = @lambdastart endif float alpha = @myalpha float beta = 1.0 - alpha loop: z = alpha*(z^@p1 + #pixel) + beta*(#pixel*z*(1.0-z)^(@p2-1.0)) float temp = beta beta = alpha alpha = temp bailout: |z| < @bailout default: param myalpha caption = "Alpha" default = 0.6180339887498 endparam param p1 caption = "Mandelbrot Power" default = (2,0) hint = "typical mandelbrot power." endparam param p2 caption = "Lambda Power" default = (2,0) hint = "Power for the lambda fractal." endparam param mandelstart caption = "Mandelbrot Start" default = (0,0) endparam param lambdastart caption = "Lambda Start" default = (0.5,0.0) endparam param bailout caption = "Bailout" default = 128.0 endparam title = "WeirdMandel-V2" method = multipass periodicity = 0 maxiter = 250 switch: type = "WeirdMandel2-Julia" p1 = @p1 p2 = @p2 seed = #pixel bailout = @bailout myalpha = @myalpha ; This section is optional and can be used to specify a formula ; in the same file that forms a switch pair with this formula. ; This is the case for example with Mandelbrot and Julia sets. } WeirdMandel2-Julia { ;On even iterations the mandelbrot formula is applied ;on odd iterations the julia formula is applied global: init: z = #pixel float alpha = @myalpha float beta = 1.0 - alpha loop: z = alpha*(z^@p1 + @seed) + beta*(@seed*z*(1.0-z)^(@p2-1.0)) float temp = beta beta = alpha alpha = temp bailout: |z| < @bailout default: param myalpha caption = "Alpha" default = 0.6180339887498 endparam param p1 caption = "Mandelbrot Power" default = (2,0) hint = "typical mandelbrot power." endparam param p2 caption = "Lambda Power" default = (2,0) hint = "Power for the lambda fractal." endparam param seed caption = "Seed" default = (0,0) endparam param bailout caption = "Bailout" default = 128.0 endparam title = "WeirdMandel-V2-Julia1" periodicity = 0 maxiter = 250 method = multipass switch: type = "WeirdMandel2-Julia2" p1 = @p1 p2 = @p2 seed = @seed seed2 = #pixel bailout = @bailout myalpha = @myalpha } WeirdMandel2-Julia2 { ;On even iterations the mandelbrot formula is applied ;on odd iterations the julia formula is applied global: init: z = #pixel float alpha = @myalpha float beta = 1.0 - alpha loop: z = alpha*(z^@p1 + @seed) + beta*(@seed2*z*(1.0-z)^(@p2-1.0)) float temp = beta beta = alpha alpha = temp bailout: |z| < @bailout default: param myalpha caption = "Alpha" default = 0.6180339887498 endparam param p1 caption = "Mandelbrot Power" default = (2,0) hint = "typical mandelbrot power." endparam param p2 caption = "Lambda Power" default = (2,0) hint = "Power for the lambda fractal." endparam param seed caption = "Seed" default = (-.5,0) endparam param seed2 caption = "Seed 2" default = (-.75,0) endparam param bailout caption = "Bailout" default = 128.0 endparam title = "WeirdMandel-V2-Julia2" periodicity = 0 method = multipass maxiter = 250 switch: type = "WeirdMandel2-Julia2" p1 = @p1 p2 = @p2 seed = @seed seed2 = #pixel bailout = @bailout myalpha = @myalpha } MandyWithCF { global: complex expansion[@numberofterms] complex target = @seedfunc(@cfseed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < @numberofterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: z = #pixel complex w = 0 int s = 0 loop: if z != 0 int idx = @numberofterms - 1 w = @f1(1.0/z) while idx >= 0 && w != 0 w = expansion[idx] + 1.0/w idx = idx - 1 endwhile else w = target endif if @myOp1 == 0 w = -w elseif @myOp1 == 2 if s == 0 w = -w endif s = 1 - s endif if @myOp1 <= 2 z = z^@p + #pixel + w elseif @myOp1 == 3 z = (z^@p + #pixel)*w else if w != 0 z = (z^@p + #pixel)/w else z = z^@p + #pixel endif endif bailout: |z| < @bailout default: param p caption = "power" default = (2.0,0.0) hint = "typical mandelbrot power" endparam param bailout caption = "bailout" default = 128.0 endparam param cfseed caption = "Continued Fraction Seed" default = (0.6180339887, 0.0) hint = "This number generates the terms of the cf expansion." endparam param numberofterms caption = "Number Of Terms" default = 8 hint = "Number of terms in CF expansion of target" endparam param seedpower caption = "Seed Power" default = (1.0,0.0) hint = "The seed number is raised to this power before computing expansion." endparam param normalize caption = "Normalize?" default = false hint = "If on, then the terms of the expansion are normalized." endparam param normalfactor caption = "Factor" default = 1.0 visible = @normalize endparam func seedfunc caption = "CF Seed Function" default = ident() hint = "This function is applied to the seed before the expansion." endfunc func fracfunc caption = "Expansion Function" default = ident() hint = "This function is applied to every term of the expansion." endfunc func f1 caption = "Function 1" default = ident() endfunc param myOp1 caption = "Operator 1" enum = "-" "+" "mix" "*" "/" default = 0 endparam title = "MandyWithCF" maxiter = 250 periodicity = 0 method = multipass switch: type = "MandyWithCF-S1" p=@p bailout=@bailout cfseed=#pixel numberofterms=@numberofterms seedpower=@seedpower normalize=@normalize seedfunc=@seedfunc fracfunc=@fracfunc periodicity = periodicity method = method f1=@f1 myOp1= @myOp1 } MandyWithCF-S1 { global: complex expansion[@numberofterms] complex target = @seedfunc(@cfseed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < @numberofterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: z = #pixel complex w = 0 int s = 0 loop: if z != 0 int idx = @numberofterms - 1 w = @f1(1.0/z) while idx >= 0 && w != 0 w = expansion[idx] + 1.0/w idx = idx - 1 endwhile else w = target endif if @myOp1 == 0 w = -w elseif @myOp1 == 2 if s == 0 w = -w endif s = 1 - s endif if @myOp1 <= 2 z = z^@p + #pixel + w elseif @myOp1 == 3 z = (z^@p + #pixel)*w else if w != 0 z = (z^@p + #pixel)/w else z = z^@p + #pixel endif endif bailout: |z| < @bailout default: param p caption = "power" default = (2.0,0.0) hint = "typical mandelbrot power" endparam param bailout caption = "bailout" default = 128.0 endparam param cfseed caption = "Continued Fraction Seed" default = (0.6180339887, 0.0) hint = "This number generates the terms of the cf expansion." endparam param numberofterms caption = "Number Of Terms" default = 8 hint = "Number of terms in CF expansion of target" endparam param seedpower caption = "Seed Power" default = (1.0,0.0) hint = "The seed number is raised to this power before computing expansion." endparam param normalize caption = "Normalize?" default = false hint = "If on, then the terms of the expansion are normalized." endparam param normalfactor caption = "Factor" default = 1.0 visible = @normalize endparam func seedfunc caption = "CF Seed Function" default = ident() hint = "This function is applied to the seed before the expansion." endfunc func fracfunc caption = "Expansion Function" default = ident() hint = "This function is applied to every term of the expansion." endfunc func f1 caption = "Function 1" default = ident() endfunc param myOp1 caption = "Operator 1" enum = "-" "+" "mix" "*" "/" default = 0 endparam title = "MandyWithCF-S1" maxiter = 250 periodicity = 0 method = multipass switch: type = "MandyWithCF-S2" p=@p bailout=@bailout cfseed=@cfseed juliaseed=#pixel numberofterms=@numberofterms seedpower=@seedpower normalize=@normalize seedfunc=@seedfunc fracfunc=@fracfunc periodicity = periodicity method = method f1=@f1 myOp1=@myOp1 } MandyWithCF-S2 { global: complex expansion[@numberofterms] complex target = @seedfunc(@cfseed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < @numberofterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: z = #pixel complex w = 0 int s = 0 loop: if z != 0 int idx = @numberofterms - 1 w = @f1(1.0/z) while idx >= 0 && w != 0 w = expansion[idx] + 1.0/w idx = idx - 1 endwhile else w = target endif if @myOp1 == 0 w = -w elseif @myOp1 == 2 if s == 0 w = -w endif s = 1 - s endif if @myOp1 <= 2 z = z^@p + @juliaseed + w elseif @myOp1 == 3 z = (z^@p + @juliaseed)*w else if w != 0 z = (z^@p + @juliaseed)/w else z = z^@p + @juliaseed endif endif bailout: |z| < @bailout default: param p caption = "power" default = (2.0,0.0) hint = "typical mandelbrot power" endparam param juliaseed caption = "Julia Seed" default = (-0.75,.1) endparam param bailout caption = "bailout" default = 128.0 endparam param cfseed caption = "Continued Fraction Seed" default = (0.6180339887, 0.0) hint = "This number generates the terms of the cf expansion." endparam param numberofterms caption = "Number Of Terms" default = 8 hint = "Number of terms in CF expansion of target" endparam param seedpower caption = "Seed Power" default = (1.0,0.0) hint = "The seed number is raised to this power before computing expansion." endparam param normalize caption = "Normalize?" default = false hint = "If on, then the terms of the expansion are normalized." endparam param normalfactor caption = "Factor" default = 1.0 visible = @normalize endparam func seedfunc caption = "CF Seed Function" default = ident() hint = "This function is applied to the seed before the expansion." endfunc func fracfunc caption = "Expansion Function" default = ident() hint = "This function is applied to every term of the expansion." endfunc func f1 caption = "Function 1" default = ident() endfunc param myOp1 caption = "Operator 1" enum = "-" "+" "mix" "*" "/" default = 0 endparam title = "MandyWithCF-S2" maxiter = 250 periodicity = 0 method = multipass switch: type = "MandyWithCF-S2" p=@p bailout=@bailout cfseed=@cfseed juliaseed=#pixel numberofterms=@numberofterms seedpower=@seedpower normalize=@normalize seedfunc=@seedfunc fracfunc=@fracfunc periodicity = periodicity method = method myOp1 = @myOp1 f1=@f1 } MandyWithCF2 { global: complex expansion[@numberofterms] complex target = @seedfunc(@cfseed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < @numberofterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: z = #pixel complex w = 0 int s = 0 loop: if z != 0 int idx = @numberofterms - 1 w = z while idx >= 0 && w != 0 w = expansion[idx] + z/w idx = idx - 1 endwhile else w = target endif if @myOp1 == 0 w = -w elseif @myOp1 == 2 if s == 0 w = -w endif s = 1-s endif if @myOp1 <= 2 z = z^@p + #pixel + w elseif @myOp1 == 3 z = (z^@p + #pixel)*w else if w != 0 z = (z^@p + #pixel)/w else z = z^@p + #pixel endif endif bailout: |z| < @bailout default: param p caption = "power" default = (2.0,0.0) hint = "typical mandelbrot power" endparam param bailout caption = "bailout" default = 128.0 endparam param cfseed caption = "Continued Fraction Seed" default = (0.6180339887, 0.0) hint = "This number generates the terms of the cf expansion." endparam param numberofterms caption = "Number Of Terms" default = 8 hint = "Number of terms in CF expansion of target" endparam param seedpower caption = "Seed Power" default = (1.0,0.0) hint = "The seed number is raised to this power before computing expansion." endparam param normalize caption = "Normalize?" default = false hint = "If on, then the terms of the expansion are normalized." endparam param normalfactor caption = "Factor" default = 1.0 visible = @normalize endparam func seedfunc caption = "CF Seed Function" default = ident() hint = "This function is applied to the seed before the expansion." endfunc func fracfunc caption = "Expansion Function" default = ident() hint = "This function is applied to every term of the expansion." endfunc param myOp1 caption = "Operator 1" enum = "-" "+" "mix" "*" "/" default = 0 endparam title = "MandyWithCF-V2" maxiter = 250 periodicity = 0 method = multipass switch: type = "MandyWithCF2-S1" p=@p bailout=@bailout cfseed=#pixel numberofterms=@numberofterms seedpower=@seedpower normalize=@normalize seedfunc=@seedfunc fracfunc=@fracfunc periodicity = periodicity method = method myOp1=@myOp1 } MandyWithCF2-S1 { global: complex expansion[@numberofterms] complex target = @seedfunc(@cfseed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < @numberofterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: z = #pixel complex w = 0 int s = 0 loop: if z != 0 int idx = @numberofterms - 1 w = z while idx >= 0 && w != 0 w = expansion[idx] + z/w idx = idx - 1 endwhile else w = target endif if @myOp1 == 0 w = -w elseif @myOp1 == 2 if s == 0 w = -w endif s = 1-s endif if @myOp1 <= 2 z = z^@p + #pixel + w elseif @myOp1 == 3 z = (z^@p + #pixel)*w else if w != 0 z = (z^@p + #pixel)/w else z = z^@p + #pixel endif endif bailout: |z| < @bailout default: param p caption = "power" default = (2.0,0.0) hint = "typical mandelbrot power" endparam param bailout caption = "bailout" default = 128.0 endparam param cfseed caption = "Continued Fraction Seed" default = (0.6180339887, 0.0) hint = "This number generates the terms of the cf expansion." endparam param numberofterms caption = "Number Of Terms" default = 8 hint = "Number of terms in CF expansion of target" endparam param seedpower caption = "Seed Power" default = (1.0,0.0) hint = "The seed number is raised to this power before computing expansion." endparam param normalize caption = "Normalize?" default = false hint = "If on, then the terms of the expansion are normalized." endparam param normalfactor caption = "Factor" default = 1.0 visible = @normalize endparam func seedfunc caption = "CF Seed Function" default = ident() hint = "This function is applied to the seed before the expansion." endfunc func fracfunc caption = "Expansion Function" default = ident() hint = "This function is applied to every term of the expansion." endfunc param myOp1 caption = "Operator 1" enum = "-" "+" "mix" "*" "/" default = 0 endparam title = "MandyWithCF-V2-S1" maxiter = 250 periodicity = 0 method = multipass switch: type = "MandyWithCF2-S2" p=@p bailout=@bailout cfseed=@cfseed juliaseed=#pixel numberofterms=@numberofterms seedpower=@seedpower normalize=@normalize seedfunc=@seedfunc fracfunc=@fracfunc periodicity = periodicity method = method myOp1=@myOp1 } MandyWithCF2-S2 { global: complex expansion[@numberofterms] complex target = @seedfunc(@cfseed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target float maxlength = 0.0 while totalterms < @numberofterms && newtarget != 0.0 expansion[totalterms] = trunc(newtarget) newtarget = newtarget - expansion[totalterms] expansion[totalterms] = @fracfunc(expansion[totalterms]) float length = cabs(expansion[totalterms]) if length > maxlength maxlength = length endif if newtarget != 0.0 newtarget = 1.0/newtarget endif totalterms = totalterms + 1 endwhile if @normalize int k = 0 while k < totalterms expansion[k] = expansion[k]/maxlength*@normalfactor k = k + 1 endwhile endif init: z = #pixel complex w = 0 int s = 0 loop: if z != 0 int idx = @numberofterms - 1 w = z while idx >= 0 && w != 0 w = expansion[idx] + z/w idx = idx - 1 endwhile else w = target endif if @myOp1 == 0 w = -w elseif @myOp1 == 2 if s == 0 w = -w endif s = 1-s endif if @myOp1 <= 2 z = z^@p + @juliaseed + w elseif @myOp1 == 3 z = (z^@p + @juliaseed)*w else if w != 0 z = (z^@p + @juliaseed)/w else z = z^@p + @juliaseed endif endif bailout: |z| < @bailout default: param p caption = "power" default = (2.0,0.0) hint = "typical mandelbrot power" endparam param juliaseed caption = "Julia Seed" default = (-0.75,.1) endparam param bailout caption = "bailout" default = 128.0 endparam param cfseed caption = "Continued Fraction Seed" default = (0.6180339887, 0.0) hint = "This number generates the terms of the cf expansion." endparam param numberofterms caption = "Number Of Terms" default = 8 hint = "Number of terms in CF expansion of target" endparam param seedpower caption = "Seed Power" default = (1.0,0.0) hint = "The seed number is raised to this power before computing expansion." endparam param normalize caption = "Normalize?" default = false hint = "If on, then the terms of the expansion are normalized." endparam param normalfactor caption = "Factor" default = 1.0 visible = @normalize endparam func seedfunc caption = "CF Seed Function" default = ident() hint = "This function is applied to the seed before the expansion." endfunc func fracfunc caption = "Expansion Function" default = ident() hint = "This function is applied to every term of the expansion." endfunc param myOp1 caption = "Operator 1" enum = "-" "+" "mix" "*" "/" default = 0 endparam title = "MandyWithCF-V2-S2" maxiter = 250 periodicity = 0 method = multipass switch: type = "MandyWithCF2-S2" p=@p bailout=@bailout cfseed=@cfseed juliaseed=#pixel numberofterms=@numberofterms seedpower=@seedpower normalize=@normalize seedfunc=@seedfunc fracfunc=@fracfunc periodicity = periodicity method = method myOp1=@myOp1 }