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 } 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: complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target while totalterms < #maxiter - 1 && 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 init: bool done = false int i = totalterms - 1 z = #pixel if z != 0 z = 1.0/z else i = -1 endif z = @init(z^@initpower) complex newz = z complex oldz = z float delta = 1.0E20 loop: done = false if @typeof == 0 || @typeof == 1 && 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 newz != 0 if @typeof == 0 z = expansion[newi] + 1.0/newz else z = expansion[newi] + target/newz endif i = i - 1 if i < 0 done = true endif else i = 0 done = true 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" 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." 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 termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." endparam param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." 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 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 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 } ContinuedFractions-UF3-V2.0-Julia1 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target while totalterms < #maxiter - 1 && 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 init: int i = totalterms - 1 z = #pixel if z != 0 z = 1.0/z else i = -1 endif z = @init(z^@initpower) complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof == 0 || @typeof == 1 && 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 newz != 0 if @typeof == 0 z = expansion[newi] + 1.0/newz else z = expansion[newi] + target/newz endif i = i - 1 if i < 0 done = true endif else i = 0 done = true 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" 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." 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 termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." endparam param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." 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 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 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 } ContinuedFractions-UF3-V2.0-Julia2 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target while totalterms < #maxiter - 1 && 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 init: int i = totalterms - 1 z = #pixel if z != 0 z = 1.0/z else i = -1 endif z = @init(z^@initpower) complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof == 0 || @typeof == 1 && 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 newz != 0 if @typeof == 0 z = expansion[newi] + 1.0/newz else z = expansion[newi] + target/newz endif i = i - 1 if i < 0 done = true endif else i = 0 done = true 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" 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." 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 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 endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." endparam param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." 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 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 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 } ContinuedFractions-UF3-V2.0-Julia3 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target while totalterms < #maxiter - 1 && 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 init: int i = totalterms - 1 z = #pixel if z != 0 z = 1.0/z else i = -1 endif z = @init(z^@initpower) complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof == 0 || @typeof == 1 && 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 newz != 0 if @typeof == 0 || @typeof == 1 z = expansion[newi] + @seed2/newz endif i = i - 1 if i < 0 done = true endif else i = 0 done = true 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" 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." 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 termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 min = 0 endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." endparam param seed2 caption = "Seed 2" default = (1.0,0) hint = "Formula is a[i] + seed2/z for types I and II" endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." endparam param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." 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 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 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 } ContinuedFractions-UF3-V2.0-Julia4 { ; Mark Hammond, 8-31-02 ; Another formula based on the ideas of continued fractions global: complex expansion[#maxiter] complex target = @seedfunc(@seed^@seedpower) int totalterms=0 complex newtarget=target ; compute CF expansion of target while totalterms < #maxiter - 1 && 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 init: int i = totalterms - 1 z = #pixel if z != 0 z = 1.0/z else i = -1 endif z = @init(z^@initpower) complex newz = z bool done = false complex oldz = z float delta = 1.0E20 loop: done = false if @typeof == 0 || @typeof == 1 && 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 newz != 0 if @typeof == 0 || @typeof == 1 z = expansion[newi] + @seed2/newz + @seed3 endif i = i - 1 if i < 0 done = true endif else i = 0 done = true 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" 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." 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 termtouse caption = "Term To Use" default = 0 hint = "For 1 Term variant this is the term to use." visible = @variant1 == 2 min = 0 endparam param seed caption = "Seed" default = (3.14159265358979323846264338, 0.0) hint = "This number generates the CF expansion." endparam param seed2 caption = "Seed 2" default = (1.0,0) hint = "Formula is a[i] + seed2/z for types I and II" endparam param seed3 caption = "Seed 3" default = (0.0, 0.0) hint = "This perturbs each iteration." endparam func seedfunc caption = "Seed function" default = ident() hint = "Function is applied to the seed before computing continued fraction expansion." endfunc param seedpower caption = "Seed Power" default = (1.0, 0.0) hint = "This power is applied to the seed before the CF expansion." endparam param initpower caption = "Initial Power" default = (1.0,0.0) hint = "This power is applied once for each pixel." endparam param iterpower caption = "Iterated Power" default = (-2.0, 0.0) hint = "z is raised to this power through each iteration." endparam param bailout caption = "Bail Out" default = 1.0E20 hint = "Run through loop as long as z < bailout" endparam param convCheck caption = "Convergence Check" default = false hint = "If on, does a simple check for convergence at each iteration." 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 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 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 } 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 complex myZ = (0,0) while i < #maxiter myZ = myZ^@seedpower + @seed boost[i] = myZ i = i + 1 endwhile init: int idx = 0 int newidx = 0 z = 0 loop: newidx = idx if @reverse newidx = #maxiter-1-idx endif z = z^@iterpower + #pixel + boost[newidx] 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 reverse caption = "Reverse Sequence?" default = true hint = "Reverses the order in which the terms are added to the formula." endparam param bailout caption = "Bailout" default = 128 hint = "Traditional bailout" endparam switch: type = "WorkingTitle-Julia1" seed = #pixel iterpower = @iterpower seedpower = @seedpower method = method periodicity = periodicity } 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 complex myZ = (0,0) while i < #maxiter myZ = myZ^@seedpower + @seed boost[i] = myZ i = i + 1 endwhile init: int idx = 0 int newidx = 0 z = 0 loop: newidx = idx if @reverse newidx = #maxiter-1-idx endif z = z^@iterpower + #pixel + boost[newidx] 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 reverse caption = "Reverse Sequence?" default = true hint = "Reverses the order in which the terms are added to the formula." endparam param bailout caption = "Bailout" default = 128 hint = "Traditional bailout" endparam switch: type = "WorkingTitle-Julia2" seed = seed seed2 = #pixel iterpower = @iterpower seedpower = @seedpower method = method periodicity = periodicity } 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] int i=0 complex myZ = (0,0) while i < #maxiter myZ = myZ^@seedpower + @seed boost[i] = myZ i = i + 1 endwhile init: int idx = 0 int newidx = 0 z = #pixel loop: newidx = idx if @reverse newidx = #maxiter-1-idx endif z = z^@iterpower + @seed2 + boost[newidx] idx = idx + 1 bailout: |z| < @bailout default: periodicity = 0 method = multipass title = "WorkingTitle-Julia2" 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 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 bailout caption = "Bailout" default = 128 hint = "Traditional bailout" endparam switch: type = "WorkingTitle-Julia2" seed = seed seed2 = #pixel iterpower = @iterpower seedpower = @seedpower method = method periodicity = periodicity } 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 while i < #maxiter boost[i] = @myAspect*@radius*cos(theta) + @radius*flip(sin(theta))+@circcenter theta = theta + thetadelta i = i + 1 endwhile init: int idx = 0 z = 0 loop: z = z^@p + #pixel + boost[idx] idx = idx + 1 bailout: |z| < @bailout default: title = "CurveBoostMandel" periodicity = 0 method = multipass #maxiter = 100 param curve caption = "Curve Type" enum = "Circle" 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 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 = "Circle/Ellipse Center" default = (0.0,0.0) hint = "This is the center of the circle/ellipse." visible = @curve == 0 endparam param p caption = "Power" default = (2.0, 0.0) hint = "mandelbrot power" 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 } 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 while i < #maxiter boost[i] = @myAspect*@radius*cos(theta) + @radius*flip(sin(theta))+@circcenter theta = theta + thetadelta i = i + 1 endwhile init: int idx = 0 z = #pixel loop: z = z^@p + @seed + boost[idx] idx = idx + 1 bailout: |z| < @bailout default: title = "CurveBoostJulia" periodicity = 0 method = multipass #maxiter = 100 param curve caption = "Curve Type" enum = "Circle/Ellipse" 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 endparam param circcenter caption = "Circle/Ellipse Center" default = (0.0,0.0) hint = "This is the center of the circle/ellipse." visible = @curve == 0 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 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 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 }