;Ben's Fractal Formulas ;Here are the results of my experimentation with fractals. ;All of these are original formulas, although often I used ;the Mset or another common fractal as a "starting point." Batwings { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Here is one of the first formulas I wrote. ;See the Julia Sets around (.2,0) when Param is .7. ;A weird-looking Mset appears when Param is 0 global: init: z=(0,0) loop: z = (@par-z)*(@par+z)*cabs(@par+(@mult*z)) + #pixel bailout: |z| < @bail default: periodicity=0 title = "Wings of Bat" param par caption = "Param" default = 1.0 endparam param bail caption = "Bailout" default = 40 endparam param mult caption = "Mult" default = (1.0,0.0) endparam switch: type="Batjulia" seed=#pixel par=par bail=bail mult=mult } Batjulia { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Julia form of "Batwings" global: init: z=#pixel loop: z = (@par-z)*(@par+z)*cabs(@par+(@mult*z)) + @seed bailout: |z| < @bail default: periodicity=0 title = "z Batwing Julia Set" param seed caption = "Julia Seed" default = (0.0,0.0) endparam param par caption = "Param" default = 1.0 endparam param bail caption = "Bailout" default = 40 endparam param mult caption = "Mult" default = (1.0,0.0) endparam } Angular { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;This formula uses DeMoivre's Theorem to break the power into three parts. ;Of course, when all of these parts are the same you get the standard Mset. ;The larger "Magnitude" is, the more "smooth" the shape will be. ;The "Coolness" factors can make cool variations and "decapitate" the Mset. ;Try negative values! init: z = #pixel angle = 0.03 a = 0.03 b = (.3,.3) magnitude = 0.03 theI = (0,1) loop: angle = atan2(z) a = real(z)+@pert1 b = imag(z)+(@pert2*(0,1)) magnitude = sqrt((a^2)+(b^2))^@power a = (magnitude*cos(angle*@pow1)) b = theI*(magnitude*sin(angle*@pow2)) z = a + b + #pixel bailout: |z| < @bailout default: title = "Angular Mandel!" maxiter = 149 param power caption = "Magnitude" default = 1.5 endparam param pow1 caption = "Cos" default = 2.0 endparam param pow2 caption = "Sin" default = 2.0 endparam param pert1 caption = "Coolness" default = 0.0 endparam param pert2 caption = "More Coolness" default = 0.0 endparam param bailout caption = "Bailout value" default = 40.0 min = 1.0 endparam switch: type = "AngularJ" seed=#pixel power=power pow1=pow1 pow2=pow2 pert1=pert1 pert2=pert2 } AngularJ { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Julia set of Angular Mandelbrot init: z = #pixel angle = 0.03 a = 0.03 b = (.3,.3) magnitude = 0.03 theI = (0,1) loop: angle = atan2(z) a = real(z)+@pert1 b = imag(z)+(@pert2*(0,1)) magnitude = sqrt((a^2)+(b^2))^@power a = (magnitude*cos(angle*@pow1)) b = theI*(magnitude*sin(angle*@pow2)) z = a + b + @seed bailout: |z| < @bailout default: title = "z Angular Julia Set" maxiter = 149 param seed caption = "Seed" default = (0.3583333334,-0.0625) endparam param power caption = "Magnitude" default = 1.5 endparam param pow1 caption = "Cos" default = 2.0 endparam param pow2 caption = "Sin" default = 2.0 endparam param pert1 caption = "Coolness" default = 0.0 endparam param pert2 caption = "More Coolness" default = 0.0 endparam param bailout caption = "Bailout value" default = 40.0 min = 1.0 endparam } FviewDisco { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Use the Switch to find some sweet Julia sets. ;Look for the "Mushrooms," you'll know what I mean when you see them. ;Bailout is an important parameter. init: z =(0,0) loop: z=fn2(z+fn1(#pixel))^@power bailout: |z|<= @bailout default: title = "Sweet Julias - Inside the Disco ball" maxiter = 149 complex func fn1 caption="X Coordinate Func" default=ident() endfunc complex func fn2 caption="Y Coordinate Func" default=abs() endfunc param power caption = "power" default = (-1.0,0.0) endparam param bailout caption = "Bailout value" default = 40.0 min = 1.0 endparam switch: type="FviewJ" fn1=fn1 bailout=bailout power=power fn2=fn2 c=#pixel } FviewNeon { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Use the Switch to find some sweet Julia sets. ;Try changing the X Coord Function ;Bailout is an important parameter. init: z =(0,0) loop: z=fn2(z+fn1(#pixel))^@power bailout: |z|<= @bailout default: title = "Sweet Julias - Neon Designs" center=(-1.492653526,-2.88352521885) magn=0.47204969 maxiter = 149 complex func fn1 caption="X Coordinate Func" default=exp() endfunc complex func fn2 caption="Y Coordinate Func" default=abs() endfunc param power caption = "power" default = (0.0,-1.0) endparam param bailout caption = "Bailout value" default = 20.0 min = 1.0 endparam switch: type="FviewJ" fn1=fn1 bailout=bailout power=power fn2=fn2 c=#pixel } FviewTan { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Use the Switch to find some sweet Julia sets. ;Look to the Left of the Julia sets for more detail!!! ;To see "hyper veggies," look at Jset seed 1.50599060533,-0.0179266675506 init: z =(0,0) loop: z=fn2(z+fn1(#pixel))^@power bailout: |z|<= @bailout default: title = "Sweet Julias - Tangent Veggies" center=(1.50813869522,-0.01317965409039) magn=157.11633 maxiter = 149 complex func fn1 caption="X Coordinate Func" default=tan() endfunc complex func fn2 caption="Y Coordinate Func" default=abs() endfunc param power caption = "power" default = (1.0,1.0) endparam param bailout caption = "Bailout value" default = 200.0 min = 1.0 endparam switch: type="FviewJ" fn1=fn1 bailout=bailout power=power fn2=fn2 c=#pixel } FviewExp { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Use the Switch to find some sweet Julia sets. ;Bailout is an important parameter. init: z =(0,0) loop: z=fn2(z+fn1(#pixel))^@power bailout: |z|<= @bailout default: title = "Sweet Julias - Absolute Madness eXP" center=(2.27217665905,1.64814078) magn=3.9261823 maxiter = 149 complex func fn1 caption="X Coordinate Func" default=exp() endfunc complex func fn2 caption="Y Coordinate Func" default=abs() endfunc param power caption = "power" default = (0.0,-2.0) endparam param bailout caption = "Bailout value" default = 530.0 min = 1.0 endparam switch: type="FviewJ" fn1=fn1 bailout=bailout power=power fn2=fn2 c=#pixel } FviewJ { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Julia form of Function viewers init: z =#pixel loop: z=fn2(z+fn1(@c))^@power bailout: |z|<= @bailout default: title = "z Julia Function Viewer" maxiter = 149 complex func fn1 caption="X Coordinate Func" default=ident() endfunc complex func fn2 caption="Y Coordinate Func" default=abs() endfunc param power caption = "power" default = (-1.0,0.0) endparam param c caption = "Seed" default = (-0.1875,0.1166666667) endparam param bailout caption = "Bailout value" default = 40.0 min = 1.0 endparam } DynamicCloud { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Originally an IFS type fractal that I modified to make this. ;See this: a = (2,0) b = (-1.7,1.7) ;Weird eyeballs: a = (2,0) b = (-1.1,1.2) init: z=(0,0) loop: x=real(z) y=imag(z) w=(@a*x+@b*fn1(x)) z=y+w+((w-x)*(0,1))+#pixel bailout: |z| <= @bailout default: title = "Dynamic Cloud" maxiter = 100 periodicity = 0 method = guessing param a caption = "a" default = (2, 0.0) endparam param b caption = "b" default = (-3, 0.0) endparam param bailout caption = "Bailout value" default = 64.0 min = 1 endparam func fn1 caption="F" default=sin() endfunc switch: type = "DynamicCloud" a =#pixel bailout = bailout b=b power=power fn1 = fn1 } Flipped { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Uses the "flip" function to make things interesting. ;Asin() gives good results when bailout is low. And change mult to 0. global: init: z=(0,0) loop: z = fn1(flip(z^@power))+ z*@mult + #pixel bailout: |z| < @bail default: title = "Flipped Fractal" complex func fn1 caption="Func" default=ident() endfunc param power hint="Power" default=2.0 endparam param mult hint="Mult" default=(-1.0,0.0) endparam param bail hint="Bailout" default=400 endparam switch: type="FlippedJ" seed=#pixel bail=bail power=power fn1=fn1 mult=mult } FlippedAsin { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Asin() gives good results when bailout is low. And change mult to 0. global: init: z=(0,0) loop: z = fn1(flip(z^@power))+ z*@mult + #pixel bailout: |z| < @bail default: title = "Sweet Julias - Insane Asin" complex func fn1 caption="Func" default=asin() endfunc param power hint="Power" default=-2.0 endparam param mult hint="Mult" default=(0.0,0.0) endparam param bail hint="Bailout" default=10 endparam switch: type="FlippedJ" seed=#pixel bail=bail power=power fn1=fn1 mult=mult } HyperPetals { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Asin() gives good results when bailout is low. And change mult to 0. global: init: z=(0,0) loop: z = fn1(flip(z^@power))+ z*@mult + #pixel bailout: |z| < @bail default: title = "HyperPetals" complex func fn1 caption="Func" default=sin() endfunc param power hint="Power" default=-2.0 endparam param mult hint="Mult" default=(1.0,0.0) endparam param bail hint="Bailout" default=400 endparam switch: type="FlippedJ" seed=#pixel bail=bail power=power fn1=fn1 mult=mult } FlippedJ { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Uses the "flip" function to make things interesting. global: init: z=#pixel loop: z = fn1(flip(z^@power))+ z*@mult + @seed bailout: |z| < @bail default: title = "z Flipped Fractal Julia" complex func fn1 caption="Func" default=asin() endfunc param power hint="Power" default=-2.0 endparam param seed hint="Julia Seed" default=(-0.0170092189,0.565024819) endparam param mult hint="Mult" default=(0.0,0.0) endparam param bail hint="Bailout" default=10 endparam } cburst { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ global: init: z=(0,0) float rea = 0.0 float imagi = 0.0 float mag = 0.0 loop: rea = real(z) imagi = imag(z) angle = atan2(z)+(@c2*(0,1)) mag = sqrt(rea^2+imagi^2) z = (mag^@power2)*(z^@power)*cos(angle*@mult)*sin(angle*@mult) + #pixel bailout: |z| < @bail default: title = "Color Burst" param c2 caption = "Sweet Adjust" default = 0.0 endparam param power caption = "Z Power" default = 2.0 endparam param power2 caption = "Magnitude Power" default = -3.0 endparam param mult caption = "Angle Multiplier" default = 3.0 endparam param bail caption = "Bailout" default = 4.0 endparam switch: type = "cburstj" seed=#pixel c2 =c2 power=power power2=power2 bail=bail mult=mult } cburstj { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ global: init: z=#pixel float rea = 0.0 float imagi = 0.0 float mag = 0.0 loop: rea = real(z) imagi = imag(z) angle = atan2(z)+(@c2*(0,1)) mag = sqrt(rea^2+imagi^2) z = (mag^@power2)*(z^@power)*cos(angle*@mult)*sin(angle*@mult) + @seed bailout: |z| < @bail default: title = "z Bursting Julia" param seed caption = "Julia Seed" default = (0.0,0.0) endparam param c2 caption = "Sweet Adjust" default = 0.0 endparam param power caption = "Z Power" default = 2.0 endparam param power2 caption = "Magnitude Power" default = -3.0 endparam param mult caption = "Angle Multiplier" default = 3.0 endparam param bail caption = "Bailout" default = 4.0 endparam } rainbowbrot { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;A variation on the Mset. global: init: z=(0,0) a = @ai loop: a = a+(a/@blur) z = a*z*((1-z)^(@power-1)) + #pixel bailout: |z| < @bail default: title = "Rainbow Mandelbrot" periodicity=0 param ai caption = "Param" default = (0.4,0.0) endparam param blur caption = "Blur/Swirl" default = (100,0.0) endparam param power caption = "power" default = 2.0 endparam param bail caption = "Bail" default = 75.0 endparam switch: type="rainbowbrotJ" seed=#pixel ai=ai blur=blur power=power bail=bail } rainbowbrotJ { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;A variation on the Jset. global: init: z=#pixel a = @ai loop: a = a+(a/@blur) z = a*z*((1-z)^(@power-1)) + @seed bailout: |z| < @bail default: periodicity=0 title = "z Rainbow Julia Set" param seed caption = "Julia Seed" default = (1.9125,0.1125) endparam param ai caption = "Param" default = (0.4,0.0) endparam param blur caption = "Blur/Swirl" default = (100,0.0) endparam param power caption = "power" default = 2.0 endparam param bail caption = "Bail" default = 75.0 endparam } RandomShape { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Change the Seed to get a different picture. ;Also try different coloring formulas. global: init: z= 0 int seed = @theseed float a = 4 loop: seed = random(seed) a = abs(seed)/#randomrange if a>0.2 if a>0.4 if a>0.6 if a>0.8 z = z^4 + #pixel endif z = z^3 + #pixel endif z = z^2 + #pixel endif z = z + #pixel endif bailout: |z| < @bail default: periodicity=0 title = "Random Shape Generator" param theseed caption = "Random Seed" default = 45 endparam param bail caption = "Bailout" default = 400 endparam } secantsketch { ;Original formula at http://astronomy.swin.edu.au/~pbourke/fractals/thorn/ ;Made cool by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ global: init: z=(0,0) value=0.0 loop: x=real(z) y=imag(z) tempx= (x/cos(y))*@mult+real(#pixel) tempy = (y/cos(x))*@mult+imag(#pixel) z=tempx + tempy*(0,1) if @bailmode value=|z| else value=x+y endif bailout: value < @bail default: periodicity = 0 angle=0.001 title = "Secant Sketch!" param mult caption = "Multiplier" default = (1.0,0.0) endparam param bail caption = "Bail" default = 10000 endparam param bailmode caption = "Bail Mode" default=true endparam switch: type="secantsketchJ" seed=#pixel mult=mult bail=bail bailmode=bailmode } secantsketchJ { ;Original formula at http://astronomy.swin.edu.au/~pbourke/fractals/thorn/ ;Made cool by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ global: init: z=#pixel value=0.0 loop: x=real(z) y=imag(z) tempx= (x/cos(y))*@mult+real(@seed) tempy = (y/cos(x))*@mult+imag(@seed) z=tempx + tempy*(0,1) if @bailmode value=|z| else value=x+y endif bailout: value < @bail default: periodicity = 0 angle=0.001 title = "z Secant Sketch Julia" param mult caption = "Multiplier" default = (1.0,0.0) endparam param seed caption = "Julia Seed" default = (0.0,0.0) endparam param bail caption = "Bail" default = 10000 endparam param bailmode caption = "Bail Mode" default=true endparam } timewarp { ;Modification of Secant Sketch, but with hyperbolic secant ;by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ global: init: z=(0,0) value=0.0 loop: x=real(z) y=imag(z) tempx= (x/cos(y))*@mult+real(#pixel) tempy = (y/cosh(x))*@mult+imag(#pixel) z=tempx + tempy*(0,1) if @bailmode value=|z| else value=x+y endif bailout: value < @bail default: periodicity = 0 angle=0.001 title = "Time Warp" param mult caption = "Multiplier" default = (1.0,0.0) endparam param bail caption = "Bail" default = 10000 endparam param bailmode caption = "Bail Mode" default=true endparam switch: type="timewarpj" seed=#pixel mult=mult bail=bail bailmode=bailmode } timewarpj { ;by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Modification of Secant Sketch global: init: z=#pixel value=0.0 loop: x=real(z) y=imag(z) tempx= (x/cos(y))*@mult+real(@seed) tempy = (y/cosh(x))*@mult+imag(@seed) z=tempx + tempy*(0,1) if @bailmode value=|z| else value=x+y endif bailout: value < @bail default: periodicity = 0 angle=0.001 title = "z Time Warp Julia" param mult caption = "Multiplier" default = (1.0,0.0) endparam param seed caption = "Julia Seed" default = (0.0,2.6625) endparam param bail caption = "Bail" default = 10000 endparam param bailmode caption = "Bail Mode" default=true endparam } Tangoid { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;This versitile formula allows creation of several shapes. global: init: z=(0,0) loop: z=@mult*z*fn1(fn2(z))^@power+#pixel bailout: |z| < @bail default: periodicity = 0 center=(-2.2,0) magn=1 title = "Tangoid" param power caption = "Power" default = (1.0,0.0) endparam param mult caption = "Multiplier" default = (1.0,0.0) endparam param bail caption = "Bail" default = 600 endparam complex func fn1 caption="X Coordinate Func" default=tan() endfunc complex func fn2 caption="Y Coordinate Func" default=ident() endfunc param bailmode caption = "Bail Mode" default=true endparam switch: type="TangoidJ" seed=#pixel power=power bail=bail mult=mult fn1=fn1 fn2=fn2 } TangoidJ { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;This versitile formula allows creation of several shapes. global: init: z=#pixel value=0.0 loop: z=@mult*z*fn1(fn2(z))^@power+@seed bailout: |z| < @bail default: periodicity = 0 angle=0 title = "z Tangoid Julia" param seed caption = "seed" default = (-0.63534722177,-0.0015972223833) endparam param mult caption = "Multiplier" default = (1.0,0.0) endparam param power caption = "Power" default = (.4,0.0) endparam param bail caption = "Bail" default = 60 endparam complex func fn1 caption="X Coordinate Func" default=tan() endfunc complex func fn2 caption="Y Coordinate Func" default=ident() endfunc param bailmode caption = "Bail Mode" default=true endparam } volterraKalei { ;Modified by Ben Fisher, to add artificial symmetry ;Written by Luke Plant ;The artificial symmetry forces the fractal to be symmetrical init: float x = real(@mult*fn2(pixel)) float y = imag(@mult*fn2(pixel)) float f = 0.0 float g = 0.0 float p = imag(@j) float h = real(@j) float x2 = 0.0 float y2 = 0.0 z = pixel loop: f = x - x * y g = -y + x * y x2 = x + p * f y2 = y + p * g x = x + h/2 * (f + ( x2 - x2*y2)) y = y + h/2 * (g + (-y2 + x2*y2)) z = x + (y*(0,1)) bailout: |z| < @bailout default: title = "Kaleidoscope!" maxiter = 149 periodicity=0 param j caption = "Julia Parameter" default = (0.26,0.0) endparam param mult caption = "Artificial Symmetry" default = (1,0) endparam func fn2 caption= "Function" default = abs() endfunc param bailout caption = "Bailout value" default = 256.0 min = 1 endparam switch: type="volterraKalei" bailout=bailout fn2=fn2 mult=mult j=#pixel } HenonFlame { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Based loosely on the Henon IFS formula. ;Uses primitive artificial symmetry. init: float a = real(@j) float b = imag(@j) complex tempx=(0.0,0.0) complex x=(0.0,0.0) complex y=(0.0,0.0) z = fn2(#pixel)^@power loop: x=real(abs(fn1(z))) y=imag(abs(fn1(z))) tempx = x x=(x*a)-(y-(x*x))*b y = (tempx*b) + (y-tempx*tempx)*a z = x + (y*(0,1)) bailout: |z| < @bailout default: title = "Henon Flame" maxiter = 149 periodicity=0 param j caption = "Henon Parameter 1" default = (-0.6958333334,0.8125000001) endparam param power caption = "Power" default = (1,0) endparam func fn2 caption="Complete Function" default = ident() endfunc func fn1 caption="Variable Function" default = ident() endfunc param bailout caption = "Bailout value" default = 25.0 min = 1 endparam switch: type="HenonFlame" bailout=bailout fn1=fn1 fn2=fn2 power=power j=#pixel } Z2Z { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ ;Raises Z to the Z power. Optionally makes symmetry. global: init: z=(0,0) c=(0.0,0.0) c=#pixel if (@mode==true) if (real(c)>0) c=(0-real(c))+((0,1)*imag(c)) endif endif if (@mode==false) if (real(c)<0) c=(real(c)*-1)+((0,1)*imag(c)) endif endif loop: z = (z^@power)^(z+@plus)*@times + c bailout: |fn1(z)| < @bail default: center=(0,0) magn=16 title = "Z to the Z" param mode caption = "Symmetry Reflect" default=false endparam func fn1 caption = "Bail Function" default = ident() endfunc param plus caption = "Z Plus" default = 0.0 endparam param times caption = "Times" default = -2.0 endparam param power caption = "Z Power" default = (1.0,0.0) endparam param bail caption = "Bailout" default = 4.0 endparam switch: type="Z2Zj" seed=#pixel plus=plus times=times power=power bail=bail mode=mode fn1=fn1 } Z2Zj { ;Formula by Ben Fisher, 2004 - http://www.angeltowns2.net/jamonben/ufanim/ global: init: z=#pixel c=(0.0,0.0) c=@seed if (@mode==true) if (real(z)>0) z=(0-real(z))+((0,1)*imag(z)) endif endif loop: z = (z^@power)^(z+@plus)*@times + c bailout: |fn1(z)| < @bail default: title = "z to the z Julia" param mode caption = "Symmetry Reflect" default=false endparam func fn1 caption = "Bail Function" default = ident() endfunc param plus caption = "Z Plus" default = 0.0 endparam param times caption = "Times" default = -2.0 endparam param power caption = "Julia Seed" default = (0.0,0.0) endparam param power caption = "Z Power" default = (1.0,0.0) endparam param bail caption = "Bailout" default = 4.0 endparam }