comment { MMF3 colouring 3.9 (Colourings for Ultrafractal 3+) (5th June 2007) Added the Stars colouring. (10th January 2007) Fixed Field Lines to work in UF3. Added the Distance/Rotation colouring. (6th January 2007) Added a couple of options to Field Lines, one of which improves the accuracy of the rendering quite a bit, the other just an interesting accident. (30th March 2006) Added "Field Lines". Corrected thanks to Chris Hayton. (3rd February 2006) Added the Predictor options to Interpolation Constants. (29th January 2006) Added the extra version options to Turning Points and Orbital Waves and added a corrected version of colour by distance to Orbital Waves. (22nd January 2006) Added "Interpolation Constants". Also added colour by distance to "Orbital Waves" and "Turning Points". (10th January 2006) Added more trapping options to Turning Points. (9th January 2006) Added more options to the user parameter trapping in Turning Points, with more to be added. (8th January 2006) Added some more trapping options to Orbital Waves and Turning Points and masking options to Orbital Waves, Turning Points and Periodicity. (7th January 2006) Added some control options to "Orbital Waves". (6th January 2006) Added two extra colouring choices to "Turning Points". (3rd January 2006) Added "Orbital Waves" and a couple of extras to "Turning Points". (2nd January 2006) (Optionally) added a bugfix to "Turning Points", specifically there was an error in the "Average" methods which produced some iteration banding. There is now a switch to correct this, default is "off" so as not to cause compatibility problems. Also added more options and some bugfixes to "Periodicity". Please Note that some UPRs using the previous version of Periodicity may get broken by one of the bugfixes, if you have this problem and wish to correct it please mail me as I've kept the previous version of the formula. (30th December 2005) Added "Turning Points" (14th December 2005) Added "Periodicity" (26th November 2004) Added "Vergence". (14th November 2004) Added "Extended Cilia" and updated all to include the "Auto-power" option which fixes standard iteration smoothing to work with all? formulas. Also had added convergent Hinrich smoothing for MMF formulas that use it, but this is probably superfluos with the auto-power option :-) (4th February 2004) Added "Centre of Curvature" (25th January 2004) Added "Curvature and Acceleration" (27th June 2003) Added convergent smoothing and some extras to Orbitals+, also added "morphing" to the fBm formulas. (23rd February 2003) Added Orbitals+ (Orbitals with added fBm). (27th January 2003) Array out of bounds problem fixed, final z smoothing added and "sea level" added to the slope version. (1st January 2003) Updated the fBm algorithm to use float n%16384 instead of int n%16384, this avoids possible problems when the frequency parameters are set high. Added the alternative fBm II algorithm for colouring "outside" areas of non-pixel formulas. (30th December 2002) Added a new fBm algorithm which allows smoothing for non-pixel "outside" areas and has a slope (lighting) mode for pixel formulas. Dave Makin (Makin' Magic) http://website.lineone.net/~dave_makin/ http://makinmagic.deviantart.com/ http://djm.digitalart.org/ http://www.renderosity.com/mod/gallery/browse.php?usernane=MakinMagic http://skyscraper.fortunecity.com/terabyte/966/ dave_makin@lineone.net dave@parystec.demon.co.uk } MMF3-Stars { global: complex p[@numstars] complex cen = #center float r[@numstars] float c[@numstars] int gi = 0 int gj = 0 int seed = @rnd float irr = 1.0/#randomrange float dt = 2.0*irr/#magn float gw = #height/#width float gh if @method==0 if gw<0.75 gh = 0.75*dt gw = 0.75*dt*gw else gh = dt*gw gw = dt endif else gw = irr*real(@offsets) gh = irr*imag(@offsets) cen = @centre endif dt = irr*@scale/@numdice float h = 0.5*@scale float dv = 0.0 repeat p[gi] = gw*(seed=random(seed)) + flip(gh*(seed=random(seed))) + cen gj = 0 dv = 0.0 repeat dv = dv + dt*abs(seed=random(seed)) until (gj=gj+1)>=@numdice if @wrapdice dv = 2.0*abs(dv-h) endif r[gi] = dv*dv c[gi] = irr*abs(seed=random(seed)) until (gi=gi+1)>=@numstars init: float mag = 0.0 float min = 1e200 complex zv = #z loop: if @method==1 if (mag=|#z|)=@numstars if k>=0 if @fade>=0 #color = compose(gradient(c[k]),@colour,@fade*sqrt(md/r[k])) else #color = compose(gradient(c[k]),@colour,-@fade*(1.0-sqrt(md/r[k]))) endif else #solid = true endif default: title = "MMF3 Stars" param method caption = "Method" enum = "Pixel" "Orbit trap" default = 0 hint = "Pixel is really for use with pixel formulas, Orbit trap extends \ the use to other formulas." endparam param centre caption = "Central coord." default = (0,0) hint = "Specifies the relative central point for the stars." visible = @method>0 endparam param offsets caption = "Width/Height" default = (4,4) hint = "Specifies the size of the area covered by stars." visible = @method>0 endparam param numstars caption = "Number of stars" default = 2000 min = 1 max = 10000 hint = "Specifies the number of stars to generate. Note that when working \ on an image at say 640*480 to later be rendered at say 8000*6000 \ then you may need to set this number higher than you think \ necessary on the smaller version as there will appear to be a \ larger density of stars on the small version as compared to the \ large." endparam param scale caption = "Star scale" default = 0.1 min = 0.0 hint = "Scales all the stars from the smallest to the largest." endparam param fade caption = "Star fade" default = 0.5 min = -1.0 max = 1.0 hint = "Determines how much the star colouring fades towards the 'Fade \ Colour'. Zero produces no fading, one produces maximum \ fading, negative values reverse the fading with -1 the minimum." endparam color param colour caption = "Fade Colour" default = rgba(0,0,0,1.0) hint = "Altering the opacity is effectively the same as changing the 'Star \ fade' except that you can only reverse the direction by changing \ the 'Star fade' value." endparam param rnd caption = "Random seed" default = 123456 hint = "The base seed for randomising, change to produce different \ starfields." endparam param numdice caption = "Number of dice" default = 8 min = 1 max = 64 hint = "Affects the bias of the randoms for star sizes. With a single dice \ there is no bias, when using multiple dice the bias is either to \ the minimum size or the average size depending how you set 'Wrap \ sizes'." endparam param wrapdice caption = "Wrap sizes" default = true hint = "When enabled the size randoms are manipulated so that the smallest \ star size is most probable. If disabled then the average star size \ is most probable. If only one dice is used then the only effect of \ changing this parameter is to change the distribution slightly but \ not the relative probabilities of different sized stars." endparam } MMF3-DistanceRotation { global: float twopi = 2.0*#pi float dtwopi = 0.5/#pi float pwrm1 = @power-1.0 float lb = log(0.5*log(@bailout)) init: complex dz = 1.0 complex odz = dz complex zo = #z float r = 0.0 float p = 0.0 float a = 0.0 float d if @julia dz = @power*dz*#z^pwrm1 endif int i = 1 loop: odz = dz dz = @power*dz*#z^pwrm1 if !@julia dz = dz + 1.0 endif if @smoothd || @smoothr i = i + 1 zo = #z endif final: dz = #z*log(#z)/dz if (@smoothd || @smoothr) && i>1 a = |#z| a = (log(0.5*log(a))-lb)/log(log(a)/log(|zo|)) odz = zo*log(zo)/odz endif if @method>0 r = atan2(dz) if r<0.0 r = r + twopi endif if @smoothr && i>1 p = atan2(odz) if p<0.0 p = p + twopi endif r = p*a + r*(1.0-a) endif r = r*dtwopi endif if @method==1 #index = r else if @distance==0 d = cabs(dz) if @smoothd && i>1 d = cabs(odz)*a + d*(1.0-a) endif else if @smoothd && i>1 dz = odz*a + dz*(1.0-a) endif a = abs(real(dz)) d = abs(imag(dz)) if @distance==1 d = a elseif @distance==3 if a < d d = a endif elseif @distance==4 if a > d d = a endif elseif @distance==5 d = (@addreal+a)*(@addimag+d) elseif @distance==6 d = a/(@addimag1+d) elseif @distance==7 d = d/(@addreal1+a) elseif @distance==8 d = abs(a-d) endif endif if @method==0 #index = d elseif (@dscale < 0) #index = @rscale*(2.0-r) - @dscale*d*0.2 else #index = @rscale*r + @dscale*d*0.2 endif endif default: title = "MMF3 Distance/Rotation" param smoothd caption = "Distance Smoothing" default = true endparam param smoothr caption = "Rotation Smoothing" default = false endparam param bailout caption = "Bailout" default = 128.0 hint = "Should match the bailout value in the main formula." visible = @smoothd || @smoothr endparam param power caption = "Power/Degree" default = 2.0 hint = "This should match the degree of divergence of the main formula e.g. 2 for z^2+c, \ 3 for z^3+c etc." endparam param julia caption = "Julia switch" default = false hint = "Enable when rendering a Julia Set." endparam param method caption = "Method" enum = "Distance" "Rotation" "Spiral" endparam param dscale caption = "Distance Scale" default = 1.0 visible = @method==2 endparam param rscale caption = "Rotation Scale" default = 1.0 visible = @method==2 endparam param distance caption = "Use Distance" enum = "Cabs" "Real" "Imag" "Min(Real or Imag)" "Max(Real or Imag)" "Real*Imag" \ "Real/Imag" "Imag/Real" "Diff." visible = @method!=1 endparam param addreal caption = "Add to Real" default = 2.0 min = 0.0 hint = "v in '(Real+v)*(Imag+w)'" visible = @method!=1 && @distance==5 endparam param addimag caption = "Add to Imag" default = 2.0 min = 0.0 hint = "w in '(Real+v)*(Imag+w)'" visible = @method!=1 && @distance==5 endparam param addimag1 caption = "Add to Imag" default = 0.5 min = 0.01 hint = "v in 'Real/(v+Imag)'" visible = @method!=1 && @distance==6 endparam param addreal1 caption = "Add to Real" default = 0.5 min = 0.01 hint = "v in 'Imag/(v+Real)'" visible = @method!=1 && @distance==7 endparam } MMF3-FieldLines { ; ; This version of calculating field lines will work reasonably well with both ; Mandelbrot and Julia Sets for divergent fractals with a divergence that is ; close to being a positive integer >=2 but can also produce quite interesting ; results with fractals that do not fit that criteria - just not rendering the ; field lines correctly in other cases :-) ; ; Thanks to Chris Hayton for showing me how to fix the "off-by-one" problems. ; global: float twopi = 2.0*#pi float dtwopi = 0.5/#pi float dp = 1.0/@power float m = @power*dtwopi float dp2 = 1.0/(2.0+@power) ; Changed from originally trying 1/power init: complex zv[#maxiter] int i = 0 float a = 0.0 float b = 0.0 float c = 0.0 float s = 0.0 if @julia zv[i] = #z i = i + 1 endif loop: zv[i] = #z i = i + 1 final: if (s = atan2(#z))<0 s = s + twopi endif while i > @skipiter i = i - 1 if @version==0 b = (@power*atan2(zv[i]))%twopi else b = atan2(zv[i]^@power) endif if b < 0.0 b = b + twopi endif c = c + b - s if c >= #pi s = s + twopi if @fixit || @accident c = c - twopi endif elseif c < -#pi s = s - twopi if @fixit || @accident c = c + twopi endif endif if @fixit c = dp2*c elseif !@accident c = 0.0 endif if (a = atan2(zv[i])) < 0.0 a = a + twopi endif s = dp*(s + twopi*floor(a*m)) endwhile s = s*dtwopi if @fixskip while s<0.0 s = s + 1.0 endwhile while s>=1.0 s = s - 1.0 endwhile endif #index = s default: title = "MMF3 Field Lines (use high bailouts)" heading caption = "Information" ; text = "This colouring is a little touchy around certain values, if you \ ; get obvious lines or dots that shouldn't be there but the 'Degree \ ; of Divergence' is set properly for the main formula and you are \ ; using a high bailout of say 1e20 or higher then try \ ; adjusting the location very slightly. For example if vertical \ ; lines appear on an unrotated fractal then try changing the x \ ; (real) location very slightly, if horizontal lines appear then try \ ; changing the y (imag) location very slightly." endheading heading endheading param version caption = "Version" enum = "Original" "Alternative" default = 1 hint = "Allows you to modify one of the calculations in the formula that \ is particularly sensitive to small errors. Ideally both methods \ should produce identical results but they don't, so if you get \ visible errors using one method then try the other (assuming you \ have the divergence set correctly and are using a high bailout)." endparam param power caption = "Degree of divergence" default = 2.0 hint = "This is an estimate of the divergence of the main formula, e.g. 2 \ for z^2+c, 3 for z^3+c etc." endparam param julia caption = "Julia ?" default = false hint = "Enable for correct rendering of Julia Sets." endparam param skipiter caption = "'Start' iteration" default = 0 min = 0 hint = "You can use this to attempt to get better detail at higher \ iteration depths, note that it only works as intended with 'Color \ Density' as a whole integer >=1." endparam param fixskip caption = "Fix 'Start' iteration" default = false hint = "Fixes a problem when the start iteration is non-zero and maybe in \ other cases - specifically if you get solid areas of palette \ colour zero when the Transfer Function is Linear this may fix the \ problem." endparam param fixit caption = "Fix Field Lines" default = false hint = "Enable this to make the formula much more accurate at rendering \ the field lines correctly. It's a fudge produced after trial and \ error but is quite effective at correcting some areas." endparam param accident caption = "Happy Accident" default = false hint = "You may find the colouring useful when this is enabled. This \ is available as I found the results when initially adding the \ 'Fix it' option quite interesting." visible = !@fixit endparam } MMF3-InterpolationConstants { ; ; This formula is an alternative method of visualising the "poly predictor" ; methods in MMF3 Orbitals+. ; Instead of using the interpolation formula to predict the new value of z and ; trapping z to that value (as in Orbitals+) this colouring allows you to trap ; the actual values of the constants calculated for the interpolation formula. ; The interpolation formula takes the form of "a*z^n1 + b*z^n2" where n1 and ; n2 are user parameters and the values of a and b are calculated based on ; zolder, zold and z. ; ; Using zolder, zold and z for "a*z^n1 + b*z^n2": ; ; 1. zold = a*zolder^n1 + b*zolder^n2 ; and 2. z = a*zold^n1 + b*zold^n2 ; ; Hence: ; ; (zold - b*zolder^n2)/zolder^n1 = (z - b*zold^n2)/zold^n1 ; zold^(n1+1) - b*zold^n1*zolder^n2 = z*zolder^n1 - b*zolder^n1*zold^n2 ; b*zold^n1*zolder^n2 - b*zolder^n1*zold^n2 = zold^(n1+1) - z*zolder^n1 ; ; b = (zold^(n1+1) - z*zolder^n1)/(zold^n1*zolder^n2 - zolder^n1*zold^n2) ; ; (zold - a*zolder^n1)/zolder^n2 = (z - a*zold^n1)/zold^n2 ; zold^(n2+1) - a*zolder^n1*zold^n2 = z*zolder^n2 - a*zold^n1*zolder^n2 ; a*zold^n1*zolder^n2 - a*zolder^n1*zold^n2 = z*zolder^n2 - zold^(n2+1) ; ; a = (z*zolder^n2 - zold^(n2+1))/(zold^n1*zolder^n2 - zolder^n1*zold^n2) ; global: float il = real(1.0/log(@power)) ; for smoothing float lp = log(0.5*log(@bailout)) if !@autopower lp=il*lp endif float cil = real(1.0/log(@cpower)) float clp = log(-0.5*log(@smallbail)) if !@autopowerc clp=cil*clp endif float iv = 0.0001*@iterval*@iterweight float ivc = 0.0001*@itervalc*@iterweightc float iw = 1.0 - 0.01*@iterweight float iwc = 1.0 - 0.01*@iterweightc float co = 0.0025*@convoff float twopi = 2.0*#pi float athird = 1.0/3.0 complex pp1 = @pwr1 + 1.0 complex pp2 = @pwr2 + 1.0 bool f1 = true bool f2 = true if @usevar<4 || @usevar==5 if @pwr1==@pwr2 $define DEBUG print("Your power values must not be the same !") endif if @pwr1==(0,0) f1 = false endif if @pwr2==(0,0) f2 = false endif endif float mixa = 0.01*@percent float mixb = 1.0 - mixa init: complex zold = #z complex zolder = #z complex zt = (0,0) int i = 0 BOOL gotval = false BOOL gotval1 = false BOOL lf = false BOOL ff = false complex tx = (0,0) float t = 0.0 complex a = (0,0) complex oa = (0,0) float mxmna = 1e200 if @methoda==8 mxmna = -1e200 endif complex sa = (0,0) complex xa = (0,0) complex xaold = (0,0) int ca = 0 int da = 0 int daold = 0 float ta = 0.0 float va = 0.0 float vaold = 0.0 bool fa = false bool ga = false bool gaold = false complex b = (0,0) complex ob = (0,0) float mxmnb = 1e200 if @methodb==8 mxmnb = -1e200 endif complex sb = (0,0) complex xb = (0,0) complex xbold = (0,0) int cb = 0 int db = 0 int dbold = 0 float tb = 0.0 float vb = 0.0 float vbold = 0.0 bool fb = false bool gb = false bool gbold = false float iuse = 0.0 ; for additer colouring float iwuse = 0.0 ; for additer colouring bool usebasins = false int li = 0 float f = 0 ; Smoothing fraction float cco = 0.0 loop: gotval1 = gotval if @usevar!=1 xaold = xa vaold = va daold = da gaold = ga endif if @usevar>0 && @usevar<4 xbold = xb vbold = vb dbold = db gbold = gb endif fa = false fb = false if (@usevar!=1 && ((@methoda!=4 && @methoda!=10) || ca==0)) \ ||(@usevar!=0 && @usevar<4 && ((@methodb!=4 && @methodb!=10) || cb==0)) \ && i>=@start && i<=@stop if @usevar>4 ff = lf if lf if @usevar==5 zt = #z - oa*zold^@pwr1 - ob*zold^@pwr2 else zt = #z - oa*zold^@pwr1 - @valb*zold^@pwr2 endif endif endif if @usevar<4 || @usevar==5 if f1 if f2 a = zold^@pwr1*zolder^@pwr2 - zolder^@pwr1*zold^@pwr2 else a = zold^@pwr1 - zolder^@pwr1 endif elseif f2 a = zolder^@pwr2 - zold^@pwr2 endif else a = zold^@pwr1 endif if |a|>0.0 || ff if |a|>0 lf = true if @usevar<4 || @usevar==5 if f1 if f2 b = (zold^pp1 - #z*zolder^@pwr1)/a a = (#z*zolder^@pwr2 - zold^pp2)/a else b = (zold^pp1 - #z*zolder^@pwr1)/a a = (#z - zold)/a endif elseif f2 b = (zold - #z)/a a = (#z*zolder^@pwr2 - zold^pp2)/a endif else a = (#z - @valb*zold^@pwr2)/a endif if @usevar>4 oa = a ob = b endif else lf = false endif if @usevar<5 || ff if @usevar>4 a = zt endif if @fna==1 a = log(a) elseif @fna==2 a = sin(a) elseif @fna==3 a = cos(a) elseif @fna==4 a = tan(a) elseif @fna==5 a = sinh(a) elseif @fna==6 a = cosh(a) elseif @fna==7 a = tanh(a) elseif @fna==8 a = exp(a) elseif @fna==9 a = sqrt(a) elseif @fna==10 a = a^athird elseif @fna==11 a = a*a elseif @fna==12 a = a^3.0 endif if @fnb==1 b = log(b) elseif @fnb==2 b = sin(b) elseif @fnb==3 b = cos(b) elseif @fnb==4 b = tan(b) elseif @fnb==5 b = sinh(b) elseif @fnb==6 b = cosh(b) elseif @fnb==7 b = tanh(b) elseif @fnb==8 b = exp(b) elseif @fnb==9 b = sqrt(b) elseif @fnb==10 b = b^athird elseif @fnb==11 b = b*b elseif @fnb==12 b = b^3.0 endif if @usevar!=1 && ((@methoda!=4 && @methoda!=10) || ca==0) if @methoda<2 fa = true if @typea==0 sa = sa + a elseif @typea==1 ta = ta + cabs(a) elseif @typea==2 ta = ta + abs(real(a)) elseif @typea==3 ta = ta + abs(imag(a)) elseif @totanga==0 sa = sa + a else ta = ta + #pi + atan2(a) endif ca = ca + 1 else if @typea==0 t = cabs(a-@ctrapa) - @thresholda else if @typea==1 t = cabs(a) - @ftrapa elseif @typea==2 t = real(a) - @ftrapa elseif @typea==3 t = imag(a) - @ftrapa else t = atan2(a) - @ftrapa endif if @usethresholda t = abs(t) - @thresholda endif endif if @methoda==2 || @methoda==8 t = abs(t) if (@methoda==2 && tmxmna) fa = true mxmna = t if @coloura==0 ta = t else if @coloura<5 tx = a elseif @coloura<9 tx = b elseif @coloura<13 tx = #z endif if @coloura==1 || @coloura==5 || @coloura==9 ta = cabs(tx) elseif @coloura==2 || @coloura==6 || @coloura==10 ta = abs(real(tx)) elseif @coloura==3 || @coloura==7 || @coloura==11 ta = abs(imag(tx)) elseif @coloura==4 || @coloura==8 || @coloura==12 ta = atan2(tx) if @anglea==1 ta = abs(ta) elseif ta<0 ta = ta + twopi endif elseif @coloura==13 ta = 0.01*ca else ta = 0.01*i endif endif endif ca = ca + 1 elseif @methoda>2 && ((@methoda<8 && t<0) || (@methoda>8 && t>=0)) t = abs(t) fa = true if @methoda==6 || @methoda==7 || @methoda==12 || @methoda==13 if @typea==0 sa = sa + a elseif @typea==1 ta = ta + cabs(a) elseif @typea==2 ta = ta + abs(real(a)) elseif @typea==3 ta = ta + abs(imag(a)) elseif @totanga==0 sa = sa + a else ta = ta + #pi + atan2(a) endif elseif (@methoda!=3 && @methoda!=9) || t0 && @usevar<4 && ((@methodb!=4 && @methodb!=10) || cb==0) if @methodb<2 fb = true if @typeb==0 sb = sb + b elseif @typeb==1 tb = tb + cabs(b) elseif @typeb==2 tb = tb + abs(real(b)) elseif @typeb==3 tb = tb + abs(imag(b)) elseif @totangb==0 sb = sb + b else tb = tb + #pi + atan2(b) endif cb = cb + 1 else if @typeb==0 t = cabs(b-@ctrapb) - @thresholdb else if @typeb==1 t = cabs(b) - @ftrapb elseif @typeb==2 t = real(b) - @ftrapb elseif @typeb==3 t = imag(b) - @ftrapb else t = atan2(b) - @ftrapb endif if @usethresholdb t = abs(t) - @thresholdb endif endif if @methodb==2 || @methodb==8 t = abs(t) if (@methodb==2 && tmxmnb) fb = true mxmnb = t if @colourb==0 tb = t else if @colourb<5 tx = a elseif @colourb<9 tx = b elseif @colourb<13 tx = #z endif if @colourb==1 || @colourb==5 || @colourb==9 tb = cabs(tx) elseif @colourb==2 || @colourb==6 || @colourb==10 tb = abs(real(tx)) elseif @colourb==3 || @colourb==7 || @colourb==11 tb = abs(imag(tx)) elseif @colourb==4 || @colourb==8 || @colourb==12 tb = atan2(tx) if @angleb==1 tb = abs(tb) elseif tb<0 tb = tb + twopi endif elseif @colourb==13 tb = 0.01*cb else tb = 0.01*i endif endif endif cb = cb + 1 elseif @methodb>2 && ((@methodb<8 && t<0) || (@methodb>8 && t>=0)) t = abs(t) fb = true if @methodb==6 || @methodb==7 || @methodb==12 || @methodb==13 if @typeb==0 sb = sb + b elseif @typeb==1 tb = tb + cabs(b) elseif @typeb==2 tb = tb + abs(real(b)) elseif @typeb==3 tb = tb + abs(imag(b)) elseif @totangb==0 sb = sb + b else tb = tb + #pi + atan2(b) endif elseif (@methodb!=3 && @methodb!=9) || t3) && fa) \ || (@usevar==3 && fa && fb) gotval = true xa = sa va = ta da = ca ga = fa endif if ((@usevar==1 || @usevar==2) && fb) || (@usevar==3 && fa && fb) gotval = true xb = sb vb = tb db = cb gb = fb endif endif endif endif zolder = zold zold = #z i = i + 1 final: if (@smooth==1 || (@smooth==4 && |#z-zold|>0.5)) && gotval1 f = real(#z) if f<0 cco = co f = 1.0 + @fudge1c*f iuse = ivc iwuse = iwc li = @logiterc usebasins = true else f = @fudge1*f iuse = iv iwuse = iw li = @logiter endif elseif (@smooth==0 || @smooth==3) && |#z-zold|>0.5 && gotval1 if @autopower f = real((lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|zold|))) if @usefudge f = @fudge*f endif else f = @fudge*real(lp-il*log(0.5*log(|#z|))) endif iuse = iv iwuse = iw li = @logiter elseif (@smooth>1 && @smooth<5) && |#z-zold|<0.5 && gotval1 cco = co if @fixedconv if @autopowerc f = real( (clp-log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|zold-@fixedval|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-@fixedval|))) ) endif elseif @autopowerc f = real( (clp-log(-0.5*log(|#z-zold|))) \ /log(log(|#z-zold|)/log(|zold-zolder|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-zold|))) ) endif iuse = ivc iwuse = iwc li = @logiterc usebasins = true elseif @smooth!=5 || !gotval if @solid==0 #solid = true else #index = @fillcol*0.0025 endif f = -5.0 endif if f>-4.0 if @usevar!=1 if @methoda<2 || @methoda==6 || @methoda==7 || @methoda>11 if ga if @typea==0 va = cabs(xa) elseif @typea==4 && @totanga==0 va = atan2(xa) + #pi endif if @methoda==1 || @methoda==7 || @methoda==13 va = va/da endif if gaold if @typea==0 vaold = cabs(xaold) elseif @typea==4 && @totanga==0 vaold = atan2(xaold) + #pi endif if @methoda==1 || @methoda==7 || @methoda==13 vaold = vaold/daold endif endif endif endif endif if @usevar>0 && @usevar<4 if @methodb<2 || @methodb==6 || @methodb==7 || @methodb>11 if gb if @typeb==0 vb = cabs(xb) elseif @typeb==4 && @totangb==0 vb = atan2(xb) + #pi endif if @methodb==1 || @methodb==7 || @methodb==13 vb = vb/db endif if gbold if @typeb==0 vbold = cabs(xbold) elseif @typeb==4 && @totangb==0 vb = atan2(xb) + #pi endif if @methodb==1 || @methodb==7 || @methodb==13 vbold = vbold/dbold endif endif endif endif endif if @usevar==1 va = vb vaold = vbold elseif @usevar==2 if @mix==0 if ga && gb if vbva va = vb endif elseif gb va = vb endif if gaold && gbold if vbold>vaold vaold = vbold endif elseif gbold vaold = vbold endif elseif @mix==2 va = mixa*va + mixb*vb vaold = mixa*vaold + mixb*vbold endif elseif @usevar==3 if @mix==0 if vbva va = vb endif if vbold>vaold vaold = vbold endif elseif @mix==2 va = mixa*va + mixb*vb vaold = mixa*vaold + mixb*vbold endif endif if @smooth==1 || (@smooth==4 && |#z-zold|>0.5) va = vaold + (va-vaold) * f elseif @smooth!=5 va = va + (va-vaold) * f endif if @fn==1 va = log(1.0 + va) elseif @fn==2 va = log(1.0 + log(1.0 + va)) elseif @fn==3 va = abs(sin(va)) elseif @fn==4 va = abs(cos(va)) elseif @fn==5 va = abs(tan(va)) elseif @fn==6 va = abs(sinh(va)) elseif @fn==7 va = abs(cosh(va)) elseif @fn==8 va = abs(tanh(va)) elseif @fn==9 va = exp(va) elseif @fn==10 va = sqrt(va) elseif @fn==11 va = va^athird elseif @fn==12 va = va*va elseif @fn==13 va = va^3.0 endif if iuse!=0 && @smooth!=5 vaold = #numiter+f if li==1 vaold = log(1+vaold) elseif li==2 vaold = log(1+log(1+vaold)) endif va = iuse*vaold+iwuse*va endif if usebasins && @zbasin>0 if @smooth!=1 && (@smooth!=4 || |#z-zold|<0.5) zolder = zold zold = #z endif if @zbasin==1 vb = abs(real(twopi+atan2(zold))) vaold = abs(real(twopi+atan2(zolder))) elseif @zbasin==2 vb = abs(real(zold)) vaold = abs(real(zolder)) elseif @zbasin==3 vb = abs(imag(zold)) vaold = abs(imag(zolder)) elseif @zbasin==4 vb = abs(real(zold)+imag(zold)) vaold = abs(real(zolder)+imag(zolder)) elseif @zbasin==5 vb = abs(2*real(zold)+imag(zold)) vaold = abs(2*real(zolder)+imag(zolder)) elseif @zbasin==6 vb = abs(real(zold)+2*imag(zold)) vaold = abs(real(zolder)+2*imag(zolder)) elseif @zbasin==7 vb = abs(real(zold)/(abs(imag(zold))+1)) vaold = abs(real(zolder)/(abs(imag(zolder))+1)) elseif @zbasin==8 vb = abs(imag(zold)/(abs(real(zold))+1)) vaold = abs(imag(zolder)/(abs(real(zolder))+1)) elseif @zbasin==9 vb = abs(2*real(sqrt(zold))+imag(sqrt(zold))) vaold = abs(2*real(sqrt(zolder))+imag(sqrt(zolder))) elseif @zbasin==10 vb = abs(real(sqrt(zold))+2*imag(sqrt(zold))) vaold = abs(real(sqrt(zolder))+2*imag(sqrt(zolder))) endif if @smooth==1 || (@smooth==4 && |#z-zold|>0.5) va = va + @zscale*(vaold+(vb-vaold)*f) elseif @smooth!=5 va = va + @zscale*(vb+(vb-vaold)*f) endif endif #index = cco + va endif default: title = "MMF3 Interpolation Constants" heading caption = "Formula control" endheading param pwr1 caption = "Power 1" default = (2,0) hint = "n1 in 'a*z^n1 + b*z^n2'. Note that if it is (0,0) then the \ interpolation formula becomes 'a + b*z^n2'." endparam param pwr2 caption = "Power 2" default = (1,0) hint = "n2 in 'a*z^n1 + b*z^n2'. Note that if it is (0,0) then the \ interpolation formula becomes 'a*z^n1 + b'." endparam heading caption = "Colouring control" endheading param usevar caption = "Variable/s to use" enum = "Just a" "Just b" "Combined" "Both" "Fixed b" "Predict1" "Predict2" default = 0 hint = "'Combined' calculates values using a and b separately and then \ allows you to set the final colour value by combining the two \ separate values. 'Both' works exactly the same way as 'Combined' \ if you choose the 'Total' or 'Average' methods but for the methods \ involving a test/trap value then both a and b must must pass their \ specified condition. 'Fixed b' allows you to specify a fixed value \ for b in a*z^n1 + b*z^n2 and colours based on a." endparam param valb caption = "Value of b" default = (0,0) visible = @usevar==4 || @usevar==6 endparam param mix caption = "Colour mixing" enum = "Minimum" "Maximum" "Mix %age" default = 0 visible = @usevar>1 && @usevar<4 endparam param percent caption = "Mix %age" default = 50.0 hint = "100% uses the value from a only, 0% uses the value from b only." visible = @usevar>1 && @usevar<4 && @mix==2 endparam param start caption = "First iteration" default = 0 min = 0 hint = "Iteration at which to start colouring values." endparam param stop caption = "Last iteration" default = 2147483647 min = 0 hint = "Last iteration on which to calculate colouring." endparam param fna caption = "Function for a" enum = "Ident" "Log" "Sin" "Cos" "Tan" "Sinh" "Cosh" "Tanh" "Exp" \ "Sqrt" "Cubert" "Square" "Cube" default = 0 hint = "Applied to the calculated value of a before use in any trapping or \ colouring." endparam param fnb caption = "Function for b" enum = "Ident" "Log" "Sin" "Cos" "Tan" "Sinh" "Cosh" "Tanh" "Exp" \ "Sqrt" "Cubert" "Square" "Cube" default = 0 hint = "Applied to the calculated value of b before use in any trapping or \ colouring." endparam param fn caption = "Colour function" enum = "Ident" "Log" "LogLog" "Sin" "Cos" "Tan" "Sinh" "Cosh" "Tanh" "Exp" \ "Sqrt" "Cubert" "Square" "Cube" default = 0 hint = "Applied to the main colouring before the mixing in of iteration \ or basin colouring values." endparam param solid caption = "Fill method" default = 0 enum = "Solid colour" "Fill #index" endparam param fillcol caption = "Fill #index" default = 0.0 min = 0.0 hint = "Fill colour index. Only matches an actual gradient position \ when Color Density is 1 and Transfer Function is Linear." visible = @solid==1 endparam heading caption = "Settings for a (or zval)" visible = @usevar!=1 endheading param typea caption = "Type for a (or zval)" enum = "Complex" "Magnitude" "Real" "Imag" "Angle" default = 0 visible = @usevar!=1 endparam param methoda caption = "Method for a (or zval)" enum = "Total" "Average" \ "Nearest" "Nearest Below" "First Below" "Last Below" "Total Below" \ "Average Below" \ "Farthest" "Nearest Above" "First Above" "Last Above" "Total Above" \ "Average Above" default = 2 visible = @usevar!=1 endparam param ctrapa caption = "Trap value for a (or zval)" default = (0,0) visible = @usevar!=1 && @typea==0 && @methoda>1 endparam param ftrapa caption = "Trap value for a (or zval)" default = 0.0 visible = @usevar!=1 && @typea>0 && @methoda>1 endparam param usethresholda caption = "Use threshold for a (or zval)" default = false visible = @usevar!=1 && @typea>0 && @methoda>1 endparam param thresholda caption = "Threshold for a (or zval)" default = 1.0 min = 0.0 visible = @usevar!=1 && @methoda>1 && (@typea==0 || @usethresholda) endparam param coloura caption = "Colour by a (or zval)" enum = "Distance" "Magnitude(a)" "Real(a)" "Imag(a)" "Angle(a)" \ "Magnitude(b)" "Real(b)" "Imag(b)" "Angle(b)" \ "Magnitude(z)" "Real(z)" "Imag(z)" "Angle(z)" \ "Count" "Iteration" default = 0 hint = "There is no point choosing the options involving b if you are \ using 'Fixed b'." visible = @usevar!=1 \ && ((@methoda>1 && @methoda<6) || (@methoda>7 && @methoda<12)) endparam param anglea caption = "Angle a (or zval)" enum = "All angles" "abs(angle)" default = 0 visible = @usevar!=1 && (@coloura==4 || @coloura==8 || @coloura==12) \ && ((@methoda>1 && @methoda<6) || (@methoda>7 && @methoda<12)) endparam param totanga caption = "Angle sum a (or zval)" enum = "Angle of sum" "Sum of angles" default = 0 visible = @usevar!=1 && @typea==4 \ && (@methoda<2 || @methoda==6 || @methoda==7 \ || @methoda==12 || @methoda==13) endparam heading caption = "Settings for b" visible = @usevar>0 && @usevar<4 endheading param typeb caption = "Type for b" enum = "Complex" "Magnitude" "Real" "Imag" "Angle" default = 0 visible = @usevar>0 && @usevar<4 endparam param methodb caption = "Method for b" enum = "Total" "Average" \ "Nearest" "Nearest Below" "First Below" "Last Below" "Total Below" \ "Average Below" \ "Farthest" "Nearest Above" "First Above" "Last Above" "Total Above" \ "Average Above" default = 2 visible = @usevar>0 && @usevar<4 endparam param ctrapb caption = "Trap value for b" default = (0,0) visible = @usevar>0 && @usevar<4 && @typeb==0 && @methodb>1 endparam param ftrapb caption = "Trap value for b" default = 0.0 visible = @usevar>0 && @usevar<4 && @typeb>0 && @methodb>1 endparam param usethresholdb caption = "Use threshold for b" default = false visible = @usevar>0 && @usevar<4 && @typeb>0 && @methodb>1 endparam param thresholdb caption = "Threshold for b" default = 1.0 min = 0.0 visible = @usevar>0 && @usevar<4 && @methodb>1 \ && (@typeb==0 || @usethresholdb) endparam param colourb caption = "Colour by b" enum = "Distance" "Magnitude(a)" "Real(a)" "Imag(a)" "Angle(a)" \ "Magnitude(b)" "Real(b)" "Imag(b)" "Angle(b)" \ "Magnitude(z)" "Real(z)" "Imag(z)" "Angle(z)" \ "Count" "Iteration" default = 0 visible = @usevar>0 && @usevar<4 \ && ((@methodb>1 && @methodb<6) || (@methodb>7 && @methodb<12)) endparam param angleb caption = "Angle b" enum = "All angles" "abs(angle)" default = 0 visible = @usevar>0 && @usevar<4 \ && (@colourb==4 || @colourb==8 || @colourb==12) \ && ((@methodb>1 && @methodb<6) || (@methodb>7 && @methodb<12)) endparam param totangb caption = "Angle sum b" enum = "Angle of sum" "Sum of angles" default = 0 visible = @usevar>0 && @usevar<4 && @typeb==4 \ && (@methodb<2 || @methodb==6 || @methodb==7 \ || @methodb==12 || @methodb==13) endparam heading caption = "Smoothing" endheading param smooth caption = "Method" default = 0 enum = "Divergent" "Finalz" "Convergent" "Div&Conv" "Finalz&Conv" "None" endparam param autopower caption = "Auto-power (div)" default = true hint = "When enabled you should get correct smoothing on any divergent \ fractal without having to supply a power value and smoothing with \ low bailout values is much improved." visible = @smooth==0 || @smooth==3 endparam param power caption = "Power" default = (2,0) hint = "This should match the power/degree/exponent in the \ fractal formula." visible = (@smooth==0 || @smooth==3) && !@autopower endparam param bailout caption = "Bailout" default = 128.0 hint = "This should match the bailout in the fractal formula." visible = @smooth==0 || @smooth==3 endparam param usefudge caption = "Use fudge (div)" default = false hint = "Allows you to enable use of the divergent scaling fudge \ when using 'Auto-power (div)'." visible = (@smooth==0 || @smooth==3) && @autopower endparam param fudge caption = "Fudge (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = @smooth!=2 && @smooth!=5 && (@usefudge || !@autopower) endparam param fudge1 caption = "Fudge 1 (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = @smooth==1 || @smooth==4 endparam param iterval caption = "Add iter (div)" default = 0.0 hint = "Use to add some of the smooth iteration value to divergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth!=2 && @smooth!=5 endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth!=2 && @smooth!=5 && @iterval!=0 endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth!=2 && @smooth!=5 && @iterval!=0 && @iterweight!=0 endparam param autopowerc caption = "Auto-power (conv)" default = true hint = "When enabled you should get correct smoothing on any convergent \ fractal without having to supply a power value." visible = @smooth>1 && @smooth<5 endparam param cpower caption = "Convergent Power" default = (2,0) hint = "This should match the power (exponent/degree) for the \ convergent areas of your main fractal formula." visible = @smooth>1 && @smooth!=5 && !@autopowerc endparam param smallbail caption = "Small bailout" default = 1e-5 hint = "This should match the small bailout in your fractal formula." visible = @smooth>1 && @smooth!=5 endparam param usefudgec caption = "Use fudge (conv)" default = false hint = "Allows you to enable use of the convergent scaling fudge \ when using 'Auto-power (conv)'." visible = @smooth>1 && @smooth!=5 && @autopowerc endparam param fudgec caption = "Fudge (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power (conv)' or the best value you can \ find for the 'Convergent Power' parameter don't \ produce smooth results then modifying this value \ should help." visible = @smooth>0 && @smooth!=5 && (!@autopowerc || @usefudgec) endparam param fudge1c caption = "Fudge 1 (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1." visible = @smooth==1 endparam param fixedconv caption = "Absolute convergence" default = false hint = "Use with main formulas that test for convergence using \ only |z-value| rather than |z-zold| eg. some Magnet formulas." visible = @smooth>1 && @smooth!=5 endparam param fixedval caption = "Convergence value" default = (1,0) hint = "Should match the value the main formula uses when testing \ for convergence." visible = @smooth>1 && @smooth!=5 && @fixedconv endparam param itervalc caption = "Add iter (conv)" default = 0.0 hint = "Use to add some of the smooth iteration value to convergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth>0 && @smooth!=5 endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth>0 && @smooth!=5 && @itervalc!=0 endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth>0 && @smooth!=5 && @itervalc!=0 && @iterweightc!=0 endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "roots 1" "roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ final or penultimate value of z." visible = @smooth>0 && @smooth!=5 endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = @smooth>0 && @smooth!=5 && @zbasin>0 endparam param convoff caption = "Offset (conv.)" default = 0.0 hint = "Offsets the final colour index in convergent areas. \ The value corresponds to gradient points when Color Density \ is 1 and Transfer Function is Linear." endparam } MMF3-OrbitalWaves { ; ; This was originally to be an extension to the Turning Points colouring but it ; would have made it a little overcomplicated so here it is as a formula in its ; own right. ; Here the turning points in the orbit of z are again used, this time with ; options to colour based on the amplitude or wavelength or energy or magnitude ; of the turning points. ; Some parameter combinations do duplicate colourings that can be achieved in ; the Turning Points formula but avoiding this would have meant restricting ; other possibilities. ; init: int i = 0 int p = 0 int n = 0 int d = 0 int c = @count complex z = #z complex zold = #z complex zl = #z complex zp = (0,0) complex zv = (0,0) float m = |#z| float m1 = m float lm = m float v = 0.0 float vv = v float t = 0.0 int w = 0 int ww = 0 float x = 1e200 if @method==1 || @method==8 x = -1e200 endif bool f = false if @version==0 && (@trap==3 || @usefirst) n = 1 if !@fixdave f = true endif endif loop: if (i>1 || (i>0 && @version==0)) && (@trap!=4 || c>0) m = m1 if @version==0 m1 = |#z| elseif @version==1 m1 = |#z-zold| else m1 = |#z| - |zold| if @version==3 m1 = abs(m1) endif endif if (@control!=4 && mm1 && d>=0) if f v = abs(m-lm) w = i - p lm = m p = i if @version==0 zp = zold - z else zp = zold - 2*z + zl zl = z endif z = zold if @control==0 || ( (@control==1 || @control==3) && d<=0) \ || ( (@control==2 || @control==4) && d>=0) n = n + 1 f = true if @trap==4 c = c - 1 elseif @trap<4 || @trap>5 if @trap==0 t = v elseif @trap==1 t = w elseif @trap==2 t = v/w elseif @trap==3 t = abs(m) elseif @trap==6 t = abs(real(zp)) elseif @trap==7 t = abs(imag(zp)) elseif @trap==8 t = atan2(zp)+#pi endif if @method==0 if tx x = t if @colour==0 vv = v elseif @colour==1 ww = w elseif @colour==2 vv = v ww = w elseif @colour==3 vv = abs(m) elseif @colour<7 zv = zold elseif @colour==7 vv = i elseif @colour<11 zv = zp else vv = x endif endif elseif @method<4 vv = v + t elseif @method==8 t = abs(t-@rtrap) if t>x x = t if @colour==0 vv = v elseif @colour==1 ww = w elseif @colour==2 vv = v ww = w elseif @colour==3 vv = abs(m) elseif @colour<7 zv = zold elseif @colour==7 vv = i elseif @colour<11 zv = zp else vv = x endif endif elseif (@method!=6 && @method!=10) || x>1e150 t = t - @rtrap if (abs(t)0))) \ || (t<0 && (@method==6 || @method==7)) \ || (t>0 && (@method==10 || @method==11)) x = abs(t) if @colour==0 vv = v elseif @colour==1 ww = w elseif @colour==2 vv = v ww = w elseif @colour==3 vv = abs(m) elseif @colour<7 zv = zold elseif @colour==7 vv = i elseif @colour<11 zv = zp else vv = x endif endif endif endif endif else f = true if @version>0 zl = z endif z = zold lm = m p = i endif if mm1 d = -1 endif elseif mm1 d = -1 endif elseif @version>0 && i==1 if @version==1 m1 = |#z-zold| else m1 = |#z| - |zold| if @version==3 m1 = abs(m1) endif endif if mm1 d = -1 endif elseif i==0 if @version==0 m1 = |#z| if mm1 d = -1 endif else if @version==1 m = |#z-zold| else m = |#z| - |zold| if @version==3 m = abs(m) endif endif if @trap==3 || @usefirst n = 1 if !@fixdave f = true endif endif endif endif zold = #z i = i + 1 final: if n>1 && (@trap!=4 || c==0 || @uselast) if @trap<4 || @trap>5 if @method<2 || @method>3 if @colour==0 || @colour==12 v = vv elseif @colour==1 v = 0.01*ww elseif @colour==2 v = vv/ww elseif @colour==3 v = vv elseif @colour==4 || @colour==8 v = abs(real(zv)) elseif @colour==5 || @colour==9 v = abs(imag(zv)) elseif @colour==6 || @colour==10 v = atan2(zv)+#pi elseif @colour==7 v = 0.01*vv endif elseif @method==2 v = vv elseif @method==3 v = vv/(n-1) endif else if @colour==1 v = 0.01*w elseif @colour==2 v = v/w elseif @colour==3 v = m elseif @colour==4 v = abs(real(z)) elseif @colour==5 v = abs(imag(z)) elseif @colour==6 v = atan2(z)+#pi elseif @colour==7 v = 0.01*p elseif @colour==8 v = abs(real(zp)) elseif @colour==9 v = abs(imag(zp)) elseif @colour==10 v = atan2(zp)+#pi endif endif if @uselog v = log(1.0+v) endif if @recip v = 1.0/(1.0+v) endif if @mask==0 || ((@mask==1 || @mask==3) && v<@mlow) \ || ((@mask==2 || @mask==3) && v>@mhigh) \ || (@mask==4 && (v>=@mlow && v<=@mhigh)) #index = v else #solid = true endif elseif @solid==0 #solid=true else #index = @fill*0.0025 endif default: title = "MMF3 Orbital Waves" param version caption = "Version" enum = "Original" "Diff #1" "Diff #2" "Diff #2a" default = 0 endparam param control caption = "Control" enum = "All" "Max to Min" "Min to Max" "Min to Min" "Max to Max" default = 0 endparam param trap caption = "Trap" enum = "Amplitude" "Wavelength" "Energy" "Magnitude" "Nth" "Last" \ "Diff. Real" "Diff. Imag" "Diff. Angle" default = 0 endparam param usefirst caption = "Use first" default = true hint = "If enabled then the initial z value is taken to be at a turning \ point." visible = @trap!=3 endparam param fixdave caption = "Break using first" default = false hint = "Enabling this fixes one of my own old images, normally you should \ leave it disabled but you may wish to try it enabled anyway !" visible = @usefirst || @trap==3 endparam param count caption = "Count (N)" default = 1 hint = "Use 1 for first, 2 for second etc. You can choose to leave points \ that do not reach the count uncoloured or colour them based on the \ last value." visible = @trap==4 endparam param uselast caption = "Use Last" default = false hint = "If disabled then points that do not reach the count will not be \ coloured. If enabled then they are coloured based on the last \ value." visible = @trap==4 endparam param method caption = "Method" enum = "Min" "Max" "Total" "Average" "Nearest" "Nearest Below" \ "First Below" "Last Below" "Farthest" "Nearest Above" "First Above" \ "Last Above" default = 0 visible = @trap<4 || @trap>5 hint = "Note that when using 'Total' or 'Average' 'Control' options 'Max \ to Min' and 'Min to Max' are sometimes the same as 'All'." endparam param rtrap caption = "Threshold" default = 1.0 min = 0 visible = @method>3 && (@trap<4 || @trap>5) endparam param colour caption = "Colour by" enum = "Amplitude" "Wavelength" "Energy" "Magnitude" "Real" "Imag" "Angle" \ "Iteration" "Diff. Real" "Diff. Imag" "Diff. Angle" "Distance" \ "Dist. fixed" default = 0 hint = "'Distance' is the same as 'Amplitude' when 'Trap' is set to 'Nth' \ or 'Last'." visible = @method<2 || @method>3 || (@trap>3 && @trap<6) endparam param uselog caption = "Apply log" default = true hint = "When enabled log is applied to any value before use as the \ colour index." endparam param recip caption = "Reciprocate" default = false hint = "If enabled the value for colouring is reciprocated." endparam param solid caption = "Fill method" enum = "Solid" "Colour index" default = 0 hint = "You can choose to have uncoloured areas set to the solid colour or \ to a selected colour index." endparam param fill caption = "Fill index" default = 0 hint = "The value matches the colour index from the gradient when \ 'Color Density' is 1 and 'Transfer Function' is linear." endparam param mask caption = "Masking" enum = "Off" "Below(low)" "Above(high)" "Outside" "Inside" default = 0 hint = "Masking allows you to mask out selected sections of your image \ such that only the masking areas are coloured and other areas that \ would normally be coloured are set to #solid. 'Below' only colours \ areas with colouring value less than 'Mask Low', 'Above' only \ colours areas with colouring value higher than 'Mask High', \ 'Outside' colours areas with colouring value either less than \ 'Mask Low' or higher than 'Mask High' and 'Inside' colours areas \ with colouring value higher or equal to 'Mask Low' AND less than \ or equal to 'Mask High'." endparam param mlow caption = "Mask Low" default = 0.1 min = 0.0 visible = @mask==1 || @mask>2 endparam param mhigh caption = "Mask High" default = 0.5 min = 0.0 visible = @mask>1 endparam } MMF3-TurningPoints { ; ; This one sort of came about when thinking about adding to the 'Vergence ; formula - I decided to use the idea in a formula of its own. ; It simply allows you to colour based on the actual maxima and/or minima ; from the orbit of z ie. the z value at the turning points rather than simply ; the min or max value of |z|. ; init: int i = 0 int j = 0 int p = 0 int d = 0 int c = @count complex z = (0,0) complex zold = #z complex zlast = #z complex ztemp = #z float m = 0.0 float m1 = 0.0 float om = 0.0 float t = 0.0 float u = 0.0 float v = 0.0 float w = 0.0 bool f = false bool g = false float x = 1e200 float y = 1e200 if @method==10 x = -1e200 y = -1e200 endif loop: if @useprev==2 zold = #z endif if (i>2 || (@version==0 && i>1)) && (@method>0 || c>0) om = m m = m1 if @version==0 m1 = |#z| elseif @version==1 m1 = |#z-zlast| else m1 = |#z| - |zlast| endif if m1 && @method<6 if @colour==0 if @useprev==2 v = v + abs(m1) elseif @useprev==1 v = v + abs(om) else v = v + abs(m) endif elseif @colour<3 z = z + zold elseif @colour==3 if @method>3 v = v + atan2(zold) + #pi else z = z + zold endif else p = p + i - 1 endif elseif @method<6 if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold else p = i - 1 endif elseif @trapmode==0 t = cabs(zold-@trapval) if (@method!=8 && @method!=12) || x>1e150 t = t - @traptest if (abs(t)>=x && @method==10) || (abs(t)=0))) \ || (t<0 && (@method==8 || @method==9)) \ || (t>=0 && (@method==12 || @method==13)) x = abs(t) f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x endif endif endif elseif @trapmode<4 if @trapmode==1 t = real(zold)-real(@trapval) elseif @trapmode==2 t = imag(zold)-imag(@trapval) else t = atan2(zold)-@trapang endif if @usetest if @trapmode==3 && @fixangles t = t + #pi - @traptest else t = abs(t)-@traptest endif endif if (@method!=8 && @method!=12) || x>1e150 if (abs(t)>=x && @method==10) || (abs(t)=0))) \ || (t<0 && (@method==8 || @method==9)) \ || (t>=0 && (@method==12 || @method==13)) x = abs(t) f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x endif endif endif elseif (@method!=8 && @method!=12) || (x>1e150 && y>1e150) if @trapmode<12 t = real(zold)-real(@trapval) if @trapmode<8 u = imag(zold)-imag(@trapval) else u = atan2(zold)-@trapang endif else t = imag(zold)-imag(@trapval) u = atan2(zold)-@trapang endif if @usetest t = abs(t)-@traptest if @trapmode>7 && @fixangles u = u + #pi - @traptest1 else u = abs(u)-@traptest1 endif endif g = false if @trapmode==4 || @trapmode==8 || @trapmode==12 if (@method==6 && (abs(t)=x || abs(u)>=y)) \ || (@method==13 && (t>=0 || u>=0)) g = true if abs(t)>x x = abs(t) endif if abs(u)>y y = abs(t) endif elseif (@method==11 || @method==12) \ && ((abs(t)=0) || (abs(u)=0)) g = true if abs(t)=0 x = abs(t) endif if abs(u)=0 y = abs(u) endif endif if g f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x + y endif endif elseif @trapmode==5 || @trapmode==9 || @trapmode==13 if (@method==6 && (abs(t)=x && abs(u)>=y)) \ || (@method==13 && (t>=0 && u>=0)) g = true if @method==10 x = abs(t) y = abs(t) endif elseif (@method==11 || @method==12) \ && ((abs(t)=0) && (abs(u)=0)) g = true x = abs(t) y = abs(u) endif if g f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x + y endif endif else;if @trapmode==6 || @trapmode==10 || @trapmode==14 \ ; || @trapmode==7 || @trapmode==11 || @trapmode==15 if @trapmode==7 || @trapmode==11 || @trapmode==15 w = u u = t t = w endif if (@method==6 && (abs(t)=y)) \ || (@method==9 && (t<0 || u>=0)) g = true if abs(t)=x || abs(u)=0 || u<0)) g = true if abs(t)>x x = abs(t) endif if abs(u)>y y = abs(t) endif elseif (@method==11 || @method==12) \ && ((abs(t)=0) || !(abs(u)=0)) g = true if abs(t)=0 x = abs(t) endif if abs(u)=0 y = abs(u) endif endif if g f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x + y endif endif endif endif j = j + 1 if @method==0 c = c - 1 if @showall || c==0 f = true endif elseif @method<6 f = true endif endif d = 1 elseif m>m1 if (@mode==0 || @mode==2) && d>=0 if @method>1 && @method<6 if @colour==0 if @useprev==2 v = v + abs(m1) elseif @useprev==1 v = v + abs(om) else v = v + abs(m) endif elseif @colour<3 z = z + zold elseif @colour==3 if @method>3 v = v + atan2(zold) + #pi else z = z + zold endif else p = p + i - 1 endif elseif @method<6 if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold else p = i - 1 endif elseif @trapmode==0 t = cabs(zold-@trapval) if (@method!=8 && @method!=12) || x>1e150 t = t - @traptest if (abs(t)>=x && @method==10) || (abs(t)=0))) \ || (t<0 && (@method==8 || @method==9)) \ || (t>=0 && (@method==12 || @method==13)) x = abs(t) f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x endif endif endif elseif @trapmode<4 if @trapmode==1 t = real(zold)-real(@trapval) elseif @trapmode==2 t = imag(zold)-imag(@trapval) else t = atan2(zold)-@trapang endif if @usetest if @trapmode==3 && @fixangles t = t + #pi - @traptest else t = abs(t)-@traptest endif endif if (@method!=8 && @method!=12) || x>1e150 if (abs(t)>=x && @method==10) || (abs(t)=0))) \ || (t<0 && (@method==8 || @method==9)) \ || (t>=0 && (@method==12 || @method==13)) x = abs(t) f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x endif endif endif elseif (@method!=8 && @method!=12) || (x>1e150 && y>1e150) if @trapmode<12 t = real(zold)-real(@trapval) if @trapmode<8 u = imag(zold)-imag(@trapval) else u = atan2(zold)-@trapang endif else t = imag(zold)-imag(@trapval) u = atan2(zold)-@trapang endif if @usetest t = abs(t)-@traptest if @trapmode>7 && @fixangles u = u + #pi - @traptest1 else u = abs(u)-@traptest1 endif endif g = false if @trapmode==4 || @trapmode==8 || @trapmode==12 if (@method==6 && (abs(t)=x || abs(u)>=y)) \ || (@method==13 && (t>=0 || u>=0)) g = true if abs(t)>x x = abs(t) endif if abs(u)>y y = abs(t) endif elseif (@method==11 || @method==12) \ && ((abs(t)=0) || (abs(u)=0)) g = true if abs(t)=0 x = abs(t) endif if abs(u)=0 y = abs(u) endif endif if g f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x + y endif endif elseif @trapmode==5 || @trapmode==9 || @trapmode==13 if (@method==6 && (abs(t)=x && abs(u)>=y)) \ || (@method==13 && (t>=0 && u>=0)) g = true if @method==10 x = abs(t) y = abs(t) endif elseif (@method==11 || @method==12) \ && ((abs(t)=0) && (abs(u)=0)) g = true x = abs(t) y = abs(u) endif if g f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x + y endif endif else;if @trapmode==6 || @trapmode==10 || @trapmode==14 \ ; || @trapmode==7 || @trapmode==11 || @trapmode==15 if @trapmode==7 || @trapmode==11 || @trapmode==15 w = u u = t t = w endif if (@method==6 && (abs(t)=y)) \ || (@method==9 && (t<0 || u>=0)) g = true if abs(t)=x || abs(u)=0 || u<0)) g = true if abs(t)>x x = abs(t) endif if abs(u)>y y = abs(t) endif elseif (@method==11 || @method==12) \ && ((abs(t)=0) || !(abs(u)=0)) g = true if abs(t)=0 x = abs(t) endif if abs(u)=0 y = abs(u) endif endif if g f = true if @colour==0 if @useprev==2 v = abs(m1) elseif @useprev==1 v = abs(om) else v = abs(m) endif elseif @colour<4 z = zold elseif @colour==4 p = i - 1 elseif @colour==5 p = j else v = x + y endif endif endif endif j = j + 1 if @method==0 c = c - 1 if @showall || c==0 f = true endif elseif @method<6 f = true endif endif d = -1 endif elseif i==2 if @version==1 m1 = |#z-zlast| else m1 = |#z| - |zlast| endif if mm1 d = -1 endif elseif i==1 if @version==0 m1 = |#z| if mm1 d = -1 endif elseif @version==1 m = |#z-zlast| else m = |#z| - |zlast| endif else m = |#z| endif if @useprev==1 zold = ztemp ztemp = #z else zold = #z endif zlast = #z i = i + 1 final: if f if @method<3 || @method==4 || @method>5 if @colour==1 v = abs(real(z)) elseif @colour==2 v = abs(imag(z)) elseif @colour==3 if @method!=4 v = atan2(z) + #pi endif elseif @colour==4 || @colour==5 v = p*0.01 endif elseif @method==3 || @method==5 if @fixave i = j endif if @colour==0 v = v/i elseif @colour==1 v = abs(real(z))/i elseif @colour==2 v = abs(imag(z))/i elseif @colour==3 if @method==3 v = (atan2(z) + #pi)/i ; /i just to make it different from total else v = v/i endif elseif @colour==4 v = 0.01*p/i else v = 0.01*j endif endif if @colour<3 && @uselog v = log(1.0+v) endif if @recip v = 1.0/(1.0+v) endif if @mask==0 || ((@mask==1 || @mask==3) && v<@mlow) \ || ((@mask==2 || @mask==3) && v>@mhigh) \ || (@mask==4 && (v>=@mlow && v<=@mhigh)) #index = v else #solid = true endif elseif @solid==0 #solid=true else #index = @fill*0.0025 endif default: title = "MMF3 Turning Points" param version caption = "Version" enum = "Original" "Diff #1" "Diff #2" endparam param mode caption = "Mode" enum = "Both" "Minima" "Maxima" default = 0 endparam param method caption = "Method" enum = "Countdown" "Last" "Total" "Average" "Total1" "Average1" "Nearest" \ "Nearest Below" "First Below" "Last Below" "Farthest" \ "Nearest Above" "First Above" "Last Above" default = 0 hint = "Using 'Countdown' allows you to specify which turning point to \ use, setting a 'Count' of 1 uses the first turning point, 2 uses \ the second and so on. If there are less turning points than the \ specified count for a pixel then you can choose to only colour \ points that reach the count or have the rest coloured using the \ last turning point. 'Total1' and 'Average1' are the same as \ 'Total' and 'Average' except when colouring by angle." endparam param trapmode caption = "Trap type" enum = "Complex" "Real" "Imag" "Angle" "Real || Imag" "Real && Imag" \ "Real || !Imag" "Imag || !Real" "Real || Angle" "Real && Angle" \ "Real || !Angle" "Angle || !Real" "Imag || Angle" "Imag && Angle" \ "Imag || !Angle" "Angle || !Imag" default = 0 visible = @method>5 endparam param trapval caption = "Trap Value/s" default = (0,0) visible = @method>5 && @trapmode!=3 endparam param trapang caption = "Trap Angle (rads)" default = 0.0 hint = "The actual range of the angle in the calculations will be -pi to \ +pi (approx. -3.14159 to + 3.14159)." visible = @method>5 && (@trapmode==3 || @trapmode>7) endparam param usetest caption = "Use Trap Threshold" default = false visible = @method>5 && @trapmode>0 endparam param fixangles caption = "Fix angles" default = false hint = "Should really have been enabled by default, but I've left it this \ way to avoid any compatibility problems. Enabled it changes the \ angle range from 0 to 2*pi instead of -pi to +pi so that all \ values work correctly when using the threshold value." visible = @method>5 && (@trapmode==3 || @trapmode>7) && @usetest endparam param traptest caption = "Trap Threshold" default = 0.0 min = 0.0 hint = "The threshold used for the first (or only) trap variable." visible = @method>5 && (@trapmode==0 || @usetest) endparam param traptest1 caption = "2nd Threshold" default = 0.0 min = 0.0 hint = "The threshold used for the second trap variable." visible = @method>5 && @trapmode>7 && @usetest endparam param fixave caption = "Fix Average" default = false hint = "There is a major bug in the formula - the original average method \ divides by the iteration count instead of the number of turning \ points ! Enabling this fix corrects the problem, default is false \ to avoid any backward compatibility problems." visible = @method==3 || @method==5 endparam param count caption = "Count" default = 1 min = 1 hint = "Use 1 for the first, 2 for the second etc. Completely changes the \ shape of the colouring that reaches the count value." visible = @method==0 endparam param showall caption = "Use last" default = true hint = "Disable if you wish to only colour areas that actually reached the \ count." visible = @method==0 endparam param colour caption = "Colour by" enum = "Magnitude" "Real" "Imag" "Angle" "Iteration" "Count" "Distance" default = 0 hint = "'Distance' doesn't apply to the 'Countdown', 'Last' or Total and \ Average 'Method's. Changing this option often just changes the \ nature of the smooth coloured areas rather than the hard breaks." endparam param useprev caption = "Colour by value" enum = "Original" "Previous" "Next" default = 0 hint = "If 'Previous' the colour used is based on the z value prior to \ the turning point, if 'Next' then the colour used is based on the \ z value following the turning point. Changing this option mainly \ changes the nature of the smooth coloured areas rather than the \ hard breaks." visible = @colour<4 endparam param uselog caption = "Apply log" default = true hint = "When enabled log is applied to the 'Magnitude', 'Real' or 'Imag' \ value before use as the colouring." visible = @colour<3 endparam param recip caption = "Reciprocate" default = false hint = "If enabled the value for colouring is reciprocated." endparam param solid caption = "Fill method" enum = "Solid" "Colour index" default = 0 hint = "You can choose to have uncoloured areas set to the solid colour or \ to a selected colour index." endparam param fill caption = "Fill index" default = 0 hint = "The value matches the colour index from the gradient when \ 'Color Density' is 1 and 'Transfer Function' is linear." endparam param mask caption = "Masking" enum = "Off" "Below(low)" "Above(high)" "Outside" "Inside" default = 0 hint = "Masking allows you to mask out selected sections of your image \ such that only the masking areas are coloured and other areas that \ would normally be coloured are set to #solid. 'Below' only colours \ areas with colouring value less than 'Mask Low', 'Above' only \ colours areas with colouring value higher than 'Mask High', \ 'Outside' colours areas with colouring value either less than \ 'Mask Low' or higher than 'Mask High' and 'Inside' colours areas \ with colouring value higher or equal to 'Mask Low' AND less than \ or equal to 'Mask High'." endparam param mlow caption = "Mask Low" default = 0.1 min = 0.0 visible = @mask==1 || @mask>2 endparam param mhigh caption = "Mask High" default = 0.5 min = 0.0 visible = @mask>1 endparam } MMF3-Periodicity { ; ; This formula came about when I remembered a periodicity checking/colouring ; routine I wrote in an early version of MMFrac. I made the mistake of testing ; for periodicity by using |z|-|testz| instead of |z-testz| however the result ; produced some interesting colouring. ; In this version you can colour using true periodicity or "periodicity" based ; on various options. ; In actual fact the formula is a specialised type of orbit trapping, trapping ; to values from the actual orbit of z rather than user-supplied values. ; The way you choose to trap (ie. check for periodicity) may be using the ; z values or magnitudes or real values or imaginary values or angles. ; The z base value to be used for trapping (periodicity checking) may be the ; final z value, the z value of minimum or maximum magnitude, the z value ; when minimum or maximum |z-zold| occurred or z values based on the turning ; points in the orbit of z. ; You may choose to colour using the periodicity found, the magnitude, the real ; or imaginary values, the angle or the iteration when periodicity was found. ; You may set the "Threshold" distance used in the test for when periodicity is ; found, the closer to zero you set this value the more accurate the result but ; the larger the area that will not be coloured (you can choose to have areas ; not coloured to be filled with a set palette colour or set to "solid"). ; You can override the "Threshold" setting so it is ignored - in this case the ; point where periodicity is found is taken to be the one resulting in the ; minimum value in the threshold test - this allows the formula to be used as ; an Outside colouring as well as an Inside one whatever the other options. ; Full smoothing options are available for when the colouring is Outside. ; global: float fillcolour = 0.0025*@fillindex float twopi = 2.0*#pi float piscale = 20.0/#pi float il = real(1.0/log(@power)) ; for smoothing float lp = log(0.5*log(@bailout)) if !@autopower lp=il*lp endif float cil = real(1.0/log(@cpower)) float clp = log(-0.5*log(@smallbail)) if !@autopowerc clp=cil*clp endif float iv = 0.0001*@iterval*@iterweight float ivc = 0.0001*@itervalc*@iterweightc float iw = 1.0 - 0.01*@iterweight float iwc = 1.0 - 0.01*@iterweightc float co = 0.0025*@convoff init: complex z[#maxiter+1] complex zf = (0,0) complex ozf = (0,0) complex zv = (0,0) z[0] = #z complex z1 = #z complex z2 = #z float mn = 1e100 if @usemin>2 mn=-1.0 endif float m = 0.0 float v = 0.0 float ov = 0.0 float f = -5.0 int i = 1 int j = 0 int k = -1 int l = 0 int n = 0 int p = 0 int op = 0 bool usebasins = false float iuse = 0.0 ; for additer colouring float iwuse = 0.0 ; for additer colouring float cco = 0.0 int li = 0 int pp = 2147483647 int pq = 2147483647 int jj = 0 int d = 0 int c = @count float m1 = 0.0 bool ff = false complex z0 = (0,0) loop: op = p z[i] = #z if @usemin>0 && @usemin<5 if @usemin==1 || @usemin==3 v = |#z| elseif @usemin==2 || @usemin==4 v = |#z-z1| endif if @usemin<3 if vmn mn = v p = i endif elseif @usemin>6 if i>2 && (@method>0 || c>0) m = m1 m1 = |#z| if mm1 if (@usemin==7 || @usemin==9) && d>=0 if @method==2 z0 = z0 + z1 jj = jj + 1 else p = i - 1 endif if @method==0 c = c - 1 if @showall || c==0 ff = true endif else ff = true endif endif d = -1 endif elseif i==2 m1 = |#z| if m < m1 d = 1 elseif m > m1 d = -1 endif else m = |#z| endif endif i = i + 1 z2 = z1 z1 = #z final: if (@usemin>6) && !ff p = -1 i = -1 endif if @colourmode>4 mn=-1e100 else mn = 1e100 endif if @usemin==5 k = round(@frac*(i-1)) elseif @usemin==6 if @iter>i-1 k = i - 1 else k = @iter endif elseif @usemin==0 || ((@usemin>6 && @method==2) && ff) k = i - 1 else k = p endif if (@usemin>6 && @method==2) && ff z0 = z0/jj if @mode==0 zv = z0 elseif @mode==1 m = |z0| elseif @mode==2 m = real(z0) elseif @mode==3 m = imag(z0) elseif @mode==4 m = atan2(z0) endif elseif (@usemin<7) || ff if @mode==0 zv = z[k] elseif @mode==1 m = |z[k]| elseif @mode==2 m = real(z[k]) elseif @mode==3 m = imag(z[k]) elseif @mode==4 m = atan2(z[k]) endif endif if (@useall && !@fixall) || ((@usemin>6 && @method==2) && ff) j = i - 2 else j = k - 1 endif if j>=0 repeat if j!=k if @mode==0 v = |z[j]-zv| else if @mode==1 v = |z[j]|-m elseif @mode==2 v = real(z[j])-m elseif @mode==3 v = imag(z[j])-m else v = atan2(z[j])-m endif if @fixval v = abs(v) endif endif if @colourmode<2 if (mn-v)/mn>1e-11 mn = v if @colourby==0 p = abs(k-j) elseif @colourby==5 || @colourby==6 p = j else zf = z[j] endif if @colourmode==0 && mn<@threshold pp = abs(k-j) j = -5 endif endif elseif @colourmode==5 if v>mn mn = v if @colourby==0 p = abs(k-j) elseif @colourby==5 || @colourby==6 p = j else zf = z[j] endif endif else v = v - @threshold if (abs(v)=0) \ || (@colourmode==4 && v<0) ) ) \ || (abs(v)>mn && (@colourmode==6 || (@colourmode==7 && v>=0) \ || (@colourmode==8 && v<0) ) ) mn = v if @colourby==0 p = abs(k-j) elseif @colourby==5 || @colourby==6 p = j else zf = z[j] endif endif endif endif j = j - 1 until j<0 endif if @useall && @fixall && k>=0 j = k + 1 while j < i if @mode==0 v = |z[j]-zv| else if @mode==1 v = |z[j]|-m elseif @mode==2 v = real(z[j])-m elseif @mode==3 v = imag(z[j])-m else v = atan2(z[j])-m endif if @fixval v = abs(v) endif endif if @colourmode<2 if (@colourmode==1 || !@newfix || @colourall || (abs(k-j)1e-11 mn = v if @colourby==0 p = abs(k-j) elseif @colourby==5 || @colourby==6 p = j else zf = z[j] endif if @colourmode==0 && mn<@threshold pp = 0 j = i endif endif elseif @colourmode==5 if v>mn mn = v if @colourby==0 p = abs(k-j) elseif @colourby==5 || @colourby==6 p = j else zf = z[j] endif endif else v = v - @threshold if (abs(v)=0) \ || (@colourmode==4 && v<0) ) ) \ || (abs(v)>mn && (@colourmode==6 || (@colourmode==7 && v>=0) \ || (@colourmode==8 && v<0) ) ) mn = v if @colourby==0 p = abs(k-j) elseif @colourby==5 || @colourby==6 p = j else zf = z[j] endif endif endif j = j + 1 endwhile endif if @smooth==5 if k>0 && (pp<2147483647 || @colourall || @colourmode>0) if @colourby==0 v = 0.1*p elseif @colourby==1 v = 10.0*cabs(zf) elseif @colourby==2 v = 10.0*abs(real(zf)) elseif @colourby==3 v = 10.0*abs(imag(zf)) elseif @colourby==4 v = 40.0 + piscale*atan2(zf) elseif @colourby==5 v = 0.1*p elseif @colourby==6 if k>p j = k k = p p = j endif j = k zf = 1.0 repeat zf = zf*z[j] until (j=j+1)>=p zf = zf^(1.0/(p-k)) ;v = (p-k)*(#pi + atan2(zf))/(2.0*#pi) v = cabs(zf) endif if @mask==0 || ((@mask==1 || @mask==3) && v<@mlow) \ || ((@mask==2 || @mask==3) && v>@mhigh) \ || (@mask==4 && (v>=@mlow && v<=@mhigh)) if @colourby!=0 || @isolation==0 || p==@isolation #index = v else #solid = true endif else #solid = true endif elseif @fill==0 #solid = true else #index = fillcolour endif else if @usemin>=5 op = p ozf = zf n = k l = j pq = pp else if @colourmode>4 mn = -1e100 else mn = 1e100 endif if @usemin>0 n = op else n = i - 2 endif if n>0 if @mode==0 zv = z[n] elseif @mode==1 m = |z[n]| elseif @mode==2 m = real(z[n]) elseif @mode==3 m = imag(z[n]) elseif @mode==4 m = atan2(z[n]) endif if @useall && !@fixall l = i - 3 else l = n - 1 endif repeat if l!=n if @mode==0 ov = |z[l]-zv| else if @mode==1 ov = |z[l]|-m elseif @mode==2 ov = real(z[l])-m elseif @mode==3 ov = imag(z[l])-m else ov = atan2(z[l])-m endif if @fixval ov = abs(ov) endif endif if @colourmode<2 if (mn-ov)/mn>1e-11 mn = ov if @colourby==0 op = abs(n-l) elseif @colourby==5 op = l else ozf = z[l] endif if @colourmode==0 && mn<@threshold pq = abs(n-l) l = -5 endif endif elseif @colourmode==5 if ov>mn mn = ov if @colourby==0 op = abs(n-l) elseif @colourby==5 op = l else ozf = z[l] endif endif else ov = ov - @threshold if (abs(ov)=0) \ || (@colourmode==4 && ov<0) ) )\ || (abs(ov)>mn && (@colourmode==6 || (@colourmode==7 && ov>=0) \ || (@colourmode==8 && ov<0) ) ) mn = ov if @colourby==0 op = abs(n-l) elseif @colourby==5 op = l else ozf = z[l] endif endif endif endif l = l - 1 until l<0 if @useall && @fixall l = n + 1 while l1e-11 mn = ov if @colourby==0 op = abs(n-l) elseif @colourby==5 op = l else ozf = z[l] endif if @colourmode==0 && mn<@threshold pq = 0 l = i endif endif elseif @colourmode==5 if ov>mn mn = ov if @colourby==0 op = abs(n-l) elseif @colourby==5 op = l else ozf = z[l] endif endif else ov = ov - @threshold if (abs(ov)=0) \ || (@colourmode==4 && ov<0) ) )\ || (abs(ov)>mn && (@colourmode==6 || (@colourmode==7 && ov>=0) \ || (@colourmode==8 && ov<0) ) ) mn = ov if @colourby==0 op = abs(n-l) elseif @colourby==5 op = l else ozf = z[l] endif endif endif l = l + 1 endwhile endif endif endif ; usemin if @colourby==0 v = 0.1*p elseif @colourby==1 v = 10.0*cabs(zf) elseif @colourby==2 v = 10.0*abs(real(zf)) elseif @colourby==3 v = 10.0*abs(imag(zf)) elseif @colourby==4 v = 40.0 + piscale*atan2(zf) elseif @colourby==5 v = 0.1*p endif if @maskfirst if !(@mask==0 || ((@mask==1 || @mask==3) && v<@mlow) \ || ((@mask==2 || @mask==3) && v>@mhigh) \ || (@mask==4 && (v>=@mlow && v<=@mhigh))) k=-100 endif endif if k>0 && n>0 && ((pp<2147483647 && pq<2147483647) \ || @colourall || @colourmode>0) if @colourby==0 ov = 0.1*op elseif @colourby==1 ov = 10.0*cabs(ozf) elseif @colourby==2 ov = 10.0*abs(real(ozf)) elseif @colourby==3 ov = 10.0*abs(imag(ozf)) elseif @colourby==4 ov = 40.0 + piscale*atan2(ozf) elseif @colourby==5 ov = 0.1*op endif if (@smooth==1 || (@smooth==4 && |#z-z1|>0.5)) f = real(#z) if f<0 cco = co f = 1 + @fudge1c*f iuse = ivc iwuse = iwc li = @logiterc usebasins = true else f = @fudge1*f iuse = iv iwuse = iw li = @logiter endif elseif (@smooth==0 || @smooth==3) && |#z-z1|>0.5 if @autopower f = real((lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|z1|))) if @usefudge f = @fudge*f endif else f = @fudge*real(lp-il*log(0.5*log(|#z|))) endif iuse = iv iwuse = iw li = @logiter elseif (@smooth>1 && @smooth<5) && |#z-z1|<0.5 cco = co if @fixedconv if @autopowerc f = real( (clp-log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|z1-@fixedval|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-@fixedval|))) ) endif elseif @autopowerc f = real( (clp-log(-0.5*log(|#z-z1|))) \ /log(log(|#z-z1|)/log(|z1-z2|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-z1|))) ) endif iuse = ivc iwuse = iwc li = @logiterc usebasins = true else if @fill==0 #solid = true else #index = fillcolour endif f = -5 endif if f!=-5 if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) v = ov + (v-ov) * f else v = v + (v-ov) * f endif if iuse!=0 ov = #numiter+f if li==1 ov = log(1+ov) elseif li==2 ov = log(1+log(1+ov)) endif v = iuse*ov+iwuse*v endif if usebasins && @zbasin>0 if @smooth!=1 && (@smooth!=4 || |#z-z1|<0.5) z2 = z1 z1 = #z endif if @zbasin==1 ov = abs(real(twopi+atan2(z1))) mn = abs(real(twopi+atan2(z2))) elseif @zbasin==2 ov = abs(real(z1)) mn = abs(real(z2)) elseif @zbasin==3 ov = abs(imag(z1)) mn = abs(imag(z2)) elseif @zbasin==4 ov = abs(real(z1)+imag(z1)) mn = abs(real(z2)+imag(z2)) elseif @zbasin==5 ov = abs(2*real(z1)+imag(z1)) mn = abs(2*real(z2)+imag(z2)) elseif @zbasin==6 ov = abs(real(z1)+2*imag(z1)) mn = abs(real(z2)+2*imag(z2)) elseif @zbasin==7 ov = abs(real(z1)/(abs(imag(z1))+1)) mn = abs(real(z2)/(abs(imag(z2))+1)) elseif @zbasin==8 ov = abs(imag(z1)/(abs(real(z1))+1)) mn = abs(imag(z2)/(abs(real(z2))+1)) elseif @zbasin==9 ov = abs(2*real(sqrt(z1))+imag(sqrt(z1))) mn = abs(2*real(sqrt(z2))+imag(sqrt(z2))) elseif @zbasin==10 ov = abs(real(sqrt(z1))+2*imag(sqrt(z1))) mn = abs(real(sqrt(z2))+2*imag(sqrt(z2))) endif if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) v = v + @zscale*(mn+(ov-mn)*f) elseif @smooth!=5 v = v + @zscale*(ov+(ov-mn)*f) endif endif if !@maskfirst if @mask==0 || ((@mask==1 || @mask==3) && v<@mlow) \ || ((@mask==2 || @mask==3) && v>@mhigh) \ || (@mask==4 && (v>=@mlow && v<=@mhigh)) if @colourby!=0 || @isolation==0 || @isolation==p #index = cco + v else #solid = true endif else #solid = true endif elseif @colourby!=0 || @isolation==0 || @isolation==p #index = cco + v else #solid = true endif endif elseif @fill==0 || k==-100 #solid = true else #index = fillcolour endif endif default: title = "MMF3 Periodicity" param mode caption = "Colour mode" enum = "True periodicity" "Periodic magn" "Periodic real" "Periodic imag" \ "Periodic angle" hint = "'True periodicity' checks for periodicity of z, the alternative options \ check for periodicity of |z|, real(z), imag(z) and atan2(z). The \ alternative options produce interesting Julia colouring in particular." endparam param colourby caption = "Colour by" enum = "Periodicity" "Magnitude" "Real" "Imag" "Angle" "Iteration" \ "Distance Estimator" hint = "Choosing 'Magnitude' when using 'True periodicity' or \ 'Periodic magn', or choosing 'Real' with 'Periodic real', \ or choosing 'Imag' with 'Periodic imag' or choosing 'Angle' \ with 'Periodic angle' are fairly redundant as all that does \ is colour according to the relevant function of final z." endparam param isolation caption = "Isolation" default = 0 min = 0 hint = "Use to isolate particular periodicities. Using 0 will colour all \ periodicities found, 1 will colour only point attractors, 2 will \ colour areas with a periodicity of 2, 3 of 3 etc." visible = @colourby==0 endparam param fixval caption = "Correction" default = true hint = "Added to correct a mistake I made - I left it as an option \ as disabling it fixes some of my old parameter files." endparam param usemin caption = "Base z value" enum = "Final z" "Min |z|" "Min |z-zold|" "Max |z|" "Max |z-zold|" \ "Frac. iter" "Iteration" "Min or Max" "Minima" "Maxima" default = 0 hint = "Try 'Min' when used as an Outside colouring. 'Frac. iter' traps to \ the z value from the iteration that was the given fraction of the \ way through the iterations for each pixel. 'Iteration' traps to \ the z value from the specified iteration, or the last iteration if \ the specified iteration wasn't reached." endparam param method caption = "Min/Max method" enum = "Countdown" "Last" "Average" default = 0 hint = "Using 'Countdown' allows you to specify which turning point to \ use, setting a 'Count' of 1 uses the first turning point, 2 uses \ the second and so on. If there are less turning points than the \ specified count for a pixel then you can choose to only colour \ points that reach the count or have the rest coloured using the \ last turning point." visible = @usemin>6 endparam param count caption = "Count" default = 1 min = 1 hint = "Use 1 for the first turning point, 2 for the second etc." visible = @usemin>6 && @method==0 endparam param showall caption = "Use last" default = true hint = "Disable if you wish to only colour areas that actually reached the \ count." visible = @usemin>6 && @method==0 endparam param frac caption = "Iter fraction" default = 0.5 min = 0.0 max = 1.0 hint = "Specifies the fraction of the way through the iterations from \ which the z value for trapping is taken." visible = @usemin==5 endparam param iter caption = "Iteration" default = 50 min = 1 hint = "Specifies the iteration from which the z value for trapping is \ taken." visible = @usemin==6 endparam param colourmode caption = "Trapping" enum = "Original" "Minimum" "Nearest" "Nearest Above" "Nearest Below" \ "Maximum" "Farthest" "Farthest Above" "Farthest Below" default = 0 hint = "For 'correct' periodicity use Original, the other methods are \ equivalent to similar methods used in standard orbit trapping and \ the Nearest and Farthest methods use the Threshold value which \ it's best to increase from the default value for these methods." endparam param useall caption = "Check all values" default = false hint = "Normally only values prior to the base value are tested for \ periodicity but you may enable all values to be checked." visible = @usemin>0 && (@usemin<7 || @method<2) endparam param fixall caption = "Fix all" default = false hint = "Fixes an error with the testing order when 'Check all values' is \ enabled." visible = @useall && @usemin>0 && (@usemin<7 || @method<2) endparam param colourall caption = "Colour all" default = false hint = "When enabled inside areas that didn't pass the threshold \ test will be coloured according to the best guess." visible = @colourmode==0 && (@usemin<7 || @method<2) endparam param newfix caption = "Fix first" default = false hint = "This fix corrects a problem with the original formula that meant \ that the periodicity found was not necessarily the minimum." visible = @useall && @usemin>0 && (@usemin<7 || @method<2) \ && @colourmode==0 && !@colourall && @fixall endparam param threshold caption = "Threshold" default = 1e-9 min = 0 hint = "Reducing this can improve accuracy when using the Original \ trapping method. It sets the trapping test distance for the \ Nearest and Farthest trapping methods and it's best to increase \ the value from the default for these methods." visible = (!@colourall || @colourmode>0) && @colourmode!=1 && @colourmode!=5 endparam param fill caption = "Fill method" enum = "Solid" "Fill colour" default = 0 hint = "Allows you to choose how areas not coloured otherwise will \ be filled." endparam param fillindex caption = "Fill colour" default = 1.0 min = 0.0 hint = "Value matches the same periodicity count colour." visible = @fill==1 endparam heading caption = "Smoothing" endheading param smooth caption = "Method" default = 5 enum = "Divergent" "Finalz" "Convergent" "Div&Conv" "Finalz&Conv" "None" endparam param autopower caption = "Auto-power (div)" default = true hint = "When enabled you should get correct smoothing on any divergent \ fractal without having to supply a power value and smoothing with \ low bailout values is much improved." visible = @smooth==0 || @smooth==3 endparam param power caption = "Power" default = (2,0) hint = "This should match the power/degree/exponent in the \ fractal formula." visible = (@smooth==0 || @smooth==3) && !@autopower endparam param bailout caption = "Bailout" default = 65536.0 hint = "This should match the bailout in the fractal formula." visible = @smooth==0 || @smooth==3 endparam param usefudge caption = "Use fudge (div)" default = false hint = "Allows you to enable use of the divergent scaling fudge \ when using 'Auto-power (div)'." visible = (@smooth==0 || @smooth==3) && @autopower endparam param fudge caption = "Fudge (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = @smooth!=2 && @smooth!=5 \ && (@usefudge || !@autopower) endparam param fudge1 caption = "Fudge 1 (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = (@smooth==1 || @smooth==4) endparam param iterval caption = "Add iter (div)" default = 0.0 hint = "Use to add some of the smooth iteration value to divergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth!=2 && @smooth!=5 endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth!=2 && @smooth!=5 && @iterval!=0 endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth!=2 && @smooth!=5 && @iterval!=0 && @iterweight!=0 endparam param autopowerc caption = "Auto-power (conv)" default = true hint = "When enabled you should get correct smoothing on any convergent \ fractal without having to supply a power value." visible = @smooth>1 && @smooth<5 endparam param cpower caption = "Convergent Power" default = (2,0) hint = "This should match the power (exponent/degree) for the \ convergent areas of your main fractal formula." visible = @smooth>1 && @smooth!=5 && !@autopowerc endparam param smallbail caption = "Small bailout" default = 1e-5 hint = "This should match the small bailout in your fractal formula." visible = @smooth>1 && @smooth!=5 endparam param usefudgec caption = "Use fudge (conv)" default = false hint = "Allows you to enable use of the convergent scaling fudge \ when using 'Auto-power (conv)'." visible = @smooth>1 && @smooth!=5 && @autopowerc endparam param fudgec caption = "Fudge (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power (conv)' or the best value you can \ find for the 'Convergent Power' parameter don't \ produce smooth results then modifying this value \ should help." visible = @smooth>0 && @smooth!=5 \ && (!@autopowerc || @usefudgec) endparam param fudge1c caption = "Fudge 1 (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1." visible = @smooth==1 endparam param fixedconv caption = "Absolute convergence" default = false hint = "Use with main formulas that test for convergence using \ only |z-value| rather than |z-zold| eg. some Magnet formulas." visible = @smooth>1 && @smooth!=5 endparam param fixedval caption = "Convergence value" default = (1,0) hint = "Should match the value the main formula uses when testing \ for convergence." visible = @smooth>1 && @smooth!=5 && @fixedconv endparam param itervalc caption = "Add iter (conv)" default = 0.0 hint = "Use to add some of the smooth iteration value to convergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth>0 && @smooth!=5 endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth>0 && @smooth!=5 && @itervalc!=0 endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth>0 && @smooth!=5 && @itervalc!=0 && @iterweightc!=0 endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "roots 1" "roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ final or penultimate value of z." visible = @smooth>0 && @smooth!=5 endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = @smooth>0 && @smooth!=5 && @zbasin>0 endparam param convoff caption = "Offset (conv.)" default = 0.0 hint = "Offsets the final colour index in convergent areas. \ The value corresponds to gradient points when Color Density \ is 1 and Transfer Function is Linear." endparam param mask caption = "Masking" enum = "Off" "Below(low)" "Above(high)" "Outside" "Inside" default = 0 hint = "Masking allows you to mask out selected sections of your image \ such that only the masking areas are coloured and other areas that \ would normally be coloured are set to #solid. 'Below' only colours \ areas with colouring value less than 'Mask Low', 'Above' only \ colours areas with colouring value higher than 'Mask High', \ 'Outside' colours areas with colouring value either less than \ 'Mask Low' or higher than 'Mask High' and 'Inside' colours areas \ with colouring value higher or equal to 'Mask Low' AND less than \ or equal to 'Mask High'." endparam param maskfirst caption = "Mask before smoothing" default = false hint = "You can choose to mask based on the non-smoothed or smoothed \ colouring value. If you choose to base masking on the smoothed \ value then any iteration count added will affect the masking." visible = @smooth!=5 endparam param mlow caption = "Mask Low" default = 0.1 min = 0.0 visible = @mask==1 || @mask>2 endparam param mhigh caption = "Mask High" default = 0.5 min = 0.0 visible = @mask>1 endparam } MMF3g-vergence { ; ; This colouring is inspired by the method I found for calculating ; correct standard smoothed iterations using a more accurate ; estimate of the divergence or convergence of z ie. using ; log(|z|)/log(|zold|) for the degree of divergence and ; log(|z-zold|)/log(|zold-zolder|) for the degree of convergence. ; It allows you to colour based on the 'vergence from every iteration. ; ; You can choose to calculate the 'vergence using either divergent testing ; (using |z| and |zold|) or convergent testing (using |z-zold| and |zold-zolder|). ; ; The types of 'vergence are: ; ; 1. Divergence: ; |z|>=|zold|>1 or |z-zold|>=|zolder-zold|>1 ; 2. Convergence: ; |z|<=|zold|<1 or |z-zold|<=|zold-zolder|<1 ; 3. Inverse Divergence: ; |zold|>=|z|>1 or |zold-zolder|>=|z-zold|>1 ; 4. Inverse Convergence: ; |zold|<=|z|<1 or |zold-zolder|<=|z-zold|<1 ; 5. Increases: ; |z|>1 and |zold|<1 or |z-zold|>1 and |zold-zolder|<1 ; 6. Decreases: ; |z|<1 and |zold|>1 or |z-zold|<1 and |zold-zolder|>1 ; ; The formula includes full smoothing options, smoothing of the values ; from 'vergence is disabled by default but is sometimes needed to remove ; iteration banding especially when colouring by "total" or "average". ; ; You may also choose to mix in the iteration count or zbasins. ; ; Released November '04 ; global: float il = real(1/log(@power)) ; for divergent smoothing float lp = log(0.5*log(@bailout)) if !@dauto lp = il*lp endif float cil = real(1/log(@cpower)) ; for convergent smoothing float clp = log(-0.5*log(@smallbail)) if !@cauto clp = cil*clp endif float iv = 0.0001*@iterval*@iterweight float ivc = 0.0001*@citerval*@iterweightc float iw = 1.0 - 0.01*@iterweight float iwc = 1.0 - 0.01*@iterweightc float fc = 0.0025*@fillcolour float fc1 = 0.0025*@fillcolour1 float oc = 0.0025*@convoff bool all = @always && \ ( (@iterval!=0 && (@method==0 || @method==2 || @method==3 || (@method>4 && @method!=9))) \ || ((@zbasin>0 || @citerval!=0) && (@method==1 || @method==2 || (@method>3 && @method!=8))) ) float diviverg = 0.0 float conviverg = 0.0 float idiviverg = 0.0 float iconviverg = 0.0 float inciverg = 0.0 float deciverg = 0.0 if @divverg>0.0 diviverg = 1.0/@divverg endif if @convverg>0.0 conviverg = 1.0/@convverg endif if @idivverg>0.0 idiviverg = 1.0/@idivverg endif if @iconvverg>0.0 iconviverg = 1.0/@iconvverg endif if @incverg>0.0 inciverg = 1.0/@incverg endif if @decverg>0.0 deciverg = 1.0/@decverg endif init: complex zold = #z ; old z complex zolder = #z ; older z int i = 0 ; iteration count ; divergent/convergent calculation float d = -1.0 ; |#z| float od = -1.0 ; |#zold| float dv = 0.0 ; log(d)/log(od) etc. int v = 0 ; 'vergence found ; divergence float tdv = 0.0 ; total degree of divergence float otdv = 0.0 ; old total int id = 0 ; Count or iteration at max/min int oid = 0 ; Previous count or iteration at max/min complex dz = #z ; z at max/min complex odz = #z ; Previous z at max/min float mdv = 0 ; min or max degree of divergence float omdv = 0 ; old min or max bool gotd = false ; "got a value" bool gotdf = false ; "got first" ; convergence float tcv = 0.0 float otcv = 0.0 int ic = 0 int oic = 0 complex cz = #z complex ocz = #z float mcv = 0 float omcv = 0 bool gotc = false bool gotcf = false ; inverse divergence float tidv = 0.0 ; total degree of inverse divergence float otidv = 0.0 ; old total int iid = 0 ; Count or iteration at max/min int oiid = 0 ; Previous count or iteration at max/min complex idz = #z ; z at max/min complex oidz = #z ; Previous z at max/min float midv = 0 ; min or max degree of inverse divergence float omidv = 0 ; old min or max bool gotid = false ; "got a value" bool gotidf = false ; inverse convergence float ticv = 0.0 float oticv = 0.0 int iic = 0 int oiic = 0 complex icz = #z complex oicz = #z float micv = 0 float omicv = 0 bool gotic = false bool goticf = false ; increase float tinv = 0.0 ; total degree of increase float otinv = 0.0 ; old total int iin = 0 ; Count or iteration at max/min int oiin = 0 ; Previous count or iteration at max/min complex inz = #z ; z at max/min complex oinz = #z ; Previous z at max/min float minv = 0 ; min or max degree of increase float ominv = 0 ; old min or max bool gotin = false ; "got a value" bool gotinf = false ; decrease float tdev = 0.0 float otdev = 0.0 int ide = 0 int oide = 0 complex dez = #z complex odez = #z float mdev = 0 float omdev = 0 bool gotde = false bool gotdef = false float f = 0 float ivuse = 0 float iwuse = 0 int li = 0 bool usebasins = false if @method==11 usebasins=true endif bool isstandard = true float o = 0.0 loop: od = d if @method<8 if @calcdiv && @divsmooth if @dmode>0 oid = id endif if @dmode<2 otdv = tdv elseif @dmode>2 omdv = mdv odz = dz endif endif if @calcconv && @convsmooth if @cmode>0 oic = ic endif if @cmode<2 otcv = tcv elseif @cmode>2 omcv = mcv ocz = cz endif endif if @calcidiv && @idivsmooth if @idmode>0 oiid = iid endif if @idmode<2 otidv = tidv elseif @idmode>2 omidv = midv oidz = idz endif endif if @calciconv && @iconvsmooth if @icmode>0 oiic = iic endif if @icmode<2 oticv = ticv elseif @icmode>2 omicv = micv oicz = icz endif endif if @calcinc && @incsmooth if @incmode>0 oiin = iin endif if @incmode<2 otinv = tinv elseif @incmode>2 ominv = minv oinz = inz endif endif if @calcdec && @decsmooth if @decmode>0 oide = ide endif if @decmode<2 otdev = tdev elseif @decmode>2 omdev = mdev odez = dez endif endif endif v = -1 if @type==0 || i>0 if @type==0 d = |#z| elseif @cfixed d = |#z-@cfixedval| else d = |#z-zold| endif if od>0 && d>0 if od>1.0 && d>=od if @divinv dv = log(1+abs(log(od)/log(d)-diviverg)) else dv = log(1+abs(log(d)/log(od)-@divverg)) endif v = 0 elseif od<1.0 && d<=od if @convinv dv = log(1+abs(log(od)/log(d)-conviverg)) else dv = log(1+abs(log(d)/log(od)-@convverg)) endif v = 1 elseif d>1.0 && od>=d if @idivinv dv = log(1+abs(log(od)/log(d)-idiviverg)) else dv = log(1+abs(log(d)/log(od)-@idivverg)) endif v = 2 elseif d<1.0 && od<=d if @iconvinv dv = log(1+abs(log(od)/log(d)-iconviverg)) else dv = log(1+abs(log(d)/log(od)-@iconvverg)) endif v = 3 elseif od<1.0 && d>1.0 if @incinv dv = log(1.0+abs(log(od)/log(d)+inciverg)) else dv = log(1.0+abs(log(d)/log(od)+@incverg)) endif v = 4 elseif od>1.0 && d<1.0 if @decinv dv = log(1.0+abs(log(od)/log(d)+deciverg)) else dv = log(1.0+abs(log(d)/log(od)+@decverg)) endif v=5 endif endif endif if @calcdiv && (v==0 || (@combdic && v==3) || (@combdinc && v==4)) if @divtrap==0 || (@divtrap==1 && dv<=@divmin) || (@divtrap==2 && dv>=@divmax) \ || (@divtrap==3 && dv>=@divmin && dv<=@divmax) \ || (@divtrap==4 && (dv<=@divmin || dv>=@divmax)) if @dmode<3 tdv = tdv + dv id = id + 1 gotd = true elseif @dmode==6 || (@dmode==3 && dvmdv) || !gotd dz = #z mdv = dv id = i if @dmode!=5 if !gotd odz = #z omdv = dv oid = i endif gotd = true elseif !@divsmooth || @method>7 || gotdf gotd = true else odz = #z omdv = dv oid = i gotdf = true endif endif endif elseif @calcconv && (v==1 || (@combcid && v==2) || (@combcdec && v==5)) if @convtrap==0 || (@convtrap==1 && dv<=@convmin) || (@convtrap==2 && dv>=@convmax) \ || (@convtrap==3 && dv>=@convmin && dv<=@convmax) \ || (@convtrap==4 && (dv<=@convmin || dv>=@convmax)) if @cmode<3 tcv = tcv + dv ic = ic + 1 gotc = true elseif @cmode==6 || (@cmode==3 && dvmcv) || !gotc cz = #z mcv = dv ic = i if @cmode!=5 if !gotc ocz = #z omcv = dv oic = i endif gotc = true elseif !@convsmooth || @method>7 || gotcf gotc = true else ocz = #z omdv = dv oid = i gotcf = true endif endif endif elseif @calcidiv && (v==2 || (@combiddec && v==5)) if @idivtrap==0 || (@idivtrap==1 && dv<=@idivmin) || (@idivtrap==2 && dv>=@idivmax) \ || (@idivtrap==3 && dv>=@idivmin && dv<=@idivmax) \ || (@idivtrap==4 && (dv<=@idivmin || dv>=@idivmax)) if @idmode<3 tidv = tidv + dv iid = iid + 1 gotid = true elseif @idmode==6 || (@idmode==3 && dvmidv) || !gotid idz = #z midv = dv iid = i if @idmode!=5 if !gotid oidz = #z omidv = dv oiid = i endif gotid = true elseif !@idivsmooth || @method>7 || gotidf gotid = true else oidz = #z omidv = dv oiid = i gotidf = true endif endif endif elseif @calciconv && (v==3 || (@combicinc && v==4)) if @iconvtrap==0 || (@iconvtrap==1 && dv<=@iconvmin) || (@iconvtrap==2 && dv>=@iconvmax) \ || (@iconvtrap==3 && dv>=@iconvmin && dv<=@iconvmax) \ || (@iconvtrap==4 && (dv<=@iconvmin || dv>=@iconvmax)) if @icmode<3 ticv = ticv + dv iic = iic + 1 gotic = true elseif @icmode==6 || (@icmode==3 && dvmicv) || !gotic icz = #z micv = dv iic = i if @idmode!=5 if !gotic oicz = #z omicv = dv oiic = i endif gotic = true elseif !@iconvsmooth || @method>7 || goticf gotic = true else oicz = #z omicv = dv oiic = i goticf = true endif endif endif elseif @calcinc && v==4 if @inctrap==0 || (@inctrap==1 && dv<=@incmin) || (@inctrap==2 && dv>=@incmax) \ || (@inctrap==3 && dv>=@incmin && dv<=@incmax) \ || (@inctrap==4 && (dv<=@incmin || dv>=@incmax)) if @incmode<3 tinv = tinv + dv iin = iin + 1 gotin = true elseif @incmode==6 || (@incmode==3 && dvminv) || !gotin inz = #z minv = dv iin = i if @incmode!=5 if !gotin oinz = #z ominv = dv oiin = i endif gotin = true elseif !@incsmooth || @method>7 || gotinf gotin = true else oinz = #z ominv = dv oiin = i gotinf = true endif endif endif elseif @calcdec && v==5 if @dectrap==0 || (@dectrap==1 && dv<=@decmin) || (@dectrap==2 && dv>=@decmax) \ || (@dectrap==3 && dv>=@decmin && dv<=@decmax) \ || (@dectrap==4 && (dv<=@decmin || dv>=@decmax)) if @decmode<3 tdev = tdev + dv ide = ide + 1 gotde = true elseif @decmode==6 || (@decmode==3 && dvmdev) || !gotde dez = #z mdev = dv ide = i if @decmode!=5 if !gotde odez = #z omdev = dv oide = i endif gotde = true elseif !@decsmooth || @method>7 || gotdef gotde = true else odez = #z omdev = dv oide = i gotdef = true endif endif endif endif zolder = zold zold = #z i = i + 1 final: f = real(#z); fractional iteration if using Hinrich's smoothing d = |#z| if @cfixed dv = |#z-@cfixedval| else dv = |#z-zold| endif v=0 if f<0 && d<@bailout && (@method==4 || @method==5 || @method==6) usebasins = true isstandard = false o = oc f = 1+@fudge1c*f ivuse = ivc iwuse = iwc li = @logiterc elseif d>=@bailout && (@method==0 || @method==2 || @method==6) if @dauto if @usedfudge f = 1 + @fudge*real(lp - log(0.5*log(d)))/log(log(d)/log(|zold|)) else f = 1 + real(lp - log(0.5*log(d)))/log(log(d)/log(|zold|)) endif else f = 1 + @fudge*real(lp - il*log(0.5*log(d))) endif ivuse = iv iwuse = iw li = @logiter elseif f>=0 && dv>@smallbail && d<@bailout && (@method==3 || @method==5 || @method==7) isstandard = false f = @fudge1*f ivuse = iv iwuse = iw li = @logiter elseif dv<=@smallbail && (@method==1 || @method==2 || @method==7) o = oc usebasins = true if @cfixed if @cauto if @usecfudge f = 1 + @fudgec*real(clp - log(-0.5*log(dv))) \ /log(log(dv)/log(|zold-@cfixedval|)) else f = 1 + real(clp - log(-0.5*log(dv))) \ /log(log(dv)/log(|zold-@cfixedval|)) endif else f = 1 + @fudgec*real(clp - cil*log(-0.5*log(dv))) endif elseif @cauto if @usecfudge f = 1 + @fudgec*real(clp - log(-0.5*log(dv))) \ /log(log(dv)/log(|zold-zolder|)) else f = 1 + real(clp - log(-0.5*log(dv))) \ /log(log(dv)/log(|zold-zolder|)) endif else f = 1 + @fudgec*real(clp - cil*log(-0.5*log(dv))) endif ivuse = ivc iwuse = iwc li = @logiterc elseif @method==8 && d>=@bailout ivuse = iv iwuse = iw li = @logiter elseif @method==9 && dv<=@smallbail o = oc ivuse = ivc iwuse = iwc li = @logiterc elseif @method==10 if dv>@smallbail ivuse = iv iwuse = iw li = @logiter else o = oc ivuse = ivc iwuse = iwc li = @logiterc endif elseif @method!=11 v = -1 if @fill==0 #solid = true else #index = fc endif endif if v!=-1 d = 0.0 if gotd || gotdf gotd = true if @dmode==0 if @method<8 && @divsmooth if id>1 od = otdv else od = tdv endif tdv = od + f*(tdv-od) endif elseif @dmode==1 tdv = tdv/id if @method<8 && @divsmooth && id>1 od = otdv/oid tdv = od + f*(tdv-od) endif elseif @dmode==2 tdv = 0.01*id if @method<8 && @divsmooth && id>1 od = 0.01*oid tdv = od + f*(tdv-od) endif elseif @dval==0 tdv = mdv if @method<8 && @divsmooth tdv = omdv + f*(tdv-omdv) endif elseif @dval==1 tdv = 0.01*id if @method<8 && @divsmooth od = 0.01*oid tdv = od + f*(tdv-od) endif elseif @dval==2 tdv = cabs(dz) if @method<8 && @divsmooth od = cabs(odz) tdv = od + f*(tdv-od) endif elseif @dval==3 tdv = abs(real(dz)) if @method<8 && @divsmooth od = abs(real(odz)) tdv = od + f*(tdv-od) endif elseif @dval==4 tdv = abs(imag(dz)) if @method<8 && @divsmooth od = abs(imag(odz)) tdv = od + f*(tdv-od) endif endif if @divrecip tdv = 1/(tdv+1e-100) endif if @divfunc==1 tdv = log(1+tdv) elseif @divfunc==2 tdv = sqrt(tdv) elseif @divfunc==3 tdv = exp(tdv) elseif @divfunc==4 tdv = tdv*tdv elseif @divfunc==5 tdv = tdv^@divpower elseif @divfunc==6 tdv = sin(tdv) elseif @divfunc==7 tdv = cos(tdv) elseif @divfunc==8 tdv = tan(tdv) elseif @divfunc==9 tdv = sinh(tdv) elseif @divfunc==10 tdv = cosh(tdv) elseif @divfunc==11 tdv = tanh(tdv) endif d = d + @divscale*tdv endif if gotc || gotcf gotd = true if @cmode==0 if @method<8 && @convsmooth if ic>1 od = otcv else od = tcv endif tcv = od + f*(tcv-od) endif elseif @cmode==1 tcv = tcv/ic if @method<8 && @convsmooth && ic>1 od = otcv/oic tcv = od + f*(tcv-od) endif elseif @cmode==2 tcv = 0.01*ic if @method<8 && @convsmooth && ic>1 od = 0.01*oic tcv = od + f*(tcv-od) endif elseif @cval==0 tcv = mcv if @method<8 && @convsmooth tcv = omcv + f*(tcv-omcv) endif elseif @cval==1 tcv = 0.01*ic if @method<8 && @convsmooth od = 0.01*oic tcv = od + f*(tcv-od) endif elseif @cval==2 tcv = cabs(cz) if @method<8 && @convsmooth od = cabs(ocz) tcv = od + f*(tcv-od) endif elseif @cval==3 tcv = abs(real(cz)) if @method<8 && @convsmooth od = abs(real(ocz)) tcv = od + f*(tcv-od) endif elseif @cval==4 tcv = abs(imag(cz)) if @method<8 && @convsmooth od = abs(imag(ocz)) tcv = od + f*(tcv-od) endif endif if @convrecip tcv = 1/(tcv+1e-100) endif if @convfunc==1 tcv = log(1+tcv) elseif @convfunc==2 tcv = sqrt(tcv) elseif @convfunc==3 tcv = exp(tcv) elseif @convfunc==4 tcv = tcv*tcv elseif @convfunc==5 tcv = tcv^@convpower elseif @convfunc==6 tcv = sin(tcv) elseif @convfunc==7 tcv = cos(tcv) elseif @convfunc==8 tcv = tan(tcv) elseif @convfunc==9 tcv = sinh(tcv) elseif @convfunc==10 tcv = cosh(tcv) elseif @convfunc==11 tcv = tanh(tcv) endif d = d + @convscale*tcv endif if gotid || gotidf gotd = true if @idmode==0 if @method<8 && @idivsmooth if iid>1 od = otidv else od = tidv endif tidv = od + f*(tidv-od) endif elseif @idmode==1 tidv = tidv/iid if @method<8 && @idivsmooth && iid>1 od = otidv/oiid tidv = od + f*(tidv-od) endif elseif @idmode==2 tidv = 0.01*iid if @method<8 && @idivsmooth && iid>1 od = 0.01*oiid tidv = od + f*(tidv-od) endif elseif @idval==0 tidv = midv if @method<8 && @idivsmooth tidv = omidv + f*(tidv-omidv) endif elseif @idval==1 tidv = 0.01*iid if @method<8 && @idivsmooth od = 0.01*oiid tidv = od + f*(tidv-od) endif elseif @idval==2 tidv = cabs(idz) if @method<8 && @idivsmooth od = cabs(oidz) tidv = od + f*(tidv-od) endif elseif @idval==3 tidv = abs(real(idz)) if @method<8 && @idivsmooth od = abs(real(oidz)) tidv = od + f*(tidv-od) endif elseif @idval==4 tidv = abs(imag(idz)) if @method<8 && @idivsmooth od = abs(imag(oidz)) tidv = od + f*(tidv-od) endif endif if @idivrecip tidv = 1/(tidv+1e-100) endif if @idivfunc==1 tidv = log(1+tidv) elseif @idivfunc==2 tidv = sqrt(tidv) elseif @idivfunc==3 tidv = exp(tidv) elseif @idivfunc==4 tidv = tidv*tidv elseif @idivfunc==5 tidv = tidv^@idivpower elseif @idivfunc==6 tidv = sin(tidv) elseif @idivfunc==7 tidv = cos(tidv) elseif @idivfunc==8 tidv = tan(tidv) elseif @idivfunc==9 tidv = sinh(tidv) elseif @idivfunc==10 tidv = cosh(tidv) elseif @idivfunc==11 tidv = tanh(tidv) endif d = d + @idivscale*tidv endif if gotic || goticf gotd = true if @icmode==0 if @method<8 && @iconvsmooth if iic>1 od = oticv else od = ticv endif ticv = od + f*(ticv-od) endif elseif @icmode==1 ticv = ticv/iic if @method<8 && @iconvsmooth && iic>1 od = oticv/oiic ticv = od + f*(ticv-od) endif elseif @icmode==2 ticv = 0.01*iic if @method<8 && @iconvsmooth && iic>1 od = 0.01*oiic ticv = od + f*(ticv-od) endif elseif @icval==0 ticv = micv if @method<8 && @iconvsmooth ticv = omicv + f*(ticv-omicv) endif elseif @icval==1 ticv = 0.01*iic if @method<8 && @iconvsmooth od = 0.01*oiic ticv = od + f*(ticv-od) endif elseif @icval==2 ticv = cabs(icz) if @method<8 && @iconvsmooth od = cabs(oicz) ticv = od + f*(ticv-od) endif elseif @icval==3 ticv = abs(real(icz)) if @method<8 && @iconvsmooth od = abs(real(oicz)) ticv = od + f*(ticv-od) endif elseif @icval==4 ticv = abs(imag(icz)) if @method<8 && @iconvsmooth od = abs(imag(oicz)) ticv = od + f*(ticv-od) endif endif if @iconvrecip ticv = 1/(ticv+1e-100) endif if @iconvfunc==1 ticv = log(1+ticv) elseif @iconvfunc==2 ticv = sqrt(ticv) elseif @iconvfunc==3 ticv = exp(ticv) elseif @iconvfunc==4 ticv = ticv*ticv elseif @iconvfunc==5 ticv = ticv^@iconvpower elseif @iconvfunc==6 ticv = sin(ticv) elseif @iconvfunc==7 ticv = cos(ticv) elseif @iconvfunc==8 ticv = tan(ticv) elseif @iconvfunc==9 ticv = sinh(ticv) elseif @iconvfunc==10 ticv = cosh(ticv) elseif @iconvfunc==11 ticv = tanh(ticv) endif d = d + @iconvscale*ticv endif if gotin || gotinf gotd = true if @incmode==0 if @method<8 && @incsmooth if iin>1 od = otinv else od = tinv endif tinv = od + f*(tinv-od) endif elseif @incmode==1 tinv = tinv/iin if @method<8 && @incsmooth && iin>1 od = otinv/oiin tinv = od + f*(tinv-od) endif elseif @incmode==2 tinv = 0.01*iin if @method<8 && @incsmooth && iin>1 od = 0.01*oiin tdv = od + f*(tinv-od) endif elseif @incval==0 tinv = minv if @method<8 && @incsmooth tinv = ominv + f*(tinv-ominv) endif elseif @incval==1 tinv = 0.01*iin if @method<8 && @incsmooth od = 0.01*oiin tinv = od + f*(tinv-od) endif elseif @incval==2 tinv = cabs(inz) if @method<8 && @incsmooth od = cabs(oinz) tinv = od + f*(tinv-od) endif elseif @incval==3 tinv = abs(real(inz)) if @method<8 && @incsmooth od = abs(real(oinz)) tinv = od + f*(tinv-od) endif elseif @incval==4 tinv = abs(imag(inz)) if @method<8 && @incsmooth od = abs(imag(oinz)) tinv = od + f*(tinv-od) endif endif if @increcip tinv = 1/(tinv+1e-100) endif if @incfunc==1 tinv = log(1+tinv) elseif @incfunc==2 tinv = sqrt(tinv) elseif @incfunc==3 tinv = exp(tinv) elseif @incfunc==4 tinv = tinv*tinv elseif @incfunc==5 tinv = tinv^@incpower elseif @incfunc==6 tinv = sin(tinv) elseif @incfunc==7 tinv = cos(tinv) elseif @incfunc==8 tinv = tan(tinv) elseif @incfunc==9 tinv = sinh(tinv) elseif @incfunc==10 tinv = cosh(tinv) elseif @incfunc==11 tinv = tanh(tinv) endif d = d + @incscale*tinv endif if gotde || gotdef gotd = true if @decmode==0 if @method<8 && @decsmooth if ide>1 od = otdev else od = tdev endif tdev = od + f*(tdev-od) endif elseif @decmode==1 tdev = tdev/ide if @method<8 && @decsmooth && ide>1 od = otdev/oide tdev = od + f*(tdev-od) endif elseif @decmode==2 tdev = 0.01*ide if @method<8 && @decsmooth && ide>1 od = 0.01*oide tdev = od + f*(tdev-od) endif elseif @decval==0 tdev = mdev if @method<8 && @decsmooth tdev = omdev + f*(tdev-omdev) endif elseif @decval==1 tdev = 0.01*ide if @method<8 && @decsmooth od = 0.01*oide tdev = od + f*(tdev-od) endif elseif @decval==2 tdev = cabs(dez) if @method<8 && @decsmooth od = cabs(odez) tdev = od + f*(tdev-od) endif elseif @decval==3 tdev = abs(real(dez)) if @method<8 && @decsmooth od = abs(real(odez)) tdev = od + f*(tdev-od) endif elseif @decval==4 tdev = abs(imag(dez)) if @method<8 && @decsmooth od = abs(imag(odez)) tdev = od + f*(tdev-od) endif endif if @decrecip tdev = 1/(tdev+1e-100) endif if @decfunc==1 tdev = log(1+tdev) elseif @decfunc==2 tdev = sqrt(tdev) elseif @decfunc==3 tdev = exp(tdev) elseif @decfunc==4 tdev = tdev*tdev elseif @decfunc==5 tdev = tdev^@decpower elseif @decfunc==6 tdev = sin(tdev) elseif @decfunc==7 tdev = cos(tdev) elseif @decfunc==8 tdev = tan(tdev) elseif @decfunc==9 tdev = sinh(tdev) elseif @decfunc==10 tdev = cosh(tdev) elseif @decfunc==11 tdev = tanh(tdev) endif d = d + @decscale*tdev endif if !gotd if all if @fill1==1 d = o + fc1 endif elseif @fill1==0 #solid = true else #index = o + fc1 endif endif if all || gotd if @method<11 && ivuse>0 dv = #numiter + 1 if @method<8 dv = dv + f endif if li==1 dv = log(1+dv) elseif li==2 dv = log(1+log(1+dv)) endif d = ivuse*dv + iwuse*d endif if usebasins && @zbasin>0 if isstandard zolder = zold zold = #z endif if @zbasin==1 dv = abs(real(2.0*#pi+atan2(zold))) od = abs(real(2.0*#pi+atan2(zolder))) elseif @zbasin==2 dv = abs(real(zold)) od = abs(real(zolder)) elseif @zbasin==3 dv = abs(imag(zold)) od = abs(imag(zolder)) elseif @zbasin==4 dv = abs(real(zold)+imag(zold)) od = abs(real(zolder)+imag(zolder)) elseif @zbasin==5 dv = abs(2*real(zold)+imag(zold)) od = abs(2*real(zolder)+imag(zolder)) elseif @zbasin==6 dv = abs(real(zold)+2*imag(zold)) od = abs(real(zolder)+2*imag(zolder)) elseif @zbasin==7 dv = abs(real(zold)/(abs(imag(zold))+1)) od = abs(real(zolder)/(abs(imag(zolder))+1)) elseif @zbasin==8 dv = abs(imag(zold)/(abs(real(zold))+1)) od = abs(imag(zolder)/(abs(real(zolder))+1)) elseif @zbasin==9 dv = abs(2*real(sqrt(zold))+imag(sqrt(zold))) od = abs(2*real(sqrt(zolder))+imag(sqrt(zolder))) elseif @zbasin==10 dv = abs(real(sqrt(zold))+2*imag(sqrt(zold))) od = abs(real(sqrt(zolder))+2*imag(sqrt(zolder))) endif if @method<8 d = d + @zscale*(od+(dv-od)*f) else d = d + @zscale*dv endif endif #index = d + o endif endif default: title = "MMF3 'vergence" heading caption = "Main control" endheading param type caption = "'vergence method" enum = "Divergent" "Convergent" default = 1 hint = "Allows you to choose whether 'vergence is checked for using \ |z| and |zold| (normal divergent) or |z-zold| and |zold-zolder| \ (normal convergent). Note that both methods can be used to check \ for convergence or divergence." endparam param method caption = "Smoothing" default = 0 enum = "Standard Div." "Standard Conv." "Standard both" \ "Hinrich's Div." "Hinrich's Conv." "Hinrich's both" \ "St.Div. H.Conv." "H.Div St.Conv." "No smooth div." \ "No smooth conv." "No smooth both" "Inside (None)" hint = "Specifies the type of smoothing to use and whether to \ colour divergent or convergent areas or both. \ Standard uses standard iteration smoothing and hence \ requires appropriate bailout (and power and fudge) values. \ Hinrich's uses what I've previously called 'finalz' \ smoothing where the final value of z from the main formula \ passes a smoothing fraction as real(z)." endparam heading caption = "Settings for divergence" endheading param calcdiv caption = "Use Divergence" default = true hint = "When enabled some or all the colour will come from when \ divergence was found using the current method. Divergence \ being when |zold| (or |zold-zolder|) is >1 and |z| (or \ |z-zold|) is greater still." endparam param divverg caption = "Adjustment (div)" default = 0.0 min = 0.0 hint = "Adjusts the raw 'vergence found by this value. It's worth trying it \ set to the expected 'vergence of the main fractal formula. \ Note that it's really designed for when using trapping or 'Minimum' \ and 'Maximum' modes, though it will affect the colouring anyway." visible = @calcdiv endparam param divtrap caption = "Trapping (div)" enum = "Off" "Below" "Above" "Between" "Outside" default = 0 hint = "Standard trapping, works on the modified 'vergence value (the one \ actually used for colouring)." visible = @calcdiv endparam param divmin caption = "Trap low (div)" default = 0.5 min = 0.0 hint = "A bound for the trapping." visible = @calcdiv && (@divtrap>2 || @divtrap==1) endparam param divmax caption = "Trap high (div)" default = 1.0 min = 0.0 hint = "Second bound for trapping, should be larger than 'Trap low' \ when trapping 'Between' or 'Outside'." visible = @calcdiv && @divtrap>1 endparam param dmode caption = "Divergence mode" enum = "Total" "Average" "Count" "Minimum" "Maximum" "First" "Last" default = 3 hint = "How to use the degree of divergence." visible = @calcdiv endparam param dval caption = "Colour by (div.)" enum = "Value" "Iteration" "cabs(z)" "real(z)" "imag(z)" default = 0 hint = "When using the 'Minimum' or 'Maximum' modes you can choose \ to colour by the min/max value or the iteration or z value \ when the min/max occurred." visible = @calcdiv && @dmode>2 endparam param divscale caption = "Scale divergence" default = 1.0 hint = "Allows you to scale the value produced from divergence." visible = @calcdiv endparam param divfunc caption = "Transfer func.(div)" enum = "linear" "log" "sqrt" "exp" "sqr" "^power" \ "sin" "cos" "tan" "sinh" "cosh" "tanh" default = 2 hint = "Applied to the value before scaling." visible = @calcdiv endparam param divpower caption = "Trans. power (div)" default = 0.3333333333333 visible = @calcdiv && @divfunc==5 endparam param divrecip caption = "Reciprocate" default = false hint = "Applied to the value before the transfer function." visible = @calcdiv endparam param divsmooth caption = "Smoothing (div)" default = false hint = "May be needed for 'Total' or 'Average' modes." visible = @calcdiv && @method<8 endparam param combdic caption = "+ Inverse convergence" default = true hint = "When enabled inverse convergence is considered as divergence." visible = @calcdiv endparam param combdinc caption = "+ Increases" default = true hint = "When enabled 'increases' are considered as divergence." visible = @calcdiv endparam param divinv caption = "Invert divergence" default = false hint = "When enabled the divergence calculated will be inverted." visible = @calcdiv endparam heading caption = "Settings for inverse convergence" endheading param calciconv caption = "Use inv. conv." default = false hint = "When enabled some or all the colour will come from when \ inverse convergence was found using the current method. \ Inverse convergence being when |z| (or |z-zold|) \ is <1 and |zold| (or |zold-zolder|) is even less." visible = !(@calcdiv && @combdic) endparam param iconvverg caption = "Adjustment (iconv)" default = 0.0 min = 0.0 hint = "Adjusts the raw 'vergence found by this value. It's worth trying it \ set to the expected 'vergence of the main fractal formula. \ Note that it's really designed for when using trapping or 'Minimum' \ and 'Maximum' modes, though it will affect the colouring anyway." visible = @calciconv || (@calcdiv && @combdic) endparam param iconvtrap caption = "Trapping (iconv)" enum = "Off" "Below" "Above" "Between" "Outside" default = 0 hint = "Standard trapping, works on the modified 'vergence value (the one \ actually used for colouring)." visible = @calciconv && !(@calcdiv && @combdic) endparam param iconvmin caption = "Trap low (iconv)" default = 0.5 min = 0.0 hint = "A bound for the trapping." visible = @calciconv && !(@calcdiv && @combdic) && (@iconvtrap>2 || @iconvtrap==1) endparam param iconvmax caption = "Trap high (iconv)" default = 1.0 min = 0.0 hint = "Second bound for trapping, should be larger than 'Trap low' \ when trapping 'Between' or 'Outside'." visible = @calciconv && !(@calcdiv && @combdic) && @iconvtrap>1 endparam param icmode caption = "Inv. conv. mode" enum = "Total" "Average" "Count" "Minimum" "Maximum" "First" "Last" default = 3 hint = "How to use the degree of inverse convergence." visible = @calciconv && !(@calcdiv && @combdic) endparam param icval caption = "Colour by (inv.conv.)" enum = "Value" "Iteration" "cabs(z)" "real(z)" "imag(z)" default = 0 hint = "When using the 'Minimum' or 'Maximum' modes you can choose \ to colour by the min/max value or the iteration or z value \ when the min/max occurred." visible = @calciconv && !(@calcdiv && @combdic) && @icmode>2 endparam param iconvscale caption = "Scale inv.conv." default = 1.0 hint = "Allows you to scale the value produced from inverse convergence." visible = @calciconv && !(@calcdiv && @combdic) endparam param iconvfunc caption = "Transfer func.(iconv)" enum = "linear" "log" "sqrt" "exp" "sqr" "^power" \ "sin" "cos" "tan" "sinh" "cosh" "tanh" default = 2 hint = "Applied to the value before scaling." visible = @calciconv && !(@calcdiv && @combdic) endparam param iconvpower caption = "Trans. power (iconv)" default = 0.3333333333333 visible = @calciconv && !(@calcdiv && @combdic) && @iconvfunc==5 endparam param iconvrecip caption = "Reciprocate" default = false hint = "Applied to the value before the transfer function." visible = @calciconv && !(@calcdiv && @combdic) endparam param iconvsmooth caption = "Smoothing (inv.conv)" default = false hint = "May be needed for 'Total' or 'Average' modes." visible = @calciconv && !(@calcdiv && @combdic) && @method<8 endparam param combicinc caption = "+ Increases" default = false hint = "When enabled 'increases' are considered as inverse convergence." visible = @calciconv && !(@calcdiv && @combdic) endparam param iconvinv caption = "Invert inv.conv." default = false hint = "When enabled the inverse convergence calculated will be inverted." visible = @calciconv || (@calcdiv && @combdic) endparam heading caption = "Settings for 'increases'" endheading param calcinc caption = "Use 'increases'" default = false hint = "When enabled some or all the colour will come from when \ increases were found using the current method. 'Increases' \ being when |zold| (or |zold-zolder|) is <1 and |z| (or \ |z-zold|) is >1." visible = !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) endparam param incverg caption = "Adjustment (inc)" default = 0.0 min = 0.0 hint = "Adjusts the raw 'vergence found by this value. It's worth trying it \ set to the expected 'vergence of the main fractal formula. \ Note that it's really designed for when using trapping or 'Minimum' \ and 'Maximum' modes, though it will affect the colouring anyway." visible = @calcinc || (@calcdiv && @combdinc) || (@calciconv && @combicinc) endparam param inctrap caption = "Trapping (inc)" enum = "Off" "Below" "Above" "Between" "Outside" default = 0 hint = "Standard trapping, works on the modified 'vergence value (the one \ actually used for colouring)." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) endparam param incmin caption = "Trap low (inc)" default = 0.5 min = 0.0 hint = "A bound for the trapping." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) \ && (@inctrap>2 || @inctrap==1) endparam param incmax caption = "Trap high (inc)" default = 1.0 min = 0.0 hint = "Second bound for trapping, should be larger than 'Trap low' \ when trapping 'Between' or 'Outside'." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) \ && @inctrap>1 endparam param incmode caption = "Increases mode" enum = "Total" "Average" "Count" "Minimum" "Maximum" "First" "Last" default = 3 hint = "How to use the degree of increase." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) endparam param incval caption = "Colour by (inc.)" enum = "Value" "Iteration" "cabs(z)" "real(z)" "imag(z)" default = 0 hint = "When using the 'Minimum' or 'Maximum' modes you can choose \ to colour by the min/max value or the iteration or z value \ when the min/max occurred." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) && @incmode>2 endparam param incscale caption = "Scale 'increases'" default = 1.0 hint = "Allows you to scale the value produced from 'increases'." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) endparam param incfunc caption = "Transfer func.(inc)" enum = "linear" "log" "sqrt" "exp" "sqr" "^power" \ "sin" "cos" "tan" "sinh" "cosh" "tanh" default = 2 hint = "Applied to the value before scaling." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) endparam param incpower caption = "Trans. power (inc)" default = 0.3333333333333 visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) && @incfunc==5 endparam param increcip caption = "Reciprocate" default = false hint = "Applied to the value before the transfer function." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) endparam param incsmooth caption = "Smoothing (inc)" default = false hint = "May be needed for 'Total' or 'Average' modes." visible = @calcinc && !(@calcdiv && @combdinc) && !(@calciconv && @combicinc) && @method<8 endparam param incinv caption = "Invert increases" default = false hint = "When enabled the 'increases' calculated will be inverted." visible = @calcinc || (@calcdiv && @combdinc) || (@calciconv && @combicinc) endparam heading caption = "Settings for convergence" endheading param calcconv caption = "Use Convergence" default = false hint = "When enabled some or all the colour will come from when \ convergence was found using the current method. Convergence \ being when |zold| (or |zold-zolder|) is <1 and |z| (or \ |z-zold|) is even less." endparam param convverg caption = "Adjustment (conv)" default = 0.0 min = 0.0 hint = "Adjusts the raw 'vergence found by this value. It's worth trying it \ set to the expected 'vergence of the main fractal formula. \ Note that it's really designed for when using trapping or 'Minimum' \ and 'Maximum' modes, though it will affect the colouring anyway." visible = @calcconv endparam param convtrap caption = "Trapping (conv)" enum = "Off" "Below" "Above" "Between" "Outside" default = 0 hint = "Standard trapping, works on the modified 'vergence value (the one \ actually used for colouring)." visible = @calcconv endparam param convmin caption = "Trap low (conv)" default = 0.5 min = 0.0 hint = "A bound for the trapping." visible = @calcconv && (@convtrap>2 || @convtrap==1) endparam param convmax caption = "Trap high (conv)" default = 1.0 min = 0.0 hint = "Second bound for trapping, should be larger than 'Trap low' \ when trapping 'Between' or 'Outside'." visible = @calcconv && @convtrap>1 endparam param cmode caption = "Convergence mode" enum = "Total" "Average" "Count" "Minimum" "Maximum" "First" "Last" default = 3 hint = "How to use the degree of convergence." visible = @calcconv endparam param cval caption = "Colour by (conv.)" enum = "Value" "Iteration" "cabs(z)" "real(z)" "imag(z)" default = 0 hint = "When using the 'Minimum' or 'Maximum' modes you can choose \ to colour by the min/max value or the iteration or z value \ when the min/max occurred." visible = @calcconv && @cmode>2 endparam param convscale caption = "Scale convergence" default = 1.0 hint = "Allows you to scale the value produced from convergence." visible = @calcconv endparam param convfunc caption = "Transfer func.(conv)" enum = "linear" "log" "sqrt" "exp" "sqr" "^power" \ "sin" "cos" "tan" "sinh" "cosh" "tanh" default = 2 hint = "Applied to the value before scaling." visible = @calcconv endparam param convpower caption = "Trans. power (conv)" default = 0.3333333333333 visible = @calcconv && @convfunc==5 endparam param convrecip caption = "Reciprocate" default = false hint = "Applied to the value before the transfer function." visible = @calcconv endparam param convsmooth caption = "Smoothing (conv)" default = false hint = "May be needed for 'Total' or 'Average' modes." visible = @calcconv && @method<8 endparam param combcid caption = "+ Inverse divergence" default = true hint = "When enabled inverse divergence is considered as convergence." visible = @calcconv endparam param combcdec caption = "+ Decreases" default = true hint = "When enabled 'decreases' are considered as convergence." visible = @calcconv endparam param convinv caption = "Invert convergence" default = false hint = "When enabled the convergence calculated will be inverted." visible = @calcconv endparam heading caption = "Settings for inverse divergence" endheading param calcidiv caption = "Use inv. div." default = false hint = "When enabled some or all the colour will come from when \ inverse divergence was found using the current method. \ Inverse divergence being when |z| (or |z-zold|) is >1 \ and |zold| (or |zold-zolder|) is greater still." visible = !(@calcconv && @combcid) endparam param idivverg caption = "Adjustment (idiv)" default = 0.0 min = 0.0 hint = "Adjusts the raw 'vergence found by this value. It's worth trying it \ set to the expected 'vergence of the main fractal formula. \ Note that it's really designed for when using trapping or 'Minimum' \ and 'Maximum' modes, though it will affect the colouring anyway." visible = @calcidiv || (@calcconv && @combcid) endparam param idivtrap caption = "Trapping (idiv)" enum = "Off" "Below" "Above" "Between" "Outside" default = 0 hint = "Standard trapping, works on the modified 'vergence value (the one \ actually used for colouring)." visible = @calcidiv && !(@calcconv && @combcid) endparam param idivmin caption = "Trap low (idiv)" default = 0.5 min = 0.0 hint = "A bound for the trapping." visible = @calcidiv && !(@calcconv && @combcid) && (@idivtrap>2 || @idivtrap==1) endparam param idivmax caption = "Trap high (idiv)" default = 1.0 min = 0.0 hint = "Second bound for trapping, should be larger than 'Trap low' \ when trapping 'Between' or 'Outside'." visible = @calcidiv && !(@calcconv && @combcid) && @idivtrap>1 endparam param idmode caption = "Inv. div. mode" enum = "Total" "Average" "Count" "Minimum" "Maximum" "First" "Last" default = 3 hint = "How to use the degree of inverse divergence." visible = @calcidiv && !(@calcconv && @combcid) endparam param idval caption = "Colour by (inv.div.)" enum = "Value" "Iteration" "cabs(z)" "real(z)" "imag(z)" default = 0 hint = "When using the 'Minimum' or 'Maximum' modes you can choose \ to colour by the min/max value or the iteration or z value \ when the min/max occurred." visible = @calcidiv && !(@calcconv && @combcid) && @idmode>2 endparam param idivscale caption = "Scale inv.div." default = 1.0 hint = "Allows you to scale the value produced from inverse divergence." visible = @calcidiv && !(@calcconv && @combcid) endparam param idivfunc caption = "Transfer func.(idiv)" enum = "linear" "log" "sqrt" "exp" "sqr" "^power" \ "sin" "cos" "tan" "sinh" "cosh" "tanh" default = 2 hint = "Applied to the value before scaling." visible = @calcidiv && !(@calcconv && @combcid) endparam param idivpower caption = "Trans. power (idiv)" default = 0.3333333333333 visible = @calcidiv && !(@calcconv && @combcid) && @idivfunc==5 endparam param idivrecip caption = "Reciprocate" default = false hint = "Applied to the value before the transfer function." visible = @calcidiv && !(@calcconv && @combcid) endparam param idivsmooth caption = "Smoothing (inv.div)" default = false hint = "May be needed for 'Total' or 'Average' modes." visible = @calcidiv && !(@calcconv && @combcid) && @method<8 endparam param combiddec caption = "+ Decreases" default = false hint = "When enabled 'decreases' are considered as inverse divergence." visible = @calcidiv && !(@calcconv && @combcid) endparam param idivinv caption = "Invert inv.div." default = false hint = "When enabled the inverse divergence calculated will be inverted." visible = @calcidiv || (@calcconv && @combcid) endparam heading caption = "Settings for 'decreases'" endheading param calcdec caption = "Use 'decreases'" default = false hint = "When enabled some or all the colour will come from when \ decreases were found using the current method. 'Decreases' \ being when |zold| (or |zold-zolder|) is >1 and |z| (or \ |z-zold|) is <1." visible = !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) endparam param decverg caption = "Adjustment (dec)" default = 0.0 min = 0.0 hint = "Adjusts the raw 'vergence found by this value. It's worth trying it \ set to the expected 'vergence of the main fractal formula. \ Note that it's really designed for when using trapping or 'Minimum' \ and 'Maximum' modes, though it will affect the colouring anyway." visible = @calcdec || (@calcconv && @combcdec) || (@calcidiv && @combiddec) endparam param dectrap caption = "Trapping (dec)" enum = "Off" "Below" "Above" "Between" "Outside" default = 0 hint = "Standard trapping, works on the modified 'vergence value (the one \ actually used for colouring)." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) endparam param decmin caption = "Trap low (dec)" default = 0.5 min = 0.0 hint = "A bound for the trapping." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) \ && (@dectrap>2 || @dectrap==0) endparam param decmax caption = "Trap high (dec)" default = 1.0 min = 0.0 hint = "Second bound for trapping, should be larger than 'Trap low' \ when trapping 'Between' or 'Outside'." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) \ && @dectrap>1 endparam param decmode caption = "Decreases mode" enum = "Total" "Average" "Count" "Minimum" "Maximum" "First" "Last" default = 3 hint = "How to use the degree of decrease." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) endparam param decval caption = "Colour by (dec.)" enum = "Value" "Iteration" "cabs(z)" "real(z)" "imag(z)" default = 0 hint = "When using the 'Minimum' or 'Maximum' modes you can choose \ to colour by the min/max value or the iteration or z value \ when the min/max occurred." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) && @decmode>2 endparam param decscale caption = "Scale 'decreases'" default = 1.0 hint = "Allows you to scale the value produced from 'decreases'." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) endparam param decfunc caption = "Transfer func.(dec)" enum = "linear" "log" "sqrt" "exp" "sqr" "^power" \ "sin" "cos" "tan" "sinh" "cosh" "tanh" default = 2 hint = "Applied to the value before scaling." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) endparam param decpower caption = "Trans. power (dec)" default = 0.3333333333333 visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) && @decfunc==5 endparam param decrecip caption = "Reciprocate" default = false hint = "Applied to the value before the transfer function." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) endparam param decsmooth caption = "Smoothing (dec)" default = false hint = "May be needed for 'Total' or 'Average' modes." visible = @calcdec && !(@calcconv && @combcdec) && !(@calcidiv && @combiddec) && @method<8 endparam param decinv caption = "Invert decreases" default = false hint = "When enabled the 'decreases' calculated will be inverted." visible = @calcdec || (@calcconv && @combcdec) || (@calcidiv && @combiddec) endparam heading caption = "Infill" endheading param fill caption = "No colour fill" enum = "Solid" "Fill colour index" default = 0 hint = "Allows you to choose how to fill areas not to be coloured by the formula." endparam param fillcolour caption = "No col. index" default = 0.0 hint = "When the Color Density is set to 1 and Transfer Function is linear \ the area will be filled with the gradient colour of this index." visible = @fill==1 endparam param fill1 caption = "No 'vergence fill" enum = "Solid" "Fill colour index" default = 0 hint = "Allows you to choose how to fill areas without 'vergence." endparam param fillcolour1 caption = "No 'verge index" default = 0.0 hint = "When the Color Density is set to 1 and Transfer Function is linear \ the area will be filled with the gradient colour of this index." visible = @fill1==1 endparam heading caption = "Divergent smoothing" visible = @method<8 endheading param bailout caption = "Bailout" default = 16.0 hint = "This should match the bailout in the fractal formula. \ When NOT using standard divergent smoothing \ you should ensure this is a suitable value (eg. >=10)." visible = @method<8 endparam param dauto caption = "Auto-power" default = true hint = "When enabled should produce smoothing for any divergent \ areas without you needing to set a divergent power value \ for the colouring." visible = @method==0 || @method==2 || @method==6 endparam param power caption = "Power/exponent/degree" default = (2,0) hint = "This should match the power/degree/exponent in the \ fractal formula. If the value to use isn't immediately \ obvious from the main formula itself then it's best to \ choose the 'Just iteration' mode and modify this value \ (and maybe the Scaling fudge) until you get completely \ smooth colouring, or just enable auto-power." visible = (@method==0 || @method==2 || @method==6) && !@dauto endparam param usedfudge caption = "Use scaling fudge" default = false hint = "Normally the scaling fudge is ignored when using 'Auto-power' \ but it's possible you may want to use it." visible = (@method==0 || @method==2 || @method==6) && @dauto endparam param fudge caption = "Scaling fudge" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1, it's unlikely to be required for \ divergent smoothing but I added it just in case. If \ 'Auto-power' or the best value you can find for \ the power parameter don't produce smooth results then \ modifying this value may help." visible = (@method==0 || @method==2 || @method==6) && (!@dauto || @usedfudge) endparam param fudge1 caption = "Scaling fudge 1" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1, it's unlikely to be required for \ divergent smoothing but I added it just in case." visible = @method==3 || @method==5 || @method==7 endparam heading caption = "Divergent colouring" visible = @method==0 || @method==2 || @method==3 \ || (@method>4 && @method!=9 && @method!=11) endheading param iterval caption = "+Iter amount" default = 0.0 min = 0.0 hint = "Adds some iteration count to the colour value, \ thus producing colour change over the iterations. \ The larger the value the faster the colour change \ per iteration." visible = @method==0 || @method==2 || @method==3 \ || (@method>4 && @method!=9 && @method!=11) endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @iterval>0 && (@method==0 || @method==2 || @method==3 \ || (@method>4 && @method!=9 && @method!=11)) endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @iterval>0 && @iterweight!=0 \ && (@method==0 || @method==2 || @method==3 \ || (@method>4 && @method!=9 && @method!=11)) endparam heading caption = "Convergent smoothing" visible = @method<11 endheading param smallbail caption = "Bailout" default = 1e-5 hint = "This should match the small bailout in your fractal formula. \ When NOT using standard convergent smoothing or not using smoothing \ at all you should ensure this is a suitable value (eg. <=1e-5)." visible = @method<11 endparam param cauto caption = "Auto-power" default = true hint = "When enabled should produce smoothing for any convergent \ areas without you needing to set a convergent power value \ for the colouring." visible = @method==1 || @method==2 || @method==7 endparam param cpower caption = "Power/exponent/degree" default = (2,0) hint = "This should match the power (exponent/degree) for the \ convergent areas of your main fractal formula. If the \ value to use isn't immediately obvious from the main \ formula itself then it's best to choose the 'Just \ iteration' mode and modify this value (and maybe the \ Scaling fudge) until you get completely smooth colouring, \ or just try auto-power." visible = (@method==1 || @method==2 || @method==7) && !@cauto endparam param usecfudge caption = "Use scaling fudge" default = false hint = "Normally the scaling fudge is ignored when using 'Auto-power' \ but it's possible you may want to use it." visible = (@method==1 || @method==2 || @method==7) && @cauto endparam param fudgec caption = "Scaling Fudge" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power' or the best value you can \ find for the 'Convergent Power' parameter don't \ produce smooth results then modifying this value \ should help." visible = (@method==1 || @method==2 || @method==7) && (!@cauto || @usecfudge) endparam param fudge1c caption = "Scaling Fudge 1" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1." visible = @method==4 || @method==5 || @method==6 endparam param cfixed caption = "Absolute convergence" default = false hint = "For when using a main formula that tests for convergence by \ using (only) |#z-value| rather than |#z-zold|, a typical example \ would be a Magnet formula where |#z-1.0| is often used. When \ enabled set the value of 'Convergence root' appropriately." visible = @method==1 || @method==2 || (@method>=7 && @method!=8) endparam param cfixedval caption = "Convergence root" default = (1,0) hint = "Use (1.0,0) for some Magnet formulas." visible = (@method==1 || @method==2 || (@method>=7 && @method!=8)) && @cfixed endparam heading caption = "Convergent colouring" visible = @method==1 || @method==2 || (@method>3 && @method!=8) endheading param convoff caption = "Convergent offset" default = 0.0 hint = "Allows you to offset the colour used in convergent areas. Added \ for when the fractal has both convergent and divergent areas. \ The offset value matches the number of gradient points when the \ main Color Density is 1 and Transfer Function is Linear." visible = @method==1 || @method==2 || (@method>3 && @method!=8 && @method!=11) endparam param citerval caption = "+Iter amount" default = 0.0 min = 0.0 hint = "Adds some iteration count to the colour value, \ thus producing colour change over the iterations. \ The larger the value the faster the colour change \ per iteration." visible = @method==1 || @method==2 || (@method>3 && @method!=8 && @method!=11) endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @citerval>0 \ && (@method==1 || @method==2 || (@method>3 && @method!=8 && @method!=11)) endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @citerval>0 && @iterweightc!=0 \ && (@method==1 || @method==2 || (@method>3 && @method!=8 && @method!=11)) endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "Roots 1" "Roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ penultimate value of z." visible = (@method==1 || @method==2 || (@method>3 && @method!=8)) endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = (@method==1 || @method==2 || (@method>3 && @method!=8)) && @zbasin>0 endparam heading caption = "Extra !!" visible = (@iterval!=0 && (@method==0 || @method==2 || @method==3 || (@method>4 && @method!=9))) \ || ((@zbasin>0 || @citerval!=0) && (@method==1 || @method==2 || (@method>3 && @method!=8))) endheading param always caption = "Always Iter/zbasin" default = false hint = "Normally if no 'vergence is found the iteration count and zbasins \ are ignored, this option allows areas without a 'vergence to still \ be coloured using the iteration and/or zbasin. Note that when fill \ is set to fill colour that fill colour will be used as the base \ colour for the relevant area/s." visible = (@iterval!=0 && (@method==0 || @method==2 || @method==3 || (@method>4 && @method!=9))) \ || ((@zbasin>0 || @citerval!=0) && (@method==1 || @method==2 || (@method>3 && @method!=8))) endparam } MMF3f-ExtCilia(OUTSIDE) { ; ; This is an extension of Damien's Cilia colouring. ; It can use the "finalz" smoothing where a smoothing ; fraction is passed from the main formula based on ; a method suggested by Earl Hinrichs and it has a new ; extension to standard logarithmic smoothing in which ; the power/degree/exponent required for smoothing is ; calculated automagically by the formula - this works ; extremely well as long as the bailout/s are correct. ; It's also extended to allow Cilia for convergent areas ; and has new double-smoothed options that produce ; smooth results for those formulas with a smoothing ; power other than 2 (this is a cheat, there is a 'proper' ; way to do it but that only really works for whole ; integer powers which you can now do using the "split" ; options with 'Interpolated', 'Sine Waves', 'Cells' or 'Bricks'). ; This version includes options to "fix" the rotation and skew. ; NB. When using Hinrich's smoothing since the real part ; of the final z value is the smoothing fraction the ; formula doesn't know the actual final z value for ; the cilia hence only using older iterations will ; work unless you choose a main fractal formula using ; "+Atan" Hinrich's smoothing in which case 'No' for ; 'Old iterations' will work. ; ; Released November '04 ; global: float il = real(1/log(@power)) ; for divergent smoothing float lp = log(0.5*log(@bailout)) if !@dauto lp = il*lp endif float cil = real(1/log(@cpower)) ; for convergent smoothing float clp = log(-0.5*log(@smallbail)) if !@cauto clp = cil*clp endif float iv = 0.0001*@iterval*@iterweight float ivc = 0.0001*@citerval*@iterweightc float iw = 1.0 - 0.01*@iterweight float iwc = 1.0 - 0.01*@iterweightc float co = 0.0025*@convoffset float rval[#maxiter+1] float crval[#maxiter+1] float rv = @rot*@split^-@rpwr float crv = @crot*@csplit^-@crpwr int gi = 0 if @ciliamode!=6 && @ciliamode!=7 if @fixrot repeat rv = @split*rv rval[gi] = rv = rv - floor(rv) until (gi=gi+1)>#maxiter if @fixskew && @skew!=0.0 rv = 0.0 gi = 0 repeat rval[gi] = rval[gi] + rv rv = (rv + @skew)*@split rv = rv - floor(rv) until (gi=gi+1)>#maxiter endif endif if @cfixrot gi = 0 repeat crv = @csplit*crv crval[gi] = crv = crv - floor(crv) until (gi=gi+1)>#maxiter if @cfixskew && @cskew!=0.0 crv = 0.0 gi = 0 repeat crval[gi] = crval[gi] + crv crv = (crv + @cskew)*@csplit crv = crv - floor(crv) until (gi=gi+1)>#maxiter endif endif endif init: complex z1 = #z; old iterations complex z2 = #z complex z3 = #z complex z4 = #z complex z5 = #z complex z6 = #z float d = 0 float d1 = 0 float d2 = 0 float od = 0 float f = 0 float of = 0 float fz = 0 float fz1 = 0 float fz4 = 0 float fz5 = 0 float r = 0 float or = 0 float s = 0 int cm = 0 int oi = 0 float ivuse = 0 float iwuse = 0 int li = 0 int it = 1 bool usebasins = false bool isstandard = true float o = 0.0 loop: z6 = z5 z5 = z4 z4 = z3; save them z3 = z2 z2 = z1 z1 = #z it = it + 1 final: ; determine potential and decomposition ; this gives us a "coordinate" in d and f, ranging from 0 to 1 f = real(#z); fractional iteration if using Hinrich's smoothing fz = imag(#z) ; atan2(finalz) if using Hinrich's+Atan d1 = |#z| if @cfixed d2 = |#z-@cfixedval| else d2 = |#z-z1| endif if f<0 && d1<@bailout && (@method==4 || @method==5 || @method==6) usebasins = true isstandard = false o = co f = 1+@fudge1c*f IF (@colditer == 0) z6 = z3 z5 = z2 z4 = z1 ELSEIF (@colditer == 1) z6 = z4 z5 = z3 z4 = z2 ELSEIF (@colditer == 2) z6 = z5 z5 = z4 z4 = z3 ENDIF fz1 = atan2(z1 - z2) fz4 = atan2(z4 - z5) fz5 = atan2(z5 - z6) if @fixconv d1 = #pi - atan2(z1) fz = fz + d1 fz1 = fz1 + d1 fz4 = fz4 + d1 fz5 = fz5 + d1 endif if @cfixrot && @cciliamode!=6 && @cciliamode!=7 r = crval[it] or = crval[it-1] else r = @crot endif s = @cskew cm = @cciliamode oi = @colditer ivuse = ivc iwuse = iwc li = @logiterc elseif d1>=@bailout && (@method==0 || @method==2 || @method==6) IF (@olditer == 0) z6 = z3 z5 = z2 z4 = z1 ELSEIF (@olditer == 1) z6 = z4 z5 = z3 z4 = z2 ELSEIF (@olditer == 2) z6 = z5 z5 = z4 z4 = z3 ENDIF if @dauto if @usedfudge f = 1 + @fudge*real(lp - log(0.5*log(|#z|)))/log(log(|#z|)/log(|z1|)) else f = 1 + real(lp - log(0.5*log(|#z|)))/log(log(|#z|)/log(|z1|)) endif else f = 1 + @fudge*real(lp - il*log(0.5*log(|#z|))) endif fz = atan2(#z) fz1 = atan2(z1) fz4 = atan2(z4) fz5 = atan2(z5) if @fixrot && @ciliamode!=6 && @ciliamode!=7 r = rval[it] or = rval[it-1] else r = @rot endif s = @skew cm = @ciliamode oi = @olditer ivuse = iv iwuse = iw li = @logiter elseif f>=0 && d2>@smallbail && d1<@bailout \ && (@method==3 || @method==5 || @method==7) isstandard = false f = @fudge1*f IF (@olditer == 0) z6 = z3 z5 = z2 z4 = z1 ELSEIF (@olditer == 1) z6 = z4 z5 = z3 z4 = z2 ELSEIF (@olditer == 2) z6 = z5 z5 = z4 z4 = z3 ENDIF fz1 = atan2(z1) fz4 = atan2(z4) fz5 = atan2(z5) if @fixrot && @ciliamode!=6 && @ciliamode!=7 r = rval[it] or = rval[it-1] else r = @rot endif s = @skew cm = @ciliamode oi = @olditer ivuse = iv iwuse = iw li = @logiter elseif d2<=@smallbail && (@method==1 || @method==2 || @method==7) usebasins = true o = co IF (@colditer == 0) z6 = z3 z5 = z2 z4 = z1 ELSEIF (@colditer == 1) z6 = z4 z5 = z3 z4 = z2 ELSEIF (@colditer == 2) z6 = z5 z5 = z4 z4 = z3 ENDIF if @cfixed if @cauto if @usecfudge f = 1 + @fudgec*real(clp - log(-0.5*log(|#z-@cfixedval|))) \ /log(log(|#z-@cfixedval|)/log(|z1-@cfixedval|)) else f = 1 + real(clp - log(-0.5*log(|#z-@cfixedval|))) \ /log(log(|#z-@cfixedval|)/log(|z1-@cfixedval|)) endif else f = 1 + @fudgec*real(clp - cil*log(-0.5*log(|#z-@cfixedval|))) endif elseif @cauto if @usecfudge f = 1 + @fudgec*real(clp - log(-0.5*log(|#z-z1|))) \ /log(log(|#z-z1|)/log(|z1-z2|)) else f = 1 + real(clp - log(-0.5*log(|#z-z1|))) \ /log(log(|#z-z1|)/log(|z1-z2|)) endif else f = 1 + @fudgec*real(clp - cil*log(-0.5*log(|#z-z1|))) endif fz = atan2(#z - z1) fz1 = atan2(z1 - z2) fz4 = atan2(z4 - z5) fz5 = atan2(z5 - z6) if @fixconv d1 = #pi - atan2(#z) fz = fz + d1 fz1 = fz1 + d1 fz4 = fz4 + d1 fz5 = fz5 + d1 endif if @cfixrot && @cciliamode!=6 && @cciliamode!=7 r = crval[it] or = crval[it-1] else r = @crot endif s = @cskew cm = @cciliamode oi = @colditer ivuse = ivc iwuse = iwc li = @logiterc else #solid = true endif if cm>7 of = 1-f ; this is the cheating method !! if (oi<4) od = fz5; angle of z else od = fz1; angle of z endif if (od < 0); it's negative od = od + #pi * 2; make it positive endif od = od / (#pi * 2); scale so full angle range is 0..1 ; apply rotation and skew od = od + or + s*of od = od - floor(od) ; convert decomp and pot to tileable value d ; this is where the patterns are made IF cm==8; sawtooth IF (od < 0.5) od = od * (of+1.0) ELSE od = (od-0.5) * (of+1.0) - 0.5*of + 0.5 ENDIF od = abs(1.0-od*2.0) ELSEIF cm==9; interpolated d1 = abs(1.0-od*2.0) d2 = abs(1-(od*@split-floor(od*@split))*2.0) od = d1 + of*(d2-d1) ELSEIF cm==10; sine waves d1 = cos(od*#pi*2.0)*0.5 + 0.5 d2 = cos(od*#pi*2.0*@split)*0.5 + 0.5 od = d1 + of*(d2-d1) ELSEIF cm==11; cells od = ((0.25-sqr(od-0.5)) * (0.25-sqr(of-0.5))) * 16.0 ELSEIF cm==12; bricks d1 = 1.0 - abs(od-0.5)*2.0 d2 = 1.0 - abs(of-0.5)*2.0 IF (d1 < d2) od = d1 ELSE od = d2 ENDIF ELSEIF cm==13; diamonds od = 0.5 - abs(od - 0.5) IF (of < 2.0/3.0) od = od + of*0.75 od = abs(1.0-od*2.0) ELSE IF (od < of*0.75-0.5) od = of*3.0-2.0-od*4.0 ELSE od = 1.0-(0.5-od)/(1.0-of*0.75) ENDIF ENDIF endif endif if (oi<4) d = fz4; angle of z else d = fz endif IF (d < 0); it's negative d = d + #pi * 2.0; make it positive ENDIF d = d / (#pi * 2.0); scale so full angle range is 0..1 ; apply rotation and skew d = d + r + s*f d = d - floor(d) ; convert decomp and pot to tileable value d ; this is where the patterns are made IF (cm == 0) || cm==8; sawtooth IF (d < 0.5) d = d * (f+1.0) ELSE d = (d-0.5) * (f+1.0) - 0.5*f + 0.5 ENDIF d = abs(1.0-d*2.0) ELSEIF (cm == 1) || cm==9; interpolated d1 = abs(1.0-d*2.0) d2 = abs(1.0-(d*@split-floor(d*@split))*2.0) d = d1 + f*(d2-d1) ELSEIF (cm == 2) || cm==10; sine waves d1 = cos(d*#pi*2.0)*0.5 + 0.5 d2 = cos(d*#pi*2.0*@split)*0.5 + 0.5 d = d1 + f*(d2-d1) ELSEIF (cm == 3) || cm==11; cells d = ((0.25-sqr(d-0.5)) * (0.25-sqr(f-0.5))) * 16.0 ELSEIF (cm == 4) || cm==12; bricks d1 = 1.0 - abs(d-0.5)*2.0 d2 = 1.0 - abs(f-0.5)*2.0 IF (d1 < d2) d = d1 ELSE d = d2 ENDIF ELSEIF (cm == 5) || cm==13; diamonds d = 0.5 - abs(d - 0.5) IF (f < 2.0/3.0) d = d + f*0.75 d = abs(1.0-d*2.0) ELSE IF (d < f*0.75-0.5) d = f*3.0-2.0-d*4.0 ELSE d = 1.0-(0.5-d)/(1.0-f*0.75) ENDIF ENDIF elseif (cm == 6) ;Smoothed angles if oi<4 if fz4<-#pi fz4 = fz4 + 2*#pi elseif fz4>#pi fz4 = fz4 - 2*#pi endif if fz5<-#pi fz5 = fz5 + 2*#pi elseif fz5>#pi fz5 = fz5 - 2*#pi endif d = cos(0.5*fz4) d1 = cos(0.5*fz5); angle of older z else if fz<-#pi fz = fz + 2*#pi elseif fz>#pi fz = fz - 2*#pi endif if fz1<-#pi fz1 = fz1 + 2*#pi elseif fz1>#pi fz1 = fz1 - 2*#pi endif d = cos(0.5*fz) d1 = cos(0.5*fz1) endif d1 = d1 + s*f d = d + r*f d1 = d1 + r*(1-f) d = abs(d1 + (d-d1)*f) elseif (cm == 7) ;Just smooth iteration d = (-0.125 + 0.05*(#numiter+1+f))^@ip ENDIF if cm>7 d = od+(d-od)*f endif if cm != 7 && ivuse>0 d1 = #numiter + 1.0 + f if li==1 d1 = log(1.0+d1) elseif li==2 d1 = log(1.0+log(1.0+d1)) endif d = ivuse*d1 + iwuse*d endif if usebasins && @zbasin>0 if isstandard z2 = z1 z1 = #z endif if @zbasin==1 d1 = abs(real(2.0*#pi+atan2(z1))) od = abs(real(2.0*#pi+atan2(z2))) elseif @zbasin==2 d1 = abs(real(z1)) od = abs(real(z2)) elseif @zbasin==3 d1 = abs(imag(z1)) od = abs(imag(z2)) elseif @zbasin==4 d1 = abs(real(z1)+imag(z1)) od = abs(real(z2)+imag(z2)) elseif @zbasin==5 d1 = abs(2*real(z1)+imag(z1)) od = abs(2*real(z2)+imag(z2)) elseif @zbasin==6 d1 = abs(real(z1)+2*imag(z1)) od = abs(real(z2)+2*imag(z2)) elseif @zbasin==7 d1 = abs(real(z1)/(abs(imag(z1))+1)) od = abs(real(z2)/(abs(imag(z2))+1)) elseif @zbasin==8 d1 = abs(imag(z1)/(abs(real(z1))+1)) od = abs(imag(z2)/(abs(real(z2))+1)) elseif @zbasin==9 d1 = abs(2*real(sqrt(z1))+imag(sqrt(z1))) od = abs(2*real(sqrt(z2))+imag(sqrt(z2))) elseif @zbasin==10 d1 = abs(real(sqrt(z1))+2*imag(sqrt(z1))) od = abs(real(sqrt(z2))+2*imag(sqrt(z2))) endif d = d + @zscale*(od+(d1-od)*f) endif #index = o + d * 0.99; reduce it just a bit to prevent ; the colors from wrapping default: title = "MMF3 Extended Cilia" heading caption = "Main control" endheading param method caption = "Smoothing" default = 0 enum = "Standard Div." "Standard Conv." "Standard both" \ "Hinrich's Div." "Hinrich's Conv." "Hinrich's both" \ "St.Div. H.Conv." "H.Div St.Conv." hint = "Specifies the type of smoothing to use and whether to \ colour divergent or convergent areas or both. \ Standard uses standard iteration smoothing and hence \ requires appropriate bailout (and power and fudge) values. \ Hinrich's uses what I've previously called 'finalz' \ smoothing where the final value of z from the main formula \ passes a smoothing fraction as real(z) and maybe atan(#z) \ as imag(z)." endparam heading caption = "Divergent smoothing" endheading param bailout caption = "Bailout" default = 128.0 hint = "This should match the bailout in the fractal formula. \ Larger values work best, especially when using 'Old iterations'. \ When NOT using standard divergent smoothing \ you should still ensure this is a suitable value (eg. >=10)." endparam param dauto caption = "Auto-power" default = true hint = "When enabled should produce smoothing for any divergent \ areas without you needing to set a divergent power value \ for the colouring." visible = @method==0 || @method==2 || @method==6 endparam param power caption = "Power/exponent/degree" default = (2,0) hint = "This should match the power/degree/exponent in the \ fractal formula. If the value to use isn't immediately \ obvious from the main formula itself then it's best to \ choose the 'Just iteration' mode and modify this value \ (and maybe the Scaling fudge) until you get completely \ smooth colouring, or just enable auto-power." visible = (@method==0 || @method==2 || @method==6) && !@dauto endparam param usedfudge caption = "Use scaling fudge" default = false hint = "Normally the scaling fudge is ignored when using 'Auto-power' \ but it's possible you may want to use it." visible = (@method==0 || @method==2 || @method==6) && @dauto endparam param fudge caption = "Scaling fudge" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1, it's unlikely to be required for \ divergent smoothing but I added it just in case. If \ 'Auto-power' or the best value you can find for \ the power parameter don't produce smooth results then \ modifying this value may help." visible = (@method==0 || @method==2 || @method==6) \ && (!@dauto || @usedfudge) endparam param fudge1 caption = "Scaling fudge 1" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1, it's unlikely to be required for \ divergent smoothing but I added it just in case." visible = @method==3 || @method==5 || @method==7 endparam heading caption = "Divergent colouring" visible = @method==0 || @method==2 || @method==3 || @method>4 endheading param ciliamode caption = "Cilia Mode" default = 0 enum = "Sawtooth" "Interpolated" "Sine waves" "Cells" "Bricks" \ "Diamonds" "Smoothed angles" "Just iteration" "Smooth saw" \ "Smooth interpolated" "Smooth sine" "Smooth cells" "Smooth bricks" \ "Smooth diamonds" hint = "This is the periodic function used to generate the \ cilia pieces. Each has a different 'flavor'. \ The 'Smooth' versions produce smoothed results for \ Sawtooth, Interpolated, Sine waves and Diamonds when \ the degree of divergence or convergence is not 2, eg. z^3+c \ Note that 'Just iteration' is exactly that, the \ other parameters become irrelevant." visible = @method==0 || @method==2 || @method==3 || @method>4 endparam param split caption = "Split" default = 2.0 hint = "Allows you to choose how the colouring 'splits' from one iteration \ to the next i.e. the increase in density of the colouring from one \ iteration to the next. Should 'correctly' be equal to the rate of \ divergence of the fractal e.g. 2 for z^2+c. Note that when using \ 'Sawtooth' or 'Diamonds' then only fractals where the correct \ value is 2 will work as intended." visible = @ciliamode!=6 && @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param olditer caption = "Old Iterations" default = 4 enum = "1 older" "2 older" "3 older" "4 older" "No" hint = "Uses older iterations for decomposition angle; this \ has the effect of spreading out the pattern. Best \ used to compensate for extreme bailouts. Note that \ 'No' requires the angle passed as the imaginary \ part of final z when using Hinrich's smoothing." visible = @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param iterval caption = "+Iter amount" default = 0.0 min = 0.0 hint = "Adds some iteration count to the colour value, \ thus producing colour change over the iterations. \ The larger the value the faster the colour change \ per iteration." visible = @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @ciliamode!=7 && @iterval>0 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @ciliamode!=7 && @iterval>0 && @iterweight!=0 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param skew caption = "Skew" default = 0.0 hint = "This skews the pattern. Unless you enable 'Fix Rotation' and 'Fix \ Skew' then only certain values will maintain the pattern e.g. \ multiples of 0.5 for z^2+c whereas when the 'fixes' are enabled \ the pattern will be maintained whatever value you use. When using \ Smoothed angles it changes the pattern rather than skewing it." visible = @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param rot caption = "Rotation" default = 0.0 hint = "This rotates the pattern, only values from -1 to +1 \ make sense for rotation except when using 'Fix Rotation' in which \ case the entire pattern rotates together provided the 'Split' \ value is correct. When using Smoothed angles it \ changes the pattern rather than rotating it and any \ reasonable values make sense." visible = @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param fixrot caption = "Fix Rotation" default = false hint = "When enabled the rotation is 'fixed'." visible = @ciliamode!=6 && @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param rpwr caption = "Rotation adjust" default = 5.0 min = 0.0 max = 20.0 hint = "Use to scale the effect of the 'Rotation' value, the larger the \ value you use the smaller the effect of changes to 'Rotation'. \ Typically increase the value in areas of higher iteration counts. \ Only needed when using a 'Split' greater than 1." visible = @fixrot && @ciliamode!=6 && @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam param fixskew caption = "Fix Skew" default = false hint = "When enabled the skew is 'fixed' for any skew values." visible = @fixrot && @ciliamode!=6 && @ciliamode!=7 \ && (@method==0 || @method==2 || @method==3 || @method>4) endparam heading caption = "Convergent smoothing" endheading param smallbail caption = "Bailout" default = 1e-5 hint = "This should match the small bailout in your fractal formula. \ When NOT using standard convergent smoothing \ you should ensure this is a suitable value (eg. <=1e-5)." endparam param cauto caption = "Auto-power" default = true hint = "When enabled should produce smoothing for any convergent \ areas without you needing to set a convergent power value \ for the colouring." visible = @method==1 || @method==2 || @method==7 endparam param cpower caption = "Power/exponent/degree" default = (2,0) hint = "This should match the power (exponent/degree) for the \ convergent areas of your main fractal formula. If the \ value to use isn't immediately obvious from the main \ formula itself then it's best to choose the 'Just \ iteration' mode and modify this value (and maybe the \ Scaling fudge) until you get completely smooth colouring, \ or just try auto-power." visible = (@method==1 || @method==2 || @method==7) && !@cauto endparam param usecfudge caption = "Use scaling fudge" default = false hint = "Normally the scaling fudge is ignored when using 'Auto-power' \ but it's possible you may want to use it." visible = (@method==1 || @method==2 || @method==7) && @cauto endparam param fudgec caption = "Scaling Fudge" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power' or the best value you can \ find for the 'Convergent Power' parameter don't \ produce smooth results then modifying this value \ should help." visible = (@method==1 || @method==2 || @method==7) \ && (!@cauto || @usecfudge) endparam param fudge1c caption = "Scaling Fudge 1" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1." visible = @method==4 || @method==5 || @method==6 endparam param cfixed caption = "Absolute convergence" default = false hint = "For when using a main formula that tests for convergence by \ using (only) |#z-value| rather than |#z-zold|, a typical example \ would be a Magnet formula where |#z-1.0| is often used. When \ enabled set the value of 'Convergence root' appropriately." visible = @method==1 || @method==2 || @method==7 endparam param cfixedval caption = "Convergence root" default = (1,0) hint = "Use (1.0,0) for some Magnet formulas." visible = (@method==1 || @method==2 || @method==7) && @cfixed endparam heading caption = "Convergent colouring" visible = @method==1 || @method==2 || @method>3 endheading param cciliamode caption = "Cilia Mode" default = 0 enum = "Sawtooth" "Interpolated" "Sine waves" "Cells" "Bricks" \ "Diamonds" "Smoothed angles" "Just iteration" "Smooth saw" \ "Smooth interpolated" "Smooth sine" "Smooth cells" "Smooth bricks" \ "Smooth diamonds" hint = "This is the periodic function used to generate the \ cilia pieces. Each has a different 'flavor'. \ The 'Smooth' versions produce smoothed results for \ Sawtooth, Interpolated, Sine waves and diamonds when \ the degree of divergence or convergence is not 2, eg. Nova formulas. \ Note that 'Just iteration' is exactly that, the \ other parameters become irrelevant." visible = @method==1 || @method==2 || @method>3 endparam param csplit caption = "Split" default = 2.0 hint = "Allows you to choose how the colouring 'splits' from one iteration \ to the next i.e. the increase in density of the colouring from one \ iteration to the next. Should 'correctly' be 2 for the Newton or \ Magnet fractals. Note that when using 'Sawtooth' or 'Diamonds' \ then only fractals where the correct value is 2 will work as \ intended." visible = @cciliamode!=6 && @cciliamode!=7 \ && (@method==1 || @method==2 || @method>3) endparam param fixconv caption = "Convergent 'fix'" default = true hint = "Fixes the convergent areas of some fractals (eg. Newton) \ so areas in different z basins will have consistent colouring. \ Turn this off to get more variety in your fractal \ but then plain Sawtooth, Sine and Interpolated will \ have iteration bands in some areas - you could use the \ Smooth versions instead. You may find 'Smoothed angles' better \ with this switched off." visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3) endparam param colditer caption = "Old Iterations" default = 0 enum = "1 older" "2 older" "3 older" "4 older" "No" hint = "Uses older iterations for decomposition angle; this \ has the effect of spreading out the pattern. Best \ used to compensate for extreme bailouts. Note that \ 'No' requires the angle passed as the imaginary \ part of final z when using Hinrich's smoothing." visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3) endparam param citerval caption = "+Iter amount" default = 0.0 min = 0.0 hint = "Adds some iteration count to the colour value, \ thus producing colour change over the iterations. \ The larger the value the faster the colour change \ per iteration." visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3) endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @cciliamode!=7 && @citerval>0 \ && (@method==1 || @method==2 || @method>3) endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @cciliamode!=7 && @citerval>0 && @iterweightc!=0 \ && (@method==1 || @method==2 || @method>3) endparam param cskew caption = "Skew" default = 0.0 hint = "This skews the pattern. Unless you enable 'Fix Rotation' and 'Fix \ Skew' then only certain values will maintain the pattern e.g. \ multiples of 0.5 for Newton whereas when the 'fixes' are enabled \ the pattern will be maintained whatever value you use. When using \ Smoothed angles it changes the pattern rather than skewing it." visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3) endparam param crot caption = "Rotation" default = 0.0 hint = "This rotates the pattern, only values from -1 to +1 \ make sense for rotation except when using 'Fix Rotation' in which \ case the entire pattern rotates together provided the 'Split' \ value is correct. When using Smoothed angles it \ changes the pattern rather than rotating it and any \ reasonable values make sense." visible = @cciliamode!=7 && (@method==1 || @method==2 || @method>3) endparam param cfixrot caption = "Fix Rotation" default = false hint = "When enabled the rotation is 'fixed'." visible = @cciliamode!=6 && @cciliamode!=7 \ && (@method==1 || @method==2 || @method>3) endparam param crpwr caption = "Rotation adjust" default = 5.0 min = 0.0 max = 20.0 hint = "Use to scale the effect of the 'Rotation' value, the larger the \ value you use the smaller the effect of changes to 'Rotation'. \ Typically increase the value in areas of higher iteration counts. \ Only needed when using a 'Split' greater than 1." visible = @cfixrot && @cciliamode!=6 && @cciliamode!=7 \ && (@method==1 || @method==2 || @method>3) endparam param cfixskew caption = "Fix Skew" default = false hint = "When enabled the skew is 'fixed' for any skew value." visible = @cfixrot && @cciliamode!=6 && @cciliamode!=7 \ && (@method==1 || @method==2 || @method>3) endparam param convoffset caption = "Colour offset" default = 0.0 hint = "Adds an offset to the final colour value in convergent areas, for \ when the main fractal has both convergent and divergent areas. \ The offset value corresponds to the number of gradient points when \ Color Density is 1 and Transfer Function is linear." visible = @method==1 || @method==2 || @method>3 endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "Roots 1" "Roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ penultimate value of z." visible = (@method==1 || @method==2 || @method>3) endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = (@method==1 || @method==2 || @method>3) && @zbasin>0 endparam param ip caption = "Iteration Power" default = 1.0 visible = @ciliamode==7 endparam } MMF3e-CentreOfCurve { ; ; This is a formula inspired by Luke Plant's "Curvature" ; in which 3 consecutive points in the orbit of z are ; taken to lie on the circumference of a circle. ; The three points can be used to calculate the centre ; of the circle and hence all properties associated with it. ; This version has a slightly different method of calculating ; the centre to that in the original formula, in this way ; some cases that resulted in NAN's have been avoided. ; ; The formula has been extended to allow colouring by ; first, last, nearest, farthest, average or sum using ; the radius, centre or various angles as the value to trap. ; In addition you can colour by iteration or potential. ; ; Note that in some cases it will be desirable to enable ; smoothing to remove iteration breaks in the colouring. ; ; You can choose to use classic iteration smoothing ; to get smooth colouring or to use the "finalz" ; smoothing where a smoothing fraction is passed from ; the main formula as real(finalz) based on a method ; suggested by Earl Hinrichs. ; ; When using the classic iteration smoothing methods ; the bailout parameters must be set correctly for the ; fractal formula in use. When not using "Auto-power" ; the "Power" and/or "Convergent power" parameters must ; also be set correctly. ; ; Updated 13th November 2004 ; Updated to have "auto-power" available for improved standard ; smoothing. It also now handles convergent Hinrich smoothing ; as well as divergent plus has the option to mix in the standard ; smoothed iteration value and zbasins with the main colour. ; global: float twopi = 2.0*#pi float il = real(1.0/log(@power)) ; for smoothing float lp = log(0.5*log(@bailout)) if !@autopower || @versionno==0 lp=il*lp endif float cil = real(1.0/log(@cpower)) float clp = log(-0.5*log(@smallbail)) if !@autopowerc || @versionno==0 clp=cil*clp endif float iv = 0.0001*@iterval*@iterweight float ivc = 0.0001*@itervalc*@iterweightc float iw = 1.0 - 0.01*@iterweight float iwc = 1.0 - 0.01*@iterweightc float co = 0.0025*@convoff init: complex c = (0,0) ; circle centre complex z1 = (0,0) ; z(n-1) complex z2 = (0,0) ; z(n-2) if @fixzold && @versionno>0 z1 = z2 = #z endif complex o = (0,0) ; #z - centre complex o1 = (0,0) ; centre - trapval int i = 0 ; iteration count float v = 0.0 ; colouring value float v1 = 0.0 ; old colouring value int t = 0 ; count for average int t1 = 0 ; old count float tv = 0.0 ; temp value to test for trapping float cv = 0.0 ; temp value for colouring float m = -1.0 ; for minimum or maximum float iuse = 0.0 ; for additer colouring float iwuse = 0.0 ; for additer colouring int li = 0 bool usebasins = false float x2m1 = 0 ; temp values to find the centre float y2m1 = 0 float x3m1 = 0 float y3m1 = 0 float x2y2s = 0 float x3y3s = 0 float d = 0 BOOL trapping = true ; flags BOOL trapped = true BOOL gotval = false BOOL gotval1 = false float f = 0 ; Smoothing fraction float cco = 0.0 loop: gotval1 = gotval v1 = v t1 = t if (i>1) && trapping x2m1 = real(z1) - real(#z) y2m1 = imag(z1) - imag(#z) x3m1 = real(z2) - real(#z) y3m1 = imag(z2) - imag(#z) x2y2s = x2m1*(real(z1) + real(#z)) + y2m1*(imag(z1) + imag(#z)) x3y3s = x3m1*(real(z2) + real(#z)) + y3m1*(imag(z2) + imag(#z)) d = 2*(x2m1*y3m1-x3m1*y2m1) c = y3m1*x2y2s - y2m1*x3y3s + flip(x2m1*x3y3s - x3m1*x2y2s) if abs(d)<1e-5 if abs(d)*1e1000 || @trapmethod==2 || @trapmethod==3) \ && (@trapvar==0 || @trapvar==3 || @trapvar>7)) \ || @colourvar==3 || @colourvar==6 || @colourvar>10 o = #z-c endif if ((@colourvar<3 || @trapmode>0 || @trapmethod==2 || @trapmethod==3) \ && (@trapvar==2 || @trapvar==7)) || @colourvar==5 || @colourvar==10 o1 = c-@trapval endif if @colourvar>0 && @colourvar!=2 if @colourvar==3 cv = cabs(o) elseif @colourvar==4 cv = cabs(c) elseif @colourvar==5 cv = cabs(o1) elseif @colourvar==6 cv = atan2(o) elseif @colourvar==7 cv = atan2(z1-c) elseif @colourvar==8 cv = atan2(z2-c) elseif @colourvar==9 cv = atan2(c) elseif @colourvar==10 cv = atan2(o1) elseif @colourvar==11 cv = |z1-z2|/cabs(o) elseif @colourvar==1 cv = log(1+log(1+cabs(#z))) endif if cv<0 if @angle==0 cv = abs(cv) else cv = cv + twopi endif endif cv = cabs(@fnc(cv)) if @diviterc==1 cv = cv/(i-1) elseif @diviterc==2 cv = cv/sqr(i-1) endif if @scalec cv = cv/cabs(#z) endif if @loglogc cv = log(1+log(1+cv)) endif elseif @colourvar==0 cv = i-1 endif if @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 trapped = false if @trapvar==0 tv = cabs(o) elseif @trapvar==1 tv = cabs(c) elseif @trapvar==2 tv = cabs(o1) elseif @trapvar==3 tv = atan2(o) elseif @trapvar==4 tv = atan2(z1-c) elseif @trapvar==5 tv = atan2(z2-c) elseif @trapvar==6 tv = atan2(c) elseif @trapvar==7 tv = atan2(o1) elseif @trapvar==8 tv = |z1-z2|/cabs(o) endif if tv<0 if @angle==0 tv = abs(tv) else tv = tv + twopi endif endif tv = cabs(@fnt(tv)) if @divitert==1 tv = tv/(i-1) elseif @divitert==2 tv = tv/sqr(i-1) endif if @scalet tv = tv/cabs(#z) endif if @loglogt tv = log(1+log(1+tv)) endif if @colourvar==2 || (@trapmode==0 && @colourvar<3 && (@trapmethod<2 || @trapmethod>3)) cv = tv endif if @trapmode==0 || (@trapmode==1 && tv<@trapdist) || (@trapmode==2 && tv>=@trapdist) trapped = true endif else tv = cv endif if trapped gotval = true if @trapmethod<2 v = cv if @trapmethod==0 trapping = false endif elseif @trapmethod==2 if abs(tv-@trapdist)m || m<0 m = abs(tv-@trapdist) v = cv endif elseif @trapmethod==4 || @trapmethod==5 v = v + cv if @trapmethod==4 t = t + 1 endif endif endif endif z2 = z1 z1 = #z i = i + 1 final: if gotval if @versionno==0 if (@smooth>1)&&(@smooth<5)&&(|#z-z1|<0.5)&&gotval1 f = real(clp-cil*log(-0.5*log(|#z-z1|))) elseif ((@smooth==0)||(@smooth==3))&&(|#z-z1|>0.5)&&gotval1 f = real(lp-il*log(0.5*log(|#z|))) elseif ((@smooth==1)||(@smooth==4))&&(|#z-z1|>0.5)&&gotval1 f = real(#z) elseif @smooth!=5 if @solid==0 #solid = true else #index = @fillcol*0.0025 endif f = -5 endif elseif (@smooth==1 || (@smooth==4 && |#z-z1|>0.5)) && gotval1 f = real(#z) if f<0 cco = co f = 1 + @fudge1c*f iuse = ivc iwuse = iwc li = @logiterc usebasins = true else f = @fudge1*f iuse = iv iwuse = iw li = @logiter endif elseif (@smooth==0 || @smooth==3) && |#z-z1|>0.5 && gotval1 if @autopower f = real((lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|z1|))) if @usefudge f = @fudge*f endif else f = @fudge*real(lp-il*log(0.5*log(|#z|))) endif iuse = iv iwuse = iw li = @logiter elseif (@smooth>1 && @smooth<5) && |#z-z1|<0.5 && gotval1 cco = co if @fixedconv if @autopowerc f = real( (clp-log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|z1-@fixedval|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-@fixedval|))) ) endif elseif @autopowerc f = real( (clp-log(-0.5*log(|#z-z1|))) \ /log(log(|#z-z1|)/log(|z1-z2|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-z1|))) ) endif iuse = ivc iwuse = iwc li = @logiterc usebasins = true elseif @smooth!=5 if @solid==0 #solid = true else #index = @fillcol*0.0025 endif f = -5 endif if f!=-5 if @trapmethod==4 v = v/t if @smooth!=5 v1 = v1/t1 endif endif v = cabs(fn1(v)) if @smooth!=5 v1 = cabs(fn1(v1)) endif if @divlast==1 v = v/(i-1) if @smooth!=5 v1 = v1/(i-2) endif elseif @divlast==2 v = v/sqr(i-1) if @smooth!=5 v1 = v1/sqr(i-2) endif endif if @colourvar==0 && (@trapmode>0 || @trapmethod==2 || @trapmethod==3) \ && @divlast==0 v = v*0.0025 v1 = v1*0.0025 endif if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) v = v1 + (v-v1) * f elseif @smooth!=5 v = v + (v-v1) * f endif if @versionno>0 && iuse!=0 && @smooth!=5 v1 = #numiter+f if li==1 v1 = log(1+v1) elseif li==2 v1 = log(1+log(1+v1)) endif v = iuse*v1+iwuse*v endif if usebasins && @zbasin>0 if @smooth!=1 && (@smooth!=4 || |#z-z1|<0.5) z2 = z1 z1 = #z endif if @zbasin==1 tv = abs(real(twopi+atan2(z1))) v1 = abs(real(twopi+atan2(z2))) elseif @zbasin==2 tv = abs(real(z1)) v1 = abs(real(z2)) elseif @zbasin==3 tv = abs(imag(z1)) v1 = abs(imag(z2)) elseif @zbasin==4 tv = abs(real(z1)+imag(z1)) v1 = abs(real(z2)+imag(z2)) elseif @zbasin==5 tv = abs(2*real(z1)+imag(z1)) v1 = abs(2*real(z2)+imag(z2)) elseif @zbasin==6 tv = abs(real(z1)+2*imag(z1)) v1 = abs(real(z2)+2*imag(z2)) elseif @zbasin==7 tv = abs(real(z1)/(abs(imag(z1))+1)) v1 = abs(real(z2)/(abs(imag(z2))+1)) elseif @zbasin==8 tv = abs(imag(z1)/(abs(real(z1))+1)) v1 = abs(imag(z2)/(abs(real(z2))+1)) elseif @zbasin==9 tv = abs(2*real(sqrt(z1))+imag(sqrt(z1))) v1 = abs(2*real(sqrt(z2))+imag(sqrt(z2))) elseif @zbasin==10 tv = abs(real(sqrt(z1))+2*imag(sqrt(z1))) v1 = abs(real(sqrt(z2))+2*imag(sqrt(z2))) endif if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) v = v + @zscale*(v1+(tv-v1)*f) elseif @smooth!=5 v = v + @zscale*(tv+(tv-v1)*f) endif endif #index = cco + v endif elseif @solid==0 #solid = true else v = @fillcol*0.0025 if usebasins && @zbasin>0 if @smooth!=1 && (@smooth!=4 || |#z-z1|<0.5) z2 = z1 z1 = #z endif if @zbasin==1 tv = abs(real(twopi+atan2(z1))) v1 = abs(real(twopi+atan2(z2))) elseif @zbasin==2 tv = abs(real(z1)) v1 = abs(real(z2)) elseif @zbasin==3 tv = abs(imag(z1)) v1 = abs(imag(z2)) elseif @zbasin==4 tv = abs(real(z1)+imag(z1)) v1 = abs(real(z2)+imag(z2)) elseif @zbasin==5 tv = abs(2*real(z1)+imag(z1)) v1 = abs(2*real(z2)+imag(z2)) elseif @zbasin==6 tv = abs(real(z1)+2*imag(z1)) v1 = abs(real(z2)+2*imag(z2)) elseif @zbasin==7 tv = abs(real(z1)/(abs(imag(z1))+1)) v1 = abs(real(z2)/(abs(imag(z2))+1)) elseif @zbasin==8 tv = abs(imag(z1)/(abs(real(z1))+1)) v1 = abs(imag(z2)/(abs(real(z2))+1)) elseif @zbasin==9 tv = abs(2*real(sqrt(z1))+imag(sqrt(z1))) v1 = abs(2*real(sqrt(z2))+imag(sqrt(z2))) elseif @zbasin==10 tv = abs(real(sqrt(z1))+2*imag(sqrt(z1))) v1 = abs(real(sqrt(z2))+2*imag(sqrt(z2))) endif if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) v = v + @zscale*(v1+(tv-v1)*f) elseif @smooth!=5 v = v + @zscale*(tv+(tv-v1)*f) endif endif #index = cco + v endif default: title = "MMF3 Centre of Curvature" heading caption = "Main settings" endheading param versionno caption = "Ver. (fix old UPRs)" enum = "Original" "Update 1" default = 1 hint = "In the unlikely event that an update has broken \ one of your old UPRs then use this to fix it." endparam param trapmode caption = "Trap mode" default = 0 enum = "Trap all" "Below" "Above" hint = "Below and Above will use only values below \ or above the Trap Threshold respectively. Note \ that when using Trap all and NOT using Nearest \ or Farthest then Colour by Iteration or Potential \ will be ignored and the trap value used instead." endparam param trapmethod caption = "Colouring method" default = 2 enum = "First" "Last" "Nearest" "Farthest" "Average" "Sum" endparam param colourvar caption = "Colour By" default = 2 enum = "Iteration" "Potential" "Trap Variable" "Radius" "Distance" \ "Distance to Trap" "Angle1 (#z to Centre)" "Angle2 (zold to Centre)" \ "Angle3 (zolder to Centre)" "Angle4 (Centre)" "Angle5 (Centre to Trap)" \ "Centripetal" hint = "Decides which value to use for colouring. Note that when using \ 'Trap all', Iteration and Potential are only used when the \ Colouring method is Nearest or Farthest - otherwise the Trap \ Variable is used as the Colour By." endparam param trapvar caption = "Trap Variable" default = 8 enum = "Radius" "Distance" "Distance to Trap" "Angle1 (#z to Centre)" \ "Angle2 (zold to Centre)" "Angle3 (zolder to Centre)" \ "Angle4 (Centre)" "Angle5 (Centre to Trap)" "Centripetal" hint = "Decides which property of the circle to trap." visible = @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 endparam param trapdist caption = "Trap Threshold" default = 0.0 min = 0.0 hint = "Used with Trap Modes Below and Above and Colouring \ methods Nearest and Farthest. Note that when trapping \ angle values the angle ranges from 0 to pi when using \ Abs Angle or 0 to 2*pi when using All Angles unless \ modified by Diviter, Scale, loglog or the Trap Function." visible = @trapmode>0 || @trapmethod==2 || @trapmethod==3 endparam param angle caption = "Angle to use" default = 0 enum = "Abs Angle" "All Angles" visible = ((@colourvar<3 || @trapmode>0 || @trapmethod==2 || @trapmethod==3) \ && @trapvar>2 && @trapvar<8) || (@colourvar>5 && @colourvar<11) endparam param trapval caption = "Trap Centre" default = (1,0) hint = "Used for 'Distance to Trap' and 'Angle5'." visible = ((@colourvar<3 || @trapmode>0 || @trapmethod==2 || @trapmethod==3) \ && (@trapvar==2 || @trapvar==7)) || @colourvar==5 || @colourvar==10 endparam param fixzold caption = "Fix zold" default = true hint = "Modifies the initial value of zold so it starts as #z \ rather than (0,0)." visible = @versionno>0 endparam heading caption = "Trap Adjustments (per iteration)" hint = "Applied to the values to trap." visible = @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 endheading func fnt caption = "Trap Function" default = ident() hint = "Try recip() with the radius/distance methods." visible = @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 endfunc param divitert caption = "Diviter" default = 0 enum = "Off" "On" "Squared" hint = "When enabled values used on every iteration are divided by \ the iteration count or the iteration count squared." visible = @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 endparam param scalet caption = "Scale by 1/cabs(z)" default = false hint = "When enabled values used are divided by cabs(#z)." visible = @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 endparam param loglogt caption = "Apply loglog" default = true hint = "Try with the radius/distance methods." visible = @trapmode>0 || @colourvar<3 || @trapmethod==2 || @trapmethod==3 endparam heading caption = "Colouring Adjustments (per iteration)" hint = "Applied to the values to use for colouring, except \ the iteration count." visible = @colourvar>2 || (@colourvar<2 && (@trapmethod==2 || @trapmethod==3)) endheading func fnc caption = "Colouring Function" default = ident() hint = "Try recip() with the radius/distance methods. Not applied \ to the iteration count." visible = @colourvar>2 || (@colourvar<2 && (@trapmethod==2 || @trapmethod==3)) endfunc param diviterc caption = "Diviter" default = 0 enum = "Off" "On" "Squared" hint = "When enabled values used on every iteration are divided by \ the iteration count or the iteration count squared. Not applied \ to the iteration count." visible = @colourvar>2 || (@colourvar<2 && (@trapmethod==2 || @trapmethod==3)) endparam param scalec caption = "Scale by 1/cabs(z)" default = false hint = "When enabled values used are divided by cabs(#z). Not applied \ to the iteration count." visible = @colourvar>2 || (@colourvar<2 && (@trapmethod==2 || @trapmethod==3)) endparam param loglogc caption = "Apply loglog" default = false hint = "Try with the radius/distance methods. Not applied to the \ iteration count." visible = @colourvar>2 || (@colourvar<2 && (@trapmethod==2 || @trapmethod==3)) endparam heading caption = "Adjustments (final)" hint = "Applied to the final colour values in all cases" endheading func fn1 caption = "Final function" default = ident() hint = "Applied as cabs(fn(value)) to all final values." endfunc param divlast caption = "DivFinaliter" default = 0 enum = "Off" "On" "Squared" hint = "When enabled all final values are divided by the final \ iteration count or it's square." endparam param solid caption = "Fill method" default = 0 enum = "Solid colour" "Fill #index" endparam param fillcol caption = "Fill #index" default = 0.0 hint = "Fill colour index. Only matches an actual gradient position \ when Color Density is 1 and Transfer Function is Linear." visible = @solid==1 endparam heading caption = "Smoothing" endheading param smooth caption = "Method" default = 0 enum = "Divergent" "Finalz" "Convergent" "Div&Conv" "Finalz&Conv" "None" endparam param autopower caption = "Auto-power (div)" default = true hint = "When enabled you should get correct smoothing on any divergent \ fractal without having to supply a power value and smoothing with \ low bailout values is much improved." visible = (@smooth==0 || @smooth==3) && @versionno>0 endparam param power caption = "Power" default = (2,0) hint = "This should match the power/degree/exponent in the \ fractal formula." visible = (@smooth==0 || @smooth==3) && (!@autopower || @versionno==0) endparam param bailout caption = "Bailout" default = 65536.0 hint = "This should match the bailout in the fractal formula." visible = @smooth==0 || @smooth==3 endparam param usefudge caption = "Use fudge (div)" default = false hint = "Allows you to enable use of the divergent scaling fudge \ when using 'Auto-power (div)'." visible = (@smooth==0 || @smooth==3) && @autopower && @versionno>0 endparam param fudge caption = "Fudge (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = @smooth!=2 && @smooth!=5 && @versionno>0 \ && (@usefudge || !@autopower) endparam param fudge1 caption = "Fudge 1 (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = (@smooth==1 || @smooth==4) && @versionno>0 endparam param iterval caption = "Add iter (div)" default = 0.0 hint = "Use to add some of the smooth iteration value to divergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth!=2 && @smooth!=5 && @versionno>0 endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth!=2 && @smooth!=5 && @versionno>0 && @iterval!=0 endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth!=2 && @smooth!=5 && @versionno>0 && @iterval!=0 && @iterweight!=0 endparam param autopowerc caption = "Auto-power (conv)" default = true hint = "When enabled you should get correct smoothing on any convergent \ fractal without having to supply a power value." visible = @smooth>1 && @smooth<5 && @versionno>0 endparam param cpower caption = "Convergent Power" default = (2,0) hint = "This should match the power (exponent/degree) for the \ convergent areas of your main fractal formula." visible = @smooth>1 && @smooth!=5 && (!@autopowerc || @versionno==0) endparam param smallbail caption = "Small bailout" default = 1e-5 hint = "This should match the small bailout in your fractal formula." visible = @smooth>1 && @smooth!=5 endparam param usefudgec caption = "Use fudge (conv)" default = false hint = "Allows you to enable use of the convergent scaling fudge \ when using 'Auto-power (conv)'." visible = @smooth>1 && @smooth!=5 && @autopowerc && @versionno>0 endparam param fudgec caption = "Fudge (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power (conv)' or the best value you can \ find for the 'Convergent Power' parameter don't \ produce smooth results then modifying this value \ should help." visible = @smooth>0 && @smooth!=5 && @versionno>0 \ && (!@autopowerc || @usefudgec) endparam param fudge1c caption = "Fudge 1 (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1." visible = @smooth==1 && @versionno>0 endparam param fixedconv caption = "Absolute convergence" default = false hint = "Use with main formulas that test for convergence using \ only |z-value| rather than |z-zold| eg. some Magnet formulas." visible = @smooth>1 && @smooth!=5 && @versionno>0 endparam param fixedval caption = "Convergence value" default = (1,0) hint = "Should match the value the main formula uses when testing \ for convergence." visible = @smooth>1 && @smooth!=5 && @fixedconv && @versionno>0 endparam param itervalc caption = "Add iter (conv)" default = 0.0 hint = "Use to add some of the smooth iteration value to convergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth>0 && @smooth!=5 && @versionno>0 endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth>0 && @smooth!=5 && @versionno>0 && @itervalc!=0 endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth>0 && @smooth!=5 && @versionno>0 && @itervalc!=0 && @iterweightc!=0 endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "roots 1" "roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ final or penultimate value of z." visible = @smooth>0 && @smooth!=5 && @versionno>0 endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = @smooth>0 && @smooth!=5 && @versionno>0 && @zbasin>0 endparam param convoff caption = "Offset (conv.)" default = 0.0 hint = "Offsets the final colour index in convergent areas. \ The value corresponds to gradient points when Color Density \ is 1 and Transfer Function is Linear." endparam } MMF3d-ExtCurvature { ; ; This started from Damien's Curvature Average, being ; extended to allow smooth versions of "Total" and "Last" ; as well as adding "Minimum" and "Maximum" and the ; Acceleration colouring. ; Alternative Curvature has hard breaks that provide ; interesting curves. ; ; The acceleration is based on the idea that cabs(z-zold) ; gives a "speed" hence cabs(z-zold)-cabs(zold-zold1) ; gives an "acceleration". In order to produce a useable ; colouring the acceleration value is divided by cabs(z) ; to make a more reasonable range of values for colouring. ; ; You can choose to use classic iteration smoothing ; to get smooth colouring or to use the "finalz" ; smoothing where a smoothing fraction is passed from ; the main formula as real(finalz) based on a method ; suggested by Earl Hinrichs. ; ; When using the classic iteration smoothing methods ; the bailout parameters must be set correctly for the ; fractal formula in use. When not using "Auto-power" ; the "Power" and/or "Convergent power" parameters must ; also be set correctly. ; ; Updated 13th November 2004 ; Updated to have "auto-power" available for improved standard ; smoothing. It also now handles convergent Hinrich smoothing ; as well as divergent plus has the option to mix in the standard ; smoothed iteration value and zbasins with the main colour. ; global: float il = real(1/log(@power)) ; for smoothing float lp = log(0.5*log(@bailout)) if !@autopower || @versionno==0 lp=il*lp endif float cil = real(1/log(@cpower)) float clp = log(-0.5*log(@smallbail)) if !@autopowerc || @versionno==0 clp=cil*clp endif float twopi = 2*#pi float iv = 0.0001*@iterval*@iterweight float ivc = 0.0001*@itervalc*@iterweightc float iw = 1.0 - 0.01*@iterweight float iwc = 1.0 - 0.01*@iterweightc float co = 0.0025*@convoff init: complex z1 = (0,0) complex z2 = (0,0) if @fixzold && @versionno>0 z1 = z2 = #z endif float a = 0 float a0 = 0 float a1 = 0 float a2 = 0 float s = 0 float s0 = 0 float s1 = 0 float s2 = 0 int i = 0 int ia = 0 int im = 0 float f = 0 float amin = twopi float amax = 0 float amin1 = amin float amax1 = amax float smin = 1e200 float smax = -1e200 float smin1 = smin float smax1 = smax float iuse = 0.0 ; for additer colouring float iwuse = 0.0 ; for additer colouring int li = 0 bool usebasins = false float o = 0.0 loop: if @use==0 || @use>1 if @method<2 a2 = a1 elseif @method==2 a0 = a elseif @method==3 || @method==5 amin1 = amin elseif @method==4 || @method==6 amax1 = amax endif if i>1 if @type==0 || @type==1 a = atan2((#z-z1)/(z1-z2)) if @type==1 if a<0 a = a + twopi endif else a = 2*abs(a) endif elseif @type==2 a = 2*abs(atan2((#z-@centre1)/(z1-@centre1))) elseif @type==3 || @type==4 a = atan2((#z-z1-@centre1)/(z1-z2-@centre2)) if @type==4 if a<0 a = a + twopi endif else a = 2*abs(a) endif elseif @type==5 a = 2*abs(atan2((#z-@centre1)/(z1-@centre2))) endif if @scale==1 a = a/(i-1) elseif @scale==2 a = a/sqr(i-1) endif if @method<2 a1 = a1 + a elseif @method==3 || @method==5 if aamax amax = a ia = i endif endif endif endif if @use>0 if @methodm<2 s2 = s1 elseif @methodm==2 s0 = s elseif @methodm==3 || @methodm==5 smin1 = smin elseif @methodm==4 || @methodm==6 smax1 = smax endif if (i>1) if @typem==0 s = abs(cabs(#z-z1)-cabs(z1-z2)) elseif @typem==1 s = abs(cabs(#z-@centrem1)-cabs(z1-@centrem2)) endif if @adiv==0 s = s/cabs(#z) elseif @adiv==1 s = s/cabs(#z-z1) elseif @adiv==2 s = s/cabs(z1-z2) endif if @arecip s = log(1+log(1+1/s)) endif if @scalem==1 s = s/(i-1) elseif @scalem==2 s = s/sqr(i-1) endif if @methodm<2 s1 = s1 + s elseif @methodm==3 || @methodm==5 if ssmax smax = s im = i endif endif endif endif i = i + 1 z2 = z1 z1 = #z final: if @versionno==0 if (@smooth>1)&&(@smooth<5)&&(|#z-z1|<0.5) f = real(clp-cil*log(-log(|#z-z1|)/2)) elseif ((@smooth==0)||(@smooth==3))&&(|#z-z1|>0.5) f = real(lp-il*log(log(|#z|)/2)) elseif ((@smooth==1)||(@smooth==4))&&(|#z-z1|>0.5) f = real(#z) elseif @smooth!=5 f = 5 else f = 0 endif elseif @smooth==1 || (@smooth==4 && |#z-z1|>0.5) f = real(#z) if f<0 o = co f = 1 + @fudge1c*f iuse = ivc iwuse = iwc li = @logiterc usebasins = true else f = @fudge1*f iuse = iv iwuse = iw li = @logiter endif elseif (@smooth==0 || @smooth==3) && |#z-z1|>0.5 if @autopower f = real((lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|z1|))) if @usefudge f = @fudge*f endif else f = @fudge*real(lp-il*log(0.5*log(|#z|))) endif iuse = iv iwuse = iw li = @logiter elseif (@smooth>1 && @smooth<5) && |#z-z1|<0.5 o = co if @fixedconv if @autopowerc f = real( (clp-log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|z1-@fixedval|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-@fixedval|))) ) endif elseif @autopowerc f = real( (clp-log(-0.5*log(|#z-z1|))) \ /log(log(|#z-z1|)/log(|z1-z2|)) ) if @usefudgec f = @fudgec*f endif else f = @fudgec*real( (clp-cil*log(-0.5*log(|#z-z1|))) ) endif iuse = ivc iwuse = iwc li = @logiterc usebasins = true elseif @smooth!=5 f = 5 else f = 0 endif if f!=5 if @use==0 || @use>1 a1 = a1/twopi a2 = a2/twopi if @method==0 if i<2 f = 5 else a1=a1/(i-1) endif if i<3 if @smooth!=5 f = 5 endif else a2=a2/(i-2) endif elseif @method==1 a1 = log(1+a1) a2 = log(1+a2) elseif @method==2 a1 = log(1+a) a2 = log(1+a0) elseif @method==3 a1 = amin/twopi a2 = amin1/twopi elseif @method==4 a1 = exp(amax/twopi) a2 = exp(amax1/twopi) elseif @method==5 || @method==6 a1 = ia*0.0025 a2 = a1 endif endif endif if f!=5 if @use>0 if @methodm==0 if i<2 f = 5 else s1=abs(s1/(i-1)) endif if i<3 if @smooth!=5 f = 5 endif else s2=abs(s2/(i-2)) endif elseif @methodm==1 s1 = log(1+s1) s2 = log(1+s2) elseif @methodm==2 s1 = s s2 = s0 elseif @methodm==3 s1 = log(1+log(1+log(1+log(1+log(1+log(1/smin)))))) s2 = log(1+log(1+log(1+log(1+log(1+log(1/smin1)))))) elseif @methodm==4 s1 = log(1+smax) s2 = log(1+smax1) elseif @methodm==5 || @methodm==6 s1 = im*0.0025 s2 = s1 endif endif endif if f!=5 if @use==1 a1 = s1 a2 = s2 elseif @use==2 a1 = cabs(@fn1(a1)*@fn2(s1)) a2 = cabs(@fn1(a2)*@fn2(s2)) elseif @use==3 a1 = cabs(@weight*@fn1(a1)+(1-@weight)*@fn2(s1)) a2 = cabs(@weight*@fn1(a2)+(1-@weight)*@fn2(s2)) elseif @use==4 a1 = cabs(@weight*@fn1(a1)-(1-@weight)*@fn2(s1)) a2 = cabs(@weight*@fn1(a2)-(1-@weight)*@fn2(s2)) elseif @use==5 a1 = cabs(@fn1(a1)/@fn2(s1)) a2 = cabs(@fn1(a2)/@fn2(s2)) elseif @use==6 a1 = cabs(@fn1(s1)/@fn2(a1)) a2 = cabs(@fn1(s2)/@fn2(a2)) endif a1 = cabs(@fn0(a1)) a2 = cabs(@fn0(a2)) if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) a1 = a2 + (a1-a2) * f elseif @smooth!=5 a1 = a1 + (a1-a2) * f endif if @versionno>0 && iuse!=0 && @smooth!=5 s1 = #numiter+f if li==1 s1 = log(1+s1) elseif li==2 s1 = log(1+log(1+s1)) endif a1 = iuse*s1+iwuse*a1 endif if usebasins && @zbasin>0 if @smooth!=1 && (@smooth!=4 || |#z-z1|<0.5) z2 = z1 z1 = #z endif if @zbasin==1 s1 = abs(real(twopi+atan2(z1))) s2 = abs(real(twopi+atan2(z2))) elseif @zbasin==2 s1 = abs(real(z1)) s2 = abs(real(z2)) elseif @zbasin==3 s1 = abs(imag(z1)) s2 = abs(imag(z2)) elseif @zbasin==4 s1 = abs(real(z1)+imag(z1)) s2 = abs(real(z2)+imag(z2)) elseif @zbasin==5 s1 = abs(2*real(z1)+imag(z1)) s2 = abs(2*real(z2)+imag(z2)) elseif @zbasin==6 s1 = abs(real(z1)+2*imag(z1)) s2 = abs(real(z2)+2*imag(z2)) elseif @zbasin==7 s1 = abs(real(z1)/(abs(imag(z1))+1)) s2 = abs(real(z2)/(abs(imag(z2))+1)) elseif @zbasin==8 s1 = abs(imag(z1)/(abs(real(z1))+1)) s2 = abs(imag(z2)/(abs(real(z2))+1)) elseif @zbasin==9 s1 = abs(2*real(sqrt(z1))+imag(sqrt(z1))) s2 = abs(2*real(sqrt(z2))+imag(sqrt(z2))) elseif @zbasin==10 s1 = abs(real(sqrt(z1))+2*imag(sqrt(z1))) s2 = abs(real(sqrt(z2))+2*imag(sqrt(z2))) endif if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) a1 = a1 + @zscale*(s2+(s1-s2)*f) elseif @smooth!=5 a1 = a1 + @zscale*(s1+(s1-s2)*f) endif endif #index = o + a1 elseif @fill==0 #solid = true else a1 = 0.0025*@fillvalue if usebasins && @zbasin>0 if @smooth!=1 && (@smooth!=4 || |#z-z1|<0.5) z2 = z1 z1 = #z endif if @zbasin==1 s1 = abs(real(twopi+atan2(z1))) s2 = abs(real(twopi+atan2(z2))) elseif @zbasin==2 s1 = abs(real(z1)) s2 = abs(real(z2)) elseif @zbasin==3 s1 = abs(imag(z1)) s2 = abs(imag(z2)) elseif @zbasin==4 s1 = abs(real(z1)+imag(z1)) s2 = abs(real(z2)+imag(z2)) elseif @zbasin==5 s1 = abs(2*real(z1)+imag(z1)) s2 = abs(2*real(z2)+imag(z2)) elseif @zbasin==6 s1 = abs(real(z1)+2*imag(z1)) s2 = abs(real(z2)+2*imag(z2)) elseif @zbasin==7 s1 = abs(real(z1)/(abs(imag(z1))+1)) s2 = abs(real(z2)/(abs(imag(z2))+1)) elseif @zbasin==8 s1 = abs(imag(z1)/(abs(real(z1))+1)) s2 = abs(imag(z2)/(abs(real(z2))+1)) elseif @zbasin==9 s1 = abs(2*real(sqrt(z1))+imag(sqrt(z1))) s2 = abs(2*real(sqrt(z2))+imag(sqrt(z2))) elseif @zbasin==10 s1 = abs(real(sqrt(z1))+2*imag(sqrt(z1))) s2 = abs(real(sqrt(z2))+2*imag(sqrt(z2))) endif if @smooth==1 || (@smooth==4 && |#z-z1|>0.5) a1 = a1 + @zscale*(s2+(s1-s2)*f) elseif @smooth!=5 a1 = a1 + @zscale*(s1+(s1-s2)*f) endif endif #index = o + a1 endif default: title = "MMF3 Curvature and Acceleration" heading caption = "Main control" endheading param versionno caption = "Ver. (fix old UPRs)" enum = "Original" "Update 1" default = 1 hint = "In the unlikely event that an update has broken \ one of your old UPRs then use this to fix it." endparam param use caption = "Colour using" default = 0 enum = "Curvature" "Acceleration" "Product" "Weighted Sum" \ "Weighted Difference" "Quotient" "1/Quotient" hint = "In the Weighted modes a weight of 1.0 will use all \ Curvature and 0 will use all Acceleration. Quotient \ uses Curvature/Acceleration." endparam param weight caption = "Weight" default = 0.5 hint = "Weighting for when colouring using Sum or Difference, \ normal range from 0 to 1." visible = @use==3 || @use==4 endparam func fn0 caption = "Final function" default = ident() hint = "Not all settings apply as this is used on a real \ number not a complex one." endfunc param fixzold caption = "Fix zold" default = true hint = "Modifies the initial value of zold so it starts as #z \ rather than (0,0)." visible = @versionno>0 endparam param fill caption = "Fill method" enum = "Solid" "Colour index" default = 0 hint = "Allows you to decide how to infill areas that cannot be \ coloured by the formula eg. iteration 1 in convergent areas." visible = @versionno>0 endparam param fillvalue caption = "Fill index" default = 0.0 hint = "Sets the fill colour, matches your gradient points ie. 0 to 399 \ when the Color Density is 1 and Transfer Function is Linear." visible = @fill==1 && @versionno>0 endparam heading caption = "Curvature settings" visible = @use!=1 endheading param type caption = "Curvature Type" default = 0 enum = "Original" "Alternative" "Around Centre" "Orig Offset" \ "Alt Offset" "Two Centres" visible = @use!=1 endparam param method caption = "Curvature Value" default = 0 enum = "Average" "Total" "Last" "Minimum" "Maximum" \ "Min. (Iter)" "Max. (Iter)" visible = @use!=1 endparam param centre1 caption = "Curvature Centre 1" default = (0,0) hint = "Used as an offset value for 'Alt Offset' and \ 'Orig Offset' types, as the centre of curvature \ for 'Around Centre' and as the first centre for \ 'Two Centres'." visible = @use!=1 && @type>1 endparam param centre2 caption = "Curvature Centre 2" default = (0,0) hint = "Used as an offset value for 'Alt Offset' and \ 'Orig Offset' types, unused for 'Around Centre' \ and as the second centre for 'Two Centres'." visible = @use!=1 && @type>2 endparam param scale caption = "Diviter (curvature)" enum = "Off" "On" "Squared" hint = "Enabling divides the curvature on every iteration \ by the current iteration count or it's square. \ Should be left off when using Curvature Value \ 'Max. (Iter)'." visible = @use!=1 endparam func fn1 caption = "Curvature function" default = ident() hint = "Applied to the Curvature when colouring using \ combined Curvature and Acceleration. Not all \ settings apply as this is used on a real number \ not a complex one." visible = @use>1 endfunc heading caption = "Acceleration settings" visible = @use>0 endheading param typem caption = "Acceleration type" default = 0 enum = "Normal" "Two Centres" visible = @use>0 endparam param methodm caption = "Acceleration Value" default = 0 enum = "Average" "Total" "Last" "Minimum" "Maximum" \ "Min. (Iter)" "Max. (Iter)" visible = @use>0 endparam param adiv caption = "Accel. scale" default = 0 enum = "*1/cabs(z)" "*1/cabs(z-zold)" "*1/cabs(zold-zolder)" "none" visible = @use>0 endparam param arecip caption = "Reciprocal" default = false hint = "When applied max's become mins and mins become max's." visible = @use>0 endparam param centrem1 caption = "Accel. Centre 1" default = (0,0) visible = @use>0 && @typem==1 endparam param centrem2 caption = "Accel. Centre 2" default = (0,0) visible = @use>0 && @typem==1 endparam param scalem caption = "Diviter (scale)" enum = "Off" "On" "Squared" hint = "Enabling divides the acceleration on every iteration \ by the current iteration count or it's square. \ Should be left off when using Acceleration Value \ 'Max. (Iter)'." visible = @use>0 endparam func fn2 caption = "Acceleration function" default = ident() hint = "Applied to the Acceleration when colouring using \ combined Curvature and Acceleration. Not all \ settings apply as this is used on a real number \ not a complex one." visible = @use>1 endfunc heading caption = "Smoothing" endheading param smooth caption = "Method" default = 0 enum = "Divergent" "Finalz" "Convergent" "Div&Conv" "Finalz&Conv" "None" endparam param autopower caption = "Auto-power (div)" default = true hint = "When enabled you should get correct smoothing on any divergent \ fractal without having to supply a power value and smoothing with \ low bailout values is much improved." visible = (@smooth==0 || @smooth==3) && @versionno>0 endparam param power caption = "Power" default = (2,0) hint = "This should match the power/degree/exponent in the \ fractal formula." visible = (@smooth==0 || @smooth==3) && (!@autopower || @versionno==0) endparam param bailout caption = "Bailout" default = 65536.0 hint = "This should match the bailout in the fractal formula." visible = @smooth==0 || @smooth==3 endparam param usefudge caption = "Use fudge (div)" default = false hint = "Allows you to enable use of the divergent scaling fudge \ when using 'Auto-power (div)'." visible = (@smooth==0 || @smooth==3) && @autopower && @versionno>0 endparam param fudge caption = "Fudge (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = @smooth!=2 && @smooth!=5 && @versionno>0 \ && (@usefudge || !@autopower) endparam param fudge1 caption = "Fudge 1 (div)" default = 1.0 hint = "Use to scale the divergent smoothing fraction when it \ doesn't fully range from 0 to 1." visible = (@smooth==1 || @smooth==4) && @versionno>0 endparam param iterval caption = "Add iter (div)" default = 0.0 hint = "Use to add some of the smooth iteration value to divergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth!=2 && @smooth!=5 && @versionno>0 endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth!=2 && @smooth!=5 && @versionno>0 && @iterval!=0 endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth!=2 && @smooth!=5 && @versionno>0 && @iterval!=0 && @iterweight!=0 endparam param autopowerc caption = "Auto-power (conv)" default = true hint = "When enabled you should get correct smoothing on any convergent \ fractal without having to supply a power value." visible = @smooth>1 && @smooth<5 && @versionno>0 endparam param cpower caption = "Convergent Power" default = (2,0) hint = "This should match the power (exponent/degree) for the \ convergent areas of your main fractal formula." visible = @smooth>1 && @smooth!=5 && (!@autopowerc || @versionno==0) endparam param smallbail caption = "Small bailout" default = 1e-5 hint = "This should match the small bailout in your fractal formula." visible = @smooth>1 && @smooth!=5 endparam param usefudgec caption = "Use fudge (conv)" default = false hint = "Allows you to enable use of the convergent scaling fudge \ when using 'Auto-power (conv)'." visible = @smooth>1 && @smooth!=5 && @autopowerc && @versionno>0 endparam param fudgec caption = "Fudge (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power (conv)' or the best value you can \ find for the 'Convergent Power' parameter don't \ produce smooth results then modifying this value \ should help." visible = @smooth>0 && @smooth!=5 && @versionno>0 \ && (!@autopowerc || @usefudgec) endparam param fudge1c caption = "Fudge 1 (conv)" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1." visible = @smooth==1 && @versionno>0 endparam param fixedconv caption = "Absolute convergence" default = false hint = "Use with main formulas that test for convergence using \ only |z-value| rather than |z-zold| eg. some Magnet formulas." visible = @smooth>1 && @smooth!=5 && @versionno>0 endparam param fixedval caption = "Convergence value" default = (1,0) hint = "Should match the value the main formula uses when testing \ for convergence." visible = @smooth>1 && @smooth!=5 && @fixedconv && @versionno>0 endparam param itervalc caption = "Add iter (conv)" default = 0.0 hint = "Use to add some of the smooth iteration value to convergent areas. \ Larger values change the colour more rapidly per iteration." visible = @smooth>0 && @smooth!=5 && @versionno>0 endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @smooth>0 && @smooth!=5 && @versionno>0 && @itervalc!=0 endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @smooth>0 && @smooth!=5 && @versionno>0 && @itervalc!=0 && @iterweightc!=0 endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "roots 1" "roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ final or penultimate value of z." visible = @smooth>0 && @smooth!=5 && @versionno>0 endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = @smooth>0 && @smooth!=5 && @versionno>0 && @zbasin>0 endparam param convoff caption = "Offset (conv.)" default = 0.0 hint = "Offsets the final colour index in convergent areas. \ The value corresponds to gradient points when Color Density \ is 1 and Transfer Function is Linear." endparam } MMF3c-Orbitals { ; ; Orbitals with added fBm. ; ; This is essentially orbit trapping, but using ; the z values from previous iteration/s to set ; the value of the trap. ; I've employed the same technique as Damien did ; in his curvature average algorithm to get smooth ; colouring, ie. using the smooth iteration fraction ; to combine results from consecutive iterations. ; Hence the smooth method only works perfectly with ; those fractal types for which smooth iteration ; colouring works and you should set the power and bailout ; parameters to the values used in your main formula ; (preferably with a high bailout value). ; However it may produce interesting results on other ; fractal types too (in which case it's worth playing ; with the power and bailout values). ; ; Updated 2nd-10th November 2004 ; Added auto-power for standard smoothing and the Earl ; Hinrich's method for convergent smoothing for use with ; formulas that use it. Also added a separate frequency ; scale for fBm in convergent areas and the option to scale ; the additive value by 1/cabs(z) in addition to 1/iter or ; 1/iter^2. ; ; Updated 8th September 2002 ; Added "plain" orbit traps since this allows options for ; plain orbit traps not available elsewhere. ; Also added an alternative smoothing method - for use with ; formulas that pass a smoothing fraction as final z. Such ; a formula is the MMF-Transformation formula which impliments ; a smoothing algorithm suggested by Earl Hinrichs, see: ; ; http://computerart.org/smoothcolor.html ; ; Updated 21st March 2002 ; Added the "Poly predictor" options. ; These trap to a predictor based on: ; a*z^power + b OR a*z^power + b*z + c ; The power to use is a user parameter and the values ; of a, b and c are calculated based on old z values. ; Please note that if you are using a standard formula ; of the same sort as the predictor, with the same power, ; then no colouring will result. ; ; Updated 7th March 2002 ; Added Predictor 5 ; Predictors 3 & 4 were based on the assumption that the ; orbit of Z follows basic spirals around the origin. ; Predictor 5 is based on the assumption that the orbit is ; spiralling around a point other than the origin. ; Predictor 5 traps to: ; (zold*(zold-zold1)+zold1^2-zold*zold2)/(zold1-zold2) ; ; Updated 4th March 2002 ; Added the "Predictor" options. ; Predictor 1 traps to Zold+(Zold-Zold1) ; Predictor 2 traps to Zold+(Zold-Zold1)+(Zold-Zold1)-(Zold2-Zold1) ; Predictor 3 traps to Zold*(Zold/Zold1) ; Predictor 4 traps to Zold*(Zold/Zold1)*(Zold/Zold1)/(Zold1/Zold2) ; ; Updated 18th November 2000 ; Added iteration skipping and index masking as well as more ; options for "Colour by", options to change the "Diviter" value ; and the "Funky Function". ; ; Updated 14th November 2000 - Added "Shapes" and "Colour by". ; ; Shape algorithms imported from "Orbit Traps" with ; thanks to Damien. ; ; Created 10th/11th November 2000 ; ; (c) Dave Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; global: $define DEBUG ; This method uses a single array 262144 in size, but defined ; as 262147 to repeat 3 points so they can be indexed without ; needing to use n%262144 an extra time float fbmh[262147] ; Arrays for the fBm level data float fbmq[16,5] ; various float fbmd=#pi/180 ; for conversion to radians float fbmc=4096*@rs ; overall frequency ; fBm level 1 float fbmang=0 ; rads ; q[level,0] and q[level,1] are the scaling factors for the ; x+y and x-y arrays, the "correct" value should be the same ; for both (ie. 1/sqrt(2)) but to increase variation the ; values used are in the neighbourhood of 0.7071, being n/8192 ; where n is a prime number. fbmq[0,0]=5471/8192 fbmq[0,1]=6143/8192 ; The rotation values fbmq[0,2]=1.0 ; Cos(0) fbmq[0,3]=0 ; Sin(0) ; fBm level 2 (Note slightly different values q[1,0] and q[1,1]) fbmang=22.5*fbmd fbmq[1,0]=6079/8192 fbmq[1,1]=5521/8192 fbmq[1,2]=cos(fbmang) fbmq[1,3]=sin(fbmang) ; fBm level 3 fbmang=11.25*fbmd fbmq[2,0]=5501/8192 fbmq[2,1]=6113/8192 fbmq[2,2]=cos(fbmang) fbmq[2,3]=sin(fbmang) ; fBm level 4 fbmang=33.75*fbmd fbmq[3,0]=6047/8192 fbmq[3,1]=5563/8192 fbmq[3,2]=cos(fbmang) fbmq[3,3]=sin(fbmang) ; fBm level 5 fbmang=16.875*fbmd fbmq[4,0]=5507/8192 fbmq[4,1]=6091/8192 fbmq[4,2]=cos(fbmang) fbmq[4,3]=sin(fbmang) ; fBm level 6 fbmang=39.375*fbmd fbmq[5,0]=6037/8192 fbmq[5,1]=5573/8192 fbmq[5,2]=cos(fbmang) fbmq[5,3]=sin(fbmang) ; fBm level 7 fbmang=28.125*fbmd fbmq[6,0]=5531/8192 fbmq[6,1]=6067/8192 fbmq[6,2]=cos(fbmang) fbmq[6,3]=sin(fbmang) ; fBm level 8 fbmang=5.625*fbmd fbmq[7,0]=6131/8192 fbmq[7,1]=5479/8192 fbmq[7,2]=cos(fbmang) fbmq[7,3]=sin(fbmang) ; fBm level 9 fbmang=19.6875*fbmd fbmq[8,0]=5503/8192 fbmq[8,1]=6101/8192 fbmq[8,2]=cos(fbmang) fbmq[8,3]=sin(fbmang) ; fBm level 10 fbmang=36.5625*fbmd fbmq[9,0]=6133/8192 fbmq[9,1]=5477/8192 fbmq[9,2]=cos(fbmang) fbmq[9,3]=sin(fbmang) ; fBm level 11 fbmang=8.4375*fbmd fbmq[10,0]=5557/8192 fbmq[10,1]=6053/8192 fbmq[10,2]=cos(fbmang) fbmq[10,3]=sin(fbmang) ; fBm level 12 fbmang=25.3125*fbmd fbmq[11,0]=6029/8192 fbmq[11,1]=5581/8192 fbmq[11,2]=cos(fbmang) fbmq[11,3]=sin(fbmang) ; fBm level 13 fbmang=14.0625*fbmd fbmq[12,0]=5527/8192 fbmq[12,1]=6073/8192 fbmq[12,2]=cos(fbmang) fbmq[12,3]=sin(fbmang) ; fBm level 14 fbmang=30.9375*fbmd fbmq[13,0]=6121/8192 fbmq[13,1]=5483/8192 fbmq[13,2]=cos(fbmang) fbmq[13,3]=sin(fbmang) ; fBm level 15 fbmang=2.8125*fbmd fbmq[14,0]=5569/8192 fbmq[14,1]=6043/8192 fbmq[14,2]=cos(fbmang) fbmq[14,3]=sin(fbmang) ; fBm level 16 fbmang=42.1875*fbmd fbmq[15,0]=6089/8192 fbmq[15,1]=5519/8192 fbmq[15,2]=cos(fbmang) fbmq[15,3]=sin(fbmang) ; Now initialise the height arrays ready for fBm creation. int fbmr=@seed ; initialise the random variable float fbmr1=fbmr int fbms=4096 ; initially assume fBm at step 4096 ; ie. "div 64" (16*4 arrays of 4096) int fbmi=0 while fbmi<262144 fbmh[fbmi]=0 ; set entry to 0 if @fbmmode>0 fbmh[fbmi+2048]=0 fbms=2048 if @fbmmode>1 fbmr=random(fbmr) fbmh[fbmi+1024]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+3072]=fbmr/#randomrange fbms=1024 if @fbmmode>2 fbmr=random(fbmr) fbmh[fbmi+512]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+1536]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+2560]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+3584]=fbmr/#randomrange fbms=512 if @fbmmode>3 fbmr=random(fbmr) fbmh[fbmi+256]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+768]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+1280]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+1792]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+2304]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+2816]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+3328]=fbmr/#randomrange fbmr=random(fbmr) fbmh[fbmi+3840]=fbmr/#randomrange fbms=256 endif endif endif endif fbmi=fbmi+4096 endwhile fbmh[262144]=0 ; Now calculate the number of extra (dummy) dice rolls to use ; (The dummy rolls mean the shape of the fBm will not change ; in great jumps as the number of dice used is changed - ; provided @dice is <= @dummy) int fbmnd=0 if @dummy>0 fbmnd=@dummy-ceil(@dice) if fbmnd<0 print("Not enough dummy rolls") fbmnd=0 endif endif ; Now proceed with the actual fBm creation float fbmrs=1.0 ; Initial fBm scale factor float fbmmx=0 ; for the maximum float fbmmn=0 ; for the minimum while fbms>1 ; we've finished when s=1 int fbmo=floor(fbms/2) ; offset is step/2 int fbmp=fbmo ; start index while fbmp<262144 ; Now roll up the next random fbmr1=0 float fbmnr=@dice while fbmnr>=1 fbmr=random(fbmr) fbmr1=fbmr1+fbmr/#randomrange fbmnr=fbmnr-1 endwhile if fbmnr>0 fbmr=random(fbmr) fbmr1=fbmr1+fbmnr*fbmr/#randomrange endif fbmr1=fbmr1/@dice ; Do any dummy rolls int fbmn=fbmnd while fbmn>0 fbmr=random(fbmr) fbmn=fbmn-1 endwhile ; Height = (previous+next)/2 + random*scale factor ; or cubic interpolation + random*scale factor if @average==0 fbmh[fbmp]=(fbmh[fbmp-fbmo]+fbmh[fbmp+fbmo])/2+fbmrs*fbmr1 else int fbmw=(fbmp-fbmo-fbms)%262144 if fbmw<0 fbmw=fbmw+262144 endif float hh0=fbmh[fbmw] float hh1=fbmh[fbmp-fbmo] float hh2=fbmh[fbmp+fbmo] fbmw=(fbmp+fbmo+fbms)%262144 float hh3=fbmh[fbmw] fbmh[fbmp]=(5*(hh1+hh2)-(hh0+hh3))/8+fbmrs*fbmr1 endif ; Check for max and min if fbmh[fbmp]>fbmmx fbmmx=fbmh[fbmp] endif if fbmh[fbmp] 7) then move the trap ; Check value against bailout to avoid overflow if (@version > 7 && @version < 13) && (|ft|<@obailout) ft = fts*@fn4(ft)^ftp+fto endif ; Store previous values required for smoothing if @colour == 0 || @mode == 2 ; Value (or Total) otv = tv elseif @colour == 1 || @colour == 6 ; Iteration ovi = vi elseif @colour == 2 ; Zmag ovz = vz elseif @colour == 3 || @colour == 4 ; Sum or Average omv = mv endif if @limiter == 1 ; #Iterations tested oi1 = i1 endif if @limiter == 2 || (@colour > 3 && @colour != 6) ; Trap count needed oi2 = i2 endif angold = ang ofbm = fbm otrapfbm = trapfbm ; Now check if trapping is enabled if i >= @fi && (i - @fi)%(@di + @si) < @di ; start iteration & iteration skip ; get the orbital change and angle ; ie. trap against old z, the "predictor" or the trap value if @version == 0 zd = z - zold + @trapoff elseif @version == 1 zd = z - (zold + (zold - zold1)) + @trapoff elseif @version == 2 zd = z - (zold + (zold - zold1) + (zold - zold1) - (zold1 - zold2)) + @trapoff elseif @version == 3 if zold1 == 0 zd = @trapoff else zd = z - zold*zold/zold1 + @trapoff endif elseif @version == 4 if zold1 == 0 zd = @trapoff else zd = z - zold2*(zold/zold1)^3 + @trapoff endif elseif @version == 5 if (zold1-zold2)==0 zd = @trapoff else zd = z - (zold*(zold-zold1)+zold1^2-zold*zold2)/(zold1-zold2) + @trapoff endif elseif @version == 6 if (zold1^@pp-zold2^@pp)==0 zd = @trapoff else zd = z - (zold^@pp*(zold-zold1)+zold1^(@pp+1)-zold*zold2^@pp)/(zold1^@pp-zold2^@pp) + @trapoff endif elseif @version == 7 if ((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3))==0 zd = @trapoff else zd = z - ((zold^@pp-zold3^@pp)*((zold1-zold2)*(zold1-zold3)-(zold-zold2)*(zold2-zold3)) \ +(zold-zold3)*((zold-zold2)*(zold2^@pp-zold3^@pp)-(zold1-zold2)*(zold1^@pp-zold3^@pp))) \ /((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3)) \ - zold2 + @trapoff endif elseif @version == 13 zd = z - zold1 + @trapoff elseif @version == 14 zd = z - zold2 + @trapoff elseif @version == 15 zd = z - zold3 + @trapoff elseif @version == 16 zd = z - zold^@zpower + @trapoff elseif @version == 17 if real(z) >= 0 zd = z - zold + 1 + @trapoff else z = z - zold - 1 + @trapoff endif elseif @version == 18 zd = z - ((zold^2-1)/(2*zold-2))^2 + @trapoff elseif @version == 19 zd = z - ((zold^3-3*zold+2)/(3*zold^2-6*zold+3))^2 + @trapoff elseif @version == 20 if @sillyerror zd = @pfn(zold) + @trapoff else zd = z - @pfn(zold) + @trapoff endif elseif @version > 7 zd = z - ft + @trapoff endif if @traprot != 0 zd = real(zd)*ct - imag(zd)*st + flip(real(zd)*st +imag(zd)*ct) endif if @fbmvalue==1 fbm0 = zd/(i+1) elseif @fbmvalue==2 fbm0 = zd/((i+1)^2) endif if @fbmscale fbm0=fbm0/cabs(z) endif ; Modify the angle as selected ang = atan2(zd) if ang < 0 && @angmod > 0 if @angmod == 1 ang = abs(ang) elseif @angmod == 2 ang = ang + #pi*2 endif endif ; Initially set the main value v to the required distance if @type == 1 || @type == 6 || @type == 9 ; real zd = real(zd) elseif @type == 2 || @type == 7 || @type == 10 ; imaginary zd = imag(zd) endif if @shape == 0 ; point v = cabs(zd) elseif @shape == 1 ; ring v = abs(cabs(zd) - @radius) elseif @shape == 2 ; ring 2 v = 0.25*abs(|zd| - radius) elseif @shape == 3 ; egg v = 0.25*(cabs(zd - flip(@radius*2)) + cabs(zd)*@order*0.5) elseif @shape == 4 ; hyperbola v = 0.5*abs(real(zd)*imag(zd) - @radius) elseif @shape == 5 ; cross v = abs(real(zd)) d = abs(imag(zd)) if d < v v = d endif elseif @shape == 6 ; astroid v = abs(real(zd))^@order + abs(imag(zd))^@order elseif @shape == 7 ; diamond v = abs(real(zd) + abs(imag(zd))) elseif @shape == 8 ; box v = abs(real(zd)) d = abs(imag(zd)) if d > v v = d endif v = abs(v - @radius) elseif @shape == 9 ; lines v = abs(abs(imag(zd)) - @radius) elseif @shape == 10 ; waves v = abs(abs(imag(zd) + sin(real(zd)*@freq)*@order*0.25) - @radius) elseif @shape == 11 ; mirrored waves v = abs(abs(imag(zd)) - @radius + sin(real(zd)*@freq)*@order*0.25) elseif @shape == 12 ; mirrored waves 2 d = @radius - sin(real(zd)*@freq)*@order*0.25 v = abs(abs(imag(zd)) - d) d = abs(abs(imag(zd)) + d) if d < v v = d endif elseif @shape == 13 ; radial waves v = abs(cabs(zd) * (1 - sin(atan2(zd)*@freq)*@order*0.125) - @radius) elseif @shape == 14 ; radial waves 2 d = sin(atan2(zd)*@freq)*@order*0.125 v = abs(cabs(zd) * (1 - d) - @radius) d = abs(cabs(zd) * (1 + d) - @radius) if d < v v = d endif elseif @shape == 15 ; ring ripples v = cabs(zd) if v < @order v = cos(v*radius*@freq)*sqr(1 - v/@order) else v = 0 endif elseif @shape == 16 ; grid ripples v = cabs(zd) if v < @order v = (cos(real(zd)*radius*@freq) + 0.5*cos(imag(zd)*radius*@freq))*sqr(1 - v/@order) else v = 0 endif elseif @shape == 17 ; radial ripples v = cabs(zd) if v < @order v = cos(4*atan2(zd)*@freq)*sqr(1 - v/@order) else v = 0 endif elseif @shape == 18 ; pinch v = atan2(zd) if v < 0 v = v + 2*#pi endif v = sqrt(cabs(zd))/abs(sin(v*@order*0.5)) elseif @shape == 19 ; spiral t = zd * (0,1)^(@radius/cabs(zd)) v = atan(abs(imag(t)/real(t))) elseif @shape == 20 ; heart t = rh*(real(zd) + flip(abs(imag(zd)))) v = abs(real(t) - sqr(imag(t)) + 3) endif ; Now apply scaling if enabled if @scale v = v/cabs(z) endif ; Use the angle for the types that require it if @type > 2 if @type == 3 ; just the angle v = real(fn2(ang)) elseif @type == 4 ; change in the angle v = real(fn2(abs(ang-angold))) elseif @type < 8 ; "vector" - ie. dist * angle v = abs(v*real(fn2(ang))) else ; "energy" - ie. dist change * angle change d = v ; NB. old distance value needed v = abs((v-vold)*real(fn2(abs(ang-angold)))) vold = d endif endif ; Now apply the overall function v = abs(real(fn1(v))) ; Now store the required value for the current mode. ; NB. on the first pass the max/min values are set irrespective. if @mode == 0 ; Minimum if (v < tv) && ((zold1 != 0) || (@version < 3) || (@version > 7)) \ && ((zold1-zold2!=0) || (@version != 5)) \ && ((zold1^@pp-zold2^@pp!=0) || (@version != 6)) \ && ((((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3))!=0) || (@version != 7)) if @fbmvalue>0 fbm = fbm0 trapfbm = false endif tv = v if @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 ; log(Zmag) vz = #z elseif @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif endif elseif @mode == 1 ; Maximum if (v > tv) && ((zold1 != 0) || (@version < 3) || (@version > 7)) \ && ((zold1-zold2!=0) || (@version != 5)) \ && ((zold1^@pp-zold2^@pp!=0) || (@version != 6)) \ && ((((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3))!=0) || (@version != 7)) if @fbmvalue>0 fbm = fbm0 trapfbm=false endif tv = v if @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 ; log(Zmag) vz = #z elseif @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif endif elseif @mode == 2 ; Trapping all (Total) if @fbmvalue>0 fbm = fbm + fbm0 trapfbm = false endif tv = tv + v if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif elseif @mode == 3 || @mode == 5 || @mode == 8 ; Above if (v > @threshold) && ((zold1 != 0) || (@version < 3) || (@version > 7)) \ && ((zold1-zold2!=0) || (@version != 5)) \ && ((zold1^@pp-zold2^@pp!=0) || (@version != 6)) \ && ((((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3))!=0) || (@version != 7)) if @mode == 3 || @mode == 5 if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif if @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif endif if @mode == 3 ; First if notyet if @fbmvalue>0 fbm = fbm0 trapfbm = false endif if @colour == 0 ; Value tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 ; log(Zmag) vz = #z endif notyet = false endif elseif @mode == 5 ; Last if @fbmvalue>0 fbm = fbm0 trapfbm = false endif if @colour == 0 ; Value tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 ; log(Zmag) vz = #z endif notyet = false elseif @mode == 8 if (v - @threshold) < mn if @fbmvalue>0 fbm = fbm0 trapfbm = false endif mn = v - @threshold if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif if @colour == 0 tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 vz = #z elseif @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif notyet = false endif endif endif elseif @mode == 4 || @mode == 6 || @mode == 7 ; Below if (v < @threshold) && ((zold1 != 0) || (@version < 3) || (@version > 7)) \ && ((zold1-zold2!=0) || (@version != 5)) \ && ((zold1^@pp-zold2^@pp!=0) || (@version != 6)) \ && ((((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3))!=0) || (@version != 7)) if @mode == 4 || @mode == 6 if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif if @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif endif if @mode == 4 ; First if notyet if @fbmvalue>0 fbm = fbm0 trapfbm = false endif if @colour == 0 ; Value tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 ; log(Zmag) vz = #z endif notyet = false endif elseif @mode == 6 ; Last if @fbmvalue>0 fbm = fbm0 trapfbm = false endif if @colour == 0 ; Value tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 ; log(Zmag) vz = #z endif notyet = false elseif @mode == 7 if (@threshold - v) < mn if @fbmvalue>0 fbm = fbm0 trapfbm = false endif mn = @threshold - v if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif if @colour == 0 tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 vz = #z elseif @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif notyet = false endif endif endif elseif @mode == 9 ; Nearest if (abs(v - @threshold) < mn) && ((zold1 != 0) || (@version < 3) || (@version > 7)) \ && ((zold1-zold2!=0) || (@version != 5)) \ && ((zold1^@pp-zold2^@pp!=0) || (@version != 6)) \ && ((((zold2^@pp-zold3^@pp)*(zold1-zold3)-(zold1^@pp-zold3^@pp)*(zold2-zold3))!=0) || (@version != 7)) if @fbmvalue>0 fbm = fbm0 trapfbm = false endif mn = abs(v - @threshold) if @limiter == 2 || (@colour > 3 && @colour != 6) ; need trap count i2 = i2 + 1 endif if @colour == 0 tv = v elseif @colour == 1 || @colour == 6 ; Iteration vi = i + 1 elseif @colour == 2 vz = #z elseif @colour == 3 || @colour == 4 ; Sum or Average mv = mv + v endif notyet = false endif endif if @fbmvalue>0 && @fbmtotal fbm = fbm + fbm0 trapfbm = false endif ; increment counter if @limiter == 1 i1 = i1 + 1 endif endif ; start iteration & iteration skip ; store old values and increment the counter zold3 = zold2 zold2 = zold1 zold1 = zold zold = z i = i + 1 final: if @limiter == 0 oi1 = i - 1 elseif @limiter == 1 i = i1 else i = i2 oi1 = oi2 endif if @colour == 1 ; Iteration if @mode == 2 ; Total tv = i/#maxiter otv = oi1/#maxiter else tv = vi/#maxiter otv = ovi/#maxiter endif elseif @colour == 2 ; log(Zmag) if @mode == 2 ; Total tv = log(log(|fn3(#z)|)/2) ; This is basically unchanged for otv = log(log(|zold|)/2) ; compatability with earlier versions else tv = log(#e + cabs(vz)) - 1 ; ensure positive log otv = log(#e + cabs(ovz)) - 1 ; starting from zero endif elseif @colour == 5 ; Trap count tv = i2/#maxiter otv = oi2/#maxiter elseif @colour == 6 ; Fix Iteration if @mode == 2 ; Total tv = i/400 otv = oi1/400 else tv = vi/400 otv = ovi/400 endif elseif @colour == 7 ; Fix Trap count tv = i2/400 otv = oi2/400 elseif @mode != 2 if @colour == 3 ; Sum tv = mv otv = omv elseif @colour == 4 ; Average tv = mv/i2 otv = omv/oi2 endif endif if @smooth || @finalz || (@useconv && |#z-zprev|<0.5) \ || (@finalzconv && |#z|<=@bailout) ; use smoothing fraction if @diviter tv = tv/i ; diviter on (converts Total to average) if @useconv && |#z-zprev|<0.5 && (!@finalzconv) if @fixedconv if @cauto if @usecfudge index = tv + fdg*(tv - otv/oi1)*(clp - log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|zprev-@fixedval|)) else index = tv + (tv - otv/oi1)*(v*clp - v*log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|zprev-@fixedval|)) endif else index = tv + fdg*(tv - otv/oi1)*(clp - cil*log(-0.5*log(|#z-@fixedval|))) endif elseif @cauto if @usecfudge index = tv + fdg*(tv - otv/oi1)*(clp - log(-0.5*log(|#z-zprev|))) \ /log(log(|#z-zprev|)/log(|zprev-zprev1|)) else index = tv + (tv - otv/oi1)*(clp - log(-0.5*log(|#z-zprev|))) \ /log(log(|#z-zprev|)/log(|zprev-zprev1|)) endif else index = tv + fdg*(tv - otv/oi1)*(clp - cil*log(-0.5*log(|#z-zprev|))) endif elseif @finalz || (@finalzconv && |#z|<=@bailout && real(#z)<0) if @finalzconv && |#z|<=@bailout && real(#z)<0 vz = 1+fdg*real(#z)+flip(imag(#z)) else vz = #z endif otv = otv/oi1 index = abs(real(@fn5(otv + (tv - otv)*vz))) elseif @dauto index = tv + (tv - otv/oi1)*(lp - log(0.5*log(|#z|))) \ /log(log(|#z|)/log(|zprev|)) else index = tv + (tv - otv/oi1)*(lp - il*log(0.5*log(|#z|))) endif elseif @useconv && |#z-zprev|<0.5 && (!@finalzconv) if @fixedconv if @cauto if @usecfudge index = abs(tv + fdg*(tv - otv)*(clp - log(-0.5*log(|#z-@fixedval|)))) \ /log(log(|#z-@fixedval|)/log(|zprev-@fixedval|)) else index = abs(tv + (tv - otv)*(clp - log(-0.5*log(|#z-@fixedval|)))) \ /log(log(|#z-@fixedval|)/log(|zprev-@fixedval|)) endif else index = abs(tv + fdg*(tv - otv)*(clp - cil*log(-0.5*log(|#z-@fixedval|)))) endif elseif @cauto if @usecfudge index = abs(tv + fdg*(tv - otv)*(clp - log(-0.5*log(|#z-zprev|)))) \ /log(log(|#z-zprev|)/log(|zprev-zprev1|)) else index = abs(tv + (tv - otv)*(clp - log(-0.5*log(|#z-zprev|)))) \ /log(log(|#z-zprev|)/log(|zprev-zprev1|)) endif else index = abs(tv + fdg*(tv - otv)*(clp - cil*log(-0.5*log(|#z-zprev|)))) endif elseif @finalz || (@finalzconv && |#z|<=@bailout && real(#z)<0) if @finalzconv && |#z|<=@bailout && real(#z)<0 vz = 1+fdg*real(#z)+flip(imag(#z)) else vz = #z endif index = abs(real(@fn5(otv + (tv - otv)*vz))) elseif @dauto v = 1/log(log(|#z|)/log(|zprev|)) index = abs(tv + (tv - otv)*(v*lp - v*log(0.5*log(|#z|)))) else index = abs(tv + (tv - otv)*(lp - il*log(0.5*log(|#z|)))) endif elseif @diviter index = tv/i ; diviter on (converts Total to average) else index = tv endif if @extra==1 index = log(1+abs(index)) elseif @extra==2 index = abs(sin(index)) elseif @extra==3 index = abs(cos(index)) elseif @extra==4 index = abs(tan(index)) elseif @extra==5 index = abs(atan(index)) elseif @extra==6 index = 1/index endif if @usefinalz>0 && @useconv && (|#z-zprev|<0.5) if @usefinalz==1 index = (1-@zscale)*index+@zscale*abs(real(2*#pi+atan2(#z))) elseif @usefinalz==2 index = (1-@zscale)*index+@zscale*real(#z) elseif @usefinalz==3 index = (1-@zscale)*index+@zscale*imag(#z) elseif @usefinalz==4 index = (1-@zscale)*index+@zscale*(real(#z)+imag(#z)) elseif @usefinalz==5 index = (1-@zscale)*index+@zscale*|#z| elseif @usefinalz==6 index = (1-@zscale)*index+@zscale*abs(real(#z)) elseif @usefinalz==7 index = (1-@zscale)*index+@zscale*abs(imag(#z)) elseif @usefinalz==8 index = (1-@zscale)*index+@zscale*abs(real(#z)+imag(#z)) endif endif if @mode > 2 ; Above or Below or Nearest if notyet ; if threshold not passed if @filltype == 0 index = @threshold elseif @filltype == 1 usesolid = true else index = @filler/400.0 endif endif endif if (!usesolid) && (!@areatime) maskval = index ; maskval used for future upgrades if @maskarea == 1 if maskval < @masklo usesolid = true endif elseif @maskarea == 2 if maskval >= @maskhi usesolid = true endif elseif @maskarea == 3 if maskval >= @masklo && maskval < @maskhi usesolid = true endif elseif @maskarea == 4 if maskval < @masklo || maskval >= @maskhi usesolid = true endif endif endif if (!usesolid) && (!@repttime) maskval = index ; maskval used for future upgrades if @rptmask > 0 i = round((@rmaskoff + maskval)*51200) % maskh if @rptmask == 1 if i < maskl usesolid = true endif elseif @rptmask == 2 if i >= maskl #solid = true endif endif endif endif if @fbmvalue>0 && @fbmstrength>0 && (!usesolid) && (!trapfbm) i=1 if (@smooth || @finalz || (@useconv && (|#z-zprev|<0.5)) \ || (@finalzconv && |#z|<=@bailout)) && (!otrapfbm) i=2 endif while i>0 lvl=0 off=0 f=fbmc if (|#z-zprev|<0.5 || (@finalzconv && |#z|<=@bailout && real(#z)<0)) f=f*@rsc endif fbmv=0 while lvl<@levels ; Scale z by the frequency if i==2 z=ofbm*f else z=fbm*f endif ; Rotate x=real(z)*fbmq[lvl,2]-imag(z)*fbmq[lvl,3] y=imag(z)*fbmq[lvl,2]+real(z)*fbmq[lvl,3] ; Scale x+y and x-y xpy=(x+y)*fbmq[lvl,0] xmy=(x-y)*fbmq[lvl,1] ; Convert to (float) indexes x=(x+off)%262144 y=(y+off+4096.0)%262144 xpy=(xpy+off+8192.0)%262144 xmy=(xmy+off+12288.0)%262144 ; Convert to indexes ix=floor(x) iy=floor(y) ixpy=floor(xpy) ixmy=floor(xmy) ; Convert x, y, xpy and xmy to fractions x=x-ix y=y-iy xpy=xpy-ixpy xmy=xmy-ixmy ; Linear or cubic interpolation if @inter==0 ; Remember the indexes could be - if ix<0 ix=262144+ix endif if iy<0 iy=262144+iy endif if ixpy<0 ixpy=262144+ixpy endif if ixmy<0 ixmy=262144+ixmy endif ; Linear interpolation fbmv=fbmv + (fbmh[ix]+(fbmh[ix+1]-fbmh[ix])*x \ + fbmh[iy]+(fbmh[iy+1]-fbmh[iy])*y \ + fbmh[ixpy]+(fbmh[ixpy+1]-fbmh[ixpy])*xpy \ + fbmh[ixmy]+(fbmh[ixmy+1]-fbmh[ixmy])*xmy) \ *fbmq[lvl,4] else ; Note using n-1 as we require the height at index-1 for cubic ; interpolation. ix=ix-1 while ix<0 ix=262144+ix endwhile iy=iy-1 while iy<0 iy=262144+iy endwhile ixpy=ixpy-1 while ixpy<0 ixpy=262144+ixpy endwhile ixmy=ixmy-1 while ixmy<0 ixmy=262144+ixmy endwhile ; Cubic interpolation h0=fbmh[ix] h1=fbmh[ix+1] h2=fbmh[ix+2] h3=fbmh[ix+3] fbmt=(h3-h2+h1-h0)*x^3+(2*(h0-h1)+h2-h3)*x^2 \ +(h2-h0)*x+h1 h0=fbmh[iy] h1=fbmh[iy+1] h2=fbmh[iy+2] h3=fbmh[iy+3] fbmt=fbmt+(h3-h2+h1-h0)*y^3+(2*(h0-h1)+h2-h3)*y^2 \ +(h2-h0)*y+h1 h0=fbmh[ixpy] h1=fbmh[ixpy+1] h2=fbmh[ixpy+2] h3=fbmh[ixpy+3] fbmt=fbmt+(h3-h2+h1-h0)*xpy^3+(2*(h0-h1)+h2-h3)*xpy^2 \ +(h2-h0)*xpy+h1 h0=fbmh[ixmy] h1=fbmh[ixmy+1] h2=fbmh[ixmy+2] h3=fbmh[ixmy+3] fbmt=fbmt+(h3-h2+h1-h0)*xmy^3+(2*(h0-h1)+h2-h3)*xmy^2 \ +(h2-h0)*xmy+h1 fbmv=fbmv+fbmt*fbmq[lvl,4] endif off=off+16384.0 f=f*@freqscale lvl=lvl+1 endwhile if i==2 fbmv1=fbmv endif i=i-1 endwhile if @useconv && (|#z-zprev|<0.5) && (!@finalzconv) if @fixedconv if @cauto v = fdg*(fbmv - fbmv1)*(clp - log(-0.5*log(|#z-@fixedval|))) \ /log(log(|#z-@fixedval|)/log(|zprev-@fixedval|)) fbmv = @amp*(fbmv + v - 0.5)+0.5 else fbmv = @amp*(fbmv+fdg*(fbmv-fbmv1)*(clp-cil*log(-0.5*log(|#z-@fixedval|)))-0.5)+0.5 endif elseif @cauto v = fdg*(fbmv - fbmv1)*(clp - log(-0.5*log(|#z-zprev|))) \ /log(log(|#z-zprev|)/log(|zprev-zprev1|)) fbmv = @amp*(fbmv + v - 0.5)+0.5 else fbmv = @amp*(fbmv+fdg*(fbmv-fbmv1)*(clp-cil*log(-0.5*log(|#z-zprev|)))-0.5)+0.5 endif elseif @finalz || (@finalzconv && |#z|<=@bailout) if @finalzconv && |#z|<=@bailout && real(#z)<0 vz = 1+fdg*real(#z) else vz = #z endif fbmv = @amp*(fbmv1+(fbmv-fbmv1)*real(vz)-0.5)+0.5 elseif @smooth if @dauto v = 1/log(log(|#z|)/log(|zprev|)) fbmv = @amp*(fbmv+(fbmv-fbmv1) \ *(lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|zprev|))-0.5)+0.5 else fbmv = @amp*(fbmv+(fbmv-fbmv1)*(lp-il*log(0.5*log(|#z|)))-0.5)+0.5 endif else fbmv = @amp*(fbmv-0.5)+0.5 endif index = @fbmstrength*fbmv + (1.0-@fbmstrength)*index endif ;@fbm if !usesolid && @areatime maskval = index ; maskval used for future upgrades if @maskarea == 1 if maskval < @masklo usesolid = true endif elseif @maskarea == 2 if maskval >= @maskhi usesolid = true endif elseif @maskarea == 3 if maskval >= @masklo && maskval < @maskhi usesolid = true endif elseif @maskarea == 4 if maskval < @masklo || maskval >= @maskhi usesolid = true endif endif endif if !usesolid && @repttime maskval = index ; maskval used for future upgrades if @rptmask > 0 i = round((@rmaskoff + maskval)*51200) % maskh if @rptmask == 1 if i < maskl usesolid = true endif elseif @rptmask == 2 if i >= maskl #solid = true endif endif endif endif if usesolid #solid = true else #index = index endif default: title = "MMF3 Orbitals+" heading caption = "fBm settings" endheading param hidefbm caption = "Hide fBm settings" default = false endparam param fbmvalue caption = "fBm method" enum = "Off" "Diviter" "Diviter squared" default = 2 hint = "You can initialise the fBm with the trapped value divided by \ the iteration count, or divided by the iteration count squared." visible = (!@hidefbm) endparam param fbmstrength caption = "fBm strength" default = 0.5 min = 0.0 max = 1.0 hint = "Sets the strength of the fBm. A value of zero \ disables fBm completely, a value of 1 uses fBm only." visible = (!@hidefbm) && @fbmvalue>0 endparam param fbmscale caption = "Scale fbm distance" default = false hint = "When enabled scales the fbm additive values by 1/cabs(z)." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param fbmtotal caption = "Force total fBm" default = false hint = "Normally the final fBm seed used is based on the current 'Mode' \ in 'Main settings' but you can force the fBm to act as if the mode \ selected is 'Total' as I found this produces the best results - \ note that in modes other than 'Total' the fBm may not follow the \ colouring quite as well when you enable 'Force total fBm'." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param fbmmode caption = "Method" enum = "Normal" "Div 2" "Div 4" "Div 8" "Div 16" default = 0 visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param average caption = "Averaging" enum = "Normal" "Cubic" default = 0 hint = "Using Cubic is a bit slower but tends to produce \ slightly smoother results." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param seed caption = "Seed" default = 123456 hint = "The seed for the random, change for different patterns." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param inter caption = "Interpolation" enum = "Linear" "Cubic" default = 0 hint = "Cubic is probably just overkill only really needed \ when at high magnification." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param frac caption = "Sharpness" default = 0.5 min = 1e-5 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results, if the value is >=1 then \ that fBm will effectively be completely random." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param rs caption = "Frequency" default = 1.0 min = 1e-5 hint = "Controls the scale of the patterns." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param rsc caption = "Convergent Frequency" default = 1.0 min = 1e-5 hint = "Further controls the scale of the patterns in convergent areas." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param amp caption = "Amplitude" default = 2.8 min = 1e-5 hint = "Scales the max strength of the fBm." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param dice caption = "#Dice to use" default = 1.0 min = 1.0 max = 64.0 hint = "Changing the number of dice used will affect the \ character of the fBm." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param dummy caption = "#Dice to roll" default = 0 min = 0 max = 64 hint = "Anything greater than #Dice to use forces the \ total dice rolled whether they are all used or \ not. This means gradual changes to #Dice to use \ will produce gradual changes in the fBm provided \ #Dice to use stays <= #Dice to roll." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param exp caption = "Exponent" default = 1.0 hint = "Changes the nature of the fBm. With values >1.0 you \ may need to reduce the Amplitude to avoid \ areas of solid colour." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param levels caption = "Number of levels" default = 8 min = 1 max = 16 hint = "The number of levels of fBm to mix." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param freqscale caption = "Frequency change" default = 1.0 min = 1.0 hint = "Scales the frequency used from \ one level of fBm to the next eg. if you set the \ value to 2 then level 2 will be 2* the frequency \ of level 1, level 3 will be 4* the frequency of \ level 1 etc. Range >1" visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam param ampscale caption = "Amplitude change" default = 1.0 min = 1e-5 max = 1.0 hint = "Scales the amplitude used from one level of fBm \ to the next eg. if you set the value to 0.5 then \ level 2 will be half the volume of level 1, level \ 3 will be a quarter the volume of level 1 etc. \ Range 1e-5 to 1." visible = (!@hidefbm) && @fbmvalue>0 && @fbmstrength>0 endparam heading caption = "Main settings" endheading param hidemain caption = "Hide main settings" default = false endparam param version caption = "Version" default = 0 enum = "Original (Z-Zold)" "Predictor1" "Predictor2" "Predictor3" \ "Predictor4" "Predictor5" "Poly Predictor 1" "Poly predictor 2" \ "Orbit 1" "Orbit 2" "Orbit 3" "Orbit 4" "Orbit 5" \ "(Z-Zold1)" "(Z-Zold2)" "(Z-Zold3)" "(Z-Zold^power)" \ "For Barnsley 1" "For Magnet 1" "For Magnet 2" "Z-fn(Zold)" hint = "Original traps to Zold, Predictor1 to Predictor5 trap to various \ predictions involving older values of z. The Poly predictors trap to \ a value based on the formula being a polynomial. The Orbit types allow \ you to trap to a calculated trap value similar to standard orbit traps. \ You may also trap to older values of z or predicted values based on the \ constant beng zero." visible = (!@hidemain) endparam param zpower caption = "Zold power" default = (2,0) hint = "Only used in version '(Z-Zold^power)'." visible = (!@hidemain) && @version==16 endparam func pfn caption = "Zold function" default = sin() hint = "Only used in version 'Z-fn(Zold)'." visible = (!@hidemain) && @version==20 endfunc param sillyerror caption = "Silly error" default = false hint = "Just a quick fix for 1 UPR when I was testing !" visible = false endparam param type caption = "Type" default = 0 enum = "Complex" "Real" "Imag" "Angle" "Angle Change" \ "Comp Vector" "Real Vector" "Imag Vector" \ "Comp Energy" "Real Energy" "Imag Energy" hint = "The 'vector' and 'energy' modes are a combination \ of the distance value and the changes in angle. They \ have no real mathematical significance, they're \ just visually interesting combinations." visible = (!@hidemain) endparam param mode caption = "Mode" default = 2 enum = "Minimum" "Maximum" "Total" "First Above" "First Below" \ "Last Above" "Last Below" "Nearest Below" "Nearest Above" \ "Nearest" hint = "Use to select the trapping method, use 'Total' to trap all. \ Modify the 'Threshold' for First/Last/Nearest Above/Below." visible = (!@hidemain) endparam param threshold caption = "Threshold" default = 1.5 min = 0.0 hint = "Threshold value for First/Last/Nearest Above/Below modes. \ NB. Values around 1.0 can produce effects that \ are a result of the limited accuracy of the FPU \ (or at least that appears to be the case)." visible = (!@hidemain) && @mode>2 endparam param colour caption = "Colour by" default = 0 enum = "Value" "Iteration" "log(Zmag)" "Sum" "Average" "Trap count" \ "'Fix' Iteration" "'Fix' Trap count" hint = "When using 'Total' mode only colour by 'Value' makes sense. \ When using 'Iteration' 'Average' or 'Trap Count' it's better \ to disable 'Diviter'. For 'Sum', 'Average' and 'Trap count' \ using a 'First' mode is the same as the equivalent 'Last' mode." visible = (!@hidemain) endparam param filltype caption = "Fill Method" default = 0 enum = "Threshold" "Solid" "Gradient Value" hint = "Fill colouring for when the Threshold test is not \ fulfilled ie. applies to First/Last Above/Below." visible = (!@hidemain) endparam param filler caption = "Gradient Value" default = 0 min = 0 max = 399 hint = "Sets the gradient colour number for Fill Method \ 'Gradient Value' ie. 0 to 399." visible = (!@hidemain) && @filltype==2 endparam heading caption = "Modifiers" endheading param hidemod caption = "Hide modifiers" default = false endparam param pp caption = "Predictor power" default = (2,0) hint = "For the poly predictors only. If using a main formula \ of the form m*Z^n+c then \ poly predictor 1 with a predictor power of n will \ result in no colouring - the same applies to a main formula of \ the form m*Z^n+b*Z+c for poly predictor 2." visible = (!@hidemod) && (@version==6 || @version==7) endparam param scale caption = "Scale distance" default = true hint = "Divides the distance values by cabs(z) when \ enabled, disabling may produce some banding \ with results similar to types of cilia colouring. \ Doesn't affect the Angle or Angle Change types." visible = (!@hidemod) endparam param diviter caption = "Diviter" default = true hint = "If enabled then the final values used are divided by \ the selected count, hence converting the values produced \ by mode 'Total' into average values. It's better to disable \ it when using colour by 'Iteration', 'Average' or 'Trap count'." visible = (!@hidemod) endparam param limiter caption = "Value for 'Diviter'" default = 0 enum = "Full #Iterations" "#Iterations to trap" "Trap count" hint = "Provides alternative values of 'Diviter' for when \ skipping iterations or using conditional trapping." visible = (!@hidemod) && @diviter endparam param fi caption = "Start Iteration" default = 0 min = 0 hint = "Iteration from which to begin trapping, use 0 \ to start on the first, 1 for the second etc." visible = (!@hidemod) endparam param di caption = "Iterations to trap" default = 100 min = 1 hint = "Number of iterations to trap, note that if \ 'Iterations to skip' is set to zero then this \ value is irrelevant as all iterations from the \ 'Start Iteration' will be trapped." visible = (!@hidemod) endparam param si caption = "Iterations to skip" default = 0 min = 0 hint = "Number of iterations to skip, if set to \ zero then all iterations from the 'Start \ Iteration' will be trapped." visible = (!@hidemod) endparam param angmod caption = "Angle modifier" default = 0 enum = "As is" "Absolute" "All angles" hint = "Sometimes two or all of these will produce the \ same result but which depends on other settings. \ Doesn't apply to the Complex, Real or Imag types." visible = (!@hidemod) endparam param traprot caption = "Trap rotation" default = 0.0 hint = "Rotates the value to trap, the effect varies considerably depending \ on other settings." visible = (!@hidemod) endparam param trapoff caption = "Trap offset" default = (0,0) hint = "Offsets the value to trap, the effect varies considerably depending \ on other settings." visible = (!@hidemod) endparam func fn1 caption = "Overall Function" default = ident() hint = "Try the trig and hyper functions. \ Please note that some of UF's inbuilt functions \ only really apply to complex numbers and this \ function is used on a real number so not all \ settings are applicable." visible = (!@hidemod) endfunc func fn2 caption = "Angle Function" default = ident() hint = "Applied to the angle values, isn't used \ for the Complex, Real or Imag types. \ Try the trig and hyper functions. \ Please note that some of UF's inbuilt functions \ only really apply to complex numbers and this \ function is used on a real number so not all \ settings are applicable." visible = (!@hidemod) endfunc func fn3 caption = "Funky Function" default = ident() hint = "This function is applied to the value of Z to use for \ the trapping in all cases, however colour by 'log(Zmag)' \ uses the unadulterated #z for the Zmag value itself \ except when using type 'Total'." visible = (!@hidemod) endfunc param extra caption = "Extra Function" enum = "None" "log" "sin" "cos" "tan" "atan" "recip" default = 0 hint = "This function is applied to the final index value before \ the addition of z basins, masking or fBm, it's really meant \ for you to use 'log' in cases where you get large variations \ in colouring density but the other settings may be interesting." visible = (!@hidemod) endparam param finalz caption = "Finalz (Hinrich) smoothing" default = false hint = "Use this with a main formula that can pass a smoothing \ fraction as the final z value. \ This includes MMF - Transformation, MMF - Formula Wars, \ MMFS - Mixer and MMF3 formulas." visible = (!@hidemod) endparam param finalzconv caption = "Finalz (Hinrich) convergent" default = false hint = "Use this with a main formula that can pass a convergent \ smoothing fraction as the final z value. \ This includes MMF - Transformation, MMF - Formula Wars, \ MMFS - Mixer and MMF3 formulas." visible = (!@hidemod) endparam func fn5 caption = "Final z smooth fn" default = ident() hint = "This function is applied to the complex value calculated \ when using the final z smoothing. It's probably best to \ ignore it when creating new images." visible = (!@hidemod) && @finalz endfunc param smooth caption = "Smoothing" default = true hint = "Enable this if you get iteration breaks. \ Note that 'Finalz (Hinrich) smoothing' takes priority." visible = (!@hidemod) && (!@finalz) endparam param useconv caption = "Convergent smoothing" default = false hint = "Use to remove iteration breaks in convergent areas. \ Note that 'Finalz (Hinrich) convergent' takes priority." visible = (!@hidemod) && (!@finalzconv) endparam param usefinalz caption = "Add z basins" enum = "No" "+Atan" "+real" "+imag" "+real+imag" "+|z|" \ "+abs(real)" "+abs(imag)" "+abs(real+imag)" hint = "When enabled modifies the index value (before masking \ or fBm) based on the final z value. \ Works for convergent areas only." visible = (!@hidemod) && @useconv endparam param zscale caption = "z basin Scale" default = 0.3 min = 0 max = 1.0 hint = "Scales how much the final z value affects the index \ when 'Add z basins' is applied." visible = (!@hidemod) && @useconv && @usefinalz>0 endparam heading caption = "Standard smoothing values" visible = (!@hidemod) && ((@smooth && (!@finalz)) || (@useconv && (!@finalzconv))) endheading param dauto caption = "Auto-power" default = false hint = "Enabling this should produce smoothing without you having \ to set a power parameter provided the bailout parameter \ is correct - it even works on formulas using trigonometrics, \ hyperbolics, transcendentals and others such as the Barnsleys." visible = (!@hidemod) && @smooth && (!@finalz) endparam param power caption = "Power" default = (2,0) hint = "This should match the exponent of your formula. \ For Magnet 1 use '1.8', for Magnet 2 use '1.6'. \ NB. This refers to using the Magnet formula options \ in the main formula MMF-Transformation." visible = (!@hidemod) && @smooth && (!@finalz) && (!@dauto) endparam param bailout caption = "Bailout" default = 65536.0 hint = "This should match the bailout for your formula." visible = (!@hidemod) && @smooth && (!@finalz) endparam param cauto caption = "Auto-power (convergent)" default = false hint = "Enabling this should produce smoothing without you having \ to set a power parameter provided the small bailout parameter \ is correct - it even works on formulas using convergent (inverse) \ trigonometrics, (inverse) hyperbolics and transcendentals." visible = (!@hidemod) && (@useconv && (!@finalzconv)) endparam param cpower caption = "Power (convergent)" default = (2,0) hint = "For most formulas this is (2,0). In some cases changing \ the value will help remove iteration banding, especially \ when the banding visibility varies depending on the final \ iteration count on bailout." visible = (!@hidemod) && (@useconv && (!@finalzconv)) && (!@cauto) endparam param smallbail caption = "Small bailout" default = 1e-5 hint = "This should match the convergent bailout for your formula." visible = (!@hidemod) && (@useconv && !@finalzconv) endparam param fixedconv caption = "Absolute convergence" default = false hint = "For when using a main formula that tests for convergence by \ using (only) |#z-value| rather than |#z-zold|, a typical example \ would be a Magnet formula where |#z-1.0| is often used. When \ enabled set the value of 'Convergence root' appropriately." visible = (!@hidemod) && (@useconv && !@finalzconv) endparam param fixedval caption = "Convergence root" default = (1,0) hint = "Use (1.0,0) for some Magnet formulas." visible = (!@hidemod) && (@useconv && !@finalzconv) && @fixedconv endparam param cpreset caption = "Convergent presets" enum = "Off" "Newton" "Nova" "Magnet 1" "Magnet 2" "HalleyNova" default = 0 hint = "Quick presets for some convergent formulae, the preset for \ HalleyNova is set for with 'diviter' disabled and will \ need setting manually otherwise. \ The fudge values used in these are designed for when the \ convergent power is (2,0). NB. The Magnet settings are for \ the Magnet options in the main formula MMF-Transformation." visible = (!@hidemod) && (@useconv && !@finalzconv) && !@cauto endparam param usecfudge caption = "Use Convergent fudge" default = false hint = "Turns on use of the convergent fudge when using 'Auto-power'." visible = (!@hidemod) && @useconv && !@finalzconv && @cauto endparam param fudge caption = "Convergent fudge" default = 1.0 hint = "This is a fudge value for convergent smoothing. \ It scales the strength of the fractional values, \ adjust it to remove iteration banding." visible = (!@hidemod) && ((@useconv && ((@cpreset==0 && !@cauto) || (@cauto && @usecfudge))) \ || @finalzconv) endparam heading caption = "Standard orbit trap values" visible = @version>7 && @version<13 endheading param hideorbit caption = "Hide orbit values" default = false visible = @version>7 && @version<13 endparam param fix caption = "Orbit value" default = (0,0) hint = "This is the (start) value of the trap for the Orbit Versions. \ In version Orbit 2 this value is multiplied by #pixel. \ (Equivalent to scaling a standard Julia)" visible = (!@hideorbit) && @version>7 && @version<13 endparam param fixo caption = "Orbit offset" default = (0,0) hint = "This is the offset applied to the Orbit trap value on each iteration in \ the Orbit Versions. In version Orbit 3 this value is multiplied by \ #pixel. (Equivalent to scaling a standard Mandelbrot)" visible = (!@hideorbit) && @version>7 && @version<13 endparam param fixs caption = "Orbit scale" default = (1,0) hint = "This is the scale applied to the Orbit trap value on each iteration in \ the Orbit Versions. In version Orbit 4 this value is multiplied by \ #pixel. (Equivalent to scaling a Lambda Mandelbrot ie. s in s*z^n + c)" visible = (!@hideorbit) && @version>7 && @version<13 endparam param fixp caption = "Orbit power" default = (1,0) hint = "This is the power applied to the Orbit trap value on each iteration in \ the Orbit Versions. In version Orbit 5 this value is multiplied by \ #pixel. (Equivalent to scaling a power Mandelbrot)" visible = (!@hideorbit) && @version>7 && @version<13 endparam param obailout caption = "Orbit bailout" default = 65536.0 hint = "Bailout value for the moving trap." visible = (!@hideorbit) && @version>7 && @version<13 endparam func fn4 caption = "Orbit trap function" default = ident() hint = "This function is applied to the Orbit trap value each \ iteration when using the Orbit Versions of the formula." visible = (!@hideorbit) && @version>7 && @version<13 endfunc heading caption = "Trap shape modifiers" endheading param hideshape caption = "Hide shape modifiers" default = false endparam param shape caption = "Shape" default = 0 enum = "Point" "Ring" "Ring 2" "Egg" "Hyperbola" "Cross" "Astroid" \ "Diamond" "Box" "Lines" "Waves" "Mirrored Waves" "Mirrored Waves 2" \ "Radial Waves" "Radial Waves 2" "Ring Ripples" "Grid Ripples" \ "Radial Ripples" "Pinch" "Spiral" "Heart" hint = "The shapes do not apply to the 'Angle' or 'Angle Change' types." visible = !@hideshape endparam param radius caption = "Shape Radius" default = 1.0 hint = "This essentially controls the size of the shapes, applies \ to all the shapes except Point, Cross, Diamond and Pinch." visible = !@hideshape endparam param order caption = "Shape Order" default = 4.0 min = 0.0 hint = "Applies to Egg, Astroid, Waves, Ripples and Pinch. \ Controls the 'egginess', the astroid exponent (try 0.6667), \ the height of waves/ripples and the number of leaves for pinch." visible = !@hideshape endparam param freq caption = "Shape Frequency" default = 1.0 min = 0.0 hint = "Controls the frequency of ripples and waves." visible = !@hideshape endparam heading caption = "Masking values" endheading param hidemask caption = "Hide masking values" default = false endparam ; param maskval ; caption = "Value for masking" ; default = 0 ; enum = "Index" ; hint = "For changing the value used to control masking, applies \ ; to both the Mask Area and the Repeating Mask." ; endparam param maskarea caption = "Mask Area" default = 0 enum = "None" "Below" "Above" "Between" "Outside" hint = "Can be used in combination with the Repeating Mask." visible = !@hidemask endparam param areatime caption = "Mask area after fBm" default = false hint = "Allows you to choose to apply the mask to the index \ value before or after fBm has been added. If you mask \ after the fBm then the mask will have wobbly edges." visible = (!@hidemask) && @maskarea>0 && @fbmvalue>0 && @fbmstrength>0 endparam param masklo caption = "Lower mask value" default = 1.0 hint = "This should be less than 'Upper mask value'." visible = (!@hidemask) && @maskarea>0 endparam param maskhi caption = "Upper mask value" default = 1.5 hint = "This should be more than 'Lower mask value'." visible = (!@hidemask) && @maskarea>0 endparam param rptmask caption = "Repeating Mask" default = 0 enum = "None" "Lower sections" "Upper sections" hint = "Try small values for mask 'texturing'. You can \ use this in combination with the Mask Area." visible = !@hidemask endparam param repttime caption = "Repeat mask after fBm" default = false hint = "Allows you to choose to apply the mask to the index \ value before or after fBm has been added. If you mask \ after the fBm then the mask will have wobbly edges." visible = (!@hidemask) && @rptmask>0 && @fbmvalue>0 && @fbmstrength>0 endparam param rmasklo caption = "Lower Mask Rpt" default = 0.1 hint = "This should be less than 'Upper Mask Rpt'." visible = (!@hidemask) && @rptmask>0 endparam param rmaskhi caption = "Upper Mask Rpt" default = 0.2 hint = "This should be more than 'Lower Mask Rpt'." visible = (!@hidemask) && @rptmask>0 endparam param rmaskoff caption = "Repeat Mask Offset" default = 0.0 hint = "This allows you to adjust the position of the \ repeating mask." visible = (!@hidemask) && @rptmask>0 endparam } MMF3b-AlternateFBMII { ; ; Alternate fBm II algorithm using 4n linear arrays. ; Designed for "Outside" colouring of non-pixel formulas. ; UF3+ only. ; ; Updated 13th November 2004 ; Added "finalz" convergent smoothing and "Auto-power" for ; standard smoothing. ; ; Updated 27th January 2003 ; Array out of bounds problem fixed, final z smoothing added. ; ; Created 1st January 2003 ; ; (c) David Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; global: $define DEBUG ; Each linear height array is 16384 in size, but defined as ; 16387 to repeat 3 points so they can be indexed without ; needing to use n%16384. ; 4 linear arrays are used per level of fBm. ; N/S, E/W, NE/SW and NW/SE (ie. x, y, x+y and x-y) float h[@levels,4,16387] ; Arrays for the fBm level data float q[16,7] ; various bool f[16] ; "enabled" flags float d=#pi/180 ; for conversion to radians float c=4096*@rs ; overall frequency ; fBm level 1 float ang=@ang0*d ; convert rotation to rads ; q[level,0] and q[level,1] are the scaling factors for the ; x+y and x-y arrays, the "correct" value should be the same ; for both (ie. 1/sqrt(2)) but to increase variation the ; values used are in the neighbourhood of 0.7071, being n/8192 ; where n is a prime number. q[0,0]=5471/8192 q[0,1]=6143/8192 ; The rotation values q[0,2]=cos(ang) q[0,3]=sin(ang) ; Combine the overall sharpness and frequency with the ; sharpness and frequency for this level. q[0,4]=@frac0*@frac q[0,5]=c*@rs0 ; Put the amplitude in the array so it can be indexed q[0,6]=@amp0 ; Put the enabled flag in an array so it can be indexed f[0]=@flag0 ; fBm level 2 (Note slightly different values q[1,0] and q[1,1]) ang=@ang1*d q[1,0]=6079/8192 q[1,1]=5521/8192 q[1,2]=cos(ang) q[1,3]=sin(ang) q[1,4]=@frac1*@frac q[1,5]=c*@rs1 q[1,6]=@amp1 f[1]=@flag1 ; fBm level 3 ang=@ang2*d q[2,0]=5501/8192 q[2,1]=6113/8192 q[2,2]=cos(ang) q[2,3]=sin(ang) q[2,4]=@frac2*@frac q[2,5]=c*@rs2 q[2,6]=@amp2 f[2]=@flag2 ; fBm level 4 ang=@ang3*d q[3,0]=6047/8192 q[3,1]=5563/8192 q[3,2]=cos(ang) q[3,3]=sin(ang) q[3,4]=@frac3*@frac q[3,5]=c*@rs3 q[3,6]=@amp3 f[3]=@flag3 ; fBm level 5 ang=@ang4*d q[4,0]=5507/8192 q[4,1]=6091/8192 q[4,2]=cos(ang) q[4,3]=sin(ang) q[4,4]=@frac4*@frac q[4,5]=c*@rs4 q[4,6]=@amp4 f[4]=@flag4 ; fBm level 6 ang=@ang5*d q[5,0]=6037/8192 q[5,1]=5573/8192 q[5,2]=cos(ang) q[5,3]=sin(ang) q[5,4]=@frac5*@frac q[5,5]=c*@rs5 q[5,6]=@amp5 f[5]=@flag5 ; fBm level 7 ang=@ang6*d q[6,0]=5531/8192 q[6,1]=6067/8192 q[6,2]=cos(ang) q[6,3]=sin(ang) q[6,4]=@frac6*@frac q[6,5]=c*@rs6 q[6,6]=@amp6 f[6]=@flag6 ; fBm level 8 ang=@ang7*d q[7,0]=6131/8192 q[7,1]=5479/8192 q[7,2]=cos(ang) q[7,3]=sin(ang) q[7,4]=@frac7*@frac q[7,5]=c*@rs7 q[7,6]=@amp7 f[7]=@flag7 ; fBm level 9 ang=@ang8*d q[8,0]=5503/8192 q[8,1]=6101/8192 q[8,2]=cos(ang) q[8,3]=sin(ang) q[8,4]=@frac8*@frac q[8,5]=c*@rs8 q[8,6]=@amp8 f[8]=@flag8 ; fBm level 10 ang=@ang9*d q[9,0]=6133/8192 q[9,1]=5477/8192 q[9,2]=cos(ang) q[9,3]=sin(ang) q[9,4]=@frac9*@frac q[9,5]=c*@rs9 q[9,6]=@amp9 f[9]=@flag9 ; fBm level 11 ang=@ang10*d q[10,0]=5557/8192 q[10,1]=6053/8192 q[10,2]=cos(ang) q[10,3]=sin(ang) q[10,4]=@frac10*@frac q[10,5]=c*@rs10 q[10,6]=@amp10 f[10]=@flag10 ; fBm level 12 ang=@ang11*d q[11,0]=6029/8192 q[11,1]=5581/8192 q[11,2]=cos(ang) q[11,3]=sin(ang) q[11,4]=@frac11*@frac q[11,5]=c*@rs11 q[11,6]=@amp11 f[11]=@flag11 ; fBm level 13 ang=@ang12*d q[12,0]=5527/8192 q[12,1]=6073/8192 q[12,2]=cos(ang) q[12,3]=sin(ang) q[12,4]=@frac12*@frac q[12,5]=c*@rs12 q[12,6]=@amp12 f[12]=@flag12 ; fBm level 14 ang=@ang13*d q[13,0]=6121/8192 q[13,1]=5483/8192 q[13,2]=cos(ang) q[13,3]=sin(ang) q[13,4]=@frac13*@frac q[13,5]=c*@rs13 q[13,6]=@amp13 f[13]=@flag13 ; fBm level 15 ang=@ang14*d q[14,0]=5569/8192 q[14,1]=6043/8192 q[14,2]=cos(ang) q[14,3]=sin(ang) q[14,4]=@frac14*@frac q[14,5]=c*@rs14 q[14,6]=@amp14 f[14]=@flag14 ; fBm level 16 ang=@ang15*d q[15,0]=6089/8192 q[15,1]=5519/8192 q[15,2]=cos(ang) q[15,3]=sin(ang) q[15,4]=@frac15*@frac q[15,5]=c*@rs15 q[15,6]=@amp15 f[15]=@flag15 ; Now initialise the height arrays ready for fBm creation. int r=@seed ; initialise the random variable float r1=r int l=0 ; level count int step=16384 ; initially assume all fBm while l<@levels int i=0 while i<4 h[l,i,0]=0 ; set entry 0 to 0 h[l,i,16384]=0 ; and entry 16384 ; If using Div 2, Div 4 or Div 8 initialise further array ; entries and adjust the binary step to be used later ; accordingly. if @mode>0 h[l,i,8192]=0 step=8192 if @mode>1 r=random(r) h[l,i,4096]=r/#randomrange r=random(r) h[l,i,12288]=r/#randomrange step=4096 if @mode>2 r=random(r) h[l,i,2048]=r/#randomrange r=random(r) h[l,i,6144]=r/#randomrange r=random(r) h[l,i,10240]=r/#randomrange r=random(r) h[l,i,14336]=r/#randomrange step=2048 endif endif endif i=i+1 endwhile l=l+1 endwhile ; Now calculate the number of extra (dummy) dice rolls to use ; (The dummy rolls mean the shape of the fBm will not change ; in great jumps as the number of dice used is changed - ; provided @dice is <= @dummy) int nd=0 if @dummy>0 nd=@dummy-ceil(@dice) if (nd<0 && (!@morph))||(nd<-1 && @morph) print("Not enough dummy rolls") nd=0 endif endif ; Now proceed with the actual fBm creation l=0 float th=0 ; For the "Total height" while l<@levels i=0 while i<4 float rs=1.0 ; Initial fBm scale factor int s=step ; initial step float mx=0 ; for the maximum float mn=0 ; for the minimum while s>1 ; we've finished when s=1 int o=floor(s/2) ; offset is s/2 int p=o ; start index while p<16384 ; Now roll up the next random if @morph float nr=@dice if nr<=@dummy while nr>=1 r=random(r) nr=nr-1 endwhile r1=r if nr>0 r=random(r) r1=(1-nr)*r1+nr*r endif else r=random(r) r1=r nr=nr-1 while nr>=1 r=random(r) nr=nr-1 endwhile r1=nr*r1+(1-nr)*r endif else r1=0 float nr=@dice while nr>=1 r=random(r) r1=r1+r/#randomrange nr=nr-1 endwhile if nr>0 r=random(r) r1=r1+nr*r/#randomrange endif r1=r1/@dice endif ; Do any dummy rolls int n=nd while n>0 r=random(r) n=n-1 endwhile ; Height = (previous+next)/2 + random*scale factor ; or cubic interpolation + random*scale factor if @average==0 h[l,i,p]=(h[l,i,p-o]+h[l,i,p+o])/2+rs*r1 else int w=(p-o-s)%16384 if w<0 w=w+16384 endif float hh0=h[l,i,w] float hh1=h[l,i,p-o] float hh2=h[l,i,p+o] w=(p+o+s)%16384 float hh3=h[l,i,w] h[l,i,p]=(5*(hh1+hh2)-(hh0+hh3))/8+rs*r1 endif ; Check for max and min if h[l,i,p]>mx mx=h[l,i,p] endif if h[l,i,p] 0) fd=3*fd/it if @scaleiter==1 fd=fd/it endif v=0 int lvl=0 while lvl<@levels if f[lvl] ; Scale z by the frequency z=#z*q[lvl,5]*it if @scaleiter==1 z=z*it endif ; Rotate x=real(z)*q[lvl,2]-imag(z)*q[lvl,3] y=imag(z)*q[lvl,2]+real(z)*q[lvl,3] ; Scale x+y and x-y xpy=(x+y)*q[lvl,0] xmy=(x-y)*q[lvl,1] ; Convert to (float) indexes x=x%16384 y=y%16384 xpy=xpy%16384 xmy=xmy%16384 ; Convert to indexes int ix=floor(x) int iy=floor(y) int ixpy=floor(xpy) int ixmy=floor(xmy) ; Convert x, y, xpy and xmy to fractions x=x-ix y=y-iy xpy=xpy-ixpy xmy=xmy-ixmy ; Linear or cubic interpolation if @inter==0 ; The indexes could be - if ix<0 ix=16384+ix endif if iy<0 iy=16384+iy endif if ixpy<0 ixpy=16384+ixpy endif if ixmy<0 ixmy=16384+ixmy endif ; Linear interpolation v=v + h[lvl,0,ix]+(h[lvl,0,ix+1]-h[lvl,0,ix])*x \ + h[lvl,1,iy]+(h[lvl,1,iy+1]-h[lvl,1,iy])*y \ + h[lvl,2,ixpy]+(h[lvl,2,ixpy+1]-h[lvl,2,ixpy])*xpy \ + h[lvl,3,ixmy]+(h[lvl,3,ixmy+1]-h[lvl,3,ixmy])*xmy else ; n-1 as we require the height at index-1 for cubic interpolation. ix=ix-1 while ix<0 ix=16384+ix endwhile iy=iy-1 while iy<0 iy=16384+iy endwhile ixpy=ixpy-1 while ixpy<0 ixpy=16384+ixpy endwhile ixmy=ixmy-1 while ixmy<0 ixmy=16384+ixmy endwhile ; Cubic interpolation float h0=h[lvl,0,ix] float h1=h[lvl,0,ix+1] float h2=h[lvl,0,ix+2] float h3=h[lvl,0,ix+3] v=v+(h3-h2+h1-h0)*x^3+(2*(h0-h1)+h2-h3)*x^2+(h2-h0)*x+h1 h0=h[lvl,1,iy] h1=h[lvl,1,iy+1] h2=h[lvl,1,iy+2] h3=h[lvl,1,iy+3] v=v+(h3-h2+h1-h0)*y^3+(2*(h0-h1)+h2-h3)*y^2+(h2-h0)*y+h1 h0=h[lvl,2,ixpy] h1=h[lvl,2,ixpy+1] h2=h[lvl,2,ixpy+2] h3=h[lvl,2,ixpy+3] v=v+(h3-h2+h1-h0)*xpy^3+(2*(h0-h1)+h2-h3)*xpy^2+(h2-h0)*xpy+h1 h0=h[lvl,3,ixmy] h1=h[lvl,3,ixmy+1] h2=h[lvl,3,ixmy+2] h3=h[lvl,3,ixmy+3] v=v+(h3-h2+h1-h0)*xmy^3+(2*(h0-h1)+h2-h3)*xmy^2+(h2-h0)*xmy+h1 endif endif lvl=lvl+1 endwhile v0=v0+v*fd endif it=it+1 final: if @smooth if @finalz if real(#z)<0 v = 1 + @finalzfixc*real(#z) if ivc==0 #index = v1+(v0-v1)*v else x = #numiter+v if @logiterc==1 x = log(1+x) elseif @logiterc==2 x = log(1+log(1+x)) endif #index = ivc*x + iwc*(v1+(v0-v1)*v) endif else v = @finalzfix*real(#z) if iv==0 #index = v1+(v0-v1)*v else x = #numiter+v if @logiter==1 x = log(1+x) elseif @logiter==2 x = log(1+log(1+x)) endif #index = iv*x + iw*(v1+(v0-v1)*v) endif endif elseif @smoothuse==0 || (@smoothuse==2 && |#z|>@bailout) if @autopower v = (lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|zo|)) else v = (lp-il*log(0.5*log(|#z|))) endif if iv==0 #index = v0 + (v0-v1)*v else x = #numiter+v if @logiter==1 x = log(1+x) elseif @logiter==2 x = log(1+log(1+x)) endif #index = iv*x + iw*(v0 + (v0-v1)*v) endif else if @autopowerc if @absc v = (clp-log(-0.5*log(|#z-@cvalue|)))/log(log(|#z-@cvalue|)/log(|zo-@cvalue|)) else v = (clp-log(-0.5*log(|#z-zo|)))/log(log(|#z-zo|)/log(|zo-zo1|)) endif elseif @absc v = (clp - cil*log(-0.5*log(|#z-@cvalue|))) else v = (clp - cil*log(-0.5*log(|#z-zo|))) endif if !@autopowerc || @usecfudge v = v*@fudgec endif if @zbasin==1 v0 = v0 + @zscale*abs(real(2.0*#pi+atan2(#z))) v1 = v1 + @zscale*abs(real(2.0*#pi+atan2(zo))) elseif @zbasin==2 v0 = v0 + @zscale*abs(real(#z)) v1 = v1 + @zscale*abs(real(zo)) elseif @zbasin==3 v0 = v0 + @zscale*abs(imag(#z)) v1 = v1 + @zscale*abs(imag(zo)) elseif @zbasin==4 v0 = v0 + @zscale*abs(real(#z)+imag(#z)) v1 = v1 + @zscale*abs(real(zo)+imag(zo)) elseif @zbasin==5 v0 = v0 + @zscale*abs(2*real(#z)+imag(#z)) v1 = v1 + @zscale*abs(2*real(zo)+imag(zo)) elseif @zbasin==6 v0 = v0 + @zscale*abs(real(#z)+2*imag(#z)) v1 = v1 + @zscale*abs(real(zo)+2*imag(zo)) elseif @zbasin==7 v0 = v0 + @zscale*abs(real(#z)/(abs(imag(#z))+1)) v1 = v1 + @zscale*abs(real(zo)/(abs(imag(zo))+1)) elseif @zbasin==8 v0 = v0 + @zscale*abs(imag(#z)/(abs(real(#z))+1)) v1 = v1 + @zscale*abs(imag(zo)/(abs(real(zo))+1)) elseif @zbasin==9 v0 = v0 + @zscale*abs(2*real(sqrt(#z))+imag(sqrt(#z))) v1 = v1 + @zscale*abs(2*real(sqrt(zo))+imag(sqrt(zo))) elseif @zbasin==10 v0 = v0 + @zscale*abs(real(sqrt(#z))+2*imag(sqrt(#z))) v1 = v1 + @zscale*abs(real(sqrt(zo))+2*imag(sqrt(zo))) endif if ivc==0 #index = v0 + (v0-v1)*v else x = #numiter+v if @logiterc==1 x = log(1+x) elseif @logiterc==2 x = log(1+log(1+x)) endif #index = ivc*x + iwc*(v0 + (v0-v1)*v) endif endif else #index = v0 endif default: title = "MMF3 Alternative fBm II" param scaleiter caption = "Scale by" default = 0 enum = "Iteration" "Iteration squared" hint = "Controls how much banding appears." endparam param smooth caption = "Smoothing" default = false hint = "This will remove iteration breaks for 'standard' \ formulas. It is needed when using smaller bailout \ values eg. <64, or when Fade Amount is increased." endparam heading caption = "Smoothing parameter/s" visible = @smooth endheading param finalz caption = "Use final z" default = false hint = "Enabling this will use the final z value as the \ smoothing fraction - only works with main formulas \ designed to return such a value. When enabled the \ Formula power and Formula bailout are not used." visible = @smooth endparam param finalzfix caption = "Fudge (div)" default = 1.0 hint = "Use to scale the divergent Hinrich finalz fraction when it \ doesn't fully range from 0 to 1 ie. to remove iteration breaks." visible = @smooth && @finalz endparam param smoothuse caption = "Smoothing type" enum = "Divergent" "Convergent" "Both" default = 0 hint = "Allows you to select standard smoothing for convergent \ or divergent areas or both." visible = @smooth && !@finalz endparam param autopower caption = "Auto-power" default = false hint = "When enabled you should get correct smoothing on any divergent \ fractal without having to supply a power value and smoothing with \ low bailout values is further improved." visible = @smooth && !@finalz && (@smoothuse==0 || @smoothuse==2) endparam param power caption = "Formula power" default = 2.0 hint = "This should match the power/degree/exponent used \ in the main formula." visible = @smooth && (!@finalz) && (@smoothuse==0 || @smoothuse==2) && !@autopower endparam param bailout caption = "Formula bailout" default = 16.0 hint = "This should match the bailout used in the main \ formula." visible = @smooth && (!@finalz) && (@smoothuse==0 || @smoothuse==2) endparam param iterval caption = "Add iter (div)" default = 0.0 hint = "Use to add some of the smooth iteration value to divergent areas." visible = @smooth && (@finalz || @smoothuse==0 || @smoothuse==2) endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @iterval!=0 && @smooth && (@finalz || @smoothuse==0 || @smoothuse==2) endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @iterval!=0 && @iterweight!=0 \ && @smooth && (@finalz || @smoothuse==0 || @smoothuse==2) endparam param autopowerc caption = "Auto-power (conv)" default = false hint = "When enabled you should get correct smoothing on any convergent \ fractal without having to supply a power value." visible = @smooth && (!@finalz) && @smoothuse>0 endparam param powerc caption = "Power (conv)" default = 2.0 hint = "This should match the degree of covergence in your fractal, \ eg. 2 for Newton." visible = @smooth && (!@finalz) && @smoothuse>0 && !@autopowerc endparam param bailout1 caption = "Convergent bailout" default = 1e-5 hint = "This should match the small bailout used in the main \ formula." visible = @smooth && (!@finalz) && @smoothuse>0 endparam param finalzfixc caption = "Fudge (conv)" default = 1.0 hint = "Use to scale the convergent Hinrich finalz fraction when it \ doesn't fully range from 0 to 1 ie. to remove iteration breaks." visible = @smooth && @finalz endparam param usecfudge caption = "Use scaling fudge" default = false hint = "Allows you to enable use of the convergent scaling fudge \ when using 'Auto-power (conv)'." visible = @smooth && (!@finalz) && @smoothuse>0 && @autopowerc endparam param fudgec caption = "Scaling Fudge" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power (conv)' or the best value you can \ find for the 'Power (conv)' parameter don't \ produce smooth results then modifying this value \ should help." visible = @smooth && (!@finalz) && @smoothuse>0 && (!@autopowerc || @usecfudge) endparam param absc caption = "Absolute convergence" default = false hint = "Use with main formulas that test for convergence using \ only |z-value| rather than |z-zold| eg. some Magnet formulas." visible = @smooth && (!@finalz) && @smoothuse>0 endparam param cvalue caption = "Convergence value" default = (1,0) hint = "Should match the value the main formula uses when testing \ for convergence." visible = @smooth && (!@finalz) && @smoothuse>0 && @absc endparam param itervalc caption = "Add iter (conv)" default = 0.0 hint = "Use to add some of the smooth iteration value to convergent areas." visible = @smooth && (@finalz || @smoothuse>0) endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @itervalc!=0 && @smooth && (@finalz || @smoothuse>0) endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @itervalc!=0 && @iterweightc!=0 \ && @smooth && (@finalz || @smoothuse>0) endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "Roots 1" "Roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ penultimate value of z." visible = @smooth && @smoothuse>0 endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = @smooth && @smoothuse>0 && @zbasin>0 endparam heading caption = "fBm parameters" visible = @smooth endheading param fade caption = "Fade Amount" default = 16.0 hint = "Indicates the degree to which the texture fades with distance \ from the origin. Larger values give less fading." endparam param mode caption = "Method" enum = "Normal" "Div 2" "Div 4" "Div 8" default = 0 endparam param average caption = "Averaging" enum = "Normal" "Cubic" default = 0 hint = "Using Cubic is a bit slower but tends to produce \ slightly smoother results." endparam param seed caption = "Seed" default = 123456 hint = "The seed for the random, change for different patterns." endparam param inter caption = "Interpolation" enum = "Linear" "Cubic" default = 0 hint = "Cubic is probably just overkill only really needed \ when at high magnification." endparam param frac caption = "Overall Sharpness" default = 0.7071 min = 1e-5 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results, if the result of multiplying \ this value by the sharpness for a given layer is >=1 then \ that layer will effectively be completely random." endparam param rs caption = "Overall Frequency" default = 1.0 min = 1e-5 hint = "Controls the scale of the patterns." endparam param dice caption = "#Dice to use" default = 1.0 min = 1.0 max = 64.0 hint = "Changing the number of dice used will affect the \ character of the fBm." endparam param dummy caption = "#Dice to roll" default = 0 min = 0 max = 65 hint = "Anything greater than #Dice to use forces the \ total dice rolled whether they are all used or \ not. This means gradual changes to #Dice to use \ will produce gradual changes in the fBm provided \ #Dice to use stays <= #Dice to roll." endparam param morph caption = "Morphing" default = false hint = "When enabled, eg. if the #Dice to use is 2.3 then the \ 1st dice roll is ignored, the second and third dice rolls \ are mixed - 0.7*second + 0.3*third - this allows true \ morphing of the fBm from one state to the next, provided \ #Dice to roll + 1 > #Dice to use." endparam param exp caption = "Exponent" default = 1.0 hint = "Changes the nature of the fBm." endparam param levels caption = "Number of levels" default = 2 min = 1 max = 16 hint = "The number of levels of fBm to mix." endparam param showmaps caption = "Show fBm levels" default = false endparam heading caption = "fBm level 1" visible = @showmaps endheading param flag0 caption = "Level 1 status" default = true hint = "Use to enable/disable fBm level 1." visible = @showmaps endparam param frac0 caption = "Sharpness #1" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && @flag0 endparam param rs0 caption = "Frequency #1" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && @flag0 endparam param amp0 caption = "Amplitude #1" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #1." visible = @showmaps && @flag0 endparam param ang0 caption = "Rotation #1 (degrees)" default = 0.0 hint = "Rotates the pattern." visible = @showmaps && @flag0 endparam heading caption = "fBm level 2" visible = @showmaps && (@levels>1) endheading param flag1 caption = "Level 2 status" default = true hint = "Use to enable/disable fBm level 2." visible = @showmaps && (@levels>1) endparam param frac1 caption = "Sharpness #2" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>1) && @flag1 endparam param rs1 caption = "Frequency #2" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>1) && @flag1 endparam param amp1 caption = "Amplitude #2" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #2." visible = @showmaps && (@levels>1) && @flag1 endparam param ang1 caption = "Rotation #2 (degrees)" default = 22.5 hint = "Rotates the pattern." visible = @showmaps && (@levels>1) && @flag1 endparam heading caption = "fBm level 3" visible = @showmaps && (@levels>2) endheading param flag2 caption = "Level 3 status" default = true hint = "Use to enable/disable fBm level 3." visible = @showmaps && (@levels>2) endparam param frac2 caption = "Sharpness #3" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>2) && @flag2 endparam param rs2 caption = "Frequency #3" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>2) && @flag2 endparam param amp2 caption = "Amplitude #3" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #3." visible = @showmaps && (@levels>2) && @flag2 endparam param ang2 caption = "Rotation #3 (degrees)" default = 11.25 hint = "Rotates the pattern." visible = @showmaps && (@levels>2) && @flag2 endparam heading caption = "fBm level 4" visible = @showmaps && (@levels>3) endheading param flag3 caption = "Level 4 status" default = true hint = "Use to enable/disable fBm level 4." visible = @showmaps && (@levels>3) endparam param frac3 caption = "Sharpness #4" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>3) && @flag3 endparam param rs3 caption = "Frequency #4" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>3) && @flag3 endparam param amp3 caption = "Amplitude #4" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #4." visible = @showmaps && (@levels>3) && @flag3 endparam param ang3 caption = "Rotation #4 (degrees)" default = 33.75 hint = "Rotates the pattern." visible = @showmaps && (@levels>3) && @flag3 endparam heading caption = "fBm level 5" visible = @showmaps && (@levels>4) endheading param flag4 caption = "Level 5 status" default = true hint = "Use to enable/disable fBm level 5." visible = @showmaps && (@levels>4) endparam param frac4 caption = "Sharpness #5" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>4) && @flag4 endparam param rs4 caption = "Frequency #5" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>4) && @flag4 endparam param amp4 caption = "Amplitude #5" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #5." visible = @showmaps && (@levels>4) && @flag4 endparam param ang4 caption = "Rotation #5 (degrees)" default = 16.875 hint = "Rotates the pattern." visible = @showmaps && (@levels>4) && @flag4 endparam heading caption = "fBm level 6" visible = @showmaps && (@levels>5) endheading param flag5 caption = "Level 6 status" default = true hint = "Use to enable/disable fBm level 6." visible = @showmaps && (@levels>5) endparam param frac5 caption = "Sharpness #6" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>5) && @flag5 endparam param rs5 caption = "Frequency #6" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>5) && @flag5 endparam param amp5 caption = "Amplitude #6" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #6." visible = @showmaps && (@levels>5) && @flag5 endparam param ang5 caption = "Rotation #6 (degrees)" default = 39.375 hint = "Rotates the pattern." visible = @showmaps && (@levels>5) && @flag5 endparam heading caption = "fBm level 7" visible = @showmaps && (@levels>6) endheading param flag6 caption = "Level 7 status" default = true hint = "Use to enable/disable fBm level 7." visible = @showmaps && (@levels>6) endparam param frac6 caption = "Sharpness #7" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>6) && @flag6 endparam param rs6 caption = "Frequency #7" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>6) && @flag6 endparam param amp6 caption = "Amplitude #7" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #7." visible = @showmaps && (@levels>6) && @flag6 endparam param ang6 caption = "Rotation #7 (degrees)" default = 28.125 hint = "Rotates the pattern." visible = @showmaps && (@levels>6) && @flag6 endparam heading caption = "fBm level 8" visible = @showmaps && (@levels>7) endheading param flag7 caption = "Level 8 status" default = true hint = "Use to enable/disable fBm level 8." visible = @showmaps && (@levels>7) endparam param frac7 caption = "Sharpness #8" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>7) && @flag7 endparam param rs7 caption = "Frequency #8" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>7) && @flag7 endparam param amp7 caption = "Amplitude #8" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #8." visible = @showmaps && (@levels>7) && @flag7 endparam param ang7 caption = "Rotation #8 (degrees)" default = 5.625 hint = "Rotates the pattern." visible = @showmaps && (@levels>7) && @flag7 endparam heading caption = "fBm level 9" visible = @showmaps && (@levels>8) endheading param flag8 caption = "Level 9 status" default = true hint = "Use to enable/disable fBm level 9." visible = @showmaps && (@levels>8) endparam param frac8 caption = "Sharpness #9" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>8) && @flag8 endparam param rs8 caption = "Frequency #9" default = 2.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>8) && @flag8 endparam param amp8 caption = "Amplitude #9" default = 0.5 min = 0 hint = "Controls the relative effect of fBm level #9." visible = @showmaps && (@levels>8) && @flag8 endparam param ang8 caption = "Rotation #9 (degrees)" default = 19.6875 hint = "Rotates the pattern." visible = @showmaps && (@levels>8) && @flag8 endparam heading caption = "fBm level 10" visible = @showmaps && (@levels>9) endheading param flag9 caption = "Level 10 status" default = true hint = "Use to enable/disable fBm level 10." visible = @showmaps && (@levels>9) endparam param frac9 caption = "Sharpness #10" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>9) && @flag9 endparam param rs9 caption = "Frequency #10" default = 2.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>9) && @flag9 endparam param amp9 caption = "Amplitude #10" default = 0.5 min = 0 hint = "Controls the relative effect of level #10." visible = @showmaps && (@levels>9) && @flag9 endparam param ang9 caption = "Rotation #10 (degrees)" default = 36.5625 hint = "Rotates the pattern." visible = @showmaps && (@levels>9) && @flag9 endparam heading caption = "fBm level 11" visible = @showmaps && (@levels>10) endheading param flag10 caption = "Level 11 status" default = true hint = "Use to enable/disable fBm level 11." visible = @showmaps && (@levels>10) endparam param frac10 caption = "Sharpness #11" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>10) && @flag10 endparam param rs10 caption = "Frequency #11" default = 2.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>10) && @flag10 endparam param amp10 caption = "Amplitude #11" default = 0.5 min = 0 hint = "Controls the relative effect of fBm level #11." visible = @showmaps && (@levels>10) && @flag10 endparam param ang10 caption = "Rotation #11 (degrees)" default = 8.4375 hint = "Rotates the pattern." visible = @showmaps && (@levels>10) && @flag10 endparam heading caption = "fBm level 12" visible = @showmaps && (@levels>11) endheading param flag11 caption = "Level 12 status" default = true hint = "Use to enable/disable fBm level 12." visible = @showmaps && (@levels>11) endparam param frac11 caption = "Sharpness #12" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>11) && @flag11 endparam param rs11 caption = "Frequency #12" default = 4.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>11) && @flag11 endparam param amp11 caption = "Amplitude #12" default = 0.25 min = 0 hint = "Controls the relative effect of fBm level #12." visible = @showmaps && (@levels>11) && @flag11 endparam param ang11 caption = "Rotation #12 (degrees)" default = 25.3125 hint = "Rotates the pattern." visible = @showmaps && (@levels>11) && @flag11 endparam heading caption = "fBm level 13" visible = @showmaps && (@levels>12) endheading param flag12 caption = "Level 13 status" default = true hint = "Use to enable/disable fBm level 13." visible = @showmaps && (@levels>12) endparam param frac12 caption = "Sharpness #13" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>12) && @flag12 endparam param rs12 caption = "Frequency #13" default = 4.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>12) && @flag12 endparam param amp12 caption = "Amplitude #13" default = 0.25 min = 0 hint = "Controls the relative effect of fBm level #13." visible = @showmaps && (@levels>12) && @flag12 endparam param ang12 caption = "Rotation #13 (degrees)" default = 14.0625 hint = "Rotates the pattern." visible = @showmaps && (@levels>12) && @flag12 endparam heading caption = "fBm level 14" visible = @showmaps && (@levels>13) endheading param flag13 caption = "Level 14 status" default = true hint = "Use to enable/disable fBm level 14." visible = @showmaps && (@levels>13) endparam param frac13 caption = "Sharpness #14" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>13) && @flag13 endparam param rs13 caption = "Frequency #14" default = 8.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>13) && @flag13 endparam param amp13 caption = "Amplitude #14" default = 0.125 min = 0 hint = "Controls the relative effect of fBm level #14." visible = @showmaps && (@levels>13) && @flag13 endparam param ang13 caption = "Rotation #14 (degrees)" default = 30.9375 hint = "Rotates the pattern." visible = @showmaps && (@levels>13) && @flag13 endparam heading caption = "fBm level 15" visible = @showmaps && (@levels>14) endheading param flag14 caption = "Level 15 status" default = true hint = "Use to enable/disable fBm level 15." visible = @showmaps && (@levels>14) endparam param frac14 caption = "Sharpness #15" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>14) && @flag14 endparam param rs14 caption = "Frequency #15" default = 16.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>14) && @flag14 endparam param amp14 caption = "Amplitude #15" default = 0.0625 min = 0 hint = "Controls the relative effect of fBm level #15." visible = @showmaps && (@levels>14) && @flag14 endparam param ang14 caption = "Rotation #15 (degrees)" default = 2.8125 hint = "Rotates the pattern." visible = @showmaps && (@levels>14) && @flag14 endparam heading caption = "fBm level 16" visible = @showmaps && (@levels>15) endheading param flag15 caption = "Level 16 status" default = true hint = "Use to enable/disable fBm level 16." visible = @showmaps && (@levels>15) endparam param frac15 caption = "Sharpness #16" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>15) && @flag15 endparam param rs15 caption = "Frequency #16" default = 32.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>15) && @flag15 endparam param amp15 caption = "Amplitude #16" default = 0.03125 min = 0 hint = "Controls the relative effect of level #16." visible = @showmaps && (@levels>15) && @flag15 endparam param ang15 caption = "Rotation #16 (degrees)" default = 42.1875 hint = "Rotates the pattern." visible = @showmaps && (@levels>15) && @flag15 endparam } MMF3a-AlternateFBM { ; ; Alternate fBm algorithm using 4n linear arrays. ; UF3+ only. ; ; Updated 10th-14th November 2004 ; Added "finalz" convergent smoothing and "standard" ; auto-power smoothing. ; ; Updated 27th January 2003 ; Array out of bounds problem fixed, final z smoothing added ; and "sea level" added for the slope version. ; ; Created 27th-29th December 2002 ; ; (c) David Makin (Makin' Magic) ; http://www.crosswinds.net/~makinmagic/ ; http://website.lineone.net/~dave_makin/ ; global: $define DEBUG ; Each linear height array is 16384 in size, but defined as ; 16387 to repeat 3 points so they can be indexed without ; needing to use n%16384. ; 4 linear arrays are used per level of fBm. ; N/S, E/W, NE/SW and NW/SE (ie. x, y, x+y and x-y) float h[@levels,4,16387] ; Arrays for the fBm level data float q[16,7] ; various bool f[16] ; "enabled" flags float d=#pi/180 ; for conversion to radians float c=4096*@rs ; overall frequency if @version==1 || @version==4 c=4*c/@bailout ; adjust for when smoothing endif ; fBm level 1 float ang=@ang0*d ; convert rotation to rads ; q[level,0] and q[level,1] are the scaling factors for the ; x+y and x-y arrays, the "correct" value should be the same ; for both (ie. 1/sqrt(2)) but to increase variation the ; values used are in the neighbourhood of 0.7071, being n/8192 ; where n is a prime number. q[0,0]=5471/8192 q[0,1]=6143/8192 ; The rotation values q[0,2]=cos(ang) q[0,3]=sin(ang) ; Combine the overall sharpness and frequency with the ; sharpness and frequency for this level. q[0,4]=@frac0*@frac q[0,5]=c*@rs0 ; Put the amplitude in the array so it can be indexed q[0,6]=@amp0 ; Put the enabled flag in an array so it can be indexed f[0]=@flag0 ; fBm level 2 (Note slightly different values q[1,0] and q[1,1]) ang=@ang1*d q[1,0]=6079/8192 q[1,1]=5521/8192 q[1,2]=cos(ang) q[1,3]=sin(ang) q[1,4]=@frac1*@frac q[1,5]=c*@rs1 q[1,6]=@amp1 f[1]=@flag1 ; fBm level 3 ang=@ang2*d q[2,0]=5501/8192 q[2,1]=6113/8192 q[2,2]=cos(ang) q[2,3]=sin(ang) q[2,4]=@frac2*@frac q[2,5]=c*@rs2 q[2,6]=@amp2 f[2]=@flag2 ; fBm level 4 ang=@ang3*d q[3,0]=6047/8192 q[3,1]=5563/8192 q[3,2]=cos(ang) q[3,3]=sin(ang) q[3,4]=@frac3*@frac q[3,5]=c*@rs3 q[3,6]=@amp3 f[3]=@flag3 ; fBm level 5 ang=@ang4*d q[4,0]=5507/8192 q[4,1]=6091/8192 q[4,2]=cos(ang) q[4,3]=sin(ang) q[4,4]=@frac4*@frac q[4,5]=c*@rs4 q[4,6]=@amp4 f[4]=@flag4 ; fBm level 6 ang=@ang5*d q[5,0]=6037/8192 q[5,1]=5573/8192 q[5,2]=cos(ang) q[5,3]=sin(ang) q[5,4]=@frac5*@frac q[5,5]=c*@rs5 q[5,6]=@amp5 f[5]=@flag5 ; fBm level 7 ang=@ang6*d q[6,0]=5531/8192 q[6,1]=6067/8192 q[6,2]=cos(ang) q[6,3]=sin(ang) q[6,4]=@frac6*@frac q[6,5]=c*@rs6 q[6,6]=@amp6 f[6]=@flag6 ; fBm level 8 ang=@ang7*d q[7,0]=6131/8192 q[7,1]=5479/8192 q[7,2]=cos(ang) q[7,3]=sin(ang) q[7,4]=@frac7*@frac q[7,5]=c*@rs7 q[7,6]=@amp7 f[7]=@flag7 ; fBm level 9 ang=@ang8*d q[8,0]=5503/8192 q[8,1]=6101/8192 q[8,2]=cos(ang) q[8,3]=sin(ang) q[8,4]=@frac8*@frac q[8,5]=c*@rs8 q[8,6]=@amp8 f[8]=@flag8 ; fBm level 10 ang=@ang9*d q[9,0]=6133/8192 q[9,1]=5477/8192 q[9,2]=cos(ang) q[9,3]=sin(ang) q[9,4]=@frac9*@frac q[9,5]=c*@rs9 q[9,6]=@amp9 f[9]=@flag9 ; fBm level 11 ang=@ang10*d q[10,0]=5557/8192 q[10,1]=6053/8192 q[10,2]=cos(ang) q[10,3]=sin(ang) q[10,4]=@frac10*@frac q[10,5]=c*@rs10 q[10,6]=@amp10 f[10]=@flag10 ; fBm level 12 ang=@ang11*d q[11,0]=6029/8192 q[11,1]=5581/8192 q[11,2]=cos(ang) q[11,3]=sin(ang) q[11,4]=@frac11*@frac q[11,5]=c*@rs11 q[11,6]=@amp11 f[11]=@flag11 ; fBm level 13 ang=@ang12*d q[12,0]=5527/8192 q[12,1]=6073/8192 q[12,2]=cos(ang) q[12,3]=sin(ang) q[12,4]=@frac12*@frac q[12,5]=c*@rs12 q[12,6]=@amp12 f[12]=@flag12 ; fBm level 14 ang=@ang13*d q[13,0]=6121/8192 q[13,1]=5483/8192 q[13,2]=cos(ang) q[13,3]=sin(ang) q[13,4]=@frac13*@frac q[13,5]=c*@rs13 q[13,6]=@amp13 f[13]=@flag13 ; fBm level 15 ang=@ang14*d q[14,0]=5569/8192 q[14,1]=6043/8192 q[14,2]=cos(ang) q[14,3]=sin(ang) q[14,4]=@frac14*@frac q[14,5]=c*@rs14 q[14,6]=@amp14 f[14]=@flag14 ; fBm level 16 ang=@ang15*d q[15,0]=6089/8192 q[15,1]=5519/8192 q[15,2]=cos(ang) q[15,3]=sin(ang) q[15,4]=@frac15*@frac q[15,5]=c*@rs15 q[15,6]=@amp15 f[15]=@flag15 ; Now initialise the height arrays ready for fBm creation. int r=@seed ; initialise the random variable float r1=r int l=0 ; level count int step=16384 ; initially assume all fBm while l<@levels int i=0 while i<4 h[l,i,0]=0 ; set entry 0 to 0 h[l,i,16384]=0 ; and entry 16384 ; If using Div 2, Div 4 or Div 8 initialise further array ; entries and adjust the binary step to be used later ; accordingly. if @mode>0 h[l,i,8192]=0 step=8192 if @mode>1 r=random(r) h[l,i,4096]=r/#randomrange r=random(r) h[l,i,12288]=r/#randomrange step=4096 if @mode>2 r=random(r) h[l,i,2048]=r/#randomrange r=random(r) h[l,i,6144]=r/#randomrange r=random(r) h[l,i,10240]=r/#randomrange r=random(r) h[l,i,14336]=r/#randomrange step=2048 endif endif endif i=i+1 endwhile l=l+1 endwhile ; Now calculate the number of extra (dummy) dice rolls to use ; (The dummy rolls mean the shape of the fBm will not change ; in great jumps as the number of dice used is changed - ; provided @dice is <= @dummy) int nd=0 if @dummy>0 nd=@dummy-ceil(@dice) if (nd<0 && (!@morph))||(nd<-1 && @morph) print("Not enough dummy rolls") nd=0 endif endif ; Now proceed with the actual fBm creation l=0 int al=0 float th=0 ; For the "Total height" if @method==1 th=1 endif while l<@levels i=0 while i<4 float rs=1.0 ; Initial fBm scale factor int s=step ; initial step float mx=0 ; for the maximum float mn=0 ; for the minimum while s>1 ; we've finished when s=1 int o=floor(s/2) ; offset is s/2 int p=o ; start index while p<16384 ; Now roll up the next random if @morph float nr=@dice if nr<=@dummy while nr>=1 r=random(r) nr=nr-1 endwhile r1=r if nr>0 r=random(r) r1=(1-nr)*r1+nr*r endif else r=random(r) r1=r nr=nr-1 while nr>=1 r=random(r) nr=nr-1 endwhile r1=nr*r1+(1-nr)*r endif else r1=0 float nr=@dice while nr>=1 r=random(r) r1=r1+r/#randomrange nr=nr-1 endwhile if nr>0 r=random(r) r1=r1+nr*r/#randomrange endif r1=r1/@dice endif ; Do any dummy rolls int n=nd while n>0 r=random(r) n=n-1 endwhile ; Height = (previous+next)/2 + random*scale factor ; or cubic interpolation + random*scale factor if @average==0 h[l,i,p]=(h[l,i,p-o]+h[l,i,p+o])/2+rs*r1 else int w=(p-o-s)%16384 if w<0 w=w+16384 endif float hh0=h[l,i,w] float hh1=h[l,i,p-o] float hh2=h[l,i,p+o] w=(p+o+s)%16384 float hh3=h[l,i,w] h[l,i,p]=(5*(hh1+hh2)-(hh0+hh3))/8+rs*r1 endif ; Check for max and min if h[l,i,p]>mx mx=h[l,i,p] endif if h[l,i,p]0 int lvl=0 if @method==0 v=0 elseif @method==1 v=1 endif while lvl<@levels if f[lvl] ; Scale z by the frequency if m==5 z=(#z-flip(d))*q[lvl,5] elseif m==4 z=(#z-d)*q[lvl,5] elseif m==3 z=(#z+flip(d))*q[lvl,5] elseif m==2 if @version==1 || @version==4 if (@version==4 && real(#z)>=0) || (@version==1 \ && (@smooth==0 || (@smooth==2 && |#z|>@bailout))) z=zpo*q[lvl,5] else z=@bailout*zpo*q[lvl,5]*@cscale endif else z=(#z+d)*q[lvl,5] endif elseif @version==1 || @version==4 if (@version==4 && real(#z)>=0) || (@version==1 \ && (@smooth==0 || (@smooth==2 && |#z|>@bailout))) z=zp*q[lvl,5] else z=@bailout*zp*q[lvl,5]*@cscale endif else z=#z*q[lvl,5] endif ; Rotate x=real(z)*q[lvl,2]-imag(z)*q[lvl,3] y=imag(z)*q[lvl,2]+real(z)*q[lvl,3] ; Scale x+y and x-y xpy=(x+y)*q[lvl,0] xmy=(x-y)*q[lvl,1] ; Convert to (float) indexes x=x%16384 y=y%16384 xpy=xpy%16384 xmy=xmy%16384 ; Convert to indexes int ix=floor(x) int iy=floor(y) int ixpy=floor(xpy) int ixmy=floor(xmy) ; Convert x, y, xpy and xmy to fractions x=x-ix y=y-iy xpy=xpy-ixpy xmy=xmy-ixmy ; Linear or cubic interpolation if @inter==0 ; Remember the indexes could be - if ix<0 ix=16384+ix endif if iy<0 iy=16384+iy endif if ixpy<0 ixpy=16384+ixpy endif if ixmy<0 ixmy=16384+ixmy endif ; Linear interpolation if @method==0 v=v + h[lvl,0,ix]+(h[lvl,0,ix+1]-h[lvl,0,ix])*x \ + h[lvl,1,iy]+(h[lvl,1,iy+1]-h[lvl,1,iy])*y \ + h[lvl,2,ixpy]+(h[lvl,2,ixpy+1]-h[lvl,2,ixpy])*xpy \ + h[lvl,3,ixmy]+(h[lvl,3,ixmy+1]-h[lvl,3,ixmy])*xmy elseif @method==1 v=v * (h[lvl,0,ix]+(h[lvl,0,ix+1]-h[lvl,0,ix])*x \ + h[lvl,1,iy]+(h[lvl,1,iy+1]-h[lvl,1,iy])*y \ + h[lvl,2,ixpy]+(h[lvl,2,ixpy+1]-h[lvl,2,ixpy])*xpy \ + h[lvl,3,ixmy]+(h[lvl,3,ixmy+1]-h[lvl,3,ixmy])*xmy \ - q[lvl,6]) endif else ; Note using n-1 as we require the height at index-1 for cubic ; interpolation. ix=ix-1 while ix<0 ix=16384+ix endwhile iy=iy-1 while iy<0 iy=16384+iy endwhile ixpy=ixpy-1 while ixpy<0 ixpy=16384+ixpy endwhile ixmy=ixmy-1 while ixmy<0 ixmy=16384+ixmy endwhile ; Cubic interpolation float h0=h[lvl,0,ix] float h1=h[lvl,0,ix+1] float h2=h[lvl,0,ix+2] float h3=h[lvl,0,ix+3] t=(h3-h2+h1-h0)*x^3+(2*(h0-h1)+h2-h3)*x^2+(h2-h0)*x+h1 h0=h[lvl,1,iy] h1=h[lvl,1,iy+1] h2=h[lvl,1,iy+2] h3=h[lvl,1,iy+3] t=t+(h3-h2+h1-h0)*y^3+(2*(h0-h1)+h2-h3)*y^2+(h2-h0)*y+h1 h0=h[lvl,2,ixpy] h1=h[lvl,2,ixpy+1] h2=h[lvl,2,ixpy+2] h3=h[lvl,2,ixpy+3] t=t+(h3-h2+h1-h0)*xpy^3+(2*(h0-h1)+h2-h3)*xpy^2+(h2-h0)*xpy+h1 h0=h[lvl,3,ixmy] h1=h[lvl,3,ixmy+1] h2=h[lvl,3,ixmy+2] h3=h[lvl,3,ixmy+3] t=t+(h3-h2+h1-h0)*xmy^3+(2*(h0-h1)+h2-h3)*xmy^2+(h2-h0)*xmy+h1 if @method==0 v=v+t elseif @method==1 v=v*(t-q[lvl,6]) endif endif endif lvl=lvl+1 endwhile if @method==1 v=v+0.5 endif if m==5 v4=v elseif m==4 v3=v elseif m==3 v2=v elseif m==2 v1=v endif m=m-1 endwhile if @version>1 && @version!=4 if v<@sealevel v=@sealevel endif if v1<@sealevel v1=@sealevel endif if v2<@sealevel v2=@sealevel endif v1=d*(v1-v)*sc v2=d*(v2-v)*sc xpy=1/sqrt(v1*v1+v2*v2+d4) x=v1*xpy y=-v2*xpy xpy=d2*xpy if @version==3 if v3<@sealevel v3=@sealevel endif if v4<@sealevel v4=@sealevel endif v3=d*(v3-v)*sc v4=d*(v4-v)*sc v=1/sqrt(v1*v1+v4*v4+d4) x=x+v1*v y=y+v4*v xpy=xpy+d2*v v=1/sqrt(v3*v3+v2*v2+d4) x=x-v3*v y=y-v2*v xpy=xpy+d2*v v=1/sqrt(v3*v3+v4*v4+d4) x=x-v3*v y=y+v4*v xpy=xpy+d2*v v=1/sqrt(x*x+y*y+xpy*xpy) x=x*v y=y*v xpy=xpy*v endif endif if @version==0 #index = @amp*(v-0.5)+0.5 elseif @version==1 if @smooth==0 || (@smooth==2 && |#z|>@bailout) if @autopower v2 = (lp-log(0.5*log(|#z|)))/log(log(|#z|)/log(|zo|)) else v2 = (lp-il*log(0.5*log(|#z|))) endif if iv==0 #index = @amp*(v + (v-v1)*v2-0.5)+0.5 else x = #numiter+v2 if @logiter==1 x = log(1+x) elseif @logiter==2 x = log(1+log(1+x)) endif #index = iv*x + iw*@amp*(v + (v-v1)*v2-0.5)+0.5 endif elseif @smooth>0 if @autopowerc if @absc v2 = (clp-log(-0.5*log(|#z-@cvalue|))) \ /log(log(|#z-@cvalue|)/log(|zo-@cvalue|)) else v2 = (clp-log(-0.5*log(|#z-zo|)))/log(log(|#z-zo|)/log(|zo-zo1|)) endif elseif @absc v2 = (clp - cil*log(-0.5*log(|#z-@cvalue|))) else v2 = (clp - cil*log(-0.5*log(|#z-zo|))) endif if !@autopowerc || @usecfudge v2 = v2*@fudgec endif if @zbasin==1 v = v + @zscale*abs(real(2.0*#pi+atan2(#z))) v1 = v1 + @zscale*abs(real(2.0*#pi+atan2(zo))) elseif @zbasin==2 v = v + @zscale*abs(real(#z)) v1 = v1 + @zscale*abs(real(zo)) elseif @zbasin==3 v = v + @zscale*abs(imag(#z)) v1 = v1 + @zscale*abs(imag(zo)) elseif @zbasin==4 v = v + @zscale*abs(real(#z)+imag(#z)) v1 = v1 + @zscale*abs(real(zo)+imag(zo)) elseif @zbasin==5 v = v + @zscale*abs(2*real(#z)+imag(#z)) v1 = v1 + @zscale*abs(2*real(zo)+imag(zo)) elseif @zbasin==6 v = v + @zscale*abs(real(#z)+2*imag(#z)) v1 = v1 + @zscale*abs(real(zo)+2*imag(zo)) elseif @zbasin==7 v = v + @zscale*abs(real(#z)/(abs(imag(#z))+1)) v1 = v1 + @zscale*abs(real(zo)/(abs(imag(zo))+1)) elseif @zbasin==8 v = v + @zscale*abs(imag(#z)/(abs(real(#z))+1)) v1 = v1 + @zscale*abs(imag(zo)/(abs(real(zo))+1)) elseif @zbasin==9 v = v + @zscale*abs(2*real(sqrt(#z))+imag(sqrt(#z))) v1 = v1 + @zscale*abs(2*real(sqrt(zo))+imag(sqrt(zo))) elseif @zbasin==10 v = v + @zscale*abs(real(sqrt(#z))+2*imag(sqrt(#z))) v1 = v1 + @zscale*abs(real(sqrt(zo))+2*imag(sqrt(zo))) endif if ivc==0 #index = @amp*(v + (v-v1)*v2-0.5)+0.5 else x = #numiter+v2 if @logiterc==1 x = log(1+x) elseif @logiterc==2 x = log(1+log(1+x)) endif #index = ivc*x + iwc*@amp*(v + (v-v1)*v2-0.5)+0.5 endif else #index = @amp*(v-0.5)+0.5 endif elseif @version==4 if (real(#z)<0) v2 = 1+@finalzfixc*real(#z) if ivc==0 #index = @amp*(v1+(v-v1)*v2-0.5)+0.5 else x = #numiter+v2 if @logiterc==1 x = log(1+x) elseif @logiterc==2 x = log(1+log(1+x)) endif #index = ivc*x + iwc*@amp*(v1+(v-v1)*v2-0.5)+0.5 endif else v2 = @finalzfix*real(#z) if iv==0 #index = @amp*(v1+(v-v1)*v2-0.5)+0.5 else x = #numiter+v2 if @logiter==1 x = log(1+x) elseif @logiter==2 x = log(1+log(1+x)) endif #index = iv*x + iw*@amp*(v1+(v-v1)*v2-0.5)+0.5 endif endif else #index = (lx*x+ly*y+lz*xpy)*(1-@ambient)+@ambient endif default: title = "MMF3 Alternative fBm" param version caption = "Version" enum = "Standard" "Smoothed" "Slope (3 points)" "Slope (5 points)" "Final z smoothed" hint = "Smoothed is for non-pixel formulas and in many cases \ will allow you to avoid iteration banding. The Slope \ versions are designed for use with Pixel formulas only. \ 'Final z smoothed' is for use with main formulas passing \ a smoothing fraction as the final z value eg. using Hinrich." endparam param alterit caption = "Alter fBm seed" default = false hint = "Modifies the fBm seed to consider all values of z." visible = @version==1 || @version==4 endparam param fixstartz caption = "Fix zold" default = false hint = "The original version starts with zolder set to (0,0), use this to \ set it to the start value of z instead." endparam heading caption = "Smoothing parameter/s" visible = @version==1 || @version==4 endheading param smooth caption = "Smoothing type" enum = "Divergent" "Convergent" "Both" default = 0 hint = "Allows you to select standard smoothing for convergent \ or divergent areas or both." visible = @version==1 endparam param autopower caption = "Auto-power" default = false hint = "When enabled you should get correct smoothing on any divergent \ fractal without having to supply a power value and smoothing with \ low bailout values is further improved." visible = @version==1 && (@smooth==0 || @smooth==2) endparam param power caption = "Formula power" default = 2.0 hint = "This should match the power/degree/exponent used \ in the main formula." visible = @version==1 && (@smooth==0 || @smooth==2) && !@autopower endparam param bailout caption = "Formula bailout" default = 16.0 hint = "This should match the bailout used in the main \ formula when using standard smoothing (smaller values work best). \ When using Hinrich (finalz) smoothing it just modifies the \ fBm frequency." visible = (@version==1 && (@smooth==0 || @smooth==2)) || @version==4 endparam param finalzfix caption = "Fudge (div)" default = 1.0 hint = "Use to scale the divergent Hinrich finalz fraction when it \ doesn't fully range from 0 to 1." visible = @version==4 endparam param iterval caption = "Add iter (div)" default = 0.0 hint = "Use to add some of the smooth iteration value to divergent areas." visible = @version==4 || (@version==1 && (@smooth==0 || @smooth==2)) endparam param iterweight caption = "Iter %age (div)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @iterval!=0 && (@version==4 || (@version==1 && (@smooth==0 || @smooth==2))) endparam param logiter caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @iterval!=0 && @iterweight!=0 \ && (@version==4 || (@version==1 && (@smooth==0 || @smooth==2))) endparam param autopowerc caption = "Auto-power (conv)" default = false hint = "When enabled you should get correct smoothing on any convergent \ fractal without having to supply a power value." visible = @version==1 && @smooth>0 endparam param powerc caption = "Power (conv)" default = 2.0 hint = "This should match the degree of covergence in your fractal, \ eg. 2 for Newton." visible = @version==1 && @smooth>0 && !@autopowerc endparam param bailout1 caption = "Convergent bailout" default = 1e-5 hint = "This should match the small bailout used in the main \ formula." visible = @version==1 && @smooth>0 endparam param finalzfixc caption = "Fudge (conv)" default = 1.0 hint = "Use to scale the convergent Hinrich finalz fraction when it \ doesn't fully range from 0 to 1." visible = @version==4 endparam param usecfudge caption = "Use scaling fudge" default = false hint = "Allows you to enable use of the convergent scaling fudge \ when using 'Auto-power (conv)'." visible = @version==1 && @smooth>0 && @autopowerc endparam param fudgec caption = "Scaling Fudge" default = 1.0 hint = "This is a scaling fudge value, it's used to scale \ the calculated iteration fraction when the value \ doesn't reach 1. If 'Auto-power (conv)' or the best value you can \ find for the 'Power (conv)' parameter don't \ produce smooth results then modifying this value \ should help." visible = @version==1 && @smooth>0 && (!@autopowerc || @usecfudge) endparam param absc caption = "Absolute convergence" default = false hint = "Use with main formulas that test for convergence using \ only |z-value| rather than |z-zold| eg. some Magnet formulas." visible = @version==1 && @smooth>0 endparam param cvalue caption = "Convergence value" default = (1,0) hint = "Should match the value the main formula uses when testing \ for convergence." visible = @version==1 && @smooth>0 && @absc endparam param itervalc caption = "Add iter (conv)" default = 0.0 hint = "Use to add some of the smooth iteration value to convergent areas." visible = @version==4 || (@version==1 && @smooth>0) endparam param iterweightc caption = "Iter %age (conv)" default = 50.0 hint = "Allows you to control the mixing of the smooth iteration value \ and the normal formula colouring value. Zero will use no iteration \ value and 100 will use all iteration value." visible = @itervalc!=0 && (@version==4 || (@version==1 && @smooth>0)) endparam param logiterc caption = "+Iter function" enum = "Ident" "Log()" "Log(Log())" hint = "Allows you to apply log or double log to the iteration component." visible = @itervalc!=0 && @iterweightc!=0 \ && (@version==4 || (@version==1 && @smooth>0)) endparam param zbasin caption = "Add z basins" enum = "Off" "abs(atan2())" "abs(real())" "abs(imag())" "abs(real+imag)" \ "abs(2*real+imag)" "abs(2*imag+real)" "abs(real/(abs(imag)+1))" \ "abs(imag/(abs(real)+1))" "Roots 1" "Roots 2" default = 0 hint = "Allows you to add a value to the final colouring based on the \ penultimate value of z." visible = @version==1 && @smooth>0 endparam param zscale caption = "Basin scale" default = 0.1 hint = "Scales the effect of the z basin value." visible = @version==1 && @smooth>0 && @zbasin>0 endparam param cscale caption = "fBm scale (conv)" default = 1.0 hint = "Allows you to adjust the fBm frequency in convergent areas." visible = @version==4 || (@version==1 && @smooth>0) endparam heading caption = "Slope parameters" visible = @version>1 && @version!=4 endheading param showslope caption = "Show slope parameters" default = true visible = @version>1 && @version!=4 endparam param scale caption = "Height scale" default = 1.0 min = 0 hint = "Scales the height values used for the lighting \ calculations, the smaller the value the less \ defined the lighting becomes." visible = (@version>1 && @version!=4) && @showslope endparam param offscale caption = "Offset scale" default = 1.0 min = 0 hint = "Adjusts the lighting detail, the larger the value \ the more detailed the lighting. You may wish to use \ larger values at higher magnification or for larger \ image sizes. Changes in this may require changes \ to the Height scale as well." visible = (@version>1 && @version!=4) && @showslope endparam param ambient caption = "Ambient light" default = 0.25 min = 0.0 max = 1.0 hint = "Sets the ambient (background) light level, typically \ use values from 0 to 0.6" visible = (@version>1 && @version!=4) && @showslope endparam param lightx caption = "Light elevation (degrees)" default = 60.0 min = 0.0 max = 90.0 hint = "Sets the elevation of the light, zero is horizontal \ and 90 is vertical." visible = (@version>1 && @version!=4) && @showslope endparam param lightz caption = "Light direction (degrees)" default = -45.0 hint = "Sets the direction of the light: 0 = from the top, \ +90 = from the right, -90 = from the left, 180 = \ from the bottom." visible = (@version>1 && @version!=4) && @showslope endparam param sealevel caption = "Sea level" default = 0.0 min = 0.0 hint = "In the lighting calculation any heights below this \ are flattened to this value. This produces areas \ of constant brightness." visible = (@version>1 && @version!=4) && @showslope endparam heading caption = "Main fBm parameters" endheading param showmain caption = "Show fBm parameters" default = true endparam param method caption = "Level mixing" enum = "Normal (sum)" "Product" default = 0 visible = @showmain endparam param mode caption = "Method" enum = "Normal" "Div 2" "Div 4" "Div 8" default = 0 visible = @showmain endparam param average caption = "Averaging" enum = "Normal" "Cubic" default = 0 hint = "Using Cubic is a bit slower but tends to produce \ slightly smoother results." visible = @showmain endparam param seed caption = "Seed" default = 123456 hint = "The seed for the random, change for different patterns." visible = @showmain endparam param inter caption = "Interpolation" enum = "Linear" "Cubic" default = 0 hint = "Cubic is probably just overkill only really needed \ when at high magnification." visible = @showmain endparam param frac caption = "Overall Sharpness" default = 0.7071 min = 1e-5 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results, if the result of multiplying \ this value by the sharpness for a given layer is >=1 then \ that layer will effectively be completely random." visible = @showmain endparam param rs caption = "Overall Frequency" default = 1.0 min = 1e-5 hint = "Controls the scale of the patterns." visible = @showmain endparam param amp caption = "Overall Amplitude" default = 2.8 min = 1e-5 hint = "Scales the final index value keeping the average \ index at 0.5, you may need to reduce the value \ if using less than 8 levels of fBm and you want to \ avoid the colours wrapping." visible = (@version<2 || @version==4) && @showmain endparam param dice caption = "#Dice to use" default = 1.0 min = 1.0 max = 65.0 hint = "Changing the number of dice used will affect the \ character of the fBm." visible = @showmain endparam param dummy caption = "#Dice to roll" default = 0 min = 0 max = 64 hint = "Anything greater than #Dice to use forces the \ total dice rolled whether they are all used or \ not. This means gradual changes to #Dice to use \ will produce gradual changes in the fBm provided \ #Dice to use stays <= #Dice to roll." visible = @showmain endparam param morph caption = "Morphing" default = false hint = "When enabled, eg. if the #Dice to use is 2.3 then the \ 1st dice roll is ignored, the second and third dice rolls \ are mixed - 0.7*second + 0.3*third - this allows true \ morphing of the fBm from one state to the next, provided \ #Dice to roll + 1 > #Dice to use." endparam param exp caption = "Exponent" default = 1.0 hint = "Changes the nature of the fBm. With values >1.0 you \ may need to reduce the Overall amplitude to avoid \ areas of solid colour." visible = @showmain endparam param levels caption = "Number of levels" default = 8 min = 1 max = 16 hint = "The number of levels of fBm to mix." visible = @showmain endparam param showmaps caption = "Show fBm levels" default = false endparam heading caption = "fBm level 1" visible = @showmaps endheading param flag0 caption = "Level 1 status" default = true hint = "Use to enable/disable fBm level 1." visible = @showmaps endparam param frac0 caption = "Sharpness #1" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && @flag0 endparam param rs0 caption = "Frequency #1" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && @flag0 endparam param amp0 caption = "Amplitude #1" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #1." visible = @showmaps && @flag0 endparam param ang0 caption = "Rotation #1 (degrees)" default = 0.0 hint = "Rotates the pattern." visible = @showmaps && @flag0 endparam heading caption = "fBm level 2" visible = @showmaps && (@levels>1) endheading param flag1 caption = "Level 2 status" default = true hint = "Use to enable/disable fBm level 2." visible = @showmaps && (@levels>1) endparam param frac1 caption = "Sharpness #2" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>1) && @flag1 endparam param rs1 caption = "Frequency #2" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>1) && @flag1 endparam param amp1 caption = "Amplitude #2" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #2." visible = @showmaps && (@levels>1) && @flag1 endparam param ang1 caption = "Rotation #2 (degrees)" default = 22.5 hint = "Rotates the pattern." visible = @showmaps && (@levels>1) && @flag1 endparam heading caption = "fBm level 3" visible = @showmaps && (@levels>2) endheading param flag2 caption = "Level 3 status" default = true hint = "Use to enable/disable fBm level 3." visible = @showmaps && (@levels>2) endparam param frac2 caption = "Sharpness #3" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>2) && @flag2 endparam param rs2 caption = "Frequency #3" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>2) && @flag2 endparam param amp2 caption = "Amplitude #3" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #3." visible = @showmaps && (@levels>2) && @flag2 endparam param ang2 caption = "Rotation #3 (degrees)" default = 11.25 hint = "Rotates the pattern." visible = @showmaps && (@levels>2) && @flag2 endparam heading caption = "fBm level 4" visible = @showmaps && (@levels>3) endheading param flag3 caption = "Level 4 status" default = true hint = "Use to enable/disable fBm level 4." visible = @showmaps && (@levels>3) endparam param frac3 caption = "Sharpness #4" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>3) && @flag3 endparam param rs3 caption = "Frequency #4" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>3) && @flag3 endparam param amp3 caption = "Amplitude #4" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #4." visible = @showmaps && (@levels>3) && @flag3 endparam param ang3 caption = "Rotation #4 (degrees)" default = 33.75 hint = "Rotates the pattern." visible = @showmaps && (@levels>3) && @flag3 endparam heading caption = "fBm level 5" visible = @showmaps && (@levels>4) endheading param flag4 caption = "Level 5 status" default = true hint = "Use to enable/disable fBm level 5." visible = @showmaps && (@levels>4) endparam param frac4 caption = "Sharpness #5" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>4) && @flag4 endparam param rs4 caption = "Frequency #5" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>4) && @flag4 endparam param amp4 caption = "Amplitude #5" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #5." visible = @showmaps && (@levels>4) && @flag4 endparam param ang4 caption = "Rotation #5 (degrees)" default = 16.875 hint = "Rotates the pattern." visible = @showmaps && (@levels>4) && @flag4 endparam heading caption = "fBm level 6" visible = @showmaps && (@levels>5) endheading param flag5 caption = "Level 6 status" default = true hint = "Use to enable/disable fBm level 6." visible = @showmaps && (@levels>5) endparam param frac5 caption = "Sharpness #6" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>5) && @flag5 endparam param rs5 caption = "Frequency #6" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>5) && @flag5 endparam param amp5 caption = "Amplitude #6" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #6." visible = @showmaps && (@levels>5) && @flag5 endparam param ang5 caption = "Rotation #6 (degrees)" default = 39.375 hint = "Rotates the pattern." visible = @showmaps && (@levels>5) && @flag5 endparam heading caption = "fBm level 7" visible = @showmaps && (@levels>6) endheading param flag6 caption = "Level 7 status" default = true hint = "Use to enable/disable fBm level 7." visible = @showmaps && (@levels>6) endparam param frac6 caption = "Sharpness #7" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>6) && @flag6 endparam param rs6 caption = "Frequency #7" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>6) && @flag6 endparam param amp6 caption = "Amplitude #7" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #7." visible = @showmaps && (@levels>6) && @flag6 endparam param ang6 caption = "Rotation #7 (degrees)" default = 28.125 hint = "Rotates the pattern." visible = @showmaps && (@levels>6) && @flag6 endparam heading caption = "fBm level 8" visible = @showmaps && (@levels>7) endheading param flag7 caption = "Level 8 status" default = true hint = "Use to enable/disable fBm level 8." visible = @showmaps && (@levels>7) endparam param frac7 caption = "Sharpness #8" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>7) && @flag7 endparam param rs7 caption = "Frequency #8" default = 1.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>7) && @flag7 endparam param amp7 caption = "Amplitude #8" default = 1.0 min = 0 hint = "Controls the relative effect of fBm level #8." visible = @showmaps && (@levels>7) && @flag7 endparam param ang7 caption = "Rotation #8 (degrees)" default = 5.625 hint = "Rotates the pattern." visible = @showmaps && (@levels>7) && @flag7 endparam heading caption = "fBm level 9" visible = @showmaps && (@levels>8) endheading param flag8 caption = "Level 9 status" default = true hint = "Use to enable/disable fBm level 9." visible = @showmaps && (@levels>8) endparam param frac8 caption = "Sharpness #9" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>8) && @flag8 endparam param rs8 caption = "Frequency #9" default = 2.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>8) && @flag8 endparam param amp8 caption = "Amplitude #9" default = 0.5 min = 0 hint = "Controls the relative effect of fBm level #9." visible = @showmaps && (@levels>8) && @flag8 endparam param ang8 caption = "Rotation #9 (degrees)" default = 19.6875 hint = "Rotates the pattern." visible = @showmaps && (@levels>8) && @flag8 endparam heading caption = "fBm level 10" visible = @showmaps && (@levels>9) endheading param flag9 caption = "Level 10 status" default = true hint = "Use to enable/disable fBm level 10." visible = @showmaps && (@levels>9) endparam param frac9 caption = "Sharpness #10" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>9) && @flag9 endparam param rs9 caption = "Frequency #10" default = 2.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>9) && @flag9 endparam param amp9 caption = "Amplitude #10" default = 0.5 min = 0 hint = "Controls the relative effect of level #10." visible = @showmaps && (@levels>9) && @flag9 endparam param ang9 caption = "Rotation #10 (degrees)" default = 36.5625 hint = "Rotates the pattern." visible = @showmaps && (@levels>9) && @flag9 endparam heading caption = "fBm level 11" visible = @showmaps && (@levels>10) endheading param flag10 caption = "Level 11 status" default = true hint = "Use to enable/disable fBm level 11." visible = @showmaps && (@levels>10) endparam param frac10 caption = "Sharpness #11" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>10) && @flag10 endparam param rs10 caption = "Frequency #11" default = 2.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>10) && @flag10 endparam param amp10 caption = "Amplitude #11" default = 0.5 min = 0 hint = "Controls the relative effect of fBm level #11." visible = @showmaps && (@levels>10) && @flag10 endparam param ang10 caption = "Rotation #11 (degrees)" default = 8.4375 hint = "Rotates the pattern." visible = @showmaps && (@levels>10) && @flag10 endparam heading caption = "fBm level 12" visible = @showmaps && (@levels>11) endheading param flag11 caption = "Level 12 status" default = true hint = "Use to enable/disable fBm level 12." visible = @showmaps && (@levels>11) endparam param frac11 caption = "Sharpness #12" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>11) && @flag11 endparam param rs11 caption = "Frequency #12" default = 4.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>11) && @flag11 endparam param amp11 caption = "Amplitude #12" default = 0.25 min = 0 hint = "Controls the relative effect of fBm level #12." visible = @showmaps && (@levels>11) && @flag11 endparam param ang11 caption = "Rotation #12 (degrees)" default = 25.3125 hint = "Rotates the pattern." visible = @showmaps && (@levels>11) && @flag11 endparam heading caption = "fBm level 13" visible = @showmaps && (@levels>12) endheading param flag12 caption = "Level 13 status" default = true hint = "Use to enable/disable fBm level 13." visible = @showmaps && (@levels>12) endparam param frac12 caption = "Sharpness #13" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>12) && @flag12 endparam param rs12 caption = "Frequency #13" default = 4.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>12) && @flag12 endparam param amp12 caption = "Amplitude #13" default = 0.25 min = 0 hint = "Controls the relative effect of fBm level #13." visible = @showmaps && (@levels>12) && @flag12 endparam param ang12 caption = "Rotation #13 (degrees)" default = 14.0625 hint = "Rotates the pattern." visible = @showmaps && (@levels>12) && @flag12 endparam heading caption = "fBm level 14" visible = @showmaps && (@levels>13) endheading param flag13 caption = "Level 14 status" default = true hint = "Use to enable/disable fBm level 14." visible = @showmaps && (@levels>13) endparam param frac13 caption = "Sharpness #14" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>13) && @flag13 endparam param rs13 caption = "Frequency #14" default = 8.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>13) && @flag13 endparam param amp13 caption = "Amplitude #14" default = 0.125 min = 0 hint = "Controls the relative effect of fBm level #14." visible = @showmaps && (@levels>13) && @flag13 endparam param ang13 caption = "Rotation #14 (degrees)" default = 30.9375 hint = "Rotates the pattern." visible = @showmaps && (@levels>13) && @flag13 endparam heading caption = "fBm level 15" visible = @showmaps && (@levels>14) endheading param flag14 caption = "Level 15 status" default = true hint = "Use to enable/disable fBm level 15." visible = @showmaps && (@levels>14) endparam param frac14 caption = "Sharpness #15" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>14) && @flag14 endparam param rs14 caption = "Frequency #15" default = 16.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>14) && @flag14 endparam param amp14 caption = "Amplitude #15" default = 0.0625 min = 0 hint = "Controls the relative effect of fBm level #15." visible = @showmaps && (@levels>14) && @flag14 endparam param ang14 caption = "Rotation #15 (degrees)" default = 2.8125 hint = "Rotates the pattern." visible = @showmaps && (@levels>14) && @flag14 endparam heading caption = "fBm level 16" visible = @showmaps && (@levels>15) endheading param flag15 caption = "Level 16 status" default = true hint = "Use to enable/disable fBm level 16." visible = @showmaps && (@levels>15) endparam param frac15 caption = "Sharpness #16" default = 0.7071 min = 1e-5 max = 1.0 hint = "Controls the sharpness of the fBm, lower values \ produce smoother results." visible = @showmaps && (@levels>15) && @flag15 endparam param rs15 caption = "Frequency #16" default = 32.0 hint = "Controls the scale of the patterns." visible = @showmaps && (@levels>15) && @flag15 endparam param amp15 caption = "Amplitude #16" default = 0.03125 min = 0 hint = "Controls the relative effect of level #16." visible = @showmaps && (@levels>15) && @flag15 endparam param ang15 caption = "Rotation #16 (degrees)" default = 42.1875 hint = "Rotates the pattern." visible = @showmaps && (@levels>15) && @flag15 endparam }