sierpinskid { ; Written by Luke Plant ; Modified by Frederik Slijkerman ; Generalized by Marcelo Anelli ; Caracas, Marzo de 1999 ; Tweaked with by Dan Kuzmenka 2000 init: complex z = pixel loop: IF (imag(z)>0.5) z = @factor*real(z) + flip(@factor*imag(z)-1) ELSEIF (real(z)>0.5) z = @factor*real(z)-1 + flip(@factor*imag(z)) ELSE z = @factor*real(z) + flip(@factor*imag(z)) z = @fn1(1/z^@factor) ENDIF bailout: ;|z| < @bailout (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout)) || \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Sierpinksi Triangle distorted" center = (0.4, 0.4) magn = 1.1538 maxiter = 149 param bailout caption = "Bailout value" default = 127 min = 1 endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam param factor caption = "Factor Transformation" default = 2.0 endparam func fn1 caption = "Function applied" default = ident() endfunc } Polynomial1 { ; Modified from a formula in The Beauty of Fractals ; Bailout test curtesy of Ron Barnett init: z=0 loop: z=(z^@power1/(1+z^@power1))+ #pixel bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout)) || \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Polynomial1" param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the set anymore." endparam param power1 caption = "Degree of the Polynomial" default = (2,0) hint = "This is the power that z is raised" endparam } Polynomial2 { ; Modified from a formula in The Beauty of Fractals ; Bailout test curtesy of Ron Barnett init: z=0 loop: z=(z^@power1/(1-z^@power1))+#pixel bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout)) || \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Polynomial2" param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the set anymore." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam param power1 caption = "Degree of Polynomial" default = (2,0) hint = "This is the power that z is raised" endparam } Polynomial3 { ; Modified from a formula in The Beauty of Fractals ; Bailout test curtesy of Ron Barnett init: z=0 loop: z=(1+z^@power2)/(1-z^@power2)+z^@power1 + #pixel bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout)) || \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Polynomial3" param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the set anymore." endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam param power2 caption = "Degree of first term in Polynomial" default = (2,0) endparam param power1 caption = "Degree of second term in Polynomial" default = (2,0) endparam } Polynomial4 { ; Modification of formula by Bob Margolis ; Bailout test curtesy of Ron Barnett init: z=0 loop: z=z^@power1 - z - #pixel bailout: |z| <= @bailout default: title = "Polynomial4" param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the set anymore." endparam param power1 caption = "Number of arms" default = (2,0) endparam } sierpinskiplane1 { ; Written by Luke Plant ; Modified by Frederik Slijkerman ; Modified by Samuel Monnier ; Modified by Daniel Kuzmenka init: z = #pixel+z i = 0 count = 0 loop: z = @f1(#pixel)^@offset3 n = (@offset1)^(@offset4*i) zi = round(z*n)/n z = @offset2*n*(z - zi) while |z| < @bailout && |z| > 0.001 count = count + 1 if imag(z) > @course z = @offset*z - 1i elseif real(z) > @course z = @offset*z - 1 else z = @offset*z endif endwhile i = i + 1 bailout: count < @endcount default: title = "Sierpinski Plane1" center = (0.4, 0.4) magn = 1.1538 maxiter = 1000 method = multipass periodicity = 0 param bailout caption = "Bailout value" default = 127 min = 1 endparam param offset caption = "Premultiplier" hint = "Use small variations around 2. Min=1.0 and max=4.0" default = 2.0 max = 4.0 min = 1.0 endparam param offset1 caption = "Another Premultiplier" hint = "Use small variations around 2. Min=0.75 and max=4.0" default = 2.0 min = 0.75 max = 4.0 endparam param offset2 caption = "distorts the lattice" hint = "Maximum = 5.0 and Minimum = 0.1" default = 1.0 min = 0.1 max = 5.0 endparam param offset3 caption = "Further distorts the lattice. Positive and Negative values allowed" hint = "Maximum = 2.0" default = 1.0 max = 2.0 endparam param offset4 caption = "Even further distorts the lattice." hint = "Maximum = 2.0" default = 1.0 ;max = 2.0 endparam param course caption = "Changes the courseness of the lattice." hint = "Positive and Negative values allowed" default = 0.5 endparam param endcount caption = "Number of times through the loop" hint = "min=20 and max=200" default = 100 min = 20.0 max = 200.0 endparam func f1 caption = "Function 1" default = ident() endfunc } Trapinski+ { ; By Samuel Monnier, 23.12.99 ;humbly tweaked by Dan Kuzmenka 3/7/2000 ; This formula divide the ; complex plane into squares ; of length 2^n at the nth ; iteration. The point bails ; out if it is inside (or outside) ; a shape centered in this square. ; It can gives some Sierpinski-like ; patterns. ; ; Here is a quick explanation about ; what each parameter do : ; ; Shape : Define the shape of the trap ; ; Shape parameter : A parameter of the ; equation of the trap. The default ; value is set so that it works well ; with the Astroïd. So you might have ; to change it if you are using another ; shape. If you use the Pinch, change ; this value to 5 or 6 (or the number ; of "petals" you want the pinch to ; have. On some shape like the Circle ; or the square, this parameter has no ; effect. ; ; Threshold : Define how far from the ; curve a point is considered as inside. ; No effect on some shapes. ; If the points aren't bailed out fast ; enough (ie the image is messy and long ; to calculate) or are bailed out too ; fast, changing this value can help. ; In this case, you can also try ; changing the size of the shape. ; ; Rotation Step : Allow you to rotate ; the trap at each iteration. ; ; Invert z : Apply z -> 1/z before ; trapping. This can change the ; shape of the trap. ; ; Graph functions : Only with the ; Graph shape. The graph shape ; is defined by f(x) = g(y). Set ; the y function to ident to get ; a "standard" graph. ; ; Anyway, if you have question, you ; can mail me at : ; samuel.monnier@urbanet.ch ; init: i = 0 z = #pixel x = @f1(real(z)) y = @f2(imag(z)) zz = x + flip(y) loop: ; Apply Function 3 and Rotation Step z = @f3(zz)*exp(1i*i*@rotst/180*pi) ; Compute the new z n = @f4((@power1^i))+@loopmod zi = round(z*n)/n z = n*(z - zi) i = i + 1 ; Aspect Ratio and Size z = (1/@r^.5*real(z) + @r^.5*imag(z)*1i)/@size ; Rotation of the Shape z = z*exp(-1i*@rot/180*pi) ; Invert z if @invert z = 1/z endif x = real(z) y = imag(z) bool nobail = true ; Circle if @shape == 0 if @inside == 0 if !(|z| > 1) nobail = false endif elseif @inside == 1 if !(|z| < 1) nobail = false endif endif endif ; Square if @shape == 1 if @inside == 1 if !(abs(real(z)) > 1 || abs(imag(z)) > 1) nobail = false endif elseif @inside == 0 if !(abs(real(z)) < 1 || abs(imag(z)) < 1) nobail = false endif endif endif ; Astroïd if @shape == 2 if @inside == 1 if !(abs(real(z))^@n + abs(imag(z))^@n > 1) nobail = false endif elseif @inside == 0 if !(abs(real(z))^@n + abs(imag(z))^@n < 1) nobail = false endif endif endif ; Folium if @shape == 3 if @inside == 1 if !(|x^3 + y^3 - 3*x*y| > @thresh) nobail = false endif elseif @inside == 0 if !(|x^3 + y^3 - 3*x*y| < @thresh) nobail = false endif endif endif ; Cissoïd if @shape == 4 if @inside == 1 if !(|y^2 - x^3/(@n - x)| > @thresh) nobail = false endif elseif @inside == 0 if !(|y^2 - x^3/(@n - x)| < @thresh) nobail = false endif endif endif ; Parabola if @shape == 5 if @inside == 1 if !(|y - x^2| > @thresh) nobail = false endif elseif @inside == 0 if !(|y - x^2| < @thresh) nobail = false endif endif endif ; Hyperbola if @shape == 6 if @inside == 1 if !(|y - 1/x| > @thresh) nobail = false endif elseif @inside == 0 if !(|y - 1/x| < @thresh) nobail = false endif endif endif ; Pinch if @shape == 7 pin = atan2(z) if pin < 0 pin = pin + 2*pi endif if @inside == 1 if !(|sqrt(cabs(z))/abs(sin(pin*@n/2))| > @thresh) nobail = false endif elseif @inside == 0 if !(|sqrt(cabs(z))/abs(sin(pin*@n/2))| < @thresh) nobail = false endif endif endif ; SC Parabola if @shape == 8 if @inside == 1 if !(|y^2 - x^3| > @thresh) nobail = false endif elseif @inside == 0 if !(|y^2 - x^3| < @thresh) nobail = false endif endif endif ; Line if @shape == 9 if @inside == 1 if !(|y - @n*x| > @thresh) nobail = false endif elseif @inside == 0 if !(|y - @n*x| < @thresh) nobail = false endif endif endif ; Cross if @shape == 10 if @inside == 1 if !(|(y + @n*x)*(y + 1/@n*x)| > @thresh) nobail = false endif elseif @inside == 0 if !(|(y + @n*x)*(y + 1/@n*x)| < @thresh) nobail = false endif endif endif ; Strophoïd if @shape == 11 if @inside == 1 if !(x^2 * (@n + x)/(@n - x) - y^2 > @thresh) nobail = false endif elseif @inside == 0 if !(x^2 * (@n + x)/(@n - x) - y^2 < @thresh) nobail = false endif endif endif ; Lemniscate if @shape == 12 if @inside == 1 if !(|(x^2 + y^2)^2 - @n^2*(x^2 - y^2)| > @thresh) nobail = false endif elseif @inside == 0 if !(|(x^2 + y^2)^2 - @n^2*(x^2 - y^2)| < @thresh) nobail = false endif endif endif ; Agnesi's Curve if @shape == 13 if @inside == 1 if !(|y - (1/(1 + x^2))| > @thresh) nobail = false endif elseif @inside == 0 if !(|y - (1/(1 + x^2))| < @thresh) nobail = false endif endif endif ; Graph if @shape == 14 if @inside == 1 if !(|@g2(y) - @g1(x)| > @thresh) nobail = false endif elseif @inside == 0 if !(|@g2(y) - @g1(x)| < @thresh) nobail = false endif endif endif ; Cross 2 if @shape == 15 if @inside == 1 if !(abs(real(z)) > 1 && abs(imag(z)) > 1) nobail = false endif elseif @inside == 0 if !(abs(real(z)) < 1 && abs(imag(z)) < 1) nobail = false endif endif endif bailout: nobail == true default: title = "Trapinski+" method = multipass periodicity = 0 param shape caption = "Shape" default = 1 enum = "Circles" "Squares" \ "Astroïd" "Folium" "Cissoïd" "Parabola" \ "Hyperbola" "Pinch" "SC Parabola" "Line" \ "Cross" "Strophoïd" "Lemniscate" \ "Agnesi's Curve" "Graph" "Cross 2" endparam param size caption = "Size of the Shape" default = .25 endparam param rot caption = "Rotation of the Shape" default = 0.0 endparam param r caption = "Ratio Width/Height" default = 1.0 endparam param n caption = "Shape parameter" default = .5 endparam param thresh caption = "Threshold" default = .2 endparam param rotst caption = "Rotation step" default = 0.0 endparam param inside caption = "Trapping region" default = 1 enum = "Outside" "Inside" endparam param invert caption = "Invert z?" default = false endparam param power1 caption = "Distorts the shape" default = 2.0 endparam param loopmod caption = "Modifies the loop calculations" default = 0.0 endparam func g1 caption = "Graph x Function" default = sin() endfunc func g2 caption = "Graph y Function" default = ident() endfunc func f1 caption = "Real twist function" default = ident() endfunc func f2 caption = "Imaginary twist function" default = ident() endfunc func f3 caption = "Another twist function" default = ident() endfunc func f4 caption = "Yet another twist function" default = ident() endfunc } barnsleyj1+ { ;Additional parameter added by Dan Kuzmenka 2000 init: z = pixel loop: IF real(z) >= 0 z = @f1((z - 1)) * @start ELSE z = (z + 1) * @start ENDIF bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout)) default: title = "Barnsley 1 (Julia)+" maxiter = 149 param start caption = "Parameter" default = (0.6, 1.1) endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 endparam func f1 caption="Function 1" hint="Use this to perturb the fractal." default = ident() endfunc switch: type = "barnsleym1" bailout = bailout test = test } Polynomial5 { ; Bailout test curtesy of Ron Barnett init: z=0 loop: z=z^(@offset*z)*@power1 + #pixel bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout)) || \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Polynomial5" param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam param bailout caption = "Bailout value" default = 4.0 min = 1.0 hint = "Defines how soon an orbit bails out, i.e. doesn't belong \ to the set anymore." endparam param power1 caption = "Degree of the Polynomial" default = (2,0) hint = "This is the power that z is raised" endparam param Offset default = 1.0 ;hint = "This is the power that z is raised" endparam } pc+{ ; By Samuel Monnier, 31.10.99 ;Tweaked by Dan Kuzmenka 3/13/00 init: z = @start c = #pixel loop: c = @f1(c^@power2) z = z^@power + @f2(c) bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout))|| \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Powered C+" center = (0, 0) param start caption = "Starting point" default = (0,0) endparam param power caption = "Power of z" default = (-1.5,1) endparam param power2 caption = "Power of c" default = (2,0) endparam param bailout caption = "Bailout value" default = 1e20 endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam func f1 caption = "First function" default = ident() endfunc func f2 caption = "Second function" default = ident() endfunc } zc+1 { ; From Samuel Monnier's Julifamily ; Modified by KPK, December 1999 ; Enhanced by Samuel Monnier, March 2000 ; Revision March, 3 ; Tweaked by Dan Kuzmenka March 17, 2000 ; Added parameters to modify the images in the tiles init: complex z = pixel int i = 0 z = z - @tilem z = z*exp(1i*pi/180*@rottile) zc = round(z/@sizesq)*@sizesq z = z*exp(-1i*pi/180*@rottile) zc = zc*exp(-1i*pi/180*@rottile) z = z - @tilem zc = zc - @tilem z = (z - zc)/@sizesq + @center z = z/@magn z = z*exp(1i*pi/180*@rot) loop: i = i + 1 if (imag(z)>0.5) z = @imagmod*z - 1i elseif (real(z)>0.5) z = @realmod*z - 1 else if @mode2 == 0 z = @func1((@totalmod*z)) elseif @mode2 == 1 z = @func1(@totalmod*z + i) elseif @mode2 == 2 z = @func1(@totalmod*z - i) elseif @mode2 == 3 z = @func1(@totalmod*z + zc) elseif @mode2 == 4 z = @func1(@totalmod*z - zc) elseif @mode2 == 5 z = @func1(@totalmod*z + z) elseif @mode2 == 6 z = @func1(@totalmod*z - z) endif endif if @mode == 0 z = z*zc elseif @mode == 1 z = z/zc elseif @mode == 2 z = z+zc elseif @mode == 3 z = z^zc endif bailout: (@test == 0 && |z| <= @bailout) || \ (@test == 1 && sqr(real(z)) <= @bailout) || \ (@test == 2 && sqr(imag(z)) <= @bailout) || \ (@test == 3 && (sqr(real(z)) <= @bailout && sqr(imag(z)) < @bailout)) || \ (@test == 4 && (sqr(real(z)) <= @bailout || sqr(imag(z)) < @bailout)) || \ (@test == 5 && (sqr(abs(real(z)) + abs(imag(z))) <= @bailout)) || \ (@test == 6 && (sqr(real(z) + imag(z)) <= @bailout))|| \ (@test == 7 && (real(z)) <= @bailout) || \ (@test == 8 && (imag(z)) <= @bailout) default: title = "Pinskyfamilyzc+" magn = 1.5 maxiter = 500 method = multipass param mode caption = "Mode" default = 0 enum = "Product" "Quotient" "Sum" "Power" endparam param mode2 caption = "Loop Modifier" default = 0 enum = "None" "+i" "-i" "+zc" "-zc" "+z" "-z" endparam param center caption = "Center" default = (.2,.2) endparam param magn caption = "Magnification" default = 1.0 endparam param rot caption = "Rotation" default = 0.0 endparam param tilem caption = "Tiling translation" default = (0,0) endparam param sizesq caption = "Size of the tiles" default = 0.6 endparam param rottile caption = "Rotation of the Tiling" default = 0.0 endparam param imagmod caption = "Imaginary modifier" default = 2.0 endparam param realmod caption = "Real modifier" default = 2.0 endparam param totalmod caption = "Total modifier" default = 2.0 endparam param bailout caption = "Bailout" default = 1e20 endparam param test caption = "Bailout Test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "modreal" "modimag" endparam func func1 caption = "Modifies the images in the tiles" default = ident() endfunc }