comment { Helpfiles / Fichiers d'aide: http://www.pruniermei.ca/mde-help.zip Pour me contacter / To contact me: http://www.pruniermei.ca - Le code fBm vient de Damien Jones. Merci Damien pour ta permission. - The fBm code comes from Damien Jones. Thanks Damien for your permission. - Le code de masquage vient de Andreas Lober. Merci Andreas. - The code for masking comes from Andreas Lober. Danke Schön, Andreas. - Merci à Kerry Mitchell pour la permission de publier fBm Gauss et fBm Pythagore, ma version personnelle de Gaussian Integer & Pythagorician Triple. - Thanks to Kerry Mitchell for the permission to publish fBm Gauss & fBm Pythogore, ma personal versions of his Gaussian Interger & Pythagorician Triple. } md-ifs-e {; English version of mde.IFS ; Michèle Dessureault, 30 décembre 1999 ; ; D'après Roger Stevens, "Fractal programming in C", ; p.394 à 397 ; ; Mark Townsend m'a inspiré pour les modes de coloration ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float x = 0 float y = 0 int iter = 0 float dist = 0 int min_trap_iter = 0 int max_trap_iter = 0 float min_dist = 1e20 float max_dist = 0.0 float a1=0 float a2=0 float a3=0 float a4=0 float b1=0 float b2=0 float b3=0 float b4=0 float c1=0 float c2=0 float c3=0 float c4=0 float d1=0 float d2=0 float d3=0 float d4=0 float e1=0 float e2=0 float e3=0 float e4=0 float f1=0 float f2=0 float f3=0 float f4=0 float a=0 float b=0 float c=0 float d=0 float e0=0 float f=0 float p=0 float r1=0 float r2=0 float r3=0 float r4=0 float phi =0 min_trap_z=0 max_trap_z=0 if @figure == 0 ;Sierpinsky a1=a2=a3=d1=d2=d3=e3=f3=0.5 e2=1.0 r1=10813.0 r2=21626.0 r3=32767.0 endif if @figure == 1 ;fougère a2=f2=f3=f4=0.2 a3=-0.15 a4=d4=0.85 b2=-0.26 b3=0.28 b4=0.04 c2=0.23 c3=0.26 c4=-0.04 d1=0.16 d2=0.22 d3=0.24 r1=328.0 r2=2621.0 r3=4915.0 r4=32767.0 endif if @figure == 2 ; arbre a2=d2=0.1 a3=b4=c3=d3=d4=0.42 a4=b3=c4=-0.42 d1=0.5 f2=f3=f4=0.2 r1=1638.0 r2=6553.0 r3=19660.0 r4=32767.0 endif if @figure == 3 ; arbre de Cantor a1=a2=d1=d2=0.333 a3=d3=0.667 e2=1.0 e3=f3=0.5 r1=10813.0 r2=21626.0 r3=32767.0 endif loop: if @hasard == 1 p = real(#random*#z)*32767.0 elseif @hasard == 2 p = imag(#random*#z)*32767.0 elseif @hasard == 0 ; pas de hasard p = (real(#z)+imag(#z)) % 32767 elseif @hasard == 3 p = (real(#random*#z)+imag(#random*#z)) *32767.0 elseif @hasard == 4 p = (real(#random*#z)-imag(#random*#z)) *32767.0 elseif @hasard == 5 p = (real(#random*#z)*imag(#random*#z)) *32767.0 elseif @hasard == 6 p = (real(#random*#z)/imag(#random*#z)) *32767.0 elseif @hasard == 7 p = (imag(#random*#z)/real(#random*#z)) *32767.0 elseif @hasard == 8 p = (real(#random*#z)^imag(#random*#z)) *32767.0 else p = (imag(#random*#z)^real(#random*#z)) *32767.0 endif if p <= r1 a = a1 b = b1 c = c1 d = d1 e0 = e1 f = f1 endif if p > r1 && p <= r2 a = a2 b = b2 c = c2 d = d2 e0 = e2 f = f2 endif if p > r2 && p <= r3 a = a3 b = b3 c = c3 d = d3 e0 = e3 f = f3 endif if p > r3 && p <= r4 && (@figure == 1 || @figure == 2) a = a4 b = b4 c = c4 d = d4 e0 = e4 f = f4 endif x = a*real(#z) + b*imag(#z) + e0 y = c*real(#z) + d*imag(#z) + f w = x + flip(y) dist = cabs(#z-w) phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if dist < min_dist min_dist = dist min_trap_z = #z min_trap_iter = iter endif if dist > max_dist max_dist = dist max_trap_z = #z max_trap_iter = iter endif iter = iter + 1 final: float mask = 0 if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(dist+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = true endif endif endif if @color == 0 #index = min_dist elseif @color == 1 #index = cabs(min_trap_z) elseif @color == 2 #index = 0.01 * min_trap_iter elseif @color == 3 #index = abs(real(min_trap_z)) elseif @color == 4 #index = abs(imag(min_trap_z)) elseif @color == 5 theta = atan2(min_trap_z) if theta < 0 theta = theta + 2 * #pi endif theta = 1 / (2 * #pi) * theta #index = real(theta) elseif @color == 6 #index = max_dist elseif @color == 7 #index = cabs(max_trap_z) elseif @color == 8 #index = 0.01 * max_trap_iter elseif @color == 9 #index = abs(real(max_trap_z)) elseif @color == 10 #index = abs(imag(max_trap_z)) elseif @color == 11 theta = atan2(max_trap_z) if theta < 0 theta = theta + 2 * #pi endif theta = 1 / (2 * #pi) * theta #index = real(theta) endif default: title = "Ifs" helpfile="mde-help\mde-IFS.htm" param color caption = "Colouring Mode" enum = "distance min" "magnitude min" "iteration min" "real min" \ "imaginary min" "angle min" "distance max" "magnitude max" \ "iteration max" "real max" "imaginary max" "angle max" endparam param figure caption = "Figure" enum = "sierpinsky" "fern" "tree" "Cantor tree" endparam param hasard caption ="Chaos" enum="no" "real" "imag" "real+imag" "real-imag" "real*imag" \ "real/imag" "imag/real" "real^imag" "imag^real" hint="How to apply the randomizing factor of the IFS figure" endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fm caption = "Masking Function" default = ident() endfunc } md-courbes-e { ; English version of mde.COURBES ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; Michèle Dessureault, 12 décembre 1999 ; Avec emprunt d'une portion de 'Gaussian Integer' ; de Kerry Mitchell ; Équations paramétriques de l'épicycloïde (spirographe) ; x = (a+b)*cos(z) - b*cos(((a+b)/b)*z) ; y = (a+b)*sin(z) - b*sin(((a+b)/b)*z) ; Équations paramétriques des figures de Lissajou: ; x = cos(a*z) ; y = sin(b*z) ; ; Ajout d'un paramètre 'hasard' le 22 mars 2000 ; et d'autres courbes. ; ; Ajout d'une texture fBm le 8 avril 2000 ; Le code vient de Damien Jones & Mark Townsend ; Merci à eux pour la permission de publier ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float rave=0.0 float total=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x=(0.0,0.0) y=(0.0,0.0) float texture=0.0 float phi=0.0 p=(0.0,0.0) loop: if @courbe == 0 ;épicycloïde x = (@a+@b)*cos(#z)- @b*cos(((@a+@b)/@b)*#z) y = (@a+@b)*sin(#z)- @b*sin(((@a+@b)/@b)*#z) elseif @courbe == 1 ;lissajou x = real(cos(@a*#z)) y = imag(sin(@b*#z)) elseif @courbe == 2 ;compagnon du cycloïde x = real(@a*#z) y = imag(@a*(1-cos(#z))) elseif @courbe == 3 ;cycloïde x = real(@a*#z - @b*sin(#z)) y = imag(@a*-@b*cos(#z)) elseif @courbe == 4 x = real(@a*cos(#z)) ;ellipse y = imag(@b*sin(#z)) elseif @courbe == 5 x = real(@a*cos(#z)*cos(#z)*cos(#z)) ;évolute de l'ellipse y = imag(@b*sin(#z)*sin(#z)*sin(#z)) elseif @courbe == 6 x = real(@b*@a*#z / (1+#z^3)) ;folium de Descartes y = imag(@b*@a+#z^2 / (1+#z^3)) elseif @courbe == 7 ;involute du cercle x = real(@a*cos(#z) + @a*#z*sin(#z)) y = imag(@a*sin(#z) - @a*#z*cos(#z)) elseif @courbe == 8 ;nephroïde x = real(@a*.5*(@b*cos(#z) - cos(@b*#z))) y = imag(@a*.5*(@b*sin(#z) - sin(@b*#z))) elseif @courbe == 9 ;courbe serpentine x = real(@a*cotan(#z)) y = imag(@b*sin(#z)*cos(#z)) elseif @courbe == 10 ;sorcière d'Agnesi x = real(@a*cotan(#z)) y = imag(@b*sin(#z)*sin(#z)) elseif @courbe == 11 ;tractrice x = real(#z-@a*tanh(#z/@a)) y = imag(@a/sinh(#z/@a)) elseif @courbe == 12 ;épicycloïde 2 x = real((@a+@b)*cos(#z)- @b*cos(((@a+@b)/@b)*#z)) y = imag((@a+@b)*sin(#z)- @b*sin(((@a+@b)/@b)*#z)) endif if @coord == 1 rho = sqrt(sqr(x)+sqr(y)) theta = atan2(y/x) if theta < 0 theta = theta + 2 * #pi endif x = rho y = theta endif if @applic == 0 z= x * (1.0,0.0) + y * (0.0,1.0) elseif @applic == 1 z= @fn1(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 2 z= x * (1.0,0.0) + @fn1(y * (0.0,1.0)) elseif @applic == 3 z= @fn2(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 4 z= x * (1.0,0.0) + @fn2(y * (0.0,1.0)) elseif @applic == 5 z= @fn1(x * (1.0,0.0)) + @fn2(y * (0.0,1.0)) elseif @applic == 6 z= @fn2(x * (1.0,0.0)) + @fn1(y * (0.0,1.0)) endif iter=iter+1 remain=#z-z r=cabs(remain) total=total+r rave=total/iter phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter endif final: float mask = 0 bool is_masked = false if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(r+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = is_masked = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = is_masked = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = is_masked = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = is_masked = true endif endif endif if !is_masked if (@text_type == 0) ;Random complex hasard = #random texture = @rnd * (real(hasard)+ imag(hasard)) elseif (@text_type == 1) ; fBm if (@rnd != 0) complex r1 = (0,1) ^ (@fbmangle / 90.0) complex r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture = @rnd * sum endif endif endif if(@colorby==0) ; minimum distance #index=rmin + texture elseif(@colorby==1) ; iteration @ min #index=0.01*itermin + texture elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif(@colorby==3) ; maximum distance #index=rmax + texture elseif(@colorby==4) ; iteration @ max #index=0.01*itermax + texture elseif(@colorby==5) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif @colorby==6 #index=rave + texture ; average distance else ; opérations if @oper == 0 #index = real(z) + texture ; réel elseif @oper == 1 #index = imag(z) + texture ; imaginaire elseif @oper == 2 #index = real(z)+imag(z) + texture ; real+imag elseif @oper == 3 #index = real(z)*imag(z) + texture ; real*imag elseif @oper == 4 #index = real(z)-imag(z) + texture ; real-imag elseif @oper == 5 #index = imag(z)+real(z) + texture ; imag-real elseif @oper == 6 #index = real(z)/imag(z) + texture ; real/imag elseif @oper == 7 #index = imag(z)/real(z) + texture ; imag/real elseif @oper == 8 #index = real(z)^imag(z) + texture ; real^imag else #index = imag(z)+real(z) + texture ; imag^real endif endif default: title="Curves" helpfile="mde-help\mde-courbes-fonctions-ucl.htm" param courbe caption = "Curve" enum="epicycloid" "lissajou" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "epicycloid 2" default = 1 endparam param coord caption = "Coordinates" enum="cartesian" "polar" default = 0 endparam param colorby caption="Colouring Mode" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" "average distance" \ "operations" endparam param oper caption="Operations" default=0 enum="real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" hint="Operations you can use when 'operations' colouring mode is chosen" endparam param a caption = "a" default = 1.0 endparam param b caption = "b" default = 1.0 endparam param applic caption = "Functions Application" default = 0 enum = "none" "f(x)-> real" "f(x)-> imag" "f(y)-> real" \ "f(y)-> imag" "f(x)->re & f(y)->im" "f(x)->im & f(y)->re" hint= "How to apply f(x) & f(y)" endparam param text_type caption = "Texture Type" enum = "random" "fBm" endparam param rnd caption = "Texture Amount" default = 0.0 endparam param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" endparam param fbmscale caption = "fBm Scale" default = 1.0 endparam param fbmoffset caption = "fBm Offset" default = (0,0) endparam param fbmangle caption = "fBm Rotation" default = 0.0 endparam param fbmstep caption = "fBm Scale Step" default = 0.5 endparam param fbmastep caption = "fBm Rotation Step" default = 37.0 endparam param fbmoct caption = "fBm Octaves" default = 7 min = 1 endparam param fbmpower caption = "fBm Exponent" default = 2.0 endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fn1 caption = "F(x)" default = ident() endfunc func fn2 caption = "F(y)" default = ident() endfunc func fm caption = "Masking Function" default = ident() endfunc } md-pcourbes-e {; English version of mde.COURBES POLAIRES ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; Michèle Dessureault, 20 avril 2000 ; Avec emprunt d'une portion de 'Gaussian Integer' ; de Kerry Mitchell ; Comme la méthode 'Courbes', mais celles en coordonnées ; polaires de ce manuel ; le code du fBm vient de Damien Jones & Mark Townsend ; Merci à eux pour la permission de publier ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float rave=0.0 float total=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x=(0.0,0.0) y=(0.0,0.0) rho=(0.0,0.0) float texture=0.0 float phi=0.0 p=(0.0,0.0) loop: if @courbe == 0 ;bifolium rho = @a*sin(#z)*cos(#z)*cos(#z) elseif @courbe == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho = @a*cos(#z)+@b elseif @courbe == 2 ;cissoïde de Dioclès rho = @a*sin(#z)*tan(#z) elseif @courbe == 3 ;cochléoïde rho = @a*sin(#z)/#z elseif @courbe == 4 ;conchoïde de Nicomède rho = @a/sin(#z)+@b elseif @courbe == 5 rho = (@a^2*cos(2*#z))^.5 ;lemniscate de Bernouilli elseif @courbe == 6 rho = (@a^2/#z)^.5 ;lituus elseif @courbe == 7 ;pétales rho = @a*cos(@b*#z) elseif @courbe == 8 ;parabole rho = 2*@a/(1-cos(#z)) elseif @courbe == 9 ;spirale d'Archimède rho = @a*#z elseif @courbe == 10 ;spirale hyperbolique rho = @a/#z elseif @courbe == 11 ;spirale logarithmique rho = exp(@a*#z) elseif @courbe == 12 ;strophoïde rho = @a*cos(2*#z)/cos(#z) endif x = real(rho) y = imag(rho) if @coord == 1 x = rho * cos(real(#z)) y = rho * sin(imag(#z)) elseif @coord ==2 x = rho * cosh(real(#z)) y = rho * sinh(imag(#z)) endif if @applic == 0 z= x * (1.0,0.0) + y * (0.0,1.0) elseif @applic == 1 z= @fn1(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 2 z= x * (1.0,0.0) + @fn1(y * (0.0,1.0)) elseif @applic == 3 z= @fn2(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 4 z= x * (1.0,0.0) + @fn2(y * (0.0,1.0)) elseif @applic == 5 z= @fn1(x * (1.0,0.0)) + @fn2(y * (0.0,1.0)) elseif @applic == 6 z= @fn2(x * (1.0,0.0)) + @fn1(y * (0.0,1.0)) endif iter=iter+1 remain=#z-z r=cabs(remain) total=total+r rave=total/iter phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter endif final: float mask = 0 bool is_masked = false if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(r+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = is_masked = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = is_masked = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = is_masked = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = is_masked = true endif endif endif if !is_masked if (@text_type == 0) ;Random complex hasard = #random texture = @rnd * (real(hasard)+ imag(hasard)) elseif (@text_type == 1) ; fBm if (@rnd != 0) complex r1 = (0,1) ^ (@fbmangle / 90.0) complex r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture = @rnd * sum endif endif endif if(@colorby==0) ; minimum distance #index=rmin + texture elseif(@colorby==1) ; iteration @ min #index=0.01*itermin + texture elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif(@colorby==3) ; maximum distance #index=rmax + texture elseif(@colorby==4) ; iteration @ max #index=0.01*itermax + texture elseif(@colorby==5) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif @colorby==6 #index=rave + texture ; average distance else ; opérations if @oper == 0 #index = real(z) + texture ; réel elseif @oper == 1 #index = imag(z) + texture ; imaginaire elseif @oper == 2 #index = real(z)+imag(z) + texture ; real+imag elseif @oper == 3 #index = real(z)*imag(z) + texture ; real*imag elseif @oper == 4 #index = real(z)-imag(z) + texture ; real-imag elseif @oper == 5 #index = imag(z)+real(z) + texture ; imag-real elseif @oper == 6 #index = real(z)/imag(z) + texture ; real/imag elseif @oper == 7 #index = imag(z)/real(z) + texture ; imag/real elseif @oper == 8 #index = real(z)^imag(z) + texture ; real^imag else #index = imag(z)+real(z) + texture ; imag^real endif endif default: title="Polar Curves" helpfile="mde-help\mde-courbes-fonctions-polaires-ucl.htm" param courbe caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "lituus" "petals" "parabola" \ "Archimedes spir." "hyperbolic spir." \ "logarithmic spir." "strophoid" default = 0 endparam param coord caption = "Coordinates" enum="polar" "cartesian" "hyperbolic" default = 0 endparam param colorby caption="Colouring mode" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" "average distance" \ "operations" endparam param oper caption="Operations" default=0 enum="real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" hint="Operations you can use when 'operations' colouring mode is chosen" endparam param a caption = "a" default = 1.0 endparam param b caption = "b" default = 1.0 endparam param applic caption = "Function Application" default = 0 enum = "none" "f(x)-> real" "f(x)-> imag" "f(y)-> real" \ "f(y)-> imag" "f(x)->re et f(y)->im" "f(x)->im et f(y)->re" hint= "How to apply f(x) & f(y)" endparam param text_type caption = "Texture Type" enum = "Random" "fBm" endparam param rnd caption = "Texture amount" default = 0.0 endparam param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" endparam param fbmscale caption = "fBm Scale" default = 1.0 endparam param fbmoffset caption = "fBm Offset" default = (0,0) endparam param fbmangle caption = "fBm Rotation" default = 0.0 endparam param fbmstep caption = "fBm Scale Step" default = 0.5 endparam param fbmastep caption = "fBm Rotation Step" default = 37.0 endparam param fbmoct caption = "fBm Octaves" default = 7 min = 1 endparam param fbmpower caption = "fBm Exponent" default = 2.0 endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fn1 caption = "F(x)" default = ident() endfunc func fn2 caption = "F(y)" default = ident() endfunc func fm caption = "Masking Function" default = ident() endfunc } md-gauss-e {; English version of mde.fBm GAUSS ; Kerry Mitchell 20sep98, updated 02apr99 ; Michèle Dessureault - novembre 1999, avril 2000 ; ; Colors by orbit's relationship ; to Gaussian Integers. See comment ; block for more information. ; ; Updated 02apr99 to include options for finding ; the integer: added trunc, floor, and ceil. ; Thanks to Marcelo Anelli for the idea. ; ; 12/11/99 - j'ai ajouté la balance des fonctions de UF ; à l'original pour les avoir toutes ; avril 2000 - j'ai ajouté fBm d'après Mark Townsend & Damien Jones ; Merci à Kerry Mitchell, Damien Jones et Mark Townsend ; pour la permission de publier ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float rave=0.0 float total=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) float texture=0.0 float phi=0.0 p=(0.0,0.0) if(@norm==1) ; pixel normalization normfac=#pixel elseif(@norm==2) ; factor normalization normfac=@fac else ; no normalization normfac=(1.0,0.0) endif loop: iter=iter+1 temp=@fn(#z/normfac) remain=#z-temp*normfac r=cabs(remain) total=total+r rave=total/iter phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter endif final: float mask = 0 bool is_masked = false if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(r+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = is_masked = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = is_masked = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = is_masked = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = is_masked = true endif endif endif if !is_masked if (@text_type == 0) ;Random complex hasard = #random texture = @rnd * (real(hasard)+ imag(hasard)) elseif (@text_type == 1) ; fBm if (@rnd != 0) complex r1 = (0,1) ^ (@fbmangle / 90.0) complex r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture = @rnd * sum endif endif endif if(@colorby==0) ; minimum distance #index=rmin + texture elseif(@colorby==1) ; iteration @ min #index=0.01*itermin + texture elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif(@colorby==3) ; maximum distance #index=rmax + texture elseif(@colorby==4) ; iteration @ max #index=0.01*itermax + texture elseif(@colorby==5) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture else #index=rave + texture ; average distance endif default: title="fBm Gauss" param colorby caption="Colouring Mode" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" "average distance" endparam param norm caption="Normalization" default=0 enum="none" "pixel" "factor" endparam param fac caption="Normalizing Factor" default=(2.0,1.0) endparam param text_type caption = "Texture Type" enum = "random" "fBm" endparam param rnd caption = "Texture Amount" default = 0.0 endparam param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" endparam param fbmscale caption = "fBm Scale" default = 1.0 endparam param fbmoffset caption = "fBm Offset" default = (0,0) endparam param fbmangle caption = "fBm Rotation" default = 0.0 endparam param fbmstep caption = "fBm Scale Step" default = 0.5 endparam param fbmastep caption = "fBm Rotation Step" default = 37.0 endparam param fbmoct caption = "fBm Octaves" default = 7 min = 1 endparam param fbmpower caption = "fBm Exponent" default = 2.0 endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fn caption="Function" default= round() endfunc func fm caption = "Masking Function" default = ident() endfunc } md-pythagore-e {; English version of mde.fBm PYTHAGORE ; Kerry Mitchell 06feb00 ; Michèle Dessureault, mars & avril 2000 ; ; Colors by the approach of the orbit to a Pythagorean ; triple: when x, y, and r are all integers. Uses ; several different ways to find the closest integer ; to determine the distance. Colors according to ; the closest approach, the furthest approach, or ; combinations thereof. ; ; See the helpfile for more information. ; ; Mes modifs du 6 mars et du 13 avril 2000 ; J'ai modifié le code original de Kerry pour pouvoir utiliser ; toutes les fonctions disponibles en UF comme ma version de Gauss. ; Le code pour fBm est inspiré de Mark Townsend & Damien Jones ; Merci à Kerry Mitchell, Damien Jones et Mark Townsend ; pour la permission de publier ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float rx=0.0 float ry=0.0 float rr=0.0 float r=0.0 float rmin=1.0e12 float rmax=0.0 float rsum=0.0 float rproduct=1.0 float temp=0.0 float temp2=0.0 int iter=0 int itermin=0 int itermax=0 float texture=0.0 float phi=0.0 p=(0.0,0.0) zmin=(0.0,0.0) zmax=(0.0,0.0) loop: iter=iter+1 ; ; generate closest integer ; temp=cabs(#z) rr=abs(temp-real(@fn(temp))) temp=real(#z) rx=abs(temp-real(@fn(temp))) temp=imag(#z) ry=abs(temp-real(@fn(temp))) ; ; find distance to integer ; if(@rtype==1) ; minimum r=rr if(rxr) r=rx endif if(ry>r) r=ry endif elseif(@rtype==3) ; sum r=rr+rx+ry elseif(@rtype==4) ; product r=(rr*rx*ry)^(1/3) else ; euclidean r=(rx^@power+ry^@power+rr^@power)^(1/@power) endif phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif ; ; find min, max & build tallies for means ; rsum=rsum+r rproduct=rproduct*r if(rrmax) rmax=r zmax=#z itermax=iter endif final: float mask = 0 bool is_masked = false if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(r+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = is_masked = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = is_masked = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = is_masked = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = is_masked = true endif endif endif if !is_masked if (@text_type == 0) ;Random complex hasard = #random texture = @rnd * (real(hasard)+ imag(hasard)) elseif (@text_type == 1) ; fBm if (@rnd != 0) complex r1 = (0,1) ^ (@fbmangle / 90.0) complex r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture = @rnd * sum endif endif endif if(@colorby==0) ; minimum distance #index=rmin + texture elseif(@colorby==1) ; iteration @ min #index=0.01*itermin + texture elseif(@colorby==2) ; angle @ min temp=atan2(zmin)/#pi if(temp<0.0) temp=temp+2.0 endif #index=0.5*temp + texture elseif(@colorby==3) ; maximum distance #index=rmax + texture elseif(@colorby==4) ; iteration @ max #index=0.01*itermax + texture elseif(@colorby==5) ; angle @ max temp=atan2(zmax)/#pi if(temp<0.0) temp=temp+2.0 endif #index=0.5*temp + texture elseif(@colorby==6) ; min/max distance angle zmin=rmin+flip(rmax) temp=atan2(zmin)/#pi if(temp<0.0) temp=temp+2.0 endif #index=0.5*temp + texture elseif(@colorby==7) ; arithmetic mean #index=rsum/iter + texture elseif(@colorby==8) ; geometric mean temp=log(rproduct)/iter #index=exp(temp) + texture elseif(@colorby==9) ; amean/gmean angle temp=rsum/iter temp2=log(rproduct)/iter temp2=exp(temp2) zmax=temp+flip(temp2) temp=atan2(zmax)/#pi if(temp<0.0) temp=temp+2.0 endif #index=0.5*temp + texture endif default: title="fBm Pythagore" helpfile="mde-help\mde-fbm-pythagore.htm" param rtype caption="Distance Type" default=0 enum="Euclidean" "minimum" "maximum" "sum" "product" endparam param colorby caption="Colouring Mode" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" \ "min/max combo" "arithmetic mean" \ "geometric mean" "amean/gmean combo" endparam param power caption="Power" default=2.0 hint="Exponent for the 'Euclidean' type. Use 2 for \ standard Pythagorean distance." endparam param text_type caption = "Texture Type" enum = "random" "fBm" endparam param rnd caption = "Texturisation Amount" default = 0.0 endparam param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" endparam param fbmscale caption = "fBm Scale" default = 1.0 endparam param fbmoffset caption = "fBm Offset" default = (0,0) endparam param fbmangle caption = "fBm Rotation" default = 0.0 endparam param fbmstep caption = "fBm Scale Step" default = 0.5 endparam param fbmastep caption = "fBm Rotation Step" default = 37.0 endparam param fbmoct caption = "fBm Octaves" default = 7 min = 1 endparam param fbmpower caption = "fBm Exponent" default = 2.0 endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fn caption="Function" default= round() endfunc func fm caption = "Masking Function" default = ident() endfunc } md-fonctions-e { ; English version of mde.FONCTIONS ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; Michèle Dessureault, 12 décembre 1999 ; Avec emprunt d'une portion de 'Gaussian Integer' ; de Kerry Mitchell ; Équations paramétriques de l'épicycloïde (spirographe) ; x = (a+b)*cos(z) - b*cos(((a+b)/b)*z) ; y = (a+b)*sin(z) - b*sin(((a+b)/b)*z) ; Équations paramétriques des figures de Lissajou: ; x = cos(a*z) ; y = sin(b*z) ; ; Ajout d'un paramètre 'hasard' le 22 mars 2000 ; et d'autres courbes. ; ; Ajout d'une texture fBm le 8 avril 2000 ; Le code vient de Damien Jones & Mark Townsend ; Merci à eux pour la permission de publier ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float rave=0.0 float total=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x=(0.0,0.0) y=(0.0,0.0) float texture=0.0 float phi=0.0 p=(0.0,0.0) loop: if @courbe == 0 ;épicycloïde x = (@a+@b)*@fn1(#z)- @b*@fn1(((@a+@b)/@b)*#z) y = (@a+@b)*@fn2(#z)- @b*@fn2(((@a+@b)/@b)*#z) elseif @courbe == 1 ;lissajou x = real(@fn1(@a*#z)) y = imag(@fn2(@b*#z)) elseif @courbe == 2 ;compagnon du cycloïde x = real(@a*#z) y = imag(@a*(1-@fn1(#z))) elseif @courbe == 3 ;cycloïde x = real(@a*#z - @b*@fn2(z)) y = imag(@a*-@b*@fn1(#z)) elseif @courbe == 4 x = real(@a*@fn1(#z)) ;ellipse y = imag(@b*@fn2(#z)) elseif @courbe == 5 x = real(@a*@fn1(#z)*@fn1(#z)*@fn1(#z)) ;évolute de l'ellipse y = imag(@b*@fn2(#z)*@fn2(#z)*@fn2(#z)) elseif @courbe == 6 x = real(@b*@a*#z / (1+#z^3)) ;folium de Descartes y = imag(@b*@a+#z^2 / (1+#z^3)) elseif @courbe == 7 ;involute du cercle x = real(@a*@fn1(#z) + @a*#z*@fn2(#z)) y = imag(@a*@fn2(#z) - @a*#z*@fn1(#z)) elseif @courbe == 8 ;nephroïde x = real(@a*.5*(@b*@fn1(#z) - @fn1(@b*#z))) y = imag(@a*.5*(@b*@fn2(#z) - @fn2(@b*#z))) elseif @courbe == 9 ;courbe serpentine x = real(@a*@fn1(#z)/@fn2(#z)) y = imag(@b*@fn2(#z)*@fn1(#z)) elseif @courbe == 10 ;sorcière d'Agnesi x = real(@a*@fn1(#z)/@fn2(#z)) y = imag(@b*@fn2(#z)*@fn2(#z)) elseif @courbe == 11 ;tractrice x = real(#z-@a*@fn2(#z/@a)/@fn1(#z/@a)) y = imag(@a/@fn2(#z/@a)) elseif @courbe == 12 ;épicycloïde 2 x = real((@a+@b)*@fn1(#z)- @b*@fn1(((@a+@b)/@b)*#z)) y = imag((@a+@b)*@fn2(#z)- @b*@fn2(((@a+@b)/@b)*#z)) endif if @coord == 1 rho = sqrt(sqr(x)+sqr(y)) theta = atan2(y/x) if theta < 0 theta = theta + 2 * #pi endif x = rho y = theta endif if @applic == 0 z= x * (1.0,0.0) + y * (0.0,1.0) elseif @applic == 1 z= @fn1(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 2 z= x * (1.0,0.0) + @fn1(y * (0.0,1.0)) elseif @applic == 3 z= @fn2(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 4 z= x * (1.0,0.0) + @fn2(y * (0.0,1.0)) elseif @applic == 5 z= @fn1(x * (1.0,0.0)) + @fn2(y * (0.0,1.0)) elseif @applic == 6 z= @fn2(x * (1.0,0.0)) + @fn1(y * (0.0,1.0)) endif iter=iter+1 remain=#z-z r=cabs(remain) total=total+r rave=total/iter phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter endif final: float mask = 0 bool is_masked = false if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(r+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = is_masked = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = is_masked = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = is_masked = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = is_masked = true endif endif endif if !is_masked if (@text_type == 0) ;Random complex hasard = #random texture = @rnd * (real(hasard)+ imag(hasard)) elseif (@text_type == 1) ; fBm if (@rnd != 0) complex r1 = (0,1) ^ (@fbmangle / 90.0) complex r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture = @rnd * sum endif endif endif if(@colorby==0) ; minimum distance #index=rmin + texture elseif(@colorby==1) ; iteration @ min #index=0.01*itermin + texture elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif(@colorby==3) ; maximum distance #index=rmax + texture elseif(@colorby==4) ; iteration @ max #index=0.01*itermax + texture elseif(@colorby==5) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif @colorby==6 #index=rave + texture ; average distance else ; opérations if @oper == 0 #index = real(z) + texture ; réel elseif @oper == 1 #index = imag(z) + texture ; imaginaire elseif @oper == 2 #index = real(z)+imag(z) + texture ; real+imag elseif @oper == 3 #index = real(z)*imag(z) + texture ; real*imag elseif @oper == 4 #index = real(z)-imag(z) + texture ; real-imag elseif @oper == 5 #index = imag(z)+real(z) + texture ; imag-real elseif @oper == 6 #index = real(z)/imag(z) + texture ; real/imag elseif @oper == 7 #index = imag(z)/real(z) + texture ; imag/real elseif @oper == 8 #index = real(z)^imag(z) + texture ; real^imag else #index = imag(z)+real(z) + texture ; imag^real endif endif default: title="Functions" helpfile="mde-help\mde-courbes-fonctions-ucl.htm" param courbe caption = "Curve" enum="epicycloid" "Lissajou" "companion" "cycloid" \ "ellipse" "evolute" "folium" "involute" \ "nephroid" "serpentine" "agnesi" "tractrix" \ "epicycloid 2" default = 1 endparam param coord caption = "Coordinates" enum="cartesian" "polar" default = 0 endparam param colorby caption="Colouring mode" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" "average distance" \ "operations" endparam param oper caption="Operations" default=0 enum="real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" hint="Operations you can use when 'operations' colouring mode is chosen" endparam param a caption = "a" default = 1.0 endparam param b caption = "b" default = 1.0 endparam param applic caption = "Function Application" default = 0 enum = "none" "f(x)-> real" "f(x)-> imag" "f(y)-> real" \ "f(y)-> imag" "f(x)->re & f(y)-> im" "f(x)->im & f(y)->re" hint= "How to apply f(x) & f(y)" endparam param text_type caption = "Texture Type" enum = "random" "fBm" endparam param rnd caption = "Texture Amount" default = 0.0 endparam param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" endparam param fbmscale caption = "fBm Scale" default = 1.0 endparam param fbmoffset caption = "fBm Offset" default = (0,0) endparam param fbmangle caption = "fBm Rotation" default = 0.0 endparam param fbmstep caption = "fBm Scale Step" default = 0.5 endparam param fbmastep caption = "fBm Rotation Step" default = 37.0 endparam param fbmoct caption = "fBm Octaves" default = 7 min = 1 endparam param fbmpower caption = "fBm Exponent" default = 2.0 endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fn1 caption = "Function 1 / f(x)" default = cos() endfunc func fn2 caption = "Function 2 / f(y)" default = sin() endfunc func fm caption = "Masking Function" default = ident() endfunc } md-pfonctions-e { ;English version of mde.FONCTIONS POLAIRES ; d'après les pages 390 des Standard Mathematical Tables ; 22ème édition ; Michèle Dessureault, 24 avril 2000 ; Avec emprunt d'une portion de 'Gaussian Integer' ; de Kerry Mitchell ; Pour fBm, le code vient de Damien Jones & Mark Townsend ; ; Vient de 'Courbes polaires'. Similaire à 'Fonctions' ; Merci à Damien Jones et Mark Townsend ; pour la permission de publier ; ; Masques ajoutés en juin 2000, d'après Andreas Lober ; init: float r=0.0 float rmin=1.0e12 float rmax=0.0 float rave=0.0 float total=0.0 float t=0.0 int iter=0 int itermin=0 int itermax=0 zmin=(0.0,0.0) zmax=(0.0,0.0) z=(0.0,0.0) x=(0.0,0.0) y=(0.0,0.0) rho=(0.0,0.0) float texture=0.0 float phi=0.0 p=(0.0,0.0) loop: if @courbe == 0 ;bifolium rho = @a*@fn2(#z)*@fn1(#z)*@fn1(#z) elseif @courbe == 1 ;limaçon de Pascal ; si a=b-> cardioïde rho = @a*@fn1(#z)+@b elseif @courbe == 2 ;cissoïde de Dioclès rho = @a*@fn2(#z)*@fn2(#z)/@fn1(#z) elseif @courbe == 3 ;cochléoïde rho = @a*@fn2(#z)/#z elseif @courbe == 4 ;conchoïde de Nicomède rho = @a/@fn2(#z)+@b elseif @courbe == 5 rho = (@a^2*@fn1(2*#z))^.5 ;lemniscate de Bernouilli elseif @courbe == 6 ; pétales rho = @a*@fn1(@b*#z) elseif @courbe == 7 ;parabole rho = 2*@a/(1-@fn1(#z)) elseif @courbe == 8 ;strophoïde rho = @a*@fn1(2*#z)/@fn1(#z) endif x = real(rho) y = imag(rho) if @coord == 1 x = rho * cos(real(#z)) y = rho * sin(imag(#z)) elseif @coord ==2 x = rho * cosh(real(#z)) y = rho * sinh(imag(#z)) endif if @applic == 0 z= x * (1.0,0.0) + y * (0.0,1.0) elseif @applic == 1 z= @fn1(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 2 z= x * (1.0,0.0) + @fn1(y * (0.0,1.0)) elseif @applic == 3 z= @fn2(x * (1.0,0.0)) + y * (0.0,1.0) elseif @applic == 4 z= x * (1.0,0.0) + @fn2(y * (0.0,1.0)) elseif @applic == 5 z= @fn1(x * (1.0,0.0)) + @fn2(y * (0.0,1.0)) elseif @applic == 6 z= @fn2(x * (1.0,0.0)) + @fn1(y * (0.0,1.0)) endif iter=iter+1 remain=#z-z r=cabs(remain) total=total+r rave=total/iter phi = atan2(#z) phi = phi/#pi if phi < 0.0 phi = phi + 2.0 endif if(rrmax) rmax=r zmax=#z itermax=iter endif final: float mask = 0 bool is_masked = false if (@masking > 0) if @mask_type == 0 mask = real(@fm(#pixel)) elseif @mask_type == 1 mask =imag(@fm(#pixel)) elseif @mask_type == 2 mask =real(@fm(#z)) elseif @mask_type == 3 mask =imag(@fm(#z)) elseif @mask_type == 4 mask =real(@fm(r+0i)) elseif @mask_type == 5 mask =real(@fm(phi+0i)) elseif @mask_type == 6 mask =real(@fm(iter+0i)) endif if (@masking == 1) ; Lower if (mask < @threshold_l) #solid = is_masked = true endif elseif (@masking == 2) ; Upper if (mask > @threshold_u) #solid = is_masked = true endif elseif (@masking == 3) ; Between if (mask > @threshold_l && mask < @threshold_u) #solid = is_masked = true endif elseif (@masking == 4) ; Outside if (mask < @threshold_l || mask > @threshold_u) #solid = is_masked = true endif endif endif if !is_masked if (@text_type == 0) ;Random complex hasard = #random texture = @rnd * (real(hasard)+ imag(hasard)) elseif (@text_type == 1) ; fBm if (@rnd != 0) complex r1 = (0,1) ^ (@fbmangle / 90.0) complex r2 = (0,1) ^ (@fbmastep / 90.0) if @fbminit == 0 p = #pixel * @fbmscale * r1 + @fbmoffset elseif @fbminit == 1 p = #z * @fbmscale * r1 + @fbmoffset elseif @fbminit == 2 p = r * @fbmscale * r1 + @fbmoffset elseif @fbminit == 3 p = phi * @fbmscale * r1 + @fbmoffset endif float sum = 0.0 float freq = 1.0 int i = @fbmoct while (i > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p)) % 256 float by0 = floor(imag(p)) % 256 IF (bx0 < 0) bx0 = bx0 + 256 ENDIF IF (by0 < 0) by0 = by0 + 256 ENDIF float bx1 = (bx0 + 1) % 256 float by1 = (by0 + 1) % 256 float rx0 = real(p) - floor(real(p)) float ry0 = imag(p) - floor(imag(p)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 float b00 = (bx0^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b10 = (bx1^@fbmpower % 65536 + by0)^@fbmpower % 65536 float b01 = (bx0^@fbmpower % 65536 + by1)^@fbmpower % 65536 float b11 = (bx1^@fbmpower % 65536 + by1)^@fbmpower % 65536 float g_b00_0 = (b00)^@fbmpower*0.25 % 512 - 256 float g_b10_0 = (b10)^@fbmpower*0.25 % 512 - 256 float g_b01_0 = (b01)^@fbmpower*0.25 % 512 - 256 float g_b11_0 = (b11)^@fbmpower*0.25 % 512 - 256 float g_b00_1 = (b00+1)^@fbmpower*0.25 % 512 - 256 float g_b10_1 = (b10+1)^@fbmpower*0.25 % 512 - 256 float g_b01_1 = (b01+1)^@fbmpower*0.25 % 512 - 256 float g_b11_1 = (b11+1)^@fbmpower*0.25 % 512 - 256 float d = 0.0; d = 1 / sqrt(sqr(g_b00_0) + sqr(g_b00_1)) g_b00_0 = g_b00_0 * d g_b00_1 = g_b00_1 * d d = 1 / sqrt(sqr(g_b10_0) + sqr(g_b10_1)) g_b10_0 = g_b10_0 * d g_b10_1 = g_b10_1 * d d = 1 / sqrt(sqr(g_b01_0) + sqr(g_b01_1)) g_b01_0 = g_b01_0 * d g_b01_1 = g_b01_1 * d d = 1 / sqrt(sqr(g_b11_0) + sqr(g_b11_1)) g_b11_0 = g_b11_0 * d g_b11_1 = g_b11_1 * d float u1 = rx0 * g_b00_0 + ry0 * g_b00_1 float v1 = rx1 * g_b10_0 + ry0 * g_b10_1 float u2 = rx0 * g_b01_0 + ry1 * g_b01_1 float v2 = rx1 * g_b11_0 + ry1 * g_b11_1 float sx = sqr(rx0) * (3 - rx0*2) float sy = sqr(ry0) * (3 - ry0*2) float a = u1 + sx*(v1-u1) float b = u2 + sx*(v2-u2) sum = sum + (a + sy*(b-a))*freq freq = freq * @fbmstep p = p * r2 / @fbmstep i = i - 1 endwhile texture = @rnd * sum endif endif endif if(@colorby==0) ; minimum distance #index=rmin + texture elseif(@colorby==1) ; iteration @ min #index=0.01*itermin + texture elseif(@colorby==2) ; angle @ min t=atan2(zmin) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif(@colorby==3) ; maximum distance #index=rmax + texture elseif(@colorby==4) ; iteration @ max #index=0.01*itermax + texture elseif(@colorby==5) ; angle @ max t=atan2(zmax) t=t/pi if(t<0.0) t=t+2.0 endif #index=0.5*t + texture elseif @colorby==6 #index=rave + texture ; average distance else ; opérations if @oper == 0 #index = real(z) + texture ; réel elseif @oper == 1 #index = imag(z) + texture ; imaginaire elseif @oper == 2 #index = real(z)+imag(z) + texture ; real+imag elseif @oper == 3 #index = real(z)*imag(z) + texture ; real*imag elseif @oper == 4 #index = real(z)-imag(z) + texture ; real-imag elseif @oper == 5 #index = imag(z)+real(z) + texture ; imag-real elseif @oper == 6 #index = real(z)/imag(z) + texture ; real/imag elseif @oper == 7 #index = imag(z)/real(z) + texture ; imag/real elseif @oper == 8 #index = real(z)^imag(z) + texture ; real^imag else #index = imag(z)+real(z) + texture ; imag^real endif endif default: title="Polar Functions" helpfile="mde-help\mde-courbes-fonctions-polaires-ucl.htm" param courbe caption = "Curve" enum="bifolium" "limacon" "cissoid" "cochleoid" \ "conchoid" "lemniscate" "petals" "parabola" \ "strophoid" default = 0 endparam param coord caption = "Coordinates" enum="polar" "cartesian" "hyperbolic" default = 0 endparam param colorby caption="Colouring mode" default=0 enum="minimum distance" "iteration @ min" "angle @ min" \ "maximum distance" "iteration @ max" "angle @ max" "average distance" \ "operations" endparam param oper caption="Operations" default=0 enum="real" "imag" "real+imag" "real*imag" "real-imag" \ "imag-real" "real/imag" "imag/real" "real^imag" "imag^real" hint="Operations you can use when 'operations' colouring mode is chosen" endparam param a caption = "a" default = 1.0 endparam param b caption = "b" default = 1.0 endparam param applic caption = "Function Application" default = 0 enum = "none" "f(x)-> real" "f(x)-> imag" "f(y)-> real" \ "f(y)-> imag" "f(x)->re & f(y)->im" "f(x)->im & f(y)->re" hint= "How to apply the functions f(x) & f(y)" endparam param text_type caption = "Texture Type" enum = "Random" "fBm" endparam param rnd caption = "Texture Amount" default = 0.0 endparam param fbminit caption = "fBm Initialization" enum = "pixel" "z" "distance" "angle" endparam param fbmscale caption = "fBm Scale" default = 1.0 endparam param fbmoffset caption = "fBm Offset" default = (0,0) endparam param fbmangle caption = "fBm Rotation" default = 0.0 endparam param fbmstep caption = "fBm Step Scale" default = 0.5 endparam param fbmastep caption = "fBm Rotation Step" default = 37.0 endparam param fbmoct caption = "fBm Octaves" default = 7 min = 1 endparam param fbmpower caption = "fBm Exponent" default = 2.0 endparam param mask_type caption = "Mask Type" enum = "Real Pixel" "Imag Pixel" "Real z" "Imag z" "Distance" \ "Angle" "Iteration" endparam param masking caption = "Masking" enum = "None" "Lower" "Upper" "Between" "Outside" default = 0 endparam param threshold_l caption = "Lower Mask Threshold" default = 0.5 endparam param threshold_u caption = "Upper Mask Threshold" default = 1.0 endparam func fn1 caption = "Function 1 / f(x)" default = cos() endfunc func fn2 caption = "Function 2 / f(y)" default = sin() endfunc func fm caption = "Masking Function" default = ident() endfunc }