AvariantM { ; by Ed Algra, 2007-11-09 ; With thanks to Albert Smooks for his great suggestion in: ; http://orbittrap.blogspot.com/2007_08_01_archive.html global: huge = (1e60,1e60) float small = 1e-20 float con=#pi/180 float twopi = 2*#pi float halfpi = 0.5*#pi float hka_a = @alpha_a*con ; alpha in radians float hkbr_a = real(@gamma_a)*con float hkbi_a = imag(@gamma_a)*con float hka_b = @alpha_b*con float hkbr_b = real(@gamma_b)*con float hkbi_b = imag(@gamma_b)*con ; init: z = @start_a c = #pixel z_old = (0,0) z1 = (0,0) bool keep_going = true float temp0 = 0 t1 = (0,0) t2 = (0,0) t3 = (0,0) t4 = (0,0) ua = (0,0) ub = (0,0) va = (0,0) vb = (0,0) numerator = (0,0) denominator = (0,0) fraction = (0,0) float angle = 0 int iter = 0 offset = (0,.5) bool flag = true bool vlag = true float x = 0 float y = 0 float ta = 0 float tb = 0 keep_going = true ; loop: ; iter=iter+1 z_old=z ; ;======================================= ; formula a (executed every iteration) M ;======================================= ; Mandelbrot related polynoms (a) M ;======================================= ; if @fractal_a==0 ; Mandelbrot if @nsa==false ; standard A z = z^@ap001 + c else ; nsa true t1 = @a001*@fa001(z)^@ap001 if @term_a>0 ; 2, 3 or 4 terms t2 = @a002*@fa002(z)^@ap002 endif if @term_a>1 ; 3 or 4 terms t3 = @a003*@fa003(z)^@ap003 endif if @term_a>2 ; 4 terms t4 = @a004*@fa004(z)^@ap004 endif if @term_a==0 ; 1 term if @alloc_a00==0 ; all ua = t1 + @fca(c) elseif @alloc_a00==1 ; part ua = t1 va = @fca(c) endif elseif @term_a==1 ; 2 terms if @alloc_a01==0 ; all ua = t1 + t2 + @fca(c) elseif @alloc_a01==1 ; part 1 ua = t1 + t2 va = @fca(c) elseif @alloc_a01==2 ; part 2 ua = t1 va = t2 + @fca(c) endif elseif @term_a==2 ; 3 terms if @alloc_a02==0 ; all ua = t1 + t2 + t3 + @fca(c) elseif @alloc_a02==1 ; part 1 ua = t1 + t2 + t3 va = @fca(c) elseif @alloc_a02==2 ; part 2 ua = t1 + t2 va = t3 + @fca(c) elseif @alloc_a02==3 ; part 3 ua = t1 va = t2 + t3 + @fca(c) endif else ; 4 terms if @alloc_a03==0 ; all ua = t1 + t2 + t3 + t4 + @fca(c) elseif @alloc_a03==1 ; part 1 ua = t1 + t2 + t3 + t4 va = @fca(c) elseif @alloc_a03==2 ; part 2 ua = t1 + t2 + t3 va = t4 + @fca(c) elseif @alloc_a03==3 ; part 3 ua = t1 + t2 va = t3 + t4 + @fca(c) elseif @alloc_a03==4 ; part 4 ua = t1 va = t2 + t3 + t4 + @fca(c) endif ; alloc endif ; term endif ; nsa ; end Mandelbrot polynoms ; ;================================================ ; Lattes (a) M ;================================================ ; elseif @fractal_a==1 z = z + offset if @nsa==false ; standard A denominator = z*(z^2-1) ; noemer if denominator==(0,0) z = huge else z = c*(1+z^2)^2/denominator endif else ; nsa true t1 = @a011*@fa011(z)^@ap011 numerator = @fca(c)*(@a01t+t1)^@ap010 ; teller c*(at + a1.z^p1)^p0 if @var_a1==0 ; basic denominator = @a012*z*(@fa012(z)^@ap012-(1,0)) ; noemer a2.z(z^p2 - 1) elseif @var_a1==1 ; plus denominator = @a012*(@fa012(z)^@ap012 - @fa012(z)^(@ap012-@a01n)) ; noemer a2(z^p2 - z^(p2-a0)) elseif @var_a1==2 ; enhanced t2 = @a012*@fa012(z)^@ap012 t3 = @a013*@fa013(z)^@ap013 denominator = t3-t2 ; noemer a3.p3.z^p3 - a2.p2.z^p2 endif if denominator==(0,0) denominator = e-30 endif if @alloc_a1==0 ; all ua = numerator/denominator elseif @alloc_a1==1 ; smooks op teller ua = numerator elseif @alloc_a1==2 ; smooks op noemer ua = denominator endif ; alloc ; in Lattes va = zero endif ; nsa ; endif ; Lattes ; ;================================================== ; Talis (a) M ;================================================== ; elseif @fractal_a==2 if @var_a2==0 ; andere talisvariaties later if @nsa==false ; standard A denominator = @a020+z ; noemer if denominator==(0,0) z = huge else z = z^@ap021/denominator + c endif else ; nsa true numerator = @a021*@fa021(z)^@ap021 t1 = @a022*@fa022(z)^@ap022 denominator = @a020+t1 if denominator==(0,0) denominator = e-30 endif if @alloc_a2>0 va = @fca(c) endif if @alloc_a2==0 ; on all fraction = numerator/denominator ua = fraction + @fca(c) elseif @alloc_a2==1 ; on fraction ua = numerator/denominator ; fraction elseif @alloc_a2==2 ; on numerator ua = numerator elseif @alloc_a2==3 ; on denominator ua = denominator endif ; alloc endif ; nsa endif ; var ; endif ******* einde Talis*********** ; ;================================================== ; Combination of z & c in 3 terms (including c) (a) ;================================================== ; elseif @fractal_a==3 t1 = @a031*@fa031(z)^@ap031 t2 = @a032*@fa032(z)^@ap032*@fa033(c)^@ap033 if @alloc_a3==0 ua = t1 + t2 + @fca(c) elseif @alloc_a3==1 ua = t1 + t2 va = @fca(c) elseif @alloc_a3==2 ua = t1 + @fca(c) va = t2 elseif @alloc_a3==3 ua = t2 + @fca(c) va = t1 elseif @alloc_a3==4 ua = t1 va = t2 + @fca(c) elseif @alloc_a3==5 ua = t2 va = t1 + @fca(c) elseif @alloc_a3==6 ua = @fca(c) va = t1 + t2 endif endif ; combi z&c en @fractal_a ; ;========================= ; Smooks operations (a) M ;========================= ; if ((@nsa==true && @fractal_a<3) || (@fractal_a>2)) if @sma==true ta = atan2(ua) if ta<0 ta = ta + twopi endif if @mode_a>3 x = real(ua) y = imag(ua) endif if @mode_a==1 ; alfa and beta not involved (original Smooks; 2 segments) ua = abs(ua) elseif @mode_a==2 ; 3 segments if ((@subma==false && ta>halfpi && ta<=hka_a) || (@subma==true && ta>hka_a)) ua = abs(ua) endif elseif @mode_a==3 ; 4 segments if ((@subma==false && ta>=hkbr_a && tahalfpi && ta<=hkbr_a) || ta>hkbi_a))) ua = abs(ua) endif elseif @mode_a==4 ; south reflecting to north if y<0 y = -y endif elseif @mode_a==5 ; west reflecting to east if x<0 x = -x endif endif if @mode_a>3 ua = x + flip(y) endif if ((@flipper_a==1 && real(ua)>=1 && imag(ua)>=1) || @flipper_a==2) ua = flip(ua) endif endif ; sma ; ;--- end smooks / joining u and v to z ------------------------------- ; if (@fractal_a==0 || @fractal_a==3) ; polynoms if (@alloc_a00==0 && @alloc_a01==0 && @alloc_a02==0 && @alloc_a03==0 \ && @alloc_a3==0) ; va=(0,0) z = ua else z = @as*ua + va endif endif ; if @fractal_a==1 ; lattes if @alloc_a1==0 z = ua elseif @alloc_a1==1 z = @as*ua/denominator elseif @alloc_a1==2 z = @as*numerator/ua endif ; nsa elseif @fractal_a==2 ; talis if @alloc_a2==0 z = ua elseif @alloc_a2==1 z= @as*ua + va elseif @alloc_a2==2 z = @as*ua/denominator + va elseif @alloc_a2==3 z = @as*numerator/ua + va endif endif endif ; nsa ; ;================================================== ; formula b (executed only at certain conditions) M ;================================================== ; if @q>0 ; first requirement for executing B if vlag==true z = @scala * z ; scaling of A (only when also B is active) vlag = false endif if @parallel==true z1 = z ; safe for later use z = z_old ; further with again the original z endif if @q>@threshold && @q<@gate ; second requirement for executing B ; (iteratie inside 'window') temp0 = iter/@q if temp0-round(temp0)==0 ; third requirement for executing B if flag==true z = z + @start_b flag = false endif ; ;================================================ ; Mandelbrot and polynoms (b) M ;================================================ ; if @fractal_b==0 ; Mandelbrot if @nsb==false ; standard B z = z^@bp001 + c else ; nsb true t1 = @b001*@fb001(z)^@bp001 if @term_b>0 ; 2, 3 or 4 terms t2 = @b002*@fb002(z)^@bp002 endif if @term_b>1 ; 3 or 4 terms t3 = @b003*@fb003(z)^@bp003 endif if @term_b>2 ; 4 terms t4 = @b004*@fb004(z)^@bp004 endif if @term_b==0 ; 1 term if @alloc_b00==0 ; all ub = t1 + @fcb(c) elseif @alloc_b00==1 ; part 1 ub = t1 vb = @fcb(c) endif elseif @term_b==1 ; 2 terms if @alloc_b01==0 ; all ub = t1 + t2 + @fcb(c) elseif @alloc_b01==1 ; part 1 ub = t1 + t2 vb = @fcb(c) elseif @alloc_b01==2 ; part 2 ub = t1 vb = t2 + @fcb(c) endif elseif @term_b==2 ; 3 terms if @alloc_b02==0 ; all ub = t1 + t2 + t3 + @fcb(c) elseif @alloc_b02==1 ; part 1 ub = t1 + t2 + t3 vb = @fcb(c) elseif @alloc_b02==2 ; part 2 ub = t1 + t2 vb = t3 + @fcb(c) elseif @alloc_b02==3 ; part 3 ub = t1 vb = t2 + t3 + @fcb(c) endif else ; 4 terms if @alloc_b03==0 ; all ub = t1 + t2 + t3 + t4 + @fcb(c) elseif @alloc_b03==1 ; part 1 ub = t1 + t2 + t3 + t4 vb = @fcb(c) elseif @alloc_b03==2 ; part 2 ub = t1 + t2 + t3 vb = t4 + @fcb(c) elseif @alloc_b03==3 ; part 3 ub = t1 + t2 vb = t3 + t4 + @fcb(c) elseif @alloc_b03==4 ; part 4 ub = t1 vb = t2 + t3 + t4 + @fcb(c) endif ; alloc endif ; term endif ; nsb ; end Mandelbrot polynoms ; ;================================================ ; Lattes (b) M ;================================================ ; elseif @fractal_b==1 z = z + offset if @nsb==false ; standard A denominator = z*(z^2-1) ; noemer if denominator==(0,0) z = huge else z = c*(1+z^2)^2/denominator endif else ; nsb true t1 = @b011*@fb011(z)^@bp011 numerator = @fcb(c)*(@b01t+t1)^@bp010 ; teller c*(bt + b1.z^p1)^p0 if @var_b1==0 ; basic denominator = @b012*z*(@fb012(z)^@bp012-(1,0)) ; noemer b2.z(z^p2 - 1) elseif @var_b1==1 ; plus denominator = @b012*(@fb012(z)^@bp012 - @fb012(z)^(@bp012-@b01n)) ; noemer b1(p2^p2 - z^(p2-b0)) elseif @var_b1==2 ; enhanced t2 = @b012*@fb012(z)^@bp012 t3 = @b013*@fb013(z)^@bp013 denominator = t3-t2 ; noemer b3.p3.z^p3 - b2.p2.z^p2 endif if denominator==(0,0) denominator = e-30 endif if @alloc_b1==0 ; all ub = numerator/denominator elseif @alloc_b1==1 ; smooks op teller ub = numerator elseif @alloc_b1==2 ; smooks op noemer ub = denominator endif ; alloc ; in Lattes vb always zero endif ; nsb ; end Lattes ; ;================================================== ; Talis (b) M ;================================================== ; elseif @fractal_b==2 if @var_b2==0 ; (other talis variations later) if @nsb==false ; standard B denominator = @b020+z ; noemer if denominator==(0,0) z = huge else z = z^@bp021/denominator + c endif else ; nsb true numerator = @b021*@fb021(z)^@bp021 t1 = @b022*@fb022(z)^@bp022 denominator = @b020+t1 if denominator==(0,0) denominator = e-30 endif if @alloc_b2>0 vb = @fcb(c) endif if @alloc_b2==0 ; on all fraction = numerator/denominator ub = fraction + @fcb(c) elseif @alloc_b2==1 ; on fraction ub = numerator/denominator ; fraction elseif @alloc_b2==2 ; on numerator ub = numerator elseif @alloc_b2==3 ; on denominator ub = denominator endif ; alloc endif ; nsb endif ; var ; end Talis ; ;================================================== ; Combination of z & c in 3 terms (including c) (b) ;================================================== ; elseif @fractal_b==3 t1 = @b031*@fb031(z)^@bp031 t2 = @b032*@fb032(z)^@bp032*@fb033(c)^@bp033 if @alloc_b3==0 ub = t1 + t2 + @fcb(c) elseif @alloc_b3==1 ub = t1 + t2 vb = @fca(c) elseif @alloc_b3==2 ub = t1 + @fcb(c) vb = t2 elseif @alloc_b3==3 ub = t2 + @fcb(c) vb = t1 elseif @alloc_b3==4 ub = t1 vb = t2 + @fcb(c) elseif @alloc_b3==5 ub = t2 vb = t1 + @fcb(c) elseif @alloc_b3==6 ua = @fcb(c) va = t1 + t2 endif endif ; end formula z&c ; ;========================= ; Smooks operations (b) M ;========================= ; if ((@nsb==true && @fractal_b<3) || (@fractal_b>2)) if @smb==true tb = atan2(ub) if tb<0 tb = tb + twopi endif if @mode_b>3 x = real(ub) y = imag(ub) endif if @mode_b==1 ; alfa and beta not involved (original Smooks; 2 segments) ub = abs(ub) elseif @mode_b==2 ; 3 segments if ((@submb==false && tb>halfpi && tb<=hka_b) || (@submb==true && tb>hka_b)) ub = abs(ub) endif elseif @mode_b==3 ; 4 segments if ((@submb==false && tb>=hkbr_b && tbhalfpi && tb<=hkbr_b) || tb>hkbi_b))) ub = abs(ub) endif elseif @mode_b==4 ; south reflecting to north if y<0 y = -y endif elseif @mode_b==5 ; west reflecting to east if x<0 x = -x endif endif if @mode_b>3 ub = x + flip(y) endif if ((@flipper_b==1 && real(ub)>=1 && imag(ub)>=1) || @flipper_b==2) ub = flip(ub) endif endif ; smb ; ;--- end smooks / joining u and v to z -------------------------------- ; if (@fractal_b==0 || @fractal_b==3) ; polynoms if (@alloc_b00==0 && @alloc_b01==0 && @alloc_b02==0 && \ @alloc_b03==0 && @alloc_b3==0) ; vb=(0,0) z = ub else z = @bs*ub + vb endif endif ; if @fractal_b==1 ; lattes if @alloc_b1==0 z = ub elseif @alloc_b1==1 z = @bs*ub/denominator elseif @alloc_b1==2 z = @bs*numerator/ub endif ; nsb elseif @fractal_b==2 ; talis if @alloc_b2==0 z = ub elseif @alloc_b2==1 z= @bs*ub + vb elseif @alloc_b2==2 z = @bs*ub/denominator + vb elseif @alloc_b2==3 z = @bs*numerator/ub + vb endif endif endif ; nsb endif ; temp0-round(temp0)==0 endif ; @q>@threshold && @q<@gate ; ;============================== ; joining formulas a and b M ;============================== ; if @parallel==true if @option==0 ; sum z = z+z1 elseif @option==1 ; product z = z*z1 elseif @option==2 ; difference 1 z = z-z1 elseif @option==3 ; difference 2 z = z1-z elseif @option==4 ; quotient 1 if z1==0 z=huge else z = z/z1 endif elseif @option==5 ; quotient 2 z = z1/z if z==0 z = huge else z = z1/z endif elseif @option==6 ; arithm.mean z = 0.5*(z+z1) elseif @option==7 ; geom.mean z = sqrt(z*z1) elseif @option==8 ; harm.mean if (z+z1)==(0,0) z = huge else z = (2*z*z1)/(z+z1) endif elseif @option==9 z = real(z) + flip(imag(z1)) elseif @option==10 z = real(z1) + flip(imag(z)) endif else ; series if @opt==1 z = real(z) + flip(imag(z1)) elseif @opt==2 z = real(z1) + flip(imag(z)) endif ; opt(ions) endif ; parallel / series endif ; q>0 ; ;====================== ; bailout variations M ;====================== ; if (@bailout_type=="magnitude") if (|z|>@bailout_value) keep_going = false endif elseif (@bailout_type=="abs(x)") if (abs(real(z))>@bailout_value) keep_going = false endif elseif (@bailout_type=="abs(y)") if (abs(imag(z))>@bailout_value) keep_going = false endif elseif (@bailout_type=="abs(x) & abs(y)") if ((abs(real(z))>@bailout_value)&&(abs(imag(z))>@bailout_value)) keep_going = false endif elseif (@bailout_type=="abs(x) | abs(y)") if ((abs(real(z))>@bailout_value)||(abs(imag(z))>@bailout_value)) keep_going = false endif elseif (@bailout_type=="angle 1") if (atan2(z)<@bailout_value/100) keep_going = false endif elseif (@bailout_type=="angle 2") if (atan2(z)>@bailout_value/100) keep_going = false endif elseif (@bailout_type=="ellipse") if ((sqr(real(z))+@bp*sqr(imag(z)))>@bailout_value) keep_going = false endif elseif(@bailout_type=="limaçon") if (real(z)==0) angle = small else angle = atan(imag(z)/real(z)) endif if (|z|*(real(@bpp)*cos(angle)+imag(@bpp))>@bailout_value) keep_going = false endif elseif (@bailout_type=="astroid") if (real(z)==0) angle = small else angle = atan(imag(z)/real(z)) endif if (|z|*(cos(angle)^@bp+sin(angle)^@bp)>@bailout_value) keep_going = false endif endif bailout: keep_going==true ; ;----------------------------------------------------------------------------- ; default: ; ; GENERAL ; title = "AvariantM" center = (-0.5, 0) ; heading caption="General" endheading param bailout_type caption = "bailout type" default = 0 enum = "magnitude" "abs(x)" "abs(y)" "abs(x) & abs(y)" "abs(x) | abs(y)" \ "angle 1" "angle 2" "ellipse" "limaçon" "astroid" endparam float param bp caption = "bailout parameter" default = 6.0 visible = (@bailout_type==7 || @bailout_type==10) endparam param bpp caption = "bailout parameter" default = (0.5,1.0) visible = @bailout_type==8 endparam float param bailout_value caption = "bailout value" default = 100 endparam int param q caption = "decider" default = 1 min = 0 hint = "If q = 0 then formula B is disabled" endparam int param threshold caption = "threshold" default = 0 visible = @q>0 min = 0 hint = "B starts above threshold" endparam int param gate caption = "gate" default = 1000 visible = @q>0 hint = "B ends when gate is reached. When there will be \ no end then note that gate>max.iterations. \ Note that always gate>threshold" endparam bool param parallel caption = "parallel" default = false visible = @q>0 endparam param opt caption = "series options" default = 0 visible = (@q>0 && @parallel==false) enum = "normal" "var 1" "var 2" endparam param option caption = "parallel options" default = 0 visible = (@q>0 && @parallel==true) enum = "sum" "product" "difference 1" "difference 2" "quotient 1" \ "quotient 2" "arithm.mean" "geom. mean" "harm. mean" "var 1" "var 2" endparam ; ; FORMULA A ; heading caption = "Formula A" endheading param fractal_a caption = "Formula" default = 0 enum = "Mandelbrot" "Lattes" "Talis" "Combi z&c" endparam bool param nsa caption = "non-standard" default = false visible = @fractal_a<3 endparam bool param sma caption = "enable Smooks" default = false visible = ((@nsa==true && @fractal_a<3) || (@fractal_a>2)) endparam param start_a caption = "starting point A" default = (0,0) endparam param scala caption = "overall scale A" default = (1,0) hint = "this scale is lacking for formula B. By changing this scale \ it will be possible to manage the relation between A and B" visible = @q>0 endparam param as caption = "partial scale" default = (1,0) hint = "scaling only aplied to allocated terms" visible = (@nsa==true && @fractal_a==0 && @term_a==0 && @alloc_a00>0) || \ (@nsa==true && @fractal_a==0 && @term_a==1 && @alloc_a01>0) || \ (@nsa==true && @fractal_a==0 && @term_a==2 && @alloc_a02>0) || \ (@nsa==true && @fractal_a==0 && @term_a==3 && @alloc_a03>0) || \ (@nsa==true && @fractal_a==1 && @alloc_a1>0) || \ (@nsa==true && @fractal_a==2 && @alloc_a2>0) || \ (@fractal_a==3 && @alloc_a3>0) endparam func fca caption = "function c-term" default = ident() visible = (@nsa==true || @fractal_a>2) endfunc ; ; MANDELBROT POLYNOMS A ; heading caption = "Mandelbrot Polynoms" visible = @fractal_a==0 endheading param term_a caption = "active nr of terms" default = 0 enum = "1 term" "2 terms" "3 terms" "4 terms" visible = (@fractal_a==0 && @nsa==true) hint = "active terms are all except the c-term that is added at every iteration" endparam param alloc_a03 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" visible = (@fractal_a==0 && @nsa==true && @term_a==3) endparam param alloc_a02 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" visible = (@fractal_a==0 && @nsa==true && @term_a==2) endparam param alloc_a01 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" visible = (@fractal_a==0 && @nsa==true && @term_a==1) endparam param alloc_a00 caption = "allocation" default = 0 enum = "all" "part" visible = (@fractal_a==0 && @nsa==true && @term_a==0) endparam heading caption = "term 1" visible = (@fractal_a==0 && @nsa==true) endheading param a001 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true) endparam func fa001 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true) endfunc param ap001 caption = "power" default = (2,0) visible = @fractal_a==0 endparam heading caption = "term 2" visible = (@fractal_a==0 && @nsa==true && @term_a>0) endheading param a002 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true && @term_a>0) endparam func fa002 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true && @term_a>0) endfunc param ap002 caption = "power" default = (3,0) visible = (@fractal_a==0 && @nsa==true && @term_a>0) endparam heading caption = "term 3" visible = (@fractal_a==0 && @nsa==true && @term_a>1) endheading param a003 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true && @term_a>1) endparam func fa003 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true && @term_a>1) endfunc param ap003 caption = "power" default = (4,0) visible = (@fractal_a==0 && @nsa==true && @term_a>1) endparam heading caption = "term 4" visible = (@fractal_a==0 && @nsa==true && @term_a==3) endheading param a004 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true && @term_a==3) endparam func fa004 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true && @term_a==3) endfunc param ap004 caption = "power" default = (5,0) visible = (@fractal_a==0 && @nsa==true && @term_a==3) endparam ; ; LATTES A ; heading caption = "Lattes" visible = (@fractal_a==1 && @nsa==true) endheading param var_a1 caption = "variation" default = 0 enum = "basic" "plus" "enhanced" visible = (@fractal_a==1 && @nsa==true) endparam param alloc_a1 caption = "allocation" default = 0 enum = "all" "numerator" "denominator" visible = (@fractal_a==1 && @nsa==true) endparam param a01t ; lattesconstante in teller caption = "const. in numerator" default = (1,0) visible = (@fractal_a==1 && @nsa==true) endparam param a01n ; lattesconstante in noemer caption = "const. in denominator" default = (1,0) visible = (@fractal_a==1 && @nsa==true && @var_a2==1) endparam param ap010 caption = "power 0" default = (2,0) visible = (@fractal_a==1 && @nsa==true) endparam param a011 caption = "coefficient 1" default = (1,0) visible = (@fractal_a==1 && @nsa==true) endparam func fa011 caption = "function 1" default = ident() visible = (@fractal_a==1 && @nsa==true) endfunc param ap011 caption = "power 1" default = (2,0) visible = (@fractal_a==1 && @nsa==true) endparam param a012 caption = "coefficient 2" default = (1,0) visible = (@fractal_a==1 && @nsa==true) endparam func fa012 caption = "function 2" default = ident() visible = (@fractal_a==1 && @nsa==true) endfunc param ap012 caption = "power 2" default = (2,0) visible = (@fractal_a==1 && @nsa==true) endparam param a013 caption = "coefficient 3" default = (1,0) visible = (@fractal_a==1 && @nsa==true && @var_a2==2) endparam func fa013 caption = "function 3" default = ident() visible = (@fractal_a==1 && @nsa==true && @var_a2==2) endfunc param ap013 caption = "power 3" default = (3,0) visible = (@fractal_a==1 && @nsa==true && @var_a2==2) endparam ; ; TALIS A ; heading caption = "Talis" visible = @fractal_a==2 endheading param var_a2 caption = "variation" default = 0 ; voorlopig werkt alleen de default enum = "basic" visible = (@fractal_a==2 && @nsa==true) endparam param alloc_a2 caption = "allocation" default = 0 enum = "all" "fraction" "numerator" "denominator" visible = (@fractal_a==2 && @nsa==true) endparam param a020 caption = "Talis constant" default = (1,0) visible = @fractal_a==2 endparam param a021 caption = "coefficient 1" default = (1,0) visible = (@fractal_a==2 && @nsa==true) endparam func fa021 caption = "function 1" default = ident() visible = (@fractal_a==2 && @nsa==true) endfunc param ap021 caption = "power 1" default = (2,0) visible = @fractal_a==2 endparam param a022 caption = "coefficient 2" ; in denominator default = (1,0) visible = (@fractal_a==2 && @nsa==true) endparam func fa022 caption = "function 2" ; in denominator default = ident() visible = (@fractal_a==2 && @nsa==true) endfunc param ap022 ; in numerator caption = "power 2" default = (1,0) visible = (@fractal_a==2 && @nsa==true) endparam ; ; COMBI z&c A ; heading caption = "z&c" visible = @fractal_a==3 endheading param alloc_a3 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" "part 5" "part 6" visible = @fractal_a==3 endparam param a031 caption = "z&coefficient" default = (1,0) visible = @fractal_a==3 endparam func fa031 caption = "z-function" default = ident() visible = @fractal_a==3 endfunc param ap031 caption = "z-power" default = (2,0) visible = @fractal_a==3 endparam param a032 caption = "zc-coefficient" default = (1,0) visible = @fractal_a==3 endparam func fa032 caption = "z-function zc" default = ident() visible = @fractal_a==3 endfunc param ap032 caption = "z-power zc" default = (2,0) visible = @fractal_a==3 endparam func fa033 caption = "c-function zc" default = ident() visible = @fractal_a==3 endfunc param ap033 caption = "c-power zc" default = (2,0) visible = @fractal_a==3 endparam ; ; SMOOKS A ; heading caption = " Smooks" visible = @sma==true endheading param flipper_a caption = "flipper" default = 0 enum = "none" "only north-east" "all" visible = @sma==true endparam param mode_a caption = "smooks mode" default = 0 enum = "none" "original smooks" "3 segments" "4 segments" "S to N" "W to E" visible = @sma==true endparam bool param subma caption = "sub modus toggle" default = false visible = (@sma==true && (@mode_a==2 || @mode_a==3)) endparam float param alpha_a caption = "angle alpha" default = 360 min = 90 max = 360 visible = (@sma==true && (@mode_a==2 || @mode_a==3)) endparam param gamma_a caption = "(alpha/beta)" default = (90,270) min = (90,90) max = (360,360) visible = (@sma==true && @mode_a==3) endparam ; ; FORMULA B ; heading caption = "Formula B" visible = @q>0 endheading param fractal_b caption = "Formula" default = 0 enum = "Mandelbrot" "Lattes" "Talis" "Combi z&c" visible = @q>0 endparam bool param nsb caption = "non-standard" default = false visible = (@q>0 && @fractal_b<3) endparam bool param smb caption = "enable Smooks" default = false visible = (@q>0 && ((@nsb==true && @fractal_b<3) || @fractal_b>2)) endparam param start_b caption = "starting point B" default = (0,0) visible = @q>0 endparam param bs caption = "partial scale" default = (1,0) hint = "scaling only aplied to allocated terms" visible = (@q>0 && \ ((@nsb==true && @fractal_b==0 && @term_b==0 && @alloc_b00>0) || \ (@nsb==true && @fractal_b==0 && @term_b==1 && @alloc_b01>0) || \ (@nsb==true && @fractal_b==0 && @term_b==2 && @alloc_b02>0) || \ (@nsb==true && @fractal_b==0 && @term_b==3 && @alloc_b03>0) || \ (@nsb==true && @fractal_b==1 && @alloc_b1>0) || \ (@nsb==true && @fractal_b==2 && @alloc_b2>0) || \ (@fractal_b==3 && @alloc_b3>0))) endparam func fcb caption = "function c-term" default = ident() visible = (@q>0 && (@nsb==true || @fractal_b>2)) endfunc ; ; MANDELBROT POLYNOMS B ; heading caption = "Mandelbrot Polynoms" visible = (@q>0 && @fractal_b==0) endheading param term_b caption = "active nr of terms" default = 0 enum = "1 term" "2 terms" "3 terms" "4 terms" visible = (@q>0 && @fractal_b==0 && @nsb==true) hint = "active terms are all except the c-term that is added at every iteration" endparam param alloc_b03 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endparam param alloc_b02 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==2) endparam param alloc_b01 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==1) endparam param alloc_b00 caption = "allocation" default = 0 enum = "all" "part" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==0) endparam heading caption = "term 1" visible = (@q>0 && @fractal_b==0 && @nsb==true) endheading param b001 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true) endparam func fb001 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true) endfunc param bp001 caption = "power" default = (2,0) visible = (@q>0 && @fractal_b==0) endparam heading caption = "term 2" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endheading param b002 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endparam func fb002 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endfunc param bp002 caption = "power" default = (3,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endparam heading caption = "term 3" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endheading param b003 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endparam func fb003 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endfunc param bp003 caption = "power" default = (4,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endparam heading caption = "term 4" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endheading param b004 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endparam func fb004 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endfunc param bp004 caption = "power" default = (5,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endparam ; ; LATTES B ; heading caption = "Lattes" visible = (@q>0 && @fractal_b==1 && @nsb==true) endheading param var_b1 caption = "variation" default = 0 enum = "basic" "plus" "enhanced" visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param alloc_b1 caption = "allocation" default = 0 enum = "all" "nominator" "denominator" visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b01t ; lattesconstant in teller caption = "const. in numerator" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b01n ; lattesconstante in noemer caption = "const. in denominator" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==1) endparam param bp010 caption = "power 0" default = (2,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b011 caption = "coefficient 1" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam func fb011 caption = "function 1" default = ident() visible = (@q>0 && @fractal_b==1 && @nsb==true) endfunc param bp011 caption = "power 1" default = (2,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b012 caption = "coefficient 2" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam func fb012 caption = "function 2" default = ident() visible = (@q>0 && @fractal_b==1 && @nsb==true) endfunc param bp012 caption = "power 2" default = (2,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b013 caption = "coefficient 3" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==2) endparam func fb013 caption = "function 3" default = ident() visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==2) endfunc param bp013 caption = "power 3" default = (3,0) visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==2) endparam ; ; TALIS B ; heading caption = "Talis" visible = @fractal_b==2 endheading param var_b2 caption = "variation" default = 0 ; voorlopig werkt alleen de default enum = "basic" visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam param alloc_b2 caption = "allocation" default = 0 enum = "all" "fraction" "numerator" "denominator" visible = (@q>0 && @fractal_a==2 && @nsa==true) endparam param b020 caption = "Talis constant" default = (1,0) visible = (@q>0 && @fractal_b==2) endparam param b021 caption = "coefficient 1" default = (1,0) visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam func fb021 caption = "function 1" default = ident() visible = (@q>0 && @fractal_b==2 && @nsb==true) endfunc param bp021 caption = "power 1" default = (2,0) visible = (@q>0 && @fractal_b==2) endparam param b022 caption = "coefficient 2" default = (1,0) visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam func fb022 caption = "function 2" default = ident() visible = (@q>0 && @fractal_b==2 && @nsb==true) endfunc param bp022 caption = "power 2" default = (1,0) visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam ; ; COMBI z&c B ; heading caption = "z&c" visible = (@q>0 && @fractal_b==3) endheading param alloc_b3 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" "part 5" "part 6" visible = (@q>0 && @fractal_b==3) endparam param b031 caption = "z&coefficient" default = (1,0) visible = @fractal_b==3 endparam func fb031 caption = "z-function" default = ident() visible = @fractal_b==3 endfunc param bp031 caption = "z-power" default = (2,0) visible = @fractal_b==3 endparam param b032 caption = "zc-coefficient" default = (1,0) visible = @fractal_b==3 endparam func fb032 caption = "z-function zc" default = ident() visible = @fractal_b==3 endfunc param bp032 caption = "z-power zc" default = (2,0) visible = @fractal_b==3 endparam func fb033 caption = "c-function zc" default = ident() visible = @fractal_b==3 endfunc param bp033 caption = "c-power zc" default = (2,0) visible = @fractal_b==3 endparam ; ; SMOOKS B ; heading caption = " Smooks" visible = (@q>0 && @sma==true) endheading param flipper_b caption = "flipper" default = 0 enum = "none" "only north-east" "all" visible = @smb==true endparam param mode_b caption = "smooks mode" default = 0 enum = "none" "original smooks" "3 segments" "4 segments" "S to N" "W to E" visible = @smb==true endparam bool param submb caption = "sub modus toggle" default = false visible = (@smb==true && (@mode_b==2 || @mode_b==3)) endparam float param alpha_b caption = "angle alpha" default = 360 min = 90 max = 360 visible = (@smb==true && (@mode_b==2 || @mode_b==3)) endparam param gamma_b caption = "(alpha/beta)" default = (90,270) min = (90,90) max = (360,360) visible = (@smb==true && @mode_b==3) endparam ; switch: type = "AvariantJ" seed = #pixel ; a001 = a001 a002 = a002 a003 = a003 a004 = a004 a011 = a011 a012 = a012 a013 = a013 a01n = a01n a01t = a01t a020 = a020 a021 = a021 a022 = a022 a031 = a031 a032 = a032 alloc_a00 = alloc_a00 alloc_a01 = alloc_a01 alloc_a02 = alloc_a02 alloc_a03 = alloc_a03 alloc_a1 = alloc_a1 alloc_a2 = alloc_a2 alloc_a3 = alloc_a3 alloc_b00 = alloc_b00 alloc_b01 = alloc_b01 alloc_b02 = alloc_b02 alloc_b03 = alloc_b03 alloc_b1 = alloc_b1 alloc_b2 = alloc_b2 alloc_b3 = alloc_b3 alpha_a = alpha_a alpha_b = alpha_b ap001 = ap001 ap002 = ap002 ap003 = ap003 ap004 = ap004 ap010 = ap010 ap011 = ap011 ap012 = ap012 ap013 = ap013 ap021 = ap021 ap022 = ap022 ap031 = ap031 ap032 = ap032 ap033 = ap033 as = as b001 = b001 b002 = b002 b003 = b003 b004 = b004 b01n = b01n b01t = b01t b011 = b011 b012 = b012 b013 = b013 b020 = b020 b021 = b021 b022 = b022 b031 = b031 b032 = b032 bailout_type = bailout_type bailout_value = bailout_value bp = bp bpp = bpp bp001 = bp001 bp002 = bp002 bp003 = bp003 bp004 = bp004 bp010 = bp010 bp011 = bp011 bp012 = bp012 bp013 = bp013 bp021 = bp021 bp022 = bp022 bp031 = bp031 bp032 = bp032 bp033 = bp033 bs = bs fa001 = fa001 fa002 = fa002 fa003 = fa003 fa004 = fa004 fa011 = fa011 fa012 = fa012 fa013 = fa013 fa021 = fa021 fa022 = fa022 fa031 = fa031 fa032 = fa032 fa033 = fa033 fb001 = fb001 fb002 = fb002 fb003 = fb003 fb004 = fb004 fb011 = fb011 fb012 = fb012 fb013 = fb013 fb021 = fb021 fb022 = fb022 fb031 = fb031 fb032 = fb032 fb033 = fb033 flipper_a = flipper_a flipper_b = flipper_b fca = fca fcb = fcb fractal_a = fractal_a fractal_b = fractal_b gamma_a = gamma_a gamma_b = gamma_b gate = gate keep_going =keep_going mode_a = mode_a mode_b = mode_b nsa = nsa nsb = nsb opt = opt option = option parallel = parallel q = q scala = scala sma = sma smb = smb ; start_a = start_a start_b = start_b subma = subma submb = submb term_a = term_a term_b = term_b threshold = threshold var_a1 = var_a1 var_a2 = var_a2 var_b1 = var_b1 var_b2 = var_b2 } ; ;==================================================================================================================================== ; AvariantJ { ; global: huge = (1e60,1e60) float small = 1e-20 float con = #pi/180 float twopi = 2*#pi float halfpi = 0.5*#pi float hka_a = @alpha_a*con ; alpha in radians float hkbr_a = real(@gamma_a)*con float hkbi_a = imag(@gamma_a)*con float hka_b = @alpha_b*con float hkbr_b = real(@gamma_b)*con float hkbi_b = imag(@gamma_b)*con ; init: z = #pixel c = @seed z_old = (0,0) z1 = (0,0) bool keep_going = true float temp0 = 0 t1 = (0,0) t2 = (0,0) t3 = (0,0) t4 = (0,0) ua = (0,0) ub = (0,0) va = (0,0) vb = (0,0) numerator = (0,0) denominator = (0,0) fraction = (0,0) float angle = 0 int iter = 0 offset = (0,.5) bool flag = true bool vlag = true float x = 0 float y = 0 float ta = 0 float tb = 0 keep_going = true ; loop: ; iter=iter+1 z_old=z ; ;======================================= ; formula a (executed every iteration) J ;======================================= ; Mandelbrot related polynoms (a) J ;======================================= ; if @fractal_a==0 ; Mandelbrot if @nsa==false ; standard A z = z^@ap001 + c else ; nsa true t1 = @a001*@fa001(z)^@ap001 if @term_a>0 ; 2, 3 or 4 terms t2 = @a002*@fa002(z)^@ap002 endif if @term_a>1 ; 3 or 4 terms t3 = @a003*@fa003(z)^@ap003 endif if @term_a>2 ; 4 terms t4 = @a004*@fa004(z)^@ap004 endif if @term_a==0 ; 1 term if @alloc_a00==0 ; all ua = t1 + @fca(c) elseif @alloc_a00==1 ; part ua = t1 va = @fca(c) endif elseif @term_a==1 ; 2 terms if @alloc_a01==0 ; all ua = t1 + t2 + @fca(c) elseif @alloc_a01==1 ; part 1 ua = t1 + t2 va = @fca(c) elseif @alloc_a01==2 ; part 2 ua = t1 va = t2 + @fca(c) endif elseif @term_a==2 ; 3 terms if @alloc_a02==0 ; all ua = t1 + t2 + t3 + @fca(c) elseif @alloc_a02==1 ; part 1 ua = t1 + t2 + t3 va = @fca(c) elseif @alloc_a02==2 ; part 2 ua = t1 + t2 va = t3 + @fca(c) elseif @alloc_a02==3 ; part 3 ua = t1 va = t2 + t3 + @fca(c) endif else ; 4 terms if @alloc_a03==0 ; all ua = t1 + t2 + t3 + t4 + @fca(c) elseif @alloc_a03==1 ; part 1 ua = t1 + t2 + t3 + t4 va = @fca(c) elseif @alloc_a03==2 ; part 2 ua = t1 + t2 + t3 va = t4 + @fca(c) elseif @alloc_a03==3 ; part 3 ua = t1 + t2 va = t3 + t4 + @fca(c) elseif @alloc_a03==4 ; part 4 ua = t1 va = t2 + t3 + t4 + @fca(c) endif ; alloc endif ; term endif ; nsa ; end Mandelbrot polynoms ; ;================================================ ; Lattes (a) J ;================================================ ; elseif @fractal_a==1 z = z + offset if @nsa==false ; standard A denominator = z*(z^2-1) ; noemer if denominator==(0,0) z = huge else z = c*(1+z^2)^2/denominator endif else ; nsa true t1 = @a011*@fa011(z)^@ap011 numerator = @fca(c)*(@a01t+t1)^@ap010 ; teller c*(at + a1.z^p1)^p0 if @var_a1==0 ; basic denominator = @a012*z*(@fa012(z)^@ap012-(1,0)) ; noemer a2.z(z^p2 - 1) elseif @var_a1==1 ; plus denominator = @a012*(@fa012(z)^@ap012 - @fa012(z)^(@ap012-@a01n)) ; noemer a2(z^p2 - z^(p2-a0)) elseif @var_a1==2 ; enhanced t2 = @a012*@fa012(z)^@ap012 t3 = @a013*@fa013(z)^@ap013 denominator = t3-t2 ; noemer a3.p3.z^p3 - a2.p2.z^p2 endif if denominator==(0,0) denominator = e-30 endif if @alloc_a1==0 ; all ua = numerator/denominator elseif @alloc_a1==1 ; smooks op teller ua = numerator elseif @alloc_a1==2 ; smooks op noemer ua = denominator endif ; alloc ; in Lattes va always zero endif ; nsa ; end Lattes ; ;================================================== ; Talis (a) J ;================================================== ; elseif @fractal_a==2 if @var_a2==0 ; andere talisvariaties later if @nsa==false ; standard A denominator = @a020+z ; noemer if denominator==(0,0) z = huge else z = z^@ap021/denominator + c endif else ; nsa true numerator = @a021*@fa021(z)^@ap021 t1 = @a022*@fa022(z)^@ap022 denominator = @a020+t1 if denominator==(0,0) denominator = e-30 endif if @alloc_a2>0 va = @fca(c) endif if @alloc_a2==0 ; on all fraction = numerator/denominator ua = fraction + @fca(c) elseif @alloc_a2==1 ; on fraction ua = numerator/denominator ; fraction elseif @alloc_a2==2 ; on numerator ua = numerator elseif @alloc_a2==3 ; on denominator ua = denominator endif ; alloc endif ; nsa endif ; var ; end Talis ; ;================================================== ; Combination of z & c in 3 terms (including c) J ;================================================== ; elseif @fractal_a==3 t1 = @a031*@fa031(z)^@ap031 t2 = @a032*@fa032(z)^@ap032*@fa033(c)^@ap033 if @alloc_a3==0 ua = t1 + t2 + @fca(c) elseif @alloc_a3==1 ua = t1 + t2 va = @fca(c) elseif @alloc_a3==2 ua = t1 + @fca(c) va = t2 elseif @alloc_a3==3 ua = t2 + @fca(c) va = t1 elseif @alloc_a3==4 ua = t1 va = t2 + @fca(c) elseif @alloc_a3==5 ua = t2 va = t1 + @fca(c) elseif @alloc_a3==6 ua = @fca(c) va = t1 + t2 endif endif ; combi z&c / @fractal_a ; ;========================= ; Smooks operations (a) J ;========================= ; if ((@nsa==true && @fractal_a<3) || (@fractal_a>2)) if @sma==true ta = atan2(ua) if ta<0 ta = ta + twopi endif if @mode_a>3 x = real(ua) y = imag(ua) endif if @mode_a==1 ; alfa and beta not involved (original Smooks; 2 segments) ua = abs(ua) elseif @mode_a==2 ; 3 segments if ((@subma==false && ta>halfpi && ta<=hka_a) || (@subma==true && ta>hka_a)) ua = abs(ua) endif elseif @mode_a==3 ; 4 segments if ((@subma==false && ta>=hkbr_a && tahalfpi && ta<=hkbr_a) || ta>hkbi_a))) ua = abs(ua) endif elseif @mode_a==4 ; south reflecting to north if y<0 y = -y endif elseif @mode_a==5 ; west reflecting to east if x<0 x = -x endif endif if @mode_a>3 ua = x + flip(y) endif if ((@flipper_a==1 && real(ua)>=1 && imag(ua)>=1) || @flipper_a==2) ua = flip(ua) endif endif ; sma ; ;--- end smooks / joining u and v to z --------------------------------------------- ; if (@fractal_a==0 || @fractal_a==3) ; polynoms if (@alloc_a00==0 && @alloc_a01==0 && @alloc_a02==0 && @alloc_a03==0 \ && @alloc_a3==0) ; va=(0,0) z = ua else z = @as*ua + va endif endif ; if @fractal_a==1 ; lattes if @alloc_a1==0 z = ua elseif @alloc_a1==1 z = @as*ua/denominator elseif @alloc_a1==2 z = @as*numerator/ua endif ; nsa elseif @fractal_a==2 ; talis if @alloc_a2==0 z = ua elseif @alloc_a2==1 z= @as*ua + va elseif @alloc_a2==2 z = @as*ua/denominator + va elseif @alloc_a2==3 z = @as*numerator/ua + va endif endif endif ; nsa ; ;================================================== ; formula b (executed only at certain conditions) J ;================================================== ; if @q>0 ; first requirement for executing B if vlag==true z = @scala * z ; scaling of A (only when also B is active) vlag = false endif if @parallel==true z1 = z ; safe for later use z = z_old ; further with again the original z endif if @q>@threshold && @q<@gate ; second requirement for executing B ; (iteratie inside 'window') temp0 = iter/@q if temp0-round(temp0)==0 ; third requirement for executing B if flag==true z = z + @start_b flag = false endif ; ;================================================ ; Mandelbrot and polynoms (b) J ;================================================ ; if @fractal_b==0 ; Mandelbrot if @nsb==false ; standard B z = z^@bp001 + c else ; nsb true t1 = @b001*@fb001(z)^@bp001 if @term_b>0 ; 2, 3 or 4 terms t2 = @b002*@fb002(z)^@bp002 endif if @term_b>1 ; 3 or 4 terms t3 = @b003*@fb003(z)^@bp003 endif if @term_b>2 ; 4 terms t4 = @b004*@fb004(z)^@bp004 endif ; if @term_b==0 ; 1 term if @alloc_b00==0 ; all ub = t1 + @fcb(c) elseif @alloc_b00==1 ; part 1 ub = t1 vb = @fcb(c) endif elseif @term_b==1 ; 2 terms if @alloc_b01==0 ; all ub = t1 + t2 + @fcb(c) elseif @alloc_b01==1 ; part 1 ub = t1 + t2 vb = @fcb(c) elseif @alloc_b01==2 ; part 2 ub = t1 vb = t2 + @fcb(c) endif elseif @term_b==2 ; 3 terms if @alloc_b02==0 ; all ub = t1 + t2 + t3 + @fcb(c) elseif @alloc_b02==1 ; part 1 ub = t1 + t2 + t3 vb = @fcb(c) elseif @alloc_b02==2 ; part 2 ub = t1 + t2 vb = t3 + @fcb(c) elseif @alloc_b02==3 ; part 3 ub = t1 vb = t2 + t3 + @fcb(c) endif else ; 4 terms if @alloc_b03==0 ; all ub = t1 + t2 + t3 + t4 + @fcb(c) elseif @alloc_b03==1 ; part 1 ub = t1 + t2 + t3 + t4 vb = @fcb(c) elseif @alloc_b03==2 ; part 2 ub = t1 + t2 + t3 vb = t4 + @fcb(c) elseif @alloc_b03==3 ; part 3 ub = t1 + t2 vb = t3 + t4 + @fcb(c) elseif @alloc_b03==4 ; part 4 ub = t1 vb = t2 + t3 + t4 + @fcb(c) endif ; alloc endif ; term endif ; nsb ; end Mandelbrot polynoms ; ;================================================ ; Lattes (b) J ;================================================ ; elseif @fractal_b==1 z = z + offset if @nsb==false ; standard A denominator = z*(z^2-1) ; noemer if denominator==(0,0) z = huge else z = c*(1+z^2)^2/denominator endif else ; nsb true t1 = @b011*@fb011(z)^@bp011 numerator = @fcb(c)*(@b01t+t1)^@bp010 ; teller c*(bt + b1.z^p1)^p0 if @var_b1==0 ; basic denominator = @b012*z*(@fb012(z)^@bp012-(1,0)) ; noemer b2.z(z^p2 - 1) elseif @var_b1==1 ; plus denominator = @b012*(@fb012(z)^@bp012 - @fb012(z)^(@bp012-@b01n)) ; noemer b2(p2^p2 - z^(p2-b0)) elseif @var_b1==2 ; enhanced t2 = @b012*@fb012(z)^@bp012 t3 = @b013*@fb013(z)^@bp013 denominator = t3-t2 ; noemer b3.p3.z^p3 - b2.p2.z^p2 endif if denominator==(0,0) denominator = e-30 else if @alloc_b1==0 ; all ub = numerator/denominator elseif @alloc_b1==1 ; smooks op teller ub = numerator elseif @alloc_b1==2 ; smooks op noemer ub = denominator endif ; alloc endif ; denominator ; in Lattes vb always zero endif ; nsb ; end Lattes ; ;================================================== ; Talis (b) J ;================================================== ; elseif @fractal_b==2 if @var_b2==0 ; andere talisvariaties later if @nsb==false ; standard B denominator = @b020+z ; noemer if denominator==(0,0) z = huge else z = z^@bp021/denominator + c endif else ; nsb true numerator = @b021*@fb021(z)^@bp021 t1 = @b022*@fb022(z)^@bp022 denominator = @b020+t1 if denominator==(0,0) denominator = e-30 endif if @alloc_b2>0 vb = @fcb(c) endif if @alloc_b2==0 ; on all fraction = numerator/denominator ub = fraction + @fcb(c) elseif @alloc_b2==1 ; on fraction ub = numerator/denominator ; fraction elseif @alloc_b2==2 ; on numerator ub = numerator elseif @alloc_b2==3 ; on denominator ub = denominator endif ; alloc endif ; nsb endif ; var ; end Talis ; ;===================================================== ; Combination of z & c in 3 terms (including c) (b) J ;===================================================== ; elseif @fractal_b==3 t1 = @b031*@fb031(z)^@bp031 t2 = @b032*@fb032(z)^@bp032*@fb033(c)^@bp033 if @alloc_b3==0 ub = t1 + t2 + @fcb(c) elseif @alloc_b3==1 ub = t1 + t2 vb = @fca(c) elseif @alloc_b3==2 ub = t1 + @fcb(c) vb = t2 elseif @alloc_b3==3 ub = t2 + @fcb(c) vb = t1 elseif @alloc_b3==4 ub = t1 vb = t2 + @fcb(c) elseif @alloc_b3==5 ub = t2 vb = t1 + @fcb(c) elseif @alloc_b3==6 ua = @fcb(c) va = t1 + t2 endif endif ; end z&c / @fractal_b ; ;========================= ; Smooks operations (b) J ;========================= ; if ((@nsb==true && @fractal_b<3) || (@fractal_b>2)) if @smb==true tb = atan2(ub) if tb<0 tb = tb + twopi endif if @mode_b>3 x = real(ub) y = imag(ub) endif if @mode_b==1 ; alfa and beta not involved (original Smooks; 2 segments) ub = abs(ub) elseif @mode_b==2 ; 3 segments if ((@submb==false && tb>halfpi && tb<=hka_b) || (@submb==true && tb>hka_b)) ub = abs(ub) endif elseif @mode_b==3 ; 4 segments if ((@submb==false && tb>=hkbr_b && tbhalfpi && tb<=hkbr_b) || tb>hkbi_b))) ub = abs(ub) endif elseif @mode_b==4 ; south reflecting to north if y<0 y = -y endif elseif @mode_b==5 ; west reflecting to east if x<0 x = -x endif endif if @mode_b>3 ub = x + flip(y) endif if ((@flipper_b==1 && real(ub)>=1 && imag(ub)>=1) || @flipper_b==2) ub = flip(ub) endif endif ; smb ; ;--- end smooks / joining z and c to z ------------------------------------------ ; if (@fractal_b==0 || @fractal_b==3) ; polynoms if (@alloc_b00==0 && @alloc_b01==0 && @alloc_b02==0 && \ @alloc_b03==0 && @alloc_b3==0) ; vb=(0,0) z = ub else z = @bs*ub + vb endif endif ; if @fractal_b==1 ; lattes if @alloc_b1==0 z = ub elseif @alloc_b1==1 z = @bs*ub/denominator elseif @alloc_b1==2 z = @bs*numerator/ub endif ; nsb elseif @fractal_b==2 ; talis if @alloc_b2==0 z = ub elseif @alloc_b2==1 z = @bs*ub + vb elseif @alloc_b2==2 z = @bs*ub/denominator + vb elseif @alloc_b2==3 z = @bs*numerator/ub + vb endif endif ; fractal_b endif ; nsb endif ; temp0-round(temp0)==0 endif ; @q>@threshold && @q<@gate ; ;============================== ; joining formulas a and b J ;============================== ; if @parallel==true if @option==0 ; sum z = z+z1 elseif @option==1 ; product z = z*z1 elseif @option==2 ; difference 1 z = z-z1 elseif @option==3 ; difference 2 z = z1-z elseif @option==4 ; quotient 1 if z1==0 z=huge else z = z/z1 endif elseif @option==5 ; quotient 2 z = z1/z if z==0 z = huge else z = z1/z endif elseif @option==6 ; arithm.mean z = 0.5*(z+z1) elseif @option==7 ; geom.mean z = sqrt(z*z1) elseif @option==8 ; harm.mean if (z+z1)==(0,0) z = huge else z = (2*z*z1)/(z+z1) endif elseif @option==9 z = real(z) + flip(imag(z1)) elseif @option==10 z = real(z1) + flip(imag(z)) endif else ; series if @opt==1 z = real(z) + flip(imag(z1)) elseif @opt==2 z = real(z1) + flip(imag(z)) endif ; opt(ions) endif ; parallel / series endif ; q>0 ; ;====================== ; bailout variations J ;====================== ; if (@bailout_type=="magnitude") if (|z|>@bailout_value) keep_going = false endif elseif (@bailout_type=="abs(x)") if (abs(real(z))>@bailout_value) keep_going = false endif elseif (@bailout_type=="abs(y)") if (abs(imag(z))>@bailout_value) keep_going = false endif elseif (@bailout_type=="abs(x) & abs(y)") if ((abs(real(z))>@bailout_value)&&(abs(imag(z))>@bailout_value)) keep_going = false endif elseif (@bailout_type=="abs(x) | abs(y)") if ((abs(real(z))>@bailout_value)||(abs(imag(z))>@bailout_value)) keep_going = false endif elseif (@bailout_type=="angle 1") if (atan2(z)<@bailout_value/100) keep_going = false endif elseif (@bailout_type=="angle 2") if (atan2(z)>@bailout_value/100) keep_going = false endif elseif (@bailout_type=="ellipse") if ((sqr(real(z))+@bp*sqr(imag(z)))>@bailout_value) keep_going = false endif elseif(@bailout_type=="limaçon") if (real(z)==0) angle = small else angle = atan(imag(z)/real(z)) endif if (|z|*(real(@bpp)*cos(angle)+imag(@bpp))>@bailout_value) keep_going = false endif elseif (@bailout_type=="astroid") if (real(z)==0) angle = small else angle = atan(imag(z)/real(z)) endif if (|z|*(cos(angle)^@bp+sin(angle)^@bp)>@bailout_value) keep_going = false endif endif bailout: keep_going==true ; ;----------------------------------------------------------------------------- ; default: ; ; GENERAL ; title = "AvariantJ" ; heading caption="General" endheading ; param seed caption = "Julia seed" default = (-1.25,0) endparam param bailout_type caption = "bailout type" default = 0 enum = "magnitude" "abs(x)" "abs(y)" "abs(x) & abs(y)" "abs(x) | abs(y)" \ "angle 1" "angle 2" "ellipse" "limaçon" "astroid" endparam float param bp caption = "bailout parameter" default = 6.0 visible = (@bailout_type==7 || @bailout_type==10) endparam param bpp caption = "bailout parameter" default = (0.5,1.0) visible = @bailout_type==8 endparam float param bailout_value caption = "bailout value" default = 100 endparam int param q caption = "decider" default = 1 min = 0 hint = "If q = 0 then formula B is disabled" endparam int param threshold caption = "threshold" default = 0 visible = @q>0 min = 0 hint = "B starts above threshold" endparam int param gate caption = "gate" default = 1000 visible = @q>0 hint = "B ends when gate is reached. When there will be \ no end then note that gate>max.iterations. \ Note that always gate>threshold" endparam bool param parallel caption = "parallel" default = false visible = @q>0 endparam param opt caption = "series options" default = 0 visible = (@q>0 && @parallel==false) enum = "normal" "var 1" "var 2" endparam param option caption = "parallel options" default = 0 visible = (@q>0 && @parallel==true) enum = "sum" "product" "difference 1" "difference 2" "quotient 1" \ "quotient 2" "arithm.mean" "geom. mean" "harm. mean" "var 1" "var 2" endparam ; ; FORMULA A ; heading caption = "Formula A" endheading param fractal_a caption = "Formula" default = 0 enum = "Mandelbrot" "Lattes" "Talis" "Combi z&c" endparam bool param nsa caption = "non-standard" default = false visible = @fractal_a<3 endparam bool param sma caption = "enable Smooks" default = false visible = ((@nsa==true && @fractal_a<3) || (@fractal_a>2)) endparam ; param start_a ; caption = "starting point A" ; default = (0,0) ; endparam param scala caption = "overall scale A" default = (1,0) hint = "this scale is lacking for formula B. By changing this scale \ it will be possible to manage the relation between A and B" visible = @q>0 endparam param as caption = "partial scale" default = (1,0) hint = "scaling only aplied to allocated terms" visible = (@nsa==true && @fractal_a==0 && @term_a==0 && @alloc_a00>0) || \ (@nsa==true && @fractal_a==0 && @term_a==1 && @alloc_a01>0) || \ (@nsa==true && @fractal_a==0 && @term_a==2 && @alloc_a02>0) || \ (@nsa==true && @fractal_a==0 && @term_a==3 && @alloc_a03>0) || \ (@nsa==true && @fractal_a==1 && @alloc_a1>0) || \ (@nsa==true && @fractal_a==2 && @alloc_a2>0) || \ (@fractal_a==3 && @alloc_a3>0) endparam func fca caption = "function c-term" default = ident() visible = @nsa==true || @fractal_a>2 endfunc ; ; MANDELBROT POLYNOMS A ; heading caption = "Mandelbrot Polynoms" visible = @fractal_a==0 endheading param term_a caption = "active nr of terms" default = 0 enum = "1 term" "2 terms" "3 terms" "4 terms" visible = (@fractal_a==0 && @nsa==true) hint = "active terms are all except the c-term that is added at every iteration" endparam param alloc_a03 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" visible = (@fractal_a==0 && @nsa==true && @term_a==3) endparam param alloc_a02 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" visible = (@fractal_a==0 && @nsa==true && @term_a==2) endparam param alloc_a01 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" visible = (@fractal_a==0 && @nsa==true && @term_a==1) endparam param alloc_a00 caption = "allocation" default = 0 enum = "all" "part" visible = (@fractal_a==0 && @nsa==true && @term_a==0) endparam heading caption = "term 1" visible = (@fractal_a==0 && @nsa==true) endheading param a001 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true) endparam func fa001 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true) endfunc param ap001 caption = "power" default = (2,0) visible = @fractal_a==0 endparam heading caption = "term 2" visible = (@fractal_a==0 && @nsa==true && @term_a>0) endheading param a002 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true && @term_a>0) endparam func fa002 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true && @term_a>0) endfunc param ap002 caption = "power" default = (3,0) visible = (@fractal_a==0 && @nsa==true && @term_a>0) endparam heading caption = "term 3" visible = (@fractal_a==0 && @nsa==true && @term_a>1) endheading param a003 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true && @term_a>1) endparam func fa003 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true && @term_a>1) endfunc param ap003 caption = "power" default = (4,0) visible = (@fractal_a==0 && @nsa==true && @term_a>1) endparam heading caption = "term 4" visible = (@fractal_a==0 && @nsa==true && @term_a==3) endheading param a004 caption = "coefficient" default = (1,0) visible = (@fractal_a==0 && @nsa==true && @term_a==3) endparam func fa004 caption = "function" default = ident() visible = (@fractal_a==0 && @nsa==true && @term_a==3) endfunc param ap004 caption = "power" default = (5,0) visible = (@fractal_a==0 && @nsa==true && @term_a==3) endparam ; ; LATTES A ; heading caption = "Lattes" visible = (@fractal_a==1 && @nsa==true) endheading int param var_a1 caption = "variation" default = 0 enum = "basic" "plus" "enhanced" visible = (@fractal_a==1 && @nsa==true) endparam param alloc_a1 caption = "allocation" default = 0 enum = "all" "numerator" "denominator" visible = (@fractal_a==1 && @nsa==true) endparam param a01t ; lattesconstante in teller caption = "const. in numerator" default = (1,0) visible = (@fractal_a==1 && @nsa==true) endparam param a01n ; lattesconstante in noemer caption = "const. in denominator" default = (1,0) visible = (@fractal_a==1 && @nsa==true && @var_a2==1) endparam param ap010 caption = "power 0" default = (2,0) visible = (@fractal_a==1 && @nsa==true) endparam param a011 caption = "coefficient 1" default = (1,0) visible = (@fractal_a==1 && @nsa==true) endparam func fa011 caption = "function 1" default = ident() visible = (@fractal_a==1 && @nsa==true) endfunc param ap011 caption = "power 1" default = (2,0) visible = (@fractal_a==1 && @nsa==true) endparam param a012 caption = "coefficient 2" default = (1,0) visible = (@fractal_a==1 && @nsa==true) endparam func fa012 caption = "function 2" default = ident() visible = (@fractal_a==1 && @nsa==true) endfunc param ap012 caption = "power 2" default = (2,0) visible = (@fractal_a==1 && @nsa==true) endparam param a013 caption = "coefficient 3" default = (1,0) visible = (@fractal_a==1 && @nsa==true && @var_a2==2) endparam func fa013 caption = "function 3" default = ident() visible = (@fractal_a==1 && @nsa==true && @var_a2==2) endfunc param ap013 caption = "power 3" default = (3,0) visible = (@fractal_a==1 && @nsa==true && @var_a2==2) endparam ; ; TALIS A ; heading caption = "Talis" visible = @fractal_a==2 endheading param var_a2 caption = "variation" default = 0 ; voorlopig werkt alleen de default enum = "standard" visible = (@fractal_a==2 && @nsa==true) endparam param alloc_a2 caption = "allocation" default = 0 enum = "all" "fraction" "numerator" "denominator" visible = (@fractal_a==2 && @nsa==true) endparam param a020 caption = "Talis constant" default = (1,0) visible = @fractal_a==2 endparam param a021 caption = "coefficient 1" default = (1,0) visible = (@fractal_a==2 && @nsa==true) endparam func fa021 caption = "function 1" default = ident() visible = (@fractal_a==2 && @nsa==true) endfunc param ap021 caption = "power 1" default = (2,0) visible = @fractal_a==2 endparam param a022 caption = "coefficient 2" ; in denominator default = (1,0) visible = (@fractal_a==2 && @nsa==true) endparam func fa022 caption = "function 2" ; in denominator default = ident() visible = (@fractal_a==2 && @nsa==true) endfunc param ap022 ; in numerator caption = "power 2" default = (1,0) visible = (@fractal_a==2 && @nsa==true) endparam ; ; COMBI z&c A ; heading caption = "z&c" visible = @fractal_a==3 endheading param alloc_a3 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" "part 5" "part 6" visible = (@q>0 && @fractal_a==3) endparam param a031 caption = "z&coefficient" default = (1,0) visible = @fractal_a==3 endparam func fa031 caption = "z-function" default = ident() visible = @fractal_a==3 endfunc param ap031 caption = "z-power" default = (2,0) visible = @fractal_a==3 endparam param a032 caption = "zc-coefficient" default = (1,0) visible = @fractal_a==3 endparam func fa032 caption = "z-function zc" default = ident() visible = @fractal_a==3 endfunc param ap032 caption = "z-power zc" default = (2,0) visible = @fractal_a==3 endparam func fa033 caption = "c-function zc" default = ident() visible = @fractal_a==3 endfunc param ap033 caption = "c-power zc" default = (2,0) visible = @fractal_a==3 endparam ; ; SMOOKS A ; heading caption = " Smooks" visible = @sma==true endheading param flipper_a caption = "flipper" default = 0 enum = "none" "only north-east" "all" visible = @sma==true endparam param mode_a caption = "smooks mode" default = 0 enum = "none" "original smooks" "3 segments" "4 segments" "S to N" "W to E" visible = @sma==true endparam bool param subma caption = "sub modus toggle" default = false visible = (@sma==true && (@mode_a==2 || @mode_a==3)) endparam float param alpha_a caption = "angle alpha" default = 360 min = 90 max = 360 visible = (@sma==true && (@mode_a==2 || @mode_a==3)) endparam param gamma_a caption = "(alpha/beta)" default = (90,270) min = (90,90) max = (360,360) visible = (@sma==true && @mode_a==3) endparam ; ; FORMULA B ; heading caption = "Formula B" visible = @q>0 endheading param fractal_b caption = "Formula" default = 0 enum = "Mandelbrot" "Lattes" "Talis" "Combi z&c" visible = @q>0 endparam bool param nsb caption = "non-standard" default = false visible = (@q>0 && @fractal_b<3) endparam bool param smb caption = "enable Smooks" default = false visible = (@q>0 && ((@nsb==true && @fractal_b<3) || @fractal_b>2)) endparam param start_b caption = "starting point B" default = (0,0) visible = @q>0 endparam param bs caption = "partial scale" default = (1,0) hint = "scaling only aplied to allocated terms" visible = (@q>0 && \ ((@nsb==true && @fractal_b==0 && @term_b==0 && @alloc_b00>0) || \ (@nsb==true && @fractal_b==0 && @term_b==1 && @alloc_b01>0) || \ (@nsb==true && @fractal_b==0 && @term_b==2 && @alloc_b02>0) || \ (@nsb==true && @fractal_b==0 && @term_b==3 && @alloc_b03>0) || \ (@nsb==true && @fractal_b==1 && @alloc_b1>0) || \ (@nsb==true && @fractal_b==2 && @alloc_b2>0) || \ (@fractal_b==3 && @alloc_b3>0))) endparam func fcb caption = "function c-term" default = ident() visible = (@q>0 && (@nsb==true || @fractal_b>2)) endfunc ; ; MANDELBROT POLYNOMS B ; heading caption = "Mandelbrot Polynoms" visible = (@q>0 && @fractal_b==0) endheading param term_b caption = "active nr of terms" default = 0 enum = "1 term" "2 terms" "3 terms" "4 terms" visible = (@q>0 && @fractal_b==0 && @nsb==true) hint = "active terms are all except the c-term that is added at every iteration" endparam param alloc_b03 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endparam param alloc_b02 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==2) endparam param alloc_b01 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==1) endparam param alloc_b00 caption = "allocation" default = 0 enum = "all" "part" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==0) endparam heading caption = "term 1" visible = (@q>0 && @fractal_b==0 && @nsb==true) endheading param b001 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true) endparam func fb001 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true) endfunc param bp001 caption = "power" default = (2,0) visible = (@q>0 && @fractal_b==0) endparam heading caption = "term 2" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endheading param b002 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endparam func fb002 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endfunc param bp002 caption = "power" default = (3,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>0) endparam heading caption = "term 3" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endheading param b003 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endparam func fb003 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endfunc param bp003 caption = "power" default = (4,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b>1) endparam heading caption = "term 4" visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endheading param b004 caption = "coefficient" default = (1,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endparam func fb004 caption = "function" default = ident() visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endfunc param bp004 caption = "power" default = (5,0) visible = (@q>0 && @fractal_b==0 && @nsb==true && @term_b==3) endparam ; ; LATTES B ; heading caption = "Lattes" visible = (@q>0 && @fractal_b==1 && @nsb==true) endheading int param var_b1 caption = "variation" default = 0 enum = "basic" "plus" "enhanced" visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param alloc_b1 caption = "allocation" default = 0 enum = "all" "numerator" "denominator" visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b01t ; lattesconstante in teller caption = "const. in numerator" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b01n ; lattesconstante in noemer caption = "const. in denominator" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==1) endparam param bp010 caption = "power 0" default = (2,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b011 caption = "coefficient 1" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam func fb011 caption = "function 1" default = ident() visible = (@q>0 && @fractal_b==1 && @nsb==true) endfunc param bp011 caption = "power 1" default = (2,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b012 caption = "coefficient 2" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam func fb012 caption = "function 2" default = ident() visible = (@q>0 && @fractal_b==1 && @nsb==true) endfunc param bp012 caption = "power 2" default = (2,0) visible = (@q>0 && @fractal_b==1 && @nsb==true) endparam param b013 caption = "coefficient 3" default = (1,0) visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==2) endparam func fb013 caption = "function 3" default = ident() visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==2) endfunc param bp013 caption = "power 3" default = (3,0) visible = (@q>0 && @fractal_b==1 && @nsb==true && @var_b2==2) endparam ; ; TALIS B ; heading caption = "Talis" visible = @fractal_b==2 endheading int param var_b2 caption = "variation" default = 0 ; voorlopig werkt alleen de default enum = "basic" visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam param alloc_b2 caption = "allocation" default = 0 enum = "all" "fraction" "numerator" "denominator" visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam param b020 caption = "Talis constant" default = (1,0) visible = (@q>0 && @fractal_b==2) endparam param b021 caption = "coefficient 1" default = (1,0) visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam func fb021 caption = "function 1" default = ident() visible = (@q>0 && @fractal_b==2 && @nsb==true) endfunc param bp021 caption = "power 1" default = (2,0) visible = (@q>0 && @fractal_b==2) endparam param b022 caption = "coefficient 2" default = (1,0) visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam func fb022 caption = "function 2" default = ident() visible = (@q>0 && @fractal_b==2 && @nsb==true) endfunc param bp022 caption = "power 2" default = (1,0) visible = (@q>0 && @fractal_b==2 && @nsb==true) endparam ; ; COMBI z&c B ; heading caption = "z&c" visible = (@q>0 && @fractal_b==3) endheading param alloc_b3 caption = "allocation" default = 0 enum = "all" "part 1" "part 2" "part 3" "part 4" "part 5" "part 6" visible = (@q>0 && @fractal_b==3) endparam param b031 caption = "z&coefficient" default = (1,0) visible = @fractal_b==3 endparam func fb031 caption = "z-function" default = ident() visible = @fractal_b==3 endfunc param bp031 caption = "z-power" default = (2,0) visible = @fractal_b==3 endparam param b032 caption = "zc-coefficient" default = (1,0) visible = @fractal_b==3 endparam func fb032 caption = "z-function zc" default = ident() visible = @fractal_a==3 endfunc param bp032 caption = "z-power zc" default = (2,0) visible = @fractal_b==3 endparam func fb033 caption = "c-function zc" default = ident() visible = @fractal_b==3 endfunc param bp033 caption = "c-power zc" default = (2,0) visible = @fractal_b==3 endparam ; ; SMOOKS B ; heading caption = " Smooks" visible = (@q>0 && @sma==true) endheading param flipper_b caption = "flipper" default = 0 enum = "none" "only north-east" "all" visible = @smb==true endparam param mode_b caption = "smooks mode" default = 0 enum = "none" "original smooks" "3 segments" "4 segments" "S to N" "W to E" visible = @smb==true endparam bool param submb caption = "sub modus toggle" default = false visible = (@smb==true && (@mode_b==2 || @mode_b==3)) endparam float param alpha_b caption = "angle alpha" default = 360 min = 90 max = 360 visible = (@smb==true && (@mode_b==2 || @mode_b==3)) endparam param gamma_b caption = "(alpha/beta)" default = (90,270) min = (90,90) max = (360,360) visible = (@smb==true && @mode_b==3) endparam ; switch: type = "AvariantM" seed = #pixel ; a001 = a001 a002 = a002 a003 = a003 a004 = a004 a011 = a011 a012 = a012 a013 = a013 a01n = a01n a01t = a01t a020 = a020 a021 = a021 a022 = a022 a031 = a031 a032 = a032 alloc_a00 = alloc_a00 alloc_a01 = alloc_a01 alloc_a02 = alloc_a02 alloc_a03 = alloc_a03 alloc_a1 = alloc_a1 alloc_a2 = alloc_a2 alloc_a3 = alloc_a3 alloc_b00 = alloc_b00 alloc_b01 = alloc_b01 alloc_b02 = alloc_b02 alloc_b03 = alloc_b03 alloc_b1 = alloc_b1 alloc_b2 = alloc_b2 alloc_b3 = alloc_b3 alpha_a = alpha_a alpha_b = alpha_b ap001 = ap001 ap002 = ap002 ap003 = ap003 ap004 = ap004 ap010 = ap010 ap011 = ap011 ap012 = ap012 ap013 = ap013 ap021 = ap021 ap022 = ap022 ap031 = ap031 ap032 = ap032 ap033 = ap033 as = as b001 = b001 b002 = b002 b003 = b003 b004 = b004 b01n = b01n b01t = b01t b011 = b011 b012 = b012 b013 = b013 b01d = b01d b01n = b01n b020 = b020 b021 = b021 b022 = b022 b031 = b031 b032 = b032 bailout_type = bailout_type bailout_value = bailout_value bp = bp bpp = bpp bp001 = bp001 bp002 = bp002 bp003 = bp003 bp004 = bp004 bp010 = bp010 bp011 = bp011 bp012 = bp012 bp013 = bp013 bp021 = bp021 bp022 = bp022 bp031 = bp031 bp032 = bp032 bp033 = bp033 bs = bs fa001 = fa001 fa002 = fa002 fa003 = fa003 fa004 = fa004 fa011 = fa011 fa012 = fa012 fa013 = fa013 fa021 = fa021 fa022 = fa022 fa031 = fa031 fa032 = fa032 fa033 = fa033 fb001 = fb001 fb002 = fb002 fb003 = fb003 fb004 = fb004 fb011 = fb011 fb012 = fb012 fb013 = fb013 fb021 = fb021 fb022 = fb022 fb031 = fb031 fb032 = fb032 fb033 = fb033 flipper_a = flipper_a flipper_b = flipper_b fca = fca fcb = fcb fractal_a = fractal_a fractal_b = fractal_b gamma_a = gamma_a gamma_b = gamma_b gate = gate keep_going = keep_going mode_a = mode_a mode_b = mode_b nsa = nsa nsb = nsb opt = opt option = option parallel = parallel q = q scala = scala sma = sma smb = smb smbd = smbd smbn = smbn ; start_a = start_a start_b = start_b subma = subma submb = submb term_a = term_a term_b = term_b threshold = threshold var_a1 = var_a1 var_a2 = var_a2 var_b1 = var_b1 var_b2 = var_b2 } ==================================================================================================================================== BarnsleyLuxe(UF4) { ; by Ed Algra, 2008-07-18 ; With thanks to: ; Samuel Monnier, and ; Jock Cooper (general concept) ; Michèle Dessureault (bailout options) ; Dr. Olivier Steiger (Steiger formula variants, glueing concept, bailout) ; and many others. ; Info: ea.txt ; UF4 means: written for UF4 (and UF3) ; works in UF5, but no facilities of UF5 have been used ; July 15 2008 global: ch = (0,0) cl = (0,0) d = @origin if @input == 0 ; direct ch=@cch cl=@ccl elseif @input == 1 ; via functions ch = @fnhi(@bseed) cl = @fnlo(@bseed) elseif @input == 2 ; techno ch = real(d) + flip(real(@tseed)) cl = real(imag(@tseed)) + flip(d) else ; original ch = @cseed cl = ch endif complex qh = @psech complex ql = @psecl if (@invert_hi==true && @op_hi>1) qh = 1/qh endif if (@invert_lo==true && @op_lo>1) ql = 1/ql endif float cr = real(ch) float ci = imag(ch) float kr = real(@k) float ki = imag(@k) init: z = #pixel oldz = z zz = 0.0 gh = ch gl = cl bool keep_going = true int iter = 0 float temp = 0.0 float auxc = @crit float path = 0.0 float phi = 0.0 float diff = 0.0 float bailtest = 0.0 float sth = 1.0 float stl = 1.0 loop: iter = iter + 1 if @flight_hi == true gh = iter*@dh*ch endif if @flight_lo == true gl = iter*@dl*cl endif if @mode == 0 || @mode == 24 || @mode == 25 || @mode == 26 temp = @kt*real(z) elseif @mode == 1 || @mode == 27 || @mode == 28 || @mode == 29 temp = @kt*imag(z) elseif @mode == 2 || @mode == 33 || @mode == 34 || @mode == 35 temp = @kt*|z| auxc = sqr(@crit) elseif @mode == 3 || @mode == 30 || @mode == 31 || @mode == 32 temp = @kt*atan2(z) elseif @mode == 4 ; sum 1 temp = kr*real(z) + ki*imag(z) elseif @mode == 5 ; sum 2 temp = kr*real(z) + ki*atan2(z) elseif @mode == 6 ; sum 3 temp = kr*imag(z) + ki*atan2(z) elseif @mode == 7 ; sum 4 temp = kr*real(z) + ki*imag(z) + @kt*atan2(z) elseif @mode == 8 ; product 1 temp = @kt*real(z)*imag(z) elseif @mode == 9 ; product 2 temp = @kt*real(z)*atan2(z) elseif @mode == 10 ; product 3 temp = @kt*imag(z)*atan2(z) elseif @mode == 11 ; product 4 temp = @kt*real(z)*imag(z)*atan2(z) elseif @mode == 12 ; quotient 1 temp = @kt*real(z)/imag(z) elseif @mode == 13 ; quotient 2 temp = @kt*imag(z)/real(z) elseif @mode == 14 ; quotient 3 temp = @kt*real(z)/atan2(z) elseif @mode == 15 ; quotient 4 temp = @kt*atan2(z)/real(z) elseif @mode == 16 ; quotient 5 temp = @kt*imag(z)/atan2(z) elseif @mode == 17 ; quotient 6 temp = @kt*atan2(z)/imag(z) elseif @mode == 18 ; power 1 temp = @kt*real(z)^imag(z) elseif @mode == 19 ; power 2 temp = @kt*imag(z)^real(z) elseif @mode == 20 ; power 3 temp = @kt*real(z)^atan2(z) elseif @mode == 21 ; power 4 temp = @kt*atan2(z)^real(z) elseif @mode == 22 ; power 5 temp = @kt*imag(z)^atan2(z) elseif @mode == 23 ; power 6 temp = @kt*atan2(z)^imag(z) elseif @mode == 36 ; original II temp = kr*real(z)*ci + ki*imag(z)*cr endif if @fmode == 1 temp = sqr(temp) elseif @fmode == 2 temp = sqrt(temp) elseif @fmode == 3 temp = log(temp) elseif @fmode == 4 temp = exp(temp) elseif @fmode == 5 temp = abs(temp) elseif @fmode == 6 temp = recip(temp) elseif @fmode == 7 temp = sin(temp) elseif @fmode == 8 temp = asin(temp) elseif @fmode == 9 temp = sinh(temp) elseif @fmode == 10 temp = asinh(temp) elseif @fmode == 11 temp = cos(temp) elseif @fmode == 12 temp = acos(temp) elseif @fmode == 13 temp = cosh(temp) elseif @fmode == 14 temp = acos(temp) elseif @fmode == 15 temp = acosh(temp) elseif @fmode == 16 temp = tan(temp) elseif @fmode == 17 temp = tanh(temp) elseif @fmode == 18 temp = atanh(temp) elseif @fmode == 19 temp = cotan(temp) elseif @fmode == 20 temp = cotanh(temp) elseif @fmode == 21 temp = round(temp) elseif @fmode == 22 temp = trunc(temp) elseif @fmode == 23 temp = ceil(temp) endif if @stgh == 0 sth = 1 elseif @stgh == 1 sth = 1 + 0.25*sqr(imag(z)) elseif @stgh == 2 sth = 1 + exp(-sqr(imag(z))) elseif @stgh == 3 sth = 1 + 0.5*sin(imag(z)) elseif @stgh == 4 sth = 1 + 0.25*sqr(real(z)) elseif @stgh == 5 sth = 1 + exp(-sqr(real(z))) elseif @stgh == 6 sth = 1 + 0.5*sin(real(z)) endif if @stgl == 0 stl = 1 elseif @stgl == 1 stl = 1 + 0.25*sqr(imag(z)) elseif @stgl == 2 stl = 1 + exp(-sqr(imag(z))) elseif @stgl == 3 stl = 1 + 0.5*sin(imag(z)) elseif @stgl == 4 stl = 1 + 0.25*sqr(real(z)) elseif @stgl == 5 stl = 1 + exp(-sqr(real(z))) elseif @stgl == 6 stl = 1 + 0.5*sin(real(z)) endif ; hi if temp > auxc if @form_hi == 0 ; main (type I >crit) z = @fnh(z^@mh+(sth*@ph))*gh elseif @form_hi == 1 ; jocks z = @fnh(z^@mh*gh+(sth*@ph)) elseif @form_hi == 2 ; deviant z = @fnh(z^@mh+gh+(sth*@ph)) elseif @form_hi == 3 ; type III if @fnhIII == 0 z = @fnh(z^@mh+(sth*@ph))+gh*real(z) elseif @fnhIII == 1 z = @fnh(z^@mh+(sth*@ph))+gh*imag(z) elseif @fnhIII == 2 z = @fnh(z^@mh+(sth*@ph))+gh*|z| elseif @fnhIII == 3 z = @fnh(z^@mh+(sth*@ph)) ; gh inactive endif elseif @form_hi == 4 ; formule vlg. alt z = @fnh(z^@mh+(sth*@ph))^gh endif if iter>@skiphi if @op_hi == 0 z = @fh(z) ; naturel elseif @op_hi == 1 ; + z = @fh(z+qh) elseif @op_hi == 2 ; * z = @fh(z*qh) elseif @op_hi == 3 ; ^ z = @fh(z^qh) endif endif ; lo else if @form_lo == 0 z = @fnl(z^@ml+(stl*@pl))*gl elseif @form_lo == 1 z = @fnl(z^@ml*gl+(stl*@pl)) elseif @form_lo == 2 z = @fnl(z^@ml+gl+(stl*@pl)) elseif @form_lo == 3 if @fnlIII == 0 z = @fnl(z^@ml+(stl*@pl))+gl*real(z) elseif @fnlIII == 1 z = @fnl(z^@ml+(stl*@pl))+gl*imag(z) elseif @fnlIII == 2 z = @fnl(z^@ml+(stl*@pl))+gl*|z| elseif @fnlIII == 3 z = @fnl(z^@ml+(stl*@pl)) endif elseif @form_lo == 4 z = @fnl(z^@ml+(stl*@pl))^gl endif if iter>@skiplo if @op_lo == 0 ; none z = @fl(z) elseif @op_lo == 1 ; + z = @fl(z+ql) elseif @op_lo == 2 ; * z = @fl(z*ql) elseif @op_lo == 3 ; ^ z = @fl(z^ql) endif endif endif ; alternates if (@mode>23 && @mode<36) if @mode == 27 || @mode == 30 || @mode == 33 temp = real(z) elseif @mode == 24 || @mode == 31 || @mode == 34 temp = imag(z) elseif @mode == 25 || @mode == 28 || @mode == 35 temp = atan2(z) elseif @mode == 26 || @mode == 29 || @mode == 32 temp = |z| auxc = sqr(@crit) endif if @famode == 1 temp = sqr(temp) elseif @famode == 2 temp = sqrt(temp) elseif @famode == 3 temp = log(temp) elseif @famode == 4 temp = exp(temp) elseif @famode == 5 temp = abs(temp) elseif @famode == 6 temp = recip(temp) elseif @famode == 7 temp = sin(temp) elseif @famode == 8 temp = asin(temp) elseif @famode == 9 temp = sinh(temp) elseif @famode == 10 temp = asinh(temp) elseif @famode == 11 temp = cos(temp) elseif @famode == 12 temp = acos(temp) elseif @famode == 13 temp = cosh(temp) elseif @famode == 14 temp = acos(temp) elseif @famode == 15 temp = acosh(temp) elseif @famode == 16 temp = tan(temp) elseif @famode == 17 temp = tanh(temp) elseif @famode == 18 temp = atanh(temp) elseif @famode == 19 temp = cotan(temp) elseif @famode == 20 temp = cotanh(temp) elseif @famode == 21 temp = round(temp) elseif @famode == 22 temp = trunc(temp) elseif @famode == 23 temp = ceil(temp) endif if @altplus == true if @stgh == 1 sth = 1 + 0.25*sqr(imag(z)) elseif @stgh == 2 sth = 1 + exp(-sqr(imag(z))) elseif @stgh == 3 sth = 1 + 0.5*sin(imag(z)) elseif @stgh == 4 sth = 1 + 0.25*sqr(real(z)) elseif @stgh == 5 sth = 1 + exp(-sqr(real(z))) elseif @stgh == 6 sth = 1 + 0.5*sin(real(z)) endif if @stgl == 1 stl = 1 + 0.25*sqr(imag(z)) elseif @stgl == 2 stl = 1 + exp(-sqr(imag(z))) elseif @stgl == 3 stl = 1 + 0.5*sin(imag(z)) elseif @stgl == 4 stl = 1 + 0.25*sqr(real(z)) elseif @stgl == 5 stl = 1 + exp(-sqr(real(z))) elseif @stgl == 6 stl = 1 + 0.5*sin(real(z)) endif endif ; hi if temp > auxc if @form_hi == 0 ; main z = @fnh(z^@mh+(sth*@ph))*gh elseif @form_hi == 1 ; jocks z = @fnh(z^@mh*gh+(sth*@ph)) elseif @form_hi == 2 ; deviant z = @fnh(z^@mh+gh+(sth*@ph)) elseif @form_hi == 3 ; type III if @fnhIII == 0 z = @fnh(z^@mh+(sth*@ph))+gh*real(z) elseif @fnhIII == 1 z = @fnh(z^@mh+(sth*@ph))+gh*imag(z) elseif @fnhIII == 2 z = @fnh(z^@mh+(sth*@ph))+gh*|z| elseif @fnhIII == 3 z = @fnh(z^@mh+(sth*@ph)) ; gh inactive endif elseif @form_hi == 4 ; formule vlg. alt z = @fnh(z^@mh+(sth*@ph))^gh endif if iter>@skiphi if @op_hi == 0 z = @fh(z) ; naturel elseif @op_hi == 1 ; + z = @fh(z+qh) elseif @op_hi == 2 ; * z = @fh(z*qh) elseif @op_hi == 3 ; ^ z = @fh(z^qh) endif endif ; lo else if @form_lo == 0 z = @fnl(z^@ml+(stl*@pl))*gl elseif @form_lo == 1 z = @fnl(z^@ml*gl+(stl*@pl)) elseif @form_lo == 2 z = @fnl(z^@ml+gl+(stl*@pl)) elseif @form_lo == 3 if @fnlIII == 0 z = @fnl(z^@ml+(stl*@pl))+gl*real(z) elseif @fnlIII == 1 z = @fnl(z^@ml+(stl*@pl))+gl*imag(z) elseif @fnlIII == 2 z = @fnl(z^@ml+(stl*@pl))+gl*|z| elseif @fnlIII == 3 z = @fnl(z^@ml+(stl*@pl)) endif elseif @form_lo == 4 z = @fnl(z^@ml+(stl*@pl))^gl endif if iter>@skiplo if @op_lo == 0 z = @fl(z) ; naturel elseif @op_lo == 1 ; + z = @fl(z+ql) elseif @op_lo == 2 ; * z = @fl(z*ql) elseif @op_lo == 3 ; ^ z = @fl(z^ql) endif endif endif endif path = path + abs(|z|) phi = atan2(z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif diff = abs(|z|-|oldz|) oldz = z if @gf == 0 zz = z elseif @gf == 1 zz = exp(z) elseif @gf == 2 zz = sqrt(z) elseif @gf == 3 zz = sqr(z) elseif @gf == 4 zz = cosh(z) elseif @gf == 5 zz = cos(z) elseif @gf == 6 zz = sinh(z) elseif @gf == 7 zz = sin(z) endif if @test == 0 bailtest = |zz| elseif @test == 1 bailtest = sqr(real(zz)) elseif @test == 2 bailtest = sqr(imag(zz)) elseif @test == 5 bailtest = sqr(abs(real(zz)) + abs(imag(zz))) elseif @test == 6 bailtest = sqr(real(zz) + imag(zz)) elseif @test == 7 bailtest = |zz|+iter^2 elseif @test == 8 bailtest = |zz|+phi^2 elseif @test == 9 bailtest = |zz|+path^2 elseif @test == 10 bailtest = |zz|+diff^2 elseif @test == 11 bailtest = sqr(abs(real(zz))-abs(imag(zz))) elseif @test == 12 bailtest = sqr(abs(real(zz))*abs(imag(zz))) elseif @test == 13 bailtest = sqr(abs(real(zz))/abs(imag(zz))) elseif @test == 14 bailtest = sqr(abs(real(zz))^abs(imag(zz))) elseif @test == 15 bailtest = sqr(abs(imag(zz))^abs(real(zz))) endif if ((@test<3 || @test> 4) && (bailtest > @bailout)) || \ ((@test == 3 && (sqr(real(zz)) > @bailout) && (sqr(imag(zz)) > @bailout))) || \ ((@test == 4 && ((sqr(real(zz)) > @bailout) || (sqr(imag(zz)) > @bailout)))) keep_going = false endif bailout: keep_going==true default: title = "BarnsleyJ DeLuxe (UF4)" method = multipass periodicity = 0 maxiter = 150 magn = 1 heading caption="general" endheading param mode caption = "mode" default = 24 enum = "real" "imaginary" "modulus" "argument" \ "sum 1" "sum 2" "sum 3" "sum 4" \ "product 1" "product 2" "product 3" "product 4" \ "quotient 1" "quotient 2" "quotient 3" "quotient 4""quotient 5" "quotient 6" \ "power 1" "power 2" "power 3" "power 4" "power 5" "power 6" \ "alternate 1" "alternate 2" "alternate 3" "alternate 4" "alternate 5" "alternate 6" \ "alternate 7" "alternate 8" "alternate 9" "alternate 10" "alternate 11" "alternate 12" \ "type II" endparam param fmode caption = "function mode" default = 0 enum = "ident" "sqr" "sqrt" "log" "exp" "abs" "recip" "sin" "asin" "sinh" "asinh" "cos" "acos" \ "cosh" "acosh" "tan" "atan" "tanh" "atanh" "cotan" "cotanh" "round" "trunc" "ceil" endparam param famode caption = "funct. mode alternating" default = 0 enum = "ident" "sqr" "sqrt" "log" "exp" "abs" "recip" "sin" "asin" "sinh" "asinh" "cos" "acos" \ "cosh" "acosh" "tan" "atan" "tanh" "atanh" "cotan" "cotanh" "round" "trunc" "ceil" visible = (@mode>23 && @mode<36) endparam bool param altplus caption = "alternating plus" default = false visible = ((@mode>23 && @mode<36) && \ (@stgh>0 || @stgl>0) || (@stgh>0 && @stgl>0)) endparam param k caption = "mode scaling" default = (1.0,0.0) visible = ((@mode>3 && @mode<8) || @mode==36) endparam float param kt caption = "mode scaling" default = 1.0 visible = (@mode<4 || (@mode>6 && @mode<36)) endparam float param crit caption = "critical value" default = 0.0 endparam param input caption = "input" default = 2 enum = "direct" "via functions" "techno" "original" endparam param bseed caption = "b-seed" default = (0,1) visible = (@input == "via functions") endparam param tseed caption = "t-seed" default = (-1.8,0.3) visible = (@input == "techno") endparam param cseed caption = "original seed" default = (0,0) visible = (@input == "original") endparam param test caption = "bailout test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "iter" "angle" \ "path" "diff" "minus" "product" "division" "real^imag" "imag^real" endparam param gf caption = "bailout function" default = 0 enum = "ident" "exp" "sqrt" "sqr" "cosh" "cos" "sinh" "sin" endparam param bailout caption = "bailout value" default = 1000 endparam ;------------------------------------------------- heading caption="branch hi" endheading func fnhi caption = "hi seed function" default = cotan() visible = (@input == "via functions") endfunc param cch caption = "barnsley seed hi" default = (0,-1.8) visible = (@input == "direct") endparam param form_hi caption = "formula hi" default = 0 enum = "main" "jocks" "deviant" "type III" "alt" endparam param stgh caption = "Steiger variant" default = 0 enum = "none" "parabolic" "gaussian" "sine" "var p" "var g" "var s" endparam param fnhIII caption = "type III variant" default = 0 enum = "real" "imag" "mod" "c inactive" visible = (@form_hi == "type III") endparam func fnh caption = "prim. function hi" default = ident() endfunc param ph caption = "prim. parameter hi" default = (-1.1,-0.1) endparam bool param flight_hi caption = "flight hi" default = false visible = !(@mode == 36) endparam param dh caption = "flight parameter hi" default = (0.1,0) visible = @flight_hi == true endparam param op_hi caption = "operator hi" default = 0 enum = "none" "+" "*" "^" endparam bool param invert_hi caption = "invert hi" default = false visible = @op_hi>1 endparam int param skiphi caption = "skip cycle(s)" default = 0 endparam func fh caption = "sec. function hi" default = ident() endfunc param psech caption = "sec. parameter hi" default = (1,0) visible = @op_hi>0 endparam param mh caption = "power (hi)" default = (1,0) endparam ;---------------------------------------------------------- heading caption="branch lo" endheading func fnlo caption = "lo seed function" default = cosh() visible = (@input == "via functions") endfunc param ccl caption = "barnsley seed lo" default = (0.3,0) visible = (@input == "direct") endparam param form_lo caption = "formula lo" default = 0 enum = "main" "jocks" "deviant" "type III" "alt" endparam param stgl caption = "Steiger variant" default = 0 enum = "none" "parabolic" "gaussian" "sine" "var p" "var g" "var s" endparam param fnlIII caption = "type III variant" default = 0 enum = "real" "imag" "mod" "c inactive" visible = (@form_lo == "type III") endparam func fnl caption = "prim. function lo" default = ident() endfunc param pl caption = "prim. parameter lo" default = (-3,1.5) endparam bool param flight_lo caption = "flight lo" default = false visible = !(@mode == 36) endparam param dl caption = "flight parameter lo" default = (0.1,0) visible = @flight_lo == true endparam param op_lo caption = "operator lo" default = 0 enum = "none" "+" "*" "^" endparam bool param invert_lo caption = "invert lo" default = false visible = @op_lo>1 endparam int param skiplo caption = "skip cycle(s)" default = 0 endparam func fl caption = "sec. function lo" default = ident() endfunc param psecl caption = "sec. parameter lo" default = (1,0) visible = @op_lo>0 endparam param ml caption = "power lo" default = (1,0) endparam ;---------------------------------------------------------- heading caption="techno reset: Re = 0 / Im = 0" visible = @input == "techno" endheading param origin caption = "origin" default = (0.0,0.0) visible = @input == "techno" endparam } ===================================================================================================================================== BarnsleyTechnoJUF4 { ; With thanks to: ; Samuel Monnier, and ; Jock Cooper (general concept) ; Michèle Dessureault (bailout options) ; Dr. Olivier Steiger (Steiger formula variants, glueing concept, bailout) ; and many others. global: ch = (0,0) cl = (0,0) d = @origin ch = real(d) + flip(real(@tseed)) cl = real(imag(@tseed)) + flip(d) complex qh = @psech complex ql = @psecl if (@invert_hi==true && @op_hi>1) qh = 1/qh endif if (@invert_lo==true && @op_lo>1) ql = 1/ql endif float cr = real(ch) float ci = imag(ch) float kr = real(@k) float ki = imag(@k) init: z = #pixel oldz = z zz = 0.0 gh = ch gl = cl bool keep_going = true int iter = 0 float temp = 0.0 float auxc = @crit float path = 0.0 float phi = 0.0 float diff = 0.0 float bailtest = 0.0 float sth = 1.0 float stl = 1.0 loop: iter = iter + 1 if @flight_hi == true gh = iter*@dh*ch endif if @flight_lo == true gl = iter*@dl*cl endif if @mode == 0 || @mode == 24 || @mode == 25 || @mode == 26 temp = @kt*real(z) elseif @mode == 1 || @mode == 27 || @mode == 28 || @mode == 29 temp = @kt*imag(z) elseif @mode == 2 || @mode == 33 || @mode == 34 || @mode == 35 temp = @kt*|z| auxc = sqr(@crit) elseif @mode == 3 || @mode == 30 || @mode == 31 || @mode == 32 temp = @kt*atan2(z) elseif @mode == 4 ; sum 1 temp = kr*real(z) + ki*imag(z) elseif @mode == 5 ; sum 2 temp = kr*real(z) + ki*atan2(z) elseif @mode == 6 ; sum 3 temp = kr*imag(z) + ki*atan2(z) elseif @mode == 7 ; sum 4 temp = kr*real(z) + ki*imag(z) + @kt*atan2(z) elseif @mode == 8 ; product 1 temp = @kt*real(z)*imag(z) elseif @mode == 9 ; product 2 temp = @kt*real(z)*atan2(z) elseif @mode == 10 ; product 3 temp = @kt*imag(z)*atan2(z) elseif @mode == 11 ; product 4 temp = @kt*real(z)*imag(z)*atan2(z) elseif @mode == 12 ; quotient 1 temp = @kt*real(z)/imag(z) elseif @mode == 13 ; quotient 2 temp = @kt*imag(z)/real(z) elseif @mode == 14 ; quotient 3 temp = @kt*real(z)/atan2(z) elseif @mode == 15 ; quotient 4 temp = @kt*atan2(z)/real(z) elseif @mode == 16 ; quotient 5 temp = @kt*imag(z)/atan2(z) elseif @mode == 17 ; quotient 6 temp = @kt*atan2(z)/imag(z) elseif @mode == 18 ; power 1 temp = @kt*real(z)^imag(z) elseif @mode == 19 ; power 2 temp = @kt*imag(z)^real(z) elseif @mode == 20 ; power 3 temp = @kt*real(z)^atan2(z) elseif @mode == 21 ; power 4 temp = @kt*atan2(z)^real(z) elseif @mode == 22 ; power 5 temp = @kt*imag(z)^atan2(z) elseif @mode == 23 ; power 6 temp = @kt*atan2(z)^imag(z) elseif @mode == 36 ; original II temp = kr*real(z)*ci + ki*imag(z)*cr endif if @fmode == 1 temp = sqr(temp) elseif @fmode == 2 temp = sqrt(temp) elseif @fmode == 3 temp = log(temp) elseif @fmode == 4 temp = exp(temp) elseif @fmode == 5 temp = abs(temp) elseif @fmode == 6 temp = recip(temp) elseif @fmode == 7 temp = sin(temp) elseif @fmode == 8 temp = asin(temp) elseif @fmode == 9 temp = sinh(temp) elseif @fmode == 10 temp = asinh(temp) elseif @fmode == 11 temp = cos(temp) elseif @fmode == 12 temp = acos(temp) elseif @fmode == 13 temp = cosh(temp) elseif @fmode == 14 temp = acos(temp) elseif @fmode == 15 temp = acosh(temp) elseif @fmode == 16 temp = tan(temp) elseif @fmode == 17 temp = tanh(temp) elseif @fmode == 18 temp = atanh(temp) elseif @fmode == 19 temp = cotan(temp) elseif @fmode == 20 temp = cotanh(temp) elseif @fmode == 21 temp = round(temp) elseif @fmode == 22 temp = trunc(temp) elseif @fmode == 23 temp = ceil(temp) endif if @stgh == 1 sth = 1 + 0.25*sqr(imag(z)) elseif @stgh == 2 sth = 1 + exp(-sqr(imag(z))) elseif @stgh == 3 sth = 1 + 0.5*sin(imag(z)) elseif @stgh == 4 sth = 1 + 0.25*sqr(real(z)) elseif @stgh == 5 sth = 1 + exp(-sqr(real(z))) elseif @stgh == 6 sth = 1 + 0.5*sin(real(z)) endif if @stgl == 1 stl = 1 + 0.25*sqr(imag(z)) elseif @stgl == 2 stl = 1 + exp(-sqr(imag(z))) elseif @stgl == 3 stl = 1 + 0.5*sin(imag(z)) elseif @stgl == 4 stl = 1 + 0.25*sqr(real(z)) elseif @stgl == 5 stl = 1 + exp(-sqr(real(z))) elseif @stgl == 6 stl = 1 + 0.5*sin(real(z)) endif ; hi if temp > auxc if @form_hi == 0 ; main (type I >crit) z = @fnh(z^@mh+(sth*@ph))*gh elseif @form_hi == 1 ; jocks z = @fnh(z^@mh*gh+(sth*@ph)) elseif @form_hi == 2 ; deviant z = @fnh(z^@mh+gh+(sth*@ph)) elseif @form_hi == 3 ; type III if @fnhIII == 0 z = @fnh(z^@mh+(sth*@ph))+gh*real(z) elseif @fnhIII == 1 z = @fnh(z^@mh+(sth*@ph))+gh*imag(z) elseif @fnhIII == 2 z = @fnh(z^@mh+(sth*@ph))+gh*|z| elseif @fnhIII == 3 z = @fnh(z^@mh+(sth*@ph)) endif elseif @form_hi == 4 ; formule vlg. alt z = @fnh(z^@mh+(sth*@ph))^gh endif if iter>@skiphi if @op_hi == 0 z = @fh(z) ; naturel elseif @op_hi == 1 ; + z = @fh(z+qh) elseif @op_hi == 2 ; * z = @fh(z*qh) elseif @op_hi == 3 ; ^ z = @fh(z^qh) endif endif ; lo else if @form_lo == 0 z = @fnl(z^@ml+(stl*@pl))*gl elseif @form_lo == 1 z = @fnl(z^@ml*gl+(stl*@pl)) elseif @form_lo == 2 z = @fnl(z^@ml+gl+(stl*@pl)) elseif @form_lo == 3 if @fnlIII == 0 z = @fnl(z^@ml+(stl*@pl))+gl*real(z) elseif @fnlIII == 1 z = @fnl(z^@ml+(stl*@pl))+gl*imag(z) elseif @fnlIII == 2 z = @fnl(z^@ml+(stl*@pl))+gl*|z| elseif @fnlIII == 3 z = @fnl(z^@ml+(stl*@pl)) endif elseif @form_lo == 4 z = @fnl(z^@ml+(stl*@pl))^gl endif if iter>@skiplo if @op_lo == 0 ; none z = @fl(z) elseif @op_lo == 1 ; + z = @fl(z+ql) elseif @op_lo == 2 ; * z = @fl(z*ql) elseif @op_lo == 3 ; ^ z = @fl(z^ql) endif endif endif ; alternates if (@mode>23 && @mode<36) if @mode == 27 || @mode == 30 || @mode == 33 temp = real(z) elseif @mode == 24 || @mode == 31 || @mode == 34 temp = imag(z) elseif @mode == 25 || @mode == 28 || @mode == 35 temp = atan2(z) elseif @mode == 26 || @mode == 29 || @mode == 32 temp = |z| auxc = sqr(@crit) endif if @famode == 1 temp = sqr(temp) elseif @famode == 2 temp = sqrt(temp) elseif @famode == 3 temp = log(temp) elseif @famode == 4 temp = exp(temp) elseif @famode == 5 temp = abs(temp) elseif @famode == 6 temp = recip(temp) elseif @famode == 7 temp = sin(temp) elseif @famode == 8 temp = asin(temp) elseif @famode == 9 temp = sinh(temp) elseif @famode == 10 temp = asinh(temp) elseif @famode == 11 temp = cos(temp) elseif @famode == 12 temp = acos(temp) elseif @famode == 13 temp = cosh(temp) elseif @famode == 14 temp = acos(temp) elseif @famode == 15 temp = acosh(temp) elseif @famode == 16 temp = tan(temp) elseif @famode == 17 temp = tanh(temp) elseif @famode == 18 temp = atanh(temp) elseif @famode == 19 temp = cotan(temp) elseif @famode == 20 temp = cotanh(temp) elseif @famode == 21 temp = round(temp) elseif @famode == 22 temp = trunc(temp) elseif @famode == 23 temp = ceil(temp) endif if @altplus == true if @stgh == 1 sth = 1 + 0.25*sqr(imag(z)) elseif @stgh == 2 sth = 1 + exp(-sqr(imag(z))) elseif @stgh == 3 sth = 1 + 0.5*sin(imag(z)) elseif @stgh == 4 sth = 1 + 0.25*sqr(real(z)) elseif @stgh == 5 sth = 1 + exp(-sqr(real(z))) elseif @stgh == 6 sth = 1 + 0.5*sin(real(z)) endif if @stgl == 1 stl = 1 + 0.25*sqr(imag(z)) elseif @stgl == 2 stl = 1 + exp(-sqr(imag(z))) elseif @stgl == 3 stl = 1 + 0.5*sin(imag(z)) elseif @stgl == 4 stl = 1 + 0.25*sqr(real(z)) elseif @stgl == 5 stl = 1 + exp(-sqr(real(z))) elseif @stgl == 6 stl = 1 + 0.5*sin(real(z)) endif endif ; hi if temp > auxc if @form_hi == 0 ; main z = @fnh(z^@mh+(sth*@ph))*gh elseif @form_hi == 1 ; jocks z = @fnh(z^@mh*gh+(sth*@ph)) elseif @form_hi == 2 ; deviant z = @fnh(z^@mh+gh+(sth*@ph)) elseif @form_hi == 3 ; type III if @fnhIII == 0 z = @fnh(z^@mh+(sth*@ph))+gh*real(z) elseif @fnhIII == 1 z = @fnh(z^@mh+(sth*@ph))+gh*imag(z) elseif @fnhIII == 2 z = @fnh(z^@mh+(sth*@ph))+gh*|z| elseif @fnhIII == 3 z = @fnh(z^@mh+(sth*@ph)) endif elseif @form_hi == 4 ; formule vlg. alt z = @fnh(z^@mh+(sth*@ph))^gh endif if iter>@skiphi if @op_hi == 0 z = @fh(z) ; naturel elseif @op_hi == 1 ; + z = @fh(z+qh) elseif @op_hi == 2 ; * z = @fh(z*qh) elseif @op_hi == 3 ; ^ z = @fh(z^qh) endif endif else ; lo if @form_lo == 0 z = @fnl(z^@ml+(stl*@pl))*gl elseif @form_lo == 1 z = @fnl(z^@ml*gl+(stl*@pl)) elseif @form_lo == 2 z = @fnl(z^@ml+gl+(stl*@pl)) elseif @form_lo == 3 if @fnlIII == 0 z = @fnl(z^@ml+(stl*@pl))+gl*real(z) elseif @fnlIII == 1 z = @fnl(z^@ml+(stl*@pl))+gl*imag(z) elseif @fnlIII == 2 z = @fnl(z^@ml+(stl*@pl))+gl*|z| elseif @fnlIII == 3 z = @fnl(z^@ml+(stl*@pl)) endif elseif @form_lo == 4 z = @fnl(z^@ml+(stl*@pl))^gl endif if iter>@skiplo if @op_lo == 0 z = @fl(z) ; naturel elseif @op_lo == 1 ; + z = @fl(z+ql) elseif @op_lo == 2 ; * z = @fl(z*ql) elseif @op_lo == 3 ; ^ z = @fl(z^ql) endif endif endif endif path = path + abs(|z|) phi = atan2(z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif diff = abs(|z|-|oldz|) oldz = z if @gf == 0 zz = z elseif @gf == 1 zz = exp(z) elseif @gf == 2 zz = sqrt(z) elseif @gf == 3 zz = sqr(z) elseif @gf == 4 zz = cosh(z) elseif @gf == 5 zz = cos(z) elseif @gf == 6 zz = sinh(z) elseif @gf == 7 zz = sin(z) endif if @test == 0 bailtest = |zz| elseif @test == 1 bailtest = sqr(real(zz)) elseif @test == 2 bailtest = sqr(imag(zz)) elseif @test == 5 bailtest = sqr(abs(real(zz)) + abs(imag(zz))) elseif @test == 6 bailtest = sqr(real(zz) + imag(zz)) elseif @test == 7 bailtest = |zz|+iter^2 elseif @test == 8 bailtest = |zz|+phi^2 elseif @test == 9 bailtest = |zz|+path^2 elseif @test == 10 bailtest = |zz|+diff^2 elseif @test == 11 bailtest = sqr(abs(real(zz))-abs(imag(zz))) elseif @test == 12 bailtest = sqr(abs(real(zz))*abs(imag(zz))) elseif @test == 13 bailtest = sqr(abs(real(zz))/abs(imag(zz))) elseif @test == 14 bailtest = sqr(abs(real(zz))^abs(imag(zz))) elseif @test == 15 bailtest = sqr(abs(imag(zz))^abs(real(zz))) endif if ((@test<3 || @test> 4) && (bailtest > @bailout)) || \ ((@test == 3 && (sqr(real(zz)) > @bailout) && (sqr(imag(zz)) > @bailout))) || \ ((@test == 4 && ((sqr(real(zz)) > @bailout) || (sqr(imag(zz)) > @bailout)))) keep_going = false endif bailout: keep_going==true default: title = "BarnsleyTechnoJ (UF4)" method = multipass periodicity = 0 maxiter = 150 magn = 1 heading caption="general" endheading param mode caption = "mode" default = 24 enum = "real" "imaginary" "modulus" "argument" \ "sum 1" "sum 2" "sum 3" "sum 4" \ "product 1" "product 2" "product 3" "product 4" \ "quotient 1" "quotient 2" "quotient 3" "quotient 4""quotient 5" "quotient 6" \ "power 1" "power 2" "power 3" "power 4" "power 5" "power 6" \ "alternate 1" "alternate 2" "alternate 3" "alternate 4" "alternate 5" "alternate 6" \ "alternate 7" "alternate 8" "alternate 9" "alternate 10" "alternate 11" "alternate 12" \ "type II" endparam param fmode caption = "function mode" default = 0 enum = "ident" "sqr" "sqrt" "log" "exp" "abs" "recip" "sin" "asin" "sinh" "asinh" "cos" "acos" \ "cosh" "acosh" "tan" "atan" "tanh" "atanh" "cotan" "cotanh" "round" "trunc" "ceil" endparam param famode caption = "funct. mode alternating" default = 0 enum = "ident" "sqr" "sqrt" "log" "exp" "abs" "recip" "sin" "asin" "sinh" "asinh" "cos" "acos" \ "cosh" "acosh" "tan" "atan" "tanh" "atanh" "cotan" "cotanh" "round" "trunc" "ceil" visible = (@mode>23 && @mode<36) endparam bool param altplus caption = "alternating plus" default = false visible = ((@mode>23 && @mode<36) && \ (@stgh>0 || @stgl>0) || (@stgh>0 && @stgl>0)) endparam param k caption = "mode scaling" default = (1.0,0.0) visible = ((@mode>3 && @mode<8) || @mode==36) endparam float param kt caption = "mode scaling" default = 1.0 visible = (@mode<4 || (@mode>6 && @mode<36)) endparam float param crit caption = "critical value" default = 0.0 endparam param tseed caption = "seed" default = (-1.8,0.3) endparam param test caption = "bailout test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "iter" "angle" \ "path" "diff" "minus" "product" "division" "real^imag" "imag^real" endparam param gf caption = "bailout function" default = 0 enum = "ident" "exp" "sqrt" "sqr" "cosh" "cos" "sinh" "sin" endparam param bailout caption = "bailout value" default = 1000 endparam param origin caption = "origin" default = (0.0,0.0) endparam ;------------------------------------------------- heading caption="branch hi" endheading param form_hi caption = "formula hi" default = 0 enum = "main" "jocks" "deviant" "type III" "alt" endparam param stgh caption = "Steiger variant" default = 0 enum = "none" "parabolic" "gaussian" "sine" "var p" "var g" "var s" endparam param fnhIII caption = "type III variant" default = 0 enum = "real" "imag" "mod" "c inactive" visible = (@form_hi == "type III") endparam func fnh caption = "prim. function hi" default = ident() endfunc param ph caption = "prim. parameter hi" default = (-1.1,-0.1) endparam bool param flight_hi caption = "flight hi" default = false visible = !(@mode == 36) endparam param dh caption = "flight parameter hi" default = (0.1,0) visible = @flight_hi == true endparam param op_hi caption = "operator hi" default = 0 enum = "none" "+" "*" "^" endparam bool param invert_hi caption = "invert hi" default = false visible = @op_hi>1 endparam int param skiphi caption = "skip" default = 0 endparam func fh caption = "sec. function hi" default = ident() endfunc param psech caption = "sec. parameter hi" default = (1,0) visible = @op_hi>0 endparam param mh caption = "power (hi)" default = (1,0) endparam ;---------------------------------------------------------- heading caption="branch lo" endheading param form_lo caption = "formula lo" default = 0 enum = "main" "jocks" "deviant" "type III" "alt" endparam param stgl caption = "Steiger variant" default = 0 enum = "none" "parabolic" "gaussian" "sine" "var p" "var g" "var s" endparam param fnlIII caption = "type III variant" default = 0 enum = "real" "imag" "mod" "c inactive" visible = (@form_lo == "type III") endparam func fnl caption = "prim. function lo" default = ident() endfunc param pl caption = "prim. parameter lo" default = (-3,1.5) endparam bool param flight_lo caption = "flight lo" default = false visible = !(@mode == 36) endparam param dl caption = "flight parameter lo" default = (0.1,0) visible = @flight_lo == true endparam param op_lo caption = "operator lo" default = 0 enum = "none" "+" "*" "^" endparam bool param invert_lo caption = "invert lo" default = false visible = @op_lo>1 endparam int param skiplo caption = "skip" default = 0 endparam func fl caption = "sec. function lo" default = ident() endfunc param psecl caption = "sec. parameter lo" default = (1,0) visible = @op_lo>0 endparam param ml caption = "power lo" default = (1,0) endparam switch: type = "BarnsleyTechnoMUF4" mode = mode fmode = fmode famode = famode altplus = altplus k = k kt = kt crit = crit test = test gf = gf bailout = bailout origin = origin form_hi = form_hi stgh = stgh fnhIII = fnhIII fnh = fnh ph = ph op_hi = op_hi invert_hi = invert_hi skiphi = skiphi fh = fh psech = psech mh = mh form_lo = form_lo stgl = stgl fnlIII = fnlIII fnl =fnl pl = pl op_lo = op_lo invert_lo = invert_lo skiplo = skiplo fl = fl psecl = psecl ml = ml flight_hi = flight_hi flight_lo = flight_lo } ===================================================================================================================================== BarnsleyTechnoMUF4 { ; With thanks to: ; Samuel Monnier, and ; Jock Cooper (general concept) ; Michèle Dessureault (bailout options) ; Dr. Olivier Steiger (Steiger formula variants, glueing concept, bailout) ; and many others. global: d = @origin complex qh = @psech complex ql = @psecl if (@invert_hi==true && @op_hi>1) qh = 1/qh endif if (@invert_lo==true && @op_lo>1) ql = 1/ql endif float kr = real(@k) float ki = imag(@k) init: z = (0,0) tseed = #pixel ch = real(d) + flip(real(tseed)) cl = real(imag(tseed)) + flip(d) oldz = z zz = 0.0 gh = ch gl = cl bool keep_going = true int iter = 0 float temp = 0.0 float auxc = @crit float path = 0.0 float phi = 0.0 float diff = 0.0 float bailtest = 0.0 float sth = 1.0 float stl = 1.0 float cr = real(ch) float ci = imag(ch) loop: iter = iter + 1 if @flight_hi == true gh = iter*@dh*ch endif if @flight_lo == true gl = iter*@dl*cl endif if @mode == 0 || @mode == 24 || @mode == 25 || @mode == 26 temp = @kt*real(z) elseif @mode == 1 || @mode == 27 || @mode == 28 || @mode == 29 temp = @kt*imag(z) elseif @mode == 2 || @mode == 33 || @mode == 34 || @mode == 35 temp = @kt*|z| auxc = sqr(@crit) elseif @mode == 3 || @mode == 30 || @mode == 31 || @mode == 32 temp = @kt*atan2(z) elseif @mode == 4 ; sum 1 temp = kr*real(z) + ki*imag(z) elseif @mode == 5 ; sum 2 temp = kr*real(z) + ki*atan2(z) elseif @mode == 6 ; sum 3 temp = kr*imag(z) + ki*atan2(z) elseif @mode == 7 ; sum 4 temp = kr*real(z) + ki*imag(z) + @kt*atan2(z) elseif @mode == 8 ; product 1 temp = @kt*real(z)*imag(z) elseif @mode == 9 ; product 2 temp = @kt*real(z)*atan2(z) elseif @mode == 10 ; product 3 temp = @kt*imag(z)*atan2(z) elseif @mode == 11 ; product 4 temp = @kt*real(z)*imag(z)*atan2(z) elseif @mode == 12 ; quotient 1 temp = @kt*real(z)/imag(z) elseif @mode == 13 ; quotient 2 temp = @kt*imag(z)/real(z) elseif @mode == 14 ; quotient 3 temp = @kt*real(z)/atan2(z) elseif @mode == 15 ; quotient 4 temp = @kt*atan2(z)/real(z) elseif @mode == 16 ; quotient 5 temp = @kt*imag(z)/atan2(z) elseif @mode == 17 ; quotient 6 temp = @kt*atan2(z)/imag(z) elseif @mode == 18 ; power 1 temp = @kt*real(z)^imag(z) elseif @mode == 19 ; power 2 temp = @kt*imag(z)^real(z) elseif @mode == 20 ; power 3 temp = @kt*real(z)^atan2(z) elseif @mode == 21 ; power 4 temp = @kt*atan2(z)^real(z) elseif @mode == 22 ; power 5 temp = @kt*imag(z)^atan2(z) elseif @mode == 23 ; power 6 temp = @kt*atan2(z)^imag(z) elseif @mode == 36 ; original II temp = kr*real(z)*ci + ki*imag(z)*cr endif if @fmode == 1 temp = sqr(temp) elseif @fmode == 2 temp = sqrt(temp) elseif @fmode == 3 temp = log(temp) elseif @fmode == 4 temp = exp(temp) elseif @fmode == 5 temp = abs(temp) elseif @fmode == 6 temp = recip(temp) elseif @fmode == 7 temp = sin(temp) elseif @fmode == 8 temp = asin(temp) elseif @fmode == 9 temp = sinh(temp) elseif @fmode == 10 temp = asinh(temp) elseif @fmode == 11 temp = cos(temp) elseif @fmode == 12 temp = acos(temp) elseif @fmode == 13 temp = cosh(temp) elseif @fmode == 14 temp = acos(temp) elseif @fmode == 15 temp = acosh(temp) elseif @fmode == 16 temp = tan(temp) elseif @fmode == 17 temp = tanh(temp) elseif @fmode == 18 temp = atanh(temp) elseif @fmode == 19 temp = cotan(temp) elseif @fmode == 20 temp = cotanh(temp) elseif @fmode == 21 temp = round(temp) elseif @fmode == 22 temp = trunc(temp) elseif @fmode == 23 temp = ceil(temp) endif if @stgh == 1 sth = 1 + 0.25*sqr(imag(z)) elseif @stgh == 2 sth = 1 + exp(-sqr(imag(z))) elseif @stgh == 3 sth = 1 + 0.5*sin(imag(z)) elseif @stgh == 4 sth = 1 + 0.25*sqr(real(z)) elseif @stgh == 5 sth = 1 + exp(-sqr(real(z))) elseif @stgh == 6 sth = 1 + 0.5*sin(real(z)) endif if @stgl == 1 stl = 1 + 0.25*sqr(imag(z)) elseif @stgl == 2 stl = 1 + exp(-sqr(imag(z))) elseif @stgl == 3 stl = 1 + 0.5*sin(imag(z)) elseif @stgl == 4 stl = 1 + 0.25*sqr(real(z)) elseif @stgl == 5 stl = 1 + exp(-sqr(real(z))) elseif @stgl == 6 stl = 1 + 0.5*sin(real(z)) endif ; hi if temp > auxc if @form_hi == 0 ; main (type I >crit) z = @fnh(z^@mh+(sth*@ph))*gh elseif @form_hi == 1 ; jocks z = @fnh(z^@mh*gh+(sth*@ph)) elseif @form_hi == 2 ; deviant z = @fnh(z^@mh+gh+(sth*@ph)) elseif @form_hi == 3 ; type III if @fnhIII == 0 z = @fnh(z^@mh+(sth*@ph))+gh*real(z) elseif @fnhIII == 1 z = @fnh(z^@mh+(sth*@ph))+gh*imag(z) elseif @fnhIII == 2 z = @fnh(z^@mh+(sth*@ph))+gh*|z| elseif @fnhIII == 3 z = @fnh(z^@mh+(sth*@ph)) endif elseif @form_hi == 4 ; formule vlg. alt z = @fnh(z^@mh+(sth*@ph))^gh endif if iter>@skiphi if @op_hi == 0 z = @fh(z) ; naturel elseif @op_hi == 1 ; + z = @fh(z+qh) elseif @op_hi == 2 ; * z = @fh(z*qh) elseif @op_hi == 3 ; ^ z = @fh(z^qh) endif endif ; lo else if @form_lo == 0 z = @fnl(z^@ml+(stl*@pl))*gl elseif @form_lo == 1 z = @fnl(z^@ml*gl+(stl*@pl)) elseif @form_lo == 2 z = @fnl(z^@ml+gl+(stl*@pl)) elseif @form_lo == 3 if @fnlIII == 0 z = @fnl(z^@ml+(stl*@pl))+gl*real(z) elseif @fnlIII == 1 z = @fnl(z^@ml+(stl*@pl))+gl*imag(z) elseif @fnlIII == 2 z = @fnl(z^@ml+(stl*@pl))+gl*|z| elseif @fnlIII == 3 z = @fnl(z^@ml+(stl*@pl)) endif elseif @form_lo == 4 z = @fnl(z^@ml+(stl*@pl))^gl endif if iter>@skiplo if @op_lo == 0 ; none z = @fl(z) elseif @op_lo == 1 ; + z = @fl(z+ql) elseif @op_lo == 2 ; * z = @fl(z*ql) elseif @op_lo == 3 ; ^ z = @fl(z^ql) endif endif endif ; alternates if (@mode>23 && @mode<36) if @mode == 27 || @mode == 30 || @mode == 33 temp = real(z) elseif @mode == 24 || @mode == 31 || @mode == 34 temp = imag(z) elseif @mode == 25 || @mode == 28 || @mode == 35 temp = atan2(z) elseif @mode == 26 || @mode == 29 || @mode == 32 temp = |z| auxc = sqr(@crit) endif if @famode == 1 temp = sqr(temp) elseif @famode == 2 temp = sqrt(temp) elseif @famode == 3 temp = log(temp) elseif @famode == 4 temp = exp(temp) elseif @famode == 5 temp = abs(temp) elseif @famode == 6 temp = recip(temp) elseif @famode == 7 temp = sin(temp) elseif @famode == 8 temp = asin(temp) elseif @famode == 9 temp = sinh(temp) elseif @famode == 10 temp = asinh(temp) elseif @famode == 11 temp = cos(temp) elseif @famode == 12 temp = acos(temp) elseif @famode == 13 temp = cosh(temp) elseif @famode == 14 temp = acos(temp) elseif @famode == 15 temp = acosh(temp) elseif @famode == 16 temp = tan(temp) elseif @famode == 17 temp = tanh(temp) elseif @famode == 18 temp = atanh(temp) elseif @famode == 19 temp = cotan(temp) elseif @famode == 20 temp = cotanh(temp) elseif @famode == 21 temp = round(temp) elseif @famode == 22 temp = trunc(temp) elseif @famode == 23 temp = ceil(temp) endif if @altplus == true if @stgh == 1 sth = 1 + 0.25*sqr(imag(z)) elseif @stgh == 2 sth = 1 + exp(-sqr(imag(z))) elseif @stgh == 3 sth = 1 + 0.5*sin(imag(z)) elseif @stgh == 4 sth = 1 + 0.25*sqr(real(z)) elseif @stgh == 5 sth = 1 + exp(-sqr(real(z))) elseif @stgh == 6 sth = 1 + 0.5*sin(real(z)) endif if @stgl == 1 stl = 1 + 0.25*sqr(imag(z)) elseif @stgl == 2 stl = 1 + exp(-sqr(imag(z))) elseif @stgl == 3 stl = 1 + 0.5*sin(imag(z)) elseif @stgl == 4 stl = 1 + 0.25*sqr(real(z)) elseif @stgl == 5 stl = 1 + exp(-sqr(real(z))) elseif @stgl == 6 stl = 1 + 0.5*sin(real(z)) endif endif ; hi if temp > auxc if @form_hi == 0 ; main z = @fnh(z^@mh+(sth*@ph))*gh elseif @form_hi == 1 ; jocks z = @fnh(z^@mh*gh+(sth*@ph)) elseif @form_hi == 2 ; deviant z = @fnh(z^@mh+gh+(sth*@ph)) elseif @form_hi == 3 ; type III if @fnhIII == 0 z = @fnh(z^@mh+(sth*@ph))+gh*real(z) elseif @fnhIII == 1 z = @fnh(z^@mh+(sth*@ph))+gh*imag(z) elseif @fnhIII == 2 z = @fnh(z^@mh+(sth*@ph))+gh*|z| elseif @fnhIII == 3 z = @fnh(z^@mh+(sth*@ph)) endif elseif @form_hi == 4 ; formule vlg. alt z = @fnh(z^@mh+(sth*@ph))^gh endif if iter>@skiphi if @op_hi == 0 z = @fh(z) ; naturel elseif @op_hi == 1 ; + z = @fh(z+qh) elseif @op_hi == 2 ; * z = @fh(z*qh) elseif @op_hi == 3 ; ^ z = @fh(z^qh) endif endif ; lo else if @form_lo == 0 z = @fnl(z^@ml+(stl*@pl))*gl elseif @form_lo == 1 z = @fnl(z^@ml*gl+(stl*@pl)) elseif @form_lo == 2 z = @fnl(z^@ml+gl+(stl*@pl)) elseif @form_lo == 3 if @fnlIII == 0 z = @fnl(z^@ml+(stl*@pl))+gl*real(z) elseif @fnlIII == 1 z = @fnl(z^@ml+(stl*@pl))+gl*imag(z) elseif @fnlIII == 2 z = @fnl(z^@ml+(stl*@pl))+gl*|z| elseif @fnlIII == 3 z = @fnl(z^@ml+(stl*@pl)) endif elseif @form_lo == 4 z = @fnl(z^@ml+(stl*@pl))^gl endif if iter>@skiplo if @op_lo == 0 z = @fl(z) ; naturel elseif @op_lo == 1 ; + z = @fl(z+ql) elseif @op_lo == 2 ; * z = @fl(z*ql) elseif @op_lo == 3 ; ^ z = @fl(z^ql) endif endif endif endif path = path + abs(|z|) phi = atan2(z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif diff = abs(|z|-|oldz|) oldz = z if @gf == 0 zz = z elseif @gf == 1 zz = exp(z) elseif @gf == 2 zz = sqrt(z) elseif @gf == 3 zz = sqr(z) elseif @gf == 4 zz = cosh(z) elseif @gf == 5 zz = cos(z) elseif @gf == 6 zz = sinh(z) elseif @gf == 7 zz = sin(z) endif if @test == 0 bailtest = |zz| elseif @test == 1 bailtest = sqr(real(zz)) elseif @test == 2 bailtest = sqr(imag(zz)) elseif @test == 5 bailtest = sqr(abs(real(zz)) + abs(imag(zz))) elseif @test == 6 bailtest = sqr(real(zz) + imag(zz)) elseif @test == 7 bailtest = |zz|+iter^2 elseif @test == 8 bailtest = |zz|+phi^2 elseif @test == 9 bailtest = |zz|+path^2 elseif @test == 10 bailtest = |zz|+diff^2 elseif @test == 11 bailtest = sqr(abs(real(zz))-abs(imag(zz))) elseif @test == 12 bailtest = sqr(abs(real(zz))*abs(imag(zz))) elseif @test == 13 bailtest = sqr(abs(real(zz))/abs(imag(zz))) elseif @test == 14 bailtest = sqr(abs(real(zz))^abs(imag(zz))) elseif @test == 15 bailtest = sqr(abs(imag(zz))^abs(real(zz))) endif if ((@test<3 || @test> 4) && (bailtest > @bailout)) || \ ((@test == 3 && (sqr(real(zz)) > @bailout) && (sqr(imag(zz)) > @bailout))) || \ ((@test == 4 && ((sqr(real(zz)) > @bailout) || (sqr(imag(zz)) > @bailout)))) keep_going = false endif bailout: keep_going==true default: title = "BarnsleyTechnoM (UF4)" method = multipass periodicity = 0 maxiter = 150 magn = 1 heading caption="general" endheading param mode caption = "mode" default = 24 enum = "real" "imaginary" "modulus" "argument" \ "sum 1" "sum 2" "sum 3" "sum 4" \ "product 1" "product 2" "product 3" "product 4" \ "quotient 1" "quotient 2" "quotient 3" "quotient 4""quotient 5" "quotient 6" \ "power 1" "power 2" "power 3" "power 4" "power 5" "power 6" \ "alternate 1" "alternate 2" "alternate 3" "alternate 4" "alternate 5" "alternate 6" \ "alternate 7" "alternate 8" "alternate 9" "alternate 10" "alternate 11" "alternate 12" \ "type II" endparam param fmode caption = "function mode" default = 0 enum = "ident" "sqr" "sqrt" "log" "exp" "abs" "recip" "sin" "asin" "sinh" "asinh" "cos" "acos" \ "cosh" "acosh" "tan" "atan" "tanh" "atanh" "cotan" "cotanh" "round" "trunc" "ceil" endparam param famode caption = "funct. mode alternating" default = 0 enum = "ident" "sqr" "sqrt" "log" "exp" "abs" "recip" "sin" "asin" "sinh" "asinh" "cos" "acos" \ "cosh" "acosh" "tan" "atan" "tanh" "atanh" "cotan" "cotanh" "round" "trunc" "ceil" visible = (@mode>23 && @mode<36) endparam bool param altplus caption = "alternating plus" default = false visible = ((@mode>23 && @mode<36) && \ (@stgh>0 || @stgl>0) || (@stgh>0 && @stgl>0)) endparam param k caption = "mode scaling" default = (1.0,0.0) visible = ((@mode>3 && @mode<8) || @mode==36) endparam float param kt caption = "mode scaling" default = 1.0 visible = (@mode<4 || (@mode>6 && @mode<36)) endparam float param crit caption = "critical value" default = 0.0 endparam param test caption = "bailout test" default = 0 enum = "mod" "real" "imag" "or" "and" "manh" "manr" "iter" "angle" \ "path" "diff" "minus" "product" "division" "real^imag" "imag^real" endparam param gf caption = "bailout function" default = 0 enum = "ident" "exp" "sqrt" "sqr" "cosh" "cos" "sinh" "sin" endparam param bailout caption = "bailout value" default = 1000 endparam param origin caption = "origin" default = (0.0,0.0) endparam ;------------------------------------------------- heading caption="branch hi" endheading param form_hi caption = "formula hi" default = 0 enum = "main" "jocks" "deviant" "type III" "alt" endparam param stgh caption = "Steiger variant" default = 0 enum = "none" "parabolic" "gaussian" "sine" "var p" "var g" "var s" endparam param fnhIII caption = "type III variant" default = 0 enum = "real" "imag" "mod" "c inactive" visible = (@form_hi == "type III") endparam func fnh caption = "prim. function hi" default = ident() endfunc param ph caption = "prim. parameter hi" default = (-1.1,-0.1) endparam bool param flight_hi caption = "flight hi" default = false visible = !(@mode == 36) endparam param dh caption = "flight parameter hi" default = (0.1,0) visible = @flight_hi == true endparam param op_hi caption = "operator hi" default = 0 enum = "none" "+" "*" "^" endparam bool param invert_hi caption = "invert hi" default = false visible = @op_hi>1 endparam int param skiphi caption = "skip" default = 0 endparam func fh caption = "sec. function hi" default = ident() endfunc param psech caption = "sec. parameter hi" default = (1,0) visible = @op_hi>0 endparam param mh caption = "power (hi)" default = (1,0) endparam ;---------------------------------------------------------- heading caption="branch lo" endheading param form_lo caption = "formula lo" default = 0 enum = "main" "jocks" "deviant" "type III" "alt" endparam param stgl caption = "Steiger variant" default = 0 enum = "none" "parabolic" "gaussian" "sine" "var p" "var g" "var s" endparam param fnlIII caption = "type III variant" default = 0 enum = "real" "imag" "mod" "c inactive" visible = (@form_lo == "type III") endparam func fnl caption = "prim. function lo" default = ident() endfunc param pl caption = "prim. parameter lo" default = (-3,1.5) endparam bool param flight_lo caption = "flight lo" default = false visible = !(@mode == 36) endparam param dl caption = "flight parameter lo" default = (0.1,0) visible = @flight_lo == true endparam param op_lo caption = "operator lo" default = 0 enum = "none" "+" "*" "^" endparam bool param invert_lo caption = "invert lo" default = false visible = @op_lo>1 endparam int param skiplo caption = "skip" default = 0 endparam func fl caption = "sec. function lo" default = ident() endfunc param psecl caption = "sec. parameter lo" default = (1,0) visible = @op_lo>0 endparam param ml caption = "power lo" default = (1,0) endparam switch: type = "BarnsleyTechnoJUF4" tseed = #pixel mode = mode fmode = fmode famode = famode altplus = altplus k = k kt = kt crit = crit test = test gf = gf bailout = bailout origin = origin form_hi = form_hi stgh = stgh fnhIII = fnhIII fnh = fnh ph = ph op_hi = op_hi invert_hi = invert_hi skiphi = skiphi fh = fh psech = psech mh = mh form_lo = form_lo stgl = stgl fnlIII = fnlIII fnl =fnl pl = pl op_lo = op_lo invert_lo = invert_lo skiplo = skiplo fl = fl psecl = psecl ml = ml flight_hi = flight_hi flight_lo = flight_lo } Ducky { ; Based on a private formula of Elias Rain ; A modification has been made init: z = #pixel loop: z = @qq*(sin(abs(@fns(@ps*z^@power)) + @fnp(@p1*(#pixel + @t)))) + @p2 bailout: |z| < @bailout default: title = "Rain's Ducky" param bailout, caption = "bailout", default = 1.0e20, endparam param p1, caption = "grow", default = (-0.826,0.0), endparam param p2, caption = "seed", default = (-0.28,-0.6), endparam param ps, caption = "factor", default = (1.0,0.0), endparam param power, caption = "power", default = 1.0, endparam float param qq, caption = "coëfficient", default = 1.0, endparam param t, caption = "pixel shift", default = (0.0,0.0), endparam func fnp, caption = "pixel function", default = ident(), endfunc func fns, caption = "ducky function", default = ident(), endfunc } Halley { ; Based on Halley's Root Finding ; C.A. Pickover: "Numerical Approximation Methods" ; in: "Computers, Pattern, Chaos and Beauty" (1990) init: complex z = #pixel, complex z0 = z, complex zold = (0,0) complex z2 = (0,0), complex z3 = (0,0), complex z4 = (0,0) complex z5 = (0,0), complex z6 = (0,0), complex z7 = (0,0) complex z8 = (0,0) complex t = (0,0), complex u = (0,0), complex v = (0,0) complex numerator = (0,0) complex denominator = (0,0) complex ratio = (0,0) float small = 1e-5 bool keep_going = true loop: zold = z if @options=="Lite" t = z^@m - 1 u = @m*z^(@m-1) ; 1st derivative v = @m*(@m-1)*z^(@m-2) ; 2nd derivative elseif @options=="Ten Term Polynomial" t = @p10*z^10 + @p09*z^9 + @p08*z^8 + @p07*z^7 + @p06*z^6 t = t+@p05*z^5 + @p04*z^4 + @p03*z^3 + @p02*z^2 + @p01*z u = 10*@p10*z^9 + 9*@p09*z^8 + 8*@p08*z^7 + 7*@p07*z^6 + 6*@p06*z^5 u = u+5*@p05*z^4 + 4*@p04*z^3 + 3*@p03*z^2 + 2*@p02*z + @p01 v = 90*@p10*z^8 + 72*@p09*z^7 + 56*@p08*z^6 + 42*@p07*z^5 + 30*@p06*z^4 v = v+20*@p05*z^3 + 12*@p04*z^2 + 6*@p03*z + 2*@p02 elseif @options=="Chebyshev" z2 = z*z, z3 = z2*z, z4 = z3*z, z5 = z4*z if @n>5, z6 = z5*z, endif if @n>6, z7 = z6*z, endif if @n>7, z8 = z7*z, endif if @n==5 if @type t = 32*z5-32*z3+6*z ; Chebyshev function 2st kind u = 160*z4-96*z2+6 v = 640*z3-192*z else t = 16*z5-20*z3+5*z ; Chebyshev function 1st kind u = 80*z4-60*z2+5 v = 320*z3-120*z endif elseif @n==6 if @type t = 64*z6-80*z4+24*z2-1 u = 384*z5-320*z3+48*z v = 1920*z4-960*z2+48 else t = 32*z6-48*z4+18*z*z-1 u = 192*z5-192*z3+36*zold v = 960*z4-576*z2+36 endif elseif @n==7 if @type t = 128*z7-192*z5+80*z3-8*z u = 896*z6-960*z4+240*z2-8 v = 5376*z5-3840*z3+480*z else t = 64*z7-112*z5+56*z3-7*z u = 448*z6-560*z4+168*z2-7 v = 2688*z5-2240*z3+336*z endif elseif @n==8 if @type t = 256*z8-448*z6+240*z4-40*z2+1 u = 2048*z7-2688*z5+960*z3-40*z v = 14336*z6-13440*z4+2880*z2-40 else t = 128*z8-256*z6+160*z4-32*z2+1 u = 1024*z7-1536*z5+640*z3-32*z v = 7468*z6-7680*z4+1920*z2-32 endif endif endif if @var, t = t+@p, endif ; translation ; Root finding: numerator = 2*t*u denominator = 2*u*u-t*v+small ratio = @rel*numerator/denominator if @joke z = z0-ratio else z = z-ratio endif if @bailout_type == "1" if |zold - z| <= @bailout keep_going = false endif elseif @bailout_type == "2" if |zold| - |z| <= @bailout keep_going = false endif elseif @bailout_type == "3" if abs(cabs(zold - z)) <= @bailout keep_going = false endif endif bailout: keep_going==true default: title = "Halley" center = (0,0) maxiter = 200 param options, caption="Options", default=0 enum = "Lite" "Ten Term Polynomial" "Chebyshev", endparam int param m, caption="m (min.=3)", default=6, min=3, visible=@options==0, endparam float param p01, caption="coëff. 1", default=0.0, visible=@options==1, endparam float param p02, caption="coëff. 2", default=-40.0, visible=@options==1, endparam float param p03, caption="coëff. 3", default=0, visible=@options==1, endparam float param p04, caption="coëff. 4", default=240, visible=@options==1, endparam float param p05, caption="coëff. 5", default=0, visible=@options==1, endparam float param p06, caption="coëff. 6", default=-448, visible=@options==1, endparam float param p07, caption="coëff. 7", default=0, visible=@options==1, endparam float param p08, caption="coëff. 8", default=256, visible=@options==1, endparam float param p09, caption="coëff. 9", default=0, visible=@options==1, endparam float param p10, caption="coëff. 10", default=0, visible=@options==1, endparam bool param type, caption="second kind", default=false, visible=@options==2, endparam int param n, caption="m (5-8)", default=6, min=5, max=8, visible=@options==2, endparam float param rel, caption="relaxatiefactor", default=0.75, endparam bool param var, caption="translation", default=false, endparam complex param p, caption="T translation", default=(0,1), visible=@var==true, endparam bool param joke, caption="joke", default=false, endparam param bailout_type, caption="Bailout type", default=0, enum = "1" "2" "3", endparam float param bailout, caption="Bailout value", default=1e-5, min=0.0, endparam } Ducky_Rev_M { ; ; Ed Algra Dec.14 2010 ; In coöperation with D.H. Van den Berghe, ; with thanks for his valuable suggestions. ; See for more Ducky variants his "DuckyTalis" in vdb.ufm ; and vdb's tutorial: "Talis in UF" ; http://browse.deviantart.com/?qh=§ion=&global=1&q=fourpillars#/d349fhs ; ; In the "non-lite" cases a pixel option is included for ; "historical" reasons. In a M-set both the c-term and ; the pixel term are related to c. ; ; The differences between the orginal "Rain's Ducky" and ; the one here is the addition of a possibility to create ; a Mandelbrot set and that to vary the main function. ; ; The difference between the "Rain's Ducky" option and ; variant "*" is rather slight. ; init: complex z = @start complex c = px = #pixel complex tmp1 = (0.0,0.0) complex tmp2 = (0.0,0.0) loop: if @mode==0 ; lite (D.V.d.B's stripped version) z = @fn1(abs(z)) + c elseif @mode==1 tmp1 = abs(@fns(@q*z^@power)) tmp2 = @fn2(@q2*(px+@t)) z = @q1*(@fn1(tmp1) + tmp2) + c elseif @mode==2 if @variant==0 z = abs(@fns(@q*z^@power)) else z = abs(@fns(@q+z^@power)) endif z = @q1*@fn1(z) + @q2*@fn2(px+@t) + c elseif @mode==3; Rain's Ducky tmp1 = abs(@fns(@q*z^@power)) tmp2 = @fn2(@q2*(px+@t)) z = @q1*(@fn1(tmp1+tmp2)) + c endif bailout: |z| < @bailout default: title = "Ducky Revisted M" center = (-0.3,-0.8) magn = 1.5 param mode, caption = "mode" , default = 0 enum = "Ducky Lite" "Ducky mode 1" "Ducky mode 2" "Rain's Ducky" hint = "Don't forget to use 'Inside'. A good start inside is 'Lyapunov' in dmj.ucl" endparam int param bailout, caption = "bailout", default = 100000, endparam complex param start, caption = "start", default = (0.0,0.0), endparam ; --------------------- heading, caption = "main term", visible = @mode>0, endheading param variant, caption = "variant", default = 0 enum = "*" "+", visible = @mode==2, endparam func fn1, caption = "main function", default = sin(), endfunc func fns, caption = "ducky function", default = ident(), visible = @mode>0, endfunc complex param q, caption = "ducky parameter", default = (1.0,0.0), visible = @mode>0, endparam complex param power, caption = "z exponent", default = (1.0,0.0), visible = @mode>0, endparam complex param q1, caption = "z factor", default = (1.0,0.0), visible = @mode>0, endparam ; -------------------- heading, caption = "pixel term", visible = @mode>0, endheading func fn2, caption = "pixel function", default = zero(), visible = @mode>0, endfunc complex param q2, caption = "pixel factor", default = (0.0,0.0), visible = @mode>0, endparam complex param t, caption = "pixel shift", default = (0.0,0.0), visible = @mode>0, endparam switch: type = "Ducky_Rev_J" seed = #pixel bailout = bailout mode = mode power = power variant = variant fns = fns, fn1 = fn1, fn2 = fn2 q = q, q1 = q1, q2 = q2 t = t } ==================================================================================================================================== Ducky_Rev_J { ; Ed Algra Dec.14 2010 ; In coöperation with D.H. Van den Berghe, ; with thanks for his valuable suggestions. ; See for more Ducky variants his "DuckyTalis" in vdb.ufm ; and vdb's tutorial: "Talis in UF" ; http://browse.deviantart.com/?qh=§ion=&global=1&q=fourpillars#/d349fhs ; ; In the "non-lite" cases a pixel option is included for ; "historical" reasons. In a J-set the c-term is constant, ; the pixel term differs from pixel to pixel. ; ; J-sets in option "Lite" always have a 4-fold symmetry, ; caused by the function "abs" which is a characteristic ; of "Ducky" fractals. ; ; In the orginal "Rain's Ducky" it was not possible to ; create a Mandelbrot set. ; init: complex z = px = #pixel complex c = @seed complex tmp1 = (0.0,0.0) complex tmp2 = (0.0,0.0) loop: if @mode==0 ; lite (D.V.d.B's stripped version) z = @fn1(abs(z)) + c elseif @mode==1 tmp1 = abs(@fns(@q*z^@power)) tmp2 = @fn2(@q2*(px+@t)) z = @q1*(@fn1(tmp1) + tmp2) + c elseif @mode==2 if @variant==0 z = abs(@fns(@q*z^@power)) else z = abs(@fns(@q+z^@power)) endif z = @q1*@fn1(z) + @q2*@fn2(px+@t) + c elseif @mode==3; Rain's Ducky tmp1 = abs(@fns(@q*z^@power)) tmp2 = @fn2(@q2*(px+@t)) z = @q1*(@fn1(tmp1+tmp2)) + c endif bailout: |z| < @bailout default: title = "Ducky Revisted J" center = (0.0,0.0) magn = 0.25 param mode, caption = "mode", default = 0 enum = "Ducky Lite" "Ducky mode 1" "Ducky mode 2" "Rain's Ducky" hint = "Don't forget to use 'Inside'. A good start inside is 'Lyapunov' in dmj.ucl" endparam int param bailout, caption = "bailout", default = 100000, endparam complex param seed, caption = "seed", default = (-0.28,-0.6), endparam ; --------------------- heading, caption = "main term", visible = @mode>0, endheading param variant, caption = "variant", default = 0 enum = "*" "+", visible = @mode==2, endparam func fn1, caption = "main function", default = sin(), endfunc func fns, caption = "ducky function", default = ident(), visible = @mode>0, endfunc complex param q, caption = "ducky parameter", default = (1.0,0.0), visible = @mode>0, endparam complex param power, caption = "z exponent", default = (1.0,0.0), visible = @mode>0, endparam complex param q1, caption = "z factor", default = (1.0,0.0), visible = @mode>0, endparam ; -------------------- heading, caption = "pixel term", visible = @mode>0, endheading func fn2, caption = "pixel function", default = zero(), visible = @mode>0, endfunc complex param q2, caption = "pixel factor", default = (0.0,0.0), visible = @mode>0, endparam complex param t, caption = "pixel shift", default = (0.0,0.0), visible = @mode>0, endparam switch: type = "Ducky_Rev_M" bailout = bailout mode = mode power = power variant = variant fns = fns, fn1 = fn1, fn2 = fn2 q = q, q1 = q1, q2 = q2 t = t } ==================================================================================================================================== Lucky_J (YAXIS){ ; version 1.01 ; Ed Algra 2013, Sept. 14 ; Thanks to Danny van den Berghe for the Duckytalis option, ; Edgar Malinovsky for his option, ; Mikael Hvidtfeldt Christensen, for the Syntopia variant ; and many others ; See for some elucidation: ; ea.txt on UF formula database: "Lucky, a Ducky special" global: float tol = 1e-15 float halfpi = 0.0 halfpi = 0.5*#pi zero = (0.0,0.0) int nE1 = @nE1, int nE2 = @nE2 int m = @m int nF1 = @nF1, int nF2 = @nF2 if m2 && ch<8) || ch==12 if mark==1, functie = @fnE1(z), endif if mark==2, functie = @fnF1(z), endif endif if ch==7 || ch==12 if mark==1, functie2 = @fnE2(z), endif if mark==2, functie2 = @fnF2(z), endif endif if ch==8 ; "fn(gn)" f(a*g(z-b)) if mark==1 nb = @fnE1(z-bb) na = @fnE2(aa*nb) elseif mark==2 nb = @fnF1(z-bb) na = @fnF2(aa*nb) endif endif if ch==9 ; "fn+gn" a*f(z) + b*g(z) if mark==1 na = fact*(aa*@fnE1(z)+bb*@fnE2(z)) elseif mark==2 na = fact*(aa*@fnF1(z)+bb*@fnF2(z)) endif na = .25*na endif if ch==10 ; "fn*gn" f(az)*g(bz) if mark==1 na = @fnE1(aa*z)*@fnE2(bb*z) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif elseif mark==2 na = fact*@fnF1(aa*z)*@fnF2(bb*z) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif endif na = .25*na endif if ch==11 ; "fn/gn" f(z-a)/g(z-b) if mark==1 na = @fnE1(z-aa)/@fnE2(z-bb) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif elseif mark==2 na = @fnF1(z-aa)/@fnF2(z-bb) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif endif na = 2.5*na endif if ch==12 && (opt_Frm==9 || opt_Frm==10 || opt_Frm==23) if mark==1, functie = @fnFrmE1(functie), functie2 = @fnFrmE2(functie2), endif if mark==2, functie = @fnFrmF1(functie), functie2 = @fnFrmF2(functie2), endif endif if ch==0 ; asinh result = fact*asinh(z) elseif ch==1 ; log result = fact*log(z) elseif ch==2 ; Talis result = fact*na elseif ch==3 ; general function result = fact*functie elseif ch==4 ; mix 1 result = 0.01*(mix*functie+(100-mix)*fact*asinh(z)) elseif ch==5 ; mix 2 result = 0.01*(mix*functie+(100-mix)*0.6*fact*log(z)) elseif ch==6 ; mix 3 result = 0.01*(mix*functie+(100-mix)*0.2*fact*(z^pw*na)) elseif ch==7 ; mix 4 result = 0.01*(mix*functie+(100*mix)*0.01*fact*functie2) elseif ch>7 && ch<12 result = na elseif ch==12 na = FormulaMix(functie,functie2,uFrm,vFrm,wFrm,opt_Frm,mixchangeFrm,mixvarFrm,mixvFrm,mvarFrm,iftFrm,premixFrm) result = fact*na endif return result endfunc complex func Option13(complex z,float mnx,float mny,int Manok,int keuzeR,int keuzeI,complex fact,int wahlx, \ float shiftx1,float shiftx2,int wahly,float shifty1,float shifty2,complex m5,int mark) complex na = zero float t = 0.0, float x = 0.0, float y = 0.0 x = real(z), y = imag(z) if (keuzeR==18 || keuzeR==19) while x<-1, x = x+2, endwhile while x>1, x = x-2, endwhile endif if keuzeR==20 while (x>-1 && x<0), x = x-1, endwhile while (x>=0 && x<1), x = x+1, endwhile endif if wahlx==1 while x<-1, x = x+shiftx1, endwhile while x>1, x = x-shiftx1, endwhile elseif wahlx==2 while (x>-1 && x<0), x = x-shiftx2, endwhile while (x>=0 && x<1), x = x+shiftx2, endwhile endif if (keuzeI==18 || keuzeI==19) while y<-1, y = y+2, endwhile while y>1, y = y-2, endwhile endif if keuzeI==20 while (y>-1 && y<0), y = y-1, endwhile while (y>=0 && y<1), y = y+1, endwhile endif if wahly==1 while y<-1, y = y+shifty1, endwhile while y>1, y = y-shifty1, endwhile elseif wahly==2 while (y>-1 && y<0), y = y-shifty2, endwhile while (y>=0 && y<1), y = y+shifty2, endwhile endif if Manok==0 ; original: (x/|z|) + flip(y/|z|) t = |z|, na = mnx*FltFunc(x,keuzeR)/t + flip(mny*FltFunc(y,keuzeI)/t) elseif Manok==1; z/(x*y) na = z/(FltFunc(x,keuzeR)*FltFunc(y,keuzeI)) elseif Manok==2; z/(x^y) na = z/(FltFunc(x,keuzeR)^FltFunc(y,keuzeI)) elseif Manok==3; z/(x/y) na = z*FltFunc(y,keuzeI)/FltFunc(x,keuzeR) elseif Manok==4; z = x^y na = FltFunc(x,keuzeR)^FltFunc(y,keuzeI) elseif Manok==5; z = x/y na = z+m5*FltFunc(x,keuzeR)/FltFunc(y,keuzeI) endif if mark==1 na = @fnmnE(na) elseif mark==2 na = @fnmnF(na) endif result = fact*na return result endfunc float func FltFunc(float uu, int keuze) float result = 0.0 if keuze==0, uu = ident(uu) elseif keuze==1, uu = sin(uu) elseif keuze==2, uu = sinh(uu) elseif keuze==3, uu = asinh(uu) elseif keuze==4, uu = cos(uu) elseif keuze==5, uu = cosh(uu) elseif keuze==6, uu = tan(uu) elseif keuze==7, uu = atan(uu) elseif keuze==8, uu = tanh(uu) elseif keuze==9, uu = atanh(uu) elseif keuze==10, uu = cotan(uu) elseif keuze==11, uu = cotanh(uu) elseif keuze==12, uu = sqr(uu) elseif keuze==13, uu = sqrt(uu) elseif keuze==14, uu = log(uu) elseif keuze==15, uu = exp(uu) elseif keuze==16, uu = recip(uu) elseif keuze==17, uu = (1-cos(uu)) elseif keuze==18, uu = asin(uu) elseif keuze==19, uu = acos(uu) elseif keuze==20, uu = acosh(uu) endif result = uu return result endfunc bool func ConditionE(int cE,int t,int nE1,int nE2) bool result = false if ((cE==0 && tnE1 && t=nE1) || \ (cE==4 && (tnE1)) || \ (cE==5 && (tnE2))) result = true endif return result endfunc bool func ConditionF(int cF,int t,int nF1,int nF2) bool result = false if ((cF==0 && t>=nF1) || \ (cF==1 && (tnF1)) || \ (cF==2 && (t<=nF1 || t>=nF2)) || \ (cF==3 && t=nF1 && t<=nF2)) result = true endif return result endfunc complex func CalculateBackToOne(complex z, bool b, bool v, complex v1) complex result = zero float fi = 0.0 fi = atan2(z) if fi>halfpi if b z = abs(z) else ; pi/2 backw. z = z*exp(-1i*halfpi) endif result = z else if v, result = z + v1, else, result = z, endif endif return result endfunc complex func FormulaMix(complex x,complex y,float u,float v,float w,int mengoptie,\ bool mixchange, bool mixvar, complex mixv, complex mvar, float ift, bool premix) complex result = zero if premix if mixchange x = mixv*(real(x) + flip(ift*imag(x))) if mixvar, x = mvar-x, endif else y = mixv*(real(y) + flip(ift*imag(y))) if mixvar, y = mvar-y, endif endif endif if mengoptie==0; spicy result = calculateMixOption0(x,y,u) elseif mengoptie==1; arithmetic mean result = calculateMixOption1(x,y) elseif mengoptie==2; geometric mean result = calculateMixOption2(x,y) elseif mengoptie==3; harmonic mean result = calculateMixOption3(x,y) elseif mengoptie==4; quadratic mean result = calculateMixOption4(x,y) elseif mengoptie==5; cubic mean result = calculateMixOption5(x,y) elseif mengoptie==6; generalized mean result = calculateMixOption6(x,y,u) elseif mengoptie==7; contraharmonic mean result = calculateMixOption7(x,y) elseif mengoptie==8; logarithmic mean result = calculateMixOption8(x,y) elseif mengoptie==9; arithmetric function mean result = calculateMixOption9(x,y) elseif mengoptie==10; geometric function mean result = calculateMixOption10(x,y) elseif mengoptie==11; general power mean result = calculateMixOption11(x,y,u) elseif mengoptie==12; Lehmer mean result = calculateMixOption12(x,y,v) elseif mengoptie==13; Heronian mean result = calculateMixOption13(x,y) elseif mengoptie==14; geometric harmonic 1 result = calculateMixOption14(x,y) elseif mengoptie==15; geometric harmonic 2 result = calculateMixOption15(x,y) elseif mengoptie==16; Heinz mean result = calculateMixOption16(x,y,u) elseif mengoptie==17; power mean result = calculateMixOption17(x,y,u) elseif mengoptie==18; linear variant result = calculateMixOption18(x,y,u,v) elseif mengoptie==19; geometric variant result = calculateMixOption19(x,y,v,w) elseif mengoptie==20; harmonic variant result = calculateMixOption20(x,y,u) elseif mengoptie==21; contraharmonic variant result = calculateMixOption21(x,y,u) elseif mengoptie==22; logarithmic variant result = calculateMixOption22(x,y,u) elseif mengoptie==23; function variant result = calculateMixOption23(x,y,u) elseif mengoptie==24; power variant result = calculateMixOption24(x,y,u,v) elseif mengoptie==25; generalized variant result = calculateMixOption25(x,y,u,v) elseif mengoptie==26; Lehmer variant result = calculateMixOption26(x,y,u,v) elseif mengoptie==27; product result = calculateMixOption27(x,y,u,v,w) endif return result endfunc complex func calculateMixOption0(complex x,complex y,float u); spicy return x + 0.0001*u*y endfunc complex func calculateMixOption1(complex x,complex y); arithmetic mean return 0.5*(x+y) endfunc complex func calculateMixOption2(complex x,complex y); geometric mean return sqrt(x*y) endfunc complex func calculateMixOption3(complex x,complex y); harmonic mean return 2*recip(recip(x)+recip(y)) endfunc complex func calculateMixOption4(complex x,complex y); quadratic mean return sqrt((x*x+y*y)/2) endfunc complex func calculateMixOption5(complex x,complex y); cubic mean return ((x*x*x+y*y*y)/2)^(1/3) endfunc complex func calculateMixOption6(complex x,complex y, float u); generalized mean return ((x^(0.01*u)+y^(0.01*u))/2)^(100/u) endfunc complex func calculateMixOption7(complex x,complex y); contraharmonic mean return (x*x+y*y)/(x+y) endfunc complex func calculateMixOption8(complex x,complex y); logarithmic mean return (x-y)/(log(x)-log(y)) endfunc complex func calculateMixOption9(complex x,complex y); arithmetric function mean return 0.5*(x+y) endfunc complex func calculateMixOption10(complex x,complex y); geometric function mean return sqrt(x*y) endfunc complex func calculateMixOption11(complex x,complex y, float u); general power mean return (0.5*(x^(0.01*u) + y^(0.01*u)))^(100/u) endfunc complex func calculateMixOption12(complex x,complex y, float u); Lehmer mean complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = x^(0.01*u) + y^(0.01*u) x2 = y^((0.01*u)-1) + y^((0.01*u)-1) return x1/x2 endfunc complex func calculateMixOption13(complex x,complex y); Heronian mean return (x+y+sqrt(x*y))/3 endfunc complex func calculateMixOption14(complex x,complex y); geometric harmonic 1 complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = sqrt(x*y) x2 = 2*recip(recip(x)+recip(y)) return sqrt(x1*x2) endfunc complex func calculateMixOption15(complex x,complex y); geometric harmonic 2 complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = sqrt(x*y) x2 = 2*recip(recip(x)+recip(y)) return 2/(recip(x1) + recip(x2)) endfunc complex func calculateMixOption16(complex x,complex y,float u); Heinz mean complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = (x^(0.01*u))*(y^(0.01*(100-u))) x2 = (x^(0.01*(100-u)))*(y^(0.01*u)) return 0.5*(x1+x2) endfunc complex func calculateMixOption17(complex x,complex y,float u); power mean return 0.5*((x^(0.01*u) + y^(0.01*u))^(100/u)) endfunc complex func calculateMixOption18(complex x,complex y,float u, float v); linear variant return 0.01*v*(u*x+(100-u)*y) endfunc complex func calculateMixOption19(complex x,complex y,float v, float w); geometric variant return sqrt(x^(0.01*v) * y^(0.01*w)) endfunc complex func calculateMixOption20(complex x,complex y,float u); harmonic variant return 0.04*(recip(recip(u*x) + recip((100-u)*y))) endfunc complex func calculateMixOption21(complex x,complex y,float u); contraharmonic variant complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = 0.02*((u*x)^2 + ((100-u)*y)^2) x2 = u*x + (100-u)*y return x1/x2 endfunc complex func calculateMixOption22(complex x,complex y,float u); logarithmic variant complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = 0.02*(u*x-(100-u)*y) x2 = log(0.02*u*x)-log(0.02*(100-u)*y) return x1/x2 endfunc complex func calculateMixOption23(complex x,complex y, float u); function variant return 0.01*(u*x+(100-u)*y) endfunc complex func calculateMixOption24(complex x,complex y,float u,float v); power variant complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = (0.02*u*x)^(0.01*v) x2 = (0.02*(100-u)*y)^(0.01*v) return (0.5*(x1+x2))^(100/v) endfunc complex func calculateMixOption25(complex x,complex y,float u,float v); generalized variant complex x1 = (0.0,0.0), complex x2 = (0.0,0.0) x1 = u*x^(0.01*v) x2 = (100-u)*y^(0.01*v) return (0.01*(x1+x2))^(100/v) endfunc complex func calculateMixOption26(complex x,complex y,float u,float v); Lehmer variant complex x1 = (0.0,0.0), complex x2 = (0.0,0.0), complex x3 = (0.0,0.0), complex x4 = (0.0,0.0) x1 = (0.02*u*x)^(0.01*v) x2 = (0.02*(100-u)*y)^(0.01*v) x3 = (0.02*u*x)^(0.01*v-1) x4 = (0.02*(100-u)*y)^(0.01*v-1) return (x1+x2)/(x3+x4) endfunc complex func calculateMixOption27(complex x,complex y,float u,float v,float w); product return u * x^(0.01*v) * y^(0.01*w) endfunc bool func ColorIterSelection(int p,int i,int t,int l,int u) bool result = false if p==0 result = true elseif p==1 if i<=t, result=true, endif elseif p==2 if i>t, result=true, endif elseif p==3 if i==t, result=true, endif elseif p==3 if (i>l && iu), result=true, endif elseif p==5 if (i==l || i==u), result=true, endif endif return result endfunc complex func PreColoring(complex z,int trans, complex s,bool jk,bool jp,complex t,\ complex u,complex v,float r,float w,\ float kwartm,float ga,float gb,float n1,\ float n2,float n3,float rp,bool hyp,bool roos,\ complex ma,complex mb,complex mc,complex md) complex result = (0.0,0.0) if trans==1; sin-sin | cos-sin result = ColorTransformation1(z,s,jk,t,u) elseif trans==2; sin+sin | cos+sin result = ColorTransformation2(z,s,jk,t,u) elseif trans==3; sin*sin | cos+sin result = ColorTransformation3(z,s,jk,t,u) elseif trans==4; cos-sin | cos-sin result = ColorTransformation4(z,s,jk,t,u) elseif trans==5; cos+sin | cos+sin result = ColorTransformation5(z,s,jk,t,u) elseif trans==6; atan result = ColorTransformation6(z,s,jk,jp,t,u,r) elseif trans==7; atan1 result = ColorTransformation7(z,s,jk,jp,t,u,r) elseif trans==8; sine&recip result = ColorTransformation8(z,s,jk,jp,t,u,r) elseif trans==9; sine stalks result = ColorTransformation9(z,s,jk,jp,t,u,r) elseif trans==10; log stalks result = ColorTransformation10(z,s,jk,jp,t,u,r) elseif trans==11; sine vibration1 result = ColorTransformation11(z,s,v,jk) elseif trans==12; sine vibration2 result = ColorTransformation12(z,s,v,jk,r) elseif trans==13; sine vibration3 result = ColorTransformation13(z,s,v,r) elseif trans==14; cosine vibration1 result = ColorTransformation14(z,s,jk,t,u) elseif trans==15; cosine vibration2 result = ColorTransformation15(z,s,jk,t,r,w) elseif trans==16; cosine vibration3 result = ColorTransformation16(z,s,t,r,w) elseif trans==17; tangens vibration result = ColorTransformation17(z,s,jk,t,u,r,w) elseif trans==18; sin+cos result = ColorTransformation18(z,s,jk,t,u,r,w) elseif trans==19; sin*cos result = ColorTransformation19(z,s,jk,v,r,w) elseif trans==20; tg/(sin&cos)1 result = ColorTransformation20(z,s,jk,t,u,r,w) elseif trans==21; tg/(sin&cos)2 result = ColorTransformation21(z,s,jk,jp,t,u,r,w) elseif trans==22; gielis result = ColorTransformation22(z,kwartm,ga,gb,n1,n2,n3,rp,hyp,roos) elseif trans==23; möbius result = ColorTransformation23(z,ma,mb,mc,md) endif return result endfunc ; 1 sin-sin | cos-sin complex func ColorTransformation1(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*sin(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(x))) else x = tol+real(t)*sin(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 2 sin+sin | cos+sin complex func ColorTransformation2(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*sin(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y+(tol+imag(u)*sin(x))) else x = tol+real(t)*sin(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y+(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 3 sin*sin | cos*sin complex func ColorTransformation3(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*sin(imag(t)*x*(tol+sin(y))) y = tol+real(u)*cos(y*(tol+imag(u)*sin(x))) else x = tol+real(t)*sin(imag(t)*x*(tol+sin(y))) y = tol+real(u)*cos(y*(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 4 cos-sin | cos-sin complex func ColorTransformation4(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*cos(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(x))) else x = tol+real(t)*cos(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 5 cos+sin | cos+sin complex func ColorTransformation5(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*cos(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(x))) else x = tol+real(t)*cos(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 6 atan complex func ColorTransformation6(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = atan(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan(((real(u)+imag(u)*y)^r)*(x^(-r))) else x = atan(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan(((imag(t)+imag(u)*y)^r)*(temp^(-r))) endif else if jk x = atan(real(t)+imag(t)*x/y) y = atan(imag(t)+imag(u)*y/x) else x = atan(real(t)+imag(t)*x/y) y = atan(imag(t)+imag(u)*y/temp) endif endif return x + flip(y) endfunc ; 7 atan1 complex func ColorTransformation7(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = atan2(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan2(((real(u)+imag(u)*y)^r)*(x^(-r))) else x = atan2(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan2(((real(u)+imag(u)*y)^r)*(temp^(-r))) endif else if jk x = atan2(real(t)+imag(t)*x/y) y = atan2(real(u)+imag(u)*y/x) else x = atan2(real(t)+imag(t)*x/y) y = atan2(real(u)+imag(u)*y/temp) endif endif return x + flip(y) endfunc ; 8 sin & recip complex func ColorTransformation8(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = ((real(t)*x)^r)*((tol+abs(sin(imag(t)*x*x+y*y)))^(-r)) y = ((real(u)*y)^r)*((tol+abs(sin(imag(u)*x*x+y*y)))^(-r)) else x = ((real(t)*x)^r)*((tol+abs(sin(imag(t)*x*x+y*y)))^(-r)) y = ((real(u)*y)^r)*((tol+abs(sin(imag(u)*temp*temp+y*y)))^(-r)) endif else if jk x = real(t)*x/(tol+abs(sin(imag(t)*x*x+y*y))) y = real(u)*y/(tol+abs(sin(imag(u)*x*x+y*y))) else x = real(t)*x/(tol+abs(sin(imag(t)*x*x+y*y))) y = real(u)*y/(tol+abs(sin(imag(u)*temp*temp+y*y))) endif endif return x + flip(y) endfunc ; 9 sine stalks complex func ColorTransformation9(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = ((sin(x))^r)*((tol+sqrt(real(t)*x*x+imag(t)*y*y))^(-r)) y = ((sin(y))^r)*((tol+sqrt(real(u)*x*x+imag(u)*y*y))^(-r)) else x = ((sin(x))^r)*((tol+sqrt(real(t)*x*x+imag(t)*y*y))^(-r)) y = ((sin(y))^r)*((tol+sqrt(real(u)*temp*temp+imag(u)*y*y))^(-r)) endif else if jk x = sin(x)/(tol+sqrt(real(t)*x*x+imag(t)*y*y)) y = sin(y)/(tol+sqrt(real(u)*x*x+imag(u)*y*y)) else x = sin(x)/(tol+sqrt(real(t)*x*x+imag(t)*y*y)) y = sin(y)/(tol+sqrt(real(u)*temp*temp+imag(u)*y*y)) endif endif return x + flip(y) endfunc ; 10 log stalks complex func ColorTransformation10(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = ((real(t)*log(abs(x+tol)))^r)*(log(abs(imag(t)*x*x+y+y-tol)))^(-r) y = ((real(u)*log(abs(y+tol)))^r)*(log(abs(imag(u)*x*x+y+y-tol)))^(-r) else x = ((real(t)*log(abs(x+tol)))^r)*(log(abs(imag(t)*x*x+y+y-tol)))^(-r) y = ((real(u)*log(abs(y+tol)))^r)*(log(abs(imag(u)*temp*temp+y+y-tol)))^(-r) endif else if jk x = real(t)*log(abs(x+tol))/(log(abs(imag(t)*x*x+y+y-tol))) y = real(u)*log(abs(y+tol))/(log(abs(imag(u)*x*x+y+y-tol))) else x = real(t)*log(abs(x+tol))/(log(abs(imag(t)*x*x+y+y-tol))) y = real(u)*log(abs(y+tol))/(log(abs(imag(u)*temp*temp+y+y-tol))) endif endif return x + flip(y) endfunc ; 11 sine vibration 1 complex func ColorTransformation11(complex z, complex s, complex v, bool jk) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = real(v)*sin(y) y = imag(v)*sin(x) else x = real(v)*sin(y) y = imag(v)*sin(temp) endif return x + flip(y) endfunc ; 12 sine vibration 2 complex func ColorTransformation12(complex z, complex s, complex v, bool jk, float r) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(v)*(sqr(sin(x)))^r y = imag(v)*(sqr(sin(y)))^r else x = real(v)*sqr(sin(x)) y = imag(v)*sqr(sin(y)) endif return x + flip(y) endfunc ; 13 sine vibration 3 complex func ColorTransformation13(complex z, complex s, complex v, float r) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) x = real(v)*(sin(x))^r y = imag(v)*(sin(y))^r return x + flip(y) endfunc ; 14 cosine vibration 1 complex func ColorTransformation14(complex z, complex s, bool jk, \ complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = real(t)*cos(imag(t)-(y)) y = real(u)*cos(imag(u)-(x)) else x = real(t)*cos(imag(t)-(y)) y = real(u)*cos(imag(u)-(temp)) endif return x + flip(y) endfunc ; 15 cosine vibration 2 complex func ColorTransformation15(complex z, complex s, bool jk, \ complex t, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(t)*(sqr(w-cos(x)))^r y = imag(t)*(sqr(w-cos(y)))^r else x = real(t)*sqr(w-cos(x)) y = imag(t)*sqr(w-cos(y)) endif return x + flip(y) endfunc ; 16 cosine vibration 3 complex func ColorTransformation16(complex z, complex s, complex t, \ float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) x = real(t)*(w-cos(x))^r y = imag(t)*(w-cos(y))^r return x + flip(y) endfunc ; 17 tangens vibration complex func ColorTransformation17(complex z, complex s, bool jk, \ complex t, complex u, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = ((real(t)*sin(x))^r)*((abs(imag(t)*cos(w-x+tol)))^(-r)) y = ((real(u)*sin(y))^r)*((abs(imag(u)*cos(w-y+tol)))^(-r)) else x = real(t)*sin(x)/abs(imag(t)*cos(1-x+tol)) y = real(u)*sin(y)/abs(imag(u)*cos(1-y+tol)) endif return x + flip(y) endfunc ; 18 sin+cos complex func ColorTransformation18(complex z, complex s, bool jk, complex t, \ complex u, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(t)*sin(r-x)+imag(t)*cos(w+x) y = real(u)*sin(r-y)+imag(u)*cos(w+y) else x = real(t)*sin(x)+imag(t)*cos(x) y = real(u)*sin(y)+imag(u)*cos(y) endif return x + flip(y) endfunc ; 19 sin*cos complex func ColorTransformation19(complex z, complex s, bool jk, complex v, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(v)*sin(r-x)*cos(w+x) y = imag(v)*sin(r-y)*cos(w+y) else x = real(v)*sin(x)*cos(x) y = imag(v)*sin(y)*cos(y) endif return x + flip(y) endfunc ; 20 tg/(sin&cos)1 complex func ColorTransformation20(complex z, complex s, bool jk, complex t, \ complex u, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = (tan(x))^r*((real(t)*sin(x)+imag(t)*cos(x)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(y)+imag(u)*cos(y)+tol)^(-r)) else x = (tan(x))^r*((real(t)*sin(x)+imag(t)*cos(w-x)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(y)+imag(u)*cos(w-y)+tol)^(-r)) endif return x + flip(y) endfunc ; 21 tg/(sin&cos)2 complex func ColorTransformation21(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r, float w) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(x)+imag(u)*cos(x)+tol)^(-r)) else x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(temp)+imag(u)*cos(temp)+tol)^(-r)) endif else if jk x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(w-y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(x)+imag(u)*cos(w-x)+tol)^(-r)) else x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(w-y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(temp)+imag(u)*cos(w-temp)+tol)^(-r)) endif endif return x + flip(y) endfunc ; 22 gielis complex func ColorTransformation22(complex z, float kwartm, float ga, float gb, float n1, \ float n2, float n3, float rp, bool hyp, bool roos) float fi = 0.0, float costerm = 0.0, float sinterm = 0.0, float gr = 0.0 fi = atan2(z) costerm = (abs(cos(kwartm*fi/ga)))^n2 sinterm = (abs(sin(kwartm*fi/gb)))^n3 if hyp gr = (cabs(z)*(costerm - sinterm))^(-1/n1) else gr = (cabs(z)*(costerm + sinterm))^(-1/n1) endif if roos, gr = gr * sin(rp*fi), endif x = gr*cos(fi), y = gr*sin(fi) return x + flip(y) endfunc ; 23 möbius complex func ColorTransformation23(complex z, complex ma, complex mb, complex mc, complex md) return (ma*z+mb)/(mc*z+md) endfunc loop: counter = counter+1 iter = iter + 1 if @mode==3, zq = z, endif ; I if @mode<2 || @mode==3 z = abs(z) mark = 1 if @altE if @choiceE<13 z = Fractal(z,@choiceE,@fE,@pwE,@mixE,@fctE,@aaE,@bbE,@subtalE,@subkmE,@uFrmE,@vFrmE,\ @wFrmE,@opt_FrmE,@mixchangeFrmE,@mixvarFrmE,@mixvFrmE,@mvarFrmE,@iftFrmE,\ @premixFrmE,mark) endif if @version>100 && @choiceE==13 z = Option13(z,@mnxE,@mnyE,@ManokE,@keuzeRE,@keuzeIE,@fctE,@wahlxE,@shiftx1E,\ @shiftx2E,@wahlyE,@shifty1E,@shifty2E,@m5E,mark) endif if @juliaE, z = z*c, else, z = z+c, endif endif if ConditionE(condE,counter,nE1,nE2) if @altE==false, if @choiceE<13 z = Fractal(z,@choiceE,@fE,@pwE,@mixE,@fctE,@aaE,@bbE,@subtalE,@subkmE,@uFrmE,@vFrmE,\ @wFrmE,@opt_FrmE,@mixchangeFrmE,@mixvarFrmE,@mixvFrmE,@mvarFrmE,@iftFrmE,\ @premixFrmE,mark) endif if @version>100 && @choiceE==13 z = Option13(z,@mnxE,@mnyE,@ManokE,@keuzeRE,@keuzeIE,@fctE,@wahlxE,@shiftx1E,\ @shiftx2E,@wahlyE,@shifty1E,@shifty2E,@m5E,mark) endif endif z = CalculateBackToOne(z,@btoE,@vectE,@vector_E1) else if @vectE, z = z + @vector_E2, endif endif if @altE==false if @juliaE, z = z*c, else, z = z+c, endif endif endif ; I ; II if @mode==3, zp = z, z = zq, endif if @mode==0 || @mode>1 z = abs(z) mark = 2 if @altF if @choiceE<13 z = Fractal(z,@choiceF,@fF,@pwF,@mixF,@fctF,@aaF,@bbF,@subtalF,@subkmF,@uFrmF,@vFrmF,\ @wFrmF,@opt_FrmF,@mixchangeFrmF,@mixvarFrmF,@mixvFrmF,@mvarFrmF,@iftFrmF,\ @premixFrmF,mark) endif if @version>100 && @choiceF==13 z = Option13(z,@mnxF,@mnyF,@ManokF,@keuzeRF,@keuzeIF,@fctF,@wahlxF,@shiftx1F,@shiftx2F,\ @wahlyF,@shifty1F,@shifty2F,@m5F,mark) endif if @juliaF, z = z*c, else, z = z+c, endif endif if ConditionF(condF,counter,nF1,nF2) if @altF==false if @choiceF<13 z = Fractal(z,@choiceF,@fF,@pwF,@mixF,@fctF,@aaF,@bbF,@subtalF,@subkmF,@uFrmF,@vFrmF,\ @wFrmF,@opt_FrmF,@mixchangeFrmF,@mixvarFrmF,@mixvFrmF,@mvarFrmF,@iftFrmF,\ @premixFrmF,mark) endif if @version>100 && @choiceF==13 z = Option13(z,@mnxF,@mnyF,@ManokF,@keuzeRF,@keuzeIF,@fctF,@wahlxF,@shiftx1F,@shiftx2F,\ @wahlyF,@shifty1F,@shifty2F,@m5F,mark) endif endif z = CalculateBackToOne(z,@btoF,@vectF,@vector_F1) else if @vectF, z = z + @vector_F2, endif endif if @altF==false if @juliaF, z = z*c, else, z = z+c, endif endif endif if @mode==3 zq = z if (@opt_par==9 || @opt_par==10 || @opt_par==23) zp = @fnparmixvar1(zp) zq = @fnparmixvar2(zq) endif z = FormulaMix(zp,zq,@upar,@vpar,@wpar,@opt_par,@mixchangepar,@mixvarpar,\ @mixvpar,@mvarpar,@iftpar,@premixpar) endif if @var && counter==m counter=0 endif if @ct colorfree1 = ColorIterSelection(@precoloption1,iter,@transit1,@transit1_LO,@transit1_HI) if @trans1>0 && colorfree1==true zres = z ; reserv for 2nd precoloring parallel z = PreColoring(z,@trans1,@colshift1,@joker1,@jp1,@cf11,@cf12,@cg1,@pwc1,@pwd1,\ gsfmm1,@gsfa1,@gsfb1,@gsfn11,@gsfn12,@gsfn13,@gsfrf1,@gsfh1,@rose1,\ @moeba1,@moebb1,@moebc1,@moebd1) endif endif if @colser==false, zparres = z, endif if (@ct && @ct2) colorfree2 = ColorIterSelection(@precoloption2,iter,@transit2,@transit2_LO,@transit2_HI) if @trans2>0 && colorfree2==true if @colser==false zparres = z; reserving the first transformed z if @opt_col>0, z = zres, endif endif z = PreColoring(z,@trans2,@colshift2,@joker2,@jp2,@cf21,@cf22,@cg2,@pwc2,@pwd2,\ gsfmm2,@gsfa2,@gsfb2,@gsfn21,@gsfn22,@gsfn23,@gsfrf2,@gsfh2,@rose2,\ @moeba2,@moebb2,@moebc2,@moebd2) endif endif if @ct==true && @ct2==true && @trans2>0 && @colser==false if (@opt_col==9 || @opt_col==10 || @opt_col==23) z = @fncolopt1(z) zparres = @fncolopt2(zparres) endif z = FormulaMix(z,zparres,@ucol,@vcol,@wcol,@opt_col,@mixchangeCol,@mixvarCol,@mixvCol,@mvarCol,@iftCol,@premixCol) endif ; gielis color transformation if @gt, z = ColorTransformation22(z,gsfmm,@gsfa,@gsfb,@gsfn1,@gsfn2,@gsfn3,@gsfrf,@gsfh,@rose), endif ; moebius color transformation if @moebtr, z = ColorTransformation23(z,@moeba,@moebb,@moebc,@moebd), endif bailout: |z| < @bailout default: title = "Lucky J" param Version, caption = "Formula Version", default = 101, visible = false, endparam center = (0.0,0.0) magn = 0.25 int param bailout, caption = "bailout", default = 100000, endparam complex param seed, caption = "seed", default = (-0.3,-0.8), endparam bool param var, caption = "variant", default = false, endparam bool param dev, caption = "first-second separated", default = false visible = @mode==0 || @mode==3, endparam param mode, caption = "mode", default = 0, enum = "series" "only first code active" "only second code active" "parallel" endparam ;------------------------------------ ; first code heading, caption = "first code", visible = (@mode<2 || @mode==3), endheading param choiceE, caption = "choice", default = 0 enum = "asinh" "log" "Talis" "general function" "mix asinh&fn" "mix log&fn" \ "mix Talis&fn" "mix fn&gn" "fn(gn)" "fn+gn" "fn*gn" "fn/gn" "fn&gn extended" \ "Malinovsky" visible = (@mode<2 || @mode==3), endparam param subtalE, caption = "Talis option" default = 0 enum = "Talis original" "variant 1" "variant 2" "variant 3" "Ducktalis" visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) endparam param condE, caption = "main condition", default = 0 enum = "below" "equal" "between" "above or equal" "not equal" "outside" visible = (@mode<2 || @mode==3), endparam int param nE1, caption = "primary #lo", default = 2 visible = (@mode<2 || @mode==3), endparam int param nE2, caption = "primary #hi", default = 3 visible = (@mode<2 || @mode==3) && (@condE==2 || @condE==5), endparam heading, caption = "Talis" visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6), endheading func fnaE, caption = "Talis function", default = ident() visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) && @subtalE>2 endfunc func fnbE, caption = "variation function", default = ident() visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) && @subtalE==4 endfunc complex param pwE, caption = "Talis parameter", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) endparam float param fE, caption = "variation parameter", default = 1.0 visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) endparam heading, visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6), endheading func fnE1, caption = "main function", default = asinh(), visible = (@mode<2 || @mode==3) && (@choiceE>2 && @choiceE<13), endfunc func fnE2, caption = "second function", default = ident() visible = (@mode<2 || @mode==3) && (@choiceE>6 && @choiceE<13), endfunc complex param fctE, caption = "factor", default = (1.0,0.0) visible = (@mode<2 || @mode==3), endparam int param mixE, caption = "% mixing", default = 50 visible = (@mode<2 || @mode==3) && (@choiceE>3 && @choiceE<8), endparam complex param aaE, caption = "a", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && (@choiceE>7 && @choiceE<12), endparam complex param bbE, caption = "b", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && (@choiceE>7 && @choiceE<12), endparam param ManokE, caption = "Malinovsky option" enum = "original" "syntopia variant" "variant 2" "variant 3" \ "variant 4" "variant 5" visible = (@mode<2 || @mode==3) && @choiceE==13, endparam complex param m5E, caption = "variant 5 scaling", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && @choiceE==13 && @ManokE==5, endparam float param mnxE, caption = "scaling real", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @ManokE<2 endparam float param mnyE, caption = "scaling imag", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @ManokE<2 endparam func fnmnE, caption = "Manok function", default = ident() visible = (@mode<2 || @mode==3) && @choiceE==13, endfunc param keuzeRE, caption = "Manok sub funct.x" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13, endparam param keuzeIE, caption = "Manok sub funct.y" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13, endparam param wahlxE, caption = "x-shift option" enum = "0" "1" "2", default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @keuzeIE<18, endparam float param shiftx1E, caption = "x-shift", default = 2.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlxE==1, endparam float param shiftx2E, caption = "x-shift", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlxE==2, endparam param wahlyE, caption = "y-shift option" enum = "0" "1" "2", default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @keuzeIE<18, endparam float param shifty1E, caption = "y-shift", default = 2.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlyE==1, endparam float param shifty2E, caption = "y-shift", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlyE==2, endparam param subkmE, caption = "variant", default = 0, enum = "0" "1" "2" visible = (@mode<2 || @mode==3) && (@choiceE==10 || @choiceE==11), endparam bool param btoE, caption = "rotate back", default = false visible = (@mode<2 || @mode==3), endparam bool param altE, caption = "alternative" visible = (@mode<2 || @mode==3), endparam bool param juliaE, caption = "c plus or times?", default = false visible = (@mode<2 || @mode==3), endparam bool param vectE, caption = "vectors?", default = false visible = @version==100 && (@mode<2 || @mode==3), endparam complex param vector_E1, caption = "upper vector 1", default = (0.0,0.0) visible = @vectE==true && (@mode<2 || @mode==3), endparam complex param vector_E2, caption = "upper vector 2", default = (0.0,0.0) visible = (@mode<2 || @mode==3) && @vectE==true, endparam param opt_FrmE, caption = "function combination" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "arithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = (@mode<2 || @mode==3) && @choiceE==12 endparam bool param premixFrmE, caption = "preps before func. mixing" default = false visible = (@mode<2 || @mode==3) && @choiceE==12 endparam bool param mixchangeFrmE,caption = "the other func.branch? (toggle)" default = false visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam complex param mixvFrmE, caption = "total func.scaling" default = (1.0,0.0) visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam float param iftFrmE, caption = "func.imag scaling" default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam bool param mixvarFrmE, caption = "func.mix variant" default = false visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam complex param mvarFrmE, caption = "func. const.'1'", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true && @mixvarFrmE==true endparam func fnFrmE1, caption = "fn.1 function" default = ident() visible = (@mode<2 || @mode==3) && (@opt_FrmE==9 || @opt_FrmE==10 || @opt_FrmE==23) endfunc func fnFrmE2, caption = "fn.2 function" default = ident() visible = (@mode<2 || @mode==3) && (@opt_FrmE==9 || @opt_FrmE==10 || @opt_FrmE==23) endfunc float param uFrmE, caption = "func.comb.1 (%)" default = 50.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && (@opt_FrmE==0 || @opt_FrmE==6 || \ (@opt_col>15 && @opt_col<19) || @opt_col>19) endparam float param vFrmE, caption = "func.comb.2" default = 200.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && (@opt_FrmE==11 || @opt_FrmE==12 || \ @opt_col==19 || @opt_col>23) endparam float param wFrmE, caption = "func.comb.3" default = 200.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && (@opt_FrmE==19 || @opt_FrmE==27) endparam ; second code heading, caption = "second code", visible = (@mode==0 || @mode>1), endheading param choiceF, caption = "choice", default = 0 enum = "asinh" "log" "Talis" "general function" "mix asinh&fn" "mix log&fn" \ "mix Talis&fn" "mix fn&gn" "fn(gn)" "fn+gn" "fn*gn" "fn/gn" "fn&gn extended" \ "Malinovsky" visible = (@mode==0 || @mode>1), endparam param subtalF, caption = "Talis option" default = 0 enum = "Talis original" "variant 1" "variant 2" "variant 3" "Duckytalis" visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) endparam param condF, caption = "main condition", default = 0 enum = "above or equal" "not equal" "outside" "below" "equal" "between" visible = ((@mode==0 || @mode==3) && @dev==true) || @mode==2, endparam int param nF1, caption = "primary #lo", default = 2 visible = ((@mode==0 || @mode==3) && @dev==true) || @mode==2, endparam int param nF2, caption = "primary #hi", default = 3 visible = (((@mode==0 || @mode==3) && @dev==true) || @mode==2) && (@condF==2 || @condF==5) endparam heading, caption = "Talis" visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6), endheading func fnaF, caption = "Talis function", default = ident() visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) && @subtalF>2 endfunc func fnbF, caption = "variation function", default = ident() visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) && @subtalF==4 endfunc complex param pwF, caption = "Talis parameter", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) endparam float param fF, caption = "variation parameter", default = 1.0 visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6 || \ (@choiceF==13 && @subtalF>0)) endparam heading, visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6), endheading func fnF1, caption = "main function", default = asinh(), visible = (@mode==0 || @mode>1) && (@choiceF>2 && @choiceF<13), endfunc func fnF2, caption = "second function", default = ident() visible = (@mode==0 || @mode>1) && (@choiceF>6 && @choiceF<13), endfunc complex param fctF, caption = "factor", default = (1.0,0.0) visible = (@mode==0 || @mode>1), endparam int param mixF, caption = "% mixing", default = 50 visible = (@mode==0 || @mode>1) && (@choiceF>3 && @choiceF<8), endparam complex param aaF, caption = "a", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && (@choiceF>7 && @choiceF<12), endparam complex param bbF, caption = "b", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && (@choiceF>7 && @choiceF<12), endparam param ManokF, caption = "Malinovsky option" enum = "original" "syntopia variant" "variant 2" "variant 3" \ "variant 4" "variant 5" visible = (@mode==0 || @mode>1) && @choiceF==13, endparam complex param m5F, caption = "variant 5 scaling", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && @choiceF==13 && @ManokF==5, endparam float param mnxF, caption = "scaling real", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceE==13, endparam float param mnyF, caption = "scaling imag", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceE==13, endparam func fnmnF, caption = "Manok function", default = ident() visible = (@mode==0 || @mode>1) && @choiceF==13, endfunc param keuzeRF, caption = "Manok sub funct.x" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam param keuzeIF, caption = "Manok sub funct.y" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam param wahlxF, caption = "x-shift option" enum = "0" "1" "2", default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam float param shiftx1F, caption = "x-shift", default = 2.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlxF==2, endparam float param shiftx2F, caption = "x-shift", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlxF==1, endparam param wahlyF, caption = "y-shift option" enum = "0" "1" "2", default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam float param shifty1F, caption = "y-shift", default = 2.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlyF==2, endparam float param shifty2F, caption = "y-shift", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlyF==1, endparam param subkmF, caption = "variant", default = 0, enum = "0" "1" "2" visible = (@mode==0 || @mode>1) && (@choiceF==10 || @choiceF==11), endparam bool param btoF, caption = "rotate back", default = false visible = (@mode==0 || @mode>1), endparam bool param altF, caption = "alternative" visible = (@mode==0 || @mode>1), endparam bool param juliaF, caption = "c plus or times?", default = false visible = (@mode==0 || @mode>1), endparam bool param vectF, caption = "vectors?", default = false visible = (@mode==0 || @mode>1), endparam complex param vector_F1, caption = "upper vector 1", default = (0.0,0.0) visible = @vectF==true && (@mode==0 || @mode>1), endparam complex param vector_F2, caption = "upper vector 2", default = (0.0,0.0) visible = (@mode==0 || @mode>1) && @vectF==true, endparam param opt_FrmF, caption = "function combination" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "arithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = (@mode==0 || @mode>1) && @choiceF==12 endparam bool param premixFrmF, caption = "preps before func.mixing" default = false visible = (@mode==0 || @mode>1) && @choiceF==12 endparam bool param mixchangeFrmF,caption = "the other func. branch? (toggle)" default = false visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam complex param mixvFrmF, caption = "total func.scaling" default = (1.0,0.0) visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam float param iftFrmF, caption = "func.imag scaling" default = 1.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam bool param mixvarFrmF, caption = "func.mix variant" default = false visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam complex param mvarFrmF, caption = "func.const.'1'", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true && @mixvarFrmF==true endparam func fnFrmF1, caption = "fn.1 function" default = ident() visible = (@mode==0 || @mode>1) && (@opt_FrmF==9 || @opt_FrmF==10 || @opt_FrmF==23) endfunc func fnFrmF2, caption = "fn.2 function" default = ident() visible = (@mode==0 || @mode>1) && (@opt_FrmF==9 || @opt_FrmF==10 || @opt_FrmF==23) endfunc float param uFrmF, caption = "func.comb.1 (%)" default = 50.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && (@opt_FrmF==0 || @opt_FrmF==6 || \ (@opt_col>15 && @opt_col<19) || @opt_col>19) endparam float param vFrmF, caption = "func.comb.2" default = 200.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && (@opt_FrmF==11 || @opt_FrmF==12 || \ @opt_col==19 || @opt_col>23) endparam float param wFrmF, caption = "func.comb.3" default = 200.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && (@opt_FrmF==19 || @opt_FrmF==27) endparam ;----------------------------------- ; mode: parallel heading, caption = "branches parallel", visible = @mode==3, endheading param opt_par, caption = "mixing 2 branches" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "logarithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = @mode==3 endparam bool param premixpar, caption = "preparations before branches mixing" default = false visible = @mode==3 endparam bool param mixchangepar, caption = "the other branch? (toggle)" default = false visible = @mode==3 && @premixpar==true endparam float param mixvpar, caption = "branch scaling" default = 1.0 visible = @mode==3 && @premixpar==true endparam float param iftpar, caption = "imag scaling" default = 1.0 visible = @mode==3 && @premixpar==true endparam bool param mixvarpar, caption = "branch vector?" default = false visible = @mode==3 && @premixpar==true endparam complex param mvarpar, caption = "const.'1'" default = (1.0,0.0) visible = @mode==3 && @premixpar==true && @mixvarpar==true endparam func fnparmixvar1, caption = "fn.1 mix br.mean" default = ident() visible = @mode==3 && (@opt_par==9 || @opt_par==10 || @opt_par==23) endfunc func fnparmixvar2, caption = "fn.2 mix br.mean" default = ident() visible = @mode==3 && (@opt_par==9 || @opt_par==10 || @opt_par==23) endfunc float param upar, caption = "br. mix param. 1" default = 50.0 visible = @mode==3 && (@opt_par==0 || @opt_par==6 || (@opt_par>15 && @opt_par<19) || @opt_par>19) endparam float param vpar, caption = "br. mix param. 2" default = 200.0 visible = @mode==3 && (@opt_par==11 || @opt_par==12 || @opt_par==19 || @opt_par>21) endparam float param wpar, caption = "br. mix param. 3" default = 200.0 visible = @mode==3 && (@opt_par==19 || @opt_par==27) endparam ;----------------------------------- int param m, caption = "#end", default = 5 visible = @var==true, endparam ;----------------------------------- ; precoloring heading, caption = "precoloring", endheading bool param ct, caption = "(1st) precoloring" default = false endparam bool param ct2, caption = "2nd precoloring" default = false visible = @ct==true endparam bool param colser, caption = "precol. in series" default = false visible = @ct==true && @ct2==true endparam bool param gt, caption = "gielis transformation" default = false endparam bool param moebtr, caption = "möbius transformation" default = false endparam ; I heading, caption = "precoloring #1" visible = @ct==true endheading param precoloption1, caption = "precol. #1 if" default = 0 visible = @ct==true enum = "all" "below" "above" "only 1" "between" "outside" "only 2" endparam int param transit1, caption = "precol. #1 iteration" default = 20 visible = @ct==true && @trans1>0 && @precoloption1>0 && @precoloption1<4 endparam int param transit1_LO, caption = "precol. #1 LO" default = 10 visible = @ct==true && @trans1>0 && @precoloption1>3 endparam int param transit1_HI, caption = "precol. #1 HI" default = 20 visible = @ct==true && @trans1>0 && @precoloption1>3 endparam param trans1, caption = "precol. #1 options" default = 0 enum = "normal" \ "sin-sin | cos-sin" \ "sin+sin | cos+sin" \ "sin*sin | cos*sin" \ "cos-sin | cos-sin" \ "cos+sin | cos+sin" \ "atan" \ "atan1" \ "sin & recip" \ "sine stalks 2" \ "log stalks 1" \ "sine vibration 1" \ "sine vibration 2" \ "sine vibration 3" \ "cosine vibration 1" \ "cosine vibration 2" \ "cosine vibration 3" \ "tangens vibration" \ "sin+cos" \ "sin*cos" \ "tg/(sin&cos)" \ "tg/(sin&cos) 2" \ "gielis" \ "möbius" visible = @ct==true endparam bool param joker1, caption = "joker" default = false visible = @ct==true && ((@trans1>0 && @trans1<13) || \ (@trans1>13 && @trans1<16) || (@trans1>16 && @trans1<22)) endparam bool param jp1, caption = "joker plus" default = false visible = @ct==true && (@trans1==6 || @trans1==8 || \ @trans1==9 || @trans1==10 || @trans1==21) endparam complex param colshift1, caption = "color#1 shift" visible = @ct==true && (@trans1>0 && @trans1<22) endparam float param pwc1, caption = "precol.#1 variation" default = 0.5 visible = @ct==true && \ ((@trans1==6 && @jp1==true) ||\ (@trans1==8 && @jp1==true) ||\ (@trans1==9 && @jp1==true) ||\ (@trans1==10 && @jp1==true) ||\ (@trans1==12 && @joker1==true) ||\ @trans1==13 || \ (@trans1==15 && @joker1==true) ||\ @trans1==16 || \ (@trans1==17 && @joker1==true) ||\ (@trans1==18 && @joker1==true) ||\ (@trans1==19 && @joker1==true) ||\ @trans1==20 ||\ @trans1==21) endparam float param pwd1, caption = "prec.#1 sec.var." default = 1.0 visible = @ct==true && ((@trans1>14 && @trans1<21) || (@trans1==21 && @jp1==false)) endparam complex param cf11, caption = "prec.#1 coëff.1" default = (1.0,1.0) visible = @ct==true && ((@trans1>0 && @trans1<11) || \ (@trans1>13 && @trans1<19) || @trans1==20 || @trans1==21) endparam complex param cf12, caption = "prec.#1 coëff.2" default = (1.0,1.0) visible = @ct==true && ((@trans1>0 && @trans1<11) || \ @trans1==17 || @trans1==20 || @trans1==21) endparam complex param cg1, caption = "prec.#1 coëff.3" default = 1.0 visible = @ct==true && ((@trans1>10 && @trans1<14) || @trans1==19) endparam bool param gsfh1, caption = "hyperbolic" default = false visible = @ct==true && @trans1==22 endparam bool param rose1, caption = "rose" default = false visible = @ct==true && @trans1==22 endparam float param gsfd1, caption = "gielis param m" default = 4.0 visible = @ct==true && @trans1==22 endparam float param gsfa1, caption = "gielis param a" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfb1, caption = "gielis param b" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfn11, caption = "gielis param n1" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfn12, caption = "gielis param n2" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfn13, caption = "gielis param n3" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfrf1, caption = "rose parameter" default = 1.0 visible = @ct==true && @rose1 && @trans1==22 endparam complex param moeba1, caption = "möb.param.a" default = (1.0,0.0) visible = @ct==true && @trans1==23 endparam complex param moebb1, caption = "möb.param.b" default = (0.0,0.0) visible = @ct==true && @trans1==23 endparam complex param moebc1, caption = "möb.param.c" default = (1.0,0.0) visible = @ct==true && @trans1==23 endparam complex param moebd1, caption = "möb.param.d" default = (0.0,0.0) visible = @ct==true && @trans1==23 endparam ; II heading, caption = "precoloring #2" visible = @ct==true && @ct2==true endheading param precoloption2, caption = "precol. #2 if:" default = 0 visible = @ct==true && @ct2==true enum = "all" "below" "above" "only 1" "between" "outside" "only 2" endparam int param transit2, caption = "precol. #2 iteration" default = 20 visible = @ct==true && @ct2==true && @trans2>0 && @precoloption2>0 && @precoloption2<4 endparam int param transit2_LO, caption = "precol. #2 LO" default = 10 visible = @ct==true && @ct2==true && @trans2>0 && @precoloption2>3 endparam int param transit2_HI, caption = "precol. #2 HI" default = 20 visible = @ct==true && @ct2==true && @trans2>0 && @precoloption2>3 endparam param trans2, caption = "precol. #2 options" default = 0 enum = "normal" \ "sin-sin | cos-sin" \ "sin+sin | cos+sin" \ "sin*sin | cos*sin" \ "cos-sin | cos-sin" \ "cos+sin | cos+sin" \ "atan" \ "atan1" \ "sin & recip" \ "sine stalks 2" \ "log stalks 1" \ "sine vibration 1" \ "sine vibration 2" \ "sine vibration 3" \ "cosine vibration 1" \ "cosine vibration 2" \ "cosine vibration 3" \ "tangens vibration" \ "sin+cos" \ "sin*cos" \ "tg/(sin&cos)" \ "tg/(sin&cos) 2" \ "gielis" \ "möbius" visible = @ct==true && @ct2==true endparam bool param joker2, caption = "joker" default = false visible = @ct==true && @ct2==true && ((@trans2>0 && @trans2<13) || \ (@trans2>13 && @trans2<16) || (@trans2>16 && @trans2<22)) endparam bool param jp2, caption = "joker plus" visible = @ct==true && @ct2==true && (@trans2==6 || @trans2==8 || \ @trans2==9 || @trans2==10 || @trans2==21) endparam complex param colshift2, caption = "precol.#2 shift" visible = @ct==true && @ct2==true && (@trans2>0 && @trans2<22) endparam float param pwc2, caption = "precol.#2 variation" default = 0.5 visible = @ct==true && @ct2==true && \ ((@trans2==6 && @jp2==true) ||\ (@trans2==8 && @jp2==true) ||\ (@trans2==9 && @jp2==true) ||\ (@trans2==10 && @jp2==true) ||\ (@trans2==12 && @joker2==true) ||\ @trans2==13 || \ (@trans2==15 && @joker2==true) ||\ @trans2==16 || \ (@trans2==17 && @joker2==true) ||\ (@trans2==18 && @joker2==true) ||\ (@trans2==19 && @joker2==true) ||\ @trans2==20 ||\ @trans2==21) endparam float param pwd2, caption = "prec.#2 sec.var." default = 1.0 visible = @ct==true && @ct2==true && ((@trans2>14 && @trans2<21) || \ (@trans2==21 && @jp1==false)) endparam complex param cf21, caption = "prec.#2 coëff.1" default = (1.0,1.0) visible = @ct==true && @ct2==true && ((@trans2>0 && @trans2<11) || \ (@trans2>13 && @trans2<19) || @trans2==20 || @trans2==21) endparam complex param cf22, caption = "prec.#2 coëff.2" default = (1.0,1.0) visible = @ct==true && @ct2==true && ((@trans2>0 && @trans2<11) || \ @trans2==17 || @trans2==20 || @trans2==21) endparam complex param cg2, caption = "prec.#2 coëff.3" default = 1.0 visible = @ct==true && @ct2==true && ((@trans2>10 && @trans2<14) || @trans2==19) endparam bool param gsfh2, caption = "hyperbolic" default = false visible = @ct==true && @ct2==true && @trans2==22 endparam bool param rose2, caption = "rose" default = false visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfd2, caption = "gielis param m" default = 4.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfa2, caption = "gielis param a" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfb2, caption = "gielis param b" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfn21, caption = "gielis param n1" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfn22, caption = "gielis param n2" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfn23, caption = "gielis param n3" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfrf2, caption = "rose parameter" default = 1.0 visible = @ct==true && @ct2==true && @rose2 && @trans2==22 endparam complex param moeba2, caption = "möb.param.a" default = (1.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam complex param moebb2, caption = "möb.param.b" default = (0.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam complex param moebc2, caption = "möb.param.c" default = (1.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam complex param moebd2, caption = "möb.param.d" default = (0.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam ; combination parameters coloring heading, caption = "color combination" visible = @ct==true && @ct2==true && @trans2>0 && @colser==false endheading param opt_col, caption = "color combination" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "arithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = @ct==true && @ct2==true && @colser==false && @trans2>0 endparam bool param premixCol, caption = "preparations before mixing" default = false visible = @ct==true && @ct2==true && @colser==false && @trans2>0 endparam bool param mixchangeCol, caption = "the other branch? (toggle)" default = false visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam complex param mixvCol, caption = "total scaling" default = (1.0,0.0) visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam float param iftCol, caption = "imag scaling" default = 1.0 visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam bool param mixvarCol, caption = "mix variant" default = false visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam complex param mvarCol, caption = "const.'1'", default = (1.0,0.0) visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true && @mixvarCol==true endparam func fncolopt1, caption = "fn.1 color mean" default = ident() visible = @ct==true && @ct2==true && @colser==false && (@trans2>0 && (@opt_col==9 || @opt_col==10 || @opt_col==23)) endfunc func fncolopt2, caption = "fn.2 color mean" default = ident() visible = @ct==true && @ct2==true && @colser==false && (@trans2>0 && (@opt_col==9 || @opt_col==10 || @opt_col==23)) endfunc float param ucol, caption = "color param.1" default = 50.0 visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && (@opt_col==0 || @opt_col==6 || \ (@opt_col>15 && @opt_col<19) || @opt_col>19) endparam float param vcol, caption = "color param.2" default = 200.0 visible = @ct==true && @ct2==true && @colser==false && (@trans2>0 && (@opt_col==11 || @opt_col==12 || \ @opt_col==19 || @opt_col>23)) endparam float param wcol, caption = "color param.3" default = 200.0 visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && (@opt_col==19 || @opt_col==27) endparam ; end color transformations 1&2 heading, caption = "Gielis color transformation." visible = @gt==true endheading bool param gsfh, caption = "hyperbolic" default = false visible = @gt==true endparam bool param rose, caption = "rose" default = false visible = @gt==true, endparam float param gsfd, caption = "gielis param m" default = 4.0 visible = @gt==true endparam float param gsfa, caption = "gielis param a" default = 2.0 visible = @gt==true endparam float param gsfb, caption = "gielis param b" default = 2.0 visible = @gt==true endparam float param gsfn1, caption = "gielis param n1" default = 2.0 visible = @gt==true endparam float param gsfn2, caption = "gielis param n2" default = 2.0 visible = @gt==true endparam float param gsfn3, caption = "gielis param n3" default = 2.0 visible = @gt==true endparam float param gsfrf, caption = "rose parameter" default = 1.0 visible = @gt==true && @rose==true endparam heading, caption = "Möbius color transformation." visible = @moebtr==true endheading complex param moeba, caption = "möbius a" default = (1.0,0.0) visible = @moebtr==true endparam complex param moebb, caption = "möbius b" default = (0.0,0.0) visible = @moebtr==true endparam complex param moebc, caption = "möbius c" default = (1.0,0.0) visible = @moebtr==true endparam complex param moebd, caption = "möbius d" default = (1.0,0.0) visible = @moebtr==true endparam switch: type = "Lucky_M", version = version bailout = bailout, var = var, dev = dev, mode = mode opt_par = opt_par, premixpar = premixpar, mixchangepar = mixchangepar, iftpar = iftpar mixvarpar = mixvarpar, mvarpar = mvarpar, mvpar = mvpar fnparmixvar1 = fnparmixvar1, fnparmixvar2 = fnparmixvar2, upar = upar, vpar = vpar, wpar = wpar choiceE = choiceE, fnE1 = fnE1, aaE = aaE, bbE = bbE, mixE = mixE condE = condE, nE1 = nE1, nE2 = nE2, btoE = btoE, altE = altE vectE = vectE, vector_E1 = vector_E1, vector_E2 = vector_E2, fnaE = fnaE, fnbE = fnbE, pwE = pwE, fE = fE, fnE2 = fnE2 fctE = fctE, juliaE = juliaE, uFrmE = uFrmE, vFrmE = vFrmE, wFrmE = wFrmE opt_FrmE = opt_FrmE, changeFrmE = changeFrmE, mixvarFrmE = mixvarFrmE, mixvFrmE = mixvFrmE mvarFrmE = mvarFrmE, iftFrmE = iftFrmE, premixFrmE = premixFrmE, fnFrmE1 = fnFrmE1 fnFrmE2 = fnFrmE2, subtalE = subtalE, ManokE = ManokE, mnxE = mnxE mnyE = mnyE, keuzeRE = keuzeRE, keuzeIE = keuzeIE, fnmnE = fnmnE m5E = m5E, wahlxE = wahlxE, shiftx1E = shiftx1E, shiftx2E = shiftx2E wahlyE = wahlyE, shifty1E = shifty1E, shifty2E = shifty2E choiceF = choiceF, fnF1 = fnF1, aaF = aaF, bbF = bbF, mixF = mixF condF = condF, nF1 = nF1, nF2 = nF2, btoF = btoF, altF = altF vectF = vectF, vector_F1 = vector_F1, vector_F2 = vector_F2 fnaF = fnaF, fnbF = fnbF, pwF = pwF, fF = fF, fnF2 = fnF2 fctF = fctF, juliaF = juliaF, uFrmF = uFrmF, vFrmF = vFrmF, wFrmF = wFrmF opt_FrmF = opt_FrmF, changeFrmF = changeFrmF, mixvarFrmF = mixvarFrmF, mixvFrmF = mixvFrmF mvarFrmF = mvarFrmF, iftFrmF = iftFrmF, premixFrmF = premixFrmF, fnFrmF1 = fnFrmF1 fnFrmF2 = fnFrmF2, subtalF = subtalF, ManokF = ManokF, mnxF = mnxF mnyF = mnyF, keuzeRF = keuzeRF, keuzeIF = keuzeIF, fnmnF = fnmnF m5F = m5F, wahlxF = wahlxF, shiftx1F = shiftx1F, shiftx2F = shiftx2F wahlyF = wahlyF, shifty1F = shifty1F, shifty2F = shifty2F gt = gt, moebtr = moebtr m = m, ct = ct, ct2 = ct2, colser = colser precoloption1 = precoloption1, transit1 = transit1, transit1_LO = transit1_LO, transit1_HI = transit1_HI trans1 = trans1, joker1 = joker1, jp1 = jp1, colshift1 = colshift1 pwc1 = pwc1, pwd1 = pwd1, cf11 = cf11, cf12 = cf12 cg1 = cg1, gt1 = gt1, moebtr1 = moebtr1 precoloption2 = precoloption2, transit2 = transit2, transit2_LO = transit2_LO, transit2_HI = transit2_HI trans2 = trans2, joker2 = joker2, jp2 = jp2, colshift2 = colshift2 pwc2 = pwc2, pwd2 = pwd2, cf21 = cf21, cf22 = cf22 cg2 = cg2, gt2 = gt2, moebtr2 = moebtr2 opt_col = opt_col, premixCol = premixCol, mixchangeCol = mixchangeCol, iftCol = iftCol mixvarCol = mixvarCol, mvarCol = mvarCol, mvcol = mvcol fncolopt1 = fncolopt1, fncolopt2 = fncolopt2, ucol = ucol, vcol = vcol, wcol = wcol gsfh = gsfh, gsfh1 = gsfh1, gsfh2 = gsfh2 rose = rose, rose1 = rose1, rose2 = rose2 gsfd = gsfd, gsfd1 = gsfd1, gsfd2 = gsfd2 gsfa = gsfa, gsfa1 = gsfa1, gsfa2 = gsfa2 gsfb = gsfb, gsfb1 = gsfb1, gsfb2 = gsfb2 gsfn1 = gsfn1, gsfn11 = gsfn11, gsfn21 = gsfn21 gsfn2 = gsfn2, gsfn12 = gsfn12, gsfn22 = gsfn22 gsfn3 = gsfn3, gsfn13 = gsfn13, gsfn23 = gsfn23 gsfrf = gsfrf, gsfrf1 = gsfrf1, gsfrf2 = gsfrf2 moeba = moeba, moeba1 = moeba1, moeba2 = moeba2 moebb = moebb, moebb1 = moebb1, moebb2 = moebb2 moebc = moebc, moebc1 = moebc1, moebc2 = moebc2 moebd = moebd, moebd1 = moebd1, moebd2 = moebd2 } Lucky_M { ; version 1.01 ; Thanks to Danny van den Berghe for the Duckytalis option, ; Edgar Malinovsky for his option, ; Mikael Hvidtfeldt Christensen, for the Syntopia variant ; and many others ; See for some elucidation: ; ea.txt on UF formula database: "Lucky, a Ducky special" ; Ed Algra 2013, Sept. 14 global: float tol = 1e-15 float halfpi = 0.0 halfpi = 0.5*#pi zero = (0.0,0.0) int nE1 = @nE1, int nE2 = @nE2 int m = @m int nF1 = @nF1, int nF2 = @nF2 if m2 && ch<8) || ch==12 if mark==1, functie = @fnE1(z), endif if mark==2, functie = @fnF1(z), endif endif if ch==7 || ch==12 if mark==1, functie2 = @fnE2(z), endif if mark==2, functie2 = @fnF2(z), endif endif if ch==8 ; "fn(gn)" f(a*g(z-b)) if mark==1 nb = @fnE1(z-bb) na = @fnE2(aa*nb) elseif mark==2 nb = @fnF1(z-bb) na = @fnF2(aa*nb) endif endif if ch==9 ; "fn+gn" a*f(z) + b*g(z) if mark==1 na = fact*(aa*@fnE1(z)+bb*@fnE2(z)) elseif mark==2 na = fact*(aa*@fnF1(z)+bb*@fnF2(z)) endif na = .25*na endif if ch==10 ; "fn*gn" f(az)*g(bz) if mark==1 na = @fnE1(aa*z)*@fnE2(bb*z) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif elseif mark==2 na = fact*@fnF1(aa*z)*@fnF2(bb*z) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif endif na = .25*na endif if ch==11 ; "fn/gn" f(z-a)/g(z-b) if mark==1 na = @fnE1(z-aa)/@fnE2(z-bb) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif elseif mark==2 na = @fnF1(z-aa)/@fnF2(z-bb) if subkm==0 na = fact*na elseif subkm==1 na = fact*z*na elseif subkm==2 na = fact*(z+na) endif endif na = 2.5*na endif if ch==12 && (opt_Frm==9 || opt_Frm==10 || opt_Frm==23) if mark==1, functie = @fnFrmE1(functie), functie2 = @fnFrmE2(functie2), endif if mark==2, functie = @fnFrmF1(functie), functie2 = @fnFrmF2(functie2), endif endif if ch==0 ; asinh result = fact*asinh(z) elseif ch==1 ; log result = fact*log(z) elseif ch==2 ; Talis result = fact*na elseif ch==3 ; general function result = fact*functie elseif ch==4 ; mix 1 result = 0.01*(mix*functie+(100-mix)*fact*asinh(z)) elseif ch==5 ; mix 2 result = 0.01*(mix*functie+(100-mix)*0.6*fact*log(z)) elseif ch==6 ; mix 3 result = 0.01*(mix*functie+(100-mix)*0.2*fact*(z^pw*na)) elseif ch==7 ; mix 4 result = 0.01*(mix*functie+(100*mix)*0.01*fact*functie2) elseif ch>7 && ch<12 result = na elseif ch==12 na = FormulaMix(functie,functie2,uFrm,vFrm,wFrm,opt_Frm,mixchangeFrm,mixvarFrm,mixvFrm,mvarFrm,iftFrm,premixFrm) result = fact*na endif return result endfunc complex func Option13(complex z,float mnx,float mny,int Manok,int keuzeR,int keuzeI,complex fact,int wahlx, \ float shiftx1,float shiftx2,int wahly,float shifty1,float shifty2,complex m5,int mark) complex na = zero float t = 0.0, float x = 0.0, float y = 0.0 x = real(z), y = imag(z) if (keuzeR==18 || keuzeR==19) while x<-1, x = x+2, endwhile while x>1, x = x-2, endwhile endif if keuzeR==20 while (x>-1 && x<0), x = x-1, endwhile while (x>=0 && x<1), x = x+1, endwhile endif if wahlx==1 while x<-1, x = x+shiftx1, endwhile while x>1, x = x-shiftx1, endwhile elseif wahlx==2 while (x>-1 && x<0), x = x-shiftx2, endwhile while (x>=0 && x<1), x = x+shiftx2, endwhile endif if (keuzeI==18 || keuzeI==19) while y<-1, y = y+2, endwhile while y>1, y = y-2, endwhile endif if keuzeI==20 while (y>-1 && y<0), y = y-1, endwhile while (y>=0 && y<1), y = y+1, endwhile endif if wahly==1 while y<-1, y = y+shifty1, endwhile while y>1, y = y-shifty1, endwhile elseif wahly==2 while (y>-1 && y<0), y = y-shifty2, endwhile while (y>=0 && y<1), y = y+shifty2, endwhile endif if Manok==0 ; original: (x/|z|) + flip(y/|z|) t = |z|, na = mnx*FltFunc(x,keuzeR)/t + flip(mny*FltFunc(y,keuzeI)/t) elseif Manok==1; z/(x*y) na = z/(FltFunc(x,keuzeR)*FltFunc(y,keuzeI)) elseif Manok==2; z/(x^y) na = z/(FltFunc(x,keuzeR)^FltFunc(y,keuzeI)) elseif Manok==3; z/(x/y) na = z*FltFunc(y,keuzeI)/FltFunc(x,keuzeR) elseif Manok==4; z = x^y na = FltFunc(x,keuzeR)^FltFunc(y,keuzeI) elseif Manok==5; z = x/y na = z+m5*FltFunc(x,keuzeR)/FltFunc(y,keuzeI) endif if mark==1 na = @fnmnE(na) elseif mark==2 na = @fnmnF(na) endif result = fact*na return result endfunc float func FltFunc(float uu, int keuze) float result = 0.0 if keuze==0, uu = ident(uu) elseif keuze==1, uu = sin(uu) elseif keuze==2, uu = sinh(uu) elseif keuze==3, uu = asinh(uu) elseif keuze==4, uu = cos(uu) elseif keuze==5, uu = cosh(uu) elseif keuze==6, uu = tan(uu) elseif keuze==7, uu = atan(uu) elseif keuze==8, uu = tanh(uu) elseif keuze==9, uu = atanh(uu) elseif keuze==10, uu = cotan(uu) elseif keuze==11, uu = cotanh(uu) elseif keuze==12, uu = sqr(uu) elseif keuze==13, uu = sqrt(uu) elseif keuze==14, uu = log(uu) elseif keuze==15, uu = exp(uu) elseif keuze==16, uu = recip(uu) elseif keuze==17, uu = (1-cos(uu)) elseif keuze==18, uu = asin(uu) elseif keuze==19, uu = acos(uu) elseif keuze==20, uu = acosh(uu) endif result = uu return result endfunc bool func ConditionE(int cE,int t,int nE1,int nE2) bool result = false if ((cE==0 && tnE1 && t=nE1) || \ (cE==4 && (tnE1)) || \ (cE==5 && (tnE2))) result = true endif return result endfunc bool func ConditionF(int cF,int t,int nF1,int nF2) bool result = false if ((cF==0 && t>=nF1) || \ (cF==1 && (tnF1)) || \ (cF==2 && (t<=nF1 || t>=nF2)) || \ (cF==3 && t=nF1 && t<=nF2)) result = true endif return result endfunc complex func CalculateBackToOne(complex z, bool b, bool v, complex v1) complex result = zero float fi = 0.0 fi = atan2(z) if fi>halfpi if b z = abs(z) else ; pi/2 backw. z = z*exp(-1i*halfpi) endif result = z else if v, result = z + v1, else, result = z, endif endif return result endfunc complex func FormulaMix(complex x,complex y,float u,float v,float w,int mengoptie,\ bool mixchange, bool mixvar, complex mixv, complex mvar, float ift, bool premix) complex result = zero if premix if mixchange x = mixv*(real(x) + flip(ift*imag(x))) if mixvar, x = mvar-x, endif else y = mixv*(real(y) + flip(ift*imag(y))) if mixvar, y = mvar-y, endif endif endif if mengoptie==0; spicy result = calculateMixOption0(x,y,u) elseif mengoptie==1; arithmetic mean result = calculateMixOption1(x,y) elseif mengoptie==2; geometric mean result = calculateMixOption2(x,y) elseif mengoptie==3; harmonic mean result = calculateMixOption3(x,y) elseif mengoptie==4; quadratic mean result = calculateMixOption4(x,y) elseif mengoptie==5; cubic mean result = calculateMixOption5(x,y) elseif mengoptie==6; generalized mean result = calculateMixOption6(x,y,u) elseif mengoptie==7; contraharmonic mean result = calculateMixOption7(x,y) elseif mengoptie==8; logarithmic mean result = calculateMixOption8(x,y) elseif mengoptie==9; arithmetric function mean result = calculateMixOption9(x,y) elseif mengoptie==10; geometric function mean result = calculateMixOption10(x,y) elseif mengoptie==11; general power mean result = calculateMixOption11(x,y,u) elseif mengoptie==12; Lehmer mean result = calculateMixOption12(x,y,v) elseif mengoptie==13; Heronian mean result = calculateMixOption13(x,y) elseif mengoptie==14; geometric harmonic 1 result = calculateMixOption14(x,y) elseif mengoptie==15; geometric harmonic 2 result = calculateMixOption15(x,y) elseif mengoptie==16; Heinz mean result = calculateMixOption16(x,y,u) elseif mengoptie==17; power mean result = calculateMixOption17(x,y,u) elseif mengoptie==18; linear variant result = calculateMixOption18(x,y,u,v) elseif mengoptie==19; geometric variant result = calculateMixOption19(x,y,v,w) elseif mengoptie==20; harmonic variant result = calculateMixOption20(x,y,u) elseif mengoptie==21; contraharmonic variant result = calculateMixOption21(x,y,u) elseif mengoptie==22; logarithmic variant result = calculateMixOption22(x,y,u) elseif mengoptie==23; function variant result = calculateMixOption23(x,y,u) elseif mengoptie==24; power variant result = calculateMixOption24(x,y,u,v) elseif mengoptie==25; generalized variant result = calculateMixOption25(x,y,u,v) elseif mengoptie==26; Lehmer variant result = calculateMixOption26(x,y,u,v) elseif mengoptie==27; product result = calculateMixOption27(x,y,u,v,w) endif return result endfunc complex func calculateMixOption0(complex x,complex y,float u); spicy return x + 0.0001*u*y endfunc complex func calculateMixOption1(complex x,complex y); arithmetic mean return 0.5*(x+y) endfunc complex func calculateMixOption2(complex x,complex y); geometric mean return sqrt(x*y) endfunc complex func calculateMixOption3(complex x,complex y); harmonic mean return 2*recip(recip(x)+recip(y)) endfunc complex func calculateMixOption4(complex x,complex y); quadratic mean return sqrt((x*x+y*y)/2) endfunc complex func calculateMixOption5(complex x,complex y); cubic mean return ((x*x*x+y*y*y)/2)^(1/3) endfunc complex func calculateMixOption6(complex x,complex y, float u); generalized mean return ((x^(0.01*u)+y^(0.01*u))/2)^(100/u) endfunc complex func calculateMixOption7(complex x,complex y); contraharmonic mean return (x*x+y*y)/(x+y) endfunc complex func calculateMixOption8(complex x,complex y); logarithmic mean return (x-y)/(log(x)-log(y)) endfunc complex func calculateMixOption9(complex x,complex y); arithmetric function mean return 0.5*(x+y) endfunc complex func calculateMixOption10(complex x,complex y); geometric function mean return sqrt(x*y) endfunc complex func calculateMixOption11(complex x,complex y, float u); general power mean return (0.5*(x^(0.01*u) + y^(0.01*u)))^(100/u) endfunc complex func calculateMixOption12(complex x,complex y, float u); Lehmer mean complex x1 = zero, complex x2 = zero x1 = x^(0.01*u) + y^(0.01*u) x2 = y^((0.01*u)-1) + y^((0.01*u)-1) return x1/x2 endfunc complex func calculateMixOption13(complex x,complex y); Heronian mean return (x+y+sqrt(x*y))/3 endfunc complex func calculateMixOption14(complex x,complex y); geometric harmonic 1 complex x1 = zero, complex x2 = zero x1 = sqrt(x*y) x2 = 2*recip(recip(x)+recip(y)) return sqrt(x1*x2) endfunc complex func calculateMixOption15(complex x,complex y); geometric harmonic 2 complex x1 = zero, complex x2 = zero x1 = sqrt(x*y) x2 = 2*recip(recip(x)+recip(y)) return 2/(recip(x1) + recip(x2)) endfunc complex func calculateMixOption16(complex x,complex y,float u); Heinz mean complex x1 = zero, complex x2 = zero x1 = (x^(0.01*u))*(y^(0.01*(100-u))) x2 = (x^(0.01*(100-u)))*(y^(0.01*u)) return 0.5*(x1+x2) endfunc complex func calculateMixOption17(complex x,complex y,float u); power mean return 0.5*((x^(0.01*u) + y^(0.01*u))^(100/u)) endfunc complex func calculateMixOption18(complex x,complex y,float u, float v); linear variant return 0.01*v*(u*x+(100-u)*y) endfunc complex func calculateMixOption19(complex x,complex y,float v, float w); geometric variant return sqrt(x^(0.01*v) * y^(0.01*w)) endfunc complex func calculateMixOption20(complex x,complex y,float u); harmonic variant return 0.04*(recip(recip(u*x) + recip((100-u)*y))) endfunc complex func calculateMixOption21(complex x,complex y,float u); contraharmonic variant complex x1 = zero, complex x2 = zero x1 = 0.02*((u*x)^2 + ((100-u)*y)^2) x2 = u*x + (100-u)*y return x1/x2 endfunc complex func calculateMixOption22(complex x,complex y,float u); logarithmic variant complex x1 = zero, complex x2 = zero x1 = 0.02*(u*x-(100-u)*y) x2 = log(0.02*u*x)-log(0.02*(100-u)*y) return x1/x2 endfunc complex func calculateMixOption23(complex x,complex y, float u); function variant return 0.01*(u*x+(100-u)*y) endfunc complex func calculateMixOption24(complex x,complex y,float u,float v); power variant complex x1 = zero, complex x2 = zero x1 = (0.02*u*x)^(0.01*v) x2 = (0.02*(100-u)*y)^(0.01*v) return (0.5*(x1+x2))^(100/v) endfunc complex func calculateMixOption25(complex x,complex y,float u,float v); generalized variant complex x1 = zero, complex x2 = zero x1 = u*x^(0.01*v) x2 = (100-u)*y^(0.01*v) return (0.01*(x1+x2))^(100/v) endfunc complex func calculateMixOption26(complex x,complex y,float u,float v); Lehmer variant complex x1 = zero, complex x2 = zero, complex x3 = zero, complex x4 = zero x1 = (0.02*u*x)^(0.01*v) x2 = (0.02*(100-u)*y)^(0.01*v) x3 = (0.02*u*x)^(0.01*v-1) x4 = (0.02*(100-u)*y)^(0.01*v-1) return (x1+x2)/(x3+x4) endfunc complex func calculateMixOption27(complex x,complex y,float u,float v,float w); product return u * x^(0.01*v) * y^(0.01*w) endfunc bool func ColorIterSelection(int p,int i,int t,int l,int u) bool result = false if p==0 result = true elseif p==1 if i<=t, result=true, endif elseif p==2 if i>t, result=true, endif elseif p==3 if i==t, result=true, endif elseif p==3 if (i>l && iu), result=true, endif elseif p==5 if (i==l || i==u), result=true, endif endif return result endfunc complex func PreColoring(complex z,int trans, complex s,bool jk,bool jp,complex t,\ complex u,complex v,float r,float w,\ float kwartm,float ga,float gb,float n1,\ float n2,float n3,float rp,bool hyp,bool roos,\ complex ma,complex mb,complex mc,complex md) complex result = zero if trans==1; sin-sin | cos-sin result = ColorTransformation1(z,s,jk,t,u) elseif trans==2; sin+sin | cos+sin result = ColorTransformation2(z,s,jk,t,u) elseif trans==3; sin*sin | cos+sin result = ColorTransformation3(z,s,jk,t,u) elseif trans==4; cos-sin | cos-sin result = ColorTransformation4(z,s,jk,t,u) elseif trans==5; cos+sin | cos+sin result = ColorTransformation5(z,s,jk,t,u) elseif trans==6; atan result = ColorTransformation6(z,s,jk,jp,t,u,r) elseif trans==7; atan1 result = ColorTransformation7(z,s,jk,jp,t,u,r) elseif trans==8; sine&recip result = ColorTransformation8(z,s,jk,jp,t,u,r) elseif trans==9; sine stalks result = ColorTransformation9(z,s,jk,jp,t,u,r) elseif trans==10; log stalks result = ColorTransformation10(z,s,jk,jp,t,u,r) elseif trans==11; sine vibration1 result = ColorTransformation11(z,s,v,jk) elseif trans==12; sine vibration2 result = ColorTransformation12(z,s,v,jk,r) elseif trans==13; sine vibration3 result = ColorTransformation13(z,s,v,r) elseif trans==14; cosine vibration1 result = ColorTransformation14(z,s,jk,t,u) elseif trans==15; cosine vibration2 result = ColorTransformation15(z,s,jk,t,r,w) elseif trans==16; cosine vibration3 result = ColorTransformation16(z,s,t,r,w) elseif trans==17; tangens vibration result = ColorTransformation17(z,s,jk,t,u,r,w) elseif trans==18; sin+cos result = ColorTransformation18(z,s,jk,t,u,r,w) elseif trans==19; sin*cos result = ColorTransformation19(z,s,jk,v,r,w) elseif trans==20; tg/(sin&cos)1 result = ColorTransformation20(z,s,jk,t,u,r,w) elseif trans==21; tg/(sin&cos)2 result = ColorTransformation21(z,s,jk,jp,t,u,r,w) elseif trans==22; gielis result = ColorTransformation22(z,kwartm,ga,gb,n1,n2,n3,rp,hyp,roos) elseif trans==23; möbius result = ColorTransformation23(z,ma,mb,mc,md) endif return result endfunc ; 1 sin-sin | cos-sin complex func ColorTransformation1(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*sin(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(x))) else x = tol+real(t)*sin(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 2 sin+sin | cos+sin complex func ColorTransformation2(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*sin(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y+(tol+imag(u)*sin(x))) else x = tol+real(t)*sin(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y+(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 3 sin*sin | cos*sin complex func ColorTransformation3(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*sin(imag(t)*x*(tol+sin(y))) y = tol+real(u)*cos(y*(tol+imag(u)*sin(x))) else x = tol+real(t)*sin(imag(t)*x*(tol+sin(y))) y = tol+real(u)*cos(y*(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 4 cos-sin | cos-sin complex func ColorTransformation4(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*cos(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(x))) else x = tol+real(t)*cos(x-(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 5 cos+sin | cos+sin complex func ColorTransformation5(complex z, complex s, bool jk, complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = tol+real(t)*cos(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(x))) else x = tol+real(t)*cos(x+(tol+imag(t)*sin(y))) y = tol+real(u)*cos(y-(tol+imag(u)*sin(temp))) endif return x + flip(y) endfunc ; 6 atan complex func ColorTransformation6(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = atan(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan(((real(u)+imag(u)*y)^r)*(x^(-r))) else x = atan(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan(((imag(t)+imag(u)*y)^r)*(temp^(-r))) endif else if jk x = atan(real(t)+imag(t)*x/y) y = atan(imag(t)+imag(u)*y/x) else x = atan(real(t)+imag(t)*x/y) y = atan(imag(t)+imag(u)*y/temp) endif endif return x + flip(y) endfunc ; 7 atan1 complex func ColorTransformation7(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = atan2(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan2(((real(u)+imag(u)*y)^r)*(x^(-r))) else x = atan2(((real(t)+imag(t)*x)^r)*(y^(-r))) y = atan2(((real(u)+imag(u)*y)^r)*(temp^(-r))) endif else if jk x = atan2(real(t)+imag(t)*x/y) y = atan2(real(u)+imag(u)*y/x) else x = atan2(real(t)+imag(t)*x/y) y = atan2(real(u)+imag(u)*y/temp) endif endif return x + flip(y) endfunc ; 8 sin & recip complex func ColorTransformation8(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = ((real(t)*x)^r)*((tol+abs(sin(imag(t)*x*x+y*y)))^(-r)) y = ((real(u)*y)^r)*((tol+abs(sin(imag(u)*x*x+y*y)))^(-r)) else x = ((real(t)*x)^r)*((tol+abs(sin(imag(t)*x*x+y*y)))^(-r)) y = ((real(u)*y)^r)*((tol+abs(sin(imag(u)*temp*temp+y*y)))^(-r)) endif else if jk x = real(t)*x/(tol+abs(sin(imag(t)*x*x+y*y))) y = real(u)*y/(tol+abs(sin(imag(u)*x*x+y*y))) else x = real(t)*x/(tol+abs(sin(imag(t)*x*x+y*y))) y = real(u)*y/(tol+abs(sin(imag(u)*temp*temp+y*y))) endif endif return x + flip(y) endfunc ; 9 sine stalks complex func ColorTransformation9(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = ((sin(x))^r)*((tol+sqrt(real(t)*x*x+imag(t)*y*y))^(-r)) y = ((sin(y))^r)*((tol+sqrt(real(u)*x*x+imag(u)*y*y))^(-r)) else x = ((sin(x))^r)*((tol+sqrt(real(t)*x*x+imag(t)*y*y))^(-r)) y = ((sin(y))^r)*((tol+sqrt(real(u)*temp*temp+imag(u)*y*y))^(-r)) endif else if jk x = sin(x)/(tol+sqrt(real(t)*x*x+imag(t)*y*y)) y = sin(y)/(tol+sqrt(real(u)*x*x+imag(u)*y*y)) else x = sin(x)/(tol+sqrt(real(t)*x*x+imag(t)*y*y)) y = sin(y)/(tol+sqrt(real(u)*temp*temp+imag(u)*y*y)) endif endif return x + flip(y) endfunc ; 10 log stalks complex func ColorTransformation10(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = ((real(t)*log(abs(x+tol)))^r)*(log(abs(imag(t)*x*x+y+y-tol)))^(-r) y = ((real(u)*log(abs(y+tol)))^r)*(log(abs(imag(u)*x*x+y+y-tol)))^(-r) else x = ((real(t)*log(abs(x+tol)))^r)*(log(abs(imag(t)*x*x+y+y-tol)))^(-r) y = ((real(u)*log(abs(y+tol)))^r)*(log(abs(imag(u)*temp*temp+y+y-tol)))^(-r) endif else if jk x = real(t)*log(abs(x+tol))/(log(abs(imag(t)*x*x+y+y-tol))) y = real(u)*log(abs(y+tol))/(log(abs(imag(u)*x*x+y+y-tol))) else x = real(t)*log(abs(x+tol))/(log(abs(imag(t)*x*x+y+y-tol))) y = real(u)*log(abs(y+tol))/(log(abs(imag(u)*temp*temp+y+y-tol))) endif endif return x + flip(y) endfunc ; 11 sine vibration 1 complex func ColorTransformation11(complex z, complex s, complex v, bool jk) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = real(v)*sin(y) y = imag(v)*sin(x) else x = real(v)*sin(y) y = imag(v)*sin(temp) endif return x + flip(y) endfunc ; 12 sine vibration 2 complex func ColorTransformation12(complex z, complex s, complex v, bool jk, float r) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(v)*(sqr(sin(x)))^r y = imag(v)*(sqr(sin(y)))^r else x = real(v)*sqr(sin(x)) y = imag(v)*sqr(sin(y)) endif return x + flip(y) endfunc ; 13 sine vibration 3 complex func ColorTransformation13(complex z, complex s, complex v, float r) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) x = real(v)*(sin(x))^r y = imag(v)*(sin(y))^r return x + flip(y) endfunc ; 14 cosine vibration 1 complex func ColorTransformation14(complex z, complex s, bool jk, \ complex t, complex u) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jk x = real(t)*cos(imag(t)-(y)) y = real(u)*cos(imag(u)-(x)) else x = real(t)*cos(imag(t)-(y)) y = real(u)*cos(imag(u)-(temp)) endif return x + flip(y) endfunc ; 15 cosine vibration 2 complex func ColorTransformation15(complex z, complex s, bool jk, \ complex t, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(t)*(sqr(w-cos(x)))^r y = imag(t)*(sqr(w-cos(y)))^r else x = real(t)*sqr(w-cos(x)) y = imag(t)*sqr(w-cos(y)) endif return x + flip(y) endfunc ; 16 cosine vibration 3 complex func ColorTransformation16(complex z, complex s, complex t, \ float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) x = real(t)*(w-cos(x))^r y = imag(t)*(w-cos(y))^r return x + flip(y) endfunc ; 17 tangens vibration complex func ColorTransformation17(complex z, complex s, bool jk, \ complex t, complex u, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = ((real(t)*sin(x))^r)*((abs(imag(t)*cos(w-x+tol)))^(-r)) y = ((real(u)*sin(y))^r)*((abs(imag(u)*cos(w-y+tol)))^(-r)) else x = real(t)*sin(x)/abs(imag(t)*cos(1-x+tol)) y = real(u)*sin(y)/abs(imag(u)*cos(1-y+tol)) endif return x + flip(y) endfunc ; 18 sin+cos complex func ColorTransformation18(complex z, complex s, bool jk, complex t, \ complex u, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(t)*sin(r-x)+imag(t)*cos(w+x) y = real(u)*sin(r-y)+imag(u)*cos(w+y) else x = real(t)*sin(x)+imag(t)*cos(x) y = real(u)*sin(y)+imag(u)*cos(y) endif return x + flip(y) endfunc ; 19 sin*cos complex func ColorTransformation19(complex z, complex s, bool jk, complex v, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = real(v)*sin(r-x)*cos(w+x) y = imag(v)*sin(r-y)*cos(w+y) else x = real(v)*sin(x)*cos(x) y = imag(v)*sin(y)*cos(y) endif return x + flip(y) endfunc ; 20 tg/(sin&cos)1 complex func ColorTransformation20(complex z, complex s, bool jk, complex t, \ complex u, float r, float w) float x = 0.0, float y = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) if jk x = (tan(x))^r*((real(t)*sin(x)+imag(t)*cos(x)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(y)+imag(u)*cos(y)+tol)^(-r)) else x = (tan(x))^r*((real(t)*sin(x)+imag(t)*cos(w-x)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(y)+imag(u)*cos(w-y)+tol)^(-r)) endif return x + flip(y) endfunc ; 21 tg/(sin&cos)2 complex func ColorTransformation21(complex z, complex s, bool jk, bool jp, \ complex t, complex u, float r, float w) float x = 0.0, float y = 0.0, float temp = 0.0 x = real(z)+real(s), y = imag(z)+imag(s) temp = x if jp if jk x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(x)+imag(u)*cos(x)+tol)^(-r)) else x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(temp)+imag(u)*cos(temp)+tol)^(-r)) endif else if jk x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(w-y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(x)+imag(u)*cos(w-x)+tol)^(-r)) else x = (tan(x))^r*((real(t)*sin(y)+imag(t)*cos(w-y)+tol)^(-r)) y = (tan(y))^r*((real(u)*sin(temp)+imag(u)*cos(w-temp)+tol)^(-r)) endif endif return x + flip(y) endfunc ; 22 gielis complex func ColorTransformation22(complex z, float kwartm, float ga, float gb, float n1, \ float n2, float n3, float rp, bool hyp, bool roos) float fi = 0.0, float costerm = 0.0, float sinterm = 0.0, float gr = 0.0 fi = atan2(z) costerm = (abs(cos(kwartm*fi/ga)))^n2 sinterm = (abs(sin(kwartm*fi/gb)))^n3 if hyp gr = (cabs(z)*(costerm - sinterm))^(-1/n1) else gr = (cabs(z)*(costerm + sinterm))^(-1/n1) endif if roos, gr = gr * sin(rp*fi), endif x = gr*cos(fi), y = gr*sin(fi) return x + flip(y) endfunc ; 23 möbius complex func ColorTransformation23(complex z, complex ma, complex mb, complex mc, complex md) return (ma*z+mb)/(mc*z+md) endfunc loop: counter = counter+1 iter = iter + 1 if @mode==3, zq = z, endif ; I if @mode<2 || @mode==3 z = abs(z) mark = 1 if @altE if @choiceE<13 z = Fractal(z,@choiceE,@fE,@pwE,@mixE,@fctE,@aaE,@bbE,@subtalE,@subkmE,@uFrmE,@vFrmE,\ @wFrmE,@opt_FrmE,@mixchangeFrmE,@mixvarFrmE,@mixvFrmE,@mvarFrmE,@iftFrmE,\ @premixFrmE,mark) endif if @version>100 && @choiceE==13 z = Option13(z,@mnxE,@mnyE,@ManokE,@keuzeRE,@keuzeIE,@fctE,@wahlxE,@shiftx1E,\ @shiftx2E,@wahlyE,@shifty1E,@shifty2E,@m5E,mark) endif if @juliaE, z = z*c, else, z = z+c, endif endif if ConditionE(condE,counter,nE1,nE2) if @altE==false, if @choiceE<13 z = Fractal(z,@choiceE,@fE,@pwE,@mixE,@fctE,@aaE,@bbE,@subtalE,@subkmE,@uFrmE,@vFrmE,\ @wFrmE,@opt_FrmE,@mixchangeFrmE,@mixvarFrmE,@mixvFrmE,@mvarFrmE,@iftFrmE,\ @premixFrmE,mark) endif if @version>100 && @choiceE==13 z = Option13(z,@mnxE,@mnyE,@ManokE,@keuzeRE,@keuzeIE,@fctE,@wahlxE,@shiftx1E,\ @shiftx2E,@wahlyE,@shifty1E,@shifty2E,@m5E,mark) endif endif z = CalculateBackToOne(z,@btoE,@vectE,@vector_E1) else if @vectE, z = z + @vector_E2, endif endif if @altE==false if @juliaE, z = z*c, else, z = z+c, endif endif endif ; I ; II if @mode==3, zp = z, z = zq, endif if @mode==0 || @mode>1 z = abs(z) mark = 2 if @altF if @choiceE<13 z = Fractal(z,@choiceF,@fF,@pwF,@mixF,@fctF,@aaF,@bbF,@subtalF,@subkmF,@uFrmF,@vFrmF,\ @wFrmF,@opt_FrmF,@mixchangeFrmF,@mixvarFrmF,@mixvFrmF,@mvarFrmF,@iftFrmF,\ @premixFrmF,mark) endif if @version>100 && @choiceF==13 z = Option13(z,@mnxF,@mnyF,@ManokF,@keuzeRF,@keuzeIF,@fctF,@wahlxF,@shiftx1F,@shiftx2F,\ @wahlyF,@shifty1F,@shifty2F,@m5F,mark) endif if @juliaF, z = z*c, else, z = z+c, endif endif if ConditionF(condF,counter,nF1,nF2) if @altF==false if @choiceF<13 z = Fractal(z,@choiceF,@fF,@pwF,@mixF,@fctF,@aaF,@bbF,@subtalF,@subkmF,@uFrmF,@vFrmF,\ @wFrmF,@opt_FrmF,@mixchangeFrmF,@mixvarFrmF,@mixvFrmF,@mvarFrmF,@iftFrmF,\ @premixFrmF,mark) endif if @version>100 && @choiceF==13 z = Option13(z,@mnxF,@mnyF,@ManokF,@keuzeRF,@keuzeIF,@fctF,@wahlxF,@shiftx1F,@shiftx2F,\ @wahlyF,@shifty1F,@shifty2F,@m5F,mark) endif endif z = CalculateBackToOne(z,@btoF,@vectF,@vector_F1) else if @vectF, z = z + @vector_F2, endif endif if @altF==false if @juliaF, z = z*c, else, z = z+c, endif endif endif if @mode==3 zq = z if (@opt_par==9 || @opt_par==10 || @opt_par==23) zp = @fnparmixvar1(zp) zq = @fnparmixvar2(zq) endif z = FormulaMix(zp,zq,@upar,@vpar,@wpar,@opt_par,@mixchangepar,@mixvarpar,\ @mixvpar,@mvarpar,@iftpar,@premixpar) endif if @var && counter==m counter=0 endif if @ct colorfree1 = ColorIterSelection(@precoloption1,iter,@transit1,@transit1_LO,@transit1_HI) if @trans1>0 && colorfree1==true zres = z ; reserv for 2nd precoloring parallel z = PreColoring(z,@trans1,@colshift1,@joker1,@jp1,@cf11,@cf12,@cg1,@pwc1,@pwd1,\ gsfmm1,@gsfa1,@gsfb1,@gsfn11,@gsfn12,@gsfn13,@gsfrf1,@gsfh1,@rose1,\ @moeba1,@moebb1,@moebc1,@moebd1) endif endif if @colser==false, zparres = z, endif if (@ct && @ct2) colorfree2 = ColorIterSelection(@precoloption2,iter,@transit2,@transit2_LO,@transit2_HI) if @trans2>0 && colorfree2==true if @colser==false zparres = z; reserving the first transformed z if @opt_col>0, z = zres, endif endif z = PreColoring(z,@trans2,@colshift2,@joker2,@jp2,@cf21,@cf22,@cg2,@pwc2,@pwd2,\ gsfmm2,@gsfa2,@gsfb2,@gsfn21,@gsfn22,@gsfn23,@gsfrf2,@gsfh2,@rose2,\ @moeba2,@moebb2,@moebc2,@moebd2) endif endif ; combinatie van takken z en zres if @ct==true && @ct2==true && @trans2>0 && @colser==false; parallel if (@opt_col==9 || @opt_col==10 || @opt_col==23) z = @fncolopt1(z) zparres = @fncolopt2(zparres) endif z = FormulaMix(z,zparres,@ucol,@vcol,@wcol,@opt_col,@mixchangeCol,@mixvarCol,@mixvCol,@mvarCol,@iftCol,@premixCol) endif ; gielis color transformation if @gt, z = ColorTransformation22(z,gsfmm,@gsfa,@gsfb,@gsfn1,@gsfn2,@gsfn3,@gsfrf,@gsfh,@rose), endif ; moebius color transformation if @moebtr, z = ColorTransformation23(z,@moeba,@moebb,@moebc,@moebd), endif bailout: |z| < @bailout default: title = "Lucky M" param Version, caption = "Formula Version", default = 101, visible = false, endparam center = (0.0,0.0) magn = 0.25 int param bailout, caption = "bailout", default = 100000, endparam complex param start, caption = "start", default = (0.0,0.0), endparam bool param var, caption = "variant", default = false, endparam bool param dev, caption = "first-second separated", default = false visible = @mode==0 || @mode==3, endparam param mode, caption = "mode", default = 0, enum = "series" "only first code active" "only second code active" "parallel" endparam ;------------------------------------ ; first code heading, caption = "first code", visible = (@mode<2 || @mode==3), endheading param choiceE, caption = "choice", default = 0 enum = "asinh" "log" "Talis" "general function" "mix asinh&fn" "mix log&fn" \ "mix Talis&fn" "mix fn&gn" "fn(gn)" "fn+gn" "fn*gn" "fn/gn" "fn&gn extended" \ "Malinovsky" visible = (@mode<2 || @mode==3), endparam param subtalE, caption = "Talis option" default = 0 enum = "Talis original" "variant 1" "variant 2" "variant 3" "Ducktalis" visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) endparam param condE, caption = "main condition", default = 0 enum = "below" "equal" "between" "above or equal" "not equal" "outside" visible = (@mode<2 || @mode==3), endparam int param nE1, caption = "primary #lo", default = 2 visible = (@mode<2 || @mode==3), endparam int param nE2, caption = "primary #hi", default = 3 visible = (@mode<2 || @mode==3) && (@condE==2 || @condE==5), endparam heading, caption = "Talis" visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6), endheading func fnaE, caption = "Talis function", default = ident() visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) && @subtalE>2 endfunc func fnbE, caption = "variation function", default = ident() visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) && @subtalE==4 endfunc complex param pwE, caption = "Talis parameter", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) endparam float param fE, caption = "variation parameter", default = 1.0 visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6) endparam heading, visible = (@mode<2 || @mode==3) && (@choiceE==2 || @choiceE==6), endheading func fnE1, caption = "main function", default = asinh(), visible = (@mode<2 || @mode==3) && (@choiceE>2 && @choiceE<13), endfunc func fnE2, caption = "second function", default = ident() visible = (@mode<2 || @mode==3) && (@choiceE>6 && @choiceE<13), endfunc complex param fctE, caption = "factor", default = (1.0,0.0) visible = (@mode<2 || @mode==3), endparam int param mixE, caption = "% mixing", default = 50 visible = (@mode<2 || @mode==3) && (@choiceE>3 && @choiceE<8), endparam complex param aaE, caption = "a", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && (@choiceE>7 && @choiceE<12), endparam complex param bbE, caption = "b", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && (@choiceE>7 && @choiceE<12), endparam param ManokE, caption = "Malinovsky option" enum = "original" "syntopia variant" "variant 2" "variant 3" \ "variant 4" "variant 5" visible = (@mode<2 || @mode==3) && @choiceE==13, endparam complex param m5E, caption = "variant 5 scaling", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && @choiceE==13 && @ManokE==5, endparam float param mnxE, caption = "scaling real", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @ManokE<2 endparam float param mnyE, caption = "scaling imag", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @ManokE<2 endparam func fnmnE, caption = "Manok function", default = ident() visible = (@mode<2 || @mode==3) && @choiceE==13, endfunc param keuzeRE, caption = "Manok sub funct.x" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13, endparam param keuzeIE, caption = "Manok sub funct.y" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13, endparam param wahlxE, caption = "x-shift option" enum = "0" "1" "2", default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @keuzeIE<18, endparam float param shiftx1E, caption = "x-shift", default = 2.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlxE==1, endparam float param shiftx2E, caption = "x-shift", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlxE==2, endparam param wahlyE, caption = "y-shift option" enum = "0" "1" "2", default = 0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @keuzeIE<18, endparam float param shifty1E, caption = "y-shift", default = 2.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlyE==1, endparam float param shifty2E, caption = "y-shift", default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==13 && @wahlyE==2, endparam param subkmE, caption = "variant", default = 0, enum = "0" "1" "2" visible = (@mode<2 || @mode==3) && (@choiceE==10 || @choiceE==11), endparam bool param btoE, caption = "rotate back", default = false visible = (@mode<2 || @mode==3), endparam bool param altE, caption = "alternative" visible = (@mode<2 || @mode==3), endparam bool param juliaE, caption = "c plus or times?", default = false visible = (@mode<2 || @mode==3), endparam bool param vectE, caption = "vectors?", default = false visible = @version==100 && (@mode<2 || @mode==3), endparam complex param vector_E1, caption = "upper vector 1", default = (0.0,0.0) visible = @vectE==true && (@mode<2 || @mode==3), endparam complex param vector_E2, caption = "upper vector 2", default = (0.0,0.0) visible = (@mode<2 || @mode==3) && @vectE==true, endparam param opt_FrmE, caption = "function combination" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "arithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = (@mode<2 || @mode==3) && @choiceE==12 endparam bool param premixFrmE, caption = "preps before func. mixing" default = false visible = (@mode<2 || @mode==3) && @choiceE==12 endparam bool param mixchangeFrmE,caption = "the other func.branch? (toggle)" default = false visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam complex param mixvFrmE, caption = "total func.scaling" default = (1.0,0.0) visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam float param iftFrmE, caption = "func.imag scaling" default = 1.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam bool param mixvarFrmE, caption = "func.mix variant" default = false visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true endparam complex param mvarFrmE, caption = "func. const.'1'", default = (1.0,0.0) visible = (@mode<2 || @mode==3) && @choiceE==12 && @premixFrmE==true && @mixvarFrmE==true endparam func fnFrmE1, caption = "fn.1 function" default = ident() visible = (@mode<2 || @mode==3) && (@opt_FrmE==9 || @opt_FrmE==10 || @opt_FrmE==23) endfunc func fnFrmE2, caption = "fn.2 function" default = ident() visible = (@mode<2 || @mode==3) && (@opt_FrmE==9 || @opt_FrmE==10 || @opt_FrmE==23) endfunc float param uFrmE, caption = "func.comb.1 (%)" default = 50.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && (@opt_FrmE==0 || @opt_FrmE==6 || \ (@opt_col>15 && @opt_col<19) || @opt_col>19) endparam float param vFrmE, caption = "func.comb.2" default = 200.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && (@opt_FrmE==11 || @opt_FrmE==12 || \ @opt_col==19 || @opt_col>23) endparam float param wFrmE, caption = "func.comb.3" default = 200.0 visible = (@mode<2 || @mode==3) && @choiceE==12 && (@opt_FrmE==19 || @opt_FrmE==27) endparam ; second code heading, caption = "second code", visible = (@mode==0 || @mode>1), endheading param choiceF, caption = "choice", default = 0 enum = "asinh" "log" "Talis" "general function" "mix asinh&fn" "mix log&fn" \ "mix Talis&fn" "mix fn&gn" "fn(gn)" "fn+gn" "fn*gn" "fn/gn" "fn&gn extended" \ "Malinovsky" visible = (@mode==0 || @mode>1), endparam param subtalF, caption = "Talis option" default = 0 enum = "Talis original" "variant 1" "variant 2" "variant 3" "Duckytalis" visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) endparam param condF, caption = "main condition", default = 0 enum = "above or equal" "not equal" "outside" "below" "equal" "between" visible = ((@mode==0 || @mode==3) && @dev==true) || @mode==2, endparam int param nF1, caption = "primary #lo", default = 2 visible = ((@mode==0 || @mode==3) && @dev==true) || @mode==2, endparam int param nF2, caption = "primary #hi", default = 3 visible = (((@mode==0 || @mode==3) && @dev==true) || @mode==2) && (@condF==2 || @condF==5) endparam heading, caption = "Talis" visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6), endheading func fnaF, caption = "Talis function", default = ident() visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) && @subtalF>2 endfunc func fnbF, caption = "variation function", default = ident() visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) && @subtalF==4 endfunc complex param pwF, caption = "Talis parameter", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6) endparam float param fF, caption = "variation parameter", default = 1.0 visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6 || \ (@choiceF==13 && @subtalF>0)) endparam heading, visible = (@mode==0 || @mode>1) && (@choiceF==2 || @choiceF==6), endheading func fnF1, caption = "main function", default = asinh(), visible = (@mode==0 || @mode>1) && (@choiceF>2 && @choiceF<13), endfunc func fnF2, caption = "second function", default = ident() visible = (@mode==0 || @mode>1) && (@choiceF>6 && @choiceF<13), endfunc complex param fctF, caption = "factor", default = (1.0,0.0) visible = (@mode==0 || @mode>1), endparam int param mixF, caption = "% mixing", default = 50 visible = (@mode==0 || @mode>1) && (@choiceF>3 && @choiceF<8), endparam complex param aaF, caption = "a", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && (@choiceF>7 && @choiceF<12), endparam complex param bbF, caption = "b", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && (@choiceF>7 && @choiceF<12), endparam param ManokF, caption = "Malinovsky option" enum = "original" "syntopia variant" "variant 2" "variant 3" \ "variant 4" "variant 5" visible = (@mode==0 || @mode>1) && @choiceF==13, endparam complex param m5F, caption = "variant 5 scaling", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && @choiceF==13 && @ManokF==5, endparam float param mnxF, caption = "scaling real", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceE==13, endparam float param mnyF, caption = "scaling imag", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceE==13, endparam func fnmnF, caption = "Manok function", default = ident() visible = (@mode==0 || @mode>1) && @choiceF==13, endfunc param keuzeRF, caption = "Manok sub funct.x" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam param keuzeIF, caption = "Manok sub funct.y" enum = "ident" "sin" "sinh" "asinh" "cos" "cosh" "tan" "atan" "tanh" \ "atanh" "cotan" "cotanh" "sqr" "sqrt" "log" "exp" "recip" "cos2" \ "asin" "acos" "acosh" default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam param wahlxF, caption = "x-shift option" enum = "0" "1" "2", default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam float param shiftx1F, caption = "x-shift", default = 2.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlxF==2, endparam float param shiftx2F, caption = "x-shift", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlxF==1, endparam param wahlyF, caption = "y-shift option" enum = "0" "1" "2", default = 0 visible = (@mode==0 || @mode>1) && @choiceF==13, endparam float param shifty1F, caption = "y-shift", default = 2.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlyF==2, endparam float param shifty2F, caption = "y-shift", default = 1.0 visible = (@mode==0 || @mode>1) && @choiceF==13 && @wahlyF==1, endparam param subkmF, caption = "variant", default = 0, enum = "0" "1" "2" visible = (@mode==0 || @mode>1) && (@choiceF==10 || @choiceF==11), endparam bool param btoF, caption = "rotate back", default = false visible = (@mode==0 || @mode>1), endparam bool param altF, caption = "alternative" visible = (@mode==0 || @mode>1), endparam bool param juliaF, caption = "c plus or times?", default = false visible = (@mode==0 || @mode>1), endparam bool param vectF, caption = "vectors?", default = false visible = (@mode==0 || @mode>1), endparam complex param vector_F1, caption = "upper vector 1", default = (0.0,0.0) visible = @vectF==true && (@mode==0 || @mode>1), endparam complex param vector_F2, caption = "upper vector 2", default = (0.0,0.0) visible = (@mode==0 || @mode>1) && @vectF==true, endparam param opt_FrmF, caption = "function combination" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "arithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = (@mode==0 || @mode>1) && @choiceF==12 endparam bool param premixFrmF, caption = "preps before func.mixing" default = false visible = (@mode==0 || @mode>1) && @choiceF==12 endparam bool param mixchangeFrmF,caption = "the other func. branch? (toggle)" default = false visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam complex param mixvFrmF, caption = "total func.scaling" default = (1.0,0.0) visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam float param iftFrmF, caption = "func.imag scaling" default = 1.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam bool param mixvarFrmF, caption = "func.mix variant" default = false visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true endparam complex param mvarFrmF, caption = "func.const.'1'", default = (1.0,0.0) visible = (@mode==0 || @mode>1) && @choiceF==12 && @premixFrmF==true && @mixvarFrmF==true endparam func fnFrmF1, caption = "fn.1 function" default = ident() visible = (@mode==0 || @mode>1) && (@opt_FrmF==9 || @opt_FrmF==10 || @opt_FrmF==23) endfunc func fnFrmF2, caption = "fn.2 function" default = ident() visible = (@mode==0 || @mode>1) && (@opt_FrmF==9 || @opt_FrmF==10 || @opt_FrmF==23) endfunc float param uFrmF, caption = "func.comb.1 (%)" default = 50.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && (@opt_FrmF==0 || @opt_FrmF==6 || \ (@opt_col>15 && @opt_col<19) || @opt_col>19) endparam float param vFrmF, caption = "func.comb.2" default = 200.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && (@opt_FrmF==11 || @opt_FrmF==12 || \ @opt_col==19 || @opt_col>23) endparam float param wFrmF, caption = "func.comb.3" default = 200.0 visible = (@mode==0 || @mode>1) && @choiceF==12 && (@opt_FrmF==19 || @opt_FrmF==27) endparam ;----------------------------------- ; mode: parallel heading, caption = "branches parallel", visible = @mode==3, endheading param opt_par, caption = "mixing 2 branches" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "logarithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = @mode==3 endparam bool param premixpar, caption = "preparations before branches mixing" default = false visible = @mode==3 endparam bool param mixchangepar, caption = "the other branch? (toggle)" default = false visible = @mode==3 && @premixpar==true endparam float param mixvpar, caption = "branch scaling" default = 1.0 visible = @mode==3 && @premixpar==true endparam float param iftpar, caption = "imag scaling" default = 1.0 visible = @mode==3 && @premixpar==true endparam bool param mixvarpar, caption = "branch vector?" default = false visible = @mode==3 && @premixpar==true endparam complex param mvarpar, caption = "const.'1'" default = (1.0,0.0) visible = @mode==3 && @premixpar==true && @mixvarpar==true endparam func fnparmixvar1, caption = "fn.1 mix br.mean" default = ident() visible = @mode==3 && (@opt_par==9 || @opt_par==10 || @opt_par==23) endfunc func fnparmixvar2, caption = "fn.2 mix br.mean" default = ident() visible = @mode==3 && (@opt_par==9 || @opt_par==10 || @opt_par==23) endfunc float param upar, caption = "br. mix param. 1" default = 50.0 visible = @mode==3 && (@opt_par==0 || @opt_par==6 || (@opt_par>15 && @opt_par<19) || @opt_par>19) endparam float param vpar, caption = "br.mix param. 2" default = 200.0 visible = @mode==3 && (@opt_par==11 || @opt_par==12 || @opt_par==19 || @opt_par>21) endparam float param wpar, caption = "br. mix param. 3" default = 200.0 visible = @mode==3 && (@opt_par==19 || @opt_par==27) endparam ;----------------------------------- int param m, caption = "#end", default = 5 visible = @var==true, endparam ;----------------------------------- ; precoloring heading, caption = "precoloring", endheading bool param ct, caption = "(1st) precoloring" default = false endparam bool param ct2, caption = "2nd precoloring" default = false visible = @ct==true endparam bool param colser, caption = "precol. in series" default = false visible = @ct==true && @ct2==true endparam bool param gt, caption = "gielis transformation" default = false endparam bool param moebtr, caption = "möbius transformation" default = false, endparam ; I heading, caption = "precoloring #1" visible = @ct==true endheading param precoloption1, caption = "precol. #1 if" default = 0 visible = @ct==true enum = "all" "below" "above" "only 1" "between" "outside" "only 2" endparam int param transit1, caption = "precol. #1 iteration" default = 20 visible = @ct==true && @trans1>0 && @precoloption1>0 && @precoloption1<4 endparam int param transit1_LO, caption = "precol. #1 LO" default = 10 visible = @ct==true && @trans1>0 && @precoloption1>3 endparam int param transit1_HI, caption = "precol. #1 HI" default = 20 visible = @ct==true && @trans1>0 && @precoloption1>3 endparam param trans1, caption = "precol. #1 options" default = 0 enum = "normal" \ "sin-sin | cos-sin" \ "sin+sin | cos+sin" \ "sin*sin | cos*sin" \ "cos-sin | cos-sin" \ "cos+sin | cos+sin" \ "atan" \ "atan1" \ "sin & recip" \ "sine stalks 2" \ "log stalks 1" \ "sine vibration 1" \ "sine vibration 2" \ "sine vibration 3" \ "cosine vibration 1" \ "cosine vibration 2" \ "cosine vibration 3" \ "tangens vibration" \ "sin+cos" \ "sin*cos" \ "tg/(sin&cos)" \ "tg/(sin&cos) 2" \ "gielis" \ "möbius" visible = @ct==true endparam bool param joker1, caption = "joker" default = false visible = @ct==true && ((@trans1>0 && @trans1<13) || \ (@trans1>13 && @trans1<16) || (@trans1>16 && @trans1<22)) endparam bool param jp1, caption = "joker plus" default = false visible = @ct==true && (@trans1==6 || @trans1==8 || \ @trans1==9 || @trans1==10 || @trans1==21) endparam complex param colshift1, caption = "color#1 shift" visible = @ct==true && (@trans1>0 && @trans1<22) endparam float param pwc1, caption = "precol.#1 variation" default = 0.5 visible = @ct==true && \ ((@trans1==6 && @jp1==true) ||\ (@trans1==8 && @jp1==true) ||\ (@trans1==9 && @jp1==true) ||\ (@trans1==10 && @jp1==true) ||\ (@trans1==12 && @joker1==true) ||\ @trans1==13 || \ (@trans1==15 && @joker1==true) ||\ @trans1==16 || \ (@trans1==17 && @joker1==true) ||\ (@trans1==18 && @joker1==true) ||\ (@trans1==19 && @joker1==true) ||\ @trans1==20 ||\ @trans1==21) endparam float param pwd1, caption = "prec.#1 sec.var." default = 1.0 visible = @ct==true && ((@trans1>14 && @trans1<21) || (@trans1==21 && @jp1==false)) endparam complex param cf11, caption = "prec.#1 coëff.1" default = (1.0,1.0) visible = @ct==true && ((@trans1>0 && @trans1<11) || \ (@trans1>13 && @trans1<19) || @trans1==20 || @trans1==21) endparam complex param cf12, caption = "prec.#1 coëff.2" default = (1.0,1.0) visible = @ct==true && ((@trans1>0 && @trans1<11) || \ @trans1==17 || @trans1==20 || @trans1==21) endparam complex param cg1, caption = "prec.#1 coëff.3" default = 1.0 visible = @ct==true && ((@trans1>10 && @trans1<14) || @trans1==19) endparam bool param gsfh1, caption = "hyperbolic" default = false visible = @ct==true && @trans1==22 endparam bool param rose1, caption = "rose" default = false visible = @ct==true && @trans1==22 endparam float param gsfd1, caption = "gielis param m" default = 4.0 visible = @ct==true && @trans1==22 endparam float param gsfa1, caption = "gielis param a" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfb1, caption = "gielis param b" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfn11, caption = "gielis param n1" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfn12, caption = "gielis param n2" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfn13, caption = "gielis param n3" default = 2.0 visible = @ct==true && @trans1==22 endparam float param gsfrf1, caption = "rose parameter" default = 1.0 visible = @ct==true && @rose1 && @trans1==22 endparam complex param moeba1, caption = "möb.param.a" default = (1.0,0.0) visible = @ct==true && @trans1==23 endparam complex param moebb1, caption = "möb.param.b" default = (0.0,0.0) visible = @ct==true && @trans1==23 endparam complex param moebc1, caption = "möb.param.c" default = (1.0,0.0) visible = @ct==true && @trans1==23 endparam complex param moebd1, caption = "möb.param.d" default = (0.0,0.0) visible = @ct==true && @trans1==23 endparam ; II heading, caption = "precoloring #2" visible = @ct==true && @ct2==true endheading param precoloption2, caption = "precol. #2 if:" default = 0 visible = @ct==true && @ct2==true enum = "all" "below" "above" "only 1" "between" "outside" "only 2" endparam int param transit2, caption = "precol. #2 iteration" default = 20 visible = @ct==true && @ct2==true && @trans2>0 && @precoloption2>0 && @precoloption2<4 endparam int param transit2_LO, caption = "precol. #2 LO" default = 10 visible = @ct==true && @ct2==true && @trans2>0 && @precoloption2>3 endparam int param transit2_HI, caption = "precol. #2 HI" default = 20 visible = @ct==true && @ct2==true && @trans2>0 && @precoloption2>3 endparam param trans2, caption = "precol. #2 options" default = 0 enum = "normal" \ "sin-sin | cos-sin" \ "sin+sin | cos+sin" \ "sin*sin | cos*sin" \ "cos-sin | cos-sin" \ "cos+sin | cos+sin" \ "atan" \ "atan1" \ "sin & recip" \ "sine stalks 2" \ "log stalks 1" \ "sine vibration 1" \ "sine vibration 2" \ "sine vibration 3" \ "cosine vibration 1" \ "cosine vibration 2" \ "cosine vibration 3" \ "tangens vibration" \ "sin+cos" \ "sin*cos" \ "tg/(sin&cos)" \ "tg/(sin&cos) 2" \ "gielis" \ "möbius" visible = @ct==true && @ct2==true endparam bool param joker2, caption = "joker" default = false visible = @ct==true && @ct2==true && ((@trans2>0 && @trans2<13) || \ (@trans2>13 && @trans2<16) || (@trans2>16 && @trans2<22)) endparam bool param jp2, caption = "joker plus" visible = @ct==true && @ct2==true && (@trans2==6 || @trans2==8 || \ @trans2==9 || @trans2==10 || @trans2==21) endparam complex param colshift2, caption = "precol.#2 shift" visible = @ct==true && @ct2==true && (@trans2>0 && @trans2<22) endparam float param pwc2, caption = "precol.#2 variation" default = 0.5 visible = @ct==true && @ct2==true && \ ((@trans2==6 && @jp2==true) ||\ (@trans2==8 && @jp2==true) ||\ (@trans2==9 && @jp2==true) ||\ (@trans2==10 && @jp2==true) ||\ (@trans2==12 && @joker2==true) ||\ @trans2==13 || \ (@trans2==15 && @joker2==true) ||\ @trans2==16 || \ (@trans2==17 && @joker2==true) ||\ (@trans2==18 && @joker2==true) ||\ (@trans2==19 && @joker2==true) ||\ @trans2==20 ||\ @trans2==21) endparam float param pwd2, caption = "prec.#2 sec.var." default = 1.0 visible = @ct==true && @ct2==true && ((@trans2>14 && @trans2<21) || \ (@trans2==21 && @jp1==false)) endparam complex param cf21, caption = "prec.#2 coëff.1" default = (1.0,1.0) visible = @ct==true && @ct2==true && ((@trans2>0 && @trans2<11) || \ (@trans2>13 && @trans2<19) || @trans2==20 || @trans2==21) endparam complex param cf22, caption = "prec.#2 coëff.2" default = (1.0,1.0) visible = @ct==true && @ct2==true && ((@trans2>0 && @trans2<11) || \ @trans2==17 || @trans2==20 || @trans2==21) endparam complex param cg2, caption = "prec.#2 coëff.3" default = 1.0 visible = @ct==true && @ct2==true && ((@trans2>10 && @trans2<14) || @trans2==19) endparam bool param gsfh2, caption = "hyperbolic" default = false visible = @ct==true && @ct2==true && @trans2==22 endparam bool param rose2, caption = "rose" default = false visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfd2, caption = "gielis param m" default = 4.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfa2, caption = "gielis param a" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfb2, caption = "gielis param b" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfn21, caption = "gielis param n1" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfn22, caption = "gielis param n2" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfn23, caption = "gielis param n3" default = 2.0 visible = @ct==true && @ct2==true && @trans2==22 endparam float param gsfrf2, caption = "rose parameter" default = 1.0 visible = @ct==true && @ct2==true && @rose2 && @trans2==22 endparam complex param moeba2, caption = "möb.param.a" default = (1.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam complex param moebb2, caption = "möb.param.b" default = (0.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam complex param moebc2, caption = "möb.param.c" default = (1.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam complex param moebd2, caption = "möb.param.d" default = (0.0,0.0) visible = @ct==true && @ct2==true && @trans2==23 endparam ; combination parameters coloring heading, caption = "color combination" visible = @ct==true && @ct2==true && @trans2>0 && @colser==false endheading param opt_col, caption = "color combination" default = 0 enum = "spicy" \ "arithmetic mean" \ "geometric mean" \ "harmonic mean" \ "quadratic mean" \ "cubic mean" \ "generalized mean" \ "contrahatmonic mean" \ "logarithmic mean" \ "arithm. function mean" \ "geom. function mean" \ "general power mean" \ "Lehmer mean" \ "Heronian mean" \ "geom. harmonic 1" \ "geom. harmonic 2" \ "Heinz mean" \ "power mean" \ "linear variant" \ "geometric variant" \ "harmonic variant" \ "contraharmonic variant" \ "logarithmic variant" \ "function variant" \ "power variant" \ "generalized variant" \ "Lehmer variant" \ "product" visible = @ct==true && @ct2==true && @colser==false && @trans2>0 endparam bool param premixCol, caption = "preparations before mixing" default = false visible = @ct==true && @ct2==true && @colser==false && @trans2>0 endparam bool param mixchangeCol, caption = "the other branch? (toggle)" default = false visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam complex param mixvCol, caption = "total scaling" default = (1.0,0.0) visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam float param iftCol, caption = "imag scaling" default = 1.0 visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam bool param mixvarCol, caption = "mix variant" default = false visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true endparam complex param mvarCol, caption = "const.'1'", default = (1.0,0.0) visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && @premixCol==true && @mixvarCol==true endparam func fncolopt1, caption = "fn.1 color mean" default = ident() visible = @ct==true && @ct2==true && @colser==false && (@trans2>0 && (@opt_col==9 || @opt_col==10 || @opt_col==23)) endfunc func fncolopt2, caption = "fn.2 color mean" default = ident() visible = @ct==true && @ct2==true && @colser==false && (@trans2>0 && (@opt_col==9 || @opt_col==10 || @opt_col==23)) endfunc float param ucol, caption = "color param.1" default = 50.0 visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && (@opt_col==0 || @opt_col==6 || \ (@opt_col>15 && @opt_col<19) || @opt_col>19) endparam float param vcol, caption = "color param.2" default = 200.0 visible = @ct==true && @ct2==true && @colser==false && (@trans2>0 && (@opt_col==11 || @opt_col==12 || \ @opt_col==19 || @opt_col>23)) endparam float param wcol, caption = "color param.3" default = 200.0 visible = @ct==true && @ct2==true && @colser==false && @trans2>0 && (@opt_col==19 || @opt_col==27) endparam ; end color transformations 1&2 heading, caption = "Gielis color transformation." visible = @gt==true endheading bool param gsfh, caption = "hyperbolic" default = false visible = @gt==true endparam bool param rose, caption = "rose" default = false visible = @gt==true, endparam float param gsfd, caption = "gielis param m" default = 4.0 visible = @gt==true endparam float param gsfa, caption = "gielis param a" default = 2.0 visible = @gt==true endparam float param gsfb, caption = "gielis param b" default = 2.0 visible = @gt==true endparam float param gsfn1, caption = "gielis param n1" default = 2.0 visible = @gt==true endparam float param gsfn2, caption = "gielis param n2" default = 2.0 visible = @gt==true endparam float param gsfn3, caption = "gielis param n3" default = 2.0 visible = @gt==true endparam float param gsfrf, caption = "rose parameter" default = 1.0 visible = @gt==true && @rose==true endparam heading, caption = "Möbius color transformation." visible = @moebtr==true endheading complex param moeba, caption = "möbius a" default = (1.0,0.0) visible = @moebtr==true endparam complex param moebb, caption = "möbius b" default = (0.0,0.0) visible = @moebtr==true endparam complex param moebc, caption = "möbius c" default = (1.0,0.0) visible = @moebtr==true endparam complex param moebd, caption = "möbius d" default = (1.0,0.0) visible = @moebtr==true endparam switch: type = "Lucky_J", version = version, seed = #pixel bailout = bailout, var = var, dev = dev, mode = mode opt_par = opt_par, premixpar = premixpar, mixchangepar = mixchangepar, iftpar = iftpar mixvarpar = mixvarpar, mvarpar = mvarpar, mvpar = mvpar fnparmixvar1 = fnparmixvar1, fnparmixvar2 = fnparmixvar2, upar = upar, vpar = vpar, wpar = wpar choiceE = choiceE, fnE1 = fnE1, aaE = aaE, bbE = bbE, mixE = mixE condE = condE, nE1 = nE1, nE2 = nE2, btoE = btoE, altE = altE vectE = vectE, vector_E1 = vector_E1, vector_E2 = vector_E2, fnaE = fnaE, fnbE = fnbE, pwE = pwE, fE = fE, fnE2 = fnE2 fctE = fctE, juliaE = juliaE, uFrmE = uFrmE, vFrmE = vFrmE, wFrmE = wFrmE opt_FrmE = opt_FrmE, changeFrmE = changeFrmE, mixvarFrmE = mixvarFrmE, mixvFrmE = mixvFrmE mvarFrmE = mvarFrmE, iftFrmE = iftFrmE, premixFrmE = premixFrmE, fnFrmE1 = fnFrmE1 fnFrmE2 = fnFrmE2, subtalE = subtalE, ManokE = ManokE, mnxE = mnxE mnyE = mnyE, keuzeRE = keuzeRE, keuzeIE = keuzeIE, fnmnE = fnmnE m5E = m5E, wahlxE = wahlxE, shiftx1E = shiftx1E, shiftx2E = shiftx2E wahlyE = wahlyE, shifty1E = shifty1E, shifty2E = shifty2E choiceF = choiceF, fnF1 = fnF1, aaF = aaF, bbF = bbF, mixF = mixF condF = condF, nF1 = nF1, nF2 = nF2, btoF = btoF, altF = altF vectF = vectF, vector_F1 = vector_F1, vector_F2 = vector_F2 fnaF = fnaF, fnbF = fnbF, pwF = pwF, fF = fF, fnF2 = fnF2 fctF = fctF, juliaF = juliaF, uFrmF = uFrmF, vFrmF = vFrmF, wFrmF = wFrmF opt_FrmF = opt_FrmF, changeFrmF = changeFrmF, mixvarFrmF = mixvarFrmF, mixvFrmF = mixvFrmF mvarFrmF = mvarFrmF, iftFrmF = iftFrmF, premixFrmF = premixFrmF, fnFrmF1 = fnFrmF1 fnFrmF2 = fnFrmF2, subtalF = subtalF, ManokF = ManokF, mnxF = mnxF mnyF = mnyF, keuzeRF = keuzeRF, keuzeIF = keuzeIF, fnmnF = fnmnF m5F = m5F, wahlxF = wahlxF, shiftx1F = shiftx1F, shiftx2F = shiftx2F wahlyF = wahlyF, shifty1F = shifty1F, shifty2F = shifty2F gt = gt, moebtr = moebtr m = m, ct = ct, ct2 = ct2, colser = colser precoloption1 = precoloption1, transit1 = transit1, transit1_LO = transit1_LO, transit1_HI = transit1_HI trans1 = trans1, joker1 = joker1, jp1 = jp1, colshift1 = colshift1 pwc1 = pwc1, pwd1 = pwd1, cf11 = cf11, cf12 = cf12 cg1 = cg1, gt1 = gt1, moebtr1 = moebtr1 precoloption2 = precoloption2, transit2 = transit2, transit2_LO = transit2_LO, transit2_HI = transit2_HI trans2 = trans2, joker2 = joker2, jp2 = jp2, colshift2 = colshift2 pwc2 = pwc2, pwd2 = pwd2, cf21 = cf21, cf22 = cf22 cg2 = cg2, gt2 = gt2, moebtr2 = moebtr2 opt_col = opt_col, premixCol = premixCol, mixchangeCol = mixchangeCol, iftCol = iftCol mixvarCol = mixvarCol, mvarCol = mvarCol, mvcol = mvcol fncolopt1 = fncolopt1, fncolopt2 = fncolopt2, ucol = ucol, vcol = vcol, wcol = wcol gsfh = gsfh, gsfh1 = gsfh1, gsfh2 = gsfh2 rose = rose, rose1 = rose1, rose2 = rose2 gsfd = gsfd, gsfd1 = gsfd1, gsfd2 = gsfd2 gsfa = gsfa, gsfa1 = gsfa1, gsfa2 = gsfa2 gsfb = gsfb, gsfb1 = gsfb1, gsfb2 = gsfb2 gsfn1 = gsfn1, gsfn11 = gsfn11, gsfn21 = gsfn21 gsfn2 = gsfn2, gsfn12 = gsfn12, gsfn22 = gsfn22 gsfn3 = gsfn3, gsfn13 = gsfn13, gsfn23 = gsfn23 gsfrf = gsfrf, gsfrf1 = gsfrf1, gsfrf2 = gsfrf2 moeba = moeba, moeba1 = moeba1, moeba2 = moeba2 moebb = moebb, moebb1 = moebb1, moebb2 = moebb2 moebc = moebc, moebc1 = moebc1, moebc2 = moebc2 moebd = moebd, moebd1 = moebd1, moebd2 = moebd2 } AnatraLiteM { ; Based on Samuel Monnier's 'Ducks' in sam.ufm ; Many thanks to Sam for allowing to use his code. ; 'Anatre' is the Italian word for 'Duck' ; version 1.01 with more vector/factor options global: float pir=#pi/180 float rota=@rot*pir float twopi=2*#pi init: if @starter, complex z=@start, else, complex z=10^(@start), endif complex c=#pixel ;-------------------------- float arg=0.0 float SecondAngle=@sa*pir float x=0.0 float y=0.0 float temp=0.0 loop: ;0 if @Rot3==0, z=exp(1i*rota)*z, endif ;1 if @FormulaStart==0, z=@FunctionStart(z) elseif @FormulaStart==1, z=@p01+@FunctionStart(z) elseif @FormulaStart==2, z=@p02-@FunctionStart(z) endif if @version==100 if @MandelAlt if @Alt0==0, z=@q0*z+c, elseif @Alt0==1, z=@q0*z*c, endif else if @Alt0==0, z=@q0*z+@p00, elseif @Alt0==1, z=z*@p00, endif endif elseif @version>100 if @MandelAlt if @Alter0==0, z=@q0*z+c, elseif @Alter0==1, z=@q0*z*c elseif @Alter0==2, z=@q0*z/c, elseif @Alter0==3, z=@q0*c/z, endif else if @Alter0==0, z=@q0*z+@p00, elseif @Alter0==1, z=z*@p00 elseif @Alter0==2, z=z/@p00, elseif @Alter0==3, z=@p00/z, endif endif endif ;2 arg = (round((atan2(z)/twopi)*@order)/@order)*twopi ;3 if @Rot3==1, z = z*exp(1i*rota), endif z = z*exp(-1i*arg) ;4 preparation for second formula if @sym==1 || @sym==2, x=real(z), y=imag(z), endif if @sym==1 y=abs(y) elseif @sym==2 x=abs(x) elseif @sym==3 z=abs(z) elseif @sym==4 z=abs(z*exp(1i*SecondAngle)) x=real(z), y=imag(z) if x>=0 && y>=0, temp=x, x=y, y=temp, endif if @turnback, z=z*exp(-1i*SecondAngle), endif endif if @sym==1 || @sym==2, z=x+1i*y, endif ;5 if @FormulaEnd==0, z=@FunctionEnd(z) elseif @FormulaEnd==1, z=@p10+@FunctionEnd(z) elseif @FormulaEnd==2, z=@p11-@FunctionEnd(z) endif z=z^@pow if @version==100 if @MandelAlt if @Alt1==0, z=@q1*(z+@p10)^@pow2, elseif @Alt1==1, z=(z*@p10)^@pow2, endif else if @Alt1==0, z=@q1*(z+c)^@pow2, elseif @Alt1==1, z=@q1*(z*c)^@pow2, endif endif elseif @version>100 if @MandelAlt if @Alter1==0, z=@q1*(z+@p10)^@pow2, elseif @Alter1==1, z=(z*@p10)^@pow2 elseif @Alter1==2, z=(z/@p10)^@pow2, elseif @Alter1==3, z=(@p10/z)^@pow2 endif else if @Alter1==0, z=@q1*(z+c)^@pow2, elseif @Alter1==1, z=@q1*(z*c)^@pow2 elseif @Alter1==2, z=@q1*(z/c)^@pow2, elseif @Alter1==3, z=@q1*(c/z)^@pow2 endif endif endif bailout: true default: title = "Anatra Lite M" int param version, caption = "version", default = 101, visible = false, endparam bool param starter, caption = "linear", default = false, endparam complex param start, caption = "start", default = (6.0,0.0), endparam ;------------------------ bool param MandelAlt, caption = "Mandelbrot alternative", default = false, visible=@version==100, endparam param Rot3, caption = "rotation", enum = "in formula I" "after formula I", default = 0, endparam float param rot, caption = "rotation (°)", default = 0.0, endparam int param order, caption = "order", default = 1, min=1, endparam param sym, caption = "symmetry", default = 1, enum = "none" "north" "east" "NE" "rotating quarter", endparam bool param turnback, caption = "turn back", default = false, visible = @sym==4, endparam float param sa, caption = "second angle", default = 0.0, visible = @sym==4, endparam ;---------------------------- heading, caption = "start formula", endheading param FormulaStart, caption = "Start options", enum = "simple" "var.1" "var.2", default = 0, endparam func FunctionStart, caption = "Start function", default = ident(), endfunc complex param q0, caption = "start factor", visible = !(@MandelAlt==false && @Alt0==1), default = (1.0,0.0), endparam complex param p00, caption = "vector", default = (1e-10,0.0), visible = @MandelAlt==false, endparam complex param p01, caption = "function parameter", default = (0.0,0.0), visible = @FormulaStart==1, endparam complex param p02, caption = "function parameter", default = (1.0,0.0), visible = @FormulaStart==2, endparam param Alt0, caption="J-vector <-> factor", enum = "vector" "factor", default=0, visible=@version==100, endparam param Alter0, caption="Juliavector or factor", enum="vector" "factor" "quotient" "rev.quotient", default=0, visible=@version>100, endparam ;---------------------------- heading, caption = "end formula", endheading param FormulaEnd, caption = "End options", enum = "simple" "var.1" "var.2", default = 0, endparam func FunctionEnd, caption = "End function", default = log(), endfunc complex param q1, caption = "end factor", visible = !(@MandelAlt && @Alt1==1), default = (1.0,0.0), endparam complex param p10, caption = "vector", default = (1e-10,0.0), visible = @MandelAlt==true, endparam complex param p11, caption = "function parameter", default = (0.0,0.0), visible = @FormulaEnd==1, endparam complex param p12, caption = "function parameter", default = (1.0,0.0), visible = @FormulaEnd==2, endparam param pow, caption = "First power", default = 1.0, endparam param pow2, caption = "Second power", default = 1.0, endparam param Alt1, caption="J-vector <-> factor", enum="vector" "factor", default=0, visible=@version==100, endparam param Alter1, caption="Juliavector or factor", enum="vector" "factor" "quotient" "rev.quotient", default=0, visible=@version>100, endparam switch: type="AnatraLiteJ", seed=#pixel ;------------------- MandelAlt=MandelAlt, Rot3=Rot3, rot=rot, order=order, sym=sym turnback=turnback, sa=sa, version=version FormulaStart=FormulaStart, FunctionStart=FunctionStart, q0=q0 p00=p00, p01=p01, p02=p02, Alt0=Alt0, Alter0=Alter0 FormulaEnd=FormulaEnd, FunctionEnd=FunctionEnd, q1=q1 p10=p10, p11=p11, p12=p12, Alt1=Alt1, Alter1=Alter1 pow=pow, pow2=pow2 } AnatraLiteJ { ; Based on Samuel Monnier's 'Ducks' in sam.ufm ; Many thanks to Sam for allowing to use his code. ; 'Anatre' is the Italian word for 'Duck' ; version 1.01 with more vector/factor options global: float pir=#pi/180 float rota=@rot*pir float twopi=2*#pi init: complex z=#pixel complex c=@seed ;-------------------------- float arg=0.0 float SecondAngle=@sa*pir float x=0.0 float y=0.0 float temp=0.0 loop: ;0 if @Rot3==0, z=exp(1i*rota)*z, endif ;1 if @FormulaStart==0, z=@FunctionStart(z) elseif @FormulaStart==1, z=@p01+@FunctionStart(z) elseif @FormulaStart==2, z=@p02-@FunctionStart(z) endif if @version==100 if @MandelAlt if @Alt0==0, z=@q0*z+c, elseif @Alt0==1, z=@q0*z*c, endif else if @Alt0==0, z=@q0*z+@p00, elseif @Alt0==1, z=z*@p00, endif endif elseif @version>100 if @MandelAlt if @Alter0==0, z=@q0*z+c, elseif @Alter0==1, z=@q0*z*c elseif @Alter0==2, z=@q0*z/c, elseif @Alter0==3, z=@q0*c/z, endif else if @Alter0==0, z=@q0*z+@p00, elseif @Alter0==1, z=z*@p00 elseif @Alter0==2, z=z/@p00, elseif @Alter0==3, z=@p00/z, endif endif endif ;2 arg = (round((atan2(z)/twopi)*@order)/@order)*twopi ;3 if @Rot3==1, z = z*exp(1i*rota), endif z = z*exp(-1i*arg) ;4 preparation for second formula if @sym==1 || @sym==2, x=real(z), y=imag(z), endif if @sym==1 y=abs(y) elseif @sym==2 x=abs(x) elseif @sym==3 z=abs(z) elseif @sym==4 z=abs(z*exp(1i*SecondAngle)) x=real(z), y=imag(z) if x>=0 && y>=0, temp=x, x=y, y=temp, endif if @turnback, z=z*exp(-1i*SecondAngle), endif endif if @sym==1 || @sym==2, z=x+1i*y, endif ;5 if @FormulaEnd==0, z=@FunctionEnd(z) elseif @FormulaEnd==1, z=@p10+@FunctionEnd(z) elseif @FormulaEnd==2, z=@p11-@FunctionEnd(z) endif z=z^@pow if @version==100 if @MandelAlt if @Alt1==0, z=@q1*(z+@p10)^@pow2, elseif @Alt1==1, z=(z*@p10)^@pow2, endif else if @Alt1==0, z=@q1*(z+c)^@pow2, elseif @Alt1==1, z=@q1*(z*c)^@pow2, endif endif elseif @version>100 if @MandelAlt if @Alter1==0, z=@q1*(z+@p10)^@pow2, elseif @Alter1==1, z=(z*@p10)^@pow2 elseif @Alter1==2, z=(z/@p10)^@pow2, elseif @Alter1==3, z=(@p10/z)^@pow2 endif else if @Alter1==0, z=@q1*(z+c)^@pow2, elseif @Alter1==1, z=@q1*(z*c)^@pow2 elseif @Alter1==2, z=@q1*(z/c)^@pow2, elseif @Alter1==3, z=@q1*(c/z)^@pow2 endif endif endif bailout: true default: title = "Anatra Lite J" int param version, caption="version", default=101, visible=false, endparam bool param starter, caption="linear", default=false, visible=@version==100, endparam complex param seed, caption="start", default=(0.5,0.0), endparam ;------------------------ bool param MandelAlt, caption = "Mandelbrot alternative", default = false, visible=@version==100, endparam param Rot3, caption = "rotation", enum = "in formula I" "after formula I", default = 0, endparam float param rot, caption = "rotation (°)", default = 0.0, endparam int param order, caption = "order", default = 1, min=1, endparam param sym, caption = "symmetry", default = 1, enum = "none" "north" "east" "NE" "rotating quarter", endparam bool param turnback, caption = "turn back", default = false, visible = @sym==4, endparam float param sa, caption = "second angle", default = 0.0, visible = @sym==4, endparam ;---------------------------- heading, caption = "start formula", endheading param FormulaStart, caption = "Start options", enum = "simple" "var.1" "var.2", default = 0, endparam func FunctionStart, caption = "Start function", default = ident(), endfunc complex param q0, caption = "start factor", visible = !(@MandelAlt==false && @Alt0==1), default = (1.0,0.0), endparam complex param p00, caption = "vector", default = (1e-10,0.0), visible = @MandelAlt==false, endparam complex param p01, caption = "function parameter", default = (0.0,0.0), visible = @FormulaStart==1, endparam complex param p02, caption = "function parameter", default = (1.0,0.0), visible = @FormulaStart==2, endparam param Alt0, caption="J-vector <-> factor", enum = "vector" "factor", default=0, visible=@version==100, endparam param Alter0, caption="Juliavector or factor", enum="vector" "factor" "quotient" "rev.quotient", default=0, visible=@version>100, endparam ;---------------------------- heading, caption = "end formula", endheading param FormulaEnd, caption = "End options", enum = "simple" "var.1" "var.2", default = 0, endparam func FunctionEnd, caption = "End function", default = log(), endfunc complex param q1, caption = "end factor", visible = !(@MandelAlt && @Alt1==1), default = (1.0,0.0), endparam complex param p10, caption = "vector", default = (1e-10,0.0), visible = @MandelAlt==true, endparam complex param p11, caption = "function parameter", default = (0.0,0.0), visible = @FormulaEnd==1, endparam complex param p12, caption = "function parameter", default = (1.0,0.0), visible = @FormulaEnd==2, endparam param pow, caption = "First power", default = 1.0, endparam param pow2, caption = "Second power", default = 1.0, endparam param Alt1, caption="J-vector <-> factor", enum="vector" "factor", default=0, visible=@version==100, endparam param Alter1, caption="Juliavector or factor", enum="vector" "factor" "quotient" "rev.quotient", default=0, visible=@version>100, endparam switch: type="AnatraLiteM" ;------------------- MandelAlt=MandelAlt, Rot3=Rot3, rot=rot, order=order, sym=sym turnback=turnback, sa=sa, version=version FormulaStart=FormulaStart, FunctionStart=FunctionStart, q0=q0 p00=p00, p01=p01, p02=p02, Alt0=Alt0, Alter0=Alter0 FormulaEnd=FormulaEnd, FunctionEnd=FunctionEnd, q1=q1 p10=p10, p11=p11, p12=p12, Alt1=Alt1, Alter1=Alter1 pow=pow, pow2=pow2 } LattèsPlusM { ; global: complex zro=(0.0,0.0) complex eps = (1e-15,0.0) init: complex z = @start, complex c = #pixel complex z2=zro, complex z3=zro complex t=zro, complex t1=zro, complex t2=zro complex s=zro complex N=zro, complex D=zro complex num=zro, complex den=zro complex a2=@a*@a, complex k2=@k*@k int iter=0 loop: iter=iter+1 if @prepare==1 && iter==1, z=@fnpf(z), endif if @prepare==2, z=@fnpf(z), endif if @ducky==1, z=abs(z) elseif @ducky==2, z=real(z)+flip(abs(imag(z))) elseif @ducky==3, z=abs(real(z))+flip(imag(z)) endif z2=z*z, z3=z2*z if @frm==0; BOF if @plus==false N=sqr(1+z2) D=z*(z2-1) else N=sqr(@p1+@u1*z2) D=z*(@v1*z2-@q1) endif elseif @frm==1; Monnier a if @plus==false N=sqr(z2-@a) D=4*z*(z-1)*(z-@a) else N=sqr(@u1*z2-@a) D=@v4*z*(@v1*z-@q1)*(@v1*z-@a) endif elseif @frm==2; Monnier b = Milnor p.25-1 if @plus==false N=z+1/z D=2i else N=@u1*z+@p1/z D=@v2*1i endif elseif @frm==3; Monnier c if @plus==false N=z3+@a D=@a*z3+1 else N=@u1*z3+@a D=@a*z3+@q1 endif elseif @frm==4; Milnor [15] (p.20) if @plus==false N=4*z*(1-z)*(1-k2*z) D=sqr(1-k2*z2) else N=@u4*z*(@p1-z)*(@u1-k2*z) D=sqr(@q1-k2*z2) endif elseif @frm==5; Milnor p.24-1 D=a2 if @plus==false N=z+1/z else N=@u1*z+@p1/z endif elseif @frm==6; Milnor p.24-2 if @plus==false N=z*(z+a2) D=a2*z+1 else N=@u1*z*(@u0*z+a2) D=a2*z+@q1 endif elseif @frm==7; Milnor p.24-3 N=@a*z*z if @plus==false D=z*(z+a2) else D=@v1*z*(@v0*z+a2) endif elseif @frm==8; Milnor p.25-2 if @plus==false N=z*sqr(z-@a) D=sqr(@a*z-1) else N=@u1*z*sqr(@u0*z-@a) D=sqr(@a*z-@q1) endif elseif @frm==9; Milnor [16] (p.26-1) if @plus==false N=6*z D=z3-2 else N=@u6*z D=@v1*z3-@q2 endif elseif @frm==10; Milnor p.26-2 if @plus==false N=2-z D=1+z else N=@p2-@u1*z D=@q1+@v1*z endif elseif @frm==11; Milnor [17] p.26-3 if @plus==false N=(6*z)^3 D=(z3-2)^3 else N=(@u6*z)^3 D=(@v1*z3-@q2)^3 endif elseif @frm==12; Milnor p.27-1 if @plus==false N=z3+@a D=@a*z3+1 else N=@u1*z3+@a D=@a*z3+@q1 endif endif if @frm>12 t1=k2*z2, t2=t1*t1 if @plus, t3=k2+@p1, else, t3=k2+1, endif if @plus==false s=z*sqr(t2-6*t1+4*t3*z-3) t=sqr(3*t2-4*k2*t3*z3+6*t1-1) else s=@u1*z*sqr(@u0*t2-@u6*t1+@u4*@u0*t3*z-@p3) t=sqr(@v3*t2-@v4*k2*t3*z3+@v6*t1-@q1) endif if @frm==13; Milnor [18] (p.27-2) N=s, D=t elseif @frm==14; Milnor [19] (p.27-3) N=t, D=k2*z*s endif endif if @rev, num=D, den=N, else, num=N, den=D, endif if den==zro, den=eps, endif z=num/den if @fnct, z=@fn1(z), endif if @abslt, z=abs(z), endif if @choice==0, z=z+c elseif @choice==1, z=z*c elseif @choice==2, z=z/c elseif @choice==3, z=c/z elseif @choice==4, z=z^c elseif @choice==5, z=c^z endif bailout: |z|< @bailout default: title="Lattès Plus M" int param version, caption="version", default=100, visible=false, endparam center=(0.0,0.0) magn=0.25 complex param start, caption="start", default=(0.0,0.5), endparam float param bailout, caption="bailout", default=100000, endparam param frm, caption="formula", default=0 enum="BOF" "Monnier a" "Monnier b" "Monnier c" "Milnor [15]" \ "Milnor 24-1" "Milnor 24-2" "Milnor 24-3" "Milnor 25-2" \ "Milnor [16]" "Milnor 26-2" "Milnor [17]" \ "Milnor 27-1" "Milnor [18]" "Milnor [19]" endparam param choice, caption="c", enum="z+c" "z*c" "z/c" "c/z" "z^c" "c^z", default=0, endparam param prepare, caption="prepare", enum="no" "once" "every cycle", default=0, endparam func fnpf, caption="pre-function", default=ident(), visible=@prepare>0, endfunc param ducky, caption="ducky option", enum = "none" "ducky" "ducks" "anatra", default=0, endparam bool param abslt, caption="absolut", default=false, endparam bool param fnct, caption="extra function?", default=false, endparam func fn1, caption="extra function", default=ident(), visible=@fnct==true, endfunc bool param rev, caption="reverse", default=false, endparam complex param a, caption="parameter a", default=(2.0,0.0) visible=@frm==1 || @frm==3 || (@frm>4 && @frm<9) || @frm==12 endparam complex param k, caption="parameter k", default=(2.0,0.0) visible=@frm==4 || @frm>12 endparam bool param plus, caption="plus", default=false, endparam complex param p1, caption="p1", default=1.0 visible=(@frm==0 || @frm==2 || @frm==4 || @frm==5 || @frm>12) && @plus endparam complex param p2, caption="p2", default=(2.0,0.0) visible=@frm==10 && @plus endparam complex param p3, caption="p3", default=(3.0,0.0) visible=@frm>12 && @plus endparam complex param q1, caption="q1", default=(1.0,0.0) visible=(@frm<2 || @frm==3 || @frm==4 || @frm==8 || @frm==10 || @frm>11) && @plus endparam complex param q2, caption="q2", default=(2.0,0.0) visible=(@frm==6 || (@frm>8 && @frm<12)) && @plus endparam complex param u0, caption="u0", default=(1.0,0.0) visible=(@frm==6 || @frm==8) && @plus endparam complex param u1, caption="u1", default=(1.0,0.0) visible=(@frm<7 || @frm==8 || @frm>11) && @plus endparam complex param u4, caption="u4", default=(4.0,0.0) visible=(@frm==4 || @frm>12 || @frm>12) && @plus endparam complex param u6, caption="u6", default=(6.0,0.0) visible=(@frm==9 || @frm==11 || @frm>12) && @plus endparam complex param v0, caption="v0", default=(1.0,0.0) visible=@frm==7 && @plus endparam complex param v1, caption="v1", default=(1.0,0.0) visible=(@frm<2 || @frm==7 || (@frm>8 && @frm<12)) && @plus endparam complex param v2, caption="v2", default=(2.0,0.0) visible=@frm==2 && @plus endparam complex param v3, caption="v3", default=(3.0,0.0) visible=@frm>12 && @plus endparam complex param v4, caption="v4", default=(4.0,0.0) visible=(@frm==1 || @frm>12) && @plus endparam complex param v6, caption="v6", default=(6.0,0.0) visible=@frm>12 && @plus endparam switch: type="LattèsPlusJ", seed=#pixel, version=version bailout=bailout, frm=frm, choice=choice, ducky=ducky, abslt=abslt fnct=fnct, fn1=fn1, rev=rev, a=a, k=k, plus=plus, prepare=prepare, fnpf=fnpf p1=p1, p2=p2, p3=p3, q1=q1, q2=q2 u0=u0, u1=u1, u4=u4, u6=u6 v0=v0, v1=v1, v2=v2, v3=v3, v4=v4, v6=v6 } LattèsPlusJ { ; global: complex zro=(0.0,0.0) complex eps=(1e-15,0.0) init: complex z=#pixel, complex c=@seed complex z2=zro, complex z3=zro complex t=zro, complex t1=zro, complex t2=zro complex s=zro complex N=zro, complex D=zro complex num=zro, complex den=zro complex a2=@a*@a, complex k2=@k*@k int iter=0 loop: iter=iter+1 if @prepare==1 && iter==1, z=@fnpf(z), endif if @prepare==2 , z=@fnpf(z), endif if @ducky==1, z=abs(z) elseif @ducky==2, z=real(z)+flip(abs(imag(z))) elseif @ducky==3, z=abs(real(z))+flip(imag(z)) endif z2=z*z, z3=z2*z if @frm==0; BOF if @plus==false N=sqr(1+z2) D=z*(z2-1) else N=sqr(@p1+@u1*z2) D=z*(@v1*z2-@q1) endif elseif @frm==1; Monnier a if @plus==false N=sqr(z2-@a) D=4*z*(z-1)*(z-@a) else N=sqr(@u1*z2-@a) D=@v4*z*(@v1*z-@q1)*(@v1*z-@a) endif elseif @frm==2; Monnier b = Milnor p.25-1 if @plus==false N=z+1/z D=2i else N=@u1*z+@p1/z D=@v2*1i endif elseif @frm==3; Monnier c if @plus==false N=z3+@a D=@a*z3+1 else N=@u1*z3+@a D=@a*z3+@q1 endif elseif @frm==4; Milnor [15] (p.20) if @plus==false N=4*z*(1-z)*(1-k2*z) D=sqr(1-k2*z2) else N=@u4*z*(@p1-z)*(@u1-k2*z) D=sqr(@q1-k2*z2) endif elseif @frm==5; Milnor p.24-1 D=a2 if @plus==false N=z+1/z else N=@u1*z+@p1/z endif elseif @frm==6; Milnor p.24-2 if @plus==false N=z*(z+a2) D=a2*z+1 else N=@u1*z*(@u0*z+a2) D=a2*z+@q1 endif elseif @frm==7; Milnor p.24-3 N=@a*z*z if @plus==false D=z*(z+a2) else D=@v1*z*(@v0*z+a2) endif elseif @frm==8; Milnor p.25-2 if @plus==false N=z*sqr(z-@a) D=sqr(@a*z-1) else N=@u1*z*sqr(@u0*z-@a) D=sqr(@a*z-@q1) endif elseif @frm==9; Milnor [16] (p.26-1) if @plus==false N=6*z D=z3-2 else N=@u6*z D=@v1*z3-@q2 endif elseif @frm==10; Milnor p.26-2 if @plus==false N=2-z D=1+z else N=@p2-@u1*z D=@q1+@v1*z endif elseif @frm==11; Milnor [17] p.26-3 if @plus==false N=(6*z)^3 D=(z3-2)^3 else N=(@u6*z)^3 D=(@v1*z3-@q2)^3 endif elseif @frm==12; Milnor p.27-1 if @plus==false N=z3+@a D=@a*z3+1 else N=@u1*z3+@a D=@a*z3+@q1 endif endif if @frm>12 t1=k2*z2, t2=t1*t1 if @plus, t3=k2+@p1, else, t3=k2+1, endif if @plus==false s=z*sqr(t2-6*t1+4*t3*z-3) t=sqr(3*t2-4*k2*t3*z3+6*t1-1) else s=@u1*z*sqr(@u0*t2-@u6*t1+@u4*@u0*t3*z-@p3) t=sqr(@v3*t2-@v4*k2*t3*z3+@v6*t1-@q1) endif if @frm==13; Milnor [18] (p.27-2) N=s, D=t elseif @frm==14; Milnor [19] (p.27-3) N=t, D=k2*z*s endif endif if @rev, num=D, den=N, else, num=N, den=D, endif if den==zro, den=eps, endif z=num/den if @fnct, z=@fn1(z), endif if @abslt, z=abs(z), endif if @choice==0, z=z+c elseif @choice==1, z=z*c elseif @choice==2, z=z/c elseif @choice==3, z=c/z elseif @choice==4, z=z^c elseif @choice==5, z=c^z endif bailout: |z|< @bailout default: title="Lattès Plus J" int param version, caption="version", default=100, visible=false, endparam center=(0.0,0.0) magn=0.25 complex param seed, caption="seed", default=(0.0,0.0), endparam float param bailout, caption="bailout", default=100000, endparam param frm, caption="formula", default=0 enum="BOF" "Monnier a" "Monnier b" "Monnier c" "Milnor [15]" \ "Milnor 24-1" "Milnor 24-2" "Milnor 24-3" "Milnor 25-2" \ "Milnor [16]" "Milnor 26-2" "Milnor [17]" \ "Milnor 27-1" "Milnor [18]" "Milnor [19]" endparam param choice, caption="c", enum="z+c" "z*c" "z/c" "c/z" "z^c" "c^z", default=0, endparam param prepare, caption="prepare", enum="no" "once" "every cycle", default=0, endparam func fnpf, caption="pre-function", default=ident(), visible=@prepare>0, endfunc param ducky, caption="ducky option", enum = "none" "ducky" "ducks" "anatra", default=0, endparam bool param abslt, caption="absolut", default=false, endparam bool param fnct, caption="extra function?", default=false, endparam func fn1, caption="extra function", default=ident(), visible=@fnct==true, endfunc bool param rev, caption="reverse", default=false, endparam complex param a, caption="parameter a", default=(2.0,0.0) visible=@frm==1 || @frm==3 || (@frm>4 && @frm<9) || @frm==12 endparam complex param k, caption="parameter k", default=(2.0,0.0) visible=@frm==4 || @frm>12 endparam bool param plus, caption="plus", default=false, endparam complex param p1, caption="p1", default=1.0 visible=(@frm==0 || @frm==2 || @frm==4 || @frm==5 || @frm>12) && @plus endparam complex param p2, caption="p2", default=(2.0,0.0) visible=@frm==10 && @plus endparam complex param p3, caption="p3", default=(3.0,0.0) visible=@frm>12 && @plus endparam complex param q1, caption="q1", default=(1.0,0.0) visible=(@frm<2 || @frm==3 || @frm==4 || @frm==8 || @frm==10 || @frm>11) && @plus endparam complex param q2, caption="q2", default=(2.0,0.0) visible=(@frm==6 || (@frm>8 && @frm<12)) && @plus endparam complex param u0, caption="u0", default=(1.0,0.0) visible=(@frm==6 || @frm==8) && @plus endparam complex param u1, caption="u1", default=(1.0,0.0) visible=(@frm<7 || @frm==8 || @frm>11) && @plus endparam complex param u4, caption="u4", default=(4.0,0.0) visible=(@frm==4 || @frm>12 || @frm>12) && @plus endparam complex param u6, caption="u6", default=(6.0,0.0) visible=(@frm==9 || @frm==11 || @frm>12) && @plus endparam complex param v0, caption="v0", default=(1.0,0.0) visible=@frm==7 && @plus endparam complex param v1, caption="v1", default=(1.0,0.0) visible=(@frm<2 || @frm==7 || (@frm>8 && @frm<12)) && @plus endparam complex param v2, caption="v2", default=(2.0,0.0) visible=@frm==2 && @plus endparam complex param v3, caption="v3", default=(3.0,0.0) visible=@frm>12 && @plus endparam complex param v4, caption="v4", default=(4.0,0.0) visible=(@frm==1 || @frm>12) && @plus endparam complex param v6, caption="v6", default=(6.0,0.0) visible=@frm>12 && @plus endparam switch: type="LattèsPlusM", version=version bailout=bailout, frm=frm, choice=choice, ducky=ducky, abslt=abslt fnct=fnct, fn1=fn1, rev=rev, a=a, k=k, plus=plus, prepare=prepare, fnpf=fnpf p1=p1, p2=p2, p3=p3, q1=q1, q2=q2 u0=u0, u1=u1, u4=u4, u6=u6 v0=v0, v1=v1, v2=v2, v3=v3, v4=v4, v6=v6 } ==================================================================================================================================== MandelSquareRL { ; Based on 'MandelBox' (author Tom Lowe) as described in ; http://en.wikipedia.org/wiki/Mandelbox ; earlier discussion on the 2D version: ; http://www.fractalforums.com/programming/understanding-the-mandelbox-formula-(for-2d)/ ; ; An earlier application of the MandelBox formula by Christian Kleinhuis, in 2013, ; as a class you can find in his ck.ulb. ; I don't know about other implementations of Tom's principle in UF. ; If there are, please let me know. ; ; It works only with 'Inside' coloring (as given in the tab 'Layer Properties'), ; so select first an appropriate coloring, e.g.'Lyapunov' in dmj.ucl. ; Many other colorings are also possible. ; ; Despite of being a 'light' version, there are some deviations and additions to ; the original 3D algorithm. ; ; Point z goes back-and-forth between the outside of a square 'wall' (by a back shift) ; and the core (by a kick off). In an 'active area' between both, z is divided by its ; squared magnitude. init: complex z=(0.0,0.0) complex c=(0.0,0.0) if @mode=="Mandelbrot", z=@start, c=#pixel elseif @mode=="Julia", z=#pixel, c=@seed+@s, endif float x=0.0, float y=0.0, float m=0.0, float p=@p float t=0.0, float t1=0.0, float t2=0.0 int kw=0 complex func back(float x,float y,int kw) if kw==2, x=-x elseif kw==3, x=-x, y=-y elseif kw==4, y=-y endif return x+flip(y) endfunc loop: x=real(z), y=imag(z) if x>=0.0 && y>=0.0 kw=1 elseif x<0.0 && y>=0.0 x=abs(x), kw=2 elseif x<0.0 && y<0.0 x=abs(x), y=abs(y), kw=3 elseif x>=0.0 && y<0.0 y=abs(y), kw=4 endif t=@a, if t=t || (x=t)) if @altsq x=t1-x, y=t2-y else if x>t, x=t1-x, endif if y>t, y=t2-y, endif endif endif if @core==0 m=sqrt(sqr(x)+sqr(y)) if m<@b0 z=@ko*back(x,y,kw) elseif m

=@b1 && y>=@b1 z=back(x,y,kw), z=z/|z| endif endif z=@main*@zscale*@fnz(z)+@cscale*@fnc(c) bailout: true default: title="Mandel Square Lite" center=(0.0,0.0) magn=1.0 int param version default=100 visible=false endparam heading caption="General" endheading param mode caption="Current Mode" enum="Mandelbrot" "Julia" default = 0 endparam param switchto caption="Switch To" enum="Mandelbrot" "Julia" default = 1 visible=@mode>1 endparam complex param start caption="start" default=(0.0,0.0) visible=@mode==0 endparam complex param seed default=(0.0,0.0) visible=@mode>1 endparam complex param s caption="seed" default=(0.0,0.0) visible=@mode==1 endparam float param main caption="main shape" default=0.5 hint="Also available in the original formula as a 'scaling factor'. \ But actually it influences mainly the shape of the fractal." endparam float param ko caption="kick off [4]" default=4.0 hint="A kick off from the core in radial ditrection. In the original \ formula this kick off is 4 times its magnitude. Here this '4' is \ a variable." endparam complex param shift caption="back shift [1/1]" default=(1.0,1.0) hint="Prevents escape of z and brings it out of its original radial \ direction by a vector. In the original formula it is an absolute \ complex constant 1/1, always more or less in the direction of \ the center point. Here it is a variable." endparam float param zscale caption="z-shape" default=1.0 hint="An added variable which influences the shape of the fractal." endparam func fnz caption="function z" default=ident() hint="An added function which transforms z, and so also the fractal." endfunc float param cscale caption="c-shape" default=1.0 visible=@mode==0 hint="An added variable which influences the scale of the fractal \ and near 0 also its shape." endparam func fnc caption="function c" default=ident() visible=@mode==0 hint="An added function which transforms c, and so also the fractal." endfunc heading caption="Wall" endheading float param a caption="half side wall [1]" default=1.0 hint="The 'wall' is a square, default with sides 2, so the 'half side \ wall'= 1.0. " endparam bool param altsq caption="other square" default=false endparam heading caption="Core" endheading param core caption="shape core" enum="circle" "square" default=1 hint="Originally in 'MandelBox' the core is a sphere with a constant \ radius 0.5. Here we can make choice between a circle and a square. \ In both cases the size is variable." endparam float param b0 caption="radius inner circle [0.5]" default=0.5 visible=@core==0 hint="Originally a constant of 0.5." endparam float param p caption="radius ref. circle" default=1.0 visible=@core==0 hint="Originally the 'Unit Circle' (radius = 1)" endparam float param b1 caption="half side inner square [0.5]" default=0.5 visible=@core==1 hint="So the square has default sides of 1." endparam switch: type="MandelSquareRL" version=version mode = switchto switchto = mode seed = #pixel s=s, main=main, p=p, ko=ko, zscale = zscale, fnz=fnz cscale=cscale, fnc=fnc, altcore=altcore, shift=shift a=a, altsq=altsq, core=core, b0=b0, b1=b1 } MandelSquareEnh { ; MandelBox Formula by Tom Lowe global: float d=1e-12 complex g=abs(@g) float gr=real(g) float gi=imag(g) float ga=atan2(@g) init: complex z=(0.0,0.0) complex c=(0.0,0.0) if @mode=="Mandelbrot", z=@start, c=#pixel elseif @mode=="Julia", z=#pixel, c=@seed+@s, endif float x=0.0, float y=0.0 int kw=0 float t=0.0, float t0=0.0, float t1=0.0 float t2=0.0, float t3=0.0, float t4=0.0 float ta=0.0, float tc=0.0 float tx=0.0, float ty=0.0 float sqx=0.0, float sqy=0.0, float sqp=0.0 float arx=0.0, float ary=0.0 float ca=@ca, if ca==1.0, ca=ca-d, endif float cb4=sqr(sqr(@cb)) float bdx=@bdx, float bdy=@bdy float bdx2=@bdx2, float bdy2=@bdy2 float bx9=@bx9, float by9=@by9 float xshift=real(@shift), float yshift=imag(@shift) float sp=sqr(@p) if @wall==0, tc=@cw, if tc<@p, tc=@p, endif elseif @wall==1 ta=@asqr, if ta<@p, ta=@p, endif elseif @wall==2 tx=real(@arect), ty=imag(@arect) if tx<@p, tx=@p, endif if ty<@p, ty=@p, endif elseif @wall==3 tx=real(@ar), ty=imag(@ar) float t=sqrt(sqr(tx)+sqr(ty)); hyp t0=tx*ty/t; alti tc=@p/t0 elseif @wall==4 t=@hp, tx=real(@hptr), ty=imag(@hptr) if t<@p, t=@p, endif endif if @core==7 || @core==8 if bdx<0.0, bdx=-bdx, endif if bdx==0.0, bdx=bdx+d, endif if bdy>0.0, bdy=-bdy, endif if bdy==0.0, bdy=bdy-d, endif t1=-bdy/bdx endif if @core==8 if @crosssym==0 if bdx2>0.0, bdx2=-bdx2, endif if bdx2==0.0, bdx2=bdx2-d, endif if bdy2<0.0, bdy2=-bdy2, endif if bdy2==0.0, bdy2=bdy2+d, endif t2=-bdy2/bdx2 elseif @crosssym==1 bdx2=bdy, bdy2=bdx, t2=1/t1 elseif @crosssym==2 bdx2=-bdx, bdy2=-bdy, t2=t1 endif endif float angle=0.0 if @core==9 if gr==bx9, bx9=bx9+d, endif if gi==by9, by9=by9+d, endif endif float e1=1.1*@e1, float e2=1.1*@e2, float r2=@r2 float p1=2*@p1, float p2=0.2*@p2, float p3=2*@p3, float p4=0.2*@p4 complex func back(float x,float y,int kw) if kw==2, x=-x elseif kw==3, x=-x, y=-y elseif kw==4, y=-y endif return x+flip(y) endfunc complex func result(float x,float y,int kw,\ bool floatfn,int flnrx,int flnry,float flscalex,float flscaley,\ bool complexfn,int combi,float atcompl1,float atcompl2,float atcompltot,\ int var,float n,float q) float m=0.0 if floatfn x=floatfunc(x,@flnrx,@flscalex) y=floatfunc(y,@flnry,@flscaley) endif z=back(x,y,kw) if complexfn z=complexfunc(z,combi,atcompl1,atcompl2,atcompltot) endif m=cabs(z) return finish(z,m,@var,@n,@q) endfunc float func floatfunc(float xy, int flnr, float flscale) float function=0.0 if flnr==0, function=xy elseif flnr==1, function=abs(xy) elseif flnr==2, function=recip(xy) elseif flnr==3, function=exp(xy) elseif flnr==4, function=log(xy) elseif flnr==5, function=sqrt(xy) elseif flnr==6, function=sqr(xy) elseif flnr==7, function=cotanh(xy) elseif flnr==8, function=cotan(xy) elseif flnr==9, function=atanh(xy) elseif flnr==10, function=atan(xy) elseif flnr==11, function=tanh(xy) elseif flnr==12, function=tan(xy) elseif flnr==13, function=acosh(xy) elseif flnr==14, function=acos(xy) elseif flnr==15, function=cosh(xy) elseif flnr==16, function=cos(xy) elseif flnr==17, function=asinh(xy) elseif flnr==18, function=asin(xy) elseif flnr==19, function=sinh(xy) elseif flnr==20, function=sin(xy) elseif flnr==21, function=ceil(xy) elseif flnr==22, function=floor(xy) elseif flnr==23, function=trunc(xy) elseif flnr==24, function=round(xy) endif return flscale*function endfunc complex func complexfunc(complex z,int combi,float atcompl1,float atcompl2,float atcompltot) ; combi==0 : z=z if combi==1 z=atcompl1*@fna(z) elseif combi==2 z=atcompl1*@fna(z)+atcompl2*@fnb(z) elseif combi==3 z=atcompltot*@fna(z)*@fnb(z) elseif combi==4 z=atcompltot*@fna(z-atcompl1)/@fnb(z-atcompl2) elseif combi==5 z=@fna(atcompl1*@fnb(z-atcompl2))+atcompltot endif return z endfunc complex func finish(complex z,float m,int var,float n,float q) float p=m^n if var==0, z=z/|z| elseif var==1, z=1/|z| elseif var==2, z=|z| elseif var==3, z=z elseif var==4, z=|z|/z elseif var==5, z=1/m elseif var==6, z=z/m elseif var==7, z=m elseif var==8, z=m/z elseif var==9, z=1/p elseif var==10, z=z/p elseif var==11, z=p elseif var==12, z=p/z endif return q*z endfunc loop: x=real(z), y=imag(z) if x>=0.0 && y>=0.0 kw=1 elseif x<0.0 && y>=0.0 x=-x, kw=2 elseif x<0.0 && y<0.0 x=-x, y=-y, kw=3 elseif x>=0.0 && y<0.0 y=-y, kw=4 endif if @wall==0; circle if sqr(x)+sqr(y)>sqr(tc) if @othershift x=xshift-x, if x<0, x=0, endif y=yshift-y, if y<0, y=0, endif else sqy=y*y, sqx=x*x, sqp=@p*@p t1=x*sqrt(1/(1-sqy)) t2=sqrt(sqp-sqy) xshift=xshift*((x-t2)/(t1-@p)) t3=y*sqrt(1/(1-sqx)) t4=sqrt(sqp-sqx) yshift=yshift*((y-t4)/(t3-@p)) x=2*xshift-x, y=2*yshift-y endif endif elseif @wall==1; square if (@sqropt==0 && (x>=ta || (x=ta))) if @altwall x=xshift-x, y=yshift-y else if x>=ta, x=xshift-x, endif if y>=ta, y=yshift-y, endif endif elseif (@sqropt==1 && x>=ta && y>=ta) || \ (@sqropt==2 && x>=ta) || (@sqropt==3 && y>=ta) x=xshift-x, y=yshift-y endif elseif @wall==2; rectangle if (@sqropt==0 && (x>=tx || (x=ty))) if @altwall x=xshift-x, y=yshift-y else if x>tx, x=xshift-x, endif if y>ty, y=yshift-y, endif endif elseif (@sqropt==1 && x>=tx && y>=ty) || \ (@sqropt==2 && x>=tx) || (@sqropt==3 && y>=ty) x=xshift-x, y=yshift-y endif elseif @wall==3; rhombus if t0>=@p arx=tx, ary=ty else arx=tc*tx, ary=tc*ty endif if x>arx*(ary-y)/ary && y>ary*(1-1/(arx)) if @othershift x=xshift-x, if x<0.0, x=0.0, endif y=yshift-y, if y<0.0, y=0.0, endif else x=(xshift*(arx-y)/y)-x y=(yshift*(ary-x)/x)-y endif endif elseif @wall==4; simple hyperbole if x*y>t && x=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==1; vierkant if x<@b1 && y<@b1 z=@ko*back(x,y,kw) elseif x>=@b1 && y>=@b1 if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==2; rhombus t=@brx+@bry if x+y=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==3; hyperbole if x*y<@bsh z=@ko*back(x,y,kw) else if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==4; combi 2-sides (ellipse, hyperbole, superellipse) t=@hx4*((x/@bx4)^@pow)+@hy4*((y/@by4)^@pow) if t<1.0 z=@ko*back(x,y,kw) else if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==5; combi 4-sides t=@hx4*((2*x*@bx4)^@pow)-@hy4*((2*y*@by4)^@pow) if x>y if t<1.0 z=@ko*back(x,y,kw) elseif t>=1.0 if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif y>x if t>-1.0 z=@ko*back(x,y,kw) elseif t<=-1.0 if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif endif elseif @core==6; cassini oval t1=(x-ca), t2=(x+ca), t=(sqr(y)+sqr(t1))*(sqr(y)+sqr(t2)) if t=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==7; diabolo t=y-t1*x if t>bdy z=@ko*back(x,y,kw) else if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==8; cross t=y-t1*x, t0=y-t2*x if t>bdy && t0=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif elseif @core==9; octagon (punt P(p,0) op x-as, punt Q(0,by) op y-as, angle=atan(y/x) if anglegr && y-t1*xt2) z=@ko*back(x,y,kw) elseif y-t1*x>t2 if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif else t1=(gi-by9)/gr; slope if y-t1*xby9 if @MSmode==0 || (@MSmode==1 && |z|=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif endif elseif @core==10 ; 2 circles t1=e1-sqrt(sqr(@r1)-sqr(y)) if x=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif if @hv if @es; 4 fold symmetry e2=e1, r2=@r1 endif t2=e2-sqrt(sqr(r2)-sqr(x)) if x=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif endif elseif @core==11 ; paraboles t1=p1*y^2+p2 if x=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif if @hv if @ps; other symmetry p3=p1, p4=p2 endif t2=2*p3*y^2+0.2*p4 if x=sp) z=result(x,y,kw,@floatfn,@flnrx,@flnry,@flscalex,@flscaley,\ @complexfn,@combi,@atcompl1,@atcompl2,@atcompltot,@var,@n,@q) endif endif endif endif if @zmod t1=real(@zm)*real(z) t2=imag(@zm)*imag(z) z=t1+flip(t2) endif z=@main*@zscale*@fnz(z)+@cscale*@fnc(c) bailout: true default: title="Mandel Square Enhanced" center=(0.0,0.0) magn=1.0 int param version default=100 visible=false endparam heading caption="General" endheading param mode caption="Current Mode" enum="Mandelbrot" "Julia" default = 0 endparam param switchto caption="Switch To" enum="Mandelbrot" "Julia" default = 1 visible=@mode>1 endparam complex param start caption="start" default=(0.0,0.0) visible=@mode==0 endparam complex param seed default=(0.0,0.0) visible=@mode>1 endparam complex param s caption="seed" default=(0.0,0.0) visible=@mode==1 endparam float param main caption="main shape" default=0.5 hint="Also available in the original formula as a 'scaling factor'. \ But actually it influences mainly the shape of the fractal." endparam float param ko caption="kick off [4]" default=4.0 hint="A kick off from the core in radial direction. In the original \ formula this kick off is 4 times its magnitude. Here this '4' is \ changed into the variable 'kick off'." endparam complex param shift caption="back shift [1/1]" default=(2.0,2.0) hint="Prevents escape of z and brings it out of its original radial \ direction by a vector. In the original formula it is an absolute \ complex constant 1/1, always more or less in the direction of \ the center point. Here it is a variable." endparam float param p caption="radius reference circle" default=1.0, min=0.0 hint="Originally the 'Unit Circle' (radius = 1) \ Somewhere outside the reference circle is the wall, \ inside is the core, which is only the inner part of the \ inside area." endparam param var caption="active area parameter" enum="z/|z|" "1/|z|" "|z|" "z" "|z|/z" "1/m" "z/m" \ "m" "m/z" "1/(m^n)" "z/(m^n)" "m^n" "(m^n)/z" default=0, min=0, max=12 hint="Active area (inside wall) can be varied by these \ options and also by using float or/and complex functions." endparam float param n caption="n (for z-var)" default=1.0 visible=@var>8 endparam float param q caption="main multiplier" default=1.0 hint="Influences the 'strength' of the 'active area'" endparam ; floatfunctions bool param floatfn caption="float functions?" default=false hint="One of the possibilities to influence the action in the \ 'active area'. It can be combined with other possibilities \ (active area parameter and complex functions)." endparam param flnrx caption="x function (Re)" enum="ident""abs""recip""exp""log""sqrt""sqr""cotanh""cotan"\ "atanh""atan""tanh""tan""acosh""acos""cosh""cos""asinh"\ "asin""sinh""sin""ceil""floor""trunc""round" default=0 visible=@floatfn endparam float param flscalex caption="scaling x function" default=1.0 visible=@floatfn endparam param flnry caption="y function (Im)" enum="ident""abs""recip""exp""log""sqrt""sqr""cotanh""cotan"\ "atanh""atan""tanh""tan""acosh""acos""cosh""cos""asinh"\ "asin""sinh""sin""ceil""floor""trunc""round" default=0 visible=@floatfn endparam float param flscaley caption="scaling y function" default=1.0 visible=@floatfn endparam ; complex functions bool param complexfn caption="complex functions?" default=false hint="One of the possibilities to influence the action in the \ 'active area'. It can be combined with other possibilities \ (active area parameter and float functions)." endparam param combi caption="combination of functions" enum="none""single""sum""product""quotient""function of function" default=1 visible=@complexfn endparam func fna caption="complex function 1" default=ident() visible=@complexfn endfunc float param atcompl1 caption="parameter complex fn1" default=1.0 visible=@complexfn && (@combi==1 || @combi==2 || @combi>3) endparam func fnb caption="complex function 2" default=ident() visible=@complexfn && @combi>1 endfunc float param atcompl2 caption="parameter complex fn2" default=1.0 visible=@complexfn && (@combi==2 || @combi>3) endparam float param atcompltot caption="param. for both fn1, fn2" default=1.0 visible=@complexfn && @combi>2 endparam float param zscale caption="z-shape" default=1.0 hint="An added variable which influences the shape of the fractal." endparam bool param zmod caption="modify z" default=false endparam complex param zm caption="modification" default=(1.0,1.0) visible=@zmod==true endparam func fnz caption="function z" default=ident() hint="An added function which transforms z, and so also the fractal." endfunc float param cscale caption="c-shape" default=1.0 visible=@mode==0 hint="An added variable which influences the scale of the fractal \ and near 0 also its shape." endparam func fnc caption="function c" default=ident() visible=@mode==0 hint="An added function which transforms c, and so also the fractal." endfunc heading caption="Wall" endheading param wall caption="shape wall" enum="circle" "square" "rectangle" "rhombus" "hyperbole" default=1 hint="Out of the wall z will be thrown back, parameter 'shift' \ has an essential influence on this action" endparam float param cw caption="circle wall [1]" default=1.0, min=0.0 visible=@wall==0 hint="Shape of the wall is a circle" endparam float param asqr caption="half side wall [1]" default=1.0, min=0.0 visible=@wall==1 hint="Shape of the wall is a square" endparam complex param arect caption="width and height rectangle" default=(1.0,1.0), min=(0.0,0.0) visible=@wall==2 hint="Re=width, Im=height" endparam complex param ar caption="half diagonal" default=(2.0,2.0) visible=@wall==3 hint="half diagonal: Re on x axis - Im on y axis" endparam float param hp caption="hyperbole constant" default=1.415 visible=@wall==4 hint="Shape of the wall is a truncated simple hyperbole \ (with mirror symmetry to the 45º axisses)." endparam complex param hptr caption="hyperbole truncation" default=(4.0,4.0) visible=@wall==4 endparam param sqropt caption="Variant" enum="A" "B" "C" "D" default=0 visible=@wall==1 || @wall==2 endparam bool param altwall caption="other wall option" default=false visible=(@wall==1 || @wall==2) && @sqropt==0 endparam bool param othershift caption="another shift" default=false visible=@wall==0 || @wall>2 hint="A different influence of parameter 'shift'" endparam heading caption="Core" endheading param core caption="shape core" enum="circle" "square" "rhombus" "hyperbole" "combi 2 sides" "combi 4 sides"\ "cassini oval" "diabolo" "x-cross" "octagon" "circles" "parabolas" "test" default=1 hint="Originally in 'MandelBox' the core is a sphere with a constant \ radius 0.5. Here we also can choose other shapes." endparam param msmode caption="core mode" enum="outside core" "outs. core - inside ref. circle" "outside ref. circle" default=0 endparam ; circle float param b0 caption="radius inner circle [0.5]" default=0.5 visible=@core==0 hint="Originally a constant of 0.5." endparam ; square float param b1 caption="half side inner square [0.5]" default=0.4 visible=@core==1 hint="Shape of the core is a square" endparam ; rhombus float param brx caption="half diagonal horizontal" default=1.0 visible=@core==2 hint="Shape of the core is a rhombus ('diamond')" endparam float param bry caption="half diagonal vertical" default=1.0 visible=@core==2 hint="Shape of the core is a rhombus ('diamond')" endparam ; hyperbole float param bsh caption="hyperbolic parameter" default=2.0 visible=@core==3 hint="Shape of the core is a simple othogonal hyperbole" endparam ; combi float param bx4 caption="hyperbolic parameter horizontal" default=2.0 visible=@core==4 || @core==5 || @core==12 hint="A shape with many possibilities, from ellipses to \ hyperboles. This parameter influences the properties \ in horizontal direction." endparam float param hx4 caption="combi weight horizontal" default=1.0 visible=@core==4 || @core==5 hint="Influences the 'strength' of the horizontal parameter." endparam float param by4 caption="hyperbolic parameter vertical" default=2.0 visible=@core==4 || @core==5 || @core==12 hint="A shape with many possibilities, from ellipses to \ hyperboles. This parameter influences the properties \ in vertical direction, from ellipse to hyperbole." endparam float param hy4 caption="combi weight vertical" default=1.0 visible=@core==4 || @core==5 hint="Influences the 'strength' of the vertical parameter." endparam float param pow caption="combi power" default=2.0 visible=@core==4 || @core==5 hint="In the case of 'ellipse' (combi weight vertical = 1) \ with combi power=1 we have an ellipse, with higher powers \ we go into the direction of super-ellipses (rectangles \ with rounded vertices), with lower powers in the direction \ of hyperbole look alikes." endparam ; cassini float param ca caption="cassini const. a" default=1.0 visible=@core==6 hint="A special curve with many possibilities" endparam float param cb caption="cassini const. b" default=1.0, min=0.0 visible=@core==6 hint="A special curve with many possibilities" endparam ; diabolo / cross float param bdx caption="diabolo horizontal" default=1.0 visible=@core==7 || @core==8 hint="Core with a diabolic or Andreas cross shape" endparam float param bdy caption="diabolo vertical" default=1.0 visible=@core==7 || @core==8 hint="Core with a diabolic or Andreas cross shape" endparam float param bdx2 caption="2nd diabolo horizontal" default=1.0 visible=@core==8 endparam float param bdy2 caption="2nd diabolo vertical" default=1.0 visible=@core==8 endparam param crosssym caption="symmetry type" enum="1" "2" "3" default=0 visible=@core==8 endparam ; octagon float param bx9 caption="octagon point x" default=1.0 visible=@core==9 hint="Octagon with 2 points on x-axis, 2 points on y-axis \ and one ('third octagon point') between them." endparam float param by9, caption="octagon point y" default=1.0 visible=@core==9 hint="Octagon with 2 points on x-axis, 2 points on y-axis \ and one ('third octagon point') between them." endparam complex param g caption="third octagon point" default=(0.3,0.3) visible=@core==9 hint="'Third' octagon point between the other ones. It can \ give regular or irregular octagons or four-pointed stars." endparam ; circles/paraboles bool param hv caption="4 fold" default=false visible=@core==10 || @core==11 hint="'Enabled' it works in both perpendicular directions \ horizontally and vertically)." endparam bool param es caption="Another symmetry" default=true visible=@core==10 && @hv hint="The 'active areas' are 2 (or 4) circles" endparam float param r1 caption="radius horizontal" default=1.0 visible=@core==10 endparam float param e1 caption="excentricity horizontal" default=1.0 visible=@core==10 hint="If excentricity=0 there is concetricity (centre at the midpoint)." endparam float param r2 caption="radius vertical" default=1.0 visible=@core==10 && @hv && @es==false endparam float param e2 caption="excentricity vertical" default=1.0 visible=@core==10 && @hv && @es==false hint="If excentricity=0 there is concetricity (centre at the midpoint)." endparam bool param ps caption="other symmetry" default=false visible=@core==11 && @hv hint="The 'active areas' are 2 (or 4) paraboles" endparam float param p1 caption="parabole param. hor. 1" default=1.0 visible=@core==11 endparam float param p2 caption="parabole param. hor. 2" default=1.0 visible=@core==11 endparam float param p3 caption="parabole param. vert. 1" default=1.0 visible=@core==11 && @hv && @ps==false endparam float param p4 caption="parabole param. vert. 2" default=1.0 visible=@core==11 && @hv && @ps==false endparam switch: type="MandelSquareEnh" version=version mode = switchto switchto = mode seed = #pixel s=s, main=main, ko=ko, shift=shift, msmode=msmode, p=p, var=var, n=n, q=q floatfn=floatfn, flnrx=flnrx, flscalex=flscalex, flnry=flnry flscaley=flscaley, complexfn=complexfn, combi=combi, fna=fna, atcompl1=atcompl1, fnb=fnb, atcompl2=atcompl2, atcompltot=atcompltot zscale=zscale, fnz=fnz, cscale=cscale, fnc=fnc, zmod=zmod, zm=zm wall=wall, cw=cw, asqr=asqr, arect=arect, sqropt=sqropt othershift=othershift, ar=ar, hp=hp, hptr=hptr, altwall=altwall core=core, b0=b0, b1=b1, brx=brx, bry=bry, bsh=bsh, bx4=bx4, hx4=hx4 by4=by4, hy4=hy4, pow=pow, ca=ca, cb=cb, bdx=bdx, bdy=bdy, bdx2=bdx2 bdy2=bdy2, crosssym=crosssym, bx9=bx9, by9=by9, g=g, hv=hv, es=es r1=r1, e1=e1, r2=r2, e2=e2, ps=ps, p1=p1, p2=p2, p3=p3, p4=p4 } DopedDuckyJ { init: complex z = #pixel complex c = @seed complex z1 = (0.0,0.0) float x = 0.0, float y = 0.0 loop: z1 = z x = real(z), y = imag(z) if @absx, x = abs(x), endif if @xmode==0 x = @p1*x+@p2 elseif @xmode==1 x = @p1*sin(@p3*x+@p4)+@p2 elseif @xmode==2 x = @p1*asinh(@p3*x+@p4)+@p2 elseif @xmode==3 x = @p1*cos(@p3*x+@p4)+@p2 elseif @xmode==4 x = @p1*tan(@p3*x+@p4)+@p2 elseif @xmode==5 x = @r0 + @r1*x + @r2*x*x + @r3*x*x*x elseif @xmode==6 x = @u0 + @u1*x^@u2 + @u3*x^@u4 endif if @absy, y = abs(y), endif if @ymode==0 y = @q1*y+@q2 elseif @ymode==1 y = @q1*sin(@q3*y+@q4)+@q2 elseif @ymode==2 y = @q1*asinh(@q3*y+@q4)+@q2 elseif @xmode==3 y = @q1*cos(@q3*y+@q4)+@q2 elseif @xmode==4 y = @q1*tan(@q3*y+@q4)+@q2 elseif @ymode==5 y = @s0 + @s1*y+ @s2*y*y + @s3*y*y*y elseif @xmode==6 y = @v0 + @v1*x^@v2 + @v3*x^@v4 endif z = x + flip(y) z = 0.01*@w1*z + @w2*@fnmain(abs(z1)) + c bailout: |z| < @bailout default: title = "Doped Ducky J" center = (0.0,0.0) magn = 0.25 int param version default=100 visible=false endparam int param bailout caption = "bailout" default = 100000 endparam complex param seed caption = "seed" default = (-0.28,-0.6) endparam heading, caption = "general", endheading func fnmain caption = "main function" default = asinh() endfunc float param w2 caption = "main stem" default = 1.0 endparam float param w1 caption = "doping [%]" default = 1.0 endparam heading, caption = "horizontal dope", endheading param xmode caption = "x-mode" default = 0 enum = "ident" "sin" "asinh" "cos" "tan" "poly 1" "poly 2" endparam bool param absx caption = "x absolute" default = false endparam float param p1 caption = "function multiplier" default = 1.0 visible = @xmode<5 endparam float param p2 caption = "function addition" default = 0.0 visible = @xmode<5 endparam float param p3 caption = "x-multiplier" default = 1.0 visible = @xmode>0 && @xmode<5 endparam float param p4 caption = "x-addition" default = 0.0 visible = @xmode>0 && @xmode<5 endparam float param r0 caption = "first term" default = 0.0 visible = @xmode==5 endparam float param r1 caption = "second term" default = 1.0 visible = @xmode==5 endparam float param r2 caption = "third term" default = -1.0 visible = @xmode==5 endparam float param r3 caption = "fourth term" default = 0.5 visible = @xmode==5 endparam float param u0 caption = "constant" default = 0.0 visible = @xmode==6 endparam float param u1 caption = "first term factor" default = 1.0 visible = @xmode==6 endparam float param u2 caption = "first term exponent" default = -1.0 visible = @xmode==6 endparam float param u3 caption = "second term factor" default = 0.5 visible = @xmode==6 endparam float param u4 caption = "second term exponent" default = 0.5 visible = @xmode==6 endparam ;----------------- heading, caption = "vertical dope", endheading param ymode caption = "y-mode" default = 0 enum = "ident" "sin" "asinh" "cos" "tan" "poly 1" "poly 2" endparam bool param absy caption = "y absolute" default = false endparam float param q1 caption = "function multiplier" default = 1.0 visible = @ymode<5 endparam float param q2 caption = "function addition" default = 0.0 visible = @ymode<5 endparam float param q3 caption = "y-multiplier" default = 1.0 visible = @ymode>0 && @ymode<5 endparam float param q4 caption = "y-addition" default = 0.0 visible = @ymode>0 && @ymode<5 endparam float param s0 caption = "first term" default = 0.0 visible = @ymode==5 endparam float param s1 caption = "second term" default = 1.0 visible = @ymode==5 endparam float param s2 caption = "third term" default = -1.0 visible = @ymode==5 endparam float param s3 caption = "fourth term" default = 0.5 visible = @ymode==5 endparam float param v0 caption = "constant" default = 0.0 visible = @ymode==6 endparam float param v1 caption = "first term factor" default = 1.0 visible = @ymode==6 endparam float param v2 caption = "first term exponent" default = -1.0 visible = @ymode==6 endparam float param v3 caption = "second term factor" default = 0.5 visible = @ymode==6 endparam float param v4 caption = "second term exponent" default = 0.5 visible = @ymode==6 endparam switch: type="DopedDuckyM" bailout=bailout fnmain=fnmain w1=w1, w2=w2 xmode=xmode absx=absx p1=p1, p2=p2, p3=p3, p4=p4 r1=r1, r2=r2, r3=r3, r4=r4 u1=u1, u2=u2, u3=u3, u4=u4 ymode=ymode absy=absy q1=q1, q2=q2, q3=q3, q4=q4 s1=s1, s2=s2, s3=s3, s4=s4 v1=v1, v2=v2, v3=v3, v4=v4 } DopedDuckyM { init: complex z = @start complex c = #pixel complex z1 = (0.0,0.0) float x = 0.0, float y = 0.0 loop: z1 = z x = real(z), y = imag(z) if @absx, x = abs(x), endif if @xmode==0 x = @p1*x+@p2 elseif @xmode==1 x = @p1*sin(@p3*x+@p4)+@p2 elseif @xmode==2 x = @p1*asinh(@p3*x+@p4)+@p2 elseif @xmode==3 x = @p1*cos(@p3*x+@p4)+@p2 elseif @xmode==4 x = @p1*tan(@p3*x+@p4)+@p2 elseif @xmode==5 x = @r0 + @r1*x + @r2*x*x + @r3*x*x*x elseif @xmode==6 x = @u0 + @u1*x^@u2 + @u3*x^@u4 endif if @absy, y = abs(y), endif if @ymode==0 y = @q1*y+@q2 elseif @ymode==1 y = @q1*sin(@q3*y+@q4)+@q2 elseif @ymode==2 y = @q1*asinh(@q3*y+@q4)+@q2 elseif @xmode==3 y = @q1*cos(@q3*y+@q4)+@q2 elseif @xmode==4 y = @q1*tan(@q3*y+@q4)+@q2 elseif @ymode==5 y = @s0 + @s1*y+ @s2*y*y + @s3*y*y*y elseif @xmode==6 y = @v0 + @v1*x^@v2 + @v3*x^@v4 endif z = x + flip(y) z = 0.01*@w1*z + @w2*@fnmain(abs(z1)) + c bailout: |z| < @bailout default: title = "Doped Ducky M" center = (0.0,0.0) magn = 0.25 int param version default=100 visible=false endparam int param bailout caption = "bailout" default = 100000 endparam complex param start caption = "start" default = (1.0,0.5) endparam heading, caption = "general", endheading func fnmain caption = "main function" default = asinh() endfunc float param w2 caption = "main stem" default = 1.0 endparam float param w1 caption = "doping [%]" default = 1.0 endparam ;----------------------- heading, caption = "horizontal dope", endheading param xmode caption = "x-mode" default = 0 enum = "ident" "sin" "asinh" "cos" "tan" "poly 1" "poly 2" endparam bool param absx caption = "x absolute" default = false endparam float param p1 caption = "function multiplier" default = 1.0 visible = @xmode<5 endparam float param p2 caption = "function addition" default = 0.0 visible = @xmode<5 endparam float param p3 caption = "x-multiplier" default = 1.0 visible = @xmode>0 && @xmode<5 endparam float param p4 caption = "x-addition" default = 0.0 visible = @xmode>0 && @xmode<5 endparam float param r0 caption = "first term" default = 0.0 visible = @xmode==5 endparam float param r1 caption = "second term" default = 1.0 visible = @xmode==5 endparam float param r2 caption = "third term" default = 0.0 visible = @xmode==5 endparam float param r3 caption = "fourth term" default = 0.0 visible = @xmode==5 endparam float param u0 caption = "constant" default = 0.0 visible = @xmode==6 endparam float param u1 caption = "first term factor" default = 1.0 visible = @xmode==6 endparam float param u2 caption = "first term exponent" default = 2.0 visible = @xmode==6 endparam float param u3 caption = "second term factor" default = 0.0 visible = @xmode==6 endparam float param u4 caption = "second term exponent" default = 1.0 visible = @xmode==6 endparam ;----------------- heading, caption = "vertical dope", endheading param ymode caption = "y-mode" default = 0 enum = "ident" "sin" "asinh" "cos" "tan" "poly 1" "poly 2" endparam bool param absy caption = "y absolute" default = false endparam float param q1 caption = "function multiplier" default = 1.0 visible = @ymode<5 endparam float param q2 caption = "function addition" default = 0.0 visible = @ymode<5 endparam float param q3 caption = "y-multiplier" default = 1.0 visible = @ymode>0 && @ymode<5 endparam float param q4 caption = "y-addition" default = 0.0 visible = @ymode>0 && @ymode<5 endparam float param s0 caption = "first term" default = 0.0 visible = @ymode==5 endparam float param s1 caption = "second term" default = 1.0 visible = @ymode==5 endparam float param s2 caption = "third term" default = 0.0 visible = @ymode==5 endparam float param s3 caption = "fourth term" default = 0.0 visible = @ymode==5 endparam float param v0 caption = "constant" default = 0.0 visible = @ymode==6 endparam float param v1 caption = "first term factor" default = 1.0 visible = @ymode==6 endparam float param v2 caption = "first term exponent" default = 2.0 visible = @ymode==6 endparam float param v3 caption = "second term factor" default = 0.0 visible = @ymode==6 endparam float param v4 caption = "second term exponent" default = 1.0 visible = @ymode==6 endparam switch: type="DopedDuckyJ" seed=#pixel bailout=bailout fnmain=fnmain w1=w1, w2=w2 xmode=xmode absx=absx p1=p1, p2=p2, p3=p3, p4=p4 r1=r1, r2=r2, r3=r3, r4=r4 u1=u1, u2=u2, u3=u3, u4=u4 ymode=ymode absy=absy q1=q1, q2=q2, q3=q3, q4=q4 s1=s1, s2=s2, s3=s3, s4=s4 v1=v1, v2=v2, v3=v3, v4=v4 } DuckyVariantJ { ; May 19. 2015 init: complex z = #pixel complex c = @seed int iter = 0 loop: iter=iter+1 if @mode==0 if iter<@itertrans z = abs(@fna(z))+ c else z = @p*abs(@fnb(z))+ @ctr endif elseif @mode==1 halfi=0.5*iter if halfi-trunc(halfi)==0.5 z = abs(@fna(z))+ c else z = @p*abs(@fnb(z))+ @ctr endif elseif @mode==2 z = abs(@fna(z))+0.01*@p*abs(@fnb(z+@ctr)) + c elseif @mode==3 z = abs(@fna(z))+0.01*@p*@fnb(z+@ctr) + c endif bailout: |z| < @bailout default: title = "Ducky Variant [J]" center = (0.0,0.0) magn = 0.25 int param version caption = "version" default = 100 visible = false endparam int param bailout caption = "bailout" default = 100000 endparam param mode caption = "mode" default = 0 enum = "Lucky Lite" "Alternating" "Symmetric doping" "Asymmetric doping" endparam int param itertrans caption = "iteration transition" default = 100 visible = @mode==0 endparam complex param seed caption = "seed" default = (-0.28,-0.6) endparam func fna caption = "main function" default = asinh() endfunc func fnb caption = "second function" default = sin() endfunc complex param ctr caption = "vector" default = (-0.27,-0.65) endparam complex param p caption = "scale" default = (1.18,0.05) endparam switch: type = "DuckyVariantM" version=version bailout=bailout mode=mode itertrans=itertrans fna=fna fnb=fnb ctr=ctr p=p } DuckyVariantM { ; May 19. 2015 init: complex z = @start complex c = #pixel int iter = 0 loop: iter=iter+1 if @mode==0 if iter<@itertrans z = abs(@fna(z))+ c else z = @p*abs(@fnb(z))+ @ctr endif elseif @mode==1 halfi=0.5*iter if halfi-trunc(halfi)==0.5 z = abs(@fna(z))+ c else z = @p*abs(@fnb(z))+ @ctr endif elseif @mode==2 z = abs(@fna(z))+0.01*@p*abs(@fnb(z+@ctr)) + c elseif @mode==3 z = abs(@fna(z))+0.01*@p*@fnb(z+@ctr) + c endif bailout: |z| < @bailout default: title = "Ducky Variant [M]" center = (0.0,0.0) magn = 0.25 int param version caption = "version" default = 100 visible = false endparam int param bailout caption = "bailout" default = 100000 endparam param mode caption = "mode" default = 0 enum = "Lucky Lite" "Alternating" "Symmetric doping" "Asymmetric doping" endparam int param itertrans caption = "iteration transition" default = 100 visible = @mode==0 endparam complex param seed caption = "start" default = (0.0,0.0) endparam func fna caption = "main function" default = asinh() endfunc func fnb caption = "second function" default = sin() endfunc complex param ctr caption = "vector" default = (-0.27,-0.65) endparam complex param p caption = "scale" default = (1.18,0.05) endparam switch: type = "DuckyVariantJ" seed = #pixel version=version bailout=bailout mode=mode itertrans=itertrans fna=fna fnb=fnb ctr=ctr p=p } Hokum { init: complex z = #pixel complex c = @seed int iter = 0 import "ea.ulb" loop: iter = iter+1 if @se if @version==100 if @pos1 z = ea_ConversionMenu.Hokum(z,@mode1,@p1,100) endif elseif @version>100 if @pos1 && iter<=@hokend1 z = ea_ConversionMenu.Hokum(z,@mode1,@p1,100) endif endif if @fchoice1==0 z = @fna(z) elseif @fchoice1==1 z = ea_ConversionMenu.Gonio(z,@fmode1,@a10,@a11,@a12,@a13,@a14,100) endif z = exp(1i*@u1*pi/180)*z + @u2 arg = round(atan2(z)/(2*pi)*@order)/@order*2*pi z = z*exp(-1i*arg) endif ;------------------------------------------------------------------------------- if @version==100 if @pos2 z = ea_ConversionMenu.Hokum(z, @mode2, @p2, 100) endif elseif @version>100 if @pos2 && iter<=@hokend2 z = ea_ConversionMenu.Hokum(z, @mode2, @p2, 100) endif endif if @fl==0 if @fchoice2==0 z = abs(@fnb(z)) elseif @fchoice2==1 z = abs(ea_ConversionMenu.Gonio(z,@fmode2,@a20,@a21,@a22,@a23,@a24,100)) endif elseif @fl==1 if @fchoice2==0 z = @fnb(abs(z)) elseif @fchoice2==1 z = ea_ConversionMenu.Gonio(abs(z),@fmode2,@a20,@a21,@a22,@a23,@a24,100) endif endif z = z + c ;------------------------------------------------------------------------------- if @version==100 if @pos3 z = ea_ConversionMenu.Hokum(z,@mode3,@p3,100) endif elseif @version>100 if @pos3 && iter<=@hokend3 z = ea_ConversionMenu.Hokum(z,@mode3,@p3,100) endif endif if @endlog, z = log(z), endif if @fchoice3==0 z = @fnc(z) elseif @fchoice3==1 z = ea_ConversionMenu.Gonio(z,@fmode3,@a30,@a31,@a32,@a33,@a34,100) elseif @fchoice3==2 z = ea_ConversionMenu.ChebyBas(z,@kind3,@n3,100) endif z = @q1*z + @q2 bailout: |z| < @bailout default: title = "Hokum" center = (0.0,0.0) magn = 0.25 int param version caption = "version" default = 101 visible = false endparam heading caption = "NO IMAGE ?" text = "Open 'Inside Coloring'." ; text = "1] Open 'Inside Coloring'." endheading ; heading ; caption = "STILL NO SATISFYING IMAGE ?" ; text = "2] Lower 'Maximum Iterations', e.g. to 10 or even lower." ; endheading heading caption = "Note" text = "It is possible to make 'real' fractals with 'Hokum', \ but sometimes they are not. Some have a glassy or jelly \ look. Often the best results are with only a few iterations." endheading int param bailout caption = "bailout" default = 100000 endparam complex param seed caption = "Seed" default = (-0.3,-0.8) endparam param fl caption = "flavor" enum = "A" "B" hint = "In many cases there is no difference between A and B" default = 0 endparam ;---------------------------------------------------------------- heading caption = "1st Step: Preparation" endheading bool param se caption = "Sam's addition" default = false endparam bool param pos1 caption = "Pre Hokum conversion" default = false endparam int param hokend1 caption = "End Hokum 1" default = 500 endparam param mode1 caption = "mode 1" enum = "A" "B" "C" "D" "E" "F" "G" default = 1 visible = @se==true && @pos1==true endparam float param p1 caption = "argument modifier" default = 1.0 visible = @se==true && @pos1==true endparam int param order caption = "order" default = 1 visible = @se==true endparam param fchoice1 caption = "pre function choice" enum = "standard" "gonio" ;"Cheby Basic" default = 0 visible = @se==true endparam func fna caption = "standard pre function" default = ident() visible = @se==true && @fchoice1==0 endfunc param fmode1 caption = "gonio function" enum = "sin" "cos" "tan" "cotan" "sec" "cosec" \ "sinh" "cosh" "tanh" "cotanh" "sech" "cosech" \ "asin" "acos" "atan" "acotan" "asec" "acosec" \ "asinh\acosh" "atanh\acotanh" "asech\acosech" default = 0 visible = @se==true && @fchoice1==1 endparam float param a10 caption = "gonio modifier" default = 0.0 visible = @se==true && @fchoice1==1 endparam float param a11 caption = "gonio changer 1" default = 1.0 visible = @se==true && @fchoice1==1 endparam float param a12 caption = "gonio changer 2" default = 1.0 visible = @se==true && @fchoice1==1 endparam float param a13 caption = "gonio changer 3" default = 1.0 visible = @se==true && @fchoice1==1 && (@fmode1==2 || @fmode1==3 || @fmode1==8 || @fmode1==9 || @fmode1>11) endparam float param a14 caption = "gonio changer 4" default = 1.0 visible = @se==true && @fchoice1==1 && (@fmode1==2 || @fmode1==3 || @fmode1==8 || @fmode1==9 || @fmode1>11) endparam float param u1 caption = "Angle (deg)" default = 0.0 visible = @se==true endparam complex param u2 caption = "Twist" default = (1.0,0.0) visible = @se==true endparam ;---------------------------------------------------------------- heading caption = "2nd Step: Main Operation" endheading bool param pos2 caption = "Main Hokum Conversion" default = true endparam int param hokend2 caption = "End Hokum 2" default = 10 visible = @pos2==true endparam param mode2 caption = "mode 2" enum = "A" "B" "C" "D" "E" "F" "G" default = 1 visible = @pos2==true endparam float param p2 caption = "argument modifier" default = 1.0 visible = @pos2==true endparam param fchoice2 caption = "main function choice" enum = "standard" "gonio" default = 0 endparam func fnb caption = "main function" default = asinh() visible = @fchoice2==0 endfunc param fmode2 caption = "main function" enum = "sin" "cos" "tan" "cotan" "sec" "cosec" \ "sinh" "cosh" "tanh" "cotanh" "sech" "cosech" \ "asin" "acos" "atan" "acotan" "asec" "acosec" \ "asinh\acosh" "atanh\acotanh" "asech\acosech" default = 0 visible = @fchoice2==1 endparam float param a20 caption = "main function modifier" default = 0.0 visible = @fchoice2==1 endparam float param a21 caption = "main function changer 1" default = 1.0 visible = @fchoice2==1 endparam float param a22 caption = "main function changer 2" default = 1.0 visible = @fchoice2==1 endparam float param a23 caption = "main function changer 3" default = 1.0 visible = @fchoice2==1 && (@fmode2==2 || @fmode2==3 || @fmode2==8 || @fmode2==9 || @fmode2>11) endparam float param a24 caption = "main function changer 4" default = 1.0 visible = @fchoice2==1 && (@fmode2==2 || @fmode2==3 || @fmode2==8 || @fmode2==9 || @fmode2>11) endparam ;---------------------------------------------------------------- heading caption = "3rd Step: Post opertion" endheading bool param pos3 caption = "Post Hokum Conversion" default = false endparam param mode3 caption = "mode 3" enum = "A" "B" "C" "D" "E" "F" "G" default = 1 visible = @pos3==true endparam int param hokend3 caption = "End Hokum 3" default = 500 visible = @pos3==true endparam float param p3 caption = "argument modifier" default = 1.0 visible = @pos3==true endparam bool param endlog caption = "log at end" default = false endparam float param q1 caption = "end modifier 1" default = 1.0 endparam float param q2 caption = "end modifier 2" default = 0.0 endparam param fchoice3 caption = "end function choice" enum = "standard" "gonio" "Cheby Basic" default = 0 endparam func fnc caption = "end function" default = ident() visible = @fchoice3==0 endfunc param fmode3 caption = "end function" enum = "sin" "cos" "tan" "cotan" "sec" "cosec" \ "sinh" "cosh" "tanh" "cotanh" "sech" "cosech" \ "asin" "acos" "atan" "acotan" "asec" "acosec" \ "asinh\acosh" "atanh\acotanh" "asech\acosech" default = 0 visible = @fchoice3==1 endparam float param a30 caption = "end changer" default = 0.0 visible = @fchoice3==1 endparam float param a31 caption = "end changer 1" default = 1.0 visible = @fchoice3==1 endparam float param a32 caption = "end changer 2" default = 1.0 visible = @fchoice3==1 endparam float param a33 caption = "end changer 3" default = 1.0 visible = @fchoice3==1 && (@fmode3==2 || @fmode3==3 || @fmode3==8 || @fmode3==9 || @fmode3>11) endparam float param a34 caption = "end changer 4" default = 1.0 visible = @fchoice3==1 && (@fmode3==2 || @fmode3==3 || @fmode3==8 || @fmode3==9 || @fmode3>11) endparam param kind3 caption = "Cheby Polynomial Kind" enum = "I" "II" default = 0 visible = @fchoice3==2 endparam int param n3 caption = "# Polynomial (3-12)" default = 6 min = 1, max = 12 visible = @fchoice3==2 endparam } DuckyPlus { ; 1016 May 16 init: complex z = (0.0,0.0) complex c = (0.0,0.0) if @mode == "Mandelbrot" z = @start c = #pixel elseif @mode == "Julia" z = #pixel c = @seed endif int iter = 0 complex z0 = (0.0,0.0) complex z1 = (0.0,0.0) int n1 = @n1 int n2 = @n2 if n2<=n1, n2 = n1+1, endif float x = 0.0 float x0 = 0.0 float x1 = 0.0 float y = 0.0 float y0 = 0.0 float y1 = 0.0 float vx = 0.0 float vy = 0.0 float wx = 0.0 float wy = 0.0 float px = real(@p2) float py = imag(@p2) import "ea.ulb" complex func SamPre(complex z, int order, float u1, complex u2) float arg = 0.0 z = exp(1i*u1*pi/180)*z + u2 arg = round(atan2(z)/(2*pi)*order)/order*2*pi return z*exp(-1i*arg) endfunc loop: iter = iter + 1 ; Step I if iter=n1 && iter<=n2 if @code>2 z0 = z + @q2 if @sam z0 = SamPre(z0,@order,@u1,@u2) endif if @hokum x0 = cabs(z0), y0 = atan2(z0) else x0 = real(z0), y0 = imag(z0) endif x = ea_ConversionMenu.FloatFunc(abs(x0),@kx,@xshift,100) y = ea_ConversionMenu.FloatFunc(abs(y0),@ky,@yshift,100) x1 = ea_ConversionMenu.FloatFunc(x0,@kx,@xshift,100) y1 = ea_ConversionMenu.FloatFunc(y0,@ky,@yshift,100) else z = z + @q2 z1 = @fnb(z) z = @fnb(abs(z)) if @sam z = SamPre(z,@order,@u1,@u2) z1 = SamPre(z1,@order,@u1,@u2) endif if @hokum vx = cabs(z), vy = atan2(z) wx = cabs(z1), wy = atan2(z1) else vx = real(z), vy = imag(z) wx = real(z1), wy = imag(z1) endif endif if @code==0; ducky if @double z = (px*vx + py*flip(vy))^@md vx = real(z), vy = imag(z) endif z = (px*vx + py*flip(vy))^@m + @c2 elseif @code==1; ducks if @double z = (px*vx + py*flip(wy))^@md vx = real(z), wy = imag(z) endif z = (px*vx + py*flip(wy))^@m + @c2 elseif @code==2; anatra if @double z = (px*wx + py*flip(vy))^@md if @DPl_version==100 wy = real(z) elseif @DPl_version>100 wx = real(z) endif vy = imag(z) endif z = (px*wx + py*flip(vy))^@m + @c2 elseif @code==3; burning ship if @double z = (px*x + py*flip(y))^@md x = real(z), y = imag(z) endif z = (px*x + py*flip(y))^@mm + @c2 elseif @code==4; bs ducks if @double z = (px*x1 + py*flip(y))^@md x1 = real(z), y = imag(z) endif z = (px*x1 + py*flip(y))^@mm + @c2 elseif @code==5; bs anatra if @double z = (px*x + py*flip(y1))^@md x = real(z), y1 = imag(z) endif z = (px*x + py*flip(y1))^@mm + @c2 endif if @midlog, z = log(z), endif ; Step III elseif iter>=n2 z = @fnc(abs(z+@q3)) z = real(@p3)*real(z) + imag(@p3)*flip(imag(z)) + @c3 endif ; End of each iteration z = z + @q4 if @lef if iter<@n3 z = z + c else z = @fnd(z) + c endif else z = @fnd(z) + c endif bailout: |z| < @bailout default: title = "Ducky Plus" magn = 1 center = (0,0) int param DPl_version caption = "DPl_version" default = 101 visible = false endparam param mode caption = "Current Mode" enum = "Mandelbrot" "Julia" default = 0 endparam param switchto caption = "Switch To" enum = "Mandelbrot" "Julia" default = 1 visible = @mode==0 endparam complex param seed caption = "Seed" default = (-0.3,-0.8) visible = @mode==1 endparam complex param start caption = "Start" default = (0.0,0.0) visible = @mode==0 endparam int param bailout caption = "Bailout" default = 100000 endparam heading caption = "NO IMAGE ? OPEN 'INSIDE COLORING' !" text = "" endheading heading caption = "DIVIDING THE THREE STEPS" endheading heading caption = "IMPORTANT: Don't forget the adjustment of 'Maximum Iterations'" endheading int param n1 caption = "End of First Step [n1]" default = 10 hint = "Don't you want a first step? Then adjust n1 = 0" endparam int param n2 caption = "Start of Last Step [n2]" default = 11 hint = "Don't you want a last step? Then adjust n2 = 'Maximum Iterations' or higher" endparam ;---------------------------------- ; STEP I ;---------------------------------- heading caption = "First Step" endheading func fna caption = "Function" default = asinh() endfunc complex param q1 caption = "Function Correction" default = (0.0,0.0) endparam complex param p1 caption = "Modifier" default = (1.0,1.0) endparam complex param c1 caption = "Extra J-vector" default = (0.0,0.0) endparam ;---------------------------------- ; STEP II ;---------------------------------- heading caption = "Second Step" endheading bool param sam caption = "Monnier Preparation" default = false endparam int param order caption = "Order" default = 1 visible = @sam==true endparam float param u1 caption = "Angle (deg)" default = 0.0 visible = @sam==true endparam complex param u2 caption = "Twist" default = (0.0,0.0) visible = @sam==true endparam bool param hokum caption = "Hokum" default = false endparam param code caption = "code" enum = "Ducky" "Ducks" "Anatra" "Burning Ship" "BS Ducks" "BS Anatra" default = 0 endparam func fnb caption = "Function" default = asinh() visible = @code<3 endfunc complex param q2 caption = "Function Correction" default = (0.0,0.0) visible = @code<3 endparam param kx caption = "Function [Re])" enum = "ident" "sqr" "sqrt" "log" "exp" "sin" "asin" "sinh" "asinh" "cos"\ "acos" "cosh" "acosh" "sec" "csc" "sech" "csch" "tan" "atan" "tanh"\ "atanh" "cotan" "cotanh" "abs" "recip" "round" "trunc" "ceil" "floor" default = 0 visible = @code>2 endparam float param xshift caption = "Function [Re] Correction" default = 0.0 visible = @code>2 endparam param ky caption = "Function [Im]" enum = "ident" "sqr" "sqrt" "log" "exp" "sin" "asin" "sinh" "asinh" "cos"\ "acos" "cosh" "acosh" "sec" "csc" "sech" "csch" "tan" "atan" "tanh"\ "atanh" "cotan" "cotanh" "abs" "recip" "round" "trunc" "ceil" "floor" default = 0 visible = @code>2 endparam float param yshift caption = "Function [Im] Correction" default = 0.0 visible = @code>2 endparam complex param p2 caption = "Modifier" default = (1.0,1.0) endparam complex param c2 caption = "Extra J-vector" default = (0.0,0.0) endparam float param m caption = "Main Exponent" default = 1.0 visible = @code<3 endparam float param mm caption = "Main Exponent" default = 2.0 visible = @code>2 endparam bool param double caption = "Double Clutch" default = false hint = "You don't need to double clutch yourself, the fractal code does. \ The formula is used two times, as a function in a function: \ fn(fn(z))." endparam float param md caption = "Double Clutch Exponent" default = 1.0 endparam bool param midlog caption = "Logarithmic Transition" default = false endparam ;---------------------------------- ; STEP III ;---------------------------------- heading caption = "Last Step" endheading func fnc caption = "Function" default = asinh() endfunc complex param q3 caption = "Function Correction" default = (0.0,0.0) endparam complex param p3 caption = "Modifier" default = (1.0,1.0) endparam complex param c3 caption = "Extra J-vector" default = (0.0,0.0) endparam ;---------------------------------- ; End of each iteration ;---------------------------------- heading caption = "------------------------------------" endheading bool param lef caption = "Limited End Function" default = false endparam int param n3 caption = "Start End Function" default = 15 visible = @lef==true endparam func fnd caption = "End Function" default = ident() endfunc complex param q4 caption = "End Function Correction" default = (0.0,0.0) endparam switch: type="DuckyPlus" mode=switchto switchto=mode seed=#pixel bailout=bailout DPl_version=DPl_version n1=n1, n2=n2, n3=n3 p1=p1, p2=p2, p3=p3 q1=q1, q2=q2, q3=q3, q4=q4 c1=c1, c2=c2, c3=c3 fna=fna, fnb=fnb, fnc=fnc, fnd=fnd sam=sam, order=order, u1=u1, u2=u2 hokum=hokum, code=code, double=double m=m, mm=mm, md=md kx=kx, ky=ky, xshift=xshift, yshift=yshift midlog=midlog, lef = lef } Smient20160731 { init: if @mode == "Mandelbrot" z = @start if z==(0.0,0.0), z = (0.0,0.01), endif c = #pixel elseif @mode == "Julia" z = #pixel c = @seed endif int iter = 0 complex u = (0.0,0.0) complex v = (0.0,0.0) complex func Dmain(complex u, complex v, int mode) complex result = (0.0,0.0) if mode==0 result = v elseif mode==1 result = abs(u) elseif mode==2 result = real(u) + flip(imag(v)) elseif mode==3 result = real(v) + flip(imag(u)) endif return result endfunc loop: iter = iter + 1 if iter==@trans_val if @tmode==0 z = @ft*@fnt(abs(z)) elseif @tmode==1 z = @ft*abs(@fnt(z)) elseif @tmode==2 z = @ft*@fnt(z) elseif @tmode==3 z = @ft*cabs(@fnt(z)) + flip(@gt*atan2(@fnt(z))) endif z = z + @ct if @rep==true, iter = 0, endif elseif @rep==true || (@rep==false && iter<@trans_val) u = @fna(z), v = @fna(abs(z)) z = Dmain(u,v,@amode) elseif @rep==false && iter>@trans_val u = @fne(z), v = @fne(abs(z)) z = Dmain(u,v,@emode) z = @fe*z + @ce endif if @endlog, z = log(z), endif z = z + c bailout: |z| < 1E12 default: title = "Widgeon" int param vs default = 100 visible = false endparam heading caption = "General" endheading param mode caption = "Switch Mode" enum = "Mandelbrot" "Julia" default = 0 endparam param switchto caption = "Switch To" enum = "Mandelbrot" "Julia" default = 1 visible = @mode==0 endparam complex param seed caption = "Seed" default = (-0.3,-0.8) visible = @mode==1 endparam complex param start caption = "Start" default = (0.0,0.0) visible = @mode==0 endparam int param bailout caption = "Bailout" default = 100000 endparam int param trans_val caption = "transition value" default = 10 endparam bool param rep caption = "repetativ" default = false endparam bool param endlog caption = "end log" default = false endparam heading caption = "Pre iterations" visible = @rep==false endheading heading caption = "Main iterations" visible = @rep==true endheading param amode caption = "main mode" enum = "A" "B" "C" "D" default = 0 endparam func fna caption = "main function" default = asinh() endfunc heading caption = "Transition iteration" endheading param tmode caption = "Transition mode" enum = "A" "B" "C" "D" default = 2 endparam float param ft caption = "1st transition factor" default = 1.0 endparam func fnt caption = "transition function" default = asinh() endfunc complex param ct caption = "transition vector" default = (0.0,0.0) endparam float param gt caption = "2nd transition factor" default = 1.0 visible = @tmode==3 endparam heading caption = "Post iterations" visible = @rep==false endheading param emode caption = "end mode" enum = "A" "B" "C" "D" default = 0 visible = @rep==false endparam func fne caption = "end function" default = asinh() visible = @rep==false endfunc float param fe caption = "end factor" default = 1.0 visible = @rep==false endparam complex param ce caption = "end vector" default = (0.0,0.0) visible = @rep==false endparam switch: type = "Smient20160731" mode=switchto switchto=mode seed = #pixel bailout = bailout rep=rep trans_val= trans_val amode=amode fna=fna tmode=tmode ft=ft fnt=fnt ct=ct gt=gt emode=emode fne=fne fe=fe ce=ce endlog = endlog } Windmill { ; 2016 Oct.3 ; With thanks to Ron Barnett and Otto Magus ; for the use of their list of extended functions. global: import "ea.ulb" init: ; complex z = (0.0,0.0) ; complex c = (0.0,0.0) if @mode == "Mandelbrot" z = @start if z==(0.0,0.0), z = (0.0,0.01), endif c = #pixel elseif @mode == "Julia" z = #pixel c = @seed endif complex tmp = (0,0) float x = 0.0 float y = 0.0 loop: x = real(z) y = imag(z) if x>=0.0 && y>=0.0 ; quadrant I if @switcha==0 if @fextra==0 z = @fna(z) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(z,@fmode,100) endif elseif @switcha==1 tmp = y+flip(x) if @fextra==0 if @vs==100, z = tmp, else, z= @fna(tmp), endif elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(tmp,@fmode,100) endif endif elseif x<0.0 && y>=0.0 ; quadrant II if @switchb==0 if @fextra==0 z = @fna(abs(z)) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(abs(z),@fmode,100) endif elseif @switchb==1 tmp = y+flip(-x) if @fextra==0 z = @fna(tmp) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(tmp,@fmode,100) endif elseif @switchb==2 if @fextra==0 z = @fna(z) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(z,@fmode,100) endif endif elseif x<0.0 && y<0.0 ; ; quadrant III if @switchc==0 if @fextra==0 z = @fna(abs(z)) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(abs(z),@fmode,100) endif elseif @switchc==1 tmp = -y+flip(-x) if @fextra==0 z = @fna(tmp) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(tmp,@fmode,100) endif elseif @switchc==2 if @fextra==0 z = @fna(z) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(z,@fmode,100) endif endif elseif x>=0.0 && y<0.0 ; quadrant IV if @switchd==0 if @fextra==0 z = @fna(abs(z)) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(abs(z),@fmode,100) endif elseif @switchd==1 tmp = -y+flip(x) if @fextra==0 z = @fna(tmp) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(tmp,@fmode,100) endif elseif @switchd==2 if @fextra==0 z = @fna(z) elseif @fextra==1 z = ea_ConversionMenu.REB_OM_FuncCmpl(z,@fmode,100) endif endif endif z = z + c if @endlog, z = log(z), endif bailout: |z| < 1E12 default: title = "Windmill" int param vs default = 101 visible = false endparam param mode caption = "Switch Mode" enum = "Mandelbrot" "Julia" default = 0 endparam param switchto caption = "Switch To" enum = "Mandelbrot" "Julia" default = 1 visible = @mode==0 endparam complex param seed caption = "Seed" default = (-0.3,-0.8) visible = @mode==1 endparam complex param start caption = "Start" default = (0.0,0.0) visible = @mode==0 endparam param fextra caption = "function mode" enum = "standard" "Barnett/Magus" default = 0 endparam func fna caption = "main function" default = asinh() visible = @fextra==0 endfunc param @fmode ; list functions from Ron Barnett caption = "main function" enum = \ "ident" "sinxx" "cosec" "sinc" "haversin" \ "versin" "sinhc" "ahaversin" "aversin" "cosxx" \ "havercos" "exsec" "excsc" "aexsec" "aexcsc" \ "vercos" "sec" "asec" "acsc" "ahavercos"\ "avercos" "tanc" "tanhc" "coversin" "acoversin"\ "hacoversin" "covercos" "acovercos" "hacovercos" "acotan" \ "acotanh" "sech" "crd" "acrd" "asech" \ "cosech" "acosech" "coshc" "cosc" "cotanc" \ "cotanhc" "secc" "sechc" "cosecc" "cosechc" \ "logistic" "softplus" "primecount" "atan2" "cube" \ "cuberoot" "logit" "colog" "gauss" "gd" \ "agd" "sigmoid" default = 1 visible = @fextra==1 endparam param switcha caption = "Switch A" enum = "function only (=abs)" "complement" default = 0 endparam param switchb caption = "Switch B" enum = "abs" "complement" "function only" default = 1 endparam param switchc caption = "Switch C" enum = "abs" "complement" "function only" default = 0 endparam param switchd caption = "Switch D" enum = "abs" "complement" "function only" default = 1 endparam bool param endlog caption = "log at end" default = false endparam switch: type = "Windmill" mode=switchto switchto=mode seed = #pixel bailout = bailout switcha = switcha switchb = switchb switchc = switchc switchd = switchd fmode = fmode endlog = endlog fna = fna fextra = fextra }