ReallyCool(OUTSIDE) { ; by Damien M. Jones init: float closest = 1e38 point = 0 r = (0,1) ^ (@rot/90) loop: z2 = (#z - p1) * r float d = abs(imag(z2) * real(z2)) if (d < closest) closest = d point = #z endif final: #index = 0.02 * abs(atan(imag(point) / real(point)) * 180/pi) default: title = "Cool outside coloring" param rot caption = "Rotation" endparam param p1 caption = "Base point" endparam } conic-lite-old { ; Kerry Mitchell ; ; *** this has been superceded by "conic lite", ; *** but is offered for compatibility ; ; colors by relationship between orbit ; and conic section. tastes great, less ; choices, less filling, easier to use. ; init: float cerr=0.0 float cerrmin=1.0e12 float x=0.0 float y=0.0 float t=0.0 int iter=0 int itermin=0 float h=real(@center) float k=imag(@center) float aa=0.0 float bb=0.0 float cc=0.0 float dd=0.0 float ff=0.0 float a2=0.0 float b2=0.0 zmin=(0.0,0.0) ; ; set up constants depending on chosen type of section ; if(@type==1) ; circle aa=1.0 bb=-2.0*h cc=1.0 dd=-2.0*k ff=sqr(h)+sqr(k)-sqr(@radius) elseif(@type==2) ; ellipse a2=sqr(@xaxis) b2=sqr(@yaxis) aa=b2 bb=-2.0*h*b2 cc=a2 dd=-2.0*k*a2 ff=b2*sqr(h)+a2*sqr(k)-a2*b2 elseif(@type==3) ; horizontal hyperbola a2=sqr(@xaxis) b2=sqr(@yaxis) aa=b2 bb=-2.0*h*b2 cc=-a2 dd=2.0*k*a2 ff=b2*sqr(h)-a2*sqr(k)-a2*b2 elseif(@type==4) ; vertical hyperbola a2=sqr(@xaxis) b2=sqr(@yaxis) aa=-b2 bb=2.0*h*b2 cc=a2 dd=-2.0*k*a2 ff=-b2*sqr(h)+a2*sqr(k)-a2*b2 else ; line t=@theta/180*#pi aa=0.0 bb=sin(t) cc=0.0 dd=-cos(t) ff=-(bb*h+dd*k) endif loop: iter=iter+1 x=real(#z) y=imag(#z) cerr=cabs((aa*x+bb)*x+(cc*y+dd)*y+ff) if(cerr 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 i = i - 1 ENDWHILE IF @transfer == 0 float x = real(#screenpixel)+50*@fbm*(sum+1) float y = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float x = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float y = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float x = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float y = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float x = real(#screenpixel)+10*log(@fbm*(sum+1)) float y = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float x = real(#screenpixel)+50*exp(@fbm*(sum+1)) float y = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float x = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float y = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float x = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float y = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float x = real(#screenpixel)+50*sin(@fbm*(sum+1)) float y = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float x = real(#screenpixel)+50*asin(@fbm*(sum+1)) float y = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float x = real(#screenpixel)+50*tan(@fbm*(sum+1)) float y = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float x = real(#screenpixel)+50*atan(@fbm*(sum+1)) float y = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float x = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float y = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF ; create the texture IF @tscale == true float gridx = @gridx*#width/400 float gridy = @gridy*#height/300 ELSE float gridx = @gridx float gridy = @gridy ENDIF IF @smooth == false IF @texture == 0 ;lattice t1x = sin(x/gridx)+@toffset t2x = t1x+0.00000001 t3x = t1x t1y = cos(y/gridy)+@toffset t2y = t1y t3y = t1y+0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 1 ;quilt t1x = tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cotan(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 2 ;circles and squares t1x = sin(x/gridx)+cos(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cos(y/gridy)+sin(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 3 ;triangles t1x = tan(x/gridx)+cotan(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cotan(y/gridy)+tan(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 4 ;X's and O's t1x = 1/sin(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cos(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 5 ;Dimples t1x = 1/tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cotan(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 6 ;Arrows t1x = 1/tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/sin(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 7 ; basketweave t1x = 1/sin(x/gridx)+1/cos(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cos(y/gridy)+1/sin(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ENDIF ELSE IF @texture == 0 ;lattice t1x = sin(x/gridx)+1 t2x = sin((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = cos(y/gridy)+1 t2y = t1y t3y = cos((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 1 ;quilt t1x = tan(x/gridx)+1 t2x = tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = cotan(y/gridy)+1 t2y = t1y t3y = cotan((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 2 ;circles and squares t1x = sin(x/gridx)+cos(y/gridy)+@toffset t2x = sin((x+0.00000001)/gridx)+cos(y/gridy)+@toffset t3x = t1x t1y = cos(y/gridy)+sin(x/gridx)+@toffset t2y = t1y t3y = cos((y+0.00000001)/gridy)+sin(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 3 ;triangles t1x = tan(x/gridx)+cotan(y/gridy)+@toffset t2x = tan((x+0.00000001)/gridx)+cotan(y/gridy)+@toffset t3x = t1x t1y = cotan(y/gridy)+tan(x/gridx)+@toffset t2y = t1y t3y = cotan((y+0.00000001)/gridy)+tan(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 4 ;X's and O's t1x = 1/sin(x/gridx)+@toffset t2x = 1/sin((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/cos(y/gridy)+@toffset t2y = t1y t3y = 1/cos((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 5 ;Dimples t1x = 1/tan(x/gridx)+@toffset t2x = 1/tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/cotan(y/gridy)+@toffset t2y = t1y t3y = 1/cotan((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 6 ;Arrows t1x = 1/tan(x/gridx)+@toffset t2x = 1/tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/sin(y/gridy)+@toffset t2y = t1y t3y = 1/sin((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 7 ; basketweave t1x = 1/sin((x+0.00000001)/gridx)+1/cos(y/gridy)+@toffset t2x = 1/sin(x/gridx)+1/cos(y/gridy)+@toffset t3x = t1x t1y = 1/cos(y/gridy)+1/sin(x/gridx)+@toffset t2y = t1y t3y = 1/cos((y+0.00000001)/gridy)+1/sin(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ENDIF ENDIF ; add the weighted texture z1 = #z*(1-@weight) + t*@weight ; compute cosine of angle between these vectors ; (this is the amount of lighting on the surface) float l = lx*real(z1) + ly*imag(z1) + lz*vz IF (l < @ambient); light is below the ambient level l = @ambient; set it to the ambient level ENDIF IF (@ambient < 0); the ambient level is negative l = l + 1; offset to prevent clipping at 0 ENDIF #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) default: title = "3D Texturizer" param texture caption = "Texture" default = 0 enum = "Lattice" "Quilt" "Circles & Squares" "Triangles" \ "X's & O's" "Dimples" "Arrows" "Basketweave" endparam param gridx caption = "Texture X distance" default = 1.0 endparam param gridy caption = "Texture Y distance" default = 1.0 endparam param theight caption = "Texture Height" default = 1.0 endparam param weight caption = "Texture Weight" default = 0.5 min = 0.0 max = 1.0 endparam param toffset caption = "Texturizer Offset" default = 1.0 endparam param tscale caption = "Scale to Screen Size" default = true hint = "If false, texture scale depends on screen size" endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Texture Weight" default = 0.2 endparam param smooth caption = "fBm Texture Smoothing" default = false hint = "Apply 3D smoothing to the texture" endparam param fbmf caption = "fBm Final Weight" default = 0.5 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param angle caption = "Light Rotation" default = 90.0 hint = "Gives the rotation of the light source, in degrees." endparam param elevation caption = "Light Elevation" default = 30.0 hint = "Gives the elevation of the light source, in degrees." endparam param ambient caption = "Ambient Light" default = 0.0 min = -1.0 max = 1.0 hint = "Specifies the level of ambient light. Use -1.0 to \ color all surfaces." endparam } 3D_Texturizer_Enhanced { ; Ron Barnett, April 2001 ; This coloring method is based upon ; the Lighting and fBm formulas of ; Damien Jones ; Iteration trap functionality, from Red William and ; Height Trap functionality added January 6, 2002 final: float res=0 float lowtrap=abs(round(real(@itrap)*#maxiter)) float hightrap=abs(round(imag(@itrap)*#maxiter)) IF lowtrap>hightrap res=lowtrap lowtrap=hightrap hightrap=res ENDIF IF (@trapsum == true) lowtrap=real(@itrap) hightrap=imag(@itrap) IF lowtrap>hightrap res=lowtrap lowtrap=hightrap hightrap=res ENDIF ENDIF complex t = 0 complex z1 = 0 float vz = -sqrt(1-|#z|) ; extract implied portion of normal float d2r = #pi/180; degrees to radians conversion factor float t1x = 0 float t2x = 0 float t3x = 0 float t1y = 0 float t2y = 0 float t3y = 0 float e1 = 0 float e2 = 0 float e3 = 0 float tx = 0 float ty = 0 float tz = 0 float td = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int i = 7 ; create vector for light direction float lx = cos(@angle*d2r) * cos(@elevation*d2r) float ly = sin(@angle*d2r) * cos(@elevation*d2r) float lz = -sin(@elevation*d2r) complex p = #pixel * @nscale * r + @noffset 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 i = i - 1 ENDWHILE IF @transfer == 0 float x = real(#screenpixel)+50*@fbm*(sum+1) float y = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float x = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float y = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float x = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float y = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float x = real(#screenpixel)+10*log(@fbm*(sum+1)) float y = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float x = real(#screenpixel)+50*exp(@fbm*(sum+1)) float y = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float x = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float y = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float x = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float y = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float x = real(#screenpixel)+50*sin(@fbm*(sum+1)) float y = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float x = real(#screenpixel)+50*asin(@fbm*(sum+1)) float y = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float x = real(#screenpixel)+50*tan(@fbm*(sum+1)) float y = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float x = real(#screenpixel)+50*atan(@fbm*(sum+1)) float y = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float x = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float y = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF ; create the texture IF @tscale == true float gridx = @gridx*#width/400 float gridy = @gridy*#height/300 ELSE float gridx = @gridx float gridy = @gridy ENDIF x = x*(1+@blend*real(#z))/(1+@blend) y = y*(1+@blend*imag(#z))/(1+@blend) IF @smooth == false IF @texture == 0 ;lattice t1x = sin(x/gridx)+@toffset t2x = t1x+0.00000001 t3x = t1x t1y = cos(y/gridy)+@toffset t2y = t1y t3y = t1y+0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 1 ;quilt t1x = tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cotan(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 2 ;circles and squares t1x = sin(x/gridx)+cos(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cos(y/gridy)+sin(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 3 ;triangles t1x = tan(x/gridx)+cotan(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cotan(y/gridy)+tan(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 4 ;X's and O's t1x = 1/sin(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cos(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 5 ;Dimples t1x = 1/tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cotan(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 6 ;Arrows t1x = 1/tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/sin(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 7 ; basketweave t1x = 1/sin(x/gridx)+1/cos(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cos(y/gridy)+1/sin(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 8 ; balls t1x = sin(x/gridx)^2 + cos(y/gridy)^2+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = sin(y/gridy)^2 + cos(x/gridx)^2+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ENDIF ELSE IF @texture == 0 ;lattice t1x = sin(x/gridx)+1 t2x = sin((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = cos(y/gridy)+1 t2y = t1y t3y = cos((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 1 ;quilt t1x = tan(x/gridx)+1 t2x = tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = cotan(y/gridy)+1 t2y = t1y t3y = cotan((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 2 ;circles and squares t1x = sin(x/gridx)+cos(y/gridy)+@toffset t2x = sin((x+0.00000001)/gridx)+cos(y/gridy)+@toffset t3x = t1x t1y = cos(y/gridy)+sin(x/gridx)+@toffset t2y = t1y t3y = cos((y+0.00000001)/gridy)+sin(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 3 ;triangles t1x = tan(x/gridx)+cotan(y/gridy)+@toffset t2x = tan((x+0.00000001)/gridx)+cotan(y/gridy)+@toffset t3x = t1x t1y = cotan(y/gridy)+tan(x/gridx)+@toffset t2y = t1y t3y = cotan((y+0.00000001)/gridy)+tan(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 4 ;X's and O's t1x = 1/sin(x/gridx)+@toffset t2x = 1/sin((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/cos(y/gridy)+@toffset t2y = t1y t3y = 1/cos((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 5 ;Dimples t1x = 1/tan(x/gridx)+@toffset t2x = 1/tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/cotan(y/gridy)+@toffset t2y = t1y t3y = 1/cotan((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 6 ;Arrows t1x = 1/tan(x/gridx)+@toffset t2x = 1/tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/sin(y/gridy)+@toffset t2y = t1y t3y = 1/sin((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 7 ; basketweave t1x = 1/sin((x+0.00000001)/gridx)+1/cos(y/gridy)+@toffset t2x = 1/sin(x/gridx)+1/cos(y/gridy)+@toffset t3x = t1x t1y = 1/cos(y/gridy)+1/sin(x/gridx)+@toffset t2y = t1y t3y = 1/cos((y+0.00000001)/gridy)+1/sin(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 8 ; balls t1x = sin((x+0.00000001)/gridx)^2 + cos(y/gridy)^2+@toffset t2x = sin(x/gridx)^2 + cos(y/gridy)^2+@toffset t3x = t1x t1y = sin(y/gridy)^2 + cos(x/gridx)^2+@toffset t2y = t1y t3y = sin((y+0.00000001)/gridy)^2 + cos(x/gridx)^2+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ENDIF ENDIF ; add the weighted texture z1 = #z*(1-@weight) + t*@weight ; compute cosine of angle between these vectors ; (this is the amount of lighting on the surface) float l = lx*real(z1) + ly*imag(z1) + lz*vz IF (l < @ambient); light is below the ambient level l = @ambient; set it to the ambient level ENDIF IF (@ambient < 0); the ambient level is negative l = l + 1; offset to prevent clipping at 0 ENDIF IF (@trap == true) IF (#numiter>=lowtrap)&&(#numiter<=hightrap) ; Is pixel in trap? #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) ELSE #solid = true ENDIF ELSEIF (@trapsum == true) float ht = abs(vz) IF (ht>=lowtrap)&&(ht<=hightrap) ; Is pixel in trap? #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) ELSE #solid = true ENDIF ELSE #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) ENDIF default: title = "3D Texturizer Enhanced" param trap caption="Use Trap by Iteration" default = false endparam param trapsum caption="Use Trap by Height" default = false endparam param itrap caption="Trap Limits" default=(0.0,1.0) hint="Between 0.0 and 1.0" endparam param texture caption = "Texture" default = 0 enum = "Lattice" "Quilt" "Circles & Squares" "Triangles" \ "X's & O's" "Dimples" "Arrows" "Basketweave" "Balls" endparam param gridx caption = "Texture X distance" default = 1.0 endparam param gridy caption = "Texture Y distance" default = 1.0 endparam param theight caption = "Texture Height" default = 1.0 endparam param weight caption = "Texture Weight" default = 0.5 min = 0.0 max = 1.0 endparam param blend caption = "Texture Blend" default = 0.5 endparam param toffset caption = "Texturizer Offset" default = 1.0 endparam param tscale caption = "Scale to Screen Size" default = true hint = "If false, texture scale depends on screen size" endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Texture Weight" default = 0.2 endparam param smooth caption = "fBm Texture Smoothing" default = false hint = "Apply 3D smoothing to the texture" endparam param fbmf caption = "fBm Final Weight" default = 0.5 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param angle caption = "Light Rotation" default = 90.0 hint = "Gives the rotation of the light source, in degrees." endparam param elevation caption = "Light Elevation" default = 30.0 hint = "Gives the elevation of the light source, in degrees." endparam param ambient caption = "Ambient Light" default = 0.0 min = -1.0 max = 1.0 hint = "Specifies the level of ambient light. Use -1.0 to \ color all surfaces." endparam } 3D_Texturizer_Enhanced_II { ; Ron Barnett, March 8, 2003 ; This coloring method is based upon ; the Lighting and fBm formulas of ; Damien Jones ; Iteration trap functionality, from Red William and ; Height Trap functionality added January 6, 2002 ; Corrected fBM for zooms and image size Jan 19, 2002 ; Revised March 8, 2003 to support solid backgrounds ; for strange attractors final: float res=0 float lowtrap=abs(round(real(@itrap)*#maxiter)) float hightrap=abs(round(imag(@itrap)*#maxiter)) IF lowtrap>hightrap res=lowtrap lowtrap=hightrap hightrap=res ENDIF IF (@trapsum == true) lowtrap=real(@itrap) hightrap=imag(@itrap) IF lowtrap>hightrap res=lowtrap lowtrap=hightrap hightrap=res ENDIF ENDIF complex t = 0 complex z1 = 0 float vz = -sqrt(1-|#z|) ; extract implied portion of normal float d2r = #pi/180; degrees to radians conversion factor float t1x = 0 float t2x = 0 float t3x = 0 float t1y = 0 float t2y = 0 float t3y = 0 float e1 = 0 float e2 = 0 float e3 = 0 float tx = 0 float ty = 0 float tz = 0 float td = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int i = 7 ; create vector for light direction float lx = cos(@angle*d2r) * cos(@elevation*d2r) float ly = sin(@angle*d2r) * cos(@elevation*d2r) float lz = -sin(@elevation*d2r) complex p = #pixel * @nscale * r + @noffset 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 i = i - 1 ENDWHILE float x = 0.0 float y = 0.0 IF @transfer == 0 x = real(#pixel)*200+@fbm*(sum+1) y = imag(#pixel)*200+@fbm*(sum+1) ELSEIF @transfer == 1 x = real(#pixel)*200*(1+@fbm*(sum+1)*0.5) y = imag(#pixel)*200*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 x = real(#pixel)*200/(1+@fbm*(sum+1)*0.5) y = imag(#pixel)*200/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 x = real(#pixel)*200+10*log(@fbm*(sum+1)) y = imag(#pixel)*200+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 x = real(#pixel)*200+50*exp(@fbm*(sum+1)) y = imag(#pixel)*200+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 x = real(#pixel)*200+50*(@fbm*(sum+1))*(@fbm*(sum+1)) y = imag(#pixel)*200+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 x = real(#pixel)*200+50*sqrt(@fbm*(sum+1)) y = imag(#pixel)*200+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 x = real(#pixel)*200+50*sin(@fbm*(sum+1)) y = imag(#pixel)*200+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 x = real(#pixel)*200+50*asin(@fbm*(sum+1)) y = imag(#pixel)*200+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 x = real(#pixel)*200+50*tan(@fbm*(sum+1)) y = imag(#pixel)*200+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 x = real(#pixel)*200+50*atan(@fbm*(sum+1)) y = imag(#pixel)*200+50*atan(@fbm*(sum+1)) ENDIF ; create the texture float gridx = @gridx float gridy = @gridy x = x*(1+@blend*real(#z))/(1+@blend) y = y*(1+@blend*imag(#z))/(1+@blend) IF @smooth == false IF @texture == 0 ;lattice t1x = sin(x/gridx)+@toffset t2x = t1x+0.00000001 t3x = t1x t1y = cos(y/gridy)+@toffset t2y = t1y t3y = t1y+0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 1 ;quilt t1x = tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cotan(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 2 ;circles and squares t1x = sin(x/gridx)+cos(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cos(y/gridy)+sin(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 3 ;triangles t1x = tan(x/gridx)+cotan(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = cotan(y/gridy)+tan(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 4 ;X's and O's t1x = 1/sin(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cos(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 5 ;Dimples t1x = 1/tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cotan(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 6 ;Arrows t1x = 1/tan(x/gridx)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/sin(y/gridy)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 7 ; basketweave t1x = 1/sin(x/gridx)+1/cos(y/gridy)+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = 1/cos(y/gridy)+1/sin(x/gridx)+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 8 ; balls t1x = sin(x/gridx)^2 + cos(y/gridy)^2+@toffset t2x = t1x + 0.00000001 t3x = t1x t1y = sin(y/gridy)^2 + cos(x/gridx)^2+@toffset t2y = t1y t3y = t1y + 0.00000001 e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ENDIF ELSE IF @texture == 0 ;lattice t1x = sin(x/gridx)+1 t2x = sin((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = cos(y/gridy)+1 t2y = t1y t3y = cos((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 1 ;quilt t1x = tan(x/gridx)+1 t2x = tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = cotan(y/gridy)+1 t2y = t1y t3y = cotan((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 2 ;circles and squares t1x = sin(x/gridx)+cos(y/gridy)+@toffset t2x = sin((x+0.00000001)/gridx)+cos(y/gridy)+@toffset t3x = t1x t1y = cos(y/gridy)+sin(x/gridx)+@toffset t2y = t1y t3y = cos((y+0.00000001)/gridy)+sin(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 3 ;triangles t1x = tan(x/gridx)+cotan(y/gridy)+@toffset t2x = tan((x+0.00000001)/gridx)+cotan(y/gridy)+@toffset t3x = t1x t1y = cotan(y/gridy)+tan(x/gridx)+@toffset t2y = t1y t3y = cotan((y+0.00000001)/gridy)+tan(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 4 ;X's and O's t1x = 1/sin(x/gridx)+@toffset t2x = 1/sin((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/cos(y/gridy)+@toffset t2y = t1y t3y = 1/cos((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 5 ;Dimples t1x = 1/tan(x/gridx)+@toffset t2x = 1/tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/cotan(y/gridy)+@toffset t2y = t1y t3y = 1/cotan((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 6 ;Arrows t1x = 1/tan(x/gridx)+@toffset t2x = 1/tan((x+0.00000001)/gridx)+@toffset t3x = t1x t1y = 1/sin(y/gridy)+@toffset t2y = t1y t3y = 1/sin((y+0.00000001)/gridy)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 7 ; basketweave t1x = 1/sin((x+0.00000001)/gridx)+1/cos(y/gridy)+@toffset t2x = 1/sin(x/gridx)+1/cos(y/gridy)+@toffset t3x = t1x t1y = 1/cos(y/gridy)+1/sin(x/gridx)+@toffset t2y = t1y t3y = 1/cos((y+0.00000001)/gridy)+1/sin(x/gridx)+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ELSEIF @texture == 8 ; balls t1x = sin((x+0.00000001)/gridx)^2 + cos(y/gridy)^2+@toffset t2x = sin(x/gridx)^2 + cos(y/gridy)^2+@toffset t3x = t1x t1y = sin(y/gridy)^2 + cos(x/gridx)^2+@toffset t2y = t1y t3y = sin((y+0.00000001)/gridy)^2 + cos(x/gridx)^2+@toffset e1 =cabs(t1x+flip(t1y)) e2 =cabs(t2x+flip(t2y)) e3 =cabs(t3x+flip(t3y)) tx = e2 - e1 ty = e3 - e1 tz = -0.00000001/@theight td = 1/sqrt(sqr(tx)+sqr(ty)+sqr(tz)) tx = tx*td ty = ty*td t = tx + flip(ty) ENDIF ENDIF ; add the weighted texture z1 = #z*(1-@weight) + t*@weight ; compute cosine of angle between these vectors ; (this is the amount of lighting on the surface) float l = lx*real(z1) + ly*imag(z1) + lz*vz IF (l < @ambient); light is below the ambient level l = @ambient; set it to the ambient level ENDIF IF (@ambient < 0); the ambient level is negative l = l + 1; offset to prevent clipping at 0 ENDIF IF (@trap == true) IF (#numiter>=lowtrap)&&(#numiter<=hightrap) ; Is pixel in trap? #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) ELSE #solid = true ENDIF ELSEIF (@trapsum == true) float ht = abs(vz) IF (ht>=lowtrap)&&(ht<=hightrap) ; Is pixel in trap? #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) ELSE #solid = true ENDIF ELSE #index = l*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) ENDIF if @solidb == true && cabs(#z) == 0 #solid = true endif default: title = "3D Texturizer Enhanced II" param trap caption="Use Trap by Iteration" default = false endparam param trapsum caption="Use Trap by Height" default = false endparam param itrap caption="Trap Limits" default=(0.0,1.0) hint="Between 0.0 and 1.0" endparam param solidb caption="Use solid background" default = false endparam param texture caption = "Texture" default = 0 enum = "Lattice" "Quilt" "Circles & Squares" "Triangles" \ "X's & O's" "Dimples" "Arrows" "Basketweave" "Balls" endparam param gridx caption = "Texture X distance" default = 1.0 endparam param gridy caption = "Texture Y distance" default = 1.0 endparam param theight caption = "Texture Height" default = 1.0 endparam param weight caption = "Texture Weight" default = 0.5 min = 0.0 max = 1.0 endparam param blend caption = "Texture Blend" default = 0.5 endparam param toffset caption = "Texturizer Offset" default = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Texture Weight" default = 0.2 endparam param smooth caption = "fBm Texture Smoothing" default = false hint = "Apply 3D smoothing to the texture" endparam param fbmf caption = "fBm Final Weight" default = 0.5 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param angle caption = "Light Rotation" default = 90.0 hint = "Gives the rotation of the light source, in degrees." endparam param elevation caption = "Light Elevation" default = 30.0 hint = "Gives the elevation of the light source, in degrees." endparam param ambient caption = "Ambient Light" default = 0.0 min = -1.0 max = 1.0 hint = "Specifies the level of ambient light. Use -1.0 to \ color all surfaces." endparam } 4D-trap { ; Ron Barnett, December 1999 ; Shamelessly borrowed from Mark Townsend's ; Martin trap method using 4D translation/rotation init: trap_z = 0 trap_p = 0 int iter = 0 float dist = 0 float distance = 0 int rt_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float distave = 0 float distsum = 0 float exptrap_p = 0 float angle = @r/180*#pi if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif complex z1 = real(#pixel) + flip(imag(#pixel)*@r) complex c = @t + @r*real(#pixel) + flip(imag(#pixel)) loop: z1 = @fn1(z1 + @start) ; Iterate the Rotate/Translate formula while rt_iter < @max_iterations z1 = z1*z1 + c rt_iter = rt_iter + 1 endwhile f_p = @fn2(z1) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "4D Orbit Trap" param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param t caption = "Translation" default = -0.75 endparam param r caption = "Rotation" default = 0.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "4D iterations" hint = "This is the number of iterations for the Chip formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Chip_strange_attractor { ; Ron Barnett February 28, 2003 ; ; Use this as inside coloring with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; ; Zoom in to about magn = 0.001 for a good starting point ; $define debug global: int w = 0 int h = 0 complex hits[#width,#height] int count[#width,#height] float fx = 1.0 float ffx = 0.0 float xx = 0.0 float fy = 1.0 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*1e11 ; ; initialize hit array ; while(h < #height) while(w < #width) hits[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx if fx != 0 fx = fy - abs(fx)/fx*cos(sqr(log(abs(@b*fx-@c))))*atan(sqr(log(abs(@b*fx-@c)))) else fx = fy - cos(sqr(log(abs(@b*fx-@c))))*atan(sqr(log(abs(@c*fx-@b)))) endif fy = @a-xx ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = trunc(ffx) py = trunc(ffy) if px > 0 && py > 0 && px < #width && py < #height hits[px,py] = hits[px,py]+ffx+flip(ffy) count[px,py] = count[px,py] + 1 endif iter = iter + 1 endwhile ; init: int nhit=0 float xhit=0 float yhit=0 loop: final: nhit=count[#x,#y] xhit=real(hits[#x,#y]) yhit=imag(hits[#x,#y]) if @closeness > 0 if #x + @closeness < #width nhit = nhit + count[#x+@closeness, #y] xhit = xhit + real(hits[#x+@closeness, #y]) yhit = yhit + imag(hits[#x+@closeness, #y]) endif if #x - @closeness > 0 nhit = nhit + count[#x-@closeness, #y] xhit = xhit + real(hits[#x-@closeness, #y]) yhit = yhit + imag(hits[#x-@closeness, #y]) endif if #y + @closeness < #height nhit = nhit + count[#x, #y+@closeness] xhit = xhit + real(hits[#x, #y+@closeness]) yhit = yhit + imag(hits[#x, #y+@closeness]) endif if #y - @closeness > 0 nhit = nhit + count[#x, #y-@closeness] xhit = xhit + real(hits[#x, #y-@closeness]) yhit = yhit + imag(hits[#x, #y-@closeness]) endif endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 4 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 7 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: heading caption="Chip Attractor" endheading heading caption="x->y-sign(x)*cos(sqr(log(abs(b*x-c)))) \" endheading heading caption=" *atan(sqr(log(abs@b*x@c))))" endheading heading caption="y->a-x" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading heading caption="Set magnification to 0.002" endheading title="Chip Attractor" render=false param solid caption="solid background?" default=true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FX+FY" "FX-FY" "FX*FY" "Count+FX" "Count+FY" "Count+FX+FY" default = 0 endparam param a caption = "parameter a" default = -15.0 endparam param b caption = "parameter b" default = -19.0 endparam param c caption = "parameter c" default = 1.0 endparam } Chip-trap { ; Ron Barnett, November 1999 ; Shamelessly borrowed from Mark Townsend's ; Martin trap method using the Chip function init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int chip_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the Chip formula chip_iter = 0 while chip_iter < @max_iterations xx = x if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx chip_iter = chip_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Chip Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Chip parameter 1" default = -15.0 endparam param b caption = "Chip parameter 2" default = -3.0 endparam param c caption = "Chip parameter 3" default = 1.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Chip iterations" hint = "This is the number of iterations for the Chip formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Chip_trap_fBm { ; Ron Barnett, April 2001 init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int chip_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p_2 = #pixel * @nscale * r + @noffset WHILE (ii > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p_2)) % 256 float by0 = floor(imag(p_2)) % 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_2) - floor(real(p_2)) float ry0 = imag(p_2) - floor(imag(p_2)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p_2 = p_2 * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#screenpixel)+50*@fbm*(sum+1) float yy = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float xx = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float xx = real(#screenpixel)+10*log(@fbm*(sum+1)) float yy = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#screenpixel)+50*exp(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#screenpixel)+50*sin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#screenpixel)+50*asin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#screenpixel)+50*tan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#screenpixel)+50*atan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float xx = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float yy = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF p_2 = xx + flip(yy) if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start)*(1-@weight) + p_2*@weight x = real(p) * scale y = imag(p) * scale ; Iterate the Chip formula chip_iter = 0 while chip_iter < @max_iterations xx = x if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx chip_iter = chip_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = (distance + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 1 #index = (0.01 * trap_iter + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 2 #index = (cabs(trap_z) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 3 #index = (abs(real(trap_z)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 4 #index = (abs(imag(trap_z)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = (angle + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 6 #index = (cabs(trap_p) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 7 #index = (abs(real(trap_p)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 8 #index = (abs(imag(trap_p)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = (angle + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 10 #index = (0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 11 #index = (0.01 * exptrap_p + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) endif endif default: title = "Chip Orbit Trap with fBm" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Alpha" default = -15.0 endparam param b caption = "Beta" default = -3.0 endparam param c caption = "Gamma" default = 1.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Chip iterations" hint = "This is the number of iterations for the Chip formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam param weight caption = "fBm Weight" default = 0.001 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 0.2 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Chip_trap_fBm_II { ; Ron Barnett, January 2002 init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int chip_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p_2 = #pixel * @nscale * r + @noffset WHILE (ii > 0) ; determine integer coordinate for corners of square ; surrounding p float bx0 = floor(real(p_2)) % 256 float by0 = floor(imag(p_2)) % 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_2) - floor(real(p_2)) float ry0 = imag(p_2) - floor(imag(p_2)) float rx1 = rx0 - 1 float ry1 = ry0 - 1 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p_2 = p_2 * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF p_2 = xx + flip(yy) if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start)*(1-@weight) + p_2*@weight x = real(p) * scale y = imag(p) * scale ; Iterate the Chip formula chip_iter = 0 while chip_iter < @max_iterations xx = x if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx chip_iter = chip_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = (distance + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 1 #index = (0.01 * trap_iter + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 2 #index = (cabs(trap_z) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 3 #index = (abs(real(trap_z)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 4 #index = (abs(imag(trap_z)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = (angle + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 6 #index = (cabs(trap_p) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 7 #index = (abs(real(trap_p)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 8 #index = (abs(imag(trap_p)) + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = (angle + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 10 #index = (0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @color_mode == 11 #index = (0.01 * exptrap_p + @randomness * real(#random))*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) endif endif default: title = "Chip Orbit Trap with fBm II" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Alpha" default = -15.0 endparam param b caption = "Beta" default = -3.0 endparam param c caption = "Gamma" default = 1.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Chip iterations" hint = "This is the number of iterations for the Chip formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam param weight caption = "fBm Weight" default = 0.1 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 1.0 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 10.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } ChipsAreUs { ; Ron Barnett, April 2000 ; based on several approaches of Mark Townsend init: float d = 0 float d1 = 0 float d2 = 0 float d3 = 0 float astd = 1e30 float mind = 1e30 float mind1 = 1e30 float mind2 = 1e30 float mind3 = 1e30 float prd = 1e30 float prd1 = 1e30 float prd2 = 1e30 float prd3 = 1e30 float divd1 = 1e30 float divd11 = 1e30 float divd12 = 1e30 float divd13 = 1e30 float divd2 = 1e30 float divd21 = 1e30 float divd22 = 1e30 float divd23 = 1e30 float ang = 0 float f1 = 0 float f2 = 0 p = @fn1(#pixel + @start) float xx = 0 float zz = 0 float x = real(p) / @scale float y = imag(p) / @scale int i = 0 while i < @iters xx = x if @formula == 0 ; Chip if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx elseif @formula == 1 ; CosMartin x = y - cos(x) y = @a - xx elseif @formula == 2 ; Hopalong if x != 0 x = y - x/abs(x)*sqrt(abs(@b*x-@c)) else x = y - sqrt(abs(@b*x-@c)) endif y = @a - xx elseif @formula == 3 ; Liar if x + flip(p) < @a x = @b - abs(y-x) y = abs(@c - xx - y) endif elseif @formula == 4 ; PickMod x = sin(@a*y) - zz*cos(@b*x) y = zz*sin(@c*xx) - cos(-@a*y) zz = sin(xx) elseif @formula == 5 ; Threeply if x != 0 x = y - x/abs(x)*(abs(sin(x)*cos(@b) + @c \ - x*sin(@a + @b + @c))) else x = y - (abs(sin(x)*cos(@b) + @c \ - x*sin(@a + @b + @c))) endif y = @a - xx elseif @formula == 6 ; Quadruptwo if x != 0 x = y - x/abs(x)*sin(log(abs(@b*x-@c))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - sin(log(abs(@b*x-@c))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx endif i = i + 1 endwhile x = x * @scale y = y * @scale p = fn2(x + flip(y)) loop: if @colorby == 0 ang = atan(imag(#z)/real(#z)) f1 = cos(ang)^3 f2 = sin(ang)^3 astroid = @spread*(f1 + flip(f2)) d = cabs(#z - p + astroid) if d < astd astd = d endif elseif @colorby == 1 d = cabs(#z + @spread*(1,0) - p) d1 = cabs(#z + @spread*(0,1) - p) d2 = cabs(#z + @spread*(-1,0) - p) d3 = cabs(#z + @spread*(0,-1) - p) if d < mind mind = d endif if d1 < mind1 mind1 = d1 endif if d2 < mind2 mind2 = d2 endif if d3 < mind3 mind3 = d3 endif elseif @colorby == 2 d = cabs(#z*p + @spread*(1,0) - p) d1 = cabs(#z*p + @spread*(0,1) - p) d2 = cabs(#z*p + @spread*(-1,0) - p) d3 = cabs(#z*p + @spread*(0,-1) - p) if d < prd prd = d endif if d1 < prd1 prd1 = d1 endif if d2 < prd2 prd2 = d2 endif if d3 < prd3 prd3 = d3 endif elseif @colorby == 3 d = cabs(#z/p + @spread*(1,0) - p) d1 = cabs(#z/p + @spread*(0,1) - p) d2 = cabs(#z/p + @spread*(-1,0) - p) d3 = cabs(#z/p + @spread*(0,-1) - p) if d < divd1 divd1 = d endif if d1 < divd11 divd11 = d1 endif if d2 < divd12 divd12 = d2 endif if d3 < divd13 divd13 = d3 endif elseif @colorby == 4 d = cabs(p/#z + @spread*(1,0) - p) d1 = cabs(p/#z + @spread*(0,1) - p) d2 = cabs(p/#z + @spread*(-1,0) - p) d3 = cabs(p/#z + @spread*(0,-1) - p) if d < divd2 divd2 = d endif if d1 < divd21 divd21 = d1 endif if d2 < divd22 divd22 = d2 endif if d3 < divd23 divd23 = d3 endif endif final: if @colorby == 0 #index = astd elseif @colorby == 1 #index = (mind+mind1+mind2+mind3)/4 elseif @colorby == 2 #index = (prd+prd1+prd2+prd3)/4 elseif @colorby == 3 #index = (divd1+divd11+divd12+divd13)/4 elseif @colorby == 4 #index = (divd2+divd21+divd22+divd23)/4 endif default: title = "Chips Are Us" param scale caption = "Scale" default = 0.1 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param colorby caption = "Color by" enum = "Astroid" "Minimum Distance" \ "Product" "Ratio1" "Ratio2" default = 0 endparam param formula caption = "Formula" enum = "Chip" "CosMartin" "Hopalong" "Liar" \ "Modified Pickover" "Threeply" "Quadruptwo" default = 0 endparam param iters caption = "Iterations" default = 50 endparam param spread caption = "Spread" default = 1.0 endparam param a caption = "Parameter 1" default = 1.0 endparam param b caption = "Parameter 2" default = 1.0 endparam param c caption = "Parameter 3" default = 1.0 endparam func fn1 caption = "Pre Function" default = ident() endfunc func fn2 caption = "Post Function" default = ident() endfunc } ChipsAreUs_fBm { ; Ron Barnett, April 2001 ; init: float d = 0 float d1 = 0 float d2 = 0 float d3 = 0 float astd = 1e30 float mind = 1e30 float mind1 = 1e30 float mind2 = 1e30 float mind3 = 1e30 float prd = 1e30 float prd1 = 1e30 float prd2 = 1e30 float prd3 = 1e30 float divd1 = 1e30 float divd11 = 1e30 float divd12 = 1e30 float divd13 = 1e30 float divd2 = 1e30 float divd21 = 1e30 float divd22 = 1e30 float divd23 = 1e30 float ang = 0 float f1 = 0 float f2 = 0 p_2 = @fn1(#pixel + @start) float zz = 0 int i = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 float x = real(p_2) / @scale float y = imag(p_2) / @scale int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#screenpixel)+50*@fbm*(sum+1) float yy = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float xx = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float xx = real(#screenpixel)+10*log(@fbm*(sum+1)) float yy = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#screenpixel)+50*exp(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#screenpixel)+50*sin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#screenpixel)+50*asin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#screenpixel)+50*tan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#screenpixel)+50*atan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float xx = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float yy = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF x = x*(1-@weight) + xx*@weight y = y*(1-@weight) + yy*@weight while i < @iters xx = x if @formula == 0 ; Chip if x != 0 x = y - x/abs(x)*cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - cos(sqr(log(abs(@b*x-@c)))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx elseif @formula == 1 ; CosMartin x = y - cos(x) y = @a - xx elseif @formula == 2 ; Hopalong if x != 0 x = y - x/abs(x)*sqrt(abs(@b*x-@c)) else x = y - sqrt(abs(@b*x-@c)) endif y = @a - xx elseif @formula == 3 ; Liar if x + flip(p_2) < @a x = @b - abs(y-x) y = abs(@c - xx - y) endif elseif @formula == 4 ; PickMod x = sin(@a*y) - zz*cos(@b*x) y = zz*sin(@c*xx) - cos(-@a*y) zz = sin(xx) elseif @formula == 5 ; Threeply if x != 0 x = y - x/abs(x)*(abs(sin(x)*cos(@b) + @c \ - x*sin(@a + @b + @c))) else x = y - (abs(sin(x)*cos(@b) + @c \ - x*sin(@a + @b + @c))) endif y = @a - xx elseif @formula == 6 ; Quadruptwo if x != 0 x = y - x/abs(x)*sin(log(abs(@b*x-@c))) \ *atan(sqr(log(abs(@c*x-@b)))) else x = y - sin(log(abs(@b*x-@c))) \ *atan(sqr(log(abs(@c*x-@b)))) endif y = @a - xx endif i = i + 1 endwhile x = x * @scale y = y * @scale p_2 = fn2(x + flip(y)) loop: if @colorby == 0 ang = atan(imag(#z)/real(#z)) f1 = cos(ang)^3 f2 = sin(ang)^3 astroid = @spread*(f1 + flip(f2)) d = cabs(#z - p_2 + astroid) if d < astd astd = d endif elseif @colorby == 1 d = cabs(#z + @spread*(1,0) - p_2) d1 = cabs(#z + @spread*(0,1) - p_2) d2 = cabs(#z + @spread*(-1,0) - p_2) d3 = cabs(#z + @spread*(0,-1) - p_2) if d < mind mind = d endif if d1 < mind1 mind1 = d1 endif if d2 < mind2 mind2 = d2 endif if d3 < mind3 mind3 = d3 endif elseif @colorby == 2 d = cabs(#z*p_2 + @spread*(1,0) - p_2) d1 = cabs(#z*p_2 + @spread*(0,1) - p_2) d2 = cabs(#z*p_2 + @spread*(-1,0) - p_2) d3 = cabs(#z*p_2 + @spread*(0,-1) - p_2) if d < prd prd = d endif if d1 < prd1 prd1 = d1 endif if d2 < prd2 prd2 = d2 endif if d3 < prd3 prd3 = d3 endif elseif @colorby == 3 d = cabs(#z/p_2 + @spread*(1,0) - p_2) d1 = cabs(#z/p_2 + @spread*(0,1) - p_2) d2 = cabs(#z/p_2 + @spread*(-1,0) - p_2) d3 = cabs(#z/p_2 + @spread*(0,-1) - p_2) if d < divd1 divd1 = d endif if d1 < divd11 divd11 = d1 endif if d2 < divd12 divd12 = d2 endif if d3 < divd13 divd13 = d3 endif elseif @colorby == 4 d = cabs(p_2/#z + @spread*(1,0) - p_2) d1 = cabs(p_2/#z + @spread*(0,1) - p_2) d2 = cabs(p_2/#z + @spread*(-1,0) - p_2) d3 = cabs(p_2/#z + @spread*(0,-1) - p_2) if d < divd2 divd2 = d endif if d1 < divd21 divd21 = d1 endif if d2 < divd22 divd22 = d2 endif if d3 < divd23 divd23 = d3 endif endif final: if @colorby == 0 #index = astd*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @colorby == 1 #index = (mind+mind1+mind2+mind3)/4*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @colorby == 2 #index = (prd+prd1+prd2+prd3)/4*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @colorby == 3 #index = (divd1+divd11+divd12+divd13)/4*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) elseif @colorby == 4 #index = (divd2+divd21+divd22+divd23)/4*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) endif default: title = "Chips Are Us with fBm" param scale caption = "Scale" default = 0.01 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param colorby caption = "Color by" enum = "Astroid" "Minimum Distance" \ "Product" "Ratio1" "Ratio2" default = 0 endparam param formula caption = "Formula" enum = "Chip" "CosMartin" "Hopalong" "Liar" \ "Modified Pickover" "Threeply" "Quadruptwo" default = 0 endparam param iters caption = "Iterations" default = 50 endparam param spread caption = "Spread" default = 1.0 endparam param a caption = "Parameter 1" default = 1.0 endparam param b caption = "Parameter 2" default = 1.0 endparam param c caption = "Parameter 3" default = 1.0 endparam param weight caption = "fBm Weight" default = 0.2 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 0.2 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam func fn1 caption = "Pre Function" default = ident() endfunc func fn2 caption = "Post Function" default = ident() endfunc } CosMartin-trap { ; Ron Barnett, June 2000 ; Based upon approaches of Mark Townsend init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int cos_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = @a float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the CosMartin formula cos_iter = 0 while cos_iter < @max_iterations xx = x x = y - cos(x) y = @a - xx cos_iter = cos_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "CosMartin Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "CosMartin parameter" default = 1.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "CosMartin iterations" hint = "This is the number of iterations for the CosMartin formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } reb_smoothexp_fBm { ; Ron Barnett, April 2001 ; General exponential smoothing algorithm ; with fine control over color spread. ; Best if used with a high bailout value ; for divergent fractals init: float iterexp = 0 float scale = @colors*#pi/128 complex zold = (0,0) complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#screenpixel)+50*@fbm*(sum+1) float yy = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float xx = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float xx = real(#screenpixel)+10*log(@fbm*(sum+1)) float yy = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#screenpixel)+50*exp(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#screenpixel)+50*sin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#screenpixel)+50*asin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#screenpixel)+50*tan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#screenpixel)+50*atan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float xx = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float yy = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF p = xx + flip(yy) loop: complex z1 = #z*(1-@weight) + p*@weight IF (@converge > 0) iterexp = iterexp + exp(-cabs(z1)) ELSE iterexp = iterexp + exp(-1/(cabs(zold - z1))) ENDIF zold = #z final: float smooth = iterexp*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle*@palrange/(#pi*512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) default: title = "Exponential Smoothing with fBm" param colors caption = "Color Spread" default = 2.0 hint = "2.0 approximates the iteration count. \ Use 10.0 for convergent fractals." endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param converge caption = "Fractal Type" default = 1 enum = "Convergent" "Divergent" hint = "Mandelbrot is Divergent, Newton is Convergent." endparam param weight caption = "fBm Weight" default = 0.001 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 0.2 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam } Henon-trap { ; Ron Barnett, November 1999 ; Shamelessly borrowed from Mark Townsend's ; Martin trap method using the Henon function init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int hen_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b) float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the Henon formula hen_iter = 0 while hen_iter < @max_iterations xx = x x = 1 + y - @a*x*x y = @b*xx hen_iter = hen_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Henon Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Henon parameter 1" default = 1.4 endparam param b caption = "Henon parameter 2" default = 0.3 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Henon iterations" hint = "This is the number of iterations for the Henon formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Hopalong_strange_attractor { ; Ron Barnett February 28, 2003 ; ; Use this as inside coloring with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; $define debug global: int w = 0 int h = 0 complex hits[#width,#height] int count[#width,#height] float fx = 1.0 float ffx = 0.0 float xx = 0.0 float fy = 1.0 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*10000000 ; ; initialize hit array ; while(h < #height) while(w < #width) hits[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx if fx != 0 fx = fy - abs(fx)/fx*sqrt(abs(@b*fx-@c)) else fx = fy - sqrt(abs(@b*fx-@c)) endif fy = @a-xx ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = trunc(ffx) py = trunc(ffy) if px > 0 && py > 0 && px < #width && py < #height hits[px,py] = hits[px,py]+ffx+flip(ffy) count[px,py] = count[px,py] + 1 endif iter = iter + 1 endwhile ; init: int nhit=0 float xhit=0 float yhit=0 loop: final: nhit=count[#x,#y] xhit=real(hits[#x,#y]) yhit=imag(hits[#x,#y]) if @closeness > 0 if #x + @closeness < #width nhit = nhit + count[#x+@closeness, #y] xhit = xhit + real(hits[#x+@closeness, #y]) yhit = yhit + imag(hits[#x+@closeness, #y]) endif if #x - @closeness > 0 nhit = nhit + count[#x-@closeness, #y] xhit = xhit + real(hits[#x-@closeness, #y]) yhit = yhit + imag(hits[#x-@closeness, #y]) endif if #y + @closeness < #height nhit = nhit + count[#x, #y+@closeness] xhit = xhit + real(hits[#x, #y+@closeness]) yhit = yhit + imag(hits[#x, #y+@closeness]) endif if #y - @closeness > 0 nhit = nhit + count[#x, #y-@closeness] xhit = xhit + real(hits[#x, #y-@closeness]) yhit = yhit + imag(hits[#x, #y-@closeness]) endif endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 4 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 7 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: heading caption="Hopalong Attractor" endheading heading caption="x -> y - sign(x)*sqrt(abs(b*x-c))" endheading heading caption="y -> a - x" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading heading caption="Set magnification to 0.3" endheading title="Hopalong Attactor" render=false param solid caption="solid background?" default=true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FX+FY" "FX-FY" "FX*FY" "Count+FX" "Count+FY" "Count+FX+FY" default = 0 endparam param a caption = "parameter a" default = 0.4 endparam param b caption = "parameter b" default = 1.0 endparam param c caption = "parameter c" default = 0.0 endparam } Hopalong-trap { ; Ron Barnett, November 1999 ; Shamelessly borrowed from Mark Townsend's ; Martin trap method using the Hopalong function init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int hop_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the Hopalong formula hop_iter = 0 while hop_iter < @max_iterations xx = x x = y - x/abs(x)*sqrt(abs(@b*x-@c)) y = @a - xx hop_iter = hop_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Hopalong Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Hopalong parameter 1" default = .4 endparam param b caption = "Hopalong parameter 2" default = 1.0 endparam param c caption = "Hopalong parameter 3" default = 0.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Hopalong iterations" hint = "This is the number of iterations for the Hopalong formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Ikenaga-trap { ; Ron Barnett, April 2000 init: trap_z = 0 trap_p = 0 int iter = 0 float dist = 0 float distance = 0 int ike_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif loop: p = @fn1(#z + @start) c = #pixel ; Iterate the Mandel formula ike_iter = 0 while ike_iter < @max_iterations p = p*p*p +(c-1)*p - c ike_iter = ike_iter + 1 endwhile f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Ikenaga Orbit Trap" param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Ikenaga iterations" hint = "This is the number of iterations for the Ikenaga formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Latoocarfian_strange_attractor { ; Ron Barnett February 28, 2003 ; ; Use this as inside coloring with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; $define debug global: int w = 0 int h = 0 complex hits[#width,#height] int count[#width,#height] float fx = 1.0 float ffx = 0.0 float xx = 0.0 float fy = 1.0 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*10000000 ; ; initialize hit arrays ; while(h < #height) while(w < #width) hits[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx fx = real(@fn1(@b*fy) + @c*@fn2(@b*fx)) fy = real(@fn3(@a*xx) + @d*@fn4(@a*fy)) ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = trunc(ffx) py = trunc(ffy) if px > 0 && py > 0 && px < #width && py < #height hits[px,py] = hits[px,py]+ffx+flip(ffy) count[px,py] = count[px,py] + 1 endif iter = iter + 1 endwhile ; init: int nhit=0 float xhit=0 float yhit=0 loop: final: nhit=count[#x,#y] xhit=real(hits[#x,#y]) yhit=imag(hits[#x,#y]) if @closeness > 0 if #x + @closeness < #width nhit = nhit + count[#x+@closeness, #y] xhit = xhit + real(hits[#x+@closeness, #y]) yhit = yhit + imag(hits[#x+@closeness, #y]) endif if #x - @closeness > 0 nhit = nhit + count[#x-@closeness, #y] xhit = xhit + real(hits[#x-@closeness, #y]) yhit = yhit + imag(hits[#x-@closeness, #y]) endif if #y + @closeness < #height nhit = nhit + count[#x, #y+@closeness] xhit = xhit + real(hits[#x, #y+@closeness]) yhit = yhit + imag(hits[#x, #y+@closeness]) endif if #y - @closeness > 0 nhit = nhit + count[#x, #y-@closeness] xhit = xhit + real(hits[#x, #y-@closeness]) yhit = yhit + imag(hits[#x, #y-@closeness]) endif endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 4 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 7 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: heading caption="Latoocarfian Attractor" endheading heading caption="x -> sin(b*y) + c*sin(b*x)" endheading heading caption="y -> sin(a*x) + d*sin(a*y)" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading title="Latoocarfian Attractor" render=false param solid caption="solid background?" default=true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FX+FY" "FX-FY" "FX*FY" "Count+FX" "Count+FY" "Count+FX+FY" default = 0 endparam param a caption = "parameter a" default = -0.960918 endparam param b caption = "parameter b" default = 2.879879 endparam param c caption = "parameter c" default = 0.765145 endparam param d caption = "parameter d" default = 0.744728 endparam func fn1 caption = "function 1" default = sin() endfunc func fn2 caption = "function 2" default = sin() endfunc func fn3 caption = "function 3" default = sin() endfunc func fn4 caption = "function 4" default = sin() endfunc } Liar-trap { ; Ron Barnett, June 2000 ; Based upon approaches of Mark Townsend init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int liar_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the Liar formula liar_iter = 0 while liar_iter < @max_iterations xx = x if x + flip(p) < @a x = @b - abs(y-x) y = abs(@c - xx - y) endif liar_iter = liar_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Liar Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Liar parameter 1" default = 1.0 endparam param b caption = "Liar parameter 2" default = 1.0 endparam param c caption = "Liar parameter 3" default = 1.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Liar iterations" hint = "This is the number of iterations for the Liar formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } PickMod-trap { ; Ron Barnett, June 2000 ; Based upon approaches of Mark Townsend init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int pick_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 float zz = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the PickMod formula pick_iter = 0 while pick_iter < @max_iterations xx = x x = sin(@a*y) - zz*cos(@b*x) y = zz*sin(@c*xx) - cos(-@a*y) zz = sin(xx) pick_iter = pick_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Modified Pickover Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "PickMod parameter 1" default = 2.34 endparam param b caption = "PickMod parameter 2" default = 0.43 endparam param c caption = "PickMod parameter 3" default = -0.65 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "PickMod iterations" hint = "This is the number of iterations for the PickMod formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Pickover_strange_attractor { ; Ron Barnett February 23, 2003 ; ; Use this as inside coloring with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; ; Modified November 3, 2004 to add support for transformations using ; an algorithm based upon the work of Susan Chambless global: int w = 0 int h = 0 float Inc = @percentInc*0.01 float wd = Inc*#width float ht = Inc*#height int wd2 = round(wd*0.5) int ht2 = round(ht*0.5) complex hits[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))] complex hits2[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))] float fx = 0.0 float ffx = 0.0 float xx = 0.0 float fy = 0.0 float yy = 0.0 float ffy = 0.0 float zz = 0.0 float ffz = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float tzmax = sqrt(txmax^2+tymax^2) float xmin = cx - txmax/2 float ymin = cy - tymax/2 float zmin = sqrt(xmin^2 + ymin^2) float iterate = @density*10000000 ; ; initialize hit array ; while(h < #height+wd) while(w < #width+ht) hits[w,h] = 0 hits2[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; anneal the attractor ; h = 0 while (h < @anneal) xx = fx fx = real(@fn1(@a*fy)) - zz*real(@fn2(@b*fx)) fy = zz*real(@fn3(@c*xx)) - real(@fn4(@d*fy)) zz = real(@fn5(xx)) h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx fx = real(@fn1(@a*fy)) - zz*real(@fn2(@b*fx)) fy = zz*real(@fn3(@c*xx)) - real(@fn4(@d*fy)) zz = real(@fn5(xx)) ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax ffz = (zmin-zz)/sqrt(txmax^2+tymax^2) xx = ffx ; ; rotation around the z axis ; xx = ffx ffx = 0.5 + (ffx - 0.5 - @rotoffx/txmax)*cos(#angle) - \ (ffy - 0.5 - @rotoffy/tymax)*sin(#angle) ffy = 0.5 + (ffy - 0.5 - @rotoffy/tymax)*cos(#angle) + \ (xx - 0.5 - @rotoffx/txmax)*sin(#angle) ; ; rotation around the y axis ; xx = ffx ffx = (0.5 + (ffz - 0.5 - @rotoffz/txmax)*sin(@zangle*pi/180) + \ (ffx - 0.5 - @rotoffx/txmax)*cos(@zangle*pi/180))*#width ffz = (0.5 + (ffz - 0.5 - @rotoffz/tzmax)*cos(@zangle*pi/180) - \ (xx - 0.5 - @rotoffx/txmax)*sin(@zangle*pi/180)) ; ; rotation around the x axis ; yy = ffy ffy = (0.5 + (ffy - 0.5 - @rotoffy/tymax)*cos(@xangle*pi/180) - \ (ffz - 0.5 - @rotoffz/tzmax)*sin(@xangle*pi/180))*#height ffz = (0.5 + (yy - 0.5 - @rotoffy/tymax)*sin(@xangle*pi/180) + \ (ffz - 0.5 - @rotoffz/tzmax)*cos(@xangle*pi/180))*#height/2 ; ; final translation ; ffx = ffx - @transx*#width ffy = ffy - @transy*#height ffz = ffz - @transz*#height/2 ; ; perspective application ; if @useproj ffx = (@cprojx*ffz-ffx*@cprojz)/(ffz-@cprojz) ffy = (@cprojy*ffz-ffy*@cprojz)/(ffz-@cprojz) endif px = trunc(ffx)+wd2 py = trunc(ffy)+ht2 if px > 0 && py > 0 && px < #width+wd && py < #height+ht hits[px,py] = hits[px,py]+ffx+flip(ffy) hits2[px,py] = hits2[px,py] + 1 + flip(ffz) endif iter = iter + 1 endwhile ; init: float nhit=0 float xhit=0 float yhit=0 float zhit=0 loop: final: int xcrd = #x int ycrd = #y bool inside = true if @applymapping==true ; generate the x and y location in the image float dxx = (real(#pixel)-real(#center))*(#width)/4*#magn float dyy = (imag(#pixel)-imag(#center))*(#width)/4*#magn float transx = (#width+wd)*0.5; float transy = (#height+ht)*0.5; float cosan = cos(#angle); float sinan = sin(#angle); xcrd = round((transx + (dxx*cosan + dyy*sinan))) ycrd = round((transy + (dxx*sinan - dyy*cosan))) ; is this in our image? if (xcrd+wd2<0 || xcrd>=#width+wd2 || ycrd+ht2<0 || ycrd>=#height+ht2) inside = false endif endif if inside == true && real(hits2[xcrd,ycrd]) > @thresh nhit=real(hits2[xcrd,ycrd]) xhit=real(hits[xcrd,ycrd]) yhit=imag(hits[xcrd,ycrd]) zhit=imag(hits2[xcrd,ycrd]) if @closeness > 0 if xcrd + @closeness < #width nhit = nhit + real(hits2[xcrd+@closeness, ycrd]) xhit = xhit + real(hits[xcrd+@closeness, ycrd]) yhit = yhit + imag(hits[xcrd+@closeness, ycrd]) zhit = zhit + imag(hits2[xcrd+@closeness, ycrd]) endif if xcrd - @closeness > 0 nhit = nhit + real(hits2[xcrd-@closeness, ycrd]) xhit = xhit + real(hits[xcrd-@closeness, ycrd]) yhit = yhit + imag(hits[xcrd-@closeness, ycrd]) zhit = zhit + imag(hits2[xcrd-@closeness, ycrd]) endif if ycrd + @closeness < #height nhit = nhit + real(hits2[xcrd, ycrd+@closeness]) xhit = xhit + real(hits[xcrd, ycrd+@closeness]) yhit = yhit + imag(hits[xcrd, ycrd+@closeness]) zhit = zhit + imag(hits2[xcrd, ycrd+@closeness]) endif if ycrd - @closeness > 0 nhit = nhit + real(hits2[xcrd, ycrd-@closeness]) xhit = xhit + real(hits[xcrd, ycrd-@closeness]) yhit = yhit + imag(hits[xcrd, ycrd-@closeness]) zhit = zhit + imag(hits2[xcrd, ycrd-@closeness]) endif endif else #solid=true endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((zhit+1)/log(iterate))^@scale elseif @method == 4 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 7 #index=(((xhit+yhit)/(zhit+1)+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 9 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 10 #index=((nhit+zhit+1)/log(iterate))^@scale elseif @method == 11 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: heading caption="Generalized Pickover Attractor" endheading heading caption="x -> fn1(a*y) - z*fn2(b*x)" endheading heading caption="y -> z*fn3(c*x) - fn4(d*y)" endheading heading caption="z -> fn5(x)" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading title="Pickover Attactor (Generalized)" render=false param solid caption="solid background?" default=true endparam param applyMapping caption = "Apply Mapping" default = false endparam param percentInc caption = "Oversize by (%)" default = 0.0 visible = @applyMapping == true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param anneal caption = "Anneal the Attractor" default = 100 endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FZ" "FX+FY" "FX-FY" "FX*FY" "(FX+FY)/FZ" \ "Count+FX" "Count+FY" "Count+FZ" "Count+FX+FY" default = 0 endparam param thresh caption = "Hit Threshold" default = 0.0 endparam param xangle caption = "X Axis Rotation" default = 0.0 hint = "This is the fixed (horizontal) Y Axis. It is performed \ after the normal fractal rotation(s) and zooms." endparam param zangle caption = "Y Axis Rotation" default = 0.0 min = 0.0 max = 180.0 hint = "This is the fixed (vertical) Y Axis. It is performed \ after the normal fractal rotation(s) and zooms." endparam param rotoffx caption = "Rotation Center X Offset" default = 0.0 endparam param rotoffy caption = "Rotation Center Y Offset" default = 0.0 endparam param rotoffz caption = "Rotation Center Z Offset" default = 0.0 endparam param useproj caption = "Use Perspective" default = false endparam param cprojx caption = "X Center of Projection" default = 0.0 endparam param cprojy caption = "Y Center of Projection" default = 0.0 endparam param cprojz caption = "Z Center of Projection" default = -100.0 endparam param transx caption = "X Final Translation" default = 0.0 endparam param transy caption = "Y Final Translation" default = 0.0 endparam param transz caption = "Z Final Translation" default = 0.0 endparam param a caption = "parameter a" default = 2.24 endparam param b caption = "parameter b" default = 0.43 endparam param c caption = "parameter c" default = -0.65 endparam param d caption = "parameter d" default = -2.43 endparam func fn1 caption = "function 1" default = sin() endfunc func fn2 caption = "function 2" default = cos() endfunc func fn3 caption = "function 3" default = sin() endfunc func fn4 caption = "function 4" default = cos() endfunc func fn5 caption = "function 5" default = sin() endfunc } polartraps { ; Ron Barnett, January 2001 ; cleaned up some presentation items ; June 2004 init: float scale = @colors*100*#pi/128 float d = 0 float r = 0 float theta = 0 float x = 0 float y = 0 float closest = 1e+318 loop: x = real(#z)+real(@offset) y = imag(#z)+imag(@offset) r = cabs(#z) theta = atan2(y/x) IF @type == 0 r = @a*sqrt(cos(2*theta)) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 1 r = @a*(1-cos(theta)) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 2 r = (@a + @b*cos(theta))/cos(theta) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 3 IF @disttype == 0 d = abs(x-r*(theta-sin(theta))+y-r*(1-cos(theta))) ELSE d = abs(x-r*(theta-sin(theta)))+abs(y-r*(1-cos(theta))) ENDIF ELSEIF @type == 4 r = @a*theta IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 5 r = exp(@a*theta) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSE r = @a*cos(theta) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ENDIF IF d < closest closest = d ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512) IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Polar Traps" param type caption = "Trap Type" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" endparam param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam param b caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@type==2 endparam param offset caption = "Trap offset" default = (0.0,0.0) endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 2.0 hint = "Changes the color spread." endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam } polartraps_direct { ; Ron Barnett, January 2003 init: color accumulator = @startcolor; initialize color accumulator color current = rgb(0,0,0); holds current iteration's color float scale = @colors*100*#pi/128 float d = 0 float r = 0 float theta = 0 float x = 0 float y = 0 float closest = 1e+318 loop: x = real(#z)+real(@offset) y = imag(#z)+imag(@offset) r = cabs(#z) theta = atan2(y/x) IF @type == 0 r = @a*sqrt(cos(2*theta)) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 1 r = @a*(1-cos(theta)) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 2 r = (@a + @b*cos(theta))/cos(theta) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 3 IF @disttype == 0 d = abs(x-r*(theta-sin(theta))+y-r*(1-cos(theta))) ELSE d = abs(x-r*(theta-sin(theta)))+abs(y-r*(1-cos(theta))) ENDIF ELSEIF @type == 4 r = @a*theta IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSEIF @type == 5 r = exp(@a*theta) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ELSE r = @a*cos(theta) IF @disttype == 0 d = abs(x-r*cos(theta) + y-r*sin(theta)) ELSE d = abs(x-r*cos(theta)) + abs(y-r*sin(theta)) ENDIF ENDIF IF d < closest closest = d ENDIF ; Compute direct color. This code is very similar to the normal processing ; in the final section. float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF current = gradient(angle / (#pi * 2)) IF (@trapmergemodifier == "distance") current = rgba(red(current), green(current), blue(current), alpha(current) * closest / @threshold) ENDIF IF (@trapmergeorder == "bottom-up") accumulator = compose(accumulator, blend(current, @trapmergemode(accumulator, current), alpha(accumulator)), @trapmergeopacity) ELSEIF (@trapmergeorder == "top-down") accumulator = compose(current, blend(accumulator, @trapmergemode(current, accumulator), alpha(current)), @trapmergeopacity) ENDIF final: ; Return direct color. #color = accumulator default: title = "Polar Traps Direct" param type caption = "Trap Type" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" endparam param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam param b caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@type==2 endparam param offset caption = "Trap offset" default = (0.0,0.0) endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam param colors caption = "Trap Color Scale" default = 2.0 endparam param threshold caption = "Alpha Modifier" default = 0.25 min = 0 endparam heading caption = "Merging" endheading color param startcolor caption = "Base Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." endparam color func trapmergemode caption = "Trap Color Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." endfunc param trapmergemodifier caption = "Additional Alpha" default = 0 enum = "none" "distance" hint = "Specifies an additional alpha value to incorporate during merging." endparam param trapmergeopacity caption = "Trap Merge Opacity" default = 0.2 hint = "Sets the opacity of each trap shape. Even if you set this value to 1 \ (forcing all traps to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." endparam param trapmergeorder caption = "Trap Merge Order" default = 0 enum = "bottom-up" "top-down" hint = "Sets the order in which traps will be merged. Bottom-up merges new \ traps on top of previous ones. Top-down merges new traps underneath \ previous ones." endparam } polartraps_fBm { ; Ron Barnett, April 2001 init: float scale = @colors*100*#pi/128 float d = 0 float rr = 0 float theta = 0 float x = 0 float y = 0 float closest = 1e+318 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#screenpixel)+50*@fbm*(sum+1) float yy = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float xx = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float xx = real(#screenpixel)+10*log(@fbm*(sum+1)) float yy = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#screenpixel)+50*exp(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#screenpixel)+50*sin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#screenpixel)+50*asin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#screenpixel)+50*tan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#screenpixel)+50*atan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float xx = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float yy = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF p = xx + flip(yy) loop: complex z1 = #z*(1-@weight) + p*@weight x = real(z1)+real(@offset) y = imag(z1)+imag(@offset) rr = cabs(z1) theta = atan2(y/x) IF @type == 0 rr = @a*sqrt(cos(2*theta)) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 1 rr = @a*(1-cos(theta)) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 2 rr = (@a + @b*cos(theta))/cos(theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 3 IF @disttype == 0 d = abs(x-rr*(theta-sin(theta))+y-rr*(1-cos(theta))) ELSE d = abs(x-rr*(theta-sin(theta)))+abs(y-rr*(1-cos(theta))) ENDIF ELSEIF @type == 4 rr = @a*theta IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 5 rr = exp(@a*theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSE rr = @a*cos(theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ENDIF IF d < closest closest = d ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Polar Traps with fBm" param type caption = "Trap Type" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam param b caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@type == 2 endparam param offset caption = "Trap offset" default = (0.0,0.0) endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 2.0 hint = "Changes the color spread." endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param weight caption = "fBm Weight" default = 0.001 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 0.2 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam } polartraps_fBm_II { ; Ron Barnett, January 2002 init: float scale = @colors*100*#pi/128 float d = 0 float rr = 0 float theta = 0 float x = 0 float y = 0 float closest = 1e+318 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF p = xx + flip(yy) loop: complex z1 = #z*(1-@weight) + p*@weight x = real(z1)+real(@offset) y = imag(z1)+imag(@offset) rr = cabs(z1) theta = atan2(y/x) IF @type == 0 rr = @a*sqrt(cos(2*theta)) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 1 rr = @a*(1-cos(theta)) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 2 rr = (@a + @b*cos(theta))/cos(theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 3 IF @disttype == 0 d = abs(x-rr*(theta-sin(theta))+y-rr*(1-cos(theta))) ELSE d = abs(x-rr*(theta-sin(theta)))+abs(y-rr*(1-cos(theta))) ENDIF ELSEIF @type == 4 rr = @a*theta IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 5 rr = exp(@a*theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSE rr = @a*cos(theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ENDIF IF d < closest closest = d ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Polar Traps with fBm II" param type caption = "Trap Type" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam param b caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@type == 2 endparam param offset caption = "Trap offset" default = (0.0,0.0) endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 2.0 hint = "Changes the color spread." endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param weight caption = "fBm Weight" default = 0.1 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 1.0 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 10.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam } polartraps_fBm_III { ; Ron Barnett, February 2002 ; added some texture options inspired by work of Dennis Magar init: float scale = @colors*100*#pi/128 float d = 0 float rr = 0 float theta = 0 float x = 0 float y = 0 float closest = 1e+318 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 complex w = 0 complex ww = 0 complex dz = 0 float t = 0 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF p = xx + flip(yy) loop: complex z1 = #z*(1-@weight) + p*@weight x = real(z1)+real(@offset) y = imag(z1)+imag(@offset) rr = cabs(z1) theta = atan2(y/x) IF @type == 0 rr = @a*sqrt(cos(2*theta)) IF @disttype == 0 d = abs((x-rr*cos(theta)) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 1 rr = @a*(1-cos(theta)) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 2 rr = (@a + @b*cos(theta))/cos(theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 3 IF @disttype == 0 d = abs(x-rr*(theta-sin(theta))+y-rr*(1-cos(theta))) ELSE d = abs(x-rr*(theta-sin(theta)))+abs(y-rr*(1-cos(theta))) ENDIF ELSEIF @type == 4 rr = @a*theta IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSEIF @type == 5 rr = exp(@a*theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ELSE rr = @a*cos(theta) IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) ENDIF ENDIF IF d < closest closest = d dz = #z ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF w = fn2(fn1(dz*10^@pwr))*@ts ww = fn2(fn1((w - round(w)))) + @toffset t = cabs(ww)*@tc t = (t - trunc(t))*@tweight #index = angle * @palrange / (#pi * 512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)+t IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Polar Traps with fBm III" param type caption = "Trap Type" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam param b caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@type == 2 endparam param offset caption = "Trap offset" default = (0.0,0.0) endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 2.0 hint = "Changes the color spread." endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param weight caption = "fBm Weight" default = 0.1 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 1.0 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 10.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam param toffset caption = "Texture offset" default = (-1,-1) hint = "Changes the texture pattern." endparam param tweight caption = "Texture weight" default = 0.05 endparam param ts caption = "Texture scale" default = 20.0 endparam param tc caption = "Texture modifier" default = 5.0 endparam param pwr caption = "Texture power" default = 1.0 endparam func fn1 caption = "Texture Function 1" default = sqr() endfunc func fn2 caption = "Texture Function 2" default = acos() endfunc } Quadruptwo_strange_attractor { ; Ron Barnett February 28, 2003 ; ; Use this as inside coloring with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; ; Zoom in to about magn = 0.01 for a good starting point ; $define debug global: int w = 0 int h = 0 complex hits[#width,#height] int count[#width,#height] float fx = 1.0 float ffx = 0.0 float xx = 0.0 float fy = 1.0 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*1e10 ; ; initialize hit array ; while(h < #height) while(w < #width) hits[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx if fx != 0 fx = fy - abs(fx)/fx*sin(log(abs(@b*fx-@c)))*atan(sqr(log(abs(@c*fx-@b)))) else fx = fy - sin(log(abs(@b*fx-@c)))*atan(sqr(log(abs(@c*fx-@b)))) endif fy = @a-xx ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = trunc(ffx) py = trunc(ffy) if px > 0 && py > 0 && px < #width && py < #height hits[px,py] = hits[px,py]+ffx+flip(ffy) count[px,py] = count[px,py] + 1 endif iter = iter + 1 endwhile ; init: int nhit=0 float xhit=0 float yhit=0 loop: final: nhit=count[#x,#y] xhit=real(hits[#x,#y]) yhit=imag(hits[#x,#y]) if @closeness > 0 if #x + @closeness < #width nhit = nhit + count[#x+@closeness, #y] xhit = xhit + real(hits[#x+@closeness, #y]) yhit = yhit + imag(hits[#x+@closeness, #y]) endif if #x - @closeness > 0 nhit = nhit + count[#x-@closeness, #y] xhit = xhit + real(hits[#x-@closeness, #y]) yhit = yhit + imag(hits[#x-@closeness, #y]) endif if #y + @closeness < #height nhit = nhit + count[#x, #y+@closeness] xhit = xhit + real(hits[#x, #y+@closeness]) yhit = yhit + imag(hits[#x, #y+@closeness]) endif if #y - @closeness > 0 nhit = nhit + count[#x, #y-@closeness] xhit = xhit + real(hits[#x, #y-@closeness]) yhit = yhit + imag(hits[#x, #y-@closeness]) endif endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 4 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 7 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: heading caption="Quadruptwo Attractor" endheading heading caption="x -> y-sign(x)*sin(log(abs(b*x-c))) \" endheading heading caption=" *atan(sqr(log(abs(c*x-b))))" endheading heading caption="y -> a - x" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading heading caption="Set magnification to 0.01" endheading title="Quadruptwo Attractor" render=false param solid caption="solid background?" default=true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FX+FY" "FX-FY" "FX*FY" "Count+FX" "Count+FY" "Count+FX+FY" default = 0 endparam param a caption = "parameter a" default = 34.0 endparam param b caption = "parameter b" default = 1.0 endparam param c caption = "parameter c" default = 5.0 endparam } Quadruptwo-trap { ; Ron Barnett, June 2000 ; Based upon approaches of Mark Townsend init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int quad_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the Quadruptwo formula quad_iter = 0 while quad_iter < @max_iterations xx = x x = y - x/abs(x)*sin(log(abs(@b*x-@c))) \ *atan(sqr(log(abs(@c*x-@b)))) y = @a - xx quad_iter = quad_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Quadruptwo Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Quadruptwo parameter 1" default = 34.0 endparam param b caption = "Quadruptwo parameter 2" default = 1.0 endparam param c caption = "Quadruptwo parameter 3" default = 5.0 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Quadruptwo iterations" hint = "This is the number of iterations for the Quadruptwo formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } simpletraps { ; Ron Barnett, December 2000 init: float scale = @colors*100*#pi/128 float d = 0 float d1 = 0 float d2 = 0 int f1 = 0 int f2 = 0 int ftemp = 0 float closest = 1e+318 loop: IF @type == 0 d = abs(real(#z)+imag(#z)) ELSEIF @type == 1 d = abs(real(#z)*imag(#z)) ELSEIF @type == 2 d = abs(real(#z)/imag(#z)) ELSEIF @type == 3 d = abs(imag(#z)/real(#z)) ELSEIF @type == 4 d = abs(real(#z)-ceil(real(#z)))+abs(imag(#z)-floor(imag(#z))) ELSEIF @type == 5 d = abs(real(#z)-round(real(#z)))+abs(imag(#z)-trunc(imag(#z))) ELSEIF @type == 6 d = real(#z)-ceil(real(#z))+imag(#z)-floor(imag(#z)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 7 d = real(#z)-round(real(#z))+imag(#z)-trunc(imag(#z)) IF d < 0 d = 1e+318 ENDIF ELSE f1 = 0 f2 = 1 d1 =real(#z)-f2 WHILE d1 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d1 = real(#z)-f2 ENDWHILE d = real(#z)-f1 ; which Fibonocci number is closest IF d < abs(d1) d1 = d ENDIF f1 = 0 f2 = 1 d2 = imag(#z)-f2 WHILE d2 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d2 = imag(#z)-f2 ENDWHILE d = real(#z)-f1 ; which Fibonocci number is closest IF d < abs(d2) d2 = d ENDIF d = abs(d1) + abs(d2) ENDIF IF d < closest closest = d ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512) IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Simple Traps" param type caption = "Trap Type" default = 0 enum = "sum" "product" "quotient1" "quotient2" \ "ceil_floor" "trunc_round" "cf_plus" \ "tr_plus" "fibonocci" endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 1.0 endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam } simpletraps_direct { ; Ron Barnett, September 2002 init: color accumulator = @startcolor; initialize color accumulator color current = rgb(0,0,0); holds current iteration's color float scale = @colors*100*#pi/128 float d = 0 float d1 = 0 float d2 = 0 int f1 = 0 int f2 = 0 int ftemp = 0 float closest = 1e+318 loop: IF @type == 0 d = abs(real(#z)+imag(#z)) ELSEIF @type == 1 d = abs(real(#z)*imag(#z)) ELSEIF @type == 2 d = abs(real(#z)/imag(#z)) ELSEIF @type == 3 d = abs(imag(#z)/real(#z)) ELSEIF @type == 4 d = abs(real(#z)-ceil(real(#z)))+abs(imag(#z)-floor(imag(#z))) ELSEIF @type == 5 d = abs(real(#z)-round(real(#z)))+abs(imag(#z)-trunc(imag(#z))) ELSEIF @type == 6 d = real(#z)-ceil(real(#z))+imag(#z)-floor(imag(#z)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 7 d = real(#z)-round(real(#z))+imag(#z)-trunc(imag(#z)) IF d < 0 d = 1e+318 ENDIF ELSE f1 = 0 f2 = 1 d1 =real(#z)-f2 WHILE d1 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d1 = real(#z)-f2 ENDWHILE d = real(#z)-f1 ; which Fibonocci number is closest IF d < abs(d1) d1 = d ENDIF f1 = 0 f2 = 1 d2 = imag(#z)-f2 WHILE d2 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d2 = imag(#z)-f2 ENDWHILE d = real(#z)-f1 ; which Fibonocci number is closest IF d < abs(d2) d2 = d ENDIF d = abs(d1) + abs(d2) ENDIF IF d < closest closest = d ENDIF ; Compute direct color. This code is very similar to the normal processing ; in the final section. float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF current = gradient(angle / (#pi * 2)) IF (@trapmergemodifier == "distance") current = rgba(red(current), green(current), blue(current), alpha(current) * closest / @threshold) ENDIF IF (@trapmergeorder == "bottom-up") accumulator = compose(accumulator, blend(current, @trapmergemode(accumulator, current), alpha(accumulator)), @trapmergeopacity) ELSEIF (@trapmergeorder == "top-down") accumulator = compose(current, blend(accumulator, @trapmergemode(current, accumulator), alpha(current)), @trapmergeopacity) ENDIF final: ; Return direct color. #color = accumulator default: title = "Simple Traps Direct" param type caption = "Trap Type" default = 0 enum = "sum" "product" "quotient1" "quotient2" \ "ceil_floor" "trunc_round" "cf_plus" \ "tr_plus" "fibonocci" endparam param colors caption = "Trap Color Scale" default = 2.0 endparam param threshold caption = "Alpha Modifier" default = 0.25 min = 0 endparam heading caption = "Merging" endheading color param startcolor caption = "Base Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." endparam color func trapmergemode caption = "Trap Color Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." endfunc param trapmergemodifier caption = "Additional Alpha" default = 0 enum = "none" "distance" hint = "Specifies an additional alpha value to incorporate during merging." endparam param trapmergeopacity caption = "Trap Merge Opacity" default = 0.2 hint = "Sets the opacity of each trap shape. Even if you set this value to 1 \ (forcing all traps to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." endparam param trapmergeorder caption = "Trap Merge Order" default = 0 enum = "bottom-up" "top-down" hint = "Sets the order in which traps will be merged. Bottom-up merges new \ traps on top of previous ones. Top-down merges new traps underneath \ previous ones." endparam } simpletrapsdirect_Enhanced { ; Ron Barnett, September 2002 ; Further enhancements, progressive parameters and ; additional functions added February 5, 2005 init: color accumulator = @startcolor; initialize color accumulator color current = rgb(0,0,0); holds current iteration's color color textureaccumulator = @startcolor; initialize texturecolor accumulator color texturecurrent = rgb(0,0,0) ; holds current iteration's texture color float d1 = 0 float d2 = 0 int f1 = 0 int f2 = 0 int ftemp = 0 float d = 0 complex cd = 0 float distance = 0 float min_dist = 1e+318 if @trap_mode == 5 || @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 \ || @trap_mode == 9 min_dist = 0 endif bool trapped = false float x = 0 float y = 0 float rr = 0 float theta = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 complex w = 0 complex ww = 0 float t = 0 float sum = 0.0 float freq = 1.0 float exptrap_p = 0 float exptrap_z = 0 complex f_p = 0 float distsum = 0 float distave = 0 complex trap_z = 0 complex trap_p = 0 int trap_iter = 0 int max_iter = 0 int iter = 0 bool msk = @mask complex af1 = 0.0 complex af2 = 0.0 complex astroid = 0.0 float fx = 0 float fy = 0 float trapangle = 0 complex off = 0 float pa = 0 float pb = 0 float pc = 0 complex ppower = (0,0) float psa1 = 0 float psa2 = 0 float psa3 = 0 float psa4 = 0 float psa5 = 0 float psa6 = 0 float psa7 = 0 complex qa = 0 complex qb = 0 complex qc = 0 complex qy = 0 complex qx = 0 complex cx = 0 complex cy = 0 complex pstart = 0 IF @no_of_iters == 0 max_iter = #maxiter - @skip ELSE max_iter = @skip + @no_of_iters ENDIF IF (@mask == true) && (@rmask == true) msk = false ENDIF int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF loop: exptrap_z = exptrap_z + exp(-cabs(#z)) if iter == 0 trapangle = @ang*180/(2*#pi) off = @offset if @movecenter == true off = off + #pixel endif pa = @a pb = @b pc = @cp pstart = @start ppower = @apwr psa1 = @sa1 psa2 = @sa2 psa3 = @sa3 psa4 = @sa4 psa5 = @sa5 psa6 = @sa6 psa7 = @sa7 endif if @increment == true trapangle = trapangle + @rot*180/(2*#pi) off = off + @offx + flip(@offy) pstart = pstart + @incstartx + flip(@incstarty) pa = pa + @polar1 pb = pb + @polar2 pc = pc + @polar3 ppower = ppower + @papwr psa1 = psa1 + @isa1 psa2 = psa2 + @isa2 psa3 = psa3 + @isa3 psa4 = psa4 + @isa4 psa5 = psa5 + @isa5 psa6 = psa6 + @isa6 psa7 = psa7 + @isa7 endif complex z1 = (#z+off)*(1-@weight) + (xx + flip(yy))*@weight fx = real(z1)*cos(trapangle) - imag(z1)*sin(trapangle) fy = imag(z1)*cos(trapangle) + real(z1)*sin(trapangle) z1 = fx + flip(fy) x = real(z1)+real(off) y = imag(z1)+imag(off) IF @type == 0 f_p = z1 -(imag(#z)+flip(real(#z)))+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = 5*abs(real(z1)+imag(z1)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 25*cabs(z1-f_p)/cabs(d/5-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d/5-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d/5-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d/5-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 1 f_p = z1 - real(#z)*imag(#z)+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = 100*abs(real(z1)*imag(z1)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 25*cabs(z1-f_p)/cabs(d-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d/100-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d/100-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d/100-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 2 f_p = z1 - real(#z)/imag(#z)+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = 3*abs(real(z1)/imag(z1)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 25*cabs(z1-f_p)/cabs(d-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d/3-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d/3-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d/3-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 3 f_p = z1 - imag(#z)/real(#z)+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = abs(imag(z1)/real(z1)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 25*cabs(z1-f_p)/cabs(d-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 4 f_p = z1 - (ceil(real(#z))+ flip(floor(imag(#z))))+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = abs(real(z1)-ceil(real(z1)))+abs(imag(z1)-floor(imag(z1))) IF @trapvar == 1 d = 25*abs(d*d - d) ELSEIF @trapvar == 2 d = 25*abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = 10*abs(d - |f_p|) ELSEIF @trapvar == 5 d = 10*abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 25*cabs(#z-f_p)/cabs(d-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 5 f_p = z1 - (round(real(#z))+ flip(trunc(imag(#z))))+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = 3*(abs(real(z1)-round(real(z1)))+abs(imag(z1)-trunc(imag(z1)))) IF @trapvar == 1 d = 2*abs(d*d - d) ELSEIF @trapvar == 2 d = 2*abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = 5*abs(d - |f_p|) ELSEIF @trapvar == 5 d = 3*abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = cabs(#z-f_p)/cabs(d/3-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d/3-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d/3-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d/3-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 6 f_p = z1 - (ceil(real(#z))+ flip(floor(imag(#z))))+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = real(z1)-ceil(real(z1))+imag(z1)-floor(imag(z1)) IF @trapvar == 1 d = 5*abs(d*d - d) ELSEIF @trapvar == 2 d = 5*abs(d*d*d - d) ELSEIF @trapvar == 3 d = 5*abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = 5*abs(d - |f_p|) ELSEIF @trapvar == 5 d = 5*abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 5*cabs(#z-f_p)/cabs(d-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d-(x*y)) ENDIF distsum = abs(d) + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 7 f_p = z1 - (round(real(#z))+ flip(trunc(imag(#z))))+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF d = real(z1)-round(real(z1))+imag(z1)-trunc(imag(z1)) IF @trapvar == 1 d = 5*abs(d*d - d) ELSEIF @trapvar == 2 d = 5*abs(d*d*d - d) ELSEIF @trapvar == 3 d = 5*abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = 5*abs(d - |f_p|) ELSEIF @trapvar == 5 d = 5*abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = 5*cabs(#z-f_p)/cabs(d-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d-(x*y)) ENDIF distsum = abs(d) + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 8 IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF f1 = 0 f2 = 1 d1 =real(z1)-f2 WHILE d1 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d1 = real(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d1) d1 = d ENDIF f1 = 0 f2 = 1 d2 = imag(z1)-f2 WHILE d2 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d2 = imag(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d2) d2 = d ENDIF d = 5*(abs(d1) + abs(d2)) f_p = z1 - (d1 + flip(d2))+pstart IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 d = cabs(z1-f_p)/cabs(d/5-f_p) ELSEIF @trapvar == 7 d = cabs(fn3(f_p))/abs(d/5-cabs(z1-f_p)) ELSEIF @trapvar == 8 d = cabs(fn3(f_p))/abs(d/5-(x+y)) ELSEIF @trapvar == 9 d = cabs(fn3(f_p))/abs(d/5-(x*y)) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ELSEIF @type == 9 if @oldv == true IF @distvar == 0 ; Sum f_p = z1 -(@fn4(real(#z))+flip(@fn5(imag(#z))))+pstart ELSEIF @distvar == 1 ; Difference f_p = z1 -(@fn4(real(#z))-flip(@fn5(imag(#z))))+pstart ELSEIF @distvar == 2 ; Product f_p = z1 -(@fn4(real(#z))*flip(@fn5(imag(#z))))+pstart ELSEIF @distvar == 3 ; Quotient 1 f_p = z1 -(@fn4(real(#z))/flip(@fn5(imag(#z))))+pstart ELSEIF @distvar == 4 ; Quotient 2 f_p = z1 -(flip(@fn5(imag(#z)))/@fn4(real(#z)))+pstart ELSEIF @distvar == 5 ; Exp 1 f_p = z1 -(@fn4(real(#z))^flip(@fn5(imag(#z))))+pstart ELSEIF @distvar == 6 ; Exp 2 f_p = z1 -(flip(@fn5(imag(#z)))^@fn4(real(#z)))+pstart endif else IF @distvar == 0 ; Sum f_p = z1 -(@fn4(pa*real(#z))+flip(@fn5(0.2*pb*imag(#z))))+pstart ELSEIF @distvar == 1 ; Difference f_p = z1 -(@fn4(pa*real(#z))-flip(@fn5(0.2*pb*imag(#z))))+pstart ELSEIF @distvar == 2 ; Product f_p = z1 -(@fn4(pa*real(#z))*flip(@fn5(pb*imag(#z))))+pstart ELSEIF @distvar == 3 ; Quotient 1 f_p = z1 -(@fn4(pa*real(#z))/flip(@fn5(0.2*pb*imag(#z))))+pstart ELSEIF @distvar == 4 ; Quotient 2 f_p = z1 -(flip(@fn5(0.2*pb*imag(#z)))/@fn4(pa*real(#z)))+pstart ELSEIF @distvar == 5 ; Exp 1 f_p = z1 -(@fn4(pa*real(#z))^flip(@fn5(0.2*pb*imag(#z))))+pstart ELSEIF @distvar == 6 ; Exp 2 f_p = z1 -(flip(@fn5(0.2*pb*imag(#z)))^@fn4(pa*real(#z)))+pstart endif endif IF @distvar == 7 ; Lemniscate IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*(cos(2*theta))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 8 ; Cardiod IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*(1-cos(theta)) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 9 ; Conchoid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.1*(pa + pb*cos(theta))/cos(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 10 ; Cycloid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = cabs(z1 + @offset) f_p = z1 -(@fn4(rr*(theta-sin(theta)))+flip(@fn5(rr*(1-cos(theta)))))+pstart ELSEIF @distvar == 11 ; Archimedes IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*theta f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 12 ; Log spiral IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = exp(pa*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 13 ; Rose IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*cos(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 14 ; Bifolium IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 4*pa*sin(theta)*sin(theta)*cos(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 15 ; Astroid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = @afn1(theta)^real(ppower) af2 = @afn2(theta)^imag(ppower) astroid = @ar*(af1 + flip(af2)) f_p = z1 - astroid + pstart ELSEIF @distvar == 16 ; Cissoid of Diocles IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.2*pa*sin(theta)*tan(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 17 ; Cochleoid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 1.25*pa*sin(theta)/theta f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 18 ; Folium of Descartes IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.3*pa*tan(theta)/(cos(theta)*(1+tan(theta)^3)) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 19 ; Limacon of Pascal IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.05*pb + pa*cos(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 20 ; Lituus IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pa/theta^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 21 ; Nephroid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) astroid = 0.5*pa*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 22 ; Strophoid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.1*pb*sin(pa-2*theta)/sin(pa-theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 23 ; Witch of Agnesi IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 2*cotan(theta) af2 = 1-cos(2*theta) astroid = 0.1*pa*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 24 ; Curtate Cycloid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = pa*theta - 0.1*pb*@afn2(theta) af2 = pa - 0.1*pb*@afn1(theta) astroid = af1 + flip(af2) f_p = z1 - astroid+pstart ELSEIF @distvar == 25 ; Epicycloid IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = (5*pa+pb)*@afn1(theta) - pb*@afn1((5*pa+pb)*theta/pb) af2 = (5*pa+pb)*@afn2(theta) - pb*@afn2((5*pa+pb)*theta/pb) astroid = 0.1*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 26 ; Ellipse Evolute IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = (pa^2-(0.7*pb)^2)/pa*@afn1(theta)^(real(ppower)) af2 = ((0.7*pb)^2-pa^2)/(0.7*pb)*@afn2(theta)^(imag(ppower)) astroid = 0.1*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 27 ; Tractrix IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = pa*(log(tan(theta/2))-@afn1(theta)) af2 = pa*@afn2(theta) astroid = 0.25*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 28 ; Kampyle of Eudoxus IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.02*pa/cos(theta)^2 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 29 ; Circle Catacaustic IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 2*pb*(1-3*2*pb*cos(theta)+2*2*pb*cos(theta)^3)/(-(1+2*(2*pb)^2)+3*2*pb*cos(theta)) af2 = 2*(2*pb)^2*sin(theta)^3/(1+2*(2*pb)^2-3*2*pb*cos(theta)) astroid = pa*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 30 ; Deltoid Catacaustic IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*pb) - @afn1(#pi/2*pb) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*pb) - @afn2(#pi/2*pb) astroid = 0.25*pa*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 31 ; Ellipse Catacaustic IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 4*pa*(pa-pb)*(pa*pb)*sin(theta)^3/(pa^2+pb^2+(pb^2-pa^2)*cos(2*theta)) af2 = 4*pb*(pb^2-pa^2)*cos(theta)^3/(pa^2+pb^2+3*(pb^2-pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 32 ; Log Spiral Catacaustic IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 0.2*pb*exp(0.1*pb*theta)*(0.1*pb*cos(theta)-sin(theta))/(1+(0.1*pb)^2) af2 = 0.2*pb*exp(0.1*pb*theta)*(0.1*pb*cos(theta)+sin(theta))/(1+(0.1*pb)^2) astroid = pa*(af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 33 ; Butterfly IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 34 ; Gear Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = (0.25*pa+1/(5*pb)*tanh(5*pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*pa+1/(5*pb)*tanh(5*pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 35 ; Arachnida 1 IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pa*sin(@pn*theta)/sin((@pn-1)*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 36 ; Arachnida 2 IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pa*sin(@pn*theta)/sin((@pn+1)*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 37 ; Cayley's Sextic IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 1.5*pa*cos(theta)^3 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 38 ; Cycloid of Seva IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.5*pa*(1+2*cos(2*theta)) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 39 ; Devil's Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = (((0.5*pa*sin(theta))^2-(0.2*pb*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 40 ; Eight Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*cos(theta)^(-2)*cos(2*theta)^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 41 ; Epispiral IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pa/cos(@pn*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 42 ; Hipopede IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = (0.5*pb*(0.5*pa-(0.5*pb)^2*cos(theta)))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 43 ; Maltese Cross IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.2*pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 44 ; Ophiuride IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = (0.01*pb*sin(theta)-pa*cos(theta))*tan(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 45 ; Quadratrix of Hippias IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*theta/sin(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 46 ; Poinsot Spiral 1 IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa/cosh(@pn*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 47 ; Poinsot Spiral 2 IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa/sinh(@pn*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 48 ; Quadrifolium IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*sin(2*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 49 ; Scarabaeus IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pb*cos(2*theta)-0.5*pa*cos(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 50 ; Semicubical Parabola IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.005*pa*tan(theta)^2/cos(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 51 ; Swastika Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.25*pa*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 52 ; Trifolium IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = -pa*cos(3*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 53 ; Tschirnhausen Cubic IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa/cos(theta/3)^3 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 54 ; Bicorn IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = pa*sin(theta) af2 = pa*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 55 ; Cruciform IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 0.1*pa/cos(theta) af2 = 0.02*pb/sin(theta) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 56 ; Knot Curve cy = imag(#z) qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif f_p = z1 - pa*(qx + flip(cy)) ELSEIF @distvar == 57 ; Ampersand qa = 4 qb = 6*real(#z)^2 - 3*real(#z) - 3 qc = 6*real(#z)^4 - 13*real(#z)^3 + 19*real(#z)^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif f_p = z1 - pa*(real(#z) + flip(qy)) ELSEIF @distvar == 58 ; Bean IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = pa*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) f_p = z1 -(@fn4(af1*cos(theta))+flip(@fn5(af1*sin(theta))))+pstart ELSEIF @distvar == 59 ; Bicuspid cy = imag(#z) qa = 1 qb = -2*(0.05*pb)^2 qc = (0.05*pb)^4 - (cy^2 - (0.05*pb)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif f_p = z1 - 2.25*pa*(qx + flip(cy)) ELSEIF @distvar == 60 ; Bow IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 0.1*pa*(1-tan(theta)^2)*cos(theta) af2 = 0.1*pb*(1-tan(theta)^2)*sin(theta) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 61 ; Cassini Ovals IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF if @negroot == true rr = 0.5*pa*(cos(2*theta)-((pb*0.1/(pa*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*pa*(cos(2*theta)+((pb*0.1/(pa*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 62 ; Circle IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*sin(theta)^2 + 0.2*pb*cos(theta)^2 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 63 ; Trident cx = real(#z) cy = cx^2 + 0.1*pb/cx f_p = z1 - 0.1*pa*(cx + flip(cy)) ELSEIF @distvar == 64 cy = imag(#z) ; Stirrup Curve qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif f_p = z1 - pa*(qx + flip(cy)) ELSEIF @distvar == 65 ; Diamond f_p = z1 - pa*@safn(abs((real(#z)*psa1))+abs((flip(imag(#z))^psa2))-1) ELSEIF @distvar == 66 ; Dumbbell Curve cx = real(#z) cy = (cx^4 - cx^6)^0.5 f_p = z1 - 4*pa*(cx + flip(cy)) ELSEIF @distvar == 67 ; Teardrop Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = pa*cos(theta) af2 = 0.5*pb*sin(theta)*sin(theta/2)^(@pn-1) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 68 ; Happy Accident f_p = z1 - 15*pa*@safn((((real(#z)*psa4)^(1+psa2))+ \ (flip(imag(#z))^2*psa3))*atan2((flip(imag(#z))^psa7)* \ (real(#z)^psa5))-psa1* \ (flip(imag(#z))^psa6)) ELSEIF @distvar == 69 ; Hyperbola IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.35*pa*(1/cos(2*theta))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 70 ; Kappa Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.1*pa*tan(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 71 ; Piriform IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 0.1*pa*(1+sin(theta)) af2 = 0.1*pb*cos(theta)*(1+sin(theta)) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 72 ; Keratoid Cusp cx = real(#z) qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif f_p = z1 - 2.5*pa*(cx + flip(qy)) ELSEIF @distvar == 73 ; Serpentine Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 0.2*pa*cotan(theta) af2 = 0.2*pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 74 ; Line cx = real(#z) cy = cx f_p = z1 - 3*pa*(cx + flip(cy)) ELSEIF @distvar == 75 ;Links Curve cx = real(#z) qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif f_p = z1 - pa*(cx + flip(qy)) ELSEIF @distvar == 76 ; Parabola cy = imag(#z) cx = 10*pb*cy^2 f_p = z1 - 0.65*pa*(cx + flip(cy)) ELSEIF @distvar == 77 ; Trefoil IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.1*pa/cos(3*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 78 ; Trident of Descartes cx = real(#z) cy = (cx-0.2*pb)*(cx+0.2*pb)*(cx-0.4*pb)/cx f_p = z1 - pa*(cx + flip(cy)) ELSEIF @distvar == 79 ; Trisectrix of Maclaurin IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = 0.5*pa*sin(3*theta)/sin(2*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 80 ; Atzema Spiral IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF af1 = 0.5*pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) f_p = z1 - astroid+pstart ELSEIF @distvar == 81 ; Rose of Troy IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pc*(1+10*pa*sin(4*pb*theta)) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 82 ; Cotes' Spiral IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa/cosh(pb*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 83 ; Dipole Curve IF @t2 == 1 theta = atan(imag(#z)/real(#z)) ELSE theta = atan2(imag(#z)/real(#z)) ENDIF rr = pa*(cos(theta))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))+pstart ELSEIF @distvar == 84 ; Polytrope cx = real(#z) cy = 1/cx^@pn f_p = z1 - 0.00005*pa*(cx + flip(cy)) ENDIF IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF if @oldv == true IF @distvar == 0 IF @absval == true cd = cabs(#z) - cabs((@fn4(real(z1)) + flip(@fn5(imag(z1))))) ELSE cd = #z - (@fn4(real(z1)) - flip(@fn5(imag(z1)))) ENDIF ELSEIF @distvar == 1 IF @absval == true cd = cabs(#z) - cabs((@fn4(real(z1)) - flip(@fn5(imag(z1))))) ELSE cd = #z - (@fn4(real(z1)) + flip(@fn5(imag(z1)))) ENDIF ELSEIF @distvar == 2 IF @absval == true cd = cabs(#z) - cabs((@fn4(real(z1))*flip(@fn5(imag(z1))))) ELSE cd = #z - @fn4((real(z1))*flip(@fn5(imag(z1)))) ENDIF ELSEIF @distvar == 3 IF @absval == true cd = cabs(#z) - cabs((@fn4(real(z1))/flip(@fn5(imag(z1))))) ELSE cd = #z - (@fn4(real(z1))/flip(@fn5(imag(z1)))) ENDIF ELSEIF @distvar == 4 IF @absval == true cd = cabs(#z) - cabs((flip(@fn5(imag(z1)))/@fn4(real(z1)))) ELSE cd = #z - flip((@fn5(imag(z1)))/@fn4(real(z1))) ENDIF ELSEIF @distvar == 5 IF @absval == true cd = cabs(#z) - cabs((@fn4(real(z1))^flip(@fn5(imag(z1))))) ELSE cd = #z - (@fn4(real(z1))^flip(@fn5(imag(z1)))) ENDIF ELSEIF @distvar == 6 IF @absval == true cd = cabs(#z) - cabs((flip(@fn5(imag(z1)))^@fn4(real(z1)))) ELSE cd = #z - (flip(@fn5(imag(z1)))^@fn4(real(z1))) ENDIF endif else IF @distvar == 0 IF @absval == true cd = cabs(#z) - cabs((@fn4(pa*real(z1)) + flip(@fn5(0.2*pb*imag(z1))))) ELSE cd = #z - (@fn4(real(pa*z1)) - flip(@fn5(0.2*pb*imag(z1)))) ENDIF ELSEIF @distvar == 1 IF @absval == true cd = cabs(#z) - cabs((@fn4(pa*real(z1)) - flip(@fn5(0.2*pb*imag(z1))))) ELSE cd = #z - (@fn4(pa*real(z1)) + flip(@fn5(0.2*pb*imag(z1)))) ENDIF ELSEIF @distvar == 2 IF @absval == true cd = cabs(#z) - cabs((@fn4(pa*real(z1))*flip(@fn5(pb*imag(z1))))) ELSE cd = #z - @fn4((pa*real(z1))*flip(@fn5(pb*imag(z1)))) ENDIF ELSEIF @distvar == 3 IF @absval == true cd = cabs(#z) - cabs((@fn4(pa*real(z1))/flip(@fn5(0.2*pb*imag(z1))))) ELSE cd = #z - (@fn4(pa*real(z1))/flip(@fn5(0.2*pb*imag(z1)))) ENDIF ELSEIF @distvar == 4 IF @absval == true cd = cabs(#z) - cabs((flip(@fn5(0.2*pb*imag(z1)))/@fn4(pa*real(z1)))) ELSE cd = #z - flip((@fn5(0.2*pb*imag(z1)))/@fn4(pa*real(z1))) ENDIF ELSEIF @distvar == 5 IF @absval == true cd = cabs(#z) - cabs((@fn4(pa*real(z1))^flip(@fn5(0.2*pb*imag(z1))))) ELSE cd = #z - (@fn4(pa*real(z1))^flip(@fn5(0.2*pb*imag(z1)))) ENDIF ELSEIF @distvar == 6 IF @absval == true cd = cabs(#z) - cabs((flip(@fn5(0.2*pb*imag(z1)))^@fn4(pa*real(z1)))) ELSE cd = #z - (flip(@fn5(0.2*pb*imag(z1)))^@fn4(pa*real(z1))) ENDIF endif endif IF @distvar == 7 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*(cos(2*theta))^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 8 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*(1-cos(theta)) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 9 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.1*(pa + pb*cos(theta))/cos(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 10 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = cabs(z1 + @offset) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*(theta-sin(theta))) - flip(@fn5(rr*(1-cos(theta))))) ELSE cd = #z - @fn4(rr*(theta-sin(theta))) - flip(@fn5(rr*(1-cos(theta)))) ENDIF ELSEIF @distvar == 11 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*theta IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 12 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = exp(pa*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 13 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*cos(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 14 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 4*pa*sin(theta)*sin(theta)*cos(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 15 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = @afn1(theta)^real(ppower) af2 = @afn2(theta)^imag(ppower) astroid = @ar*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 16 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.2*pa*sin(theta)*tan(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 17 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 1.25*pa*sin(theta)/theta IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 18 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.3*pa*tan(theta)/(cos(theta)*(1+tan(theta)^3)) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 19 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.05*pb + pa*cos(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 20 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pa/theta^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 21 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 3*@afn1(theta) - @afn1(theta/3) af2 = 3*@afn2(theta) - @afn2(theta/3) astroid = 0.5*pa*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 22 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.1*pb*sin(pa-2*theta)/sin(pa-theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 23 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 2*cotan(theta) af2 = 1-cos(2*theta) astroid = 0.1*pa*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 24 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = pa*theta - 0.1*pb*@afn2(theta) af2 = pa - 0.1*pb*@afn1(theta) astroid = af1 + flip(af2) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 25 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = (5*pa+pb)*@afn1(theta) - pb*@afn1((5*pa+pb)*theta/pb) af2 = (5*pa+pb)*@afn2(theta) - pb*@afn2((5*pa+pb)*theta/pb) astroid = 0.1*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 26 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = (pa^2-(0.7*pb)^2)/pa*@afn1(theta)^(real(ppower)) af2 = ((0.7*pb)^2-pa^2)/(0.7*pb)*@afn2(theta)^(imag(ppower)) astroid = 0.1*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 27 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = pa*(log(tan(theta/2))-@afn1(theta)) af2 = pa*@afn2(theta) astroid = 0.25*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 28 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.02*pa/cos(theta)^2 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 29 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 2*pb*(1-3*2*pb*cos(theta)+2*2*pb*cos(theta)^3)/(-(1+2*(2*pb)^2)+3*2*pb*cos(theta)) af2 = 2*(2*pb)^2*sin(theta)^3/(1+2*(2*pb)^2-3*2*pb*cos(theta)) astroid = pa*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 30 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 3*@afn1(theta) + @afn1(3*theta+#pi/2*pb) - @afn1(#pi/2*pb) af2 = 3*@afn2(theta) + @afn2(3*theta+#pi/2*pb) - @afn2(#pi/2*pb) astroid = 0.25*pa*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 31 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 4*pa*(pa-pb)*(pa*pb)*sin(theta)^3/(pa^2+pb^2+(pb^2-pa^2)*cos(2*theta)) af2 = 4*pb*(pb^2-pa^2)*cos(theta)^3/(pa^2+pb^2+3*(pb^2-pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 32 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 0.2*pb*exp(0.1*pb*theta)*(0.1*pb*cos(theta)-sin(theta))/(1+(0.1*pb)^2) af2 = 0.2*pb*exp(0.1*pb*theta)*(0.1*pb*cos(theta)+sin(theta))/(1+(0.1*pb)^2) astroid = pa*(af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 33 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 34 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = (0.25*pa+1/(5*pb)*tanh(5*pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*pa+1/(5*pb)*tanh(5*pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 35 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pa*sin(@pn*theta)/sin((@pn-1)*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 36 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pa*sin(@pn*theta)/sin((@pn+1)*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 37 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 1.5*pa*cos(theta)^3 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 38 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.5*pa*(1+2*cos(2*theta)) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 39 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = (((0.5*pa*sin(theta))^2-(0.2*pb*cos(theta))^2)/(sin(theta)^2-cos(theta)^2))^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 40 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*cos(theta)^(-2)*cos(2*theta)^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 41 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pa/cos(@pn*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 42 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = (0.5*pb*(0.5*pa-(0.5*pb)^2*cos(theta)))^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 43 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.2*pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 44 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = (0.01*pb*sin(theta)-pa*cos(theta))*tan(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 45 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*theta/sin(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 46 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa/cosh(@pn*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 47 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa/sinh(@pn*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 48 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*sin(2*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 49 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pb*cos(2*theta)-0.5*pa*cos(theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 50 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*(cos(2*pb*theta))^(1/(2*pb)) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 51 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.25*pa*(sin(theta)*cos(theta)/(sin(theta)^4-cos(theta)^4))^0.5 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 52 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = -pa*cos(3*theta) IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 53 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa/cos(theta/3)^3 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta)) + flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta)) - flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 54 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = pa*sin(theta) af2 = pa*cos(theta)^2*(2+cos(theta))/(3+sin(theta)^2) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 55 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 0.1*pa/cos(theta) af2 = 0.02*pb/sin(theta) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 56 cy = y qa = 1 qb = -2 qc = 1 - 3*cy^2 - 2*cy^3 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif IF @absval == true cd = cabs(#z) - cabs(pa*(qx + flip(cy))) ELSE cd = #z - pa*(qx + flip(cy)) ENDIF ELSEIF @distvar == 57 qa = 4 qb = 6*x^2 - 3*x - 3 qc = 6*x^4 - 13*x^3 + 19*x^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif IF @absval == true cd = cabs(#z) - cabs(pa*(x + flip(qy))) ELSE cd = #z - pa*(x + flip(qy)) ENDIF ELSEIF @distvar == 58 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = pa*(@afn1(theta)^real(@apwr) + @afn2(theta)^imag(@apwr)) IF @absval == true cd = cabs(#z) - cabs(@fn4(af1*cos(theta))+ flip(@fn5(af1*sin(theta)))) ELSE cd = #z - @fn4(af1*cos(theta))- flip(@fn5(af1*sin(theta))) ENDIF ELSEIF @distvar == 59 cy = y qa = 1 qb = -2*(0.05*pb)^2 qc = (0.05*pb)^4 - (cy^2 - (0.05*pb)^2)^2 if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif IF @absval == true cd = cabs(#z) - cabs(2.25*pa*(qx + flip(cy))) ELSE cd = #z - 2.25*pa*(qx + flip(cy)) ENDIF ELSEIF @distvar == 60 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 0.1*pa*(1-tan(theta)^2)*cos(theta) af2 = 0.1*pb*(1-tan(theta)^2)*sin(theta) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 61 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF if @negroot == true rr = 0.5*pa*(cos(2*theta)-((pb*0.1/(pa*0.5))^4-sin(2*theta)^2)^0.5)^0.5 else rr = 0.5*pa*(cos(2*theta)+((pb*0.1/(pa*0.5))^4-sin(2*theta)^2)^0.5)^0.5 endif IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta))+ flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta))- flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 62 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*sin(theta)^2 + 0.2*pb*cos(theta)^2 IF @absval == true cd = cabs(#z) - cabs(@fn4(rr*cos(theta))+ flip(@fn5(rr*sin(theta)))) ELSE cd = #z - @fn4(rr*cos(theta))- flip(@fn5(rr*sin(theta))) ENDIF ELSEIF @distvar == 63 cx = x cy = cx^2 + 0.1*pb/cx IF @absval == true cd = cabs(#z) - cabs(0.1*pa*(cx + flip(cy))) ELSE cd = #z - 0.1*pa*(cx + flip(cy)) ENDIF ELSEIF @distvar == 64 cy = y qa = 1 qb = -2 qc = 1-cy^2*(cy-1)*(cy-2)*(cy+5) if @negroot == true qx = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qx = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif f_p = z1 - pa*(qx + flip(cy)) IF @absval == true cd = cabs(#z) - cabs(pa*(qx + flip(cy))) ELSE cd = #z - pa*(qx + flip(cy)) ENDIF ELSEIF @distvar == 65 IF @absval == true cd = cabs(#z) - cabs(pa*@safn(abs((real(z1)*psa1))+abs((flip(imag(z1))^psa2))-1)) ELSE cd = #z - pa*@safn(abs((real(z1)*psa1))+abs((flip(imag(z1))^psa2))-1) ENDIF ELSEIF @distvar == 66 cx = x cy = (cx^4 - cx^6)^0.5 IF @absval == true cd = cabs(#z) - cabs(4*pa*(cx + flip(cy))) ELSE cd = #z - 4*pa*(cx + flip(cy)) ENDIF ELSEIF @distvar == 67 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = pa*cos(theta) af2 = 0.5*pb*sin(theta)*sin(theta/2)^(@pn-1) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 68 IF @absval == true cd = cabs(#z) - cabs(15*pa*@safn((((real(z1)*psa4)^(1+psa2))+ \ (flip(imag(z1))^2*psa3))*atan2((flip(imag(z1))^psa7)* \ (real(z1)^psa5))-psa1* \ (flip(imag(z1))^psa6))) ELSE cd = #z - 15*pa*@safn((((real(z1)*psa4)^(1+psa2))+ \ (flip(imag(z1))^2*psa3))*atan2((flip(imag(z1))^psa7)* \ (real(z1)^psa5))-psa1* \ (flip(imag(z1))^psa6)) ENDIF ELSEIF @distvar == 69 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.35*pa*(1/cos(2*theta))^0.5 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 70 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.1*pa*tan(theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 71 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 0.1*pa*(1+sin(theta)) af2 = 0.1*pb*cos(theta)*(1+sin(theta)) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 72 cx = x qa = 1 qb = -cx^2 qc = -cx^5 if @negroot == true qy = (-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa) else qy = (-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa) endif IF @absval == true cd = cabs(#z) - cabs(2.5*pa*(cx + flip(qy))) ELSE cd = #z - 2.5*pa*(cx + flip(qy)) ENDIF ELSEIF @distvar == 73 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 0.2*pa*cotan(theta) af2 = 0.2*pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 74 cx = x cy = cx IF @absval == true cd = cabs(#z) - cabs(3*pa*(cx + flip(cy))) ELSE cd = #z - 3*pa*(cx + flip(cy)) ENDIF ELSEIF @distvar == 75 cx = x qa = 1 qb = 2*cx^2-6*cx qc = cx^4-2*cx^3+cx^2 if @negroot == true qy = ((-qb - (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 else qy = ((-qb + (qb^2 - 4*qa*qc)^0.5)/(2*qa))^0.5 endif IF @absval == true cd = cabs(#z) - cabs(pa*(cx + flip(qy))) ELSE cd = #z - pa*(cx + flip(qy)) ENDIF ELSEIF @distvar == 76 cy = y cx = 10*pb*cy^2 IF @absval == true cd = cabs(#z) - cabs(0.65*pa*(cx + flip(cy))) ELSE cd = #z - 0.65*pa*(cx + flip(cy)) ENDIF ELSEIF @distvar == 77 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.1*pa/cos(3*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 78 cx = x cy = (cx-0.2*pb)*(cx+0.2*pb)*(cx-0.4*pb)/cx IF @absval == true cd = cabs(#z) - cabs(pa*(cx + flip(cy))) ELSE cd = #z - pa*(cx + flip(cy)) ENDIF ELSEIF @distvar == 79 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = 0.5*pa*sin(3*theta)/sin(2*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 80 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF af1 = 0.5*pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) IF @absval == true cd = cabs(#z) - cabs(astroid) ELSE cd = #z - astroid ENDIF ELSEIF @distvar == 81 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pc*(1+10*pa*sin(4*pb*theta)) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 82 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa/cosh(pb*theta) f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 83 IF @t2 == 1 theta = atan(y/x) ELSE theta = atan2(y/x) ENDIF rr = pa*(cos(theta))^2 f_p = z1 -(@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) IF @absval == true cd = cabs(#z) - cabs((@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta))))) ELSE cd = #z - (@fn4(rr*cos(theta))+flip(@fn5(rr*sin(theta)))) ENDIF ELSEIF @distvar == 84 cx = x cy = 1/cx^@pn IF @absval == true cd = cabs(#z) - cabs(0.00005*pa*(cx + flip(cy))) ELSE cd = #z - 0.00005*pa*(cx + flip(cy)) ENDIF ENDIF d = cabs(cd) IF @trapvar == 1 d = cabs(cd*cd - cd) ELSEIF @trapvar == 2 d = cabs(cd*cd*cd - cd) ELSEIF @trapvar == 3 d = cabs(cd*cd*cd -cd*cd +cd) ELSEIF @trapvar == 4 d = cabs(cd - |f_p|) ELSEIF @trapvar == 5 d = cabs(cd - fn3(f_p)) ELSEIF @trapvar == 6 d = cabs((z1-f_p)/(cd-f_p)) ELSEIF @trapvar == 7 d = cabs((fn3(f_p))/(cd-(z1-f_p))) ELSEIF @trapvar == 8 d = cabs((fn3(f_p))/(cd-(x+y))) ELSEIF @trapvar == 9 d = cabs((fn3(f_p))/(cd-(x*y))) ENDIF distsum = d + distsum if @oldv == false distave = distsum/exptrap_z else distave = distsum/iter endif ENDIF IF @trap_mode == 0 IF (iter >= @skip && iter < max_iter) \ && d < min_dist min_dist = d distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 1 IF (iter >= @skip && iter < max_iter) \ && !trapped && d < @width trapped = true distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 2 IF (iter >= @skip && iter < max_iter) \ && d < @width trapped = true distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 3 d = cabs(f_p) IF (iter >= @skip && iter < max_iter) \ && d < min_dist min_dist = d distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p ENDIF ENDIF if @oldv == true if @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif else IF @trap_mode == 4 IF (iter >= @skip && iter < max_iter) \ && d < @width trapped = true min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p ENDIF endif endif IF @trap_mode == 5 IF (iter >= @skip && iter < max_iter) \ && d > min_dist && d < @width trapped = true min_dist = d distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 \ || @trap_mode ==9 IF (iter >= @skip && iter < max_iter) \ && d < @width trapped = true distance = distance + d trap_iter = iter trap_z = trap_z + #z trap_p = trap_p + f_p ENDIF ELSEIF @trap_mode == 10 || @trap_mode == 11 || @trap_mode == 12 \ || @trap_mode ==13 IF (iter >= @skip && iter < max_iter) \ && !trapped && d < @width trapped = true distance = distance + d trap_iter = iter trap_z = trap_z + #z trap_p = trap_p + f_p ENDIF ENDIF iter = iter + 1 ; Compute direct color. This code is very similar to the normal processing ; in the final section. if @oldv == true w = fn2(fn1((trap_z)*10^@pwr))*@ts ww = fn2(fn1((w - round(w)))) + @toffset else if @txttype == 0 if @addfbm == true w = fn2(fn1((trap_z+@tfbm*(xx+flip(yy)))*10^@pwr))*@ts else w = fn2(fn1((trap_z)*10^@pwr))*@ts endif elseif @txttype == 1 if @addfbm == true w = fn2(fn1((trap_p+@tfbm*(xx+flip(yy)))*10^@pwr))*@ts else w = fn2(fn1((trap_p)*10^@pwr))*@ts endif elseif @txttype == 2 if @addfbm == true w = fn2(fn1((#pixel+@tfbm*(xx+flip(yy)))*10^@pwr))*@ts else w = fn2(fn1((#pixel)*10^@pwr))*@ts endif endif ww = fn2(fn1((w - @fn6(w)))) + @toffset endif t = cabs(ww)*@tc if @oldv == true t = (t - trunc(t))*@tweight else t = (t - round(t))*@tweight endif if @trap_mode == 7 || @trap_mode == 11 distance = distance + cabs(trap_p) endif if @trap_mode == 8 || @trap_mode == 12 distance = distance + cabs(trap_z) endif if @trap_mode == 9 || @trap_mode == 13 distance = distance + (cabs(trap_z) + cabs(trap_p))/2 endif texturecurrent = gradient(t) IF (@trap_mode == 1 || @trap_mode == 2 || @trap_mode == 5 \ || @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 || \ @trap_mode == 9 || @trap_mode == 10 || @trap_mode == 11 \ || @trap_mode == 12 || @trap_mode == 13) \ || (@oldv == false && @trap_mode == 4) IF !trapped && @back == true current = rgba(0,0,0,@maskalpha) texturecurrent = rgba(0,0,0,@maskalpha) ELSE IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF ELSEIF (@trap_mode != 1 && @trap_mode != 2 && @trap_mode != 5 \ && @trap_mode != 6 && @trap_mode != 7 && @trap_mode != 8 \ && @trap_mode != 9 && @trap_mode != 10 && @trap_mode != 11 \ && @trap_mode != 12 && @trap_mode != 13 \ || (@oldv==false && @trap_mode==4)) && @trap IF msk == true && min_dist > @width current = rgba(0,0,0,@maskalpha) texturecurrent = rgba(0,0,0,@maskalpha) ELSEIF msk == true && min_dist <= @width IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF IF @rmask == true && min_dist <= @width current = rgba(0,0,0,@maskalpha) texturecurrent = rgba(0,0,0,@maskalpha) ELSEIF @rmask == true && min_dist > @width IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF ELSE IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF IF (@trapmergemodifier == 1) current = rgba(red(current), green(current), blue(current), alpha(current) * distance / @threshold) endif IF (@trapmergeorder == "bottom-up") accumulator = compose(accumulator, blend(current, @trapmergemode(accumulator, current), alpha(accumulator)), @trapmergeopacity) ELSEIF (@trapmergeorder == "top-down") accumulator = compose(current, blend(accumulator, @trapmergemode(current, accumulator), alpha(current)), @trapmergeopacity) ENDIF IF (@texturemergeorder == "bottom-up") textureaccumulator = compose(textureaccumulator, blend(texturecurrent, @texturemergemode(textureaccumulator, texturecurrent), alpha(textureaccumulator)), @texturemergeopacity) ELSEIF (@trapmergeorder == "top-down") textureaccumulator = compose(texturecurrent, blend(textureaccumulator, @texturemergemode(texturecurrent, textureaccumulator), alpha(texturecurrent)), @texturemergeopacity) ENDIF accumulator = blend(accumulator, textureaccumulator, @blendfactor) final: ; Return direct color. #color = accumulator default: title = "Simple Traps Direct Enhanced" helpfile = "Simple Traps Direct Enhanced.chm" heading caption = "Simple Traps Direct Enhanced" endheading heading caption = "This is a direct coloring" endheading heading caption = "formula with 94 trap" endheading heading caption = "functions and 9 variants" endheading heading caption = "for each function. Refer to" endheading heading caption = "the help file to use this" endheading heading caption = "coloring method." endheading heading caption = "To use the new enhancements" endheading heading caption = "uncheck the Old Version box." endheading param oldv caption = "Use Old Version" default = true endparam param start caption = "Starting offset" default = (0.0,0.0) visible=@trap_mode==3 || @color_mode==6 || @color_mode==7 || @color_mode==8 \ || @color_mode==9 || @color_mode==10 || @color_mode== 11 || @trapvar==4 \ || @trapvar==5 || @trapvar==6 || @trapvar==7 || @trapvar==8 || @trapvar==9 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param type caption = "Trap Type" default = 0 enum = "sum" "product" "quotient1" "quotient2" \ "ceil_floor" "trunc_round" "cf_plus" \ "tr_plus" "fibonacci" "functions" endparam param distvar caption = "Distance variants" default = 0 enum = "Sum" "Difference" "Product" "Quotient1" "Quotient2" \ "Exp1" "Exp2" "Lemniscate" "Cardiod" "Conchoid" "Cycloid" \ "Archimedes" "Log spiral" "Rose" "Bifolium" "Astroid" \ "Cissoid of Diocles" "Cochleoid" "Folium of Descartes" \ "Limacon of Pascal" "Lituus" "Nephroid" "Strophoid" \ "Witch of Agnesi" "Curtate Cycloid" "Epicycloid" \ "Ellipse Evolute" "Tractrix" "Kampyle of Eudoxus" \ "Circle Catacaustic" "Deltoid Catacaustic" \ "Ellipse Catacaustic" "Log Spiral Catacaustic" \ "Butterfly" "Gear Curve" "Arachnida 1" "Arachnida 2" \ "Cayley's Sextic" "Cycloid of Seva" "Devil's Curve" \ "Eight Curve" "Epispiral" "Hipopede" "Maltese Cross" \ "Ophiuride" "Quadratrix of Hippias" "Poinsot Spiral 1" \ "Poinsot Spiral 2" "Quadrifolium" "Scarabaeus" \ "Semicubical Parabola" "Swastika Curve" "Trifolium" \ "Tschirnhausen Cubic" "Bicorn" "Cruciform" "Knot Curve" \ "Ampersand" "Bean" "Bicuspid" "Bow" "Cassini Ovals" "Circle" \ "Trident" "Stirrup Curve" "Diamond" "Dumbbell Curve" \ "Teardrop Curve" "Happy Accident" "Hyperbola" "Kappa Curve" \ "Piriform" "Keratoid Cusp" "Serpentine Curve" "Line" \ "Links Curve" "Parabola" "Trefoil" "Trident of Descartes" \ "Trisectrix of Maclaurin" "Atzema Spiral" "Rose of Troy" \ "Cotes' Spiral" "Dipole Curve" "Polytrope" visible=@type==9 endparam param sa1 caption = "Adjuster 1" default = 1.0 visible = @distvar == 65 || @distvar == 68 endparam param sa2 caption = "Adjuster 2" default = 1.0 visible = @distvar == 65 || @distvar == 68 endparam param sa3 caption = "Adjuster 3" default = 1.0 visible = @distvar == 68 endparam param sa4 caption = "Adjuster 4" default = 1.0 visible = @distvar == 68 endparam param sa5 caption = "Adjuster 5" default = 1.0 visible = @distvar == 68 endparam param sa6 caption = "Adjuster 6" default = 1.0 visible = @distvar == 68 endparam param sa7 caption = "Adjuster 7" default = 1.0 visible = @distvar == 68 endparam param ar caption = "Astroid Radius" default = 0.2 visible=@distvar==15 endparam param apwr caption = "Power" default = (3.0,3.0) visible=@distvar==15 || @distvar==26 || @distvar==58 endparam func afn1 caption = "Polar Fn 1" default = cos() visible=@distvar==15 || @distvar==21 || @distvar==24 || @distvar==25 \ || @distvar==26 || @distvar==27 || @distvar==30 || @distvar==58 endfunc func afn2 caption = "Polar Fn 2" default = sin() visible=@distvar==15 || @distvar==21 || @distvar==24 || @distvar==25 \ || @distvar==26 || @distvar==27 || @distvar==30 || @distvar==58 endfunc func safn caption = "Adjuster Fn" default = ident() visible= @distvar == 65 || @distvar == 68 endfunc param a caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible=(@oldv == false && (@distvar==0 ||@distvar==1 ||@distvar==2 || @distvar==3 \ ||@distvar==4 ||@distvar==5 ||@distvar==6)&& @type == 9) \ || @distvar==7 || @distvar==8 || @distvar==9 || @distvar==11 \ || @distvar==12 || @distvar==13 || @distvar==14 || @distvar==16 \ || @distvar==17 || @distvar==18 || @distvar==19 || @distvar==20 \ || @distvar==21 || @distvar==22 || @distvar==23 || @distvar==24 \ || @distvar==25 || @distvar==26 || @distvar==27 || @distvar==28 \ || @distvar==29 || @distvar==30 || @distvar==31 || @distvar==32 \ || @distvar==33 || @distvar==34 || @distvar==35 || @distvar==36 \ || @distvar==37 || @distvar==38 || @distvar==39 || @distvar==40 \ || @distvar==41 || @distvar==42 || @distvar==43 || @distvar==44 \ || @distvar==45 || @distvar==46 || @distvar==47 || @distvar==48 \ || @distvar==49 || @distvar==50 || @distvar==51 || @distvar==52 \ || @distvar==53 || @distvar==54 || @distvar==55 || @distvar==56 \ || @distvar==57 || @distvar==58 || @distvar==59 || @distvar==60 \ || @distvar==61 || @distvar==62 || @distvar==63 || @distvar==64 \ || @distvar==65 || @distvar==66 || @distvar==67 || @distvar==68 \ || @distvar==69 || @distvar==70 || @distvar==71 || @distvar==72 \ || @distvar==73 || @distvar==74 || @distvar==75 || @distvar==76 \ || @distvar==77 || @distvar==78 || @distvar==79 || @distvar==80 \ || @distvar==81 || @distvar==82 || @distvar==83 || @distvar==84 endparam param b caption = "2nd Polar parameter" default = 1.0 hint = "Affects shape and scale of trap." visible=(@oldv == false &&(@distvar==0 ||@distvar==1 ||@distvar==2 || @distvar==3 \ ||@distvar==4 ||@distvar==5 ||@distvar==6)&& @type == 9) \ || @distvar==9 || @distvar==19 || @distvar==22 || @distvar==24 \ || @distvar==25 || @distvar==26 || @distvar==29 || @distvar==30 \ || @distvar==31 || @distvar==32 || @distvar==34 || @distvar==39 \ || @distvar==42 || @distvar==44 || @distvar==49 || @distvar==55 \ || @distvar==59 || @distvar==60 || @distvar==61 || @distvar==62 \ || @distvar==63 || @distvar==67 || @distvar==71 || @distvar==73 \ || @distvar==76 || @distvar==78 || @distvar==80 || @distvar==81 \ || @distvar==82 endparam param cp caption = "3rd Polar parameter" default = 0.05 visible=@distvar==81 endparam param pn caption = "Polar integer" default = 3 visible=@distvar==34 || @distvar==35 || @distvar==36 || @distvar==41 \ || @distvar==46 || @distvar==47 || @distvar==67 || @distvar==84 endparam param t2 caption = "Angle type" default = 1 enum = "Atan2" "Atan" visible=@distvar==7 || @distvar==8 || @distvar==9 || @distvar==10 \ || @distvar==10 || @distvar==12 || @distvar==13 || @distvar==14 \ || @distvar==15 || @distvar==16 || @distvar==17 || @distvar==18 \ || @distvar==19 || @distvar==20 || @distvar==21 || @distvar==21 \ || @distvar==22 || @distvar==23 || @distvar==24 || @distvar==25 \ || @distvar==26 || @distvar==27 || @distvar==28 || @distvar==29 \ || @distvar==30 || @distvar==31 || @distvar==32 || @distvar==33 \ || @distvar==34 || @distvar==35 || @distvar==36 || @distvar==37 \ || @distvar==38 || @distvar==39 || @distvar==40 || @distvar==41 \ || @distvar==42 || @distvar==43 || @distvar==44 || @distvar==45 \ || @distvar==46 || @distvar==47 || @distvar==48 || @distvar==49 \ || @distvar==50 || @distvar==51 || @distvar==52 || @distvar==53 \ || @distvar==54 || @distvar==55 || @distvar==58 || @distvar==60 \ || @distvar==61 || @distvar==62 || @distvar==67 || @distvar==69 \ || @distvar==70 || @distvar==71 || @distvar==73 || @distvar==77 \ || @distvar==79 || @distvar==80 || @distvar==81 || @distvar==82 \ || @distvar==83 endparam param absval caption = "Absolute Value" default = true visible=@type==9 && @trap_mode != 3 endparam param negroot caption = "Quad Neg Root" default = false visible=@type==9 && (@distvar == 56 || @distvar == 57 || @distvar == 59 \ || @distvar==61 || @distvar==64 || @distvar == 72 || @distvar==75) endparam func fn4 caption = "Real Function" default = ident() visible=@type==9 && @distvar != 15 && @distvar != 21 && @distvar != 23 \ && @distvar != 24 && @distvar != 25 && @distvar != 26 && @distvar != 27 \ && @distvar != 29 && @distvar != 30 && @distvar != 31 && @distvar != 32 \ && @distvar != 34 && @distvar != 54 && @distvar != 55 && @distvar != 56 \ && @distvar != 57 && @distvar != 59 && @distvar != 60 \ && @distvar != 63 && @distvar != 64 \ && @distvar != 65 && @distvar != 66 && @distvar != 67 && @distvar != 68 \ && @distvar != 71 && @distvar != 72 && @distvar != 73 && @distvar != 74 \ && @distvar != 75 && @distvar != 76 && @distvar != 78 && @distvar != 80 \ && @distvar != 84 endfunc func fn5 caption = "Imaginary Function" default = ident() visible=@type==9 && @distvar != 15 && @distvar != 21 && @distvar != 23 \ && @distvar != 24 && @distvar != 25 && @distvar != 26 && @distvar != 27 \ && @distvar != 29 && @distvar != 30 && @distvar != 31 && @distvar != 32 \ && @distvar != 34 && @distvar != 54 && @distvar != 55 && @distvar != 56 \ && @distvar != 57 && @distvar != 59 && @distvar != 60 \ && @distvar != 63 && @distvar != 64 \ && @distvar != 65 && @distvar != 66 && @distvar != 67 && @distvar != 68 \ && @distvar != 71 && @distvar != 72 && @distvar != 73 && @distvar != 74 \ && @distvar != 75 && @distvar != 76 && @distvar != 78 && @distvar != 80 \ && @distvar != 84 endfunc param trapvar caption = "Trap variants" default = 0 enum = "default" "1" "2" "3" "4" "5" "6" "7" "8" "9" endparam func fn3 caption = "Trap var function" default = cos() visible = @trapvar==5 ||@trapvar==7 || @trapvar==8 || @trapvar==9 endfunc param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" "Farthest" \ "Sum" "Weighted Sum" "Weighted Sum 2" "Weighted Sum 3" \ "Sum 2" "Weighted Sum 4" "Weighted Sum 5" "Weighted Sum 6" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam heading caption = "Traps" endheading param showtrap caption = "Show Trap Parameters" default = false endparam param trap caption = "Alternate trap" default = false hint = "Trap for modes other than 'first' and 'last'" visible=@showtrap==true&&(@trap_mode == 0 || @trap_mode == 3 || (@oldv == true && @trap_mode == 4)) endparam param mask caption = "Mask" default = true hint = "Uses 'trap width' as threshold" visible=@showtrap==true&&(@trap_mode == 0 || @trap_mode == 3 || (@oldv == true && @trap_mode == 4)) endparam param rmask caption = "Reverse mask" default = false hint = "Uses 'trap width' as threshold" visible=@showtrap==true&&(@trap_mode == 0 || @trap_mode == 3 || (@oldv == true && @trap_mode == 4)) endparam param back caption = "Solid Background" default = true visible=@showtrap==true&&((@trap_mode == 1 || @trap_mode == 2 || @trap_mode == 5 \ || @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 || \ @trap_mode == 9 || @trap_mode == 10 || @trap_mode == 11 \ || @trap_mode == 12 || @trap_mode == 13) || (@oldv == false && @trap_mode == 4)) endparam param maskalpha caption = "Mask Alpha" default = 1.0 min = 0 visible=@showtrap==true endparam param width caption = "Trap width" default = 0.1 visible=@showtrap==true endparam param ang caption = "Trap rotation" default = 0.0 visible=@showtrap==true endparam param offset caption = "Trap offset" default = (0.0,0.0) visible=@showtrap==true endparam param movecenter caption = "Move offset" default = false visible=@showtrap==true endparam Heading caption = "Progressive Parameters" endheading param increment caption = "Increment parameters" default = false endparam param incstartx caption = "Inc starting x offset" default = 0.0 visible=@increment==true && (@trap_mode==3 || @color_mode==6 || @color_mode==7 || @color_mode==8 \ || @color_mode==9 || @color_mode==10 || @color_mode== 11 || @trapvar==4 \ || @trapvar==5 || @trapvar==6 || @trapvar==7 || @trapvar==8 || @trapvar==9) endparam param incstarty caption = "Inc starting y offset" default = 0.0 visible=@increment==true && (@trap_mode==3 || @color_mode==6 || @color_mode==7 || @color_mode==8 \ || @color_mode==9 || @color_mode==10 || @color_mode== 11 || @trapvar==4 \ || @trapvar==5 || @trapvar==6 || @trapvar==7 || @trapvar==8 || @trapvar==9) endparam param rot caption = "Inc trap rotation" default = 0.0 visible=@increment==true endparam param offx caption = "Inc x trap offset" default = 0.0 visible=@increment==true endparam param offy caption = "Inc y trap offset" default = 0.0 visible=@increment==true endparam param polar1 caption = "Inc polar1" default = 0.0 visible=@increment==true && ((@oldv == false && (@distvar==0 ||@distvar==1 ||@distvar==2 || @distvar==3 \ ||@distvar==4 ||@distvar==5 ||@distvar==6)&& @type == 9) \ || @distvar==7 || @distvar==8 || @distvar==9 || @distvar==11 \ || @distvar==12 || @distvar==13 || @distvar==14 || @distvar==16 \ || @distvar==17 || @distvar==18 || @distvar==19 || @distvar==20 \ || @distvar==21 || @distvar==22 || @distvar==23 || @distvar==24 \ || @distvar==25 || @distvar==26 || @distvar==27 || @distvar==28 \ || @distvar==29 || @distvar==30 || @distvar==31 || @distvar==32 \ || @distvar==33 || @distvar==34 || @distvar==35 || @distvar==36 \ || @distvar==37 || @distvar==38 || @distvar==39 || @distvar==40 \ || @distvar==41 || @distvar==42 || @distvar==43 || @distvar==44 \ || @distvar==45 || @distvar==46 || @distvar==47 || @distvar==48 \ || @distvar==49 || @distvar==50 || @distvar==51 || @distvar==52 \ || @distvar==53 || @distvar==54 || @distvar==55 || @distvar==56 \ || @distvar==57 || @distvar==58 || @distvar==59 || @distvar==60 \ || @distvar==61 || @distvar==62 || @distvar==63 || @distvar==64 \ || @distvar==65 || @distvar==66 || @distvar==67 || @distvar==68 \ || @distvar==69 || @distvar==70 || @distvar==71 || @distvar==72 \ || @distvar==73 || @distvar==74 || @distvar==75 || @distvar==76 \ || @distvar==77 || @distvar==78 || @distvar==79 || @distvar==80 \ || @distvar==81 || @distvar==82 || @distvar==83 || @distvar==84) endparam param polar2 caption = "Inc polar2" default = 0.0 visible=@increment==true && ((@oldv == false &&(@distvar==0 ||@distvar==1 ||@distvar==2 || @distvar==3 \ ||@distvar==4 ||@distvar==5 ||@distvar==6)&& @type == 9) \ || @distvar==9 || @distvar==19 || @distvar==22 || @distvar==24 \ || @distvar==25 || @distvar==26 || @distvar==29 || @distvar==30 \ || @distvar==31 || @distvar==32 || @distvar==34 || @distvar==39 \ || @distvar==42 || @distvar==44 || @distvar==49 || @distvar==55 \ || @distvar==59 || @distvar==60 || @distvar==61 || @distvar==62 \ || @distvar==63 || @distvar==67 || @distvar==71 || @distvar==73 \ || @distvar==76 || @distvar==78 || @distvar==80 || @distvar==81 \ || @distvar==82) endparam param polar3 caption = "Inc polar3" default = 0.0 visible=@distvar==81 endparam param papwr caption = "Inc power" default = (0,0) visible = @increment==true && (@distvar==15 || @distvar==26 || @distvar==58) endparam param isa1 caption = "Inc Adjuster 1" default = 0.0 visible = @increment==true && (@distvar==65 \ || @distvar==68) endparam param isa2 caption = "Inc Adjuster 2" default = 0.0 visible = @increment==true && (@distvar==65 \ || @distvar==68) endparam param isa3 caption = "Inc Adjuster 3" default = 0.0 visible = @increment==true && (@distvar==68) endparam param isa4 caption = "Inc Adjuster 4" default = 0.0 visible = @increment==true && (@distvar==68) endparam param isa5 caption = "Inc Adjuster 5" default = 0.0 visible = @increment==true && (@distvar==68) endparam param isa6 caption = "Inc Adjuster 6" default = 0.0 visible = @increment==true && (@distvar==68) endparam param isa7 caption = "Inc Adjuster 7" default = 0.0 visible = @increment==true && (@distvar==68) endparam heading caption = "fBm Textures" endheading param showfbm caption = "Show fBm Parameters" default = false endparam param weight caption = "fBm Weight" default = 0.0 min = 0.0 max = 1.0 visible=@showfbm==true endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" visible=@showfbm==true endparam param fbm caption = "fBm Transfer Weight" default = 1.0 visible=@showfbm==true endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." visible=@showfbm==true endparam param nscale caption = "fBm Scale" default = 0 hint = "This is the overall scale of the noise." visible=@showfbm==true endparam param fbmf caption = "fBm Final Weight" default = 10.0 visible=@showfbm==true endparam heading caption = "General Textures" endheading param showtxt caption = "Show Texture Parameters" default = false endparam param toffset caption = "Texture offset" default = (-1,-1) hint = "Changes the texture pattern." visible=@showtxt==true endparam param tweight caption = "Texture weight" default = 0.0 visible=@showtxt==true endparam param ts caption = "Texture scale" default = 100.0 visible=@showtxt==true endparam param tc caption = "Texture modifier" default = 5.0 visible=@showtxt==true endparam param pwr caption = "Texture power" default = 0.25 visible=@showtxt==true endparam param txttype caption = "Texture type" default = 0 enum = "z" "trap" "pixel" visible=@oldv==false&&@showtxt==true endparam param addfbm caption = "Add fBm" default = false visible=@oldv==false&&@showtxt==true endparam param tfbm caption = "fBm Amount" default = 1.0 visible=@oldv==false&&@addfbm==true&&@showtxt==true endparam func fn1 caption = "Texture Function 1" default = sqr() visible=@showtxt==true endfunc func fn2 caption = "Texture Function 2" default = acos() visible=@showtxt==true endfunc func fn6 caption = "Texture Function 3" default = round() visible=@oldv==false&&@showtxt==true endfunc heading caption = "Direct Color Parameters" endheading param showdirect caption = "Show Direct Color Params" default = false endparam param threshold caption = "Alpha Modifier" default = 0.25 min = 0 hint = "Use with 'Additional Alpha' parameter" visible=@showdirect==true endparam param blendfactor caption = "Color Texture Blend" default = 0.0 min = 0 hint = "Use with 'Additional Alpha' parameter" visible=@showdirect==true endparam heading caption = "Merging Color" visible=@showdirect==true endheading color param startcolor caption = "Base Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." visible=@showdirect==true endparam color func trapmergemode caption = "Trap Color Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." visible=@showdirect==true endfunc param trapmergemodifier caption = "Additional Alpha" default = 0 enum = "None" "Distance" hint = "Specifies an additional alpha value to incorporate during merging." visible=@showdirect==true endparam param trapmergeopacity caption = "Trap Merge Opacity" default = 0.2 hint = "Sets the opacity of each trap shape. Even if you set this value to 1 \ (forcing all traps to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." visible=@showdirect==true endparam param trapmergeorder caption = "Trap Merge Order" default = 0 enum = "bottom-up" "top-down" hint = "Sets the order in which traps will be merged. Bottom-up merges new \ traps on top of previous ones. Top-down merges new traps underneath \ previous ones." visible=@showdirect==true endparam heading caption = "Merging Texture" visible=@showdirect==true endheading color param starttexturecolor caption = "Base Texture Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." visible=@showdirect==true endparam color func texturemergemode caption = "Texture Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." visible=@showdirect==true endfunc param texturemergeopacity caption = "Texture Merge Opacity" default = 0.2 hint = "Sets the opacity of each texture. Even if you set this value to 1 \ (forcing all textures to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." visible=@showdirect==true endparam param texturemergeorder caption = "Texture Merge Order" default = 0 enum = "bottom-up" "top-down" hint = "Sets the order in which textures will be merged. Bottom-up merges new \ traps on top of previous ones. Top-down merges new textures underneath \ previous ones." visible=@showdirect==true endparam } simpletraps_fBm { ; Ron Barnett, April 2001 init: float scale = @colors*100*#pi/128 float d = 0 float d1 = 0 float d2 = 0 int f1 = 0 int f2 = 0 int ftemp = 0 float closest = 1e+318 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#screenpixel)+50*@fbm*(sum+1) float yy = imag(#screenpixel)+50*@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#screenpixel)*(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)*(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 2 float xx = real(#screenpixel)/(1+@fbm*(sum+1)*0.5) float yy = imag(#screenpixel)/(1+@fbm*(sum+1)*0.5) ELSEIF @transfer == 3 float xx = real(#screenpixel)+10*log(@fbm*(sum+1)) float yy = imag(#screenpixel)+10*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#screenpixel)+50*exp(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#screenpixel)+50*sqrt(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#screenpixel)+50*sin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#screenpixel)+50*asin(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#screenpixel)+50*tan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#screenpixel)+50*atan(@fbm*(sum+1)) float yy = imag(#screenpixel)+50*atan(@fbm*(sum+1)) ELSE float xx = real(#screenpixel-#center)+50*(@fbm*(sum+1)) float yy = imag(#screenpixel-#center)+50*(@fbm*(sum+1)) ENDIF loop: complex z1 = #z*(1-@weight) + (xx + flip(yy))*@weight IF @type == 0 d = abs(real(z1)+imag(z1)) ELSEIF @type == 1 d = abs(real(z1)*imag(z1)) ELSEIF @type == 2 d = abs(real(z1)/imag(z1)) ELSEIF @type == 3 d = abs(imag(z1)/real(z1)) ELSEIF @type == 4 d = abs(real(z1)-ceil(real(z1)))+abs(imag(z1)-floor(imag(z1))) ELSEIF @type == 5 d = abs(real(z1)-round(real(z1)))+abs(imag(z1)-trunc(imag(z1))) ELSEIF @type == 6 d = real(z1)-ceil(real(z1))+imag(z1)-floor(imag(z1)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 7 d = real(z1)-round(real(z1))+imag(z1)-trunc(imag(z1)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 8 f1 = 0 f2 = 1 d1 =real(z1)-f2 WHILE d1 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d1 = real(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d1) d1 = d ENDIF f1 = 0 f2 = 1 d2 = imag(z1)-f2 WHILE d2 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d2 = imag(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d2) d2 = d ENDIF d = abs(d1) + abs(d2) ELSEIF @type == 9 d = abs(real(@fn1(z1)))+abs(imag(@fn2(z1))) ENDIF IF d < closest closest = d ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Simple Traps with fBm" param type caption = "Trap Type" default = 0 enum = "sum" "product" "quotient1" "quotient2" \ "ceil_floor" "trunc_round" "cf_plus" \ "tr_plus" "fibonocci" "sum_fun" endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 1.0 endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param weight caption = "fBm Weight" default = 0.001 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 0.2 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 1.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam func fn1 caption = "First Function" default = sin() endfunc func fn2 caption = "Second Function" default = cos() endfunc } simpletraps_fBm_II { ; Ron Barnett, January 2002 init: float scale = @colors*100*#pi/128 float d = 0 float d1 = 0 float d2 = 0 int f1 = 0 int f2 = 0 int ftemp = 0 float closest = 1e+318 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF loop: complex z1 = #z*(1-@weight) + (xx + flip(yy))*@weight IF @type == 0 d = abs(real(z1)+imag(z1)) ELSEIF @type == 1 d = abs(real(z1)*imag(z1)) ELSEIF @type == 2 d = abs(real(z1)/imag(z1)) ELSEIF @type == 3 d = abs(imag(z1)/real(z1)) ELSEIF @type == 4 d = abs(real(z1)-ceil(real(z1)))+abs(imag(z1)-floor(imag(z1))) ELSEIF @type == 5 d = abs(real(z1)-round(real(z1)))+abs(imag(z1)-trunc(imag(z1))) ELSEIF @type == 6 d = real(z1)-ceil(real(z1))+imag(z1)-floor(imag(z1)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 7 d = real(z1)-round(real(z1))+imag(z1)-trunc(imag(z1)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 8 f1 = 0 f2 = 1 d1 =real(z1)-f2 WHILE d1 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d1 = real(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d1) d1 = d ENDIF f1 = 0 f2 = 1 d2 = imag(z1)-f2 WHILE d2 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d2 = imag(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d2) d2 = d ENDIF d = abs(d1) + abs(d2) ELSEIF @type == 9 d = abs(real(@fn1(z1)))+abs(imag(@fn2(z1))) ENDIF IF d < closest closest = d ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf) IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Simple Traps with fBm II" param type caption = "Trap Type" default = 0 enum = "sum" "product" "quotient1" "quotient2" \ "ceil_floor" "trunc_round" "cf_plus" \ "tr_plus" "fibonocci" "sum_fun" endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 1.0 endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param weight caption = "fBm Weight" default = 0.1 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 1.0 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 10.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam func fn1 caption = "First Function" default = sin() endfunc func fn2 caption = "Second Function" default = cos() endfunc } simpletraps_fBm_III { ; Ron Barnett, February 2002 ; added some texture options inspired by work of Dennis Magar init: float scale = @colors*100*#pi/128 float d = 0 float d1 = 0 float d2 = 0 int f1 = 0 int f2 = 0 int ftemp = 0 float closest = 1e+318 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 complex w = 0 complex ww = 0 complex dz = 0 float t = 0 float sum = 0.0 float freq = 1.0 int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF loop: complex z1 = #z*(1-@weight) + (xx + flip(yy))*@weight IF @type == 0 d = abs(real(z1)+imag(z1)) ELSEIF @type == 1 d = abs(real(z1)*imag(z1)) ELSEIF @type == 2 d = abs(real(z1)/imag(z1)) ELSEIF @type == 3 d = abs(imag(z1)/real(z1)) ELSEIF @type == 4 d = abs(real(z1)-ceil(real(z1)))+abs(imag(z1)-floor(imag(z1))) ELSEIF @type == 5 d = abs(real(z1)-round(real(z1)))+abs(imag(z1)-trunc(imag(z1))) ELSEIF @type == 6 d = real(z1)-ceil(real(z1))+imag(z1)-floor(imag(z1)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 7 d = real(z1)-round(real(z1))+imag(z1)-trunc(imag(z1)) IF d < 0 d = 1e+318 ENDIF ELSEIF @type == 8 f1 = 0 f2 = 1 d1 =real(z1)-f2 WHILE d1 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d1 = real(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d1) d1 = d ENDIF f1 = 0 f2 = 1 d2 = imag(z1)-f2 WHILE d2 > 0 ftemp = f2 f2 = f1 + f2 f1 = ftemp d2 = imag(z1)-f2 ENDWHILE d = real(z1)-f1 ; which Fibonocci number is closest IF d < abs(d2) d2 = d ENDIF d = abs(d1) + abs(d2) ELSEIF @type == 9 d = abs(real(@fn1(z1)))+abs(imag(@fn2(z1))) ENDIF IF d < closest closest = d dz = #z ENDIF final: float smooth = closest*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF w = fn4(fn3(dz*10^@pwr))*@ts ww = fn4(fn3((w - round(w)))) + @toffset t = cabs(ww)*@tc t = (t - trunc(t))*@tweight #index = angle * @palrange / (#pi * 512)*0.99*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)+t IF @mask == true && closest > @threshold #solid = true ENDIF IF @rmask == true && closest <= @threshold #solid = true ENDIF default: title = "Simple Traps with fBm III" param type caption = "Trap Type" default = 0 enum = "sum" "product" "quotient1" "quotient2" \ "ceil_floor" "trunc_round" "cf_plus" \ "tr_plus" "fibonocci" "sum_fun" endparam param mask caption = "Use Mask" default = false endparam param rmask caption = "Use Reverse Mask" default = false endparam param threshold caption = "Mask threshold" default = 0.1 endparam param colors caption = "Trap Color Scale" default = 1.0 endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam param weight caption = "fBm Weight" default = 0.1 min = 0.0 max = 1.0 endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" endparam param fbm caption = "fBm Transfer Weight" default = 1.0 endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." endparam param nscale caption = "fBm Scale" default = 10.0 hint = "This is the overall scale of the noise." endparam param fbmf caption = "fBm Final Weight" default = 10.0 endparam param toffset caption = "Texture offset" default = (-1,-1) hint = "Changes the texture pattern." endparam param tweight caption = "Texture weight" default = 0.05 endparam param ts caption = "Texture scale" default = 20.0 endparam param tc caption = "Texture modifier" default = 5.0 endparam param pwr caption = "Texture power" default = 1.0 endparam func fn1 caption = "First Function" default = sin() endfunc func fn2 caption = "Second Function" default = cos() endfunc func fn3 caption = "Texture Function 1" default = sqr() endfunc func fn4 caption = "Texture Function 2" default = acos() endfunc } Threeply_strange_attractor { ; Ron Barnett February 28, 2003 ; ; Use this as inside coloring with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; ; Zoom in to about magn = 0.001 for a good starting point ; $define debug global: int w = 0 int h = 0 complex hits[#width,#height] int count[#width,#height] float fx = 1.0 float ffx = 0.0 float xx = 0.0 float fy = 1.0 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*1e11 ; ; initialize hit array ; while(h < #height) while(w < #width) hits[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx if fx != 0 fx = fy - abs(fx)/fx*(abs(sin(fx)*cos(@b)+@c-fx*sin(@a+@b+@c))) else fx = fy - (abs(sin(fx)*cos(@b)+@c-fx*sin(@a+@b+@c))) endif fy = @a-xx ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = trunc(ffx) py = trunc(ffy) if px > 0 && py > 0 && px < #width && py < #height hits[px,py] = hits[px,py]+ffx+flip(ffy) count[px,py] = count[px,py] + 1 endif iter = iter + 1 endwhile ; init: int nhit=0 float xhit=0 float yhit=0 loop: final: nhit=count[#x,#y] xhit=real(hits[#x,#y]) yhit=imag(hits[#x,#y]) if @closeness > 0 if #x + @closeness < #width nhit = nhit + count[#x+@closeness, #y] xhit = xhit + real(hits[#x+@closeness, #y]) yhit = yhit + imag(hits[#x+@closeness, #y]) endif if #x - @closeness > 0 nhit = nhit + count[#x-@closeness, #y] xhit = xhit + real(hits[#x-@closeness, #y]) yhit = yhit + imag(hits[#x-@closeness, #y]) endif if #y + @closeness < #height nhit = nhit + count[#x, #y+@closeness] xhit = xhit + real(hits[#x, #y+@closeness]) yhit = yhit + imag(hits[#x, #y+@closeness]) endif if #y - @closeness > 0 nhit = nhit + count[#x, #y-@closeness] xhit = xhit + real(hits[#x, #y-@closeness]) yhit = yhit + imag(hits[#x, #y-@closeness]) endif endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 4 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 7 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: title="Threeply Attractor" render=false param solid caption="solid background?" default=true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FX+FY" "FX-FY" "FX*FY" "Count+FX" "Count+FY" "Count+FX+FY" default = 0 endparam param a caption = "parameter a" default = -55.0 endparam param b caption = "parameter b" default = -1.0 endparam param c caption = "parameter c" default = -42.0 endparam } Threeply-trap { ; Ron Barnett, November 1999 ; Shamelessly borrowed from Mark Townsend's ; Martin trap method using the Threeply function init: trap_z = 0 trap_p = 0 float x = 0 float y = 0 float xx = 0 int iter = 0 float dist = 0 float distance = 0 int thre_iter = 0 int max_iter = 0 int trap_iter = 0 bool trapped = false float min_dist = 1e30 float scale = sqrt(@a*@a + @b*@b + @c*@c) float distave = 0 float distsum = 0 float exptrap_p = 0 if @no_of_iters == 0 max_iter = #maxiter - @skip else max_iter = @skip + @no_of_iters endif if @oldscale == 0 scale = 1/scale endif loop: p = @fn1(#z + @start) x = real(p) * scale y = imag(p) * scale ; Iterate the Threeply formula thre_iter = 0 while thre_iter < @max_iterations xx = x x = y - x/abs(x)*(abs(sin(x)*cos(@b) + @c \ - x*sin(@a + @b + @c))) y = @a - xx thre_iter = thre_iter + 1 endwhile p = x + flip(y) f_p = @fn2(p) dist = abs(|#z| - |f_p|) distsum = dist + distsum distave = distsum/iter if @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) endif if @trap_mode == 0 if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 1 if (iter >= @skip && iter < max_iter) \ && !trapped && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 2 if (iter >= @skip && iter < max_iter) \ && dist < @width trapped = true distance = dist trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 3 dist = cabs(f_p) if (iter >= @skip && iter < max_iter) \ && dist < min_dist min_dist = dist distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p endif elseif @trap_mode == 4 if (iter >= @skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif iter = iter + 1 final: if (@trap_mode == 1 || @trap_mode == 2) && !trapped #solid = true else if @color_mode == 0 #index = distance + @randomness * real(#random) elseif @color_mode == 1 #index = 0.01 * trap_iter + @randomness * real(#random) elseif @color_mode == 2 #index = cabs(trap_z) + @randomness * real(#random) elseif @color_mode == 3 #index = abs(real(trap_z)) + @randomness * real(#random) elseif @color_mode == 4 #index = abs(imag(trap_z)) + @randomness * real(#random) elseif @color_mode == 5 float angle = atan2(trap_z) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 6 #index = cabs(trap_p) + @randomness * real(#random) elseif @color_mode == 7 #index = abs(real(trap_p)) + @randomness * real(#random) elseif @color_mode == 8 #index = abs(imag(trap_p)) + @randomness * real(#random) elseif @color_mode == 9 float angle = atan2(trap_p) if angle < 0 angle = angle + 2 * #pi endif angle = 1 / (2 * #pi) * angle #index = angle + @randomness * real(#random) elseif @color_mode == 10 #index = 0.1*exptrap_p*cabs(trap_p) + @randomness*real(#random) elseif @color_mode == 11 #index = 0.01 * exptrap_p + @randomness * real(#random) endif endif default: title = "Threeply Orbit Trap" param oldscale caption = "Scale Type" enum = "Old Scale" "New Scale" default = 0 endparam param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param width caption = "Trap width" default = 1.0 endparam param start caption = "Starting offset" default = (0.0,0.0) endparam param a caption = "Threeply parameter 1" default = -55.0 endparam param b caption = "Threeply parameter 2" default = -1.0 endparam param c caption = "Threeply parameter 3" default = 0.8 endparam param skip caption = "Iterations to skip" hint = "This is the number of iterations to skip before watching \ the orbit." default = 0 min = 0 endparam param no_of_iters caption = "No. of iterations" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 endparam param max_iterations caption = "Threeply iterations" hint = "This is the number of iterations for the Threeply formula." default = 1 endparam param randomness caption = "Randomness" hint = "This adds a random texture the the coloring." default = 0.0 endparam func fn1 caption = "Function" default = atan() endfunc func fn2 caption = "Another function" default = sinh() endfunc } Zito_strange_attractor { ; Ron Barnett February 28, 2003 ; ; Use this formula with the "pixel" formula in the "mt" folder. ; The formula automatically adjusts the hit density so that the coloring ; will remain constant with image size and zooms. As a result, the time ; to generate the image can increase dramatically with zooms int the image. ; ; Modified November 2, 2004 to add support for transformations using ; an algorithm based upon the work of Susan Chambless global: int w = 0 int h = 0 float Inc = @percentInc*0.01 float wd = Inc*#width float ht = Inc*#height int wd2 = round(wd*0.5) int ht2 = round(ht*0.5) complex hits[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))] int count[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))] float fx = 0.1 float ffx = 0.0 float xx = 0.0 float fy = 0.1 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*10000000 ; ; ; initialize hit array ; while(h < #height+wd) while(w < #width+ht) hits[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) xx = fx fx = fx*fy +@a*fx - fy fy = xx+fy ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = round(ffx)+wd2 py = round(ffy)+ht2 if px > 0 && py > 0 && px < #width+wd && py < #height+ht hits[px,py] = hits[px,py]+ffx+flip(ffy) count[px,py] = count[px,py] + 1 endif iter = iter + 1 endwhile ; init: int nhit=0 float xhit=0 float yhit=0 loop: final: int xcrd = #x int ycrd = #y bool inside = true if @applymapping==true ; generate the x and y location in the image float dxx = (real(#pixel)-real(#center))*(#width)/4*#magn float dyy = (imag(#pixel)-imag(#center))*(#width)/4*#magn float transx = (#width+wd)*0.5; float transy = (#height+ht)*0.5; float cosan = cos(#angle); float sinan = sin(#angle); xcrd = round((transx + (dxx*cosan + dyy*sinan))) ycrd = round((transy + (dxx*sinan - dyy*cosan))) ; is this in our image? if (xcrd+wd2<0 || xcrd>=#width+wd2 || ycrd+ht2<0 || ycrd>=#height+ht2) inside = false endif endif if inside == true && count[xcrd,ycrd] > @thresh nhit=count[xcrd,ycrd] xhit=real(hits[xcrd,ycrd]) yhit=imag(hits[xcrd,ycrd]) if @closeness > 0 if xcrd + @closeness < #width nhit = nhit + count[xcrd+@closeness, ycrd] xhit = xhit + real(hits[xcrd+@closeness, ycrd]) yhit = yhit + imag(hits[xcrd+@closeness, ycrd]) endif if xcrd - @closeness > 0 nhit = nhit + count[xcrd-@closeness, ycrd] xhit = xhit + real(hits[xcrd-@closeness, ycrd]) yhit = yhit + imag(hits[xcrd-@closeness, ycrd]) endif if ycrd + @closeness < #height nhit = nhit + count[xcrd, ycrd+@closeness] xhit = xhit + real(hits[xcrd, ycrd+@closeness]) yhit = yhit + imag(hits[xcrd, ycrd+@closeness]) endif if ycrd - @closeness > 0 nhit = nhit + count[xcrd, ycrd-@closeness] xhit = xhit + real(hits[xcrd, ycrd-@closeness]) yhit = yhit + imag(hits[xcrd, ycrd-@closeness]) endif endif else #solid=true endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((xhit+1)/log(iterate))^@scale elseif @method == 2 #index=((yhit+1)/log(iterate))^@scale elseif @method == 3 #index=((yhit+xhit+1)/log(iterate))^@scale elseif @method == 4 #index=((xhit-yhit+1)/log(iterate))^@scale elseif @method == 5 #index=((xhit*yhit+1)/log(iterate))^@scale elseif @method == 6 #index=((nhit+xhit+1)/log(iterate))^@scale elseif @method == 7 #index=((nhit+yhit+1)/log(iterate))^@scale elseif @method == 8 #index=((nhit+xhit+yhit+1)/log(iterate))^@scale endif default: heading caption="Zito Attractor" endheading heading caption="x -> x*y + a*x - y" endheading heading caption="y -> x + y" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading title="Zito Attactor" render=false param solid caption="solid background?" default=true endparam param applyMapping caption = "Apply Mapping" default = false endparam param percentInc caption = "Oversize by (%)" default = 0.0 visible = @applyMapping == true endparam param density caption = "Hit Density" default = 1.0 hint = "Coloring density for the strange attractor." endparam param closeness caption = "Orbit Closeness" default = 0 hint = "Increasing will broaden the orbit lines." endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "FX" "FY" "FX+FY" "FX-FY" "FX*FY" "Count+FX" "Count+FY" "Count+FX+FY" default = 0 endparam param thresh caption = "Hit Threshold" default = 0.0 endparam param a caption = "parameter a" default = 0.357057 endparam } KleinianCuspRayTrace { ; Ron Barnett October 7, 2005 ; derived from the public C code of Curtis McMullen ; The sorting routines use HEAPSORT ; Transparency/Refraction, relections from spheres ; to the floor, more fractal types added November 15,2005 ; added code to allow for both lines and circles in initialization ; added January 12, 2006 global: int MaxLevel = @level int level = MaxLevel complex cs[1000000] float rad[1000000] float both[1000000] complex csf[1000000] float radf[1000000] float csz[1000000] float clr[1000000] float clrf[1000000] float PARAFUZZ = 1e-3 ; Nearly parallel slopes float LINEFUZZ = 1e-5 ; Line vs. Circle complex im = (0,1) complex gens[9,4] complex temp1 = 0 float thresh = @scircle/1000 color colorswitch = rgb(0,0,0) float checkscale = @checkscale/#width*30 float frac[#width, #height] float kr = @kr float krf = @krf float krt = @krt float krft = @krft if @tparent kr = kr*(1-@tparentval) krf = krf*(1-@tparentval) krt = krt*@tparentval krft = krft*@tparentval endif complex rra = 0 float rrb = 0 float rrc = 0 bool continue = true bool done = false complex tab = 0 complex gz0 = 0 int si = 0 int sj = 0 int i = 0 int j = 0 int k = 0 int c = 0 int l = 0 int ir = 0 int ifinal = 0 int istack = 0 int nold = 0 int nfinal = 1 float mxi = 0 float fi = 0 float fj = 0 float expiter = 0 complex fij = 0 complex oldf = 0 complex fz = 0 complex fzp = 0 complex fzp2 = 0 float pwrtest = 10^(100/cabs(@p1)) bool bTest = false float isnear = cabs(@p2)^cabs(@p1)/@bailout complex fcenter = 0 float asp = #height/#width complex phx = 0 complex phy = 0 complex gx = 0 complex gx1 = 0 complex gy = 0 float ddx = 0 float ddy = 0 float ddr = 0 complex det = 0 float closest = 1e318 complex ez = 0 float trap = 0.0 float trapd = 0.0 float trapd2 = 0.0 complex trapz2 = (0,0) complex trapr = (0,1)^(@trot/90.0) complex trapcenter2 = @tcenter complex r0 = (0,0) complex rh = (0,1)^(@torder/8) complex zh = (0,0) float theta = 0 float rr = 0 float af1 = 0 float af2 = 0 complex astroid = 0 int trap_iter = 0 if @flrtype == "Fractal" if @fctltype == "Mandelbrot" fcenter = @fmcenter while i < #width fi = (i*4/(#width)-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/(#height) - 2)/@fmag + imag(fcenter) fij = 0 while k < @miter fij = fij^@mp1+fi+flip(fj) if |fij| > @bailout k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if |fij| > @bailout if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 endwhile i = i + 1 j = 0 endwhile elseif @fctltype == "Julia" closest = 1e318 fcenter = @fcenter while i < #width fi = (i*4/#width-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/#height - 2)/@fmag + imag(fcenter) fij = fi + flip(fj) while k < @miter fij = fij^@mp1+@seed if |fij| > @bailout k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if |fij| > @bailout if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 endwhile i = i + 1 j = 0 endwhile elseif @fctltype == "Newton" closest = 1e318 fcenter = @fcenter while i < #width fi = (i*4/#width-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/#height - 2)/@fmag + imag(fcenter) fij = fi + flip(fj) while k < @miter oldf = fij fz = fij^@p1 - @p2 fzp = @p1*fij^(@p1-1) fzp2 = @p1*(@p1-1)*fij^(@p1-2) if @cmethod == "Newton" fij = fij - fz/fzp elseif @cmethod == "Householder" fij = fij - fz/fzp*(1 + fz*fzp2/(2*fzp^2)) elseif @cmethod == "Halley" fij = fij - 2*fz*fzp/(2*fzp^2 - fz*fzp2) elseif @cmethod == "Schroder" fij = fij - fz*fzp/(fzp^2 - fz*fzp2) endif btest = (cabs(oldf-fij) < isnear) if !(!btest && (cabs(fij) < pwrtest)) k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if !(!btest && (cabs(fij) < pwrtest)) if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 endwhile i = i + 1 j = 0 endwhile elseif @fctltype == "Cayley Julia" closest = 1e318 fcenter = @fccenter while i < #width fi = (i*4/#width-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/#height - 2)/@fmag + imag(fcenter) fij = fi + flip(fj) while k < @miter oldf = fij fz = fij^3 - @cseed*fij - @cseed + 1 fzp = 3*fij^2 - @cseed fij = fij - fz/fzp btest = (cabs(oldf-fij) < isnear) if !(|fij - oldf| >= 1/@bailout) k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if !(|fij - oldf| >= 1/@bailout) if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 endwhile i = i + 1 j = 0 endwhile elseif @fctltype == "Phoenix" closest = 1e318 fcenter = @fcenter while i < #width fi = (i*4/#width-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/#height - 2)/@fmag + imag(fcenter) fij = fj + flip(fi) while k < @miter phx = fij*fij + real(@phseed) + imag(@phseed)*phy phy = fij fij = phx if |fij| > @bailout k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if |fij| > @bailout if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 phx = 0 phy = 0 endwhile i = i + 1 j = 0 endwhile elseif @fctltype == "Gopalsamy" closest = 1e318 fcenter = @fcenter while i < #width fi = (i*4/#width-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/#height - 2)/@fmag + imag(fcenter) fij = fj + flip(fi) while k < @miter gx = real(fij) gy = imag(fij) gx1 = -2*gx*gy + @gseed gy = gy*gy - gx*gx fij = gx1 + flip(gy) if |fij| > @bailout k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if |fij| > @bailout if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 endwhile i = i + 1 j = 0 endwhile elseif @fctltype == "Barnsley" closest = 1e318 fcenter = @fcenter while i < #width fi = (i*4/#width-2)/@fmag+real(fcenter) while j < #height fj = asp*(j*4/#height - 2)/@fmag + imag(fcenter) fij = fj + flip(fi) while k < @miter IF real(fij) >= 0 fij = (fij - 1) * @bseed ELSE fij = (fij + 1) * @bseed ENDIF if |fij| > @bailout k = @miter endif k = k + 1 if @colormethod=="Exponential smoothing" expiter = expiter + exp(-cabs(fij)) elseif @colormethod=="Simple traps" if @traptype == "Sum" trap = abs(real(fij)+imag(fij)) elseif @traptype == "Product" trap = abs(real(fij)*imag(fij)) elseif @traptype == "Quotient1" trap = abs(real(fij)/imag(fij)) elseif @traptype == "Quotient2" trap = abs(imag(fij)/real(fij)) elseif @traptype == "Ceil_floor" trap = abs(real(fij)-ceil(real(fij)))+abs(imag(fij)-floor(imag(fij))) elseif @traptype == "Trunc_round" trap = abs(real(fij)-round(real(fij)))+abs(imag(fij)-trunc(imag(fij))) elseif @traptype == "Cf_plus" trap = (real(fij)-ceil(real(fij))+imag(fij)-floor(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Tr_plus" trap = (real(fij)-round(real(fij))+imag(fij)-trunc(imag(fij))) if trap < 0 trap = 1e+318 endif elseif @traptype == "Lemniscate" theta = atan(imag(fij)/real(fij)) rr = @pa*(cos(2*theta))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cardoid" theta = atan(imag(fij)/real(fij)) rr = @pa*(1-cos(theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Conchoid" theta = atan(imag(fij)/real(fij)) rr = 0.1*(@pa + @pb*cos(theta))/cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Cycloid" theta = atan(imag(fij)/real(fij)) rr = cabs(fij) trap = cabs(fij) - cabs(rr*(theta-sin(theta)) - flip(rr*(1-cos(theta)))) elseif @traptype == "Archimedes" theta = atan(imag(fij)/real(fij)) rr = @pa*theta trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Log spiral" theta = atan(imag(fij)/real(fij)) rr = exp(@pa*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Rose" theta = atan(imag(fij)/real(fij)) rr = @pa*cos(theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Ellipse Catacaustic" theta = atan(imag(fij)/real(fij)) af1 = 4*@pa*(@pa-@pb)*(@pa*@pb)*sin(theta)^3/(@pa^2+@pb^2+(@pb^2-@pa^2)*cos(2*theta)) af2 = 4*@pb*(@pb^2-@pa^2)*cos(theta)^3/(@pa^2+@pb^2+3*(@pb^2-@pa^2)*cos(2*theta)) astroid = 0.1*(af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Butterfly" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*(exp(sin(theta))-2*cos(4*theta)+sin(1/24*(2*theta-#pi))) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Gear" theta = atan(imag(fij)/real(fij)) af1 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*cos(theta) af2 = (0.25*@pa+1/(5*@pb)*tanh(5*@pb*sin(@pn*theta)))*sin(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Arachnida2" theta = atan(imag(fij)/real(fij)) rr = 0.25*@pa*sin(@pn*theta)/sin((@pn+1)*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Maltese cross" theta = atan(imag(fij)/real(fij)) rr = 0.2*@pa/(cos(theta)*sin(theta)*(cos(theta)^2-sin(theta)^2))^0.5 trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trifolium" theta = atan(imag(fij)/real(fij)) rr = -@pa*cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Serpentine" theta = atan(imag(fij)/real(fij)) af1 = 0.2*@pa*cotan(theta) af2 = 0.2*@pb*sin(theta)*cos(theta) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Trefoil" theta = atan(imag(fij)/real(fij)) rr = 0.1*@pa/cos(3*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Trisectrix of Maclaurin" theta = atan(imag(fij)/real(fij)) rr = 0.5*@pa*sin(3*theta)/sin(2*theta) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) elseif @traptype == "Atzema spiral" theta = atan(imag(fij)/real(fij)) af1 = 0.5*@pa*(sin(theta)/theta-2*cos(theta)-theta*sin(theta)) af2 = 0.05*@pb*(cos(theta)/theta-2*sin(theta)+theta*cos(theta)) astroid = (af1 + flip(af2)) trap = cabs(fij) - cabs(astroid) elseif @traptype == "Rose of Troy" theta = atan(imag(fij)/real(fij)) rr = @pc*(1+10*@pa*sin(4*@pb*theta)) trap = cabs(fij) -cabs(rr*cos(theta) + flip(rr*sin(theta))) endif trap = abs(trap) if trap < closest closest = trap trap_iter = k endif elseif @colormethod == "Orbit traps" trapz2 = fij trapz2 = (trapz2 - trapcenter2) * trapr if @tasp != 1.0 trapz2 = real(trapz2) + flip(imag(trapz2) * @tasp) ; apply aspect endif if @traptype2 == "Point" trapd = cabs(trapz2) elseif @traptype2 == "Ring" trapd = abs(cabs(trapz2)-@diameter) elseif @traptype2 == "Egg" trapd = (cabs(trapz2-flip(@diameter)*2)+cabs(trapz2)*@torder*0.5)*0.25 elseif @traptype2 == "Hyperbola" trapd = abs(imag(trapz2) * real(trapz2) - @diameter) elseif @traptype2 == "Hypercross" trapd = abs(imag(trapz2) * real(trapz2)) elseif @traptype2 == "Cross" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 < trapd trapd = trapd2 endif elseif @traptype2 == "Astroid" trapd = abs(real(trapz2))^@torder + abs(imag(trapz2))^@torder if @torder < 0 trapd = 1/trapd endif elseif @traptype2 == "Diamond" trapd = abs(real(trapz2)) + abs(imag(trapz2)) elseif @traptype2 == "Rectangle" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif elseif @traptype2 == "Box" trapd = abs(real(trapz2)) trapd2 = abs(imag(trapz2)) if trapd2 > trapd trapd = trapd2 endif trapd = abs(trapd - @diameter) elseif @traptype2 == "Lines" trapd = abs(abs(imag(trapz2)) - @diameter) elseif @traptype2 == "Waves" trapd = abs(abs(imag(trapz2) + sin(real(trapz2)*@tfreq)*@torder*0.25) - @diameter) elseif @traptype2 == "Mirrored waves" trapd = abs(abs(imag(trapz2)) - @diameter + sin(real(trapz2)*@tfreq)*@torder*0.25) elseif @traptype2 == "Radial waves" trapd2 = atan2(trapz2) trapd = abs(cabs(trapz2) * (1 - sin(trapd2*@tfreq)*@torder*0.125) - @diameter) elseif @traptype2 == "Pinch" trapd2 = atan2(trapz2) if trapd2 < 0 trapd2 = trapd2 + 2*#pi endif trapd = sqrt(cabs(trapz2))/abs(sin(trapd2*@torder*0.5)) elseif @traptype2 == "Spiral" trapd = 1/(cabs(trapz2))*@diameter r0 = (0,1)^trapd trapz2 = trapz2*r0 trapd = atan(abs(imag(trapz2)/real(trapz2))) elseif @traptype2 == "Heart" zh = real(trapz2)+flip(abs(imag(trapz2))) zh = zh*rh*3/@diameter trapd = abs(real(zh)-sqr(imag(zh))+3) endif trapd = abs(trapd) if trapd < closest closest = trapd trap_iter = k endif endif endwhile if |fij| > @bailout if @colormethod=="Exponential smoothing" frac[i,j] = expiter if expiter >mxi mxi = expiter endif elseif @colormethod=="Simple traps" || @colormethod=="Orbit traps" if @mask && !@rmask && closest > @threshold frac[i,j] = -1 endif if @rmask == true && closest <= @threshold frac[i,j] = -1 endif ez = cos(closest)+flip(sin(closest)) closest = abs(atan2(ez)/(#pi)) if frac[i,j] >= 0 if @color_mode == "Distance" frac[i,j] = closest else frac[i,j] = trap_iter endif endif if closest >mxi mxi = closest endif endif else frac[i,j] = 0 endif j = j + 1 k = 0 expiter = 0 closest = 1e318 endwhile i = i + 1 j = 0 endwhile endif endif i = 1 j = 0 k = 0 int lev = 2 int iii = 9 float fx = 0.0 float ffx = 0.0 float xx = 0.0 float yy = 0 float fy = 0.0 float ffy = 0.0 float ffz = 0 float zz = 0 if @version < 110 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float tzmax = sqrt(txmax^2+tymax^2) float zmin = sqrt(xmin^2 + ymin^2) else float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float tzmax = tymax float zmin = xmin endif ; floor parameters float fa = @fa float fb = @fb float fc = @fc float fd = @fd*#width*asp ; Color range variables and initialization. color colorMap [500, 2] int ranges = 8 int colorsUsed = 0 int offset = 0 if (@colorPreset == "Gradient") colorsUsed = @ncolor elseif (@colorPreset == "Generate") colorsUsed = @numRanges elseif (@colorPreset == "Custom") colorsUsed = @colorRanges else colorsUsed = @ncolor endif if (@colorPreset == "Gradient") ; Use the gradient for the color ranges. ranges = @totalColors offset = 0 elseif (@colorPreset == "Custom") ; User specified custom range. ; Initial values by Toby Marshall. colorMap [0,0] = @colorMax1, colorMap [0,1] = @colorMin1 colorMap [1,0] = @colorMax2, colorMap [1,1] = @colorMin2 colorMap [2,0] = @colorMax3, colorMap [2,1] = @colorMin3 colorMap [3,0] = @colorMax4, colorMap [3,1] = @colorMin4 colorMap [4,0] = @colorMax5, colorMap [4,1] = @colorMin5 colorMap [5,0] = @colorMax6, colorMap [5,1] = @colorMin6 colorMap [6,0] = @colorMax7, colorMap [6,1] = @colorMin7 colorMap [7,0] = @colorMax8, colorMap [7,1] = @colorMin8 colorMap [8,0] = @customMax9, colorMap [8,1] = @customMin9 colorMap [9,0] = @customMax10, colorMap [9,1] = @customMin10 colorMap [10,0] = @customMax11, colorMap [10,1] = @customMin11 colorMap [11,0] = @customMax12, colorMap [11,1] = @customMin12 colorMap [12,0] = @customMax13, colorMap [12,1] = @customMin13 colorMap [13,0] = @customMax14, colorMap [13,1] = @customMin14 colorMap [14,0] = @customMax15, colorMap [14,1] = @customMin15 colorMap [15,0] = @customMax16, colorMap [15,1] = @customMin16 colorMap [16,0] = @customMax17, colorMap [16,1] = @customMin17 colorMap [17,0] = @customMax18, colorMap [17,1] = @customMin18 colorMap [18,0] = @customMax19, colorMap [18,1] = @customMin19 colorMap [19,0] = @customMax20, colorMap [19,1] = @customMin20 colorMap [20,0] = @customMax21, colorMap [20,1] = @customMin21 colorMap [21,0] = @customMax22, colorMap [21,1] = @customMin22 colorMap [22,0] = @customMax23, colorMap [22,1] = @customMin23 colorMap [23,0] = @customMax24, colorMap [23,1] = @customMin24 ranges = @colorRanges offset = @colorOffset elseif (@colorPreset == "Generate") ; Compute the color ranges using the gradient. ranges = 0 offset = @colorOffset while ranges < @numRanges color gradientColor = gradient(ranges/@numRanges) colorMap [ranges,0] = hsl(hue(gradientColor), sat(gradientColor), @luminanceUpper) colorMap [ranges,1] = hsl(hue(gradientColor), sat(gradientColor), @luminanceLower) ranges = ranges + 1 endwhile elseif (@colorPreset == "Default") ; colorMap [0,0] = @defaultMax1, colorMap [0,1] = @defaultMin1 colorMap [1,0] = @defaultMax2, colorMap [1,1] = @defaultMin2 colorMap [2,0] = @defaultMax3, colorMap [2,1] = @defaultMin3 colorMap [3,0] = @defaultMax4, colorMap [3,1] = @defaultMin4 colorMap [4,0] = @defaultMax5, colorMap [4,1] = @defaultMin5 colorMap [5,0] = @defaultMax6, colorMap [5,1] = @defaultMin6 colorMap [6,0] = @defaultMax7, colorMap [6,1] = @defaultMin7 colorMap [7,0] = @defaultMax8, colorMap [7,1] = @defaultMin8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Default 12") ; Created by Toby Marshall. colorMap [0,0] = @default12Max1, colorMap [0,1] = @default12Min1 colorMap [1,0] = @default12Max2, colorMap [1,1] = @default12Min2 colorMap [2,0] = @default12Max3, colorMap [2,1] = @default12Min3 colorMap [3,0] = @default12Max4, colorMap [3,1] = @default12Min4 colorMap [4,0] = @default12Max5, colorMap [4,1] = @default12Min5 colorMap [5,0] = @default12Max6, colorMap [5,1] = @default12Min6 colorMap [6,0] = @default12Max7, colorMap [6,1] = @default12Min7 colorMap [7,0] = @default12Max8, colorMap [7,1] = @default12Min8 colorMap [8,0] = @default12Max9, colorMap [8,1] = @default12Min9 colorMap [9,0] = @default12Max10, colorMap [9,1] = @default12Min10 colorMap [10,0] = @default12Max11, colorMap [10,1] = @default12Min11 colorMap [11,0] = @default12Max12, colorMap [11,1] = @default12Min12 ranges = 12 offset = @colorOffset elseif (@colorPreset == "Default 16") ; Created by Toby Marshall. colorMap [0,0] = @default16Max1, colorMap [0,1] = @default16Min1 colorMap [1,0] = @default16Max2, colorMap [1,1] = @default16Min2 colorMap [2,0] = @default16Max3, colorMap [2,1] = @default16Min3 colorMap [3,0] = @default16Max4, colorMap [3,1] = @default16Min4 colorMap [4,0] = @default16Max5, colorMap [4,1] = @default16Min5 colorMap [5,0] = @default16Max6, colorMap [5,1] = @default16Min6 colorMap [6,0] = @default16Max7, colorMap [6,1] = @default16Min7 colorMap [7,0] = @default16Max8, colorMap [7,1] = @default16Min8 colorMap [8,0] = @default16Max9, colorMap [8,1] = @default16Min9 colorMap [9,0] = @default16Max10, colorMap [9,1] = @default16Min10 colorMap [10,0] = @default16Max11, colorMap [10,1] = @default16Min11 colorMap [11,0] = @default16Max12, colorMap [11,1] = @default16Min12 colorMap [12,0] = @default16Max13, colorMap [12,1] = @default16Min13 colorMap [13,0] = @default16Max14, colorMap [13,1] = @default16Min14 colorMap [14,0] = @default16Max15, colorMap [14,1] = @default16Min15 colorMap [15,0] = @default16Max16, colorMap [15,1] = @default16Min16 ranges = 16 offset = @colorOffset elseif (@colorPreset == "Default 24") ; Created by Toby Marshall. colorMap [0,0] = @default24Max1, colorMap [0,1] = @default24Min1 colorMap [1,0] = @default24Max2, colorMap [1,1] = @default24Min2 colorMap [2,0] = @default24Max3, colorMap [2,1] = @default24Min3 colorMap [3,0] = @default24Max4, colorMap [3,1] = @default24Min4 colorMap [4,0] = @default24Max5, colorMap [4,1] = @default24Min5 colorMap [5,0] = @default24Max6, colorMap [5,1] = @default24Min6 colorMap [6,0] = @default24Max7, colorMap [6,1] = @default24Min7 colorMap [7,0] = @default24Max8, colorMap [7,1] = @default24Min8 colorMap [8,0] = @default24Max9, colorMap [8,1] = @default24Min9 colorMap [9,0] = @default24Max10, colorMap [9,1] = @default24Min10 colorMap [10,0] = @default24Max11, colorMap [10,1] = @default24Min11 colorMap [11,0] = @default24Max12, colorMap [11,1] = @default24Min12 colorMap [12,0] = @default24Max13, colorMap [12,1] = @default24Min13 colorMap [13,0] = @default24Max14, colorMap [13,1] = @default24Min14 colorMap [14,0] = @default24Max15, colorMap [14,1] = @default24Min15 colorMap [15,0] = @default24Max16, colorMap [15,1] = @default24Min16 colorMap [16,0] = @default24Max17, colorMap [16,1] = @default24Min17 colorMap [17,0] = @default24Max18, colorMap [17,1] = @default24Min18 colorMap [18,0] = @default24Max19, colorMap [18,1] = @default24Min19 colorMap [19,0] = @default24Max20, colorMap [19,1] = @default24Min20 colorMap [20,0] = @default24Max21, colorMap [20,1] = @default24Min21 colorMap [21,0] = @default24Max22, colorMap [21,1] = @default24Min22 colorMap [22,0] = @default24Max23, colorMap [22,1] = @default24Min23 colorMap [23,0] = @default24Max24, colorMap [23,1] = @default24Min24 ranges = 24 offset = @colorOffset elseif (@colorPreset == "Color Wheel 12") ; Created by Toby Marshall. colorMap [0,0] = @colorWheel12Max1, colorMap [0,1] = @colorWheel12Min1 colorMap [1,0] = @colorWheel12Max2, colorMap [1,1] = @colorWheel12Min2 colorMap [2,0] = @colorWheel12Max3, colorMap [2,1] = @colorWheel12Min3 colorMap [3,0] = @colorWheel12Max4, colorMap [3,1] = @colorWheel12Min4 colorMap [4,0] = @colorWheel12Max5, colorMap [4,1] = @colorWheel12Min5 colorMap [5,0] = @colorWheel12Max6, colorMap [5,1] = @colorWheel12Min6 colorMap [6,0] = @colorWheel12Max7, colorMap [6,1] = @colorWheel12Min7 colorMap [7,0] = @colorWheel12Max8, colorMap [7,1] = @colorWheel12Min8 colorMap [8,0] = @colorWheel12Max9, colorMap [8,1] = @colorWheel12Min9 colorMap [9,0] = @colorWheel12Max10, colorMap [9,1] = @colorWheel12Min10 colorMap [10,0] = @colorWheel12Max11, colorMap [10,1] = @colorWheel12Min11 colorMap [11,0] = @colorWheel12Max12, colorMap [11,1] = @colorWheel12Min12 ranges = 12 offset = @colorOffset elseif (@colorPreset == "Alhambra 8") ; Created by Toby Marshall. colorMap [0,0] = @alhambra8Max1, colorMap [0,1] = @alhambra8Min1 colorMap [1,0] = @alhambra8Max2, colorMap [1,1] = @alhambra8Min2 colorMap [2,0] = @alhambra8Max3, colorMap [2,1] = @alhambra8Min3 colorMap [3,0] = @alhambra8Max4, colorMap [3,1] = @alhambra8Min4 colorMap [4,0] = @alhambra8Max5, colorMap [4,1] = @alhambra8Min5 colorMap [5,0] = @alhambra8Max6, colorMap [5,1] = @alhambra8Min6 colorMap [6,0] = @alhambra8Max7, colorMap [6,1] = @alhambra8Min7 colorMap [7,0] = @alhambra8Max8, colorMap [7,1] = @alhambra8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Belvedere 8") ; Created by Toby Marshall. colorMap [0,0] = @belvedere8Max1, colorMap [0,1] = @belvedere8Min1 colorMap [1,0] = @belvedere8Max2, colorMap [1,1] = @belvedere8Min2 colorMap [2,0] = @belvedere8Max3, colorMap [2,1] = @belvedere8Min3 colorMap [3,0] = @belvedere8Max4, colorMap [3,1] = @belvedere8Min4 colorMap [4,0] = @belvedere8Max5, colorMap [4,1] = @belvedere8Min5 colorMap [5,0] = @belvedere8Max6, colorMap [5,1] = @belvedere8Min6 colorMap [6,0] = @belvedere8Max7, colorMap [6,1] = @belvedere8Min7 colorMap [7,0] = @belvedere8Max8, colorMap [7,1] = @belvedere8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Bouquet 8") ; Created by Toby Marshall. colorMap [0,0] = @bouquet8Max1, colorMap [0,1] = @bouquet8Min1 colorMap [1,0] = @bouquet8Max2, colorMap [1,1] = @bouquet8Min2 colorMap [2,0] = @bouquet8Max3, colorMap [2,1] = @bouquet8Min3 colorMap [3,0] = @bouquet8Max4, colorMap [3,1] = @bouquet8Min4 colorMap [4,0] = @bouquet8Max5, colorMap [4,1] = @bouquet8Min5 colorMap [5,0] = @bouquet8Max6, colorMap [5,1] = @bouquet8Min6 colorMap [6,0] = @bouquet8Max7, colorMap [6,1] = @bouquet8Min7 colorMap [7,0] = @bouquet8Max8, colorMap [7,1] = @bouquet8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Color Switch 8") ; Created by Toby Marshall. colorMap [0,0] = @colorSwitch8Max1, colorMap [0,1] = @colorSwitch8Min1 colorMap [1,0] = @colorSwitch8Max2, colorMap [1,1] = @colorSwitch8Min2 colorMap [2,0] = @colorSwitch8Max3, colorMap [2,1] = @colorSwitch8Min3 colorMap [3,0] = @colorSwitch8Max4, colorMap [3,1] = @colorSwitch8Min4 colorMap [4,0] = @colorSwitch8Max5, colorMap [4,1] = @colorSwitch8Min5 colorMap [5,0] = @colorSwitch8Max6, colorMap [5,1] = @colorSwitch8Min6 colorMap [6,0] = @colorSwitch8Max7, colorMap [6,1] = @colorSwitch8Min7 colorMap [7,0] = @colorSwitch8Max8, colorMap [7,1] = @colorSwitch8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Evening Sky 8") ; Created by Toby Marshall. colorMap [0,0] = @eveningSky8Max1, colorMap [0,1] = @eveningSky8Min1 colorMap [1,0] = @eveningSky8Max2, colorMap [1,1] = @eveningSky8Min2 colorMap [2,0] = @eveningSky8Max3, colorMap [2,1] = @eveningSky8Min3 colorMap [3,0] = @eveningSky8Max4, colorMap [3,1] = @eveningSky8Min4 colorMap [4,0] = @eveningSky8Max5, colorMap [4,1] = @eveningSky8Min5 colorMap [5,0] = @eveningSky8Max6, colorMap [5,1] = @eveningSky8Min6 colorMap [6,0] = @eveningSky8Max7, colorMap [6,1] = @eveningSky8Min7 colorMap [7,0] = @eveningSky8Max8, colorMap [7,1] = @eveningSky8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Fantasia 8") ; Created by Toby Marshall. colorMap [0,0] = @fantasia8Max1, colorMap [0,1] = @fantasia8Min1 colorMap [1,0] = @fantasia8Max2, colorMap [1,1] = @fantasia8Min2 colorMap [2,0] = @fantasia8Max3, colorMap [2,1] = @fantasia8Min3 colorMap [3,0] = @fantasia8Max4, colorMap [3,1] = @fantasia8Min4 colorMap [4,0] = @fantasia8Max5, colorMap [4,1] = @fantasia8Min5 colorMap [5,0] = @fantasia8Max6, colorMap [5,1] = @fantasia8Min6 colorMap [6,0] = @fantasia8Max7, colorMap [6,1] = @fantasia8Min7 colorMap [7,0] = @fantasia8Max8, colorMap [7,1] = @fantasia8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Flowering Orchard 8") ; Created by Toby Marshall. colorMap [0,0] = @floweringOrchard8Max1, colorMap [0,1] = @floweringOrchard8Min1 colorMap [1,0] = @floweringOrchard8Max2, colorMap [1,1] = @floweringOrchard8Min2 colorMap [2,0] = @floweringOrchard8Max3, colorMap [2,1] = @floweringOrchard8Min3 colorMap [3,0] = @floweringOrchard8Max4, colorMap [3,1] = @floweringOrchard8Min4 colorMap [4,0] = @floweringOrchard8Max5, colorMap [4,1] = @floweringOrchard8Min5 colorMap [5,0] = @floweringOrchard8Max6, colorMap [5,1] = @floweringOrchard8Min6 colorMap [6,0] = @floweringOrchard8Max7, colorMap [6,1] = @floweringOrchard8Min7 colorMap [7,0] = @floweringOrchard8Max8, colorMap [7,1] = @floweringOrchard8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Morning Sky 8") ; Created by Toby Marshall. colorMap [0,0] = @morningSky8Max1, colorMap [0,1] = @morningSky8Min1 colorMap [1,0] = @morningSky8Max2, colorMap [1,1] = @morningSky8Min2 colorMap [2,0] = @morningSky8Max3, colorMap [2,1] = @morningSky8Min3 colorMap [3,0] = @morningSky8Max4, colorMap [3,1] = @morningSky8Min4 colorMap [4,0] = @morningSky8Max5, colorMap [4,1] = @morningSky8Min5 colorMap [5,0] = @morningSky8Max6, colorMap [5,1] = @morningSky8Min6 colorMap [6,0] = @morningSky8Max7, colorMap [6,1] = @morningSky8Min7 colorMap [7,0] = @morningSky8Max8, colorMap [7,1] = @morningSky8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Pastel 8") ; colorMap [0,0] = @pastel8Max1, colorMap [0,1] = @pastel8Min1 colorMap [1,0] = @pastel8Max2, colorMap [1,1] = @pastel8Min2 colorMap [2,0] = @pastel8Max3, colorMap [2,1] = @pastel8Min3 colorMap [3,0] = @pastel8Max4, colorMap [3,1] = @pastel8Min4 colorMap [4,0] = @pastel8Max5, colorMap [4,1] = @pastel8Min5 colorMap [5,0] = @pastel8Max6, colorMap [5,1] = @pastel8Min6 colorMap [6,0] = @pastel8Max7, colorMap [6,1] = @pastel8Min7 colorMap [7,0] = @pastel8Max8, colorMap [7,1] = @pastel8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Pastel Rainbow 8") ; Created by Angela Wilczynski. colorMap [0,0] = @pastelRainbow8Max1, colorMap [0,1] = @pastelRainbow8Min1 colorMap [1,0] = @pastelRainbow8Max2, colorMap [1,1] = @pastelRainbow8Min2 colorMap [2,0] = @pastelRainbow8Max3, colorMap [2,1] = @pastelRainbow8Min3 colorMap [3,0] = @pastelRainbow8Max4, colorMap [3,1] = @pastelRainbow8Min4 colorMap [4,0] = @pastelRainbow8Max5, colorMap [4,1] = @pastelRainbow8Min5 colorMap [5,0] = @pastelRainbow8Max6, colorMap [5,1] = @pastelRainbow8Min6 colorMap [6,0] = @pastelRainbow8Max7, colorMap [6,1] = @pastelRainbow8Min7 colorMap [7,0] = @pastelRainbow8Max8, colorMap [7,1] = @pastelRainbow8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Showtime 8") ; Created by Toby Marshall. colorMap [0,0] = @showtime8Max1, colorMap [0,1] = @showtime8Min1 colorMap [1,0] = @showtime8Max2, colorMap [1,1] = @showtime8Min2 colorMap [2,0] = @showtime8Max3, colorMap [2,1] = @showtime8Min3 colorMap [3,0] = @showtime8Max4, colorMap [3,1] = @showtime8Min4 colorMap [4,0] = @showtime8Max5, colorMap [4,1] = @showtime8Min5 colorMap [5,0] = @showtime8Max6, colorMap [5,1] = @showtime8Min6 colorMap [6,0] = @showtime8Max7, colorMap [6,1] = @showtime8Min7 colorMap [7,0] = @showtime8Max8, colorMap [7,1] = @showtime8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Soleil 8") ; Created by Toby Marshall. colorMap [0,0] = @soleil8Max1, colorMap [0,1] = @soleil8Min1 colorMap [1,0] = @soleil8Max2, colorMap [1,1] = @soleil8Min2 colorMap [2,0] = @soleil8Max3, colorMap [2,1] = @soleil8Min3 colorMap [3,0] = @soleil8Max4, colorMap [3,1] = @soleil8Min4 colorMap [4,0] = @soleil8Max5, colorMap [4,1] = @soleil8Min5 colorMap [5,0] = @soleil8Max6, colorMap [5,1] = @soleil8Min6 colorMap [6,0] = @soleil8Max7, colorMap [6,1] = @soleil8Min7 colorMap [7,0] = @soleil8Max8, colorMap [7,1] = @soleil8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Chill 8") ; Created by Toby Marshall. colorMap [0,0] = @chillMax1, colorMap [0,1] = @chillMin1 colorMap [1,0] = @chillMax2, colorMap [1,1] = @chillMin2 colorMap [2,0] = @chillMax3, colorMap [2,1] = @chillMin3 colorMap [3,0] = @chillMax4, colorMap [3,1] = @chillMin4 colorMap [4,0] = @chillMax5, colorMap [4,1] = @chillMin5 colorMap [5,0] = @chillMax6, colorMap [5,1] = @chillMin6 colorMap [6,0] = @chillMax7, colorMap [6,1] = @chillMin7 colorMap [7,0] = @chillMax8, colorMap [7,1] = @chillMin8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Cloud Nine 8") ; Created by Toby Marshall. colorMap [0,0] = @cloudNineMax1, colorMap [0,1] = @cloudNineMin1 colorMap [1,0] = @cloudNineMax2, colorMap [1,1] = @cloudNineMin2 colorMap [2,0] = @cloudNineMax3, colorMap [2,1] = @cloudNineMin3 colorMap [3,0] = @cloudNineMax4, colorMap [3,1] = @cloudNineMin4 colorMap [4,0] = @cloudNineMax5, colorMap [4,1] = @cloudNineMin5 colorMap [5,0] = @cloudNineMax6, colorMap [5,1] = @cloudNineMin6 colorMap [6,0] = @cloudNineMax7, colorMap [6,1] = @cloudNineMin7 colorMap [7,0] = @cloudNineMax8, colorMap [7,1] = @cloudNineMin8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "La Terra 8") ; Created by Toby Marshall. colorMap [0,0] = @laTerraMax1, colorMap [0,1] = @laTerraMin1 colorMap [1,0] = @laTerraMax2, colorMap [1,1] = @laTerraMin2 colorMap [2,0] = @laTerraMax3, colorMap [2,1] = @laTerraMin3 colorMap [3,0] = @laTerraMax4, colorMap [3,1] = @laTerraMin4 colorMap [4,0] = @laTerraMax5, colorMap [4,1] = @laTerraMin5 colorMap [5,0] = @laTerraMax6, colorMap [5,1] = @laTerraMin6 colorMap [6,0] = @laTerraMax7, colorMap [6,1] = @laTerraMin7 colorMap [7,0] = @laTerraMax8, colorMap [7,1] = @laTerraMin8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Santa Fe 8") ; Created by Toby Marshall. colorMap [0,0] = @santaFe8Max1, colorMap [0,1] = @santaFe8Min1 colorMap [1,0] = @santaFe8Max2, colorMap [1,1] = @santaFe8Min2 colorMap [2,0] = @santaFe8Max3, colorMap [2,1] = @santaFe8Min3 colorMap [3,0] = @santaFe8Max4, colorMap [3,1] = @santaFe8Min4 colorMap [4,0] = @santaFe8Max5, colorMap [4,1] = @santaFe8Min5 colorMap [5,0] = @santaFe8Max6, colorMap [5,1] = @santaFe8Min6 colorMap [6,0] = @santaFe8Max7, colorMap [6,1] = @santaFe8Min7 colorMap [7,0] = @santaFe8Max8, colorMap [7,1] = @santaFe8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Spring 8") ; Created by Toby Marshall. colorMap [0,0] = @spring8Max1, colorMap [0,1] = @spring8Min1 colorMap [1,0] = @spring8Max2, colorMap [1,1] = @spring8Min2 colorMap [2,0] = @spring8Max3, colorMap [2,1] = @spring8Min3 colorMap [3,0] = @spring8Max4, colorMap [3,1] = @spring8Min4 colorMap [4,0] = @spring8Max5, colorMap [4,1] = @spring8Min5 colorMap [5,0] = @spring8Max6, colorMap [5,1] = @spring8Min6 colorMap [6,0] = @spring8Max7, colorMap [6,1] = @spring8Min7 colorMap [7,0] = @spring8Max8, colorMap [7,1] = @spring8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Summer 8") ; Created by Toby Marshall. colorMap [0,0] = @summer8Max1, colorMap [0,1] = @summer8Min1 colorMap [1,0] = @summer8Max2, colorMap [1,1] = @summer8Min2 colorMap [2,0] = @summer8Max3, colorMap [2,1] = @summer8Min3 colorMap [3,0] = @summer8Max4, colorMap [3,1] = @summer8Min4 colorMap [4,0] = @summer8Max5, colorMap [4,1] = @summer8Min5 colorMap [5,0] = @summer8Max6, colorMap [5,1] = @summer8Min6 colorMap [6,0] = @summer8Max7, colorMap [6,1] = @summer8Min7 colorMap [7,0] = @summer8Max8, colorMap [7,1] = @summer8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Fall 8") ; Created by Toby Marshall. colorMap [0,0] = @fall8Max1, colorMap [0,1] = @fall8Min1 colorMap [1,0] = @fall8Max2, colorMap [1,1] = @fall8Min2 colorMap [2,0] = @fall8Max3, colorMap [2,1] = @fall8Min3 colorMap [3,0] = @fall8Max4, colorMap [3,1] = @fall8Min4 colorMap [4,0] = @fall8Max5, colorMap [4,1] = @fall8Min5 colorMap [5,0] = @fall8Max6, colorMap [5,1] = @fall8Min6 colorMap [6,0] = @fall8Max7, colorMap [6,1] = @fall8Min7 colorMap [7,0] = @fall8Max8, colorMap [7,1] = @fall8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Winter 8") ; Created by Toby Marshall. colorMap [0,0] = @winter8Max1, colorMap [0,1] = @winter8Min1 colorMap [1,0] = @winter8Max2, colorMap [1,1] = @winter8Min2 colorMap [2,0] = @winter8Max3, colorMap [2,1] = @winter8Min3 colorMap [3,0] = @winter8Max4, colorMap [3,1] = @winter8Min4 colorMap [4,0] = @winter8Max5, colorMap [4,1] = @winter8Min5 colorMap [5,0] = @winter8Max6, colorMap [5,1] = @winter8Min6 colorMap [6,0] = @winter8Max7, colorMap [6,1] = @winter8Min7 colorMap [7,0] = @winter8Max8, colorMap [7,1] = @winter8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Mojave 8") ; Created by Toby Marshall. colorMap [0,0] = @mojave8Max1, colorMap [0,1] = @mojave8Min1 colorMap [1,0] = @mojave8Max2, colorMap [1,1] = @mojave8Min2 colorMap [2,0] = @mojave8Max3, colorMap [2,1] = @mojave8Min3 colorMap [3,0] = @mojave8Max4, colorMap [3,1] = @mojave8Min4 colorMap [4,0] = @mojave8Max5, colorMap [4,1] = @mojave8Min5 colorMap [5,0] = @mojave8Max6, colorMap [5,1] = @mojave8Min6 colorMap [6,0] = @mojave8Max7, colorMap [6,1] = @mojave8Min7 colorMap [7,0] = @mojave8Max8, colorMap [7,1] = @mojave8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Gold/Green 8") ; colorMap [0,0] = @goldGreen8Max1, colorMap [0,1] = @goldGreen8Min1 colorMap [1,0] = @goldGreen8Max2, colorMap [1,1] = @goldGreen8Min2 colorMap [2,0] = @goldGreen8Max3, colorMap [2,1] = @goldGreen8Min3 colorMap [3,0] = @goldGreen8Max4, colorMap [3,1] = @goldGreen8Min4 colorMap [4,0] = @goldGreen8Max5, colorMap [4,1] = @goldGreen8Min5 colorMap [5,0] = @goldGreen8Max6, colorMap [5,1] = @goldGreen8Min6 colorMap [6,0] = @goldGreen8Max7, colorMap [6,1] = @goldGreen8Min7 colorMap [7,0] = @goldGreen8Max8, colorMap [7,1] = @goldGreen8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Gold/Green Alt 8") ; colorMap [0,0] = @goldGreenAlt8Max1, colorMap [0,1] = @goldGreenAlt8Min1 colorMap [1,0] = @goldGreenAlt8Max2, colorMap [1,1] = @goldGreenAlt8Min2 colorMap [2,0] = @goldGreenAlt8Max3, colorMap [2,1] = @goldGreenAlt8Min3 colorMap [3,0] = @goldGreenAlt8Max4, colorMap [3,1] = @goldGreenAlt8Min4 colorMap [4,0] = @goldGreenAlt8Max5, colorMap [4,1] = @goldGreenAlt8Min5 colorMap [5,0] = @goldGreenAlt8Max6, colorMap [5,1] = @goldGreenAlt8Min6 colorMap [6,0] = @goldGreenAlt8Max7, colorMap [6,1] = @goldGreenAlt8Min7 colorMap [7,0] = @goldGreenAlt8Max8, colorMap [7,1] = @goldGreenAlt8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Gold/Silver 8") ; colorMap [0,0] = @goldSilver8Max1, colorMap [0,1] = @goldSilver8Min1 colorMap [1,0] = @goldSilver8Max2, colorMap [1,1] = @goldSilver8Min2 colorMap [2,0] = @goldSilver8Max3, colorMap [2,1] = @goldSilver8Min3 colorMap [3,0] = @goldSilver8Max4, colorMap [3,1] = @goldSilver8Min4 colorMap [4,0] = @goldSilver8Max5, colorMap [4,1] = @goldSilver8Min5 colorMap [5,0] = @goldSilver8Max6, colorMap [5,1] = @goldSilver8Min6 colorMap [6,0] = @goldSilver8Max7, colorMap [6,1] = @goldSilver8Min7 colorMap [7,0] = @goldSilver8Max8, colorMap [7,1] = @goldSilver8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Silver/Blue 8") ; colorMap [0,0] = @silverBlue8Max1, colorMap [0,1] = @silverBlue8Min1 colorMap [1,0] = @silverBlue8Max2, colorMap [1,1] = @silverBlue8Min2 colorMap [2,0] = @silverBlue8Max3, colorMap [2,1] = @silverBlue8Min3 colorMap [3,0] = @silverBlue8Max4, colorMap [3,1] = @silverBlue8Min4 colorMap [4,0] = @silverBlue8Max5, colorMap [4,1] = @silverBlue8Min5 colorMap [5,0] = @silverBlue8Max6, colorMap [5,1] = @silverBlue8Min6 colorMap [6,0] = @silverBlue8Max7, colorMap [6,1] = @silverBlue8Min7 colorMap [7,0] = @silverBlue8Max8, colorMap [7,1] = @silverBlue8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Silver/Blue Alt 8") ; colorMap [0,0] = @silverBlueAlt8Max1, colorMap [0,1] = @silverBlueAlt8Min1 colorMap [1,0] = @silverBlueAlt8Max2, colorMap [1,1] = @silverBlueAlt8Min2 colorMap [2,0] = @silverBlueAlt8Max3, colorMap [2,1] = @silverBlueAlt8Min3 colorMap [3,0] = @silverBlueAlt8Max4, colorMap [3,1] = @silverBlueAlt8Min4 colorMap [4,0] = @silverBlueAlt8Max5, colorMap [4,1] = @silverBlueAlt8Min5 colorMap [5,0] = @silverBlueAlt8Max6, colorMap [5,1] = @silverBlueAlt8Min6 colorMap [6,0] = @silverBlueAlt8Max7, colorMap [6,1] = @silverBlueAlt8Min7 colorMap [7,0] = @silverBlueAlt8Max8, colorMap [7,1] = @silverBlueAlt8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Gold/Silver Alt 8") ; colorMap [0,0] = @goldSilverAlt8Max1, colorMap [0,1] = @goldSilverAlt8Min1 colorMap [1,0] = @goldSilverAlt8Max2, colorMap [1,1] = @goldSilverAlt8Min2 colorMap [2,0] = @goldSilverAlt8Max3, colorMap [2,1] = @goldSilverAlt8Min3 colorMap [3,0] = @goldSilverAlt8Max4, colorMap [3,1] = @goldSilverAlt8Min4 colorMap [4,0] = @goldSilverAlt8Max5, colorMap [4,1] = @goldSilverAlt8Min5 colorMap [5,0] = @goldSilverAlt8Max6, colorMap [5,1] = @goldSilverAlt8Min6 colorMap [6,0] = @goldSilverAlt8Max7, colorMap [6,1] = @goldSilverAlt8Min7 colorMap [7,0] = @goldSilverAlt8Max8, colorMap [7,1] = @goldSilverAlt8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Purple/Yellow 8") ; colorMap [0,0] = @purpleYellow8Max1, colorMap [0,1] = @purpleYellow8Min1 colorMap [1,0] = @purpleYellow8Max2, colorMap [1,1] = @purpleYellow8Min2 colorMap [2,0] = @purpleYellow8Max3, colorMap [2,1] = @purpleYellow8Min3 colorMap [3,0] = @purpleYellow8Max4, colorMap [3,1] = @purpleYellow8Min4 colorMap [4,0] = @purpleYellow8Max5, colorMap [4,1] = @purpleYellow8Min5 colorMap [5,0] = @purpleYellow8Max6, colorMap [5,1] = @purpleYellow8Min6 colorMap [6,0] = @purpleYellow8Max7, colorMap [6,1] = @purpleYellow8Min7 colorMap [7,0] = @purpleYellow8Max8, colorMap [7,1] = @purpleYellow8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Purple/Yellow Alt 8") ; colorMap [0,0] = @purpleYellowAlt8Max1, colorMap [0,1] = @purpleYellowAlt8Min1 colorMap [1,0] = @purpleYellowAlt8Max2, colorMap [1,1] = @purpleYellowAlt8Min2 colorMap [2,0] = @purpleYellowAlt8Max3, colorMap [2,1] = @purpleYellowAlt8Min3 colorMap [3,0] = @purpleYellowAlt8Max4, colorMap [3,1] = @purpleYellowAlt8Min4 colorMap [4,0] = @purpleYellowAlt8Max5, colorMap [4,1] = @purpleYellowAlt8Min5 colorMap [5,0] = @purpleYellowAlt8Max6, colorMap [5,1] = @purpleYellowAlt8Min6 colorMap [6,0] = @purpleYellowAlt8Max7, colorMap [6,1] = @purpleYellowAlt8Min7 colorMap [7,0] = @purpleYellowAlt8Max8, colorMap [7,1] = @purpleYellowAlt8Min8 ranges = 8 offset = @colorOffset elseif (@colorPreset == "Fourth of July 3") ; colorMap [0,0] = @fourthOfJuly3Max1, colorMap [0,1] = @fourthOfJuly3Min1 colorMap [1,0] = @fourthOfJuly3Max2, colorMap [1,1] = @fourthOfJuly3Min2 colorMap [2,0] = @fourthOfJuly3Max3, colorMap [2,1] = @fourthOfJuly3Min3 ranges = 3 offset = @colorOffset elseif (@colorPreset == "Blue/Silver 2") ; colorMap [0,0] = @blueSilver2Max1, colorMap [0,1] = @blueSilver2Min1 colorMap [1,0] = @blueSilver2Max2, colorMap [1,1] = @blueSilver2Min2 ranges = 2 offset = @colorOffset elseif (@colorPreset == "Blue/White 2") ; colorMap [0,0] = @blueWhite2Max1, colorMap [0,1] = @blueWhite2Min1 colorMap [1,0] = @blueWhite2Max2, colorMap [1,1] = @blueWhite2Min2 ranges = 2 offset = @colorOffset elseif (@colorPreset == "Cyan/Magenta 2") ; colorMap [0,0] = @cyanMagenta2Max1, colorMap [0,1] = @cyanMagenta2Min1 colorMap [1,0] = @cyanMagenta2Max2, colorMap [1,1] = @cyanMagenta2Min2 ranges = 2 offset = @colorOffset elseif (@colorPreset == "Cyan/Yellow 2") ; colorMap [0,0] = @cyanYellow2Max1, colorMap [0,1] = @cyanYellow2Min1 colorMap [1,0] = @cyanYellow2Max2, colorMap [1,1] = @cyanYellow2Min2 ranges = 2 offset = @colorOffset elseif (@colorPreset == "Gold/Green 2") ; colorMap [0,0] = @goldGreen2Max1, colorMap [0,1] = @goldGreen2Min1 colorMap [1,0] = @goldGreen2Max2, colorMap [1,1] = @goldGreen2Min2 ranges = 2 offset = @colorOffset elseif (@colorPreset == "Purple/Yellow 2") ; colorMap [0,0] = @purpleYellow2Max1, colorMap [0,1] = @purpleYellow2Min1 colorMap [1,0] = @purpleYellow2Max2, colorMap [1,1] = @purpleYellow2Min2 ranges = 2 offset = @colorOffset elseif (@colorPreset == "Red/Tan 2") ; colorMap [0,0] = @redTan2Max1, colorMap [0,1] = @redTan2Min1 colorMap [1,0] = @redTan2Max2, colorMap [1,1] = @redTan2Min2 ranges = 2 offset = @colorOffset endif if (@perturbRanges == "8 Range Custom" && ranges == 8) ; If we are using 8 ranges, then take into account ; the rangeOrdering parameter. int range[8] ; Convert range ordering from 12345678 to .12345678 float ordering = @rangeOrder / 100000000 ; Convert .12345678 to 1.2345678 ordering = ordering * 10 ; Get the first digit int range[0] = trunc (ordering) ; Subract the first digit, i.e. 1.2345678 becomes .2345678 ordering = ordering - range[0] ; Get the second digit ordering = ordering * 10 int range[1] = trunc (ordering) ordering = ordering - range[1] ; Get the third digit ordering = ordering * 10 int range[2] = trunc (ordering) ordering = ordering - range[2] ; Get the fourth digit ordering = ordering * 10 int range[3] = trunc (ordering) ordering = ordering - range[3] ; Get the fifth digit ordering = ordering * 10 int range[4] = trunc (ordering) ordering = ordering - range[4] ; Get the sixth digit ordering = ordering * 10 int range[5] = trunc (ordering) ordering = ordering - range[5] ; Get the seventh digit ordering = ordering * 10 int range[6] = trunc (ordering) ordering = ordering - range[6] ; Get the eighth digit ordering = ordering * 10 int range[7] = round (ordering) ordering = ordering - range[7] ; Save the original order of the maps. color tempMap[8,2] tempMap[0,0] = colorMap[0,0], tempMap[0,1] = colorMap[0,1] tempMap[1,0] = colorMap[1,0], tempMap[1,1] = colorMap[1,1] tempMap[2,0] = colorMap[2,0], tempMap[2,1] = colorMap[2,1] tempMap[3,0] = colorMap[3,0], tempMap[3,1] = colorMap[3,1] tempMap[4,0] = colorMap[4,0], tempMap[4,1] = colorMap[4,1] tempMap[5,0] = colorMap[5,0], tempMap[5,1] = colorMap[5,1] tempMap[6,0] = colorMap[6,0], tempMap[6,1] = colorMap[6,1] tempMap[7,0] = colorMap[7,0], tempMap[7,1] = colorMap[7,1] ; Reorder the maps according to the rangeOrder parameter. colorMap[0,0] = tempMap[range[0]-1,0], colorMap[0,1] = tempMap[range[0]-1,1] colorMap[1,0] = tempMap[range[1]-1,0], colorMap[1,1] = tempMap[range[1]-1,1] colorMap[2,0] = tempMap[range[2]-1,0], colorMap[2,1] = tempMap[range[2]-1,1] colorMap[3,0] = tempMap[range[3]-1,0], colorMap[3,1] = tempMap[range[3]-1,1] colorMap[4,0] = tempMap[range[4]-1,0], colorMap[4,1] = tempMap[range[4]-1,1] colorMap[5,0] = tempMap[range[5]-1,0], colorMap[5,1] = tempMap[range[5]-1,1] colorMap[6,0] = tempMap[range[6]-1,0], colorMap[6,1] = tempMap[range[6]-1,1] colorMap[7,0] = tempMap[range[7]-1,0], colorMap[7,1] = tempMap[range[7]-1,1] endif ; initial circle cs[0] = (0,0) rad[0] = 1 csf[0] = (0,0) radf[0] = 1 if @cusptype == "Slice" cs[0] = (0,1) rad[0] = -1 csf[0] = (0,1) radf[0] = -1 cs[1] = (0,-1) rad[1] = -1 csf[1] = (0,-1) radf[1] = -1 elseif @cusptype == "1/15 cusp" && @version >= 250 if @showcusp == "Both" cs[0] = (0,0.67129232) rad[0] = 0.32870768 csf[0] = cs[0] radf[0] = rad[0] both[0] = 0 cs[1] = (0,-0.67129232) rad[1] = 0.32870768 csf[1] = cs[1] radf[1] = rad[1] both[1] = 0 cs[2] = (0,0) rad[2] = 1 csf[2] = (0,0) radf[2] = 1 both[2] = 1 if @bmethoda == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @bmethoda == 1 clr[0] = 1/abs(rad[0])^@adja+0.01 clr[1] = 1/abs(rad[1])^@adja+0.01 clrf[0] = 1/abs(rad[0])^@adja+0.01 clrf[1] = 1/abs(rad[1])^@adja+0.01 elseif @bmethoda == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @bmethoda == 3 clr[0] = cabs((cs[0]*2)^@adja)+0.01 clr[1] = cabs((cs[1]*2)^@adja)+0.01 clrf[0] = cabs((cs[0]*2)^@adja)+0.01 clrf[1] = cabs((cs[1]*2)^@adja)+0.01 elseif @bmethoda == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif elseif @showcusp == "Standard" cs[0] = (0,0) rad[0] = 1 csf[0] = (0,0) radf[0] = 1 else cs[0] = (0,0.67129232) rad[0] = 0.32870768 csf[0] = cs[0] radf[0] = rad[0] cs[1] = (0,-0.67129232) rad[1] = 0.32870768 csf[1] = cs[1] radf[1] = rad[1] if @method == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @method == 1 clr[0] = 1/abs(rad[0])^@adj+0.01 clr[1] = 1/abs(rad[1])^@adj+0.01 clrf[0] = 1/abs(rad[0])^@adj+0.01 clrf[1] = 1/abs(rad[1])^@adj+0.01 elseif @method == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @method == 3 clr[0] = cabs((cs[0]*2)^@adj)+0.01 clr[1] = cabs((cs[1]*2)^@adj)+0.01 clrf[0] = cabs((cs[0]*2)^@adj)+0.01 clrf[1] = cabs((cs[1]*2)^@adj)+0.01 elseif @method == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif endif elseif @cusptype == "0/1 cusp (Apollo)" && @version >= 260 if @showcusp == "Both" cs[0] = (0,0.5) rad[0] = 0.5 csf[0] = cs[0] radf[0] = rad[0] both[0] = 0 cs[1] = (0,-0.5) rad[1] = 0.5 csf[1] = cs[1] radf[1] = rad[1] both[1] = 0 cs[2] = (0,0) rad[2] = 1 csf[2] = (0,0) radf[2] = 1 both[2] = 1 if @bmethoda == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @bmethoda == 1 clr[0] = 1/abs(rad[0])^@adja+0.01 clr[1] = 1/abs(rad[1])^@adja+0.01 clrf[0] = 1/abs(rad[0])^@adja+0.01 clrf[1] = 1/abs(rad[1])^@adja+0.01 elseif @bmethoda == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @bmethoda == 3 clr[0] = cabs((cs[0]*2)^@adja)+0.01 clr[1] = cabs((cs[1]*2)^@adja)+0.01 clrf[0] = cabs((cs[0]*2)^@adja)+0.01 clrf[1] = cabs((cs[1]*2)^@adja)+0.01 elseif @bmethoda == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif elseif @showcusp == "Standard" cs[0] = (0,0) rad[0] = 1 csf[0] = (0,0) radf[0] = 1 else cs[0] = (0,0.5) rad[0] = 0.5 csf[0] = cs[0] radf[0] = rad[0] cs[1] = (0,-0.5) rad[1] = 0.5 csf[1] = cs[1] radf[1] = rad[1] if @method == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @method == 1 clr[0] = 1/abs(rad[0])^@adj+0.01 clr[1] = 1/abs(rad[1])^@adj+0.01 clrf[0] = 1/abs(rad[0])^@adj+0.01 clrf[1] = 1/abs(rad[1])^@adj+0.01 elseif @method == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @method == 3 clr[0] = cabs((cs[0]*2)^@adj)+0.01 clr[1] = cabs((cs[1]*2)^@adj)+0.01 clrf[0] = cabs((cs[0]*2)^@adj)+0.01 clrf[1] = cabs((cs[1]*2)^@adj)+0.01 elseif @method == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif endif elseif @cusptype == "1/1 Cusp" && @version >= 260 if @showcusp == "Both" cs[0] = (0,0.5) rad[0] = 0.5 csf[0] = cs[0] radf[0] = rad[0] both[0] = 0 cs[1] = (0,-0.5) rad[1] = 0.5 csf[1] = cs[1] radf[1] = rad[1] both[1] = 0 cs[2] = (0,0) rad[2] = 1 csf[2] = (0,0) radf[2] = 1 both[2] = 1 if @bmethoda == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @bmethoda == 1 clr[0] = 1/abs(rad[0])^@adja+0.01 clr[1] = 1/abs(rad[1])^@adja+0.01 clrf[0] = 1/abs(rad[0])^@adja+0.01 clrf[1] = 1/abs(rad[1])^@adja+0.01 elseif @bmethoda == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @bmethoda == 3 clr[0] = cabs((cs[0]*2)^@adja)+0.01 clr[1] = cabs((cs[1]*2)^@adja)+0.01 clrf[0] = cabs((cs[0]*2)^@adja)+0.01 clrf[1] = cabs((cs[1]*2)^@adja)+0.01 elseif @bmethoda == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif elseif @showcusp == "Standard" cs[0] = (0,0) rad[0] = 1 csf[0] = (0,0) radf[0] = 1 else cs[0] = (0,0.5) rad[0] = 0.5 csf[0] = cs[0] radf[0] = rad[0] cs[1] = (0,-0.5) rad[1] = 0.5 csf[1] = cs[1] radf[1] = rad[1] if @method == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @method == 1 clr[0] = 1/abs(rad[0])^@adj+0.01 clr[1] = 1/abs(rad[1])^@adj+0.01 clrf[0] = 1/abs(rad[0])^@adj+0.01 clrf[1] = 1/abs(rad[1])^@adj+0.01 elseif @method == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @method == 3 clr[0] = cabs((cs[0]*2)^@adj)+0.01 clr[1] = cabs((cs[1]*2)^@adj)+0.01 clrf[0] = cabs((cs[0]*2)^@adj)+0.01 clrf[1] = cabs((cs[1]*2)^@adj)+0.01 elseif @method == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif endif elseif @cusptype == "1/2 Cusp" && @version >= 260 if @showcusp == "Both" cs[0] = (0,0.63397461) rad[0] = 0.36602539 csf[0] = cs[0] radf[0] = rad[0] both[0] = 0 cs[1] = (0,-0.63397461) rad[1] = 0.36602539 csf[1] = cs[1] radf[1] = rad[1] both[1] = 0 cs[2] = (0,0) rad[2] = 1 csf[2] = (0,0) radf[2] = 1 both[2] = 1 if @bmethoda == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @bmethoda == 1 clr[0] = 1/abs(rad[0])^@adja+0.01 clr[1] = 1/abs(rad[1])^@adja+0.01 clrf[0] = 1/abs(rad[0])^@adja+0.01 clrf[1] = 1/abs(rad[1])^@adja+0.01 elseif @bmethoda == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @bmethoda == 3 clr[0] = cabs((cs[0]*2)^@adja)+0.01 clr[1] = cabs((cs[1]*2)^@adja)+0.01 clrf[0] = cabs((cs[0]*2)^@adja)+0.01 clrf[1] = cabs((cs[1]*2)^@adja)+0.01 elseif @bmethoda == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif elseif @showcusp == "Standard" cs[0] = (0,0) rad[0] = 1 csf[0] = (0,0) radf[0] = 1 else cs[0] = (0,0.63397461) rad[0] = 0.36602539 csf[0] = cs[0] radf[0] = rad[0] cs[1] = (0,-0.63397461) rad[1] = 0.36602539 csf[1] = cs[1] radf[1] = rad[1] if @method == 0 clr[0] = 1 clr[1] = 1 clrf[0] = 1 clrf[1] = 1 elseif @method == 1 clr[0] = 1/abs(rad[0])^@adj+0.01 clr[1] = 1/abs(rad[1])^@adj+0.01 clrf[0] = 1/abs(rad[0])^@adj+0.01 clrf[1] = 1/abs(rad[1])^@adj+0.01 elseif @method == 2 clr[0] = 0.01 clr[1] = 1+0.01 clrf[0] = 0.01 clrf[1] = 1+0.01 elseif @method == 3 clr[0] = cabs((cs[0]*2)^@adj)+0.01 clr[1] = cabs((cs[1]*2)^@adj)+0.01 clrf[0] = cabs((cs[0]*2)^@adj)+0.01 clrf[1] = cabs((cs[1]*2)^@adj)+0.01 elseif @method == 4 && @version >= 112 if abs(rad[0]) < @rthresh clr[0] = 2 clrf[0] = 2 else clr[0] = 1 clrf[0] = 1 endif if abs(rad[1]) < @rthresh clr[1] = 2 clrf[1] = 2 else clr[1] = 1 clrf[1] = 1 endif endif endif endif ; the following are matrix representations of Mobius tranforms ; matrix one gens[0,0] = (1.0,1.0) gens[0,1] = (0,1) gens[0,2] = (0,-1) gens[0,3] = (1.0,-1.0) if @trans temp1 = gens[0,1] gens[0,1] = gens[0,2] gens[0,2] = temp1 endif ; matrix two gens[1,0] = (1,-1) gens[1,1] = (0,-1) gens[1,2] = (0,1) gens[1,3] = (1,1) if @trans temp1 = gens[1,1] gens[1,1] = gens[1,2] gens[1,2] = temp1 endif if @cusptype == "Nearby Group" ; matrix three gens[2,0] = (0.955,-0.025) gens[2,1] = (0.045,0.025) gens[2,2] = (-1.955,0.025) gens[2,3] = (0.955,-0.025) if @trans temp1 = gens[2,1] gens[2,1] = gens[2,2] gens[2,2] = temp1 endif ; matrix four gens[3,0] = (0.955,-0.025) gens[3,1] = (-0.045,-0.025) gens[3,2] = (1.955,-0.025) gens[3,3] = (0.955,-0.025) if @trans temp1 = gens[3,1] gens[3,1] = gens[3,2] gens[3,2] = temp1 endif elseif @cusptype == "1/15 cusp" ; matrix three gens[2,0] = (0.979295515055895, -0.0056392803058829) gens[2,1] = (0.020704484944105, 0.0056392803058829 ) gens[2,2] = (-1.9792955150559, 0.0056392803058829) gens[2,3] = (0.979295515055895, -0.0056392803058829) if @trans temp1 = gens[2,1] gens[2,1] = gens[2,2] gens[2,2] = temp1 endif ; matrix four gens[3,0] = (0.979295515055895, -0.0056392803058829) gens[3,1] = (-0.020704484944105, -0.0056392803058829) gens[3,2] = (1.9792955150559, -0.0056392803058829) gens[3,3] = (0.979295515055895, -0.0056392803058829) if @trans temp1 = gens[3,1] gens[3,1] = gens[3,2] gens[3,2] = temp1 endif elseif @cusptype == "0/1 Cusp (Apollo)" ; matrix three gens[2,0] = (1,0) gens[2,1] = (0,0) gens[2,2] = (2,0) gens[2,3] = (1,0) ; matrix four gens[3,0] = (1,0) gens[3,1] = (0,0) gens[3,2] = (-2,0) gens[3,3] = (1,0) elseif @cusptype == "1/1 Cusp" ; matrix three gens[2,0] = (1,-1) gens[2,1] = (0,1) gens[2,2] = (-2,1) gens[2,3] = (1,-1) ; matrix four gens[3,0] = (1,-1) gens[3,1] = (0,-1) gens[3,2] = (2,-1) gens[3,3] = (1,-1) elseif @cusptype == "1/2 Cusp" ; matrix three gens[2,0] = (0.866025035,0.5) gens[2,1] = (0.1339745965,-0.5) gens[2,2] = (-1.866025035,-0.5) gens[2,3] = (0.866025035,0.5) ; matrix four gens[3,0] = (0.866025035,0.5) gens[3,1] = (-0.1339745965,0.5) gens[3,2] = (1.866025035,0.5) gens[3,3] = (0.866025035,0.5) elseif @cusptype == "Grandma's Special" tab = (@ta*@tb+sqrt(@ta*@ta*@tb*@tb-4*(@ta*@ta+@tb*@tb)))/2 gz0 = (tab-2)*@tb/(@tb*tab-2*@ta+2*(0,1)*tab) gens[0,0] = (@tb-(0,2))/2 gens[0,1] = @tb/2 gens[0,2] = @tb/2 gens[0,3] = conj(gens[0,0]) if @trans temp1 = gens[0,1] gens[0,1] = gens[0,2] gens[0,2] = temp1 endif gens[1,0] = gens[0,3] gens[1,1] = -gens[0,1] gens[1,2] = -gens[0,2] gens[1,3] = gens[0,0] gens[2,0] = @ta/2 gens[2,2] = (@ta*tab-2*@tb+(0,4))/((2*tab+4)*gz0) gens[2,1] = (@ta*tab-2*@tb-(0,4))*gz0/(2*tab-4) gens[2,3] = @ta/2 if @trans temp1 = gens[2,1] gens[2,1] = gens[2,2] gens[2,2] = temp1 endif gens[3,0] = gens[2,3] gens[3,1] = -gens[2,1] gens[3,2] = -gens[2,2] gens[3,3] = gens[2,0] elseif @cusptype == "Slice" tab = (@tas*@tbs+sqrt(@tas*@tas*@tbs*@tbs-4*(@tas*@tas+@tbs*@tbs)))/2 gz0 = (tab-2)*@tbs/(@tbs*tab-2*@tas+2*(0,1)*tab) gens[0,0] = (@tbs-(0,2))/2 gens[0,1] = @tbs/2 gens[0,2] = @tbs/2 gens[0,3] = conj(gens[0,0]) if @trans temp1 = gens[0,1] gens[0,1] = gens[0,2] gens[0,2] = temp1 endif gens[1,0] = gens[0,3] gens[1,1] = -gens[0,1] gens[1,2] = -gens[0,2] gens[1,3] = gens[0,0] gens[2,0] = @tas/2 gens[2,2] = (@tas*tab-2*@tbs+(0,4))/((2*tab+4)*gz0) gens[2,1] = (@tas*tab-2*@tbs-(0,4))*gz0/(2*tab-4) gens[2,3] = @tas/2 if @trans temp1 = gens[2,1] gens[2,1] = gens[2,2] gens[2,2] = temp1 endif gens[3,0] = gens[2,3] gens[3,1] = -gens[2,1] gens[3,2] = -gens[2,2] gens[3,3] = gens[2,0] endif ; normalize the matrices i = 0 while i < 4 det = gens[i,0]*gens[i,3]-gens[i,1]*gens[i,2] det = 1/sqrt(det) gens[i,0] = gens[i,0]*det gens[i,1] = gens[i,1]*det gens[i,2] = gens[i,2]*det gens[i,3] = gens[i,3]*det i = i + 1 endwhile ; inverse gens matrices i = 0 while i < 4 det = gens[i,0]*gens[i,3]-gens[i,1]*gens[i,2] gens[i+4,0] = gens[i,3] gens[i+4,1] = -gens[i,1] gens[i+4,2] = -gens[i,2] gens[i+4,3] = gens[i,0] if real(det) <= 0 gens[i+4,0] = -conj(gens[i+4,0]) gens[i+4,1] = -conj(gens[i+4,1]) gens[i+4,2] = -conj(gens[i+4,2]) gens[i+4,3] = -conj(gens[i+4,3]) endif i = i + 1 endwhile if @cusptype == "Slice" j = 2 iii = 1 elseif (@cusptype == "1/15 cusp" || @cusptype == "1/1 cusp" || \ @cusptype == "1/2 cusp"|| @cusptype == "0/1 cusp (Apollo)") \ && @version >= 250 if @showcusp == "Both" j = 3 iii = 2 elseif @showcusp == "Standard" j = 1 iii = 0 else j = 2 iii = 1 endif else j = 1 iii = 0 endif lev = 1 while lev <= level i = 0 while i < 4 k = 0 while k <= iii if rad[k] <= 0 ; matrix of line unit = cos(-#pi*rad[k]) + flip(sin(-#pi*rad[k])) gens[8,0] = im*unit gens[8,1] = im*(conj(unit)*cs[k]-unit*conj(cs[k])) gens[8,2] = 0 gens[8,3] = im*conj(unit) else ; matrix of circle gens[8,0] = cs[k]/rad[k] gens[8,1] = rad[k]-|cs[k]|/rad[k] gens[8,2] = 1/rad[k] gens[8,3] = -conj(cs[k])/rad[k] endif ; product of circle matrix and gens inverse det = gens[8,0]*gens[8,3]-gens[8,1]*gens[8,2] temp1 = gens[8,0] temp2 = gens[8,1] temp3 = gens[8,2] temp4 = gens[8,3] if real(det) < 0 gens[8,0] = temp1*conj(gens[i+4,0])+temp2*conj(gens[i+4,2]) gens[8,1] = temp1*conj(gens[i+4,1])+temp2*conj(gens[i+4,3]) gens[8,2] = temp3*conj(gens[i+4,0])+temp4*conj(gens[i+4,2]) gens[8,3] = temp3*conj(gens[i+4,1])+temp4*conj(gens[i+4,3]) else gens[8,0] = temp1*gens[i+4,0]+temp2*gens[i+4,2] gens[8,1] = temp1*gens[i+4,1]+temp2*gens[i+4,3] gens[8,2] = temp3*gens[i+4,0]+temp4*gens[i+4,2] gens[8,3] = temp3*gens[i+4,1]+temp4*gens[i+4,3] endif ; previous product and product with gens det = gens[i,0]*gens[i,3]-gens[i,1]*gens[i,2] temp1 = gens[8,0] temp2 = gens[8,1] temp3 = gens[8,2] temp4 = gens[8,3] if real(det) < 0 gens[8,0] = gens[i,0]*conj(temp1)+gens[i,1]*conj(temp3) gens[8,1] = gens[i,0]*conj(temp2)+gens[i,1]*conj(temp4) gens[8,2] = gens[i,2]*conj(temp1)+gens[i,3]*conj(temp3) gens[8,3] = gens[i,2]*conj(temp2)+gens[i,3]*conj(temp4) else gens[8,0] = gens[i,0]*temp1+gens[i,1]*temp3 gens[8,1] = gens[i,0]*temp2+gens[i,1]*temp4 gens[8,2] = gens[i,2]*temp1+gens[i,3]*temp3 gens[8,3] = gens[i,2]*temp2+gens[i,3]*temp4 endif if real(gens[8,2]) < LINEFUZZ && real(gens[8,2]) > - LINEFUZZ ; matrix to line rad[j] = -atan2(gens[8,0])/#pi-1.5 cs[j] = -gens[8,1]*gens[8,0]/2 else ; matrix to circle cs[j] = gens[8,0]/gens[8,2] rad[j] = cabs(1/real(gens[8,2])) endif if (@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both" both[j] = both[k] endif if abs(rad[j]) < @scircle j = j - 1 endif if (@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both" if both[j] == 0 if @bmethoda == 0 clr[j] = lev elseif @bmethoda == 1 clr[j] = 1/abs(rad[j])^@adja+0.01 elseif @bmethoda == 2 clr[j] = j^@adja+0.01 elseif @bmethoda == 3 clr[j] = cabs((cs[j]*2)^@adja)+0.01 elseif @bmethoda == 4 && @version >= 112 if abs(rad[j]) < @rthresh clr[j] = 2 else clr[j] = 1 endif endif else if @bmethods == 0 clr[j] = lev elseif @bmethods == 1 clr[j] = 1/abs(rad[j])^@adjs+0.01 elseif @bmethods == 2 clr[j] = j^@adjs+0.01 elseif @bmethods == 3 clr[j] = cabs((cs[j]*2)^@adjs)+0.01 elseif @bmethods == 4 && @version >= 112 if abs(rad[j]) < @rthresh clr[j] = 2 else clr[j] = 1 endif endif endif else if @method == 0 clr[j] = lev elseif @method == 1 clr[j] = 1/abs(rad[j])^@adj+0.01 elseif @method == 2 clr[j] = j^@adj+0.01 elseif @method == 3 clr[j] = cabs((cs[j]*2)^@adj)+0.01 elseif @method == 4 && @version >= 112 if abs(rad[j]) < @rthresh clr[j] = 2 else clr[j] = 1 endif endif endif if j > 999998 lev = level + 1 k = iii + 1 endif j = j+1 k = k + 1 endwhile if j > 999998 i = 5 endif i = i + 1 endwhile ; sort array by circle identity l = round(j/2) + 1 ir = j continue = true repeat if l > 1 l = l-1 rra = cs[l-1] rrb = rad[l-1] rrc = clr[l-1] else rra = cs[ir-1] rrb = rad[ir-1] rrc = clr[ir-1] cs[ir-1] = cs[0] rad[ir-1] = rad[0] clr[ir-1] = clr[0] ir = ir-1 if ir == 0 cs[0] = rra rad[0] = rrb clr[0] = rrc continue = false endif endif if continue == true si = l sj = 2*l endif while (sj <= ir) && (continue == true) if sj < ir ddx = real(cs[sj-1])-real(cs[sj]) ddy = imag(cs[sj-1])-imag(cs[sj]) ddr = rad[sj-1]-rad[sj] c = 0 done = false ; Lines precede circles if rad[sj-1] <= 0 && rad[sj] > 0 c = -1 done = true elseif rad[sj] <= 0 && rad[sj-1] > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif rad[sj-1] <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 sj = sj + 1 endif endif ddx = real(rra)-real(cs[sj-1]) ddy = imag(rra)-imag(cs[sj-1]) ddr = rrb-rad[sj-1] c = 0 done = false ; Lines precede circles if rrb <= 0 && rad[sj-1] > 0 c = -1 done = true elseif rad[sj-1] <= 0 && rrb > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif rrb <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 cs[si-1] = cs[sj-1] rad[si-1] = rad[sj-1] clr[si-1] = clr[sj-1] si = sj sj = sj + sj else sj = ir + 1 endif endwhile if (continue == true) cs[si-1] = rra rad[si-1] = rrb clr[si-1] = rrc endif until continue == false ; eliminate duplicates in place ir = 1 l = 1 while ir < j ddx = real(cs[ir])-real(cs[ir-1]) ddy = imag(cs[ir])-imag(cs[ir-1]) ddr = rad[ir]-rad[ir-1] c = 0 done = false ; Lines precede circles if rad[ir] <= 0 && rad[ir-1] > 0 c = -1 done = true elseif rad[ir-1] <= 0 && rad[ir] > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif rad[ir] <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c == 0 ir = ir + 1 else cs[l] = cs[ir] rad[l] = rad[ir] clr[l] = clr[ir] ir = ir +1 l = l + 1 endif endwhile j = l ; move to final array, skipping dups ifinal = 0 istack = 0 nold = nfinal while ifinal < nold && istack < j && nfinal < 999999 ddx = real(csf[ifinal])-real(cs[istack]) ddy = imag(csf[ifinal])-imag(cs[istack]) ddr = radf[ifinal]-rad[istack] c = 0 done = false ; Lines precede circles if radf[ifinal] <= 0 && rad[istack] > 0 c = -1 done = true elseif rad[istack] <= 0 && radf[ifinal] > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif radf[ifinal] <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 ifinal = ifinal + 1 endif if c == 0 istack = istack + 1 endif if c > 0 csf[nfinal] = cs[istack] radf[nfinal] = rad[istack] clrf[nfinal] = clr[istack] nfinal = nfinal + 1 istack = istack + 1 endif endwhile while istack < j && nfinal < 999999 csf[nfinal] = cs[istack] radf[nfinal] = rad[istack] clrf[nfinal] = clr[istack] nfinal = nfinal + 1 istack = istack + 1 endwhile ir = nold while ir 1 l = l-1 rra = csf[l-1] rrb = radf[l-1] rrc = clrf[l-1] else rra = csf[ir-1] rrb = radf[ir-1] rrc = clrf[ir-1] csf[ir-1] = csf[0] radf[ir-1] = radf[0] clrf[ir-1] = clrf[0] ir = ir-1 if ir == 0 csf[0] = rra radf[0] = rrb clrf[0] = rrc continue = false endif endif if continue == true si = l sj = 2*l endif while (sj <= ir) && (continue == true) if sj < ir ddx = real(csf[sj-1])-real(csf[sj]) ddy = imag(csf[sj-1])-imag(csf[sj]) ddr = radf[sj-1]-radf[sj] c = 0 done = false ; Lines precede circles if radf[sj-1] <= 0 && radf[sj] > 0 c = -1 done = true elseif radf[sj] <= 0 && radf[sj-1] > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif radf[sj-1] <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 sj = sj + 1 endif endif ddx = real(rra)-real(csf[sj-1]) ddy = imag(rra)-imag(csf[sj-1]) ddr = rrb-radf[sj-1] c = 0 done = false ; Lines precede circles if rrb <= 0 && radf[sj-1] > 0 c = -1 done = true elseif radf[sj-1] <= 0 && rrb > 0 c = 1 done = true elseif ddx < -thresh c = -1 done = true elseif ddx > thresh && !done c = 1 done = true elseif ddy < -thresh && !done c = -1 done = true elseif ddy > thresh && !done c = 1 done = true elseif rrb <= 0 && !done ; Lines if ddr < -PARAFUZZ && !done c = -1 done = true elseif ddr > PARAFUZZ && !done c = 1 done = true endif elseif !done ; Circles if ddr < -thresh && !done c = -1 done = true elseif ddr > thresh && !done c = 1 done = true endif endif if c < 0 csf[si-1] = csf[sj-1] radf[si-1] = radf[sj-1] clrf[si-1] = clrf[sj-1] si = sj sj = sj + sj else sj = ir + 1 endif endwhile if (continue == true) csf[si-1] = rra radf[si-1] = rrb clrf[si-1] = rrc endif until continue == false iii = j-1 if j == 0 lev = level+1 else lev = lev+1 endif endwhile int maxi = nfinal-1 iii = 1 float radius = 0 while iii <= maxi radius = (radf[iii]) if radius < @maxrad && radius > 0 && radius > @scirclev fx = real(csf[iii])*@ascale fy = imag(csf[iii])*@ascale zz = csz[iii]*@ascale if @sphere xx = fx yy = fy fx = fx/(fx*fx+fy*fy+1)*@sphrad fy = fy/(xx*xx+fy*fy+1)*@sphrad zz = (xx*xx+yy*yy)/(xx*xx+yy*yy+1)*@sphrad radius = radius*sqrt((fx*fx+fy*fy)/(xx*xx+yy*yy)) endif if @version < 110 ffx = fx - xmin ffy = fy - xmin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax ffz = (zmin-zz)/sqrt(txmax^2+tymax^2) xx = ffx else tymax = txmax tzmax = txmax ffx = fx - xmin ffy = fy - ymin ffy = tymax*asp - ffy ffx = ffx/txmax ffy = ffy/tymax ffz = (zz-zmin)/tzmax xx = ffx endif ; ; rotation around the z axis ; xx = ffx ffx = 0.5 + (ffx - 0.5 - @rotoffx/txmax)*cos(#angle) - \ (ffy - 0.5 - @rotoffy/tymax)*sin(#angle) ffy = 0.5 + (ffy - 0.5 - @rotoffy/tymax)*cos(#angle) + \ (xx - 0.5 - @rotoffx/txmax)*sin(#angle) ; ; rotation around the y axis ; xx = ffx ffx = (0.5 + (ffz - 0.5 - @rotoffz/txmax)*sin(@zangle*pi/180) + \ (ffx - 0.5 - @rotoffx/txmax)*cos(@zangle*pi/180))*#width ffz = (0.5 + (ffz - 0.5 - @rotoffz/tzmax)*cos(@zangle*pi/180) - \ (xx - 0.5 - @rotoffx/txmax)*sin(@zangle*pi/180)) ; ; rotation around the x axis ; yy = ffy ffy = (0.5 + (ffy - 0.5 - @rotoffy/tymax)*cos(@xangle*pi/180) - \ (ffz - 0.5 - @rotoffz/tzmax)*sin(@xangle*pi/180))*#width ffz = (0.5 + (yy - 0.5 - @rotoffy/tymax)*sin(@xangle*pi/180) + \ (ffz - 0.5 - @rotoffz/tzmax)*cos(@xangle*pi/180))*#width ; ; final translation ; ffx = ffx + @transx*#width ffy = ffy + @transy*#width ffz = ffz + @transz*#width csf[iii] = (ffx+flip(ffy)) csz[iii] = ffz radf[iii] = round(radius*#width/txmax)*@ascale if radf[iii] < 1 && @version >= 111 radf[iii] = 1 endif else radf[iii] = -1 endif iii = iii + 1 endwhile ; if @switch && @tparent int i = 0 while i < 500 colorswitch = colormap[i,0] colormap[i,0] = colormap[i,1] colormap[i,1] = colorswitch i = i + 1 endwhile endif init: ; initialize camera vector float vx = 0.0 float vy = 0.0 float vz = 0.0 float vd = 0.0 ; this is used for normalizing all vectors ; ; refraction vector array (continuation of camera vector through refractions) float vxt[300] float vyt[300] float vzt[300] ; initialize light vector float lx = 0.0 float ly = 0.0 float lz = 0.0 ; ; initialize intersection point float xi = 0 float yi = 0 float zi = 0 ; ; initialize floor intersection point float xf = 0 float yf = 0 float zf = 0 ; ; initialize reflection intersection point float xr = 0 float yr = 0 float zr = 0 ; ; initialize floor reflection intersection point float xrf = 0 float yrf = 0 float zrf = 0 ; ; floor intersection array for refraction vector float xft[100] float yft[100] float zft[100] ; refraction intersection array float xit[300] float yit[300] float zit[300] int it = 0 int jt = 0 ; surface normal array for refraction intersections float lxtt[300] float lytt[300] float lztt[300] float ctheta2 = 0 ; refraction angle float rfi = 0 ; refractive index ratio float tdt[100] ; distance from back of sphere to floor (refracted ray) float dt[100] ; distance from back of sphere to next closest sphere (refracted ray) ; initialize to 1e10 it = 0 while it < 100 tdt[it]= 1e10 dt[it] = 1e10 it = it + 1 endwhile float ldt[100] ; distance from floor intersection to light (refracted ray) float floormodt[100] float fractalmodt[100] ; initialize to 10 it = 0 while it < 100 floormodt[it] = 10 fractalmodt[it] = 10 it = it + 1 endwhile float rdt[100] ; radius of closest sphere on refraction path float ldst[100] ; distance from closest sphere on refraction path to floor bool stop = false float tindex[100] ; color index for refracted spheres float colrT[100] ; color parameter for refracted spheres float ltfact[100] ; refracted floor fade according to lighting model color colorft[100] ; refracted floor color value float ltt[100] ; dot product of light vector and normal and refract intersection float colorPosT[100] ; color parameter for refracted spheres float hvalt[100] ; hightlight parameter for refracted spheres int xcrd = #x int ycrd = #y bool inside = true if @applymapping==true ; generate the x and y location in the image float dxx = (real(#pixel)-real(#center))*(#width)/4*#magn float dyy = (imag(#pixel)-imag(#center))*(#width)/4*#magn float transx = (#width)*0.5; float transy = (#height)*0.5; float cosan = cos(#angle); float sinan = sin(#angle); xcrd = round((transx + (dxx*cosan + dyy*sinan))) ycrd = round((transy + (dxx*sinan - dyy*cosan))) ; is this in our image? if (xcrd<0 || xcrd>=#width || ycrd<0 || ycrd>=#height) inside = false endif endif float ambient = @ambient float hval = 0 ; highlight param for spheres float hvalR = 0 ; highlight param for sphere reflections float hvalRF = 0 ; highlight param for sphere reflections off floor float colorPos = 0 ; color param for spheres float colorPosR = 0 ; color param for sphere reflections float colorPosRF = 0 ; color param for sphere reflections off floor int rangeNum = 0 ; color ranges for spheres int rangeNumR = 0 ; color ranges for sphere reflections int rangeNumRF = 0 ; color ranges for sphere reflections off floor int rangeNumT[100] ; color ranges for sphere refractions color color1 = rgb(0,0,0) color color2 = rgb(0,0,0) color tempcolor = rgb(0,0,0) color colorf = rgb(0,0,0) int floormod = 10 int floormodr = 10 float fractalmod = 10 float fractalmodr = 10 color fractalcolor = rgb(0,0,0) color amcolor = @amcolor float extent = 1.0 - @extent float ctheta = 0 ; cos of angle between camera ray and floor normal float ortheta = 0 ; dot product of camera position and floor normal float dirtheta = 0 ; negative cos of angle between camera ray and floor normal float leftbound = @leftbound*#width float rightbound = @rightbound*#width float topbound = -@topbound*#width*asp float bottombound = -@bottombound*#width*asp float rd = 0 ; radius of closest sphere float td = 1e10 ; distance to closest sphere float tdr = 1e10 ; distance to closest reflection sphere float ld = 0 ; distance from light to floor intersection float ltfac = 0 ; floor fade according to lighting model float ltfacr = 0 ; floor reflection on sphere fade according to lighting model float lds = 0 ; distance from light to closest sphere with floor reflection float st = 0 float sd = 0 ; bool trapped = false ; if frac[xcrd,ycrd] == -1 ; trapped = true ; endif ; light position float lightx = @lightx*#width float lighty = @lighty*#width*asp float lightz = @lightz*#width*asp ; camera position float camx = 0 float camy = 0 float camz = 0 ; float z0 = @vplane*#width*asp float zl = @lplane*#width*asp ; camx = @camerax*#width camy = @cameray*#width*asp camz = @cameraz*#width*asp ; ; create the camera vector ; vx = xcrd-(#width-@cpointx*#width) -camx vy = ycrd-(@cpointy*#width-#width)*asp -camy vz = -z0 - camz vd = 1/sqrt(vx*vx+vy*vy+vz*vz) vx = vx*vd vy = vy*vd vz = vz*vd ; create vector for light direction if @ltype == "Point source" || @ltype == "Spotlight" lx = #width-@lpointx*#width-lightx ly = (@lpointy*#width-#width)*asp-lighty lz = -zl-lightz else float elevation = -@elevation float d2r = #pi/180; degrees to radians conversion factor lx = -cos(@angle*d2r) * cos(elevation*d2r) ly = -sin(@angle*d2r) * cos(elevation*d2r) lz = sin(elevation*d2r) endif vd = 1/sqrt(lx*lx+ly*ly+lz*lz) lx = -lx*vd ly = -ly*vd lz = -lz*vd ; ; initialize normal vector for intersection point float lxt = 0 float lyt = 0 float lzt = 0 ; ; initialize normal vector for intersection point on floor float lxtf = 0 float lytf = 0 float lztf = 0 ; ; initialize normal vector for intersection point at reflection object float lxn = 0 float lyn = 0 float lzn = 0 ; ; initialize reflection vector float lxr = 0 float lyr = 0 float lzr = 0 ; ; initialize reflection vector from floor float lxfr = 0 float lyfr = 0 float lzfr = 0 ; float bi = 0 float ci = 0 float arg = 0 float ti1 = 0 float ti2 = 0 float ti = 0 float colr = 0 ; gradient sphere color parameter float colrR = 0 ; gradient sphere relection color parameter float colrRF = 0 ; gradient sphere refraction color parameter float colorPos = 0 ; sphere color float lt = 0 ; dot product of light vector and normal float d = 1e10 ; distance from camera to closest float ss = 1e10 float ro = 1e10 ; distance from intersection to closest reflection sphere float dx = 0 float dy = 0 float dz = 0 float am = 0 ; shadow color float am2 = 0 ; shadow parameter float cindex = 0 float lrf = 0 ; reflection on floor coloring int rspf = 0 ; index of sphere reflected onto floor float rof = 1e10 ; distance from intersection to next refraction int ri = 1 int ristart = 1 int rsp = 0 ; index of reflection sphere float lr = 0 ; reflection coloring int di = 0 float rindex = 0 float rindexf = 0 ; ; create floor ; if @floor ; floor normal lxtf = fa lytf = fb lztf = fc vd = 1/sqrt(lxtf*lxtf+lytf*lytf+lztf*lztf) lxtf = lxtf*vd lytf = lytf*vd lztf = lztf*vd ; dot product with ray origin ortheta = lxtf*camx+lytf*camy+lztf*camz ; dot product with camera vector dirtheta = lxtf*vx+lytf*vy+lztf*vz ; distance from camera to intersection td = -(ortheta+fd)/dirtheta ; intersection point with camera ray if td > 0 xf = camx+vx*td yf = camy+vy*td zf = camz+vz*td endif ; distance to light if @ltype == "Point source" if td > 0 ld = sqrt((lightx-xf)^2 + (lighty-yf)^2+ (lightz-zf)^2)/ \ sqrt((lightx-xcrd)^2 + (lighty-ycrd)^2+ (lightz-z0)^2) else ld = 1234567890 endif elseif @ltype == "Spotlight" st = (xf-lightx)*lx + (yf-lighty)*ly + (zf-lightz)*lz sd = sqrt((lightx-xf+lx*st)^2+(lighty-yf+ly*st)^2+(lightz-zf+lz*st)^2) if @spottype == "Sharp" ld = 0.0 if (sd/(@spotrad*#width*asp)) > 1 ld = 1-@ambient endif elseif @spottype == "Set focus" ld = (sd/(@spotrad*#width*asp))^@setfocus if ld < 0.8 ld = 0 else ld = ld - 0.8 endif if ld > 1-@ambient ld = 1-@ambient endif endif endif if @fbound == true ; put bounds on the floor if xf < leftbound || zf < topbound || xf > rightbound || zf > bottombound td = 0 ld = 1234567890 endif endif ; setup checkerboard complex fp = (lytf+lztf)*xf + lxtf*yf + \ flip((lxtf+lytf)*zf + lztf*yf)+ \ real(@poffset)*#width + flip(imag(@poffset)*#height) if @flrtype == "Checkerboard" fp = floor(fp*checkscale) if ((real(fp) + imag(fp)) % 2 == 0) floormod = 0 else floormod = 1 endif elseif @flrtype == "Fractal" fp = abs(fp) fractalmod = frac[floor(real(fp)*checkscale*#width/2)%#width, \ floor(imag(fp)*checkscale*#width/2*asp)%trunc(#width*asp)] endif ; is the floor point in a shadow? ; create vector to light source and check for object hits if @am != 0 ri = ristart while ri <= maxi if radf[ri] != -1 if ri != di ; eliminate self-shadow bi = (lx*(xf-real(csf[ri]))+ly*(yf-imag(csf[ri]))+lz*(zf-csz[ri])) ci = (xf-real(csf[ri]))^2+(yf-imag(csf[ri]))^2+(zf-csz[ri])^2-radf[ri]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects shadow sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 > ti2 ; find smallest ti ti = ti2 else ti = ti1 endif if ti > 0 && ti < ss ss = ti am2 = @am endif endif endif endif ri = ri + 1 endwhile endif ss = 1e10 ; ; is there a reflection object to reflect onto the floor? ; if @version >=200 if @reflect && @reflectf ; ; create reflection vector [R = I+2*N*(N.I)] ; ctheta = -lxtf*vx-lytf*vy-lztf*vz ; N.I lxfr = -vx+2*lxtf*ctheta lyfr = -vy+2*lytf*ctheta lzfr = -vz+2*lztf*ctheta vd = 1/sqrt(lxfr*lxfr+lyfr*lyfr+lzfr*lzfr) lxfr = lxfr*vd lyfr = lyfr*vd lzfr = lzfr*vd ; ; is there a reflection object? ; ri = ristart ti = 0 while ri <= maxi if radf[ri] != -1 bi = (lxfr*(xf-real(csf[ri]))+lyfr*(yf-imag(csf[ri]))+lzfr*(zf-csz[ri])) ci = (xf-real(csf[ri]))^2+(yf-imag(csf[ri]))^2+(zf-csz[ri])^2-radf[ri]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects reflection sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 > ti2 ; find smallest ti ti = ti2 else ti = ti1 endif if ti > 0 && ti < rof ; find closest reflection object rof = ti rspf = ri ; index of reflection object endif endif endif ri = ri + 1 endwhile if rof != 1e10 && @reflectf==true ; find intersection point on reflection object xr = xf+lxfr*rof yr = yf+lyfr*rof zr = zf+lzfr*rof ; ; create the normal at the intersection point lxn = -(xr-real(csf[rspf]))/radf[rspf] lyn = (yr-imag(csf[rspf]))/radf[rspf] lzn = (zr-csz[rspf])/radf[rspf] vd = 1/sqrt(lxn*lxn+lyn*lyn+lzn*lzn) lxn = lxn*vd lyn = lyn*vd lzn = lzn*vd ; set the color indexing for the reflection ; if colorsUsed == 8 && !@reflect if colorsUsed == 8 rindexf = trunc(clrf[rspf]) if (trunc(rindexf/colorsUsed+0.01)%2) == 0 rindexf = rindexf%colorsUsed else rindexf = colorsUsed-1-(rindexf)%(colorsUsed) endif else rindexf = trunc(clrf[rspf])%colorsUsed endif lrf = -(lxn*lx+lyn*ly+lzn*lz)*kr ; reflection coloring endif endif endif endif ; ri = ristart ti = 0 while ri <= maxi if radf[ri] != -1 bi = vx*(camx-real(csf[ri]))+vy*(camy-imag(csf[ri]))+vz*(camz-csz[ri]) ci = (camx-real(csf[ri]))^2+(camy-imag(csf[ri]))^2+(camz-csz[ri])^2-radf[ri]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 > ti2 ; find smallest ti ti = ti2 else ti = ti1 endif endif if ti > 0 && ti < d ; find closest object d = ti dx = real(csf[ri]) dy = imag(csf[ri]) dz = csz[ri] di = ri rd = radf[ri] if colorsUsed == 8 && !@reflect cindex = trunc(clrf[ri]) if (trunc(cindex/colorsUsed+0.01)%2) == 0 cindex = cindex%colorsUsed else cindex = colorsUsed-1-(cindex)%(colorsUsed) endif else cindex = trunc(clrf[ri])%colorsUsed endif endif endif ri = ri+1 endwhile if d > 0 && d != 1e10 ; intersection point outside object xi = camx+vx*d yi = camy+vy*d zi = camz+vz*d ; distance to light if @ltype == "Point source" if tdr > 0 lds = sqrt((lightx-xi)^2 + (lighty-yi)^2+ (lightz-zi)^2)/ \ sqrt((lightx)^2 + (lighty)^2+ (lightz)^2) else lds = 1234567890 endif elseif @ltype == "Spotlight" st = (xi-lightx)*lx + (yi-lighty)*ly + (zi-lightz)*lz sd = sqrt((lightx-xi+lx*st)^2+(lighty-yi+ly*st)^2+(lightz-zi+lz*st)^2) if @spottype == "Sharp" lds = 0.0 if (sd/(@spotrad*#width*asp)) > 1 lds = 1-@ambient endif elseif @spottype == "Set focus" lds = (sd/(@spotrad*#width*asp))^@setfocus if lds < 0.8 lds = 0 else lds = lds - 0.8 endif if lds > 1-@ambient lds = 1-@ambient endif endif endif ; ; is the point in a shadow? ; create vector to light source and check for object hits if @am != 0 ri = ristart while ri <= maxi if radf[ri] != -1 if ri != di ; eliminate self-shadow bi = (lx*(xi-real(csf[ri]))+ly*(yi-imag(csf[ri]))+lz*(zi-csz[ri])) ci = (xi-real(csf[ri]))^2+(yi-imag(csf[ri]))^2+(zi-csz[ri])^2-radf[ri]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects shadow sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 > ti2 ; find smallest ti ti = ti2 else ti = ti1 endif if ti > 0 && ti < ss ss = ti am = (1.0/@totalColors)*@am+(1.0/@totalColors)*(cindex+(1-@scale/2)/2)-0.015 endif endif endif endif ri = ri + 1 endwhile endif ; ; create the normals at the intersection points ; lxt = (xi-dx)/rd lyt = (yi-dy)/rd lzt = (zi-dz)/rd vd = 1/sqrt(lxt*lxt+lyt*lyt+lzt*lzt) lxt = lxt*vd lyt = lyt*vd lzt = lzt*vd ; ; check for reflections ; if @reflect == true ; ; create reflection vector [R = I+2*N*(N.I)] ; ctheta = -lxt*vx-lyt*vy-lzt*vz ; N.I lxr = vx+2*lxt*ctheta lyr = vy+2*lyt*ctheta lzr = vz+2*lzt*ctheta vd = 1/sqrt(lxr*lxr+lyr*lyr+lzr*lzr) lxr = lxr*vd lyr = lyr*vd lzr = lzr*vd ; ; is there a reflection object? ; ri = ristart ti = 0 lr = 0 while ri <= maxi if radf[ri] != -1 if di != ri ; eliminate self-reflection bi = (lxr*(xi-real(csf[ri]))+lyr*(yi-imag(csf[ri]))+lzr*(zi-csz[ri])) ci = (xi-real(csf[ri]))^2+(yi-imag(csf[ri]))^2+(zi-csz[ri])^2-radf[ri]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects reflection sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 > ti2 ; find smallest ti ti = ti2 else ti = ti1 endif if ti > 0 && ti < ro ; find closest reflection object ro = ti rsp = ri ; index of reflection object endif endif endif endif ri = ri + 1 endwhile ; ; Is the floor closer? if @floor == true ; intersection point with reflection ray ; dot product with ray origin ortheta = lxtf*xi+lytf*yi+lztf*zi ; dot product with reflection vector dirtheta = lxtf*lxr+lytf*lyr+lztf*lzr ; distance from camera to intersection tdr = -(ortheta+fd)/dirtheta if tdr > 0 xrf = xi+lxr*tdr yrf = yi+lyr*tdr zrf = zi+lzr*tdr endif endif if tdr < ro && tdr > 0 ; floor is closest reflection object if @fbound == true ; put bounds on the floor if xrf < leftbound || zrf < topbound || xrf > rightbound || zrf > bottombound tdr = 0 endif endif ; setup checkerboard complex fp = (lytf+lztf)*xrf + lxtf*yrf + \ flip((lxtf+lytf)*zrf + lztf*yrf)+ \ real(@poffset)*#width + flip(imag(@poffset)*#height) if @flrtype == "Checkerboard" fp = floor(fp*checkscale) if ((real(fp) + imag(fp)) % 2 == 0) floormodr = 0 else floormodr = 1 endif elseif @flrtype == "Fractal" fp = abs(fp) fractalmodr = frac[floor(real(fp)*checkscale*#width/2)%#width, \ floor(imag(fp)*checkscale*#width*asp/2)%trunc(#width*asp)] endif else if ro != 1e10 && @reflect==true ; find intersection point on reflection object xr = xi+lxr*ro yr = yi+lyr*ro zr = zi+lzr*ro ; ; create the normal at the intersection point lxn = (xr-real(csf[rsp]))/radf[rsp] lyn = (yr-imag(csf[rsp]))/radf[rsp] lzn = (zr-csz[rsp])/radf[rsp] vd = 1/sqrt(lxn*lxn+lyn*lyn+lzn*lzn) lxn = lxn*vd lyn = lyn*vd lzn = lzn*vd ; set the color indexing for the reflection if colorsUsed == 8 && !@reflect rindex = trunc(clrf[rsp]) if (trunc(rindex/colorsUsed+0.01)%2) == 0 rindex = rindex%colorsUsed else rindex = colorsUsed-1-(rindex)%(colorsUsed) endif else rindex = trunc(clrf[rsp])%colorsUsed endif lr = (lxn*lx+lyn*ly+lzn*lz)*kr ; reflection coloring endif endif endif ; ; tranparency code ; ; ; initialize initial array values ; ; refraction vectors vxt[0] = vx vyt[0] = vy vzt[0] = vz ; sphere intersection points xit[0] = xi yit[0] = yi zit[0] = zi lxtt[0] = lxt lytt[0] = lyt lztt[0] = lzt ; array indices it = 0 jt = 0 stop = false if @tparent while !stop ltt[jt] = 0 ldt[jt] = 0 ldst[jt] = 0 ; calculate surface normal ; float dlast = di lxtt[it] = (xit[it]-real(csf[di]))/radf[di] lytt[it] = (yit[it]-imag(csf[di]))/radf[di] lztt[it] = (zit[it]-csz[di])/radf[di] vd = 1/sqrt(lxtt[it]*lxtt[it]+lytt[it]*lytt[it]+lztt[it]*lztt[it]) lxtt[it] = lxtt[it]*vd lytt[it] = lytt[it]*vd lztt[it] = lztt[it]*vd ; ; calculate refraction vector #1 ; ; T = [I/rfi-(ctheta2-ctheta/rfi)*N] ; Snell's law: sin(angle1)/sin(angle2) = rf2/rf1 = rfi rfi = @rfi ctheta = -lxtt[it]*vxt[it]-lytt[it]*vyt[it]-lztt[it]*vzt[it] ; N.I ctheta2 = sqrt(1 - (1-ctheta^2)/rfi^2) ; T.I vxt[it+1] = vxt[it]/rfi-lxtt[it]*(ctheta2-ctheta/rfi) vyt[it+1] = vyt[it]/rfi-lytt[it]*(ctheta2-ctheta/rfi) vzt[it+1] = vzt[it]/rfi-lztt[it]*(ctheta2-ctheta/rfi) vd = 1/sqrt(vxt[it+1]*vxt[it+1]+vyt[it+1]*vyt[it+1]+vzt[it+1]*vzt[it+1]) vxt[it+1] = vxt[it+1]*vd vyt[it+1] = vyt[it+1]*vd vzt[it+1] = vzt[it+1]*vd ; ; find intersection in back of sphere ; bi = vxt[it+1]*(xit[it]-real(csf[di]))+vyt[it+1]*(yit[it]-imag(csf[di]))+vzt[it+1]*(zit[it]-csz[di]) ci = (xit[it]-real(csf[di]))^2+(yit[it]-imag(csf[di]))^2+(zit[it]-csz[di])^2-radf[di]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 < ti2 ; find largest ti ti = ti2 else ti = ti1 endif endif xit[it+1] = xit[it]+vxt[it+1]*ti yit[it+1] = yit[it]+vyt[it+1]*ti zit[it+1] = zit[it]+vzt[it+1]*ti ; ; calculate surface normal #2 ; lxtt[it+1] = -(xit[it+1]-real(csf[di]))/radf[di] lytt[it+1] = -(yit[it+1]-imag(csf[di]))/radf[di] lztt[it+1] = -(zit[it+1]-csz[di])/radf[di] vd = 1/sqrt(lxtt[it+1]*lxtt[it+1]+lytt[it+1]*lytt[it+1]+lztt[it+1]*lztt[it+1]) lxtt[it+1] = lxtt[it+1]*vd lytt[it+1] = lytt[it+1]*vd lztt[it+1] = lztt[it+1]*vd ; ; calculate refraction vector #2 ; ctheta = -lxtt[it+1]*vxt[it+1]-lytt[it+1]*vyt[it+1]-lztt[it+1]*vzt[it+1] ; N.I rfi = 1/@rfi ctheta2 = sqrt(1 - (1-ctheta^2)/rfi^2) vxt[it+2] = vxt[it+1]/rfi-lxtt[it+1]*(ctheta2-ctheta/rfi) vyt[it+2] = vyt[it+1]/rfi-lytt[it+1]*(ctheta2-ctheta/rfi) vzt[it+2] = vzt[it+1]/rfi-lztt[it+1]*(ctheta2-ctheta/rfi) vd = 1/sqrt(vxt[it+2]*vxt[it+2]+vyt[it+2]*vyt[it+2]+vzt[it+2]*vzt[it+2]) vxt[it+2] = vxt[it+2]*vd vyt[it+2] = vyt[it+2]*vd vzt[it+2] = vzt[it+2]*vd ; ; determine intersection of reflection vector with floor ; ; dot product with ray origin at back of sphere ortheta = lxtf*xit[it+1]+lytf*yit[it+1]+lztf*zit[it+1] ; dot product with 2nd refraction vector dirtheta = lxtf*vxt[it+2]+lytf*vyt[it+2]+lztf*vzt[it+2] ; distance from back of sphere to intersection with floor tdt[jt] = -(ortheta+fd)/dirtheta ; intersection point with 2nd refraction ray if tdt[jt] > 0 xft[jt] = xit[it+1]+vxt[it+2]*tdt[jt] yft[jt] = yit[it+1]+vyt[it+2]*tdt[jt] zft[jt] = zit[it+1]+vzt[it+2]*tdt[jt] endif ; ; distance from floor interection to light ; if @ltype == "Point source" if tdt[jt] > 0 ldt[jt] = sqrt((lightx-xft[jt])^2 + (lighty-yft[jt])^2+ (lightz-zft[jt])^2)/ \ sqrt((lightx-xcrd)^2 + (lighty-ycrd)^2+ (lightz-z0)^2) else ldt[jt] = 1234567890 endif elseif @ltype == "Spotlight" st = (xft[jt]-lightx)*lx + (yft[jt]-lighty)*ly + (zft[jt]-lightz)*lz sd = sqrt((lightx-xft[jt]+lx*st)^2+(lighty-yft[jt]+ly*st)^2+(lightz-zft[jt]+lz*st)^2) if @spottype == "Sharp" ldt[jt] = 0.0 if (sd/(@spotrad*#width*asp)) > 1 ldt[jt] = 1-@ambient endif elseif @spottype == "Set focus" ldt[jt] = (sd/(@spotrad*#width*asp))^@setfocus if ldt[jt] < 0.8 ldt[jt] = 0 else ldt[jt] = ldt[jt] - 0.8 endif if ldt[jt] > 1-@ambient ldt[jt] = 1-@ambient endif endif endif ; if @fbound == true ; put bounds on the floor if xft[jt] < leftbound || zft[jt] < topbound || xft[jt] > rightbound || zft[jt] > bottombound tdt[jt] = 0 ldt[jt] = 1234567890 endif endif ; ; setup checkerboard complex fp = (lytf+lztf)*xft[jt] + lxtf*yft[jt] + \ flip((lxtf+lytf)*zft[jt] + lztf*yft[jt])+ \ real(@poffset)*#width + flip(imag(@poffset)*#height) if @flrtype == "Checkerboard" fp = floor(fp*checkscale) if ((real(fp) + imag(fp)) % 2 == 0) floormodt[jt] = 0 else floormodt[jt] = 1 endif ; setup fractal pattern elseif @flrtype == "Fractal" fp = abs(fp) fractalmodt[jt] = frac[floor(real(fp)*checkscale*#width/2)%#width, \ floor(imag(fp)*checkscale*#width*asp/2)%trunc(#width*asp)] endif ; ; find closest sphere or terminate ; ri = ristart ti = 0 dt[jt] = 1e10 while ri <= maxi if radf[ri] != -1 && ri != dlast bi = vxt[it+2]*(xit[it+1]-real(csf[ri]))+vyt[it+2]*(yit[it+1]-imag(csf[ri]))+vzt[it+2]*(zit[it+1]-csz[ri]) ci = (xit[it+1]-real(csf[ri]))^2+(yit[it+1]-imag(csf[ri]))^2+(zit[it+1]-csz[ri])^2-radf[ri]^2 arg = bi*bi-ci if (arg > 0) ; ray intersects sphere ti1 = -bi - sqrt(arg) ti2 = -bi + sqrt(arg) if ti1 > ti2 ; find smallest ti ti = ti2 else ti = ti1 endif endif if ti > 0 && ti < dt[jt] ; find closest object dt[jt] = ti dx = real(csf[ri]) dy = imag(csf[ri]) dz = csz[ri] di = ri ; this will be used in the next level rdt[jt] = radf[ri] if colorsUsed == 8 && !@reflect tindex[jt] = trunc(clrf[ri]) if (trunc(tindex[jt]/colorsUsed+0.01)%2) == 0 tindex[jt] = tindex[jt]%colorsUsed else tindex[jt] = colorsUsed-1-(tindex[jt])%(colorsUsed) endif else tindex[jt] = trunc(clrf[ri])%colorsUsed endif endif endif ri = ri+1 endwhile ; ; intersection point with next sphere ; if dt[jt] > 0 && dt[jt] != 1e10 ; intersection point outside object xit[it+2] = xit[it+1]+vxt[it+2]*dt[jt] yit[it+2] = yit[it+1]+vyt[it+2]*dt[jt] zit[it+2] = zit[it+1]+vzt[it+2]*dt[jt] ; ; distance of intersection to light ; if @ltype == "Point source" if td > 0 ldst[jt] = sqrt((lightx-xit[it+2])^2 + (lighty-yit[it+2])^2+ (lightz-zit[it+2])^2)/ \ sqrt((lightx)^2 + (lighty)^2+ (lightz)^2) else ldst[jt] = 1234567890 endif elseif @ltype == "Spotlight" st = (xit[it+2]-lightx)*lx + (yit[it+2]-lighty)*ly + (zit[it+2]-lightz)*lz sd = sqrt((lightx-xit[it+2]+lx*st)^2+(lighty-yit[it+2]+ly*st)^2+(lightz-zit[it+2]+lz*st)^2) if @spottype == "Sharp" ldst[jt] = 0.0 if (sd/(@spotrad*#width)) > 1 ldst[jt] = 1-@ambient endif elseif @spottype == "Set focus" ldst[jt] = (sd/(@spotrad*#width))^@setfocus if ldst[jt] < 0.8 ldst[jt] = 0 else ldst[jt] = ldst[jt] - 0.8 endif if ldst[jt] > 1-@ambient ldst[jt] = 1-@ambient endif endif endif ; calculation of surface normal #3 ; lxtt[it+2] = (xit[it+2]-dx)/rdt[jt] lytt[it+2] = (yit[it+2]-dy)/rdt[jt] lztt[it+2] = (zit[it+2]-dz)/rdt[jt] vd = 1/sqrt(lxtt[it+2]*lxtt[it+2]+lytt[it+2]*lytt[it+2]+lztt[it+2]*lztt[it+2]) lxtt[it+2] = lxtt[it+2]*vd lytt[it+2] = lytt[it+2]*vd lztt[it+2] = lztt[it+2]*vd ; ; dot product of light vector and normal vector ; ltt[jt] = (lx*lxtt[it+2]+ly*lytt[it+2]+lz*lztt[it+2])*krt colrT[jt] = (1.0/@totalColors)*@scale/2*ltt[jt]+0.25*(tindex[jt]+(1-@scale/2)/2)-0.015 colorPosT[jt] = @scale/2*ltt[jt] endif it = it+2 jt = jt+1 if dt[jt-1] == 1e10 stop = true jt = jt-1 it = it-2 endif endwhile endif ; ; dot product of light vector and normal vector ; lt = (lx*lxt+ly*lyt+lz*lzt) colorPos = @scale/2*lt colorPosR = @scale/2*lr if @reflect == true if lr != 0 colrR = (1.0/@totalColors)*@scale/2*lr+0.25*(rindex+(1-@scale/2)/2)-0.015 colr = (1.0/@totalColors)*@scale/2*lt+0.25*(cindex+(1-@scale/2)/2)-0.015 else colr = (1.0/@totalColors)*@scale/2*lt+0.25*(cindex+(1-@scale/2)/2)-0.015 endif else colr = (1.0/@totalColors)*@scale/2*lt+0.25*(cindex+(1-@scale/2)/2)-0.015 endif endif if rof != 1e10 && @reflectf && @floor colorPosRF = @scale/2*lrf colrRF = (1.0/@totalColors)*@scale/2*lrf+0.25*(rindexf+(1-@scale/2)/2)-0.015 endif ; if @tparent ; am = am*(1-@tparentval) ; am2 = am2*(1-@tparentval) ; endif ; loop: final: ; if @applymapping && !inside && @solid #solid = true endif ; Perturb the ranges, if specified. rangeNum = trunc(cindex) if rangeNum < 0 rangeNum = rangeNum * -1 endif rangeNum = (rangeNum + offset) % ranges if (@perturbRanges == "Even/Odd") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 2 4 6 1 3 5 7 if ((trunc (ranges / 2) * 2) == ranges) ; Number of ranges is even. if (rangeNum < ranges / 2) rangeNum = (rangeNum + rangeNum) % ranges else rangeNum = (rangeNum + rangeNum + 1) % ranges endif else ; Number of ranges is odd. rangeNum = (rangeNum + rangeNum) % ranges endif elseif (@perturbRanges == "1st Half / 2nd Half") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 4 1 5 2 6 3 7 if ((trunc (rangeNum / 2) * 2) == rangeNum) ; rangeNum is even. rangeNum = rangeNum - trunc (rangeNum / 2) else ; rangeNum is odd. rangeNum = rangeNum + trunc ((ranges - rangeNum) / 2) endif endif if colorPos > 0.5 colorPos = (colorPos - 0.5) / 0.5 else colorPos = colorPos / 0.5 endif if @highlight_type == "none" hval = 0 elseif @highlight_type == "linear" if colorPos > extent hval = (5*@highlight*(colorPos-extent)/(1-extent)+1)/(5*@highlight + 1) else hval = 0 endif elseif @highlight_type == "log" if colorPos > extent hval = (5*@highlight*log(colorPos-extent+1)/log(2-extent)+1)/(5*@highlight + 1) else hval = 0 endif elseif @highlight_type == "exponential" if colorPos > extent hval = (5*@highlight*(exp(colorPos-extent)-1)/(exp(1-extent)-1)+1)/(5*@highlight + 1) else hval = 0 endif endif if @reflect == true ; Perturb the ranges, if specified. rangeNumR = trunc(rindex) if rangeNumR < 0 rangeNumR = rangeNumR * -1 endif rangeNumR = (rangeNumR + offset) % ranges if (@perturbRanges == "Even/Odd") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 2 4 6 1 3 5 7 if ((trunc (ranges / 2) * 2) == ranges) ; Number of ranges is even. if (rangeNumR < ranges / 2) rangeNumR = (rangeNumR + rangeNumR) % ranges else rangeNumR = (rangeNumR + rangeNumR + 1) % ranges endif else ; Number of ranges is odd. rangeNumR = (rangeNumR + rangeNumR) % ranges endif elseif (@perturbRanges == "1st Half / 2nd Half") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 4 1 5 2 6 3 7 if ((trunc (rangeNumR / 2) * 2) == rangeNumR) ; rangeNumR is even. rangeNumR = rangeNumR - trunc (rangeNumR / 2) else ; rangeNumR is odd. rangeNumR = rangeNumR + trunc ((ranges - rangeNumR) / 2) endif endif if colorPosR > 0.5 colorPosR = (colorPosR - 0.5) / 0.5 else colorPosR = colorPosR / 0.5 endif if @highlight_type == "none" hvalR = 0 elseif @highlight_type == "linear" if colorPosR > extent hvalR = (5*@highlight*(colorPosR-extent)/(1-extent)+1)/(5*@highlight + 1) else hvalR = 0 endif elseif @highlight_type == "log" if colorPosR > extent hvalR = (5*@highlight*log(colorPosR-extent+1)/log(2-extent)+1)/(5*@highlight + 1) else hvalR = 0 endif elseif @highlight_type == "exponential" if colorPosR > extent hvalR = (5*@highlight*(exp(colorPosR-extent)-1)/(exp(1-extent)-1)+1)/(5*@highlight + 1) else hvalR = 0 endif endif ; Perturb the ranges, if specified. rangenumRF = trunc(rindexf) if rangenumRF < 0 rangenumRF = rangenumRF * -1 endif rangenumRF = (rangenumRF + offset) % ranges if (@perturbRanges == "Even/Odd") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 2 4 6 1 3 5 7 if ((trunc (ranges / 2) * 2) == ranges) ; Number of ranges is even. if (rangenumRF < ranges / 2) rangenumRF = (rangenumRF + rangenumRF) % ranges else rangenumRF = (rangenumRF + rangenumRF + 1) % ranges endif else ; Number of ranges is odd. rangenumRF = (rangenumRF + rangenumRF) % ranges endif elseif (@perturbRanges == "1st Half / 2nd Half") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 4 1 5 2 6 3 7 if ((trunc (rangenumRF / 2) * 2) == rangenumRF) ; rangenumRF is even. rangenumRF = rangenumRF - trunc (rangenumRF / 2) else ; rangenumRF is odd. rangenumRF = rangenumRF + trunc ((ranges - rangenumRF) / 2) endif endif if colorPosRF > 0.5 colorPosRF = (colorPosRF - 0.5) / 0.5 else colorPosRF = colorPosRF / 0.5 endif if @highlight_type == "none" hvalRF = 0 elseif @highlight_type == "linear" if colorPosRF > extent hvalRF = (5*@highlight*(colorPosRF-extent)/(1-extent)+1)/(5*@highlight + 1) else ; hvalRF = 0 endif elseif @highlight_type == "log" if colorPosRF > extent hvalRF = (5*@highlight*log(colorPosRF-extent+1)/log(2-extent)+1)/(5*@highlight + 1) else ; hvalRF = 0 endif elseif @highlight_type == "exponential" if colorPosRF > extent hvalRF = (5*@highlight*(exp(colorPosRF-extent)-1)/(exp(1-extent)-1)+1)/(5*@highlight + 1) else ; hvalRF = 0 endif endif endif if @tparent it = 0 while it <= jt ; Perturb the ranges, if specified. rangeNumT[it] = trunc(tindex[it]) if rangeNumT[it] < 0 rangeNumT[it] = rangeNumT[it] * -1 endif rangeNumT[it] = (rangeNumT[it] + offset) % ranges if (@perturbRanges == "Even/Odd") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 2 4 6 1 3 5 7 if ((trunc (ranges / 2) * 2) == ranges) ; Number of ranges is even. if (rangeNumT[it] < ranges / 2) rangeNumT[it] = (rangeNumT[it] + rangeNumT[it]) % ranges else rangeNumT[it] = (rangeNumT[it] + rangeNumT[it] + 1) % ranges endif else ; Number of ranges is odd. rangeNumT[it] = (rangeNumT[it] + rangeNumT[it]) % ranges endif elseif (@perturbRanges == "1st Half / 2nd Half") ; If range ordering is 0 1 2 3 4 5 6 7, ; then range selected becomes 0 4 1 5 2 6 3 7 if ((trunc (rangeNumT[it] / 2) * 2) == rangeNumT[it]) ; rangeNumT[it] is even. rangeNumT[it] = rangeNumT[it] - trunc (rangeNumT[it] / 2) else ; rangeNumT[it] is odd. rangeNumT[it] = rangeNumT[it] + trunc ((ranges - rangeNumT[it]) / 2) endif endif if colorPosT[it] > 0.5 colorPosT[it] = (colorPosT[it] - 0.5) / 0.5 else colorPosT[it] = colorPosT[it] / 0.5 endif if @highlight_type == "none" hvalt[it] = 0 elseif @highlight_type == "linear" if colorPosT[it] > extent hvalt[it] = (5*@highlight*(colorPosT[it]-extent)/(1-extent)+1)/(5*@highlight + 1) else hvalt[it] = 0 endif elseif @highlight_type == "log" if colorPosT[it] > extent hvalt[it] = (5*@highlight*log(colorPosT[it]-extent+1)/log(2-extent)+1)/(5*@highlight + 1) else hvalt[it] = 0 endif elseif @highlight_type == "exponential" if colorPosT[it] > extent hvalt[it] = (5*@highlight*(exp(colorPosT[it]-extent)-1)/(exp(1-extent)-1)+1)/(5*@highlight + 1) else hvalt[it] = 0 endif endif it = it + 1 endwhile endif if lds > @sdis lds = @sdis endif it = 0 while it <= jt if ldst[it] > @sdis ldst[it] = @sdis endif ; have refracted floor fade according to lighting model ltfact[it] = ldt[it]/@dis/@floorrefract if ldt[it] == 1234567890 ltfact[it] = 0 elseif ltfact[it] < 0 ltfact[it] = 0 elseif ltfact[it] > 1 ltfact[it] = 1 endif ; if ltfact[it] > krft ; ltfact[it] = krft ; endif If ltfact[it]+am2 > 1 ltfact[it] = 1-am2 endif if dt[it] > tdt[it] && tdt[it] > 0 && ltfact[it] >= 0 if @flrtype == "Checkerboard" if floormodt[it] == 0 colorft[it] = blend(@flrcolor,rgb(0,0,0),ltfact[it]+am2) elseif floormodt[it] == 1 colorft[it] = blend(@flrcolor2,rgb(0,0,0),ltfact[it]+am2) endif elseif @flrtype == "Plain" colorft[it] = blend(@flrcolor,rgb(0,0,0),ltfact[it]+am2) elseif @flrtype == "Fractal" if fractalmodt[it] == 0 fractalcolor = @icolor colorft[it] = blend(fractalcolor,rgb(0,0,0),ltfact[it]+am2) else fractalcolor = gradient((fractalmodt[it]/mxi)^@spread+@shift) colorft[it] = blend(fractalcolor,rgb(0,0,0),ltfact[it]+am2) endif endif else colorft[it] = rgba(0,0,0,1) endif it = it+ 1 endwhile if colr == 0 && (td == 0 || td == 1e10) if @solid #solid = true else if @colorPreset == "Gradient" colorf = gradient(0) else if @switch colorf = colormap[0,0] else colorf = colormap[0,1] endif endif endif else if @am == 0 if @colorPreset == "Gradient" if @reflect == true if lr != 0 color1 = gradient(colrR/2) color2 = gradient(colr/2) colorf = blend(color1,color2,1-@blendval) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif else colorf = gradient(colr/2) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else colorf = gradient(colr/2) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else if @reflect == true if lr != 0 color1 = blend(colorMap[rangeNumR,1], blend(colorMap[rangeNumR,0],@hcolor,hvalR^@hrblend), colorPosR^@rblend) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = blend(color1,color2,1-@blendval) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif else colorf = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else colorf = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif endif else if am < colr/2 if @colorPreset == "Gradient" if @reflect == true if lr != 0 ; compose reflection color1 = gradient(colrR/2) color2 = gradient(colr/2) tempcolor = blend(color1,color2,1-@blendval) ; compose shadow color1 = gradient(colr/2 - am) color2 = gradient(colr/2) color2 = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) ; compose colorf color1 = tempcolor colorf = compose(color1,blend(color1,mergedarken(color1,color2),@am),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif else color1 = gradient(colr/2 - am) color2 = gradient(colr/2) colorf = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else color1 = gradient(colr/2 - am) color2 = gradient(colr/2) colorf = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else if @reflect == true if lr != 0 ; compose reflection color1 = blend(colorMap[rangeNumR,1], blend(colorMap[rangeNumR,0],@hcolor,hvalR^@hrblend), colorPosR^@cblend) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) tempcolor = blend(color1,color2,1-@blendval) ; compose shadow color1 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend-am) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) color2 = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) ; compose colorf color1 = tempcolor colorf = compose(color1,blend(color1,mergedarken(color1,color2),@am),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif else color1 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend-am) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else color1 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend-am) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif endif else if @colorPreset == "Gradient" if @reflect == true if lr != 0 ; compose reflection color1 = gradient(colrR/2) color2 = gradient(colr/2) tempcolor = blend(color1,color2,1-@blendval) ; compose shadow color2 = gradient(0) ; compose colorf color1 = tempcolor colorf = compose(color1,blend(color1,mergedarken(color1,color2),@am),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif else colorf = gradient(0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else colorf = gradient(0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = gradient(colrT[it]/2) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else if @reflect == true if lr != 0 ; compose reflection color1 = blend(colorMap[rangeNumR,1], blend(colorMap[rangeNumR,0],@hcolor,hvalR^@hrblend), colorPosR^@rblend) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) tempcolor = blend(color1,color2,1-@blendval) ; compose shadow color1 = blend(colorMap[rangeNum,1], hsl(hue(colorMap[rangeNum,0]), sat(colorMap[rangeNum,0]), 0.5-@am/2), @am) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) color2 = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) ; compose colorf color1 = tempcolor colorf = compose(color1,blend(color1,mergedarken(color1,color2),@am),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif else color1 = blend(colorMap[rangeNum,1], hsl(hue(colorMap[rangeNum,0]), sat(colorMap[rangeNum,0]), 0.5-@am/2), @am) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif else color1 = blend(colorMap[rangeNum,1], hsl(hue(colorMap[rangeNum,0]), sat(colorMap[rangeNum,0]), 0.5-@am/2), @am) color2 = blend(colorMap[rangeNum,1], blend(colorMap[rangeNum,0],@hcolor,hval^@hblend), colorPos^@cblend) colorf = compose(color1,blend(color2,mergedarken(color1,color2),alpha(color1)),1.0) colorf = blend(colorf,rgb(0,0,0),lds/@sdis) if @tparent it = jt color colorlayer = rgba(0,0,0,1) color colorlayer2 = rgba(0,0,0,0) while it >= 0 if ltt[it] !=0 colorft[it] = blend(colorMap[rangeNumT[it],1], blend(colorMap[rangeNumT[it],0],@hcolor,hvalt[it]^@hrblendt), colorPosT[it]^@rblendt) colorft[it] = blend(colorft[it],rgb(0,0,0),ldst[it]/@sdis) if @tmerge == "Normal" colorlayer = compose(colorlayer, blend(colorft[it], mergenormal(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Screen" colorlayer = compose(colorlayer, blend(colorft[it], mergescreen(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Hard Light" colorlayer = compose(colorlayer, blend(colorft[it], mergehardlight(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Lighten" colorlayer = compose(colorlayer, blend(colorft[it], mergelighten(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) elseif @tmerge == "Addition" colorlayer = compose(colorlayer, blend(colorft[it], mergeaddition(colorlayer, colorft[it]), alpha(colorlayer)), (1-@tparentval)) endif else colorlayer2 = compose(colorlayer2, blend(colorft[it], mergenormal(colorlayer2, colorft[it]), alpha(colorlayer2)), (1.001-@tparentval)) endif it = it - 1 endwhile colorlayer = colorlayer+colorlayer2*krft colorf = blend(colorlayer,colorf,1-@tparentval) endif endif endif endif endif endif ; have floor fade according to lighting model ltfac = ld/@dis if ld == 1234567890 ltfac = 0 elseif ltfac < 0 ltfac = 0 elseif ltfac > 1 ltfac = 1 endif If ltfac+am2 > 1 ltfac = 1-am2 endif ; have floor reflection fade according to lighting model ltfacr = tdr/td/@floorreflect if lds == 1234567890 ltfacr = 0 elseif ltfacr < 0 ltfacr = 0 elseif ltfacr > 1 ltfacr = 1 endif if ltfacr>krf ltfacr = krf endif ; ltfacr = ltfacr*ltfac ; apply floor and floor reflection coloring if @reflect == true && tdr > 0 && tdr < ro if @flrtype == "Checkerboard" if floormodr == 0 colorf = blend(colorf,@flrcolor,krf-ltfacr) else colorf = blend(colorf,@flrcolor2,krf-ltfacr) endif elseif @flrtype == "Plain" colorf = blend(colorf,@flrcolor,krf-ltfacr) else if fractalmodr == 0 fractalcolor = @icolor colorf = blend(colorf,fractalcolor,krf-ltfacr) else fractalcolor = gradient((fractalmodr/mxi)^@spread+@shift) colorf = blend(colorf,fractalcolor,krf-ltfacr) endif endif endif if d > td && td > 0 && ltfac >= 0 if @flrtype == "Checkerboard" if floormod == 0 colorf = blend(@flrcolor,rgb(0,0,0),ltfac+am2) elseif floormod == 1 colorf = blend(@flrcolor2,rgb(0,0,0),ltfac+am2) endif elseif @flrtype == "Plain" colorf = blend(@flrcolor,rgb(0,0,0),ltfac+am2) else if fractalmod == 0 fractalcolor = @icolor colorf = blend(fractalcolor,rgb(0,0,0),ltfac+am2) ; colorf = blend(colorf,rgb(0,0,0),am2) elseif fractalmod == -1 && @solid #solid = true else fractalcolor = gradient((fractalmod/mxi)^@spread+@shift) colorf = blend(fractalcolor,rgb(0,0,0),ltfac+am2) ; colorf = blend(colorf,rgb(0,0,0),am2) endif endif endif if @reflectf && @floor && rof != 1e10 && d > td if @colorPreset == "Gradient" color1 = gradient(colrRF/2) else color1 = blend(colorMap[rangeNumRF,1], blend(colorMap[rangeNumRF,0], \ @hcolor,hvalRF), colorPosRF) endif colorf = blend(color1, colorf,(1-@blendvalf)) endif #color = blend(colorf, amcolor, ambient) default: param version caption = "Formula Version" default = 280 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam $ifdef VER40 heading text="Derived from the public C code of Curtis McMullen. \ Direct coloring methods provided by \ Ken Childress. \ Use with Pixel in mt.ufm or Pixel Offset in \ reb.ufm" endheading $else heading caption="Kleinian Cusp Raytrace" endheading heading caption="Derived from the public C code " endheading heading caption="of Curtis McMullen." endheading heading caption="Direct coloring methods provided by" endheading heading caption="Ken Childress." endheading heading caption="Use with Pixel formula in mt.ufm" endheading $endif render=false title="Kleinian Cusp Raytrace" param solid caption="solid background?" default=false visible= !@floor||@applymapping||@fbound || @mask || @rmask endparam param applyMapping caption = "Apply Mapping" default = false endparam param cusptype caption = "Cusp Type" default = 0 enum = "Nearby Group" "0/1 Cusp (Apollo)" "1/1 Cusp" "1/2 Cusp" \ "1/15 Cusp" "Grandma's Special" \ "Slice" endparam param showcusp caption = "Cusp view" default = 0 enum = "Both" "Standard" "Alternate" visible = (@cusptype == "1/15 Cusp" || @cusptype == "1/1 Cusp" ||\ @cusptype == "1/2 Cusp"\ ||@cusptype == "0/1 cusp (Apollo)") && @version >= 250 endparam complex param ta caption = "Trace a" default = (1.95,0.02) visible = @cusptype == "Grandma's Special" endparam complex param tb caption = "Trace b" default = (3,0) visible = @cusptype == "Grandma's Special" endparam complex param tas caption = "Trace a" default = (-1,1) visible = @cusptype == "Slice" endparam complex param tbs caption = "Trace b" default = (2,0) visible = @cusptype == "Slice" endparam bool param trans caption = "Transpose transform" default = false visible = @cusptype != "0/1 Cusp (Apollo)" && @cusptype != "1/1 Cusp" \ && @cusptype != "1/2 Cusp" endparam bool param sphere caption = "Map to Riemann" default = false endparam float param sphrad caption = "Riemann Radius" default = 1.5 visible = @sphere endparam $ifdef VER40 heading text="The actual number of iterations may be less than \ 'Max Iters' if all new generations are smaller \ than the 'Smallest Circle' setting." endheading $endif param level caption = "Max Iters" default = 100 min = 1 endparam $ifdef VER40 heading text="Decreasing 'Smallest Circle' will increase the \ amount of detail, but rending speed will decrease." endheading $endif param scircle caption = "Smallest Circle" default = 0.001 endparam param scirclev caption = "Smallest View Circle" default = 0.001 endparam param maxrad caption = "Largest Circle" default = 0.6 endparam $ifdef VER40 heading text = "Use 'Magnification' below in place of 'Magnification on \ the Location Tab." endheading $endif param ascale caption = "Magnification" default = 1.0 endparam $ifdef VER40 heading caption = "Rotations & Translations" expanded = false endheading heading text = "Z Rotation is on the Location Tab." endheading $else heading caption = "Rotations & Translations" endheading heading caption = "Z Rotation is on the" endheading heading caption = "Location Tab." endheading $endif param xangle caption = "X Axis Rotation" default = 0.0 hint = "This is the fixed (horizontal) Y Axis. It is performed \ after the normal fractal rotation(s) and zooms." endparam param zangle caption = "Y Axis Rotation" default = 0.0 hint = "This is the fixed (vertical) Y Axis. It is performed \ after the normal fractal rotation(s) and zooms." endparam param rotoffx caption = "Rotation Center X Offset" default = 0.0 endparam param rotoffy caption = "Rotation Center Y Offset" default = 0.0 endparam param rotoffz caption = "Rotation Center Z Offset" default = 0.0 endparam param transx caption = "X Final Translation" default = 0.0 endparam param transy caption = "Y Final Translation" default = -0.15 endparam param transz caption = "Z Final Translation" default = 0.0 endparam ;-------------------------------------------------------------------- ; Color Settings ;-------------------------------------------------------------------- heading caption = "Color Settings" endheading param colorPreset caption = "Color Preset" enum = "Gradient" "Custom" "Generate" "Default" "Default 12" \ "Default 16" "Default 24" "Color Wheel 12" "Alhambra 8" \ "Belvedere 8" "Bouquet 8" "Color Switch 8" "Evening Sky 8" \ "Fantasia 8" "Flowering Orchard 8" "Morning Sky 8" "Pastel 8" \ "Pastel Rainbow 8" "Showtime 8" "Soleil 8" "Chill 8" \ "Cloud Nine 8" "La Terra 8" "Santa Fe 8" "Spring 8" "Summer 8" \ "Fall 8" "Winter 8" "Mojave 8" "Gold/Green 8" "Gold/Green Alt 8" \ "Gold/Silver 8" "Gold/Silver Alt 8" "Purple/Yellow 8" \ "Purple/Yellow Alt 8" "Silver/Blue 8" "Silver/Blue Alt 8" \ "Fourth of July 3" "Blue/Silver 2" "Blue/White 2" "Cyan/Magenta 2" \ "Cyan/Yellow 2" "Gold/Green 2" "Purple/Yellow 2" "Red/Tan 2" default = 2 hint = "Use 'Gradient' for colors from the gradient. \ Use 'Custom' to set your own color ranges. \ Use 'Default' for the default colors. \ Use 'Generate' to create 3D-like colors from the \ gradient (allows using the gradient randomize function). \ Use any of the other predefined settings for those colors." endparam param customize caption = "Show/Customize" default = false hint = "Check to customize the selected color preset. NOTE: If you \ modify the default values for any of the range(s), you cannot \ get back to the default values for the range(s) you modify \ unless you reload the UCL." visible = (@colorPreset != "Gradient") && (@colorPreset != "Generate") \ && (@colorPreset != "Custom") endparam ;-------------------------------------------------------------------- ; Color Defaults for Custom ;-------------------------------------------------------------------- heading caption = " Custom Color Settings" visible = (@colorPreset == "Custom") endheading color param colorMax1 caption = "Color Range 1 High" default = rgb(255/255,0/255,211/255) hint = "Specifies the color at the high end of Range #1." visible = (@colorPreset == "Custom") endparam color param colorMin1 caption = "Color Range 1 Low" default = rgb(104/255,0/255,64/255) hint = "Specifies the color at the low end of Range #1." visible = (@colorPreset == "Custom") endparam color param colorMax2 caption = "Color Range 2 High" default = rgb(255/255,0/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@colorRanges >= 2) && (@colorPreset == "Custom") endparam color param colorMin2 caption = "Color Range 2 Low" default = rgb(92/255,0/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@colorRanges >= 2) && (@colorPreset == "Custom") endparam color param colorMax3 caption = "Color Range 3 High" default = rgb(255/255,118/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@colorRanges >= 3) && (@colorPreset == "Custom") endparam color param colorMin3 caption = "Color Range 3 Low" default = rgb(100/255,36/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@colorRanges >= 3) && (@colorPreset == "Custom") endparam color param colorMax4 caption = "Color Range 4 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@colorRanges >= 4) && (@colorPreset == "Custom") endparam color param colorMin4 caption = "Color Range 4 Low" default = rgb(92/255,61/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@colorRanges >= 4) && (@colorPreset == "Custom") endparam color param colorMax5 caption = "Color Range 5 High" default = rgb(0/255,255/255,55/255) hint = "Specifies the color at the high end of Range #5." visible = (@colorRanges >= 5) && (@colorPreset == "Custom") endparam color param colorMin5 caption = "Color Range 5 Low" default = rgb(0/255,78/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@colorRanges >= 5) && (@colorPreset == "Custom") endparam color param colorMax6 caption = "Color Range 6 High" default = rgb(0/255,255/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@colorRanges >= 6) && (@colorPreset == "Custom") endparam color param colorMin6 caption = "Color Range 6 Low" default = rgb(0/255,71/255,74/255) hint = "Specifies the color at the low end of Range #6." visible = (@colorRanges >= 6) && (@colorPreset == "Custom") endparam color param colorMax7 caption = "Color Range 7 High" default = rgb(0/255,90/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@colorRanges >= 7) && (@colorPreset == "Custom") endparam color param colorMin7 caption = "Color Range 7 Low" default = rgb(0/255,0/255,102/255) hint = "Specifies the color at the low end of Range #7." visible = (@colorRanges >= 7) && (@colorPreset == "Custom") endparam color param colorMax8 caption = "Color Range 8 High" default = rgb(175/255,0/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@colorRanges >= 8) && (@colorPreset == "Custom") endparam color param colorMin8 caption = "Color Range 8 Low" default = rgb(57/255,0/255,86/255) hint = "Specifies the color at the low end of Range #8." visible = (@colorRanges >= 8) && (@colorPreset == "Custom") endparam color param customMax9 caption = "Color Range 9 High" default = rgb(255/255,0/255,134/255) hint = "Specifies the color at the high end of Range #9." visible = (@colorRanges >= 9) && (@colorPreset == "Custom") endparam color param customMin9 caption = "Color Range 9 Low" default = rgb(106/255,0/255,55/255) hint = "Specifies the color at the low end of Range #9." visible = (@colorRanges >= 9) && (@colorPreset == "Custom") endparam color param customMax10 caption = "Color Range 10 High" default = rgb(255/255,54/255,0/255) hint = "Specifies the color at the high end of Range #10." visible = (@colorRanges >= 10) && (@colorPreset == "Custom") endparam color param customMin10 caption = "Color Range 10 Low" default = rgb(94/255,18/255,0/255) hint = "Specifies the color at the low end of Range #10." visible = (@colorRanges >= 10) && (@colorPreset == "Custom") endparam color param customMax11 caption = "Color Range 11 High" default = rgb(255/255,157/255,0/255) hint = "Specifies the color at the high end of Range #11." visible = (@colorRanges >= 11) && (@colorPreset == "Custom") endparam color param customMin11 caption = "Color Range 11 Low" default = rgb(90/255,40/255,0/255) hint = "Specifies the color at the low end of Range #11." visible = (@colorRanges >= 11) && (@colorPreset == "Custom") endparam color param customMax12 caption = "Color Range 12 High" default = rgb(229/255,255/255,0/255) hint = "Specifies the color at the high end of Range #12." visible = (@colorRanges >= 12) && (@colorPreset == "Custom") endparam color param customMin12 caption = "Color Range 12 Low" default = rgb(68/255,68/255,0/255) hint = "Specifies the color at the low end of Range #12." visible = (@colorRanges >= 12) && (@colorPreset == "Custom") endparam color param customMax13 caption = "Color Range 13 High" default = rgb(0/255,255/255,136/255) hint = "Specifies the color at the high end of Range #13." visible = (@colorRanges >= 13) && (@colorPreset == "Custom") endparam color param customMin13 caption = "Color Range 13 Low" default = rgb(0/255,66/255,30/255) hint = "Specifies the color at the low end of Range #13." visible = (@colorRanges >= 13) && (@colorPreset == "Custom") endparam color param customMax14 caption = "Color Range 14 High" default = rgb(0/255,212/255,255/255) hint = "Specifies the color at the high end of Range #14." visible = (@colorRanges >= 14) && (@colorPreset == "Custom") endparam color param customMin14 caption = "Color Range 14 Low" default = rgb(0/255,57/255,82/255) hint = "Specifies the color at the low end of Range #14." visible = (@colorRanges >= 14) && (@colorPreset == "Custom") endparam color param customMax15 caption = "Color Range 15 High" default = rgb(92/255,77/255,255/255) hint = "Specifies the color at the high end of Range #15." visible = (@colorRanges >= 15) && (@colorPreset == "Custom") endparam color param customMin15 caption = "Color Range 15 Low" default = rgb(28/255,0/255,94/255) hint = "Specifies the color at the low end of Range #15." visible = (@colorRanges >= 15) && (@colorPreset == "Custom") endparam color param customMax16 caption = "Color Range 16 High" default = rgb(209/255,0/255,255/255) hint = "Specifies the color at the high end of Range #16." visible = (@colorRanges >= 16) && (@colorPreset == "Custom") endparam color param customMin16 caption = "Color Range 16 Low" default = rgb(69/255,0/255,82/255) hint = "Specifies the color at the low end of Range #16." visible = (@colorRanges >= 16) && (@colorPreset == "Custom") endparam color param customMax17 caption = "Color Range 17 High" default = rgb(255/255,0/255,255/255) hint = "Specifies the color at the high end of Range #17." visible = (@colorRanges >= 17) && (@colorPreset == "Custom") endparam color param customMin17 caption = "Color Range 17 Low" default = rgb(84/255,0/255,84/255) hint = "Specifies the color at the low end of Range #17." visible = (@colorRanges >= 17) && (@colorPreset == "Custom") endparam color param customMax18 caption = "Color Range 18 High" default = rgb(255/255,35/255,88/255) hint = "Specifies the color at the high end of Range #18." visible = (@colorRanges >= 18) && (@colorPreset == "Custom") endparam color param customMin18 caption = "Color Range 18 Low" default = rgb(92/255,0/255,31/255) hint = "Specifies the color at the low end of Range #18." visible = (@colorRanges >= 18) && (@colorPreset == "Custom") endparam color param customMax19 caption = "Color Range 19 High" default = rgb(255/255,85/255,0/255) hint = "Specifies the color at the high end of Range #19." visible = (@colorRanges >= 19) && (@colorPreset == "Custom") endparam color param customMin19 caption = "Color Range 19 Low" default = rgb(92/255,26/255,0/255) hint = "Specifies the color at the low end of Range #19." visible = (@colorRanges >= 19) && (@colorPreset == "Custom") endparam color param customMax20 caption = "Color Range 20 High" default = rgb(255/255,203/255,0/255) hint = "Specifies the color at the high end of Range #20." visible = (@colorRanges >= 20) && (@colorPreset == "Custom") endparam color param customMin20 caption = "Color Range 20 Low" default = rgb(82/255,54/255,0/255) hint = "Specifies the color at the low end of Range #20." visible = (@colorRanges >= 20) && (@colorPreset == "Custom") endparam color param customMax21 caption = "Color Range 21 High" default = rgb(191/255,255/255,0/255) hint = "Specifies the color at the high end of Range #21." visible = (@colorRanges >= 21) && (@colorPreset == "Custom") endparam color param customMin21 caption = "Color Range 21 Low" default = rgb(32/255,64/255,0/255) hint = "Specifies the color at the low end of Range #21." visible = (@colorRanges >= 21) && (@colorPreset == "Custom") endparam color param customMax22 caption = "Color Range 22 High" default = rgb(0/255,255/255,203/255) hint = "Specifies the color at the high end of Range #22." visible = (@colorRanges >= 22) && (@colorPreset == "Custom") endparam color param customMin22 caption = "Color Range 22 Low" default = rgb(0/255,62/255,48/255) hint = "Specifies the color at the low end of Range #22." visible = (@colorRanges >= 22) && (@colorPreset == "Custom") endparam color param customMax23 caption = "Color Range 23 High" default = rgb(0/255,153/255,255/255) hint = "Specifies the color at the high end of Range #23." visible = (@colorRanges >= 23) && (@colorPreset == "Custom") endparam color param customMin23 caption = "Color Range 23 Low" default = rgb(0/255,37/255,104/255) hint = "Specifies the color at the low end of Range #23." visible = (@colorRanges >= 23) && (@colorPreset == "Custom") endparam color param customMax24 caption = "Color Range 24 High" default = rgb(131/255,67/255,255/255) hint = "Specifies the color at the high end of Range #24." visible = (@colorRanges >= 24) && (@colorPreset == "Custom") endparam color param customMin24 caption = "Color Range 24 Low" default = rgb(57/255,0/255,112/255) hint = "Specifies the color at the low end of Range #24." visible = (@colorRanges >= 24) && (@colorPreset == "Custom") endparam ;-------------------------------------------------------------------- ; Color Defaults for Default ;-------------------------------------------------------------------- heading caption = " Default Settings" visible = (@customize && @colorPreset == "Default") endheading color param defaultMax1 caption = "Color Range 1 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin1 caption = "Color Range 1 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax2 caption = "Color Range 2 High" default = rgb(252/255,0/255,172/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin2 caption = "Color Range 2 Low" default = rgb(96/255,0/255,32/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax3 caption = "Color Range 3 High" default = rgb(252/255,32/255,32/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin3 caption = "Color Range 3 Low" default = rgb(96/255,0/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax4 caption = "Color Range 4 High" default = rgb(252/255,128/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin4 caption = "Color Range 4 Low" default = rgb(160/255,16/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax5 caption = "Color Range 5 High" default = rgb(252/255,252/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin5 caption = "Color Range 5 Low" default = rgb(152/255,64/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax6 caption = "Color Range 6 High" default = rgb(0/255,252/255,128/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin6 caption = "Color Range 6 Low" default = rgb(0/255,48/255,16/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax7 caption = "Color Range 7 High" default = rgb(0/255,252/255,252/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin7 caption = "Color Range 7 Low" default = rgb(0/255,48/255,48/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Default") endparam color param defaultMax8 caption = "Color Range 8 High" default = rgb(64/255,64/255,252/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Default") endparam color param defaultMin8 caption = "Color Range 8 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Default") endparam ;-------------------------------------------------------------------- ; Color Defaults for Default 12 ;-------------------------------------------------------------------- heading caption = " Default 12 Color Settings" visible = (@customize && @colorPreset == "Default 12") endheading color param default12Max1 caption = "Color Range 1 High" default = rgb(255/255,85/255,253/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min1 caption = "Color Range 1 Low" default = rgb(98/255,0/255,76/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max2 caption = "Color Range 2 High" default = rgb(252/255,0/255,143/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min2 caption = "Color Range 2 Low" default = rgb(98/255,0/255,54/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max3 caption = "Color Range 3 High" default = rgb(255/255,32/255,32/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min3 caption = "Color Range 3 Low" default = rgb(96/255,0/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max4 caption = "Color Range 4 High" default = rgb(255/255,97/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min4 caption = "Color Range 4 Low" default = rgb(104/255,27/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max5 caption = "Color Range 5 High" default = rgb(255/255,187/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min5 caption = "Color Range 5 Low" default = rgb(110/255,54/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max6 caption = "Color Range 6 High" default = rgb(255/255,248/255,0/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min6 caption = "Color Range 6 Low" default = rgb(102/255,60/255,6/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max7 caption = "Color Range 7 High" default = rgb(0/255,255/255,58/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min7 caption = "Color Range 7 Low" default = rgb(0/255,76/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max8 caption = "Color Range 8 High" default = rgb(0/255,255/255,205/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min8 caption = "Color Range 8 Low" default = rgb(0/255,89/255,64/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max9 caption = "Color Range 9 High" default = rgb(0/255,194/255,255/255) hint = "Specifies the color at the high end of Range #9." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min9 caption = "Color Range 9 Low" default = rgb(0/255,80/255,92/255) hint = "Specifies the color at the low end of Range #9." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max10 caption = "Color Range 10 High" default = rgb(35/255,109/255,255/255) hint = "Specifies the color at the high end of Range #10." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min10 caption = "Color Range 10 Low" default = rgb(0/255,4/255,102/255) hint = "Specifies the color at the low end of Range #10." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max11 caption = "Color Range 11 High" default = rgb(149/255,53/255,255/255) hint = "Specifies the color at the high end of Range #11." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min11 caption = "Color Range 11 Low" default = rgb(53/255,0/255,96/255) hint = "Specifies the color at the low end of Range #11." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Max12 caption = "Color Range 12 High" default = rgb(195/255,0/255,252/255) hint = "Specifies the color at the high end of Range #12." visible = (@customize && @colorPreset == "Default 12") endparam color param default12Min12 caption = "Color Range 12 Low" default = rgb(58/255,0/255,84/255) hint = "Specifies the color at the low end of Range #12." visible = (@customize && @colorPreset == "Default 12") endparam ;-------------------------------------------------------------------- ; Color Defaults for Default 16 ;-------------------------------------------------------------------- heading caption = " Default 16 Color Settings" visible = (@customize && @colorPreset == "Default 16") endheading color param default16Max1 caption = "Color Range 1 High" default = rgb(255/255,31/255,114/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min1 caption = "Color Range 1 Low" default = rgb(94/255,0/255,40/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max2 caption = "Color Range 2 High" default = rgb(255/255,0/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min2 caption = "Color Range 2 Low" default = rgb(92/255,0/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max3 caption = "Color Range 3 High" default = rgb(255/255,78/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min3 caption = "Color Range 3 Low" default = rgb(88/255,27/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max4 caption = "Color Range 4 High" default = rgb(255/255,110/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min4 caption = "Color Range 4 Low" default = rgb(90/255,30/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max5 caption = "Color Range 5 High" default = rgb(255/255,187/255,31/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min5 caption = "Color Range 5 Low" default = rgb(88/255,38/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max6 caption = "Color Range 6 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min6 caption = "Color Range 6 Low" default = rgb(96/255,57/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max7 caption = "Color Range 7 High" default = rgb(170/255,255/255,37/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min7 caption = "Color Range 7 Low" default = rgb(41/255,68/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max8 caption = "Color Range 8 High" default = rgb(0/255,255/255,94/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min8 caption = "Color Range 8 Low" default = rgb(0/255,62/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max9 caption = "Color Range 9 High" default = rgb(0/255,238/255,203/255) hint = "Specifies the color at the high end of Range #9." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min9 caption = "Color Range 9 Low" default = rgb(0/255,64/255,54/255) hint = "Specifies the color at the low end of Range #9." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max10 caption = "Color Range 10 High" default = rgb(11/255,166/255,255/255) hint = "Specifies the color at the high end of Range #10." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min10 caption = "Color Range 10 Low" default = rgb(0/255,38/255,78/255) hint = "Specifies the color at the low end of Range #10." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max11 caption = "Color Range 11 High" default = rgb(0/255,68/255,255/255) hint = "Specifies the color at the high end of Range #11." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min11 caption = "Color Range 11 Low" default = rgb(0/255,20/255,88/255) hint = "Specifies the color at the low end of Range #11." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max12 caption = "Color Range 12 High" default = rgb(99/255,0/255,255/255) hint = "Specifies the color at the high end of Range #12." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min12 caption = "Color Range 12 Low" default = rgb(47/255,0/255,94/255) hint = "Specifies the color at the low end of Range #12." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max13 caption = "Color Range 13 High" default = rgb(145/255,0/255,255/255) hint = "Specifies the color at the high end of Range #13." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min13 caption = "Color Range 13 Low" default = rgb(69/255,0/255,102/255) hint = "Specifies the color at the low end of Range #13." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max14 caption = "Color Range 14 High" default = rgb(221/255,0/255,255/255) hint = "Specifies the color at the high end of Range #14." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min14 caption = "Color Range 14 Low" default = rgb(86/255,0/255,100/255) hint = "Specifies the color at the low end of Range #14." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max15 caption = "Color Range 15 High" default = rgb(255/255,0/255,255/255) hint = "Specifies the color at the high end of Range #15." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min15 caption = "Color Range 15 Low" default = rgb(90/255,0/255,75/255) hint = "Specifies the color at the low end of Range #15." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Max16 caption = "Color Range 16 High" default = rgb(255/255,0/255,140/255) hint = "Specifies the color at the high end of Range #16." visible = (@customize && @colorPreset == "Default 16") endparam color param default16Min16 caption = "Color Range 16 Low" default = rgb(96/255,0/255,60/255) hint = "Specifies the color at the low end of Range #16." visible = (@customize && @colorPreset == "Default 16") endparam ;-------------------------------------------------------------------- ; Color Defaults for Default 24 ;-------------------------------------------------------------------- heading caption = " Default 24 Color Settings" visible = (@customize && @colorPreset == "Default 24") endheading color param default24Max1 caption = "Color Range 1 High" default = rgb(255/255,0/255,211/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min1 caption = "Color Range 1 Low" default = rgb(104/255,0/255,64/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max2 caption = "Color Range 2 High" default = rgb(255/255,0/255,134/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min2 caption = "Color Range 2 Low" default = rgb(106/255,0/255,55/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max3 caption = "Color Range 3 High" default = rgb(255/255,35/255,88/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min3 caption = "Color Range 3 Low" default = rgb(92/255,0/255,31/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max4 caption = "Color Range 4 High" default = rgb(255/255,0/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min4 caption = "Color Range 4 Low" default = rgb(92/255,0/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max5 caption = "Color Range 5 High" default = rgb(255/255,54/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min5 caption = "Color Range 5 Low" default = rgb(92/255,26/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max6 caption = "Color Range 6 High" default = rgb(255/255,85/255,0/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min6 caption = "Color Range 6 Low" default = rgb(96/255,27/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max7 caption = "Color Range 7 High" default = rgb(255/255,118/255,0/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min7 caption = "Color Range 7 Low" default = rgb(100/255,38/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max8 caption = "Color Range 8 High" default = rgb(255/255,157/255,0/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min8 caption = "Color Range 8 Low" default = rgb(90/255,40/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max9 caption = "Color Range 9 High" default = rgb(255/255,203/255,0/255) hint = "Specifies the color at the high end of Range #9." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min9 caption = "Color Range 9 Low" default = rgb(82/255,54/255,0/255) hint = "Specifies the color at the low end of Range #9." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max10 caption = "Color Range 10 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #10." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min10 caption = "Color Range 10 Low" default = rgb(92/255,61/255,0/255) hint = "Specifies the color at the low end of Range #10." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max11 caption = "Color Range 11 High" default = rgb(229/255,255/255,0/255) hint = "Specifies the color at the high end of Range #11." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min11 caption = "Color Range 11 Low" default = rgb(68/255,68/255,0/255) hint = "Specifies the color at the low end of Range #11." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max12 caption = "Color Range 12 High" default = rgb(191/255,255/255,0/255) hint = "Specifies the color at the high end of Range #12." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min12 caption = "Color Range 12 Low" default = rgb(32/255,64/255,0/255) hint = "Specifies the color at the low end of Range #12." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max13 caption = "Color Range 13 High" default = rgb(0/255,255/255,55/255) hint = "Specifies the color at the high end of Range #13." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min13 caption = "Color Range 13 Low" default = rgb(0/255,78/255,0/255) hint = "Specifies the color at the low end of Range #13." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max14 caption = "Color Range 14 High" default = rgb(0/255,255/255,136/255) hint = "Specifies the color at the high end of Range #14." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min14 caption = "Color Range 14 Low" default = rgb(0/255,66/255,30/255) hint = "Specifies the color at the low end of Range #14." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max15 caption = "Color Range 15 High" default = rgb(0/255,255/255,203/255) hint = "Specifies the color at the high end of Range #15." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min15 caption = "Color Range 15 Low" default = rgb(0/255,62/255,48/255) hint = "Specifies the color at the low end of Range #15." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max16 caption = "Color Range 16 High" default = rgb(0/255,255/255,255/255) hint = "Specifies the color at the high end of Range #16." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min16 caption = "Color Range 16 Low" default = rgb(0/255,71/255,74/255) hint = "Specifies the color at the low end of Range #16." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max17 caption = "Color Range 17 High" default = rgb(0/255,212/255,255/255) hint = "Specifies the color at the high end of Range #17." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min17 caption = "Color Range 17 Low" default = rgb(0/255,57/255,82/255) hint = "Specifies the color at the low end of Range #17." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max18 caption = "Color Range 18 High" default = rgb(0/255,153/255,255/255) hint = "Specifies the color at the high end of Range #18." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min18 caption = "Color Range 18 Low" default = rgb(0/255,37/255,104/255) hint = "Specifies the color at the low end of Range #18." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max19 caption = "Color Range 19 High" default = rgb(0/255,90/255,255/255) hint = "Specifies the color at the high end of Range #19." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min19 caption = "Color Range 19 Low" default = rgb(0/255,0/255,102/255) hint = "Specifies the color at the low end of Range #19." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max20 caption = "Color Range 20 High" default = rgb(92/255,77/255,255/255) hint = "Specifies the color at the high end of Range #20." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min20 caption = "Color Range 20 Low" default = rgb(28/255,0/255,94/255) hint = "Specifies the color at the low end of Range #20." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max21 caption = "Color Range 21 High" default = rgb(131/255,67/255,255/255) hint = "Specifies the color at the high end of Range #21." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min21 caption = "Color Range 21 Low" default = rgb(57/255,0/255,112/255) hint = "Specifies the color at the low end of Range #21." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max22 caption = "Color Range 22 High" default = rgb(175/255,0/255,255/255) hint = "Specifies the color at the high end of Range #22." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min22 caption = "Color Range 22 Low" default = rgb(57/255,0/255,86/255) hint = "Specifies the color at the low end of Range #22." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max23 caption = "Color Range 23 High" default = rgb(209/255,0/255,255/255) hint = "Specifies the color at the high end of Range #23." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min23 caption = "Color Range 23 Low" default = rgb(64/255,0/255,76/255) hint = "Specifies the color at the low end of Range #23." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Max24 caption = "Color Range 24 High" default = rgb(255/255,0/255,255/255) hint = "Specifies the color at the high end of Range #24." visible = (@customize && @colorPreset == "Default 24") endparam color param default24Min24 caption = "Color Range 24 Low" default = rgb(84/255,0/255,84/255) hint = "Specifies the color at the low end of Range #24." visible = (@customize && @colorPreset == "Default 24") endparam ;-------------------------------------------------------------------- ; Color Defaults for Color Wheel 12 ;-------------------------------------------------------------------- heading caption = " Color Wheel 12 Settings" visible = (@customize && @colorPreset == "Color Wheel 12") endheading color param colorWheel12Max1 caption = "Color Range 1 High" default = rgb(142/255,117/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min1 caption = "Color Range 1 Low" default = rgb(52/255,0/255,100/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max2 caption = "Color Range 2 High" default = rgb(224/255,9/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min2 caption = "Color Range 2 Low" default = rgb(86/255,0/255,84/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max3 caption = "Color Range 3 High" default = rgb(255/255,32/255,32/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min3 caption = "Color Range 3 Low" default = rgb(92/255,0/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max4 caption = "Color Range 4 High" default = rgb(252/255,167/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min4 caption = "Color Range 4 Low" default = rgb(95/255,54/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max5 caption = "Color Range 5 High" default = rgb(190/255,255/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min5 caption = "Color Range 5 Low" default = rgb(63/255,84/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max6 caption = "Color Range 6 High" default = rgb(0/255,231/255,213/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min6 caption = "Color Range 6 Low" default = rgb(4/255,62/255,62/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max7 caption = "Color Range 7 High" default = rgb(182/255,27/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min7 caption = "Color Range 7 Low" default = rgb(53/255,0/255,92/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max8 caption = "Color Range 8 High" default = rgb(255/255,33/255,146/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min8 caption = "Color Range 8 Low" default = rgb(80/255,0/255,53/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max9 caption = "Color Range 9 High" default = rgb(255/255,110/255,0/255) hint = "Specifies the color at the high end of Range #9." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min9 caption = "Color Range 9 Low" default = rgb(101/255,25/255,21/255) hint = "Specifies the color at the low end of Range #9." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max10 caption = "Color Range 10 High" default = rgb(255/255,241/255,0/255) hint = "Specifies the color at the high end of Range #10." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min10 caption = "Color Range 10 Low" default = rgb(88/255,69/255,0/255) hint = "Specifies the color at the low end of Range #10." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max11 caption = "Color Range 11 High" default = rgb(0/255,248/255,103/255) hint = "Specifies the color at the high end of Range #11." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min11 caption = "Color Range 11 Low" default = rgb(0/255,83/255,15/255) hint = "Specifies the color at the low end of Range #11." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Max12 caption = "Color Range 12 High" default = rgb(27/255,119/255,255/255) hint = "Specifies the color at the high end of Range #12." visible = (@customize && @colorPreset == "Color Wheel 12") endparam color param colorWheel12Min12 caption = "Color Range 12 Low" default = rgb(0/255,31/255,92/255) hint = "Specifies the color at the low end of Range #12." visible = (@customize && @colorPreset == "Color Wheel 12") endparam ;-------------------------------------------------------------------- ; Color Defaults for Alhambra 8 ;-------------------------------------------------------------------- heading caption = " Alhambra 8 Settings" visible = (@customize && @colorPreset == "Alhambra 8") endheading color param alhambra8Max1 caption = "Color Range 1 High" default = rgb(15/255,222/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min1 caption = "Color Range 1 Low" default = rgb(0/255,43/255,52/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max2 caption = "Color Range 2 High" default = rgb(255/255,204/255,75/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min2 caption = "Color Range 2 Low" default = rgb(92/255,58/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max3 caption = "Color Range 3 High" default = rgb(188/255,152/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min3 caption = "Color Range 3 Low" default = rgb(41/255,0/255,70/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max4 caption = "Color Range 4 High" default = rgb(255/255,155/255,109/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min4 caption = "Color Range 4 Low" default = rgb(95/255,36/255,14/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max5 caption = "Color Range 5 High" default = rgb(121/255,180/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min5 caption = "Color Range 5 Low" default = rgb(0/255,47/255,91/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max6 caption = "Color Range 6 High" default = rgb(255/255,131/255,126/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min6 caption = "Color Range 6 Low" default = rgb(104/255,20/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max7 caption = "Color Range 7 High" default = rgb(33/255,255/255,220/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min7 caption = "Color Range 7 Low" default = rgb(0/255,67/255,49/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Max8 caption = "Color Range 8 High" default = rgb(255/255,177/255,93/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Alhambra 8") endparam color param alhambra8Min8 caption = "Color Range 8 Low" default = rgb(100/255,44/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Alhambra 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Belvedere 8 ;-------------------------------------------------------------------- heading caption = " Belvedere 8 Settings" visible = (@customize && @colorPreset == "Belvedere 8") endheading color param belvedere8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min1 caption = "Color Range 1 Low" default = rgb(92/255,92/255,122/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min2 caption = "Color Range 2 Low" default = rgb(92/255,92/255,122/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max3 caption = "Color Range 3 High" default = rgb(123/255,201/255,254/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min3 caption = "Color Range 3 Low" default = rgb(0/255,45/255,68/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max4 caption = "Color Range 4 High" default = rgb(255/255,230/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min4 caption = "Color Range 4 Low" default = rgb(162/255,28/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max5 caption = "Color Range 5 High" default = rgb(255/255,230/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min5 caption = "Color Range 5 Low" default = rgb(162/255,28/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max6 caption = "Color Range 6 High" default = rgb(0/255,255/255,217/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min6 caption = "Color Range 6 Low" default = rgb(0/255,54/255,46/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max7 caption = "Color Range 7 High" default = rgb(255/255,20/255,70/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min7 caption = "Color Range 7 Low" default = rgb(100/255,0/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Max8 caption = "Color Range 8 High" default = rgb(95/255,84/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Belvedere 8") endparam color param belvedere8Min8 caption = "Color Range 8 Low" default = rgb(0/255,0/255,89/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Belvedere 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Bouquet 8 ;-------------------------------------------------------------------- heading caption = " Bouquet 8 Settings" visible = (@customize && @colorPreset == "Bouquet 8") endheading color param bouquet8Max1 caption = "Color Range 1 High" default = rgb(0/255,255/255,131/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min1 caption = "Color Range 1 Low" default = rgb(0/255,84/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max2 caption = "Color Range 2 High" default = rgb(52/255,255/255,198/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min2 caption = "Color Range 2 Low" default = rgb(0/255,82/255,60/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max3 caption = "Color Range 3 High" default = rgb(0/255,244/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min3 caption = "Color Range 3 Low" default = rgb(0/255,64/255,74/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max4 caption = "Color Range 4 High" default = rgb(180/255,169/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min4 caption = "Color Range 4 Low" default = rgb(40/255,12/255,64/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max5 caption = "Color Range 5 High" default = rgb(251/255,148/255,230/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min5 caption = "Color Range 5 Low" default = rgb(100/255,20/255,67/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max6 caption = "Color Range 6 High" default = rgb(255/255,101/255,140/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min6 caption = "Color Range 6 Low" default = rgb(84/255,15/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max7 caption = "Color Range 7 High" default = rgb(255/255,149/255,111/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min7 caption = "Color Range 7 Low" default = rgb(77/255,36/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Max8 caption = "Color Range 8 High" default = rgb(255/255,252/255,125/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Bouquet 8") endparam color param bouquet8Min8 caption = "Color Range 8 Low" default = rgb(95/255,65/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Bouquet 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Color Switch 8 ;-------------------------------------------------------------------- heading caption = " Color Switch 8 Settings" visible = (@customize && @colorPreset == "Color Switch 8") endheading color param colorSwitch8Max1 caption = "Color Range 1 High" default = rgb(255/255,33/255,52/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min1 caption = "Color Range 1 Low" default = rgb(90/255,0/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max2 caption = "Color Range 2 High" default = rgb(61/255,136/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min2 caption = "Color Range 2 Low" default = rgb(0/255,0/255,82/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max3 caption = "Color Range 3 High" default = rgb(0/255,255/255,44/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min3 caption = "Color Range 3 Low" default = rgb(0/255,70/255,7/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max4 caption = "Color Range 4 High" default = rgb(255/255,131/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min4 caption = "Color Range 4 Low" default = rgb(105/255,40/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max5 caption = "Color Range 5 High" default = rgb(255/255,27/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min5 caption = "Color Range 5 Low" default = rgb(104/255,0/255,78/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max6 caption = "Color Range 6 High" default = rgb(168/255,87/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min6 caption = "Color Range 6 Low" default = rgb(35/255,0/255,58/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max7 caption = "Color Range 7 High" default = rgb(0/255,252/255,252/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min7 caption = "Color Range 7 Low" default = rgb(0/255,60/255,60/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,38/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Color Switch 8") endparam color param colorSwitch8Min8 caption = "Color Range 8 Low" default = rgb(90/255,90/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Color Switch 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Evening Sky 8 ;-------------------------------------------------------------------- heading caption = " Evening Sky 8 Settings" visible = (@customize && @colorPreset == "Evening Sky 8") endheading color param eveningSky8Max1 caption = "Color Range 1 High" default = rgb(255/255,238/255,222/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min1 caption = "Color Range 1 Low" default = rgb(50/255,35/255,35/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max2 caption = "Color Range 2 High" default = rgb(255/255,226/255,85/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min2 caption = "Color Range 2 Low" default = rgb(85/255,54/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max3 caption = "Color Range 3 High" default = rgb(249/255,148/255,216/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min3 caption = "Color Range 3 Low" default = rgb(79/255,20/255,57/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max4 caption = "Color Range 4 High" default = rgb(159/255,159/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min4 caption = "Color Range 4 Low" default = rgb(22/255,16/255,54/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max5 caption = "Color Range 5 High" default = rgb(255/255,175/255,79/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min5 caption = "Color Range 5 Low" default = rgb(62/255,42/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max6 caption = "Color Range 6 High" default = rgb(124/255,190/255,251/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min6 caption = "Color Range 6 Low" default = rgb(13/255,40/255,62/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max7 caption = "Color Range 7 High" default = rgb(255/255,111/255,123/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min7 caption = "Color Range 7 Low" default = rgb(57/255,24/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Max8 caption = "Color Range 8 High" default = rgb(111/255,255/255,245/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Evening Sky 8") endparam color param eveningSky8Min8 caption = "Color Range 8 Low" default = rgb(0/255,60/255,64/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Evening Sky 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Fantasia 8 ;-------------------------------------------------------------------- heading caption = " Fantasia 8 Settings" visible = (@customize && @colorPreset == "Fantasia 8") endheading color param fantasia8Max1 caption = "Color Range 1 High" default = rgb(255/255,230/255,103/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min1 caption = "Color Range 1 Low" default = rgb(102/255,81/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max2 caption = "Color Range 2 High" default = rgb(230/255,78/255,208/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min2 caption = "Color Range 2 Low" default = rgb(104/255,0/255,52/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max3 caption = "Color Range 3 High" default = rgb(180/255,119/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min3 caption = "Color Range 3 Low" default = rgb(56/255,0/255,82/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max4 caption = "Color Range 4 High" default = rgb(0/255,228/255,150/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min4 caption = "Color Range 4 Low" default = rgb(0/255,50/255,30/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max5 caption = "Color Range 5 High" default = rgb(131/255,148/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min5 caption = "Color Range 5 Low" default = rgb(38/255,31/255,85/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max6 caption = "Color Range 6 High" default = rgb(255/255,182/255,0/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min6 caption = "Color Range 6 Low" default = rgb(76/255,40/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max7 caption = "Color Range 7 High" default = rgb(252/255,0/255,113/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min7 caption = "Color Range 7 Low" default = rgb(84/255,0/255,34/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Max8 caption = "Color Range 8 High" default = rgb(0/255,232/255,249/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Fantasia 8") endparam color param fantasia8Min8 caption = "Color Range 8 Low" default = rgb(0/255,64/255,78/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Fantasia 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Flowering Orchard 8 ;-------------------------------------------------------------------- heading caption = " Flowering Orchard 8 Settings" visible = (@customize && @colorPreset == "Flowering Orchard 8") endheading color param floweringOrchard8Max1 caption = "Color Range 1 High" default = rgb(255/255,188/255,213/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min1 caption = "Color Range 1 Low" default = rgb(132/255,30/255,66/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max2 caption = "Color Range 2 High" default = rgb(240/255,135/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min2 caption = "Color Range 2 Low" default = rgb(70/255,0/255,59/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max3 caption = "Color Range 3 High" default = rgb(255/255,75/255,153/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min3 caption = "Color Range 3 Low" default = rgb(104/255,15/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max4 caption = "Color Range 4 High" default = rgb(71/255,213/255,119/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min4 caption = "Color Range 4 Low" default = rgb(0/255,48/255,16/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max5 caption = "Color Range 5 High" default = rgb(255/255,102/255,209/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min5 caption = "Color Range 5 Low" default = rgb(116/255,10/255,86/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max6 caption = "Color Range 6 High" default = rgb(154/255,199/255,51/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min6 caption = "Color Range 6 Low" default = rgb(28/255,44/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max7 caption = "Color Range 7 High" default = rgb(255/255,162/255,228/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min7 caption = "Color Range 7 Low" default = rgb(110/255,0/255,55/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Max8 caption = "Color Range 8 High" default = rgb(255/255,201/255,237/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam color param floweringOrchard8Min8 caption = "Color Range 8 Low" default = rgb(145/255,20/255,54/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Flowering Orchard 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Morning Sky 8 ;-------------------------------------------------------------------- heading caption = " Morning Sky 8 Settings" visible = (@customize && @colorPreset == "Morning Sky 8") endheading color param morningSky8Max1 caption = "Color Range 1 High" default = rgb(255/255,178/255,217/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min1 caption = "Color Range 1 Low" default = rgb(79/255,29/255,57/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max2 caption = "Color Range 2 High" default = rgb(107/255,246/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min2 caption = "Color Range 2 Low" default = rgb(13/255,70/255,75/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max3 caption = "Color Range 3 High" default = rgb(255/255,199/255,137/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min3 caption = "Color Range 3 Low" default = rgb(62/255,42/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max4 caption = "Color Range 4 High" default = rgb(241/255,245/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min4 caption = "Color Range 4 Low" default = rgb(16/255,24/255,46/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max5 caption = "Color Range 5 High" default = rgb(255/255,177/255,188/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min5 caption = "Color Range 5 Low" default = rgb(54/255,14/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max6 caption = "Color Range 6 High" default = rgb(248/255,236/255,236/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min6 caption = "Color Range 6 Low" default = rgb(49/255,38/255,35/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max7 caption = "Color Range 7 High" default = rgb(129/255,201/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min7 caption = "Color Range 7 Low" default = rgb(0/255,56/255,70/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,146/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Morning Sky 8") endparam color param morningSky8Min8 caption = "Color Range 8 Low" default = rgb(89/255,76/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Morning Sky 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Pastel 8 ;-------------------------------------------------------------------- heading caption = " Pastel 8 Settings" visible = (@customize && @colorPreset == "Pastel 8") endheading color param pastel8Max1 caption = "Color Range 1 High" default = rgb(147/255,255/255,193/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min1 caption = "Color Range 1 Low" default = rgb(0/255,48/255,16/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max2 caption = "Color Range 2 High" default = rgb(147/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min2 caption = "Color Range 2 Low" default = rgb(0/255,48/255,48/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max3 caption = "Color Range 3 High" default = rgb(148/255,148/255,253/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min3 caption = "Color Range 3 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max4 caption = "Color Range 4 High" default = rgb(199/255,149/255,253/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min4 caption = "Color Range 4 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max5 caption = "Color Range 5 High" default = rgb(255/255,147/255,221/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min5 caption = "Color Range 5 Low" default = rgb(96/255,0/255,32/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max6 caption = "Color Range 6 High" default = rgb(254/255,148/255,148/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min6 caption = "Color Range 6 Low" default = rgb(96/255,0/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max7 caption = "Color Range 7 High" default = rgb(255/255,202/255,147/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min7 caption = "Color Range 7 Low" default = rgb(160/255,16/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,147/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Pastel 8") endparam color param pastel8Min8 caption = "Color Range 8 Low" default = rgb(152/255,64/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Pastel 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Pastel Rainbow 8 ;-------------------------------------------------------------------- heading caption = " Pastel Rainbow 8 Settings" visible = (@customize && @colorPreset == "Pastel Rainbow 8") endheading color param pastelRainbow8Max1 caption = "Color Range 1 High" default = rgb(242/255,246/255,174/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min1 caption = "Color Range 1 Low" default = rgb(20/255,48/255,12/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max2 caption = "Color Range 2 High" default = rgb(182/255,242/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min2 caption = "Color Range 2 Low" default = rgb(20/255,44/255,64/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max3 caption = "Color Range 3 High" default = rgb(202/255,202/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min3 caption = "Color Range 3 Low" default = rgb(36/255,36/255,48/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max4 caption = "Color Range 4 High" default = rgb(255/255,170/255,170/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min4 caption = "Color Range 4 Low" default = rgb(89/255,0/255,24/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max5 caption = "Color Range 5 High" default = rgb(255/255,246/255,178/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min5 caption = "Color Range 5 Low" default = rgb(40/255,0/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max6 caption = "Color Range 6 High" default = rgb(255/255,238/255,206/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min6 caption = "Color Range 6 Low" default = rgb(52/255,16/255,40/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max7 caption = "Color Range 7 High" default = rgb(214/255,222/255,161/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min7 caption = "Color Range 7 Low" default = rgb(4/255,32/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Max8 caption = "Color Range 8 High" default = rgb(255/255,230/255,246/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam color param pastelRainbow8Min8 caption = "Color Range 8 Low" default = rgb(70/255,50/255,64/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Pastel Rainbow 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Showtime 8 ;-------------------------------------------------------------------- heading caption = " Showtime 8 Settings" visible = (@customize && @colorPreset == "Showtime 8") endheading color param showtime8Max1 caption = "Color Range 1 High" default = rgb(241/255,53/255,82/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min1 caption = "Color Range 1 Low" default = rgb(88/255,0/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max2 caption = "Color Range 2 High" default = rgb(255/255,121/255,52/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min2 caption = "Color Range 2 Low" default = rgb(107/255,29/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max3 caption = "Color Range 3 High" default = rgb(253/255,168/255,67/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min3 caption = "Color Range 3 Low" default = rgb(97/255,42/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max4 caption = "Color Range 4 High" default = rgb(255/255,231/255,21/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min4 caption = "Color Range 4 Low" default = rgb(140/255,64/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max5 caption = "Color Range 5 High" default = rgb(58/255,219/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min5 caption = "Color Range 5 Low" default = rgb(0/255,36/255,83/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max6 caption = "Color Range 6 High" default = rgb(9/255,116/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min6 caption = "Color Range 6 Low" default = rgb(33/255,30/255,81/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max7 caption = "Color Range 7 High" default = rgb(105/255,71/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min7 caption = "Color Range 7 Low" default = rgb(36/255,0/255,76/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Max8 caption = "Color Range 8 High" default = rgb(187/255,32/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Showtime 8") endparam color param showtime8Min8 caption = "Color Range 8 Low" default = rgb(50/255,0/255,56/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Showtime 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Soleil 8 ;-------------------------------------------------------------------- heading caption = " Soleil 8 Settings" visible = (@customize && @colorPreset == "Soleil 8") endheading color param soleil8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,35/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min1 caption = "Color Range 1 Low" default = rgb(76/255,44/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max2 caption = "Color Range 2 High" default = rgb(255/255,209/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min2 caption = "Color Range 2 Low" default = rgb(59/255,24/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max3 caption = "Color Range 3 High" default = rgb(231/255,237/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min3 caption = "Color Range 3 Low" default = rgb(54/255,29/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max4 caption = "Color Range 4 High" default = rgb(255/255,141/255,49/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min4 caption = "Color Range 4 Low" default = rgb(92/255,32/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,156/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min5 caption = "Color Range 5 Low" default = rgb(76/255,44/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max6 caption = "Color Range 6 High" default = rgb(255/255,158/255,17/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min6 caption = "Color Range 6 Low" default = rgb(59/255,24/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max7 caption = "Color Range 7 High" default = rgb(255/255,255/255,217/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min7 caption = "Color Range 7 Low" default = rgb(76/255,41/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Max8 caption = "Color Range 8 High" default = rgb(255/255,184/255,53/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Soleil 8") endparam color param soleil8Min8 caption = "Color Range 8 Low" default = rgb(76/255,29/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Soleil 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Chill 8 ;-------------------------------------------------------------------- heading caption = " Chill 8 Settings" visible = (@customize && @colorPreset == "Chill 8") endheading color param chillMax1 caption = "Color Range 1 High" default = rgb(233/255,245/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin1 caption = "Color Range 1 Low" default = rgb(0/255,21/255,60/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax2 caption = "Color Range 2 High" default = rgb(182/255,201/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin2 caption = "Color Range 2 Low" default = rgb(0/255,0/255,76/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax3 caption = "Color Range 3 High" default = rgb(0/255,34/255,136/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin3 caption = "Color Range 3 Low" default = rgb(9/255,9/255,59/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax4 caption = "Color Range 4 High" default = rgb(0/255,75/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin4 caption = "Color Range 4 Low" default = rgb(0/255,0/255,25/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax5 caption = "Color Range 5 High" default = rgb(233/255,245/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin5 caption = "Color Range 5 Low" default = rgb(0/255,21/255,60/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax6 caption = "Color Range 6 High" default = rgb(182/255,201/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin6 caption = "Color Range 6 Low" default = rgb(0/255,0/255,76/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax7 caption = "Color Range 7 High" default = rgb(0/255,34/255,136/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin7 caption = "Color Range 7 Low" default = rgb(9/255,9/255,59/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMax8 caption = "Color Range 8 High" default = rgb(0/255,75/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Chill 8") endparam color param chillMin8 caption = "Color Range 8 Low" default = rgb(0/255,0/255,25/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Chill 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Cloud Nine 8 ;-------------------------------------------------------------------- heading caption = " Cloud Nine 8 Settings" visible = (@customize && @colorPreset == "Cloud Nine 8") endheading color param cloudNineMax1 caption = "Color Range 1 High" default = rgb(255/255,255/255,173/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin1 caption = "Color Range 1 Low" default = rgb(143/255,60/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax2 caption = "Color Range 2 High" default = rgb(247/255,214/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin2 caption = "Color Range 2 Low" default = rgb(139/255,0/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax3 caption = "Color Range 3 High" default = rgb(212/255,255/255,249/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin3 caption = "Color Range 3 Low" default = rgb(0/255,53/255,20/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax4 caption = "Color Range 4 High" default = rgb(255/255,221/255,217/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin4 caption = "Color Range 4 Low" default = rgb(115/255,21/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax5 caption = "Color Range 5 High" default = rgb(255/255,255/255,173/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin5 caption = "Color Range 5 Low" default = rgb(140/255,63/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax6 caption = "Color Range 6 High" default = rgb(247/255,214/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin6 caption = "Color Range 6 Low" default = rgb(139/255,0/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax7 caption = "Color Range 7 High" default = rgb(212/255,255/255,249/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin7 caption = "Color Range 7 Low" default = rgb(0/255,53/255,20/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMax8 caption = "Color Range 8 High" default = rgb(255/255,221/255,217/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam color param cloudNineMin8 caption = "Color Range 8 Low" default = rgb(115/255,21/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Cloud Nine 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for La Terra 8 ;-------------------------------------------------------------------- heading caption = " La Terra 8 Settings" visible = (@customize && @colorPreset == "La Terra 8") endheading color param laTerraMax1 caption = "Color Range 1 High" default = rgb(255/255,174/255,103/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin1 caption = "Color Range 1 Low" default = rgb(102/255,47/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax2 caption = "Color Range 2 High" default = rgb(255/255,242/255,39/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin2 caption = "Color Range 2 Low" default = rgb(100/255,58/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax3 caption = "Color Range 3 High" default = rgb(170/255,86/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin3 caption = "Color Range 3 Low" default = rgb(92/255,29/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax4 caption = "Color Range 4 High" default = rgb(190/255,118/255,13/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin4 caption = "Color Range 4 Low" default = rgb(84/255,41/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax5 caption = "Color Range 5 High" default = rgb(255/255,174/255,103/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin5 caption = "Color Range 5 Low" default = rgb(102/255,47/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax6 caption = "Color Range 6 High" default = rgb(255/255,242/255,39/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin6 caption = "Color Range 6 Low" default = rgb(100/255,58/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax7 caption = "Color Range 7 High" default = rgb(170/255,86/255,0/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin7 caption = "Color Range 7 Low" default = rgb(92/255,29/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMax8 caption = "Color Range 8 High" default = rgb(190/255,118/255,13/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "La Terra 8") endparam color param laTerraMin8 caption = "Color Range 8 Low" default = rgb(84/255,41/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "La Terra 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Santa Fe 8 ;-------------------------------------------------------------------- heading caption = " Santa Fe 8 Settings" visible = (@customize && @colorPreset == "Santa Fe 8") endheading color param santaFe8Max1 caption = "Color Range 1 High" default = rgb(255/255,235/255,76/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min1 caption = "Color Range 1 Low" default = rgb(122/255,52/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max2 caption = "Color Range 2 High" default = rgb(0/255,229/255,222/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min2 caption = "Color Range 2 Low" default = rgb(0/255,48/255,51/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max3 caption = "Color Range 3 High" default = rgb(255/255,200/255,140/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min3 caption = "Color Range 3 Low" default = rgb(82/255,21/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max4 caption = "Color Range 4 High" default = rgb(255/255,157/255,82/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min4 caption = "Color Range 4 Low" default = rgb(130/255,0/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max5 caption = "Color Range 5 High" default = rgb(255/255,235/255,76/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min5 caption = "Color Range 5 Low" default = rgb(122/255,52/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max6 caption = "Color Range 6 High" default = rgb(0/255,229/255,222/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min6 caption = "Color Range 6 Low" default = rgb(0/255,48/255,51/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max7 caption = "Color Range 7 High" default = rgb(255/255,200/255,140/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min7 caption = "Color Range 7 Low" default = rgb(82/255,21/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Max8 caption = "Color Range 8 High" default = rgb(255/255,157/255,82/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Santa Fe 8") endparam color param santaFe8Min8 caption = "Color Range 8 Low" default = rgb(130/255,0/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Santa Fe 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Spring 8 ;-------------------------------------------------------------------- heading caption = " Spring 8 Settings" visible = (@customize && @colorPreset == "Spring 8") endheading color param spring8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,145/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min1 caption = "Color Range 1 Low" default = rgb(110/255,65/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max2 caption = "Color Range 2 High" default = rgb(215/255,182/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min2 caption = "Color Range 2 Low" default = rgb(86/255,0/255,110/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max3 caption = "Color Range 3 High" default = rgb(189/255,246/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min3 caption = "Color Range 3 Low" default = rgb(0/255,51/255,54/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max4 caption = "Color Range 4 High" default = rgb(255/255,181/255,237/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min4 caption = "Color Range 4 Low" default = rgb(92/255,0/255,31/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,145/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min5 caption = "Color Range 5 Low" default = rgb(110/255,65/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max6 caption = "Color Range 6 High" default = rgb(215/255,182/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min6 caption = "Color Range 6 Low" default = rgb(86/255,0/255,110/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max7 caption = "Color Range 7 High" default = rgb(189/255,246/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min7 caption = "Color Range 7 Low" default = rgb(0/255,51/255,54/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Max8 caption = "Color Range 8 High" default = rgb(255/255,181/255,237/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Spring 8") endparam color param spring8Min8 caption = "Color Range 8 Low" default = rgb(92/255,0/255,31/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Spring 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Summer 8 ;-------------------------------------------------------------------- heading caption = " Summer 8 Settings" visible = (@customize && @colorPreset == "Summer 8") endheading color param summer8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min1 caption = "Color Range 1 Low" default = rgb(64/255,32/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max2 caption = "Color Range 2 High" default = rgb(255/255,64/255,64/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min2 caption = "Color Range 2 Low" default = rgb(64/255,0/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max3 caption = "Color Range 3 High" default = rgb(0/255,255/255,101/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min3 caption = "Color Range 3 Low" default = rgb(0/255,62/255,22/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max4 caption = "Color Range 4 High" default = rgb(64/255,255/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min4 caption = "Color Range 4 Low" default = rgb(0/255,0/255,64/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min5 caption = "Color Range 5 Low" default = rgb(64/255,32/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max6 caption = "Color Range 6 High" default = rgb(255/255,64/255,64/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min6 caption = "Color Range 6 Low" default = rgb(64/255,0/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max7 caption = "Color Range 7 High" default = rgb(0/255,255/255,101/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min7 caption = "Color Range 7 Low" default = rgb(0/255,62/255,22/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Max8 caption = "Color Range 8 High" default = rgb(64/255,255/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Summer 8") endparam color param summer8Min8 caption = "Color Range 8 Low" default = rgb(0/255,0/255,64/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Summer 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Fall 8 ;-------------------------------------------------------------------- heading caption = " Fall 8 Settings" visible = (@customize && @colorPreset == "Fall 8") endheading color param fall8Max1 caption = "Color Range 1 High" default = rgb(255/255,235/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min1 caption = "Color Range 1 Low" default = rgb(136/255,46/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max2 caption = "Color Range 2 High" default = rgb(255/255,61/255,32/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min2 caption = "Color Range 2 Low" default = rgb(96/255,26/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max3 caption = "Color Range 3 High" default = rgb(255/255,184/255,26/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min3 caption = "Color Range 3 Low" default = rgb(86/255,24/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max4 caption = "Color Range 4 High" default = rgb(255/255,107/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min4 caption = "Color Range 4 Low" default = rgb(112/255,29/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max5 caption = "Color Range 5 High" default = rgb(255/255,235/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min5 caption = "Color Range 5 Low" default = rgb(136/255,46/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max6 caption = "Color Range 6 High" default = rgb(255/255,61/255,32/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min6 caption = "Color Range 6 Low" default = rgb(96/255,26/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max7 caption = "Color Range 7 High" default = rgb(255/255,184/255,26/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min7 caption = "Color Range 7 Low" default = rgb(86/255,24/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Max8 caption = "Color Range 8 High" default = rgb(255/255,107/255,0/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Fall 8") endparam color param fall8Min8 caption = "Color Range 8 Low" default = rgb(112/255,29/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Fall 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Winter 8 ;-------------------------------------------------------------------- heading caption = " Winter 8 Settings" visible = (@customize && @colorPreset == "Winter 8") endheading color param winter8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min1 caption = "Color Range 1 Low" default = rgb(65/255,65/255,87/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max2 caption = "Color Range 2 High" default = rgb(163/255,186/255,209/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min2 caption = "Color Range 2 Low" default = rgb(35/255,35/255,61/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max3 caption = "Color Range 3 High" default = rgb(173/255,166/255,157/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min3 caption = "Color Range 3 Low" default = rgb(78/255,65/255,52/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max4 caption = "Color Range 4 High" default = rgb(113/255,118/255,140/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min4 caption = "Color Range 4 Low" default = rgb(20/255,32/255,68/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min5 caption = "Color Range 5 Low" default = rgb(65/255,65/255,87/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max6 caption = "Color Range 6 High" default = rgb(163/255,186/255,209/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min6 caption = "Color Range 6 Low" default = rgb(35/255,35/255,61/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max7 caption = "Color Range 7 High" default = rgb(173/255,166/255,157/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min7 caption = "Color Range 7 Low" default = rgb(78/255,65/255,52/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Max8 caption = "Color Range 8 High" default = rgb(113/255,118/255,140/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Winter 8") endparam color param winter8Min8 caption = "Color Range 8 Low" default = rgb(20/255,32/255,68/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Winter 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Mojave 8 ;-------------------------------------------------------------------- heading caption = " Mojave 8 Settings" visible = (@customize && @colorPreset == "Mojave 8") endheading color param mojave8Max1 caption = "Color Range 1 High" default = rgb(255/255,169/255,50/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min1 caption = "Color Range 1 Low" default = rgb(116/255,0/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max2 caption = "Color Range 2 High" default = rgb(255/255,243/255,120/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min2 caption = "Color Range 2 Low" default = rgb(86/255,31/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max3 caption = "Color Range 3 High" default = rgb(255/255,169/255,50/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min3 caption = "Color Range 3 Low" default = rgb(116/255,0/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max4 caption = "Color Range 4 High" default = rgb(255/255,243/255,120/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min4 caption = "Color Range 4 Low" default = rgb(86/255,31/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max5 caption = "Color Range 5 High" default = rgb(255/255,169/255,50/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min5 caption = "Color Range 5 Low" default = rgb(116/255,0/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max6 caption = "Color Range 6 High" default = rgb(255/255,243/255,120/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min6 caption = "Color Range 6 Low" default = rgb(86/255,31/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max7 caption = "Color Range 7 High" default = rgb(255/255,169/255,50/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min7 caption = "Color Range 7 Low" default = rgb(116/255,0/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Max8 caption = "Color Range 8 High" default = rgb(255/255,243/255,120/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Mojave 8") endparam color param mojave8Min8 caption = "Color Range 8 Low" default = rgb(86/255,31/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Mojave 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Gold/Green 8 ;-------------------------------------------------------------------- heading caption = " Gold/Green 8 Settings" visible = (@customize && @colorPreset == "Gold/Green 8") endheading color param goldGreen8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min1 caption = "Color Range 1 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min2 caption = "Color Range 2 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min3 caption = "Color Range 3 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max4 caption = "Color Range 4 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min4 caption = "Color Range 4 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max5 caption = "Color Range 5 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min5 caption = "Color Range 5 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max6 caption = "Color Range 6 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min6 caption = "Color Range 6 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max7 caption = "Color Range 7 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min7 caption = "Color Range 7 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Max8 caption = "Color Range 8 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Gold/Green 8") endparam color param goldGreen8Min8 caption = "Color Range 8 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Gold/Green 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Gold/Green Alt 8 ;-------------------------------------------------------------------- heading caption = " Gold/Green Alt 8 Settings" visible = (@customize && @colorPreset == "Gold/Green Alt 8") endheading color param goldGreenAlt8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min1 caption = "Color Range 1 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max2 caption = "Color Range 2 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min2 caption = "Color Range 2 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min3 caption = "Color Range 3 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max4 caption = "Color Range 4 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min4 caption = "Color Range 4 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min5 caption = "Color Range 5 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max6 caption = "Color Range 6 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min6 caption = "Color Range 6 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max7 caption = "Color Range 7 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min7 caption = "Color Range 7 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Max8 caption = "Color Range 8 High" default = rgb(0/255,129/255,8/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam color param goldGreenAlt8Min8 caption = "Color Range 8 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Gold/Green Alt 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Gold/Silver 8 ;-------------------------------------------------------------------- heading caption = " Gold/Silver 8 Settings" visible = (@customize && @colorPreset == "Gold/Silver 8") endheading color param goldSilver8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min1 caption = "Color Range 1 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min2 caption = "Color Range 2 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min3 caption = "Color Range 3 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max4 caption = "Color Range 4 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min4 caption = "Color Range 4 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min5 caption = "Color Range 5 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max6 caption = "Color Range 6 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min6 caption = "Color Range 6 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max7 caption = "Color Range 7 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min7 caption = "Color Range 7 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam color param goldSilver8Min8 caption = "Color Range 8 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Gold/Silver 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Gold/Silver Alt 8 ;-------------------------------------------------------------------- heading caption = " Gold/Silver Alt 8 Settings" visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endheading color param goldSilverAlt8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min1 caption = "Color Range 1 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min2 caption = "Color Range 2 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min3 caption = "Color Range 3 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max4 caption = "Color Range 4 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min4 caption = "Color Range 4 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min5 caption = "Color Range 5 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max6 caption = "Color Range 6 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min6 caption = "Color Range 6 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max7 caption = "Color Range 7 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min7 caption = "Color Range 7 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam color param goldSilverAlt8Min8 caption = "Color Range 8 Low" default = rgb(125/255,125/255,125/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Gold/Silver Alt 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Purple/Yellow 8 ;-------------------------------------------------------------------- heading caption = " Purple/Yellow 8 Settings" visible = (@customize && @colorPreset == "Purple/Yellow 8") endheading color param purpleYellow8Max1 caption = "Color Range 1 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min1 caption = "Color Range 1 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max2 caption = "Color Range 2 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min2 caption = "Color Range 2 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max3 caption = "Color Range 3 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min3 caption = "Color Range 3 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max4 caption = "Color Range 4 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min4 caption = "Color Range 4 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min5 caption = "Color Range 5 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max6 caption = "Color Range 6 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min6 caption = "Color Range 6 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max7 caption = "Color Range 7 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min7 caption = "Color Range 7 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam color param purpleYellow8Min8 caption = "Color Range 8 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Purple/Yellow 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Purple/Yellow Alt 8 ;-------------------------------------------------------------------- heading caption = " Purple/Yellow Alt 8 Settings" visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endheading color param purpleYellowAlt8Max1 caption = "Color Range 1 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min1 caption = "Color Range 1 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min2 caption = "Color Range 2 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max3 caption = "Color Range 3 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min3 caption = "Color Range 3 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max4 caption = "Color Range 4 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min4 caption = "Color Range 4 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max5 caption = "Color Range 5 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min5 caption = "Color Range 5 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max6 caption = "Color Range 6 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min6 caption = "Color Range 6 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max7 caption = "Color Range 7 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min7 caption = "Color Range 7 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Max8 caption = "Color Range 8 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam color param purpleYellowAlt8Min8 caption = "Color Range 8 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Purple/Yellow Alt 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Silver/Blue 8 ;-------------------------------------------------------------------- heading caption = " Silver/Blue 8 Settings" visible = (@customize && @colorPreset == "Silver/Blue 8") endheading color param silverBlue8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min1 caption = "Color Range 1 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min2 caption = "Color Range 2 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min3 caption = "Color Range 3 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max4 caption = "Color Range 4 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min4 caption = "Color Range 4 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max5 caption = "Color Range 5 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min5 caption = "Color Range 5 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max6 caption = "Color Range 6 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min6 caption = "Color Range 6 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max7 caption = "Color Range 7 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min7 caption = "Color Range 7 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Max8 caption = "Color Range 8 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam color param silverBlue8Min8 caption = "Color Range 8 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Silver/Blue 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Silver/Blue Alt 8 ;-------------------------------------------------------------------- heading caption = " Silver/Blue Alt 8 Settings" visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endheading color param silverBlueAlt8Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min1 caption = "Color Range 1 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max2 caption = "Color Range 2 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min2 caption = "Color Range 2 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #3." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min3 caption = "Color Range 3 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #3." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max4 caption = "Color Range 4 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #4." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min4 caption = "Color Range 4 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #4." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max5 caption = "Color Range 5 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #5." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min5 caption = "Color Range 5 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #5." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max6 caption = "Color Range 6 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #6." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min6 caption = "Color Range 6 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #6." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max7 caption = "Color Range 7 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #7." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min7 caption = "Color Range 7 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #7." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Max8 caption = "Color Range 8 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #8." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam color param silverBlueAlt8Min8 caption = "Color Range 8 Low" default = rgb(0/255,0/255,96/255) hint = "Specifies the color at the low end of Range #8." visible = (@customize && @colorPreset == "Silver/Blue Alt 8") endparam ;-------------------------------------------------------------------- ; Color Defaults for Fourth of July 3 ;-------------------------------------------------------------------- heading caption = " Fourth of July 3 Settings" visible = (@customize && @colorPreset == "Fourth of July 3") endheading color param fourthOfJuly3Max1 caption = "Color Range 1 High" default = rgb(255/255,0/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Fourth of July 3") endparam color param fourthOfJuly3Min1 caption = "Color Range 1 Low" default = rgb(128/255,0/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Fourth of July 3") endparam color param fourthOfJuly3Max2 caption = "Color Range 2 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Fourth of July 3") endparam color param fourthOfJuly3Min2 caption = "Color Range 2 Low" default = rgb(0/255,0/255,128/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Fourth of July 3") endparam color param fourthOfJuly3Max3 caption = "Color Range 3 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Fourth of July 3") endparam color param fourthOfJuly3Min3 caption = "Color Range 3 Low" default = rgb(128/255,128/255,128/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Fourth of July 3") endparam ;-------------------------------------------------------------------- ; Color Defaults for Blue/Silver 2 ;-------------------------------------------------------------------- heading caption = " Blue/Silver 2 Settings" visible = (@customize && @colorPreset == "Blue/Silver 2") endheading color param blueSilver2Max1 caption = "Color Range 1 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Blue/Silver 2") endparam color param blueSilver2Min1 caption = "Color Range 1 Low" default = rgb(0/255,0/255,97/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Blue/Silver 2") endparam color param blueSilver2Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Blue/Silver 2") endparam color param blueSilver2Min2 caption = "Color Range 2 Low" default = rgb(97/255,97/255,97/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Blue/Silver 2") endparam ;-------------------------------------------------------------------- ; Color Defaults for Blue/White 2 ;-------------------------------------------------------------------- heading caption = " Blue/White 2 Settings" visible = (@customize && @colorPreset == "Blue/White 2") endheading color param blueWhite2Max1 caption = "Color Range 1 High" default = rgb(64/255,64/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Blue/White 2") endparam color param blueWhite2Min1 caption = "Color Range 1 Low" default = rgb(0/255,0/255,97/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Blue/White 2") endparam color param blueWhite2Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Blue/White 2") endparam color param blueWhite2Min2 caption = "Color Range 2 Low" default = rgb(124/255,124/255,124/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Blue/White 2") endparam ;-------------------------------------------------------------------- ; Color Defaults for Cyan/Magenta 2 ;-------------------------------------------------------------------- heading caption = " Cyan/Magenta 2 Settings" visible = (@customize && @colorPreset == "Cyan/Magenta 2") endheading color param cyanMagenta2Max1 caption = "Color Range 1 High" default = rgb(128/255,255/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Cyan/Magenta 2") endparam color param cyanMagenta2Min1 caption = "Color Range 1 Low" default = rgb(0/255,64/255,64/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Cyan/Magenta 2") endparam color param cyanMagenta2Max2 caption = "Color Range 2 High" default = rgb(255/255,128/255,255/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Cyan/Magenta 2") endparam color param cyanMagenta2Min2 caption = "Color Range 2 Low" default = rgb(64/255,0/255,64/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Cyan/Magenta 2") endparam ;-------------------------------------------------------------------- ; Color Defaults for Cyan/Yellow 2 ;-------------------------------------------------------------------- heading caption = " Cyan/Yellow 2 Settings" visible = (@customize && @colorPreset == "Cyan/Yellow 2") endheading color param cyanYellow2Max1 caption = "Color Range 1 High" default = rgb(128/255,255/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Cyan/Yellow 2") endparam color param cyanYellow2Min1 caption = "Color Range 1 Low" default = rgb(0/255,64/255,64/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Cyan/Yellow 2") endparam color param cyanYellow2Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Cyan/Yellow 2") endparam color param cyanYellow2Min2 caption = "Color Range 2 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Cyan/Yellow 2") endparam ;-------------------------------------------------------------------- ; Color Defaults for Gold/Green 2 ;-------------------------------------------------------------------- heading caption = " Gold/Green 2 Settings" visible = (@customize && @colorPreset == "Gold/Green 2") endheading color param goldGreen2Max1 caption = "Color Range 1 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Gold/Green 2") endparam color param goldGreen2Min1 caption = "Color Range 1 Low" default = rgb(153/255,64/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Gold/Green 2") endparam color param goldGreen2Max2 caption = "Color Range 2 High" default = rgb(0/255,129/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Gold/Green 2") endparam color param goldGreen2Min2 caption = "Color Range 2 Low" default = rgb(0/255,32/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Gold/Green 2") endparam ;-------------------------------------------------------------------- ; Color Defaults for Purple/Yellow 2 ;-------------------------------------------------------------------- heading caption = " Purple/Yellow 2 Settings" visible = (@customize && @colorPreset == "Purple/Yellow 2") endheading color param purpleYellow2Max1 caption = "Color Range 1 High" default = rgb(172/255,96/255,252/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Purple/Yellow 2") endparam color param purpleYellow2Min1 caption = "Color Range 1 Low" default = rgb(72/255,0/255,80/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Purple/Yellow 2") endparam color param purpleYellow2Max2 caption = "Color Range 2 High" default = rgb(255/255,255/255,0/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Purple/Yellow 2") endparam color param purpleYellow2Min2 caption = "Color Range 2 Low" default = rgb(155/255,65/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Purple/Yellow 2") endparam ;-------------------------------------------------------------------- ; Color Defaults for Red/Tan 2 ;-------------------------------------------------------------------- heading caption = " Red/Tan 2 Settings" visible = (@customize && @colorPreset == "Red/Tan 2") endheading color param redTan2Max1 caption = "Color Range 1 High" default = rgb(255/255,32/255,32/255) hint = "Specifies the color at the high end of Range #1." visible = (@customize && @colorPreset == "Red/Tan 2") endparam color param redTan2Min1 caption = "Color Range 1 Low" default = rgb(96/255,0/255,0/255) hint = "Specifies the color at the low end of Range #1." visible = (@customize && @colorPreset == "Red/Tan 2") endparam color param redTan2Max2 caption = "Color Range 2 High" default = rgb(255/255,208/255,152/255) hint = "Specifies the color at the high end of Range #2." visible = (@customize && @colorPreset == "Red/Tan 2") endparam color param redTan2Min2 caption = "Color Range 2 Low" default = rgb(128/255,108/255,60/255) hint = "Specifies the color at the low end of Range #2." visible = (@customize && @colorPreset == "Red/Tan 2") endparam param highlight_type caption = "Color Highlight Type" default = 1 enum = "none" "linear" "log" "exponential" hint = "Use to generate a 'shiny' hightlight." visible = @colorPreset != "Gradient" endparam param highlight caption = "Highlight Value" default = 5.0 hint = "Use to generate a 'shiny' hightlight." visible = @colorPreset != "Gradient" && @highlight_type != "none" endparam param extent caption = "Highlight Extent" default = 0.05 min = 0.0 max = 0.5 hint = "Use to generate a 'shiny' hightlight." visible = @colorPreset != "Gradient" && @highlight_type != "none" endparam float param hblend caption = "Highlight power" default = 2.0 visible = @colorPreset != "Gradient" && @highlight_type != "none" endparam color param hcolor caption = "Highlight color" default = rgb(255/255,255/255,255/255) visible = @colorPreset != "Gradient" && @highlight_type != "none" endparam float param scale caption = "color scale adj" default = 1.0 endparam float param cblend caption = "color blend power" default = 3.0 visible = @colorPreset != "Gradient" endparam param method caption = "color method" enum = "level" "size" "index" "position" "size threshold" default = 0 visible = !((@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both") || @version < 250 endparam param bmethods caption = "color methd std" enum = "level" "size" "index" "position" "size threshold" default = 0 visible = (@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both" && @version >= 250 endparam param adjs caption = "color methd adj std" default = 1.0 visible = (@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both" \ && @bmethods != "level" && @version >= 250 endparam param bmethoda caption = "color methd alt" enum = "level" "size" "index" "position" "size threshold" default = 0 visible = (@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both" && @version >= 250 endparam param rthresh caption = "Size thresh" default = 0.01 visible = (@method == 4 || @bmethods == 4 || @bmethoda == 4) && @version >=112 endparam param adja caption = "color methd adj alt" default = 1.0 visible = (@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both" \ && @bmethoda != "level" && @version >= 250 endparam param adj caption = "color methd adj" default = 1.0 visible = !((@cusptype == "1/15 Cusp" || @cusptype == "0/1 Cusp (Apollo)" || \ @cusptype == "1/1 Cusp" || @cusptype == "1/2 Cusp") \ && @showcusp == "Both") \ && @method != "level" || @version < 250 endparam float param luminanceUpper caption = "Lum. Upper Value" default = 0.5 min = 0.0 max = 1.0 hint = "The value of the Luminance component for the upper value \ when generating the ranges from the gradient. This value \ is used with the brighter end of the color range." visible = (@colorPreset == "Generate") endparam float param luminanceLower caption = "Lum. Lower Value" default = 0.0 min = 0.0 max = 1.0 hint = "The value of the Luminance component for the lower value \ when generating the ranges from the gradient. This value \ is used with the darker end of the color range." visible = (@colorPreset == "Generate") endparam int param totalColors caption = "# Colors in Gradient" default = 8 min = 1 max = 8 visible = (@colorPreset == "Gradient") endparam int param ncolor caption = "# Colors to Use" default = 8 min = 1 max = 24 visible = (@colorPreset != "Generate") endparam int param colorRanges caption = "Number of Ranges" default = 8 min = 1 max = 24 hint = "The number of color ranges (1..24)." visible = (@colorPreset == "Custom") endparam int param numRanges caption = "Number of Ranges" default = 8 min = 1 max = 500 hint = "The number of color ranges." visible = (@colorPreset == "Generate") endparam param perturbRanges caption = "Perturb Ranges" enum = "None" "Even/Odd" "1st Half / 2nd Half" "8 Range Custom" default = 0 hint = "Modify the way the ranges are assigned to the elements. \ 'None' = Assign in Order (0 1 2 3 4 5 6 7); 'Even Odd' = \ Assign Even Ranges, then Odd Ranges (0 2 4 6 1 3 5 7); \ '1st Half / 2nd Half' = Assign from first half of range, \ then 2nd half (0 4 1 5 2 6 3 7); '8 Range Custom' = Assign \ the ordering by entering digits 1-8. Only works for ranges \ with 8 colors." visible = ((@colorPreset == "Custom" && @colorRanges >= 3) || \ (@colorPreset == "Generate" && @numRanges >= 3) || \ (@colorPreset != "Custom" && @colorPreset != "Generate" && \ @colorPreset != "Gradient")) endparam int param rangeOrder caption = "Range Order" default = 12345678 min = 11111111 max = 88888888 hint = "Specify the color range ordering. Use digits 1-8 to specify \ the order the ranges will be used. For example, to reverse \ the ordering, specify 87654321. To alternate, use 13572468. \ If color map or preset is defined that does not contain exactly \ 8 ranges, then this parameter will not have any effect." visible = (@perturbRanges == "8 Range Custom") endparam int param colorOffset caption = "Range Offset" default = 0 min = 0 max = 23 hint = "This is used to rotate the color ranges. The offset can \ range from 0 to 23, where 23 is the maximum number of ranges \ that can be specified using the 'Generate' Color Preset." visible = (@colorPreset != "Gradient") endparam $ifdef VER40 heading caption = "Camera Settings" expanded = false endheading heading text = "Camera Origin" endheading $else heading caption = "Camera Settings" endheading heading caption = " Camera Origin" endheading $endif float param camerax caption = " X" default = 0.5 endparam float param cameray caption = " Y" default = -1.4 endparam float param cameraz caption = " Z" default = 10 endparam $ifdef VER40 heading text = "Camera Point At" endheading $else heading caption = " Camera Point At" endheading $endif float param cpointx caption = " X" default = 1.0 endparam float param cpointy caption = " Y" default = 0.7 endparam float param vplane caption = " Z" default = 2.0 endparam heading caption = "Illumination" endheading param ltype caption = "Light type" default = 1 enum = "Point source" "Spotlight" "Infinite light" endparam param angle caption = "Light Rotation" default = -60 hint = "Gives the rotation of the light source, in degrees." visible=@ltype == "Infinite light" endparam param elevation caption = "Light Elevation" default = 60 hint = "Gives the elevation of the light source, in degrees." visible=@ltype == "Infinite light" endparam $ifdef VER40 heading text = "Light Origin" visible=@ltype == "Point source" || @ltype == "Spotlight" endheading $else heading caption = " Light Origin" visible=@ltype == "Point source" || @ltype == "Spotlight" endheading $endif float param lpointx caption = " X" default = 1 visible=@ltype == "Point source" || @ltype == "Spotlight" endparam float param lpointy caption = " Y" default = 3 visible=@ltype == "Point source" || @ltype == "Spotlight" endparam float param lplane caption = " Z" default = 5 visible=@ltype == "Point source" || @ltype == "Spotlight" endparam $ifdef VER40 heading text = "Light Point At" visible=@ltype == "Point source" || @ltype == "Spotlight" endheading $else heading caption = " Light Point At" visible=@ltype == "Point source" || @ltype == "Spotlight" endheading $endif float param lightx caption = " X" default = 0.5 visible=@ltype == "Point source" || @ltype == "Spotlight" endparam float param lighty caption = " Y" default = 0.5 visible=@ltype == "Point source" || @ltype == "Spotlight" endparam float param lightz caption = " Z" default = 0.0 visible=@ltype == "Point source" || @ltype == "Spotlight" endparam float param spotrad caption = "Spotlight radius" default = 0.25 visible=@ltype=="Spotlight" endparam param spottype caption = "Spotlight focus" default = 0 enum = "Set focus" "Sharp" visible=@ltype=="Spotlight" endparam float param setfocus default = 1.0 visible=@ltype=="Spotlight"&& @spottype == "Set focus" endparam float param sdis caption = "Sphere brightness" default = 2.0 visible=@ltype=="Point source" || @ltype=="Spotlight" endparam float param dis caption = "Floor brightness" default = 1.0 visible=@floor==true && (@ltype=="Point source" || @ltype=="Spotlight") endparam param ambient caption = "Ambient light" default = 0.05 max = 1.0 min = 0.0 endparam color param amcolor caption = "Ambient color" default = rgb(192/255,192/255,192/255) endparam float param am caption = "Shadow level" default = 0.4 min = 0.0 max = 1.0 endparam heading caption = "Reflection parameters" endheading bool param reflect caption = "Show reflections" default = false endparam float param kr caption = "Reflect param" default = 1.0 min = 0.0 max = 1.0 visible=@reflect==true endparam float param krf caption = "Floor reflect param" default = 0.2 min = 0.0 max = 1.0 visible=@reflect==true endparam float param floorreflect caption = "Floor reflect dist" default = 1.0 visible=@reflect==true endparam param blendval caption = "Blend value" default = 0.25 max = 1.0 min = 0.0 visible=@reflect==true endparam param rblend caption = "Blend power" default = 3.0 visible=@colorPreset != "Gradient" && @reflect==true endparam float param hrblend caption = "Highlite rflct power" default = 2.0 visible = @colorPreset != "Gradient" && @highlight_type != "none" && @reflect==true endparam param reflectf caption="Reflection off floor" default = false visible = @reflect==true endparam param blendvalf caption = "Floor blend value" default = 0.25 max = 1.0 min = 0.0 visible=@reflectf==true endparam heading caption = "Transparency parameters" endheading bool param tparent caption = "Set transparency" default = false endparam param tparentval caption = "Transparency (0-1)" default = 0.5 min = 0.0 max = 1.0 visible=@tparent==true endparam param rfi caption = "Refractive index" default = 1.5 min = 1.0 max = 4 visible=@tparent==true endparam float param krt caption = "Refract param" default = 1.0 min = 0.0 max = 1.0 visible=@tparent==true endparam float param krft caption = "Floor refract param" default = 1.0 min = 0.0 max = 1.0 visible=@tparent==true endparam float param floorrefract caption = "Floor refract dist" default = 1.0 visible=@tparent==true endparam param rblendt caption = "Blend power" default = 3.0 visible=@colorPreset != "Gradient" && @tparent==true endparam float param hrblendt caption = "Highlite rflct power" default = 2.0 visible = @colorPreset != "Gradient" && @highlight_type != "none" && @tparent==true endparam param tmerge caption = "Refract merge mode" enum = "Normal" "Screen" "Hard Light" "Lighten" "Addition" default = 0 visible=@tparent==true endparam $ifdef VER40 heading text = "More realistic transparent coloring can often be obtained \ by switching colors." visible=@tparent==true && @colorPreset != "Gradient" endheading $endif bool param switch caption = "switch colors" default = false visible=@tparent==true && @colorPreset != "Gradient" endparam heading caption = "Floor Settings" endheading bool param floor caption ="Add floor" default = true endparam float param fa caption = "X direction" default = 0.0 visible=@floor==true endparam float param fb caption = "Y direction" default = 1.0 visible=@floor==true endparam float param fc caption = "Z direction" default = 0.0 visible=@floor==true endparam float param fd caption = "Position" default = -0.7 visible=@floor==true endparam heading caption = "Floor Patterns" endheading param flrtype caption = "Floor Type" default = 0 enum = "Checkerboard" "Fractal" "Plain" visible=@floor==true endparam float param checkscale caption = "Pattern scale" default = 0.3 visible=@floor==true && @flrtype != "Plain" endparam complex param poffset caption = "Pattern offset" default = (0,0) visible=@floor==true && @flrtype != "Plain" endparam param fctltype caption = "Fractal Type" default = 4 enum = "Barnsley" "Cayley Julia" "Gopalsamy" "Julia" "Mandelbrot" "Newton" "Phoenix" visible=@floor==true && @flrtype == "Fractal" endparam color param flrcolor caption = "Floor color #1" default = rgb(0/255,0/255,139/255) visible=@floor==true && (@flrtype == "Checkerboard" || @flrtype == "Plain") endparam color param flrcolor2 caption = "Floor color #2" default = rgb(176/255,224/255,230/255) visible=@floor==true && @flrtype == "Checkerboard" endparam param cmethod caption = "Converge method" default = 2 enum = "Halley" "Householder" "Newton" "Schroder" visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Newton" endparam param color_mode caption = "Color mode" default = 0 enum = "Distance" "Iteration" visible=@floor==true && @flrtype == "Fractal" && @colormethod != "Exponential smoothing" endparam param colormethod caption = "Trap" enum = "Exponential smoothing" "Simple traps" "Orbit traps" default = 0 visible=@floor==true && @flrtype == "Fractal" endparam param traptype caption = "Trap type" enum = "Arachnida2" "Archimedes" "Atzema spiral" "Butterfly" "Cardoid" \ "Ceil_floor" "Cf_plus" "Conchoid" "Cycloid" "Ellipse Catacaustic" \ "Gear" "Lemniscate" "Log spiral" "Maltese cross" "Product" "Quotient1" \ "Quotient2" "Rose" "Rose of Troy" "Serpentine" "Sum" "Tr_plus" \ "Trefoil" "Trifolium" "Trisectrix of Maclaurin" "Trunc_round" default = 0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Simple traps" endparam param traptype2 caption = "Trap type" enum = "Astroid" "Box" "Cross" "Diamond" "Egg" "Heart" "Hyperbola" "Hypercross" \ "Lines" "Mirrored waves" "Pinch" "Point" "Spiral"\ "Radial waves" "Rectangle" "Ring" "Waves" default = 0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" endparam param pa caption = "Polar parameter" default = 0.2 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Simple traps" \ && (@traptype == "Lemniscate" ||@traptype == "Cardoid" \ ||@traptype == "Conchoid"||@traptype == "Log spiral"|| \ @traptype == "Rose"||@traptype == "Ellipse Catacaustic" \ ||@traptype == "Butterfly"||@traptype == "Gear" \ ||@traptype == "Arachnida2"||@traptype == "Maltese cross" \ ||@traptype == "Trifolium"||@traptype == "Serpentine" \ ||@traptype == "Trefoil"||@traptype == "Trisectrix of Maclaurin" \ ||@traptype == "Atzema spiral"||@traptype == "Rose of Troy") endparam param pb caption = "2nd polar parameter" default = 1.0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Simple traps" \ && (@traptype == "Conchoid"||@traptype == "Ellipse Catacaustic" \ ||@traptype == "Gear"||@traptype == "Serpentine" \ ||@traptype == "Atzema spiral"||@traptype == "Rose of Troy") endparam param pc caption = "3rd Polar parameter" default = 0.05 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Simple traps" \ && @traptype == "Rose of Troy" endparam param pn caption = "Polar integer" default = 3 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Simple traps" \ && (@traptype == "Gear" || @traptype == "Arachnida2") endparam param diameter caption = "Trap diameter" default = 1.0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" \ && (@traptype2 == "Ring" || @traptype2 == "Egg" || \ @traptype2 == "Hyperbola" || @traptype2 == "Lines" ||\ @traptype2 == "Waves"|| @traptype2 == "Mirrored Waves" \ || @traptype2 == "Radial Waves"|| @traptype2 == "Spiral"\ || @traptype2 == "Heart") endparam param torder caption = "Trap order" default = 4.0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" \ && (@traptype2 == "Pinch" ||@traptype2 == "Egg" || \ @traptype2 == "Astroid" ||@traptype2 == "Waves"|| \ @traptype2 == "Mirrored Waves" || @traptype2 == "Radial Waves") endparam param tfreq caption = "Trap frequency" default = 1.0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" \ && (@traptype2 == "Waves"|| @traptype2 == "Mirrored Waves" \ || @traptype2 == "Radial Waves") endparam bool param mask caption = "Use mask" default = false visible=@floor==true && @flrtype == "Fractal" && (@colormethod == "Orbit traps" \ || @colormethod == "Simple traps") endparam $ifdef VER40 heading text = "'Reverse mask' overrides 'Mask'." visible=@floor==true && @flrtype == "Fractal" && (@colormethod == "Orbit traps" \ || @colormethod == "Simple traps") endheading $endif bool param rmask caption = "Use reverse mask" default = false visible=@floor==true && @flrtype == "Fractal" && (@colormethod == "Orbit traps" \ || @colormethod == "Simple traps") endparam param threshold caption = "Mask threshold" default = 0.1 visible=@floor==true && @flrtype == "Fractal" && (@colormethod == "Orbit traps" \ || @colormethod == "Simple traps") endparam param tcenter caption = "Trap center" default = (0,0) visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" endparam param tasp caption = "Trap aspect" default = 1.0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" endparam param trot caption = "Trap rotation" default = 0.0 visible=@floor==true && @flrtype == "Fractal" && @colormethod == "Orbit traps" endparam color param icolor caption = "Inside color" default = rgb(0,0,0) visible=@floor==true && @flrtype == "Fractal" endparam int param miter caption = "Maximum iterations" default = 100 visible=@floor==true && @flrtype == "Fractal" endparam complex param seed caption = "Seed" default = (-0.75,0.2) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Julia" endparam complex param cseed caption = "Seed" default = (0.360968017578125,0.00074462890625) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Cayley Julia" endparam complex param phseed caption = "Seed" default = (0.56667, -0.5) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Phoenix" endparam complex param gseed caption = "Seed" default = (-0.19, -0.19) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Gopalsamy" endparam complex param bseed caption = "Seed" default = (1.025, 0.9875) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Barnsley" endparam complex param p1 caption = "Newton power" default = (3.0,0.0) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Newton" endparam complex param mp1 caption = "Power" default = (2.0,0.0) visible=@floor==true && @flrtype == "Fractal" && (@fctltype == "Mandelbrot" || \ @fctltype == "Julia") endparam complex param p2 caption = "Newton root" default = (1.0,0.0) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Newton" endparam complex param fmcenter caption = "Fractal center" default = (-0.5,0) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Mandelbrot" endparam complex param fccenter caption = "Fractal center" default = (-0.0005781248605,0.0022031248985) visible=@floor==true && @flrtype == "Fractal" && @fctltype == "Cayley Julia" endparam complex param fcenter caption = "Fractal center" default = (0,0) visible=@floor==true && @flrtype == "Fractal" && (@fctltype == "Julia" || \ @fctltype == "Newton" || @fctltype == "Phoenix" || @fctltype == "Barnsley" \ || @fctltype == "Gopalsamy") endparam float param fmag caption = "Fractal magnification" default = 1.0 visible=@floor==true && @flrtype == "Fractal" endparam float param bailout caption = "Bailout" default = 10000 visible=@floor==true && @flrtype == "Fractal" endparam float param spread caption = "Color spread" default = 0.5 visible=@floor==true && @flrtype == "Fractal" endparam float param shift caption = "Color shift" default = 0.0 visible=@floor==true && @flrtype == "Fractal" endparam bool param fbound caption ="Floor boundaries?" default = false visible=@floor==true endparam float param leftbound caption ="Left boundary" default = 0.05 visible=@floor==true && @fbound == true endparam float param rightbound caption ="Right boundary" default = 0.95 visible=@floor==true && @fbound == true endparam float param topbound caption ="Top boundary" default = 2.0 visible=@floor==true && @fbound == true endparam float param bottombound caption ="Bottom boundary" default = -2.0 visible=@floor==true && @fbound == true endparam } reb-triangleikenaga {; Ron Barnett, April 1999 ; based upon the methods ; of Kerry Mitchell and Sylvie Gallet init: float a = 0 float b = 0 float mz1 = 0 complex oldz = #z float summ = 1 float iter = 1 float b1 = @bailout^(1/(4*@adjuster)) float f = b1^0.1 float b2 = b1*f float b3 = b2*f float b4 = b3*f float b5 = b4*f float b6 = b5*f float b7 = b6*f float b8 = b7*f float b9 = b8*f float b10 = b9*f float b11 = b10*f float iter1 = 0 float iter2 = 0 float iter3 = 0 float iter4 = 0 float iter5 = 0 float iter6 = 0 float iter7 = 0 float iter8 = 0 float iter9 = 0 float iter10 = 0 summ_tot = 0 iter_tot = 0 loop: a = cabs(oldz*oldz*oldz - #pixel) b = cabs(oldz*(#pixel-1)) oldz = #z mz1 = cabs(#z) summ = summ + (mz1-abs(a-b))/(a+b - abs(a-b)); IF (mz1 > b1) IF (iter1==0) iter1 = iter iter_tot = iter_tot + iter1 summ_tot = summ_tot + summ ENDIF IF (mz1 > b2) IF (iter2==0) iter2 = iter iter_tot = iter_tot + iter2 summ_tot = summ_tot + summ ENDIF IF (mz1 > b3) IF (iter3==0) iter3 = iter iter_tot = iter_tot + iter3 summ_tot = summ_tot + summ ENDIF IF (mz1 > b4) IF (iter4==0) iter4 = iter iter_tot = iter_tot + iter4 summ_tot = summ_tot + summ ENDIF IF (mz1 > b5) IF (iter5==0) iter5 = iter iter_tot = iter_tot + iter5 summ_tot = summ_tot + summ ENDIF IF (mz1 > b6) IF (iter6==0) iter6 = iter iter_tot = iter_tot + iter6 summ_tot = summ_tot + summ ENDIF IF (mz1 > b7) IF (iter7==0) iter7 = iter iter_tot = iter_tot + iter7 summ_tot = summ_tot + summ ENDIF IF (mz1 > b8) IF (iter8==0) iter8 = iter iter_tot = iter_tot + iter8 summ_tot = summ_tot + summ ENDIF IF (mz1 > b9) IF (iter9==0) iter9 = iter iter_tot = iter_tot + iter9 summ_tot = summ_tot + summ ENDIF IF (mz1 > b10) IF (iter10==0) iter10 = iter iter_tot = iter_tot + iter10 summ_tot = summ_tot + summ ENDIF IF (mz1 > b11) iter_tot = iter_tot + iter summ_tot = summ_tot + summ ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF iter = iter + 1 final: summ_tot = summ_tot/iter_tot complex k = @colors*flip(2*#pi) #index = (atan2(exp(k*summ_tot))+ #pi)/(2*#pi) default: title = "Triangle Inequality Ikenaga" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param colors caption = "Color Spread" default = 2.0 hint = "Adjust to change the color density." endparam param bailout caption = "Bailout value" default = 1e20 hint = "Must equal bailout value on Formula tab." endparam param adjuster caption = "Banding adustment" default = 3.0 hint = "Increase to reduce banding." endparam } reb-trianglejulike {; Ron Barnett, March 2000 ; based upon the methods ; of Kerry Mitchell and Sylvie Gallet init: float a = 0 float b = 0 float mz1 = 0 complex oldz = #z float summ = 1 float iter = 1 float b1 = @bailout^(1/(4*@adjuster)) float f = b1^0.1 float b2 = b1*f float b3 = b2*f float b4 = b3*f float b5 = b4*f float b6 = b5*f float b7 = b6*f float b8 = b7*f float b9 = b8*f float b10 = b9*f float b11 = b10*f float iter1 = 0 float iter2 = 0 float iter3 = 0 float iter4 = 0 float iter5 = 0 float iter6 = 0 float iter7 = 0 float iter8 = 0 float iter9 = 0 float iter10 = 0 summ_tot = 0 iter_tot = 0 loop: a = cabs(oldz*oldz*oldz - @p1) b = cabs(oldz*(@p1-1)) oldz = #z mz1 = cabs(#z) summ = summ + (mz1-abs(a-b))/(a+b - abs(a-b)); IF (mz1 > b1) IF (iter1==0) iter1 = iter iter_tot = iter_tot + iter1 summ_tot = summ_tot + summ ENDIF IF (mz1 > b2) IF (iter2==0) iter2 = iter iter_tot = iter_tot + iter2 summ_tot = summ_tot + summ ENDIF IF (mz1 > b3) IF (iter3==0) iter3 = iter iter_tot = iter_tot + iter3 summ_tot = summ_tot + summ ENDIF IF (mz1 > b4) IF (iter4==0) iter4 = iter iter_tot = iter_tot + iter4 summ_tot = summ_tot + summ ENDIF IF (mz1 > b5) IF (iter5==0) iter5 = iter iter_tot = iter_tot + iter5 summ_tot = summ_tot + summ ENDIF IF (mz1 > b6) IF (iter6==0) iter6 = iter iter_tot = iter_tot + iter6 summ_tot = summ_tot + summ ENDIF IF (mz1 > b7) IF (iter7==0) iter7 = iter iter_tot = iter_tot + iter7 summ_tot = summ_tot + summ ENDIF IF (mz1 > b8) IF (iter8==0) iter8 = iter iter_tot = iter_tot + iter8 summ_tot = summ_tot + summ ENDIF IF (mz1 > b9) IF (iter9==0) iter9 = iter iter_tot = iter_tot + iter9 summ_tot = summ_tot + summ ENDIF IF (mz1 > b10) IF (iter10==0) iter10 = iter iter_tot = iter_tot + iter10 summ_tot = summ_tot + summ ENDIF IF (mz1 > b11) iter_tot = iter_tot + iter summ_tot = summ_tot + summ ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF iter = iter + 1 final: summ_tot = summ_tot/iter_tot complex k = @colors*flip(2*#pi) #index = (atan2(exp(k*summ_tot))+ #pi)/(2*#pi) default: title = "Triangle Inequality Julike" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param colors caption = "Color Spread" default = 2.0 hint = "Adjust to change the color density." endparam param p1 caption = "Julia seed" hint = "Must equal Parameter 1 on Formula tab." endparam param bailout caption = "Bailout value" default = 1e20 hint = "Must equal bailout value on Formula tab." endparam param adjuster caption = "Banding adustment" default = 3.0 hint = "Increase to reduce banding." endparam } reb-trianglemandelbrot {; Ron Barnett, April 1999 ; based upon the methods ; of Kerry Mitchell and Sylvie Gallet init: float a = 0 float b = cabs(#pixel) float mz1 = 0 complex oldz = #pixel float summ = 1 float iter = 1 float b1 = @bailout^(1/(4*@adjuster)) float f = b1^0.1 float b2 = b1*f float b3 = b2*f float b4 = b3*f float b5 = b4*f float b6 = b5*f float b7 = b6*f float b8 = b7*f float b9 = b8*f float b10 = b9*f float b11 = b10*f float iter1 = 0 float iter2 = 0 float iter3 = 0 float iter4 = 0 float iter5 = 0 float iter6 = 0 float iter7 = 0 float iter8 = 0 float iter9 = 0 float iter10 = 0 summ_tot = 0 iter_tot = 0 loop: a = cabs(oldz*oldz) oldz = #z mz1 = cabs(#z) summ = summ + (mz1-abs(a-b))/(a+b - abs(a-b)) IF (mz1 > b1) IF (iter1==0) iter1 = iter iter_tot = iter_tot + iter1 summ_tot = summ_tot + summ ENDIF IF (mz1 > b2) IF (iter2==0) iter2 = iter iter_tot = iter_tot + iter2 summ_tot = summ_tot + summ ENDIF IF (mz1 > b3) IF (iter3==0) iter3 = iter iter_tot = iter_tot + iter3 summ_tot = summ_tot + summ ENDIF IF (mz1 > b4) IF (iter4==0) iter4 = iter iter_tot = iter_tot + iter4 summ_tot = summ_tot + summ ENDIF IF (mz1 > b5) IF (iter5==0) iter5 = iter iter_tot = iter_tot + iter5 summ_tot = summ_tot + summ ENDIF IF (mz1 > b6) IF (iter6==0) iter6 = iter iter_tot = iter_tot + iter6 summ_tot = summ_tot + summ ENDIF IF (mz1 > b7) IF (iter7==0) iter7 = iter iter_tot = iter_tot + iter7 summ_tot = summ_tot + summ ENDIF IF (mz1 > b8) IF (iter8==0) iter8 = iter iter_tot = iter_tot + iter8 summ_tot = summ_tot + summ ENDIF IF (mz1 > b9) IF (iter9==0) iter9 = iter iter_tot = iter_tot + iter9 summ_tot = summ_tot + summ ENDIF IF (mz1 > b10) IF (iter10==0) iter10 = iter iter_tot = iter_tot + iter10 summ_tot = summ_tot + summ ENDIF IF (mz1 > b11) iter_tot = iter_tot + iter summ_tot = summ_tot + summ ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF iter = iter + 1 final: summ_tot = summ_tot/iter_tot complex k = @colors*flip(2*#pi) #index = (atan2(exp(k*summ_tot))+ #pi)/(2*#pi) default: title = "Triangle Inequality Mandelbrot" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param colors caption = "Color Spread" default = 2.0 hint = "Adjust to change the color density." endparam param bailout caption = "Bailout value" default = 1e20 hint = "Must equal bailout value on Formula tab." endparam param power caption = "Power" default = (2.0,0.0) hint = "Must equal power on Formula tab." endparam param adjuster caption = "Banding adustment" default = 2.0 hint = "Increase to reduce banding." endparam } reb-trianglejulia {; Ron Barnett, March 2000 ; based upon the methods ; of Kerry Mitchell and Sylvie Gallet init: float a = 0 float b = cabs(@p1) float mz1 = 0 complex oldz = #pixel float summ = 1 float iter = 1 float b1 = @bailout^(1/(4*@adjuster)) float f = b1^0.1 float b2 = b1*f float b3 = b2*f float b4 = b3*f float b5 = b4*f float b6 = b5*f float b7 = b6*f float b8 = b7*f float b9 = b8*f float b10 = b9*f float b11 = b10*f float iter1 = 0 float iter2 = 0 float iter3 = 0 float iter4 = 0 float iter5 = 0 float iter6 = 0 float iter7 = 0 float iter8 = 0 float iter9 = 0 float iter10 = 0 summ_tot = 0 iter_tot = 0 loop: a = cabs(oldz*oldz) oldz = #z mz1 = cabs(#z) summ = summ + (mz1-abs(a-b))/(a+b - abs(a-b)) IF (mz1 > b1) IF (iter1==0) iter1 = iter iter_tot = iter_tot + iter1 summ_tot = summ_tot + summ ENDIF IF (mz1 > b2) IF (iter2==0) iter2 = iter iter_tot = iter_tot + iter2 summ_tot = summ_tot + summ ENDIF IF (mz1 > b3) IF (iter3==0) iter3 = iter iter_tot = iter_tot + iter3 summ_tot = summ_tot + summ ENDIF IF (mz1 > b4) IF (iter4==0) iter4 = iter iter_tot = iter_tot + iter4 summ_tot = summ_tot + summ ENDIF IF (mz1 > b5) IF (iter5==0) iter5 = iter iter_tot = iter_tot + iter5 summ_tot = summ_tot + summ ENDIF IF (mz1 > b6) IF (iter6==0) iter6 = iter iter_tot = iter_tot + iter6 summ_tot = summ_tot + summ ENDIF IF (mz1 > b7) IF (iter7==0) iter7 = iter iter_tot = iter_tot + iter7 summ_tot = summ_tot + summ ENDIF IF (mz1 > b8) IF (iter8==0) iter8 = iter iter_tot = iter_tot + iter8 summ_tot = summ_tot + summ ENDIF IF (mz1 > b9) IF (iter9==0) iter9 = iter iter_tot = iter_tot + iter9 summ_tot = summ_tot + summ ENDIF IF (mz1 > b10) IF (iter10==0) iter10 = iter iter_tot = iter_tot + iter10 summ_tot = summ_tot + summ ENDIF IF (mz1 > b11) iter_tot = iter_tot + iter summ_tot = summ_tot + summ ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF iter = iter + 1 final: summ_tot = summ_tot/iter_tot complex k = @colors*flip(2*#pi) #index = (atan2(exp(k*summ_tot))+ #pi)/(2*#pi) default: title = "Triangle Inequality Julia" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param colors caption = "Color Spread" default = 2.0 hint = "Adjust to change the color density." endparam param bailout caption = "Bailout value" default = 1e20 hint = "Must equal bailout value on Formula tab." endparam param power caption = "Power" default = (2.0,0.0) hint = "Must equal power on Formula tab." endparam param p1 caption = "Julia seed" hint = "Must equal Julia seed on Formula tab." endparam param adjuster caption = "Banding adustment" default = 2.0 hint = "Increase to reduce banding." endparam } reb-trianglenewton {; Ron Barnett, April 1999 ; based upon the methods ; of Kerry Mitchell and Sylvie Gallet init: float isnear = @bailout*cabs(@p2)^cabs(@p1) float a = 0 float b = 0 float mz1 = 0 float mz2 = 0 complex oldz = #pixel float summ = 1 float iter = 1 float b1 = sqrt(sqrt(1/isnear)) float f = b1^0.1 float b2 = b1*f float b3 = b2*f float b4 = b3*f float b5 = b4*f float b6 = b5*f float b7 = b6*f float b8 = b7*f float b9 = b8*f float b10 = b9*f float b11 = b10*f float iter1 = 0 float iter2 = 0 float iter3 = 0 float iter4 = 0 float iter5 = 0 float iter6 = 0 float iter7 = 0 float iter8 = 0 float iter9 = 0 float iter10 = 0 summ_tot = 0 iter_tot = 0 loop: a = cabs(oldz*(@p1-1)/@p1) b = cabs(@p2*oldz^(1-@p1)/@p1) mz2 = 1/cabs(oldz-#z) oldz = #z mz1 = cabs(#z) summ = summ + (mz1-abs(a-b))/(a+b - abs(a-b)) IF (mz2 > b1) IF (iter1==0) iter1 = iter iter_tot = iter_tot + iter1 summ_tot = summ_tot + summ ENDIF IF (mz2 > b2) IF (iter2==0) iter2 = iter iter_tot = iter_tot + iter2 summ_tot = summ_tot + summ ENDIF IF (mz2 > b3) IF (iter3==0) iter3 = iter iter_tot = iter_tot + iter3 summ_tot = summ_tot + summ ENDIF IF (mz2 > b4) IF (iter4==0) iter4 = iter iter_tot = iter_tot + iter4 summ_tot = summ_tot + summ ENDIF IF (mz2 > b5) IF (iter5==0) iter5 = iter iter_tot = iter_tot + iter5 summ_tot = summ_tot + summ ENDIF IF (mz2 > b6) IF (iter6==0) iter6 = iter iter_tot = iter_tot + iter6 summ_tot = summ_tot + summ ENDIF IF (mz2 > b7) IF (iter7==0) iter7 = iter iter_tot = iter_tot + iter7 summ_tot = summ_tot + summ ENDIF IF (mz2 > b8) IF (iter8==0) iter8 = iter iter_tot = iter_tot + iter8 summ_tot = summ_tot + summ ENDIF IF (mz2 > b9) IF (iter9==0) iter9 = iter iter_tot = iter_tot + iter9 summ_tot = summ_tot + summ ENDIF IF (mz2 > b10) IF (iter10==0) iter10 = iter iter_tot = iter_tot + iter10 summ_tot = summ_tot + summ ENDIF IF (mz2 > b11) iter_tot = iter_tot + iter summ_tot = summ_tot + summ ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF iter = iter + 1 final: summ_tot = summ_tot/iter_tot complex k = @colors*flip(2*#pi) #index = (atan2(exp(k*summ_tot))+ #pi)/(2*#pi) default: title = "Triangle Inequality Newton" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param colors caption = "Color Spread" default = 2.0 hint = "Adjust to change the color density." endparam param p1 caption = "Power" default = (3,0) hint = "Must equal bailout value on Formula tab." endparam param p2 caption = "Root" default = (1,0) hint = "Must equal bailout value on Formula tab." endparam param bailout caption = "Bailout value" default = 1e-12 hint = "Must equal bailout value on Formula tab." endparam } DistEstMandel {; Ron Barnett, May 1999 ; Mandelbrot distance estimate algorithm ; Recommended bailout is 1e20 init: if (@constzoom) complex dz = (0.001,0.001)/(1-@power*#z^(@power-1)) else complex dz = 1/((1-@power*#z^(@power-1))* \ sqrt(#width*#width+#height*#height)) endif loop: dz = @power*#z^(@power-1)*dz+1 final: float mdist = cabs(#z*log(#z)/dz) IF (mdist < @distest/(1000*#magn)) #index = @border/256 ELSE IF (@solid == 0) #index = 0.1*@distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est Mandel" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param power caption = "Power" default = (2.0,0.0) hint = "Power must match value \ on Formula tab" endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstJulia {; Ron Barnett, May 1999 ; Julia distance estimate algorithm ; Recommended bailout is 1e20 init: if (@constzoom) complex dz = (0.001,0.001)*@power*((0.001,0.001))^(@power-1) else complex dz = @power*(1/sqrt(#width^2 + \ #height^2))^(@power-1)/sqrt(#width^2 + \ #height^2) endif loop: dz = @power*#z^(@power-1)*dz final: float mdist = cabs(#z*log(#z)/dz) IF (mdist < @distest/#magn) #index = @border/256 ELSE IF (@solid == 0) #index = @distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est Julia" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param power caption = "Power" default = (2.0,0.0) hint = "Power must match value \ on Formula tab" endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstIkenaga {; Ron Barnett, May 1999 ; Ikenaga distance estimate algorithm ; Recommended bailout is 1e20 init: if (@constzoom) complex dz = (0.001,0.001)*(#z-1)/(2-#pixel-3*#z*#z) dz = 0 else complex dz = (#z-1)/((2-#pixel-3*#z*#z)* \ sqrt(#width*#width+#height*#height)) endif loop: dz = ((3*#z*#z + (#pixel-1))*dz + #z - 1) final: float mdist = cabs(#z*log(#z)/dz) IF (mdist < @distest/(1000*#magn)) #index = @border/256 ELSE IF (@solid == 0) #index = 0.1*@distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est Ikenaga" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstMandelLambda {; Ron Barnett, May 1999 ; General MandelLambda distance estimate algorithm ; Recommended bailout is 1e20 init: if (@constzoom) complex dz = (0.001,0.001)*(#z-#z^(@power+1))/ \ (1 - #pixel*(1-(@power+1)*#z^@power)) else complex dz = (#z-#z^(@power+1))/ \ ((1 - #pixel*(1-(@power+1)*#z^@power))* \ sqrt(#width*#width+#height*#height)) endif loop: dz = #pixel*(1-(@power+1)*#z^@power)*dz \ + #z - #z^(@power+1) final: float mdist = cabs(#z*log(#z)/dz) IF (mdist < @distest/(1000*#magn)) #index = @border/256 ELSE IF (@solid == 0) #index = 0.1*@distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est MandelLambda" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param power caption = "Power" default = (1.0,0.0) hint = "Power must match value \ on Formula tab" endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstLambda {; Ron Barnett, May 1999 ; General Lambda distance estimate algorithm ; Recommended bailout is 1e20 init: if (@constzoom) complex dz = (0.001,0.001)*@seed*(1-(@power+1)*#z^@power) else complex dz = @seed*(1-(@power+1)*#z^@power)/ \ sqrt(#width*#width+#height*#height) endif loop: dz = @seed*(1-(@power+1)*#z^@power)*dz final: float mdist = cabs(#z*log(#z)/dz) IF (mdist < @distest/#magn) #index = @border/256 ELSE IF (@solid == 0) #index = 0.001*@distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est Lambda" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param power caption = "Power" default = (1.0,0.0) hint = "Power must match value \ on Formula tab" endparam param @seed caption = "Julia Seed" hint = "Seed must match value \ on Formula tab" endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstFrameRobert {; Ron Barnett, May 1999 ; General FrameRobert distance estimate algorithm ; Recommended bailout is 1e20 init: if (@constzoom) complex dz = (0.001,0.001)/(1-2*#z-0.6*#z*#z) else complex dz = 1/((1-2*#z-0.6*#z*#z)* \ sqrt(#width*#width+#height*#height)) endif loop: dz = (0.6*#z*#z + 2*#z)*dz + 1 final: float mdist = cabs(#z*log(#z)/dz) IF (mdist < @distest/(1000*#magn)) #index = @border/256 ELSE IF (@solid == 0) #index = 0.01*@distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est FrameRobert" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstNewton {; Ron Barnett, May 1999 ; Newton distance estimate algorithm init: complex oldz = #pixel float mdist = 0 complex delta = 0 if (@constzoom) complex olddz = (0.001,0.001) complex dz = (0.001,0.001) else complex olddz = 1/sqrt(#width*#width+#height*#height) complex dz = 1/sqrt(#width*#width+#height*#height) endif complex deltadz = 0 loop: olddz = (@power-1)/@power*(1 - @root*oldz^-@power)*olddz dz = (@power-1)/@power*(1 - @root*#z^-@power)*dz delta = 1/(oldz - #z) deltadz = 1/(olddz - dz) oldz = #z final: mdist = 1/cabs(delta*log(delta)/deltadz) IF (mdist < @distest/#magn) #index = @border/256 ELSE IF (@solid == 0) #index = @distscale*log(log(mdist)) ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est Newton" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param power caption = "Power" default = (3.0,0.0) hint = "Must be equal to Power \ on the Formula tab" endparam param root caption = "Root" default = (1.0,0.0) hint = "Must be equal to Root \ on the Formula tab" endparam param constzoom caption = "Constant on Zoom" default = true endparam } DistEstCayleyMand {; Ron Barnett, May 1999 ; Cayley Mandelbrot distance estimate algorithm init: complex oldz = 0 complex a = #pixel float mdist = 0 complex delta = 0 if (@constzoom) complex olddz = (0.001,0.001) complex dz = (0.001,0.001) else complex olddz = 1/sqrt(#width*#width+#height*#height) complex dz = 1/sqrt(#width*#width+#height*#height) endif complex deltadz = 0 loop: olddz = ((3*oldz*oldz - a)*(6*oldz*oldz*olddz - 1) - \ (2*oldz^3 - a + 1)*(6*oldz*olddz - 1))/ \ (3*oldz*oldz - a)^2 dz = ((3*#z*#z - a)*(6*#z*#z*dz - 1) - \ (2*#z^3 - a + 1)*(6*#z*dz - 1))/ \ (3*#z*#z - a)^2 delta = 1/(oldz - #z) deltadz = 1/(olddz - dz) oldz = #z final: mdist = 1/cabs(delta*log(delta)/deltadz) IF (mdist < 0.01* @distest/#magn) #index = @border/256 ELSE IF (@solid == 0) #index = 0.1*@distscale*mdist ELSE #index = @outside/256 ENDIF ENDIF default: title = "Distance Est Cayley Mandel" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param distest caption = "Border Width" default = 1.0 endparam param border caption = "Border Color" default = 100.0 endparam param distscale caption = "Scaling Factor" default = 1.0 endparam param solid caption = "Solid Color Outside" default = 0 enum = "No" "Yes" endparam param outside caption = "Outside Color" default = 0.0 endparam param constzoom caption = "Constant on Zoom" default = true endparam } Polartrapsdirect_Enhanced {; Ron Barnett, January 2003 ; added some texture options inspired by work of Dennis Magar ; July 2006: added dual traps based upon code by Damien Jones, and additional ; trap options to be in more conformance to SimpleTraps ; iteration options expanded to include 'iterations to skip' and ; 'pattern repeat'. The last option determines how many times the trap/skip ; pattern is repeated $define debug init: color accumulator = @startcolor; initialize color accumulator color current = rgb(0,0,0); holds current iteration's color color textureaccumulator = @startcolor; initialize texturecolor accumulator color texturecurrent = rgb(0,0,0) ; holds current iteration's texture color float d = 0 float distance = 0 float distances[2] complex i = (0,1) ; convenient variable for imaginary number float pa[2] pa[0] = @aA pa[1] = @aB float pb[2] pb[0] = @bA pb[1] = @bB complex startoffset[2] startoffset[0] = @startA startoffset[1] = @startB complex trapoffset[2] trapoffset[0] = @offsetA trapoffset[1] = @offsetB int types[2] types[0] = @typeA types[1] = @typeB complex rot[2] rot[0] = i^(@angA/90) rot[1] = i^(@angB/90) complex skew[2] skew[0] = i^(@skewA/90) skew[1] = i^(@skewB/90) bool move[2] move[0] = @moveA move[1] = @moveB float astep[2] astep[0] = @aAstep astep[1] = @aBstep float bstep[2] bstep[0] = @bAstep bstep[1] = @bBstep complex rotstep[2] rotstep[0] = i^(@rotAstep/90) rotstep[1] = i^(@rotBstep/90) complex skewstep[2] skewstep[0] = i^(@skewAstep/90) skewstep[1] = i^(@skewBstep/90) complex startstep[2] startstep[0] = @startAstep startstep[1] = @startBstep complex trapstep[2] trapstep[0] = @trapAstep trapstep[1] = @trapBstep float min_dist = 1e+318 bool trapped = false float rr = 0 float theta = 0 float x = 0 float y = 0 complex r = 1 complex r2 = (0,1) ^ 0.411111111111 complex w = 0 complex ww = 0 float t = 0 float sum = 0.0 float freq = 1.0 float exptrap_p = 0 float exptrap_z = 0 complex f_p = 0 float distsum = 0 float distave = 0 complex trap_z = 0 complex trap_p = 0 int trap_iter = 0 int max_iter = 0 int iter = 0 int skip = 0 int patnum = 0 if @trap_mode == 5 || @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 \ || @trap_mode == 9 min_dist = 0 endif if @version == "0" skip = @skip if @no_of_iters == 0 max_iter = #maxiter else max_iter = skip + @no_of_iters endif else if iter == 0 if @alliter max_iter = #maxiter skip = 0 else skip = @skip if @no_of_iters != 0 max_iter = skip + @no_of_iters else max_iter = #maxiter endif endif endif endif bool msk = false bool trap = false bool rmask = false if @settrap == 1 msk = true trap = true elseif @settrap == 2 rmask = true trap = true endif if @version == "0" trap = @trap msk = @mask rmask = @rmask IF (@mask == true) && (@rmask == true) msk = false ENDIF endif int ii = 7 complex p = #pixel * @nscale * r + @noffset WHILE (ii > 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 ; create a "random" index for each corner ; (this is where Intel's version differs from Perlin's; ; I used Intel's version because it doesn't require a ; pre-computed random table, which is difficult to manage ; in UF.) float b00 = (bx0^2 % 65536 + by0)^2 % 65536 float b10 = (bx1^2 % 65536 + by0)^2 % 65536 float b01 = (bx0^2 % 65536 + by1)^2 % 65536 float b11 = (bx1^2 % 65536 + by1)^2 % 65536 ; produce a "random" vector for each corner float g_b00_0 = (b00)^2*0.25 % 512 - 256 float g_b10_0 = (b10)^2*0.25 % 512 - 256 float g_b01_0 = (b01)^2*0.25 % 512 - 256 float g_b11_0 = (b11)^2*0.25 % 512 - 256 float g_b00_1 = (b00+1)^2*0.25 % 512 - 256 float g_b10_1 = (b10+1)^2*0.25 % 512 - 256 float g_b01_1 = (b01+1)^2*0.25 % 512 - 256 float g_b11_1 = (b11+1)^2*0.25 % 512 - 256 ; normalize each vector 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 ; produce colors for each corner 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 ; interpolate between corners using ; bilinear filtering 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 / 2 p = p * r2 * 2 ii = ii - 1 ENDWHILE IF @transfer == 0 float xx = real(#pixel)+@fbm*(sum+1) float yy = imag(#pixel)+@fbm*(sum+1) ELSEIF @transfer == 1 float xx = real(#pixel)*(1+@fbm*(sum+1)) float yy = imag(#pixel)*(1+@fbm*(sum+1)) ELSEIF @transfer == 2 float xx = real(#pixel)/(1+@fbm*(sum+1)) float yy = imag(#pixel)/(1+@fbm*(sum+1)) ELSEIF @transfer == 3 float xx = real(#pixel)+20*log(@fbm*(sum+1)) float yy = imag(#pixel)+20*log(@fbm*(sum+1)) ELSEIF @transfer == 4 float xx = real(#pixel)+exp(@fbm*(sum+1)) float yy = imag(#pixel)+exp(@fbm*(sum+1)) ELSEIF @transfer == 5 float xx = real(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) float yy = imag(#pixel)+(@fbm*(sum+1))*(@fbm*(sum+1)) ELSEIF @transfer == 6 float xx = real(#pixel)+sqrt(@fbm*(sum+1)) float yy = imag(#pixel)+sqrt(@fbm*(sum+1)) ELSEIF @transfer == 7 float xx = real(#pixel)+sin(@fbm*(sum+1)) float yy = imag(#pixel)+sin(@fbm*(sum+1)) ELSEIF @transfer == 8 float xx = real(#pixel)+asin(@fbm*(sum+1)) float yy = imag(#pixel)+asin(@fbm*(sum+1)) ELSEIF @transfer == 9 float xx = real(#pixel)+tan(@fbm*(sum+1)) float yy = imag(#pixel)+tan(@fbm*(sum+1)) ELSEIF @transfer == 10 float xx = real(#pixel)+atan(@fbm*(sum+1)) float yy = imag(#pixel)+atan(@fbm*(sum+1)) ELSE float xx = real(#pixel-#center)+(@fbm*(sum+1)) float yy = imag(#pixel-#center)+(@fbm*(sum+1)) ENDIF p = xx + flip(yy) loop: int j = 0 exptrap_z = exptrap_z + exp(-cabs(#z)) while j <= @trapnum if move[j]&&iter == 0 trapoffset[j] = trapoffset[j] + #pixel endif ; increment parameters pa[j] = pa[j]+astep[j] pb[j] = pb[j]+bstep[j] rot[j] = rot[j]*rotstep[j] skew[j] = skew[j]*skewstep[j] startoffset[j] = startoffset[j] + startstep[j] trapoffset[j] = trapoffset[j] + trapstep[j] complex z1 = #z*(1-@weight) + p*@weight z1 = z1*rot[j] z1 = real(z1*skew[j]) + flip(imag(z1)) x = real(z1) + real(trapoffset[j]) y = imag(z1) + imag(trapoffset[j]) ; if move[j] ; x = x + real(#pixel) ; y = y + imag(#pixel) ; endif rr = cabs(z1) theta = atan2(y/x) IF types[j] == 0 rr = pa[j]*sqrt(cos(2*theta)) f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = 10*abs((x-rr*cos(theta)) + y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ELSEIF types[j] == 1 rr = pa[j]*(1-cos(theta)) f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = 5*abs(x-rr*cos(theta) + y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ELSEIF types[j] == 2 rr = (pa[j] + pb[j]*cos(theta))/cos(theta) f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ELSEIF types[j] == 3 f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = abs(x-rr*(theta-sin(theta))+y-rr*(1-cos(theta))) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*(theta-sin(theta)))+abs(y-rr*(1-cos(theta))) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ELSEIF types[j] == 4 rr = pa[j]*theta f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ELSEIF types[j] == 5 rr = exp(pa[j]*theta) f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ELSEif types[j] == 6 rr = pa[j]*cos(theta) f_p = x-rr*cos(theta) + flip(y-rr*sin(theta))+startoffset[j] IF @color_mode == 10 || @color_mode == 11 exptrap_p = exptrap_p + exp(-cabs(f_p)) ENDIF IF @disttype == 0 d = abs(x-rr*cos(theta) + y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ELSE d = abs(x-rr*cos(theta)) + abs(y-rr*sin(theta)) IF @trapvar == 1 d = abs(d*d - d) ELSEIF @trapvar == 2 d = abs(d*d*d - d) ELSEIF @trapvar == 3 d = abs(d*d*d -d*d +d) ELSEIF @trapvar == 4 d = abs(d - |f_p|) ELSEIF @trapvar == 5 d = abs(d - cabs(fn3(f_p))) ELSEIF @trapvar == 6 if @version == "0" d = 25*cabs(z1-f_p)/cabs(d/10-f_p) else d = cabs(25*(z1-f_p)*(d/10-f_p)) endif ELSEIF @trapvar == 7 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-cabs(z1-f_p)) else d = cabs(fn3(f_p)*(d/10-z1+f_p)) endif ELSEIF @trapvar == 8 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x+y)) else d = cabs(fn3(f_p)*(d/10-(x+y))) endif ELSEIF @trapvar == 9 if @version == "0" d = cabs(fn3(f_p))/abs(d/10-(x*y)) else d = cabs(fn3(f_p)*(d/10-(x*y))) endif ENDIF distsum = d + distsum distave = distsum/(iter+1) ENDIF ENDIF distances[j] = d if (@trapnum == 1) if (@trapAweight == "A") ; elseif (@trapAweight == "-A") distances[0] = -distances[0] elseif (@trapAweight == "|A|") distances[0] = abs(distances[0]) elseif (@trapAweight == "A*A") distances[0] = sqr(distances[0]) elseif (@trapAweight == "-A*A") distances[0] = -sqr(distances[0]) elseif (@trapAweight == "A*A*A") distances[0] = sqr(distances[0])*distances[0] elseif (@trapAweight == "-A*A*A") distances[0] = -sqr(distances[0])*distances[0] elseif (@trapAweight == "|A*A*A|") distances[0] = abs(sqr(distances[0])*distances[0]) elseif (@trapAweight == "log(A)") distances[0] = log(distances[0]) elseif (@trapAweight == "exp(A)") distances[0] = exp(distances[0]) endif if (@trapBweight == "B") ; elseif (@trapBweight == "-B") distances[1] = -distances[1] elseif (@trapBweight == "|B|") distances[1] = abs(distances[1]) elseif (@trapBweight == "B*B") distances[1] = sqr(distances[1]) elseif (@trapBweight == "-B*B") distances[1] = -sqr(distances[1]) elseif (@trapBweight == "B*B*B") distances[1] = sqr(distances[1])*distances[1] elseif (@trapBweight == "-B*B*B") distances[1] = -sqr(distances[1])*distances[1] elseif (@trapBweight == "|B*B*B|") distances[1] = abs(sqr(distances[1])*distances[1]) elseif (@trapBweight == "log(B)") distances[1] = log(distances[1]) elseif (@trapBweight == "exp(B)") distances[1] = exp(distances[1]) endif endif if (@trapnum == 0) d = distances[0] elseif (@trapnum == 1) if (@trapmerge == "min(A,B)") if (distances[0] < distances[1]) d = distances[0] else d = distances[1] endif elseif (@trapmerge == "max(A,B)") if (distances[0] > distances[1]) d = distances[0] else d = distances[1] endif elseif (@trapmerge == "A+B") d = distances[0] + distances[1] elseif (@trapmerge == "A*B") d = distances[0] * distances[1] elseif (@trapmerge == "A/B") d = distances[0] / distances[1] elseif (@trapmerge == "B/A") d = distances[1] / distances[0] elseif (@trapmerge == "1/(A*B)") d = 1 / (distances[0] * distances[1]) elseif (@trapmerge == "A^B") d = distances[0] ^ distances[1] elseif (@trapmerge == "B^A") d = distances[1] ^ distances[0] elseif (@trapmerge == "A") d = distances[0] elseif (@trapmerge == "B") d = distances[1] elseif (@trapmerge == "|A-B|") d = abs(distances[0] - distances[1]) elseif (@trapmerge == "A AND B") if (distances[0] < @width && distances[1] < @width) d = distances[0] else d = @width endif elseif (@trapmerge == "B AND A") if (distances[1] < @width && distances[0] < @width) d = distances[1] else d = @width endif elseif (@trapmerge == "A OR B") if (distances[0] < @width) d = distances[0] elseif (distances[1] < @width) d = distances[1] else d = @width endif elseif (@trapmerge == "B OR A") if (distances[1] < @width) d = distances[1] elseif (distances[0] < @width) d = distances[0] else d = @width endif elseif (@trapmerge == "A NOT B") if (distances[0] < @width && distances[1] >= @width) d = distances[0] else d = @width endif elseif (@trapmerge == "B NOT A") if (distances[1] < @width && distances[0] >= @width) d = distances[1] else d = @width endif endif if (@trapmergeabs) d = abs(d) endif endif j = j + 1 endwhile IF @trap_mode == 0 IF (iter >= skip && iter < max_iter) \ && d < min_dist min_dist = d distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 1 IF (iter >= skip && iter < max_iter) \ && !trapped && d < @width trapped = true distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 2 IF (iter >= skip && iter < max_iter) \ && d < @width trapped = true distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 3 d = cabs(f_p) IF (iter >= skip && iter < max_iter) \ && d < min_dist min_dist = d distance = abs(|#z| - |f_p|) trap_iter = iter trap_z = #z trap_p = f_p ENDIF ELSEIF @trap_mode == 5 IF (iter >= skip && iter < max_iter) \ && d > min_dist && d < @width trapped = true min_dist = d distance = d trap_iter = iter trap_z = #z trap_p = f_p ENDIF ENDIF if @version == "0" if @trap_mode == 4 if (iter >= skip && iter < max_iter) \ && distave < min_dist min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p endif endif else IF @trap_mode == 4 IF (iter >= skip && iter < max_iter) \ && d < @width trapped = true min_dist = distave distance = distave trap_iter = iter trap_z = #z trap_p = f_p ENDIF endif endif IF @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 \ || @trap_mode ==9 IF (iter >= skip && iter < max_iter) \ && d < @width trapped = true distance = distance + d trap_iter = iter trap_z = trap_z + #z trap_p = trap_p + f_p ENDIF ELSEIF @trap_mode == 10 || @trap_mode == 11 || @trap_mode == 12 \ || @trap_mode ==13 IF (iter >= skip && iter < max_iter) \ && !trapped && d < @width trapped = true distance = distance + d trap_iter = iter trap_z = trap_z + #z trap_p = trap_p + f_p ENDIF ENDIF iter = iter + 1 if @version == "1.3" if (iter >= max_iter+@itergap)&&!@alliter && (patnum == 0 || patnum < @pattern) max_iter = max_iter + @itergap + @no_of_iters if @pattern != 0 patnum = patnum + 1 endif endif endif ; Compute direct color. This code is very similar to the normal processing ; in the final section. w = fn2(fn1(trap_z*10^@pwr))*@ts ww = fn2(fn1((w - round(w)))) + @toffset t = cabs(ww)*@tc t = (t - trunc(t))*@tweight if @version == "0" w = fn2(fn1((trap_z)*10^@pwr))*@ts ww = fn2(fn1((w - round(w)))) + @toffset else if @addfbm == true w = fn2(fn1((trap_z+@tfbm*(xx+flip(yy)))*10^@pwr))*@ts else w = fn2(fn1((trap_z)*10^@pwr))*@ts endif ww = fn2(fn1((w - @fn6(w)))) + @toffset endif t = cabs(ww)*@tc if @version == "0" t = (t - trunc(t))*@tweight else t = (t - round(t))*@tweight endif texturecurrent = gradient(t) if @trap_mode == 7 || @trap_mode == 11 distance = distance + cabs(trap_p) endif if @trap_mode == 8 || @trap_mode == 12 distance = distance + cabs(trap_z) endif if @trap_mode == 9 || @trap_mode == 13 distance = distance + (cabs(trap_z) + cabs(trap_p))/2 endif IF (@trap_mode == 1 || @trap_mode == 2 || @trap_mode == 5 \ || @trap_mode == 6 || @trap_mode == 7 || @trap_mode == 8 || \ @trap_mode == 9 || @trap_mode == 10 || @trap_mode == 11 \ || @trap_mode == 12 || @trap_mode == 13) \ || (@version == "1.3" && @trap_mode == 4) IF !trapped if @version == "0" current = rgba(0,0,0,@maskalpha) texturecurrent = rgba(0,0,0,@maskalpha) else current = rgba(0,0,0,0) texturecurrent = rgba(0,0,0,0) endif ELSE IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) if @discrete == 1 current = gradient((trap_iter % @modcolor)/@modcolor) endif ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF ELSEIF (@trap_mode != 1 && @trap_mode != 2 && @trap_mode != 5 \ && @trap_mode != 6 && @trap_mode != 7 && @trap_mode != 8 \ && @trap_mode != 9 && @trap_mode != 10 && @trap_mode != 11 \ && @trap_mode != 12 && @trap_mode != 13 \ || (@version == "1.3" && @trap_mode==4)) && trap IF msk == true && min_dist > @width if @version == "0" current = rgba(0,0,0,@maskalpha) texturecurrent = rgba(0,0,0,@maskalpha) else current = rgba(0,0,0,0) texturecurrent = rgba(0,0,0,0) endif ELSEIF msk == true && min_dist <= @width IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) if @discrete == 1 current = gradient((trap_iter % @modcolor)/@modcolor) endif ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF IF rmask == true && min_dist <= @width if @version == "0" current = rgba(0,0,0,@maskalpha) texturecurrent = rgba(0,0,0,@maskalpha) else current = rgba(0,0,0,0) texturecurrent = rgba(0,0,0,0) endif ELSEIF rmask == true && min_dist > @width IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) if @discrete == 1 current = gradient((trap_iter % @modcolor)/@modcolor) endif ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF ELSE IF @color_mode == 0 current = gradient(distance*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 1 current = gradient(0.01*trap_iter*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) if @discrete == 1 current = gradient((trap_iter % @modcolor)/@modcolor) endif ELSEIF @color_mode == 2 current = gradient(cabs(trap_z)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 3 current = gradient(abs(real(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 4 current = gradient(abs(imag(trap_z))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 5 float angle = atan2(trap_z) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 6 current = gradient(cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 7 current = gradient(abs(real(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 8 current = gradient(abs(imag(trap_p))*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 9 float angle = atan2(trap_p) IF angle < 0 angle = angle + 2 * #pi ENDIF angle = 1 / (2 * #pi) * angle current = gradient(angle*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 10 current = gradient(0.1*exptrap_p*cabs(trap_p)*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ELSEIF @color_mode == 11 current = gradient(0.01 * exptrap_p*2*(1+@fbmf*(sum+1)*0.5)/(1+@fbmf)) ENDIF ENDIF IF (@trapmergemodifier == "distance") current = rgba(red(current), green(current), blue(current), alpha(current) * distance / @threshold) ENDIF IF (@trapmergeorder == "bottom-up") accumulator = compose(accumulator, blend(current, @trapmergemode(accumulator, current), alpha(accumulator)), @trapmergeopacity) ELSEIF (@trapmergeorder == "top-down") accumulator = compose(current, blend(accumulator, @trapmergemode(current, accumulator), alpha(current)), @trapmergeopacity) ENDIF IF (@texturemergeorder == "bottom-up") textureaccumulator = compose(textureaccumulator, blend(texturecurrent, @texturemergemode(textureaccumulator, texturecurrent), alpha(textureaccumulator)), @texturemergeopacity) ELSEIF (@trapmergeorder == "top-down") textureaccumulator = compose(texturecurrent, blend(textureaccumulator, @texturemergemode(texturecurrent, textureaccumulator), alpha(texturecurrent)), @texturemergeopacity) ENDIF if @addtext accumulator = blend(accumulator, textureaccumulator, @blendfactor) endif final: ; Return direct color. #color = accumulator default: title = "Polar Traps Direct Enhanced" param version caption = "Version number" enum = "0" "1.3" default = 1 hint = "This is for backwards compatibility with old versions \ of the formula. If your old upr does perform correctly, change the default 'Version \ number' to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endparam $ifdef VER40 heading text = "If your old upr does perform correctly, change the default 'Version \ number' to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endheading $else heading caption = "If your old upr does perform correctly," endheading heading caption = "change the default 'Version number'" endheading heading caption = "to '0'. DO NOT CHANGE THE DEFAULT VALUE FOR NEW UPRS!" endheading $endif bool param expert caption = "Expert mode" default = false visible = @version == "1.3" endparam heading caption = "General Parameters" endheading param trap_mode caption = "Trap mode" enum = "Closest" "First" "Last" "Smallest trap" "Average" "Farthest" \ "Sum" "Weighted Sum" "Weighted Sum 2" "Weighted Sum 3" \ "Sum 2" "Weighted Sum 4" "Weighted Sum 5" "Weighted Sum 6" endparam param color_mode caption = "Coloring mode" enum = "Distance" "Iteration" "Magnitude" "Real" "Imag" \ "Angle" "Trap magnitude" "Trap real" "Trap imag" \ "Trap angle" "Exp Iter" "Exp Iter 2" endparam param discrete caption = "Iteration options" default = 0 enum = "normal" "discrete colors" visible = @color_mode == 1 hint = "'discrete colors' allows the user to set the total number of colors \ to use with mod iter." endparam int param modcolor caption = "# of iteration colors" default = 8 visible = @color_mode == 1 && @discrete == 1 hint = "Number of iteration colors to use with mod iter. This is useful \ for gradient masks where the mask allows a specific mod iter to \ be opaque or transparent." endparam param trapvar caption = "Trap variants" default = 0 enum = "default" "1" "2" "3" "4" "5" "6" "7" "8" "9" endparam func fn3 caption = "Trap var function" default = cos() visible=@trapvar == 5||@trapvar == 7||@trapvar == 8||@trapvar == 9 endfunc param width caption = "Trap width" default = 0.1 endparam param settrap caption = "Trapping Mask" default = 0 enum = "none" "normal" "reverse" visible = (@trap_mode == 0 || @trap_mode == 3) && @version == "1.3" endparam param trap caption = "Alternate trap" default = false hint = "Trap for modes other than 'first' and 'last'" visible = @version == "0" endparam param mask caption = "Mask" default = true hint = "Uses 'trap width' as threshold" visible = @version == "0" endparam param rmask caption = "Reverse mask" default = false hint = "Uses 'trap width' as threshold" visible = @version == "0" endparam param disttype caption = "Distance type" default = 0 enum = "Abs total" "Abs parts" hint = "The distance function must be positive. \ The absolute value can be taken of the \ whole function or of its individual parts." endparam param trapnum caption = "Number of Traps" default = 0 enum = "1" "2" hint = "This is the number of traps to use." visible = @expert endparam bool param alliter caption = "Use all iterations" default = true visible = @expert && @version == "1.3" endparam param skip caption = "Initial iterations" hint = "This is the initial number of iterations before watching \ the orbit." default = 0 min = 0 visible = (!@alliter && @expert && @version == "1.3") || @version == "0" endparam param no_of_iters caption = "Iterations to trap" hint = "This is the number of iterations to monitor the orbit." default = 0 min = 0 visible = (!@alliter && @expert && @version == "1.3") || @version == "0" endparam param itergap caption = "Iterations to skip" default = 0 min = 0 hint = "This is the number of iterations before resuming monitoring of the \ orbit." visible = !@alliter && @expert && @version == "1.3" endparam int param pattern caption = "Pattern repeat" default = 0 min = 0 hint = "Set to zero for unlimited repeats, otherwise it sets the number of \ times 'trap iters' and 'skip iters' is carried out." visible = !@alliter && @expert && @version == "1.3" endparam heading caption = "Trap Merging" visible = @trapnum == 1 && @expert endheading param trapAweight caption = "Trap A Weight" default = 0 enum = "A" "-A" "|A|" "A*A" "-A*A" "A*A*A" "-A*A*A" "|A*A*A|" "log(A)" "exp(A)" hint = "Sets the weight for this trap." visible = @trapnum == 1 && @expert endparam param trapBweight caption = "Trap B Weight" default = 0 enum = "B" "-B" "|B|" "B*B" "-B*B" "B*B*B" "-B*B*B" "|B*B*B|" "log(B)" "exp(B)" hint = "Sets the weight for this trap." visible = @trapnum == 1 && @expert endparam param trapmerge caption = "Merge Mode" default = 0 enum = "min(A,B)" "max(A,B)" "A+B" "A*B" "A/B" "B/A" "1/(A*B)" "A^B" "B^A" \ "|A-B|" "A" "B" "A AND B" "B AND A" "A OR B" "B OR A" "A NOT B" "B NOT A" hint = "Sets the merge method for the traps" visible = @trapnum == 1 && @expert endparam param trapmergeabs caption = "No Negative Distances" default = false hint = "If set, converts negative combined trap distances to positive." visible = @trapnum == 1 && @expert endparam heading caption = "Trap Parameters" visible = @trapnum == 0 endheading heading caption = "Trap A Parameters" visible = @trapnum == 1 && @expert endheading param typeA caption = "Trap Type" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" endparam param aA caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" endparam param bA caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@typeA == 2 endparam param angA caption = "Trap rotation" default = 0.0 endparam param skewA caption = "Trap Skew" default = 0.0 endparam param startA caption = "Start offset" default = (0.0,0.0) visible = (@trapvar >= 4 || @color_mode >= 6) endparam param offsetA caption = "Trap offset" default = (0.0,0.0) endparam param moveA caption = "Move trap offset" default = false endparam heading caption = "Progressive Parameters" visible = @trapnum == 0 && @expert endheading heading caption = "Progressive A Parameters" visible = @trapnum == 1 && @expert endheading float param aAstep caption = "Inc polar param" default = 0 visible = @expert endparam float param bAstep caption = "Inc conchoid param" default = 0 visible=@typeA == 2 && @expert endparam float param rotAstep caption = "Inc rotation" default = 0 visible = @expert endparam float param skewAstep caption = "Inc skew" default = 0 visible = @expert endparam complex param startAstep caption = "Inc start" default = (0,0) visible = (@trapvar >= 4 || @color_mode >= 6) && @expert endparam complex param trapAstep caption = "Inc trap offset" default = (0,0) visible = @expert endparam heading caption = "Trap B Parameters" visible = @trapnum == 1 && @expert endheading param typeB caption = "Trap Type B" default = 0 enum = "lemniscate" "cardiod" "conchoid" "cycloid" \ "archimedes" "log spiral" "rose" visible = @trapnum == 1 && @expert endparam param aB caption = "Polar parameter" default = 0.2 hint = "Affects spread and scale of trap" visible = @trapnum == 1 && @expert endparam param bB caption = "Conchoid parameter" default = 1.0 hint = "Affects shape and scale of trap. \ Use only with conchoid function." visible=@typeB == 2 && @trapnum == 1 && @expert endparam param angB caption = "Trap rotation" default = 0.0 visible = @trapnum == 1 && @expert endparam param skewB caption = "Trap Skew" default = 0.0 visible = @trapnum == 1 && @expert endparam param startB caption = "Start offset" default = (0.0,0.0) visible = @trapnum == 1 && (@trapvar >= 4 || @color_mode >= 6) && @expert endparam param offsetB caption = "Trap offset" default = (0.0,0.0) visible = @trapnum == 1 && @expert endparam param moveB caption = "Move trap offset" default = false visible = @trapnum == 1 && @expert endparam heading caption = "Progressive B Parameters" visible = @trapnum == 1 && @expert endheading float param aBstep caption = "Inc polar param" default = 0 visible = @trapnum == 1 && @expert endparam float param bBstep caption = "Inc conchoid param" default = 0 visible=@typeB == 2 && @expert endparam float param rotBstep caption = "Inc rotation" default = 0 visible = @trapnum == 1 && @expert endparam float param skewBstep caption = "Inc skew" default = 0 visible = @trapnum == 1 && @expert endparam complex param startBstep caption = "Inc start" default = (0,0) visible = @trapnum == 1 && (@trapvar >= 4 || @color_mode >= 6) && @expert endparam complex param trapBstep caption = "Inc trap offset" default = (0,0) visible = @trapnum == 1 && @expert endparam heading caption = "Merging Color" endheading color param startcolor caption = "Base Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." endparam param maskalpha caption = "Mask Alpha" default = 1.0 min = 0 visible = @version == "0" endparam color func trapmergemode caption = "Trap Color Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." endfunc param trapmergemodifier caption = "Additional Alpha" default = 0 enum = "none" "distance" hint = "Specifies an additional alpha value to incorporate during merging." endparam param threshold caption = "Alpha Modifier" default = 0.25 min = 0 hint = "Use with 'Additional Alpha' parameter" visible = @trapmergemodifier == "distance" endparam param trapmergeopacity caption = "Trap Merge Opacity" default = 0.2 hint = "Sets the opacity of each trap shape. Even if you set this value to 1 \ (forcing all traps to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." endparam param trapmergeorder caption = "Trap Merge Order" default = 0 enum = "bottom-up" "top-down" hint = "Sets the order in which traps will be merged. Bottom-up merges new \ traps on top of previous ones. Top-down merges new traps underneath \ previous ones." endparam heading caption = "Merging Texture" visible = @version == "0" || (@addtext && @expert) endheading param blendfactor caption = "Color Texture Blend" default = 0.3 min = 0 hint = "Use to blend color and texture" visible = @version == "0" || (@addtext && @expert) endparam color param starttexturecolor caption = "Base Texture Color" default = rgb(0,0,0) hint = "Specifies the 'base', or starting color with which all iterations' \ colors will be merged." visible = @version == "0" || (@addtext && @expert) endparam color func texturemergemode caption = "Texture Merge" default = mergenormal() hint = "This chooses the merge mode used to blend colors at each iteration." visible = @version == "0" || (@addtext && @expert) endfunc param texturemergeopacity caption = "Texture Merge Opacity" default = 0.02 hint = "Sets the opacity of each texture. Even if you set this value to 1 \ (forcing all textures to be fully opaque) you can still control opacity \ using the alpha channel in the gradient." visible = @version == "0" || (@addtext && @expert) endparam param texturemergeorder caption = "Texture Merge Order" default = 0 enum = "bottom-up" "top-down" hint = "Sets the order in which textures will be merged. Bottom-up merges new \ traps on top of previous ones. Top-down merges new textures underneath \ previous ones." visible = @version == "0" || (@addtext && @expert) endparam bool param addtext caption = "Add Texture" default = false visible = @version == "1.3" && @expert endparam heading caption = "fBm Parameters" visible = @expert endheading param weight caption = "fBm Weight" default = 0.0 min = 0.0 max = 1.0 visible = @expert endparam param transfer caption = "fBm Transfer Function" default = 0 enum = "linear" "product" "quotient" "log" "exp" \ "sqr" "sqrt" "sin" "asin" "tan" "atan" visible = @expert endparam param fbm caption = "fBm Transfer Weight" default = 0.0 visible = @expert endparam param noffset caption = "fBm Offset" default = (0,0) hint = "This is the offset of the pattern. You can use this to shift \ the pattern around on the complex plane." visible = @expert endparam param nscale caption = "fBm Scale" default = 0.0 hint = "This is the overall scale of the noise." visible = @expert endparam param fbmf caption = "fBm Final Weight" default = 10.0 visible = @expert endparam heading caption = "Texture Parameters" visible = @version == "0" || (@addtext && @expert) endheading param toffset caption = "Texture offset" default = (-1,-1) hint = "Changes the texture pattern." visible = @version == "0" || (@addtext && @expert) endparam param tweight caption = "Texture weight" default = 0.05 visible = @version == "0" || (@addtext && @expert) endparam param ts caption = "Texture scale" default = 20.0 visible = @version == "0" || (@addtext && @expert) endparam param tc caption = "Texture modifier" default = 5.0 visible = @version == "0" || (@addtext && @expert) endparam param pwr caption = "Texture power" default = 1.0 visible = @version == "0" || (@addtext && @expert) endparam param addfbm caption = "Add fBm" default = false visible=@version == "1.3" && @addtext && @expert endparam param tfbm caption = "fBm Amount" default = 1.0 visible=@version == "1.3"&&@addfbm==true && @addtext && @expert endparam func fn1 caption = "Texture Function 1" default = sqr() visible = @version == "0" || (@addtext && @expert) endfunc func fn2 caption = "Texture Function 2" default = acos() visible = @version == "0" || (@addtext && @expert) endfunc func fn6 caption = "Texture Function 3" default = round() visible=@version == "1.3" && @addtext && @expert endfunc } Potential_Gradient_Mandel { ; Ron Barnett, April 2006 $define debug init: float expiter = 0 complex dz = 1 loop: dz = 2*#z*dz if @potmeth == "Exponential smoothing" expiter = expiter + exp(-cabs(#z)) endif final: if @potmeth == "Vepstas" expiter = #numiter-1-log(log(cabs(#z)))/log(2) endif float pot = 2^(-expiter) float grad = pot*cabs(dz)/(cabs(#z)*log(cabs(#z))) if @coloring == "Potential" #index = pot*@scale elseif @coloring == "Gradient" #index = grad*@scale else #index = @scale*sinh(pot)/(2*exp(pot)*grad) endif default: title = "Potential Gradient Distance Mandelbrot" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param coloring caption = "Coloring" default = 0 enum = "Potential" "Gradient" "Distance" endparam param potmeth caption = "Potential method" default = 0 enum = "Exponential smoothing" "Vepstas" endparam param scale caption = "Scaling Factor" default = 1.0 endparam } reb-specdecomp {; Ron Barnett, February 1999 ; Decomposition with many options init: float scale = @colors*#pi/128 final: complex ez = #z IF (@test == 1) ez = real(ez) ENDIF IF (@test == 2) ez = imag(ez) ENDIF IF (@test == 3) ez = real(ez) + imag(ez) ENDIF IF (@test == 4) ez = real(ez) - imag(ez) ENDIF IF (@test == 5) ez = real(ez)*imag(ez) ENDIF IF (@test == 6) ez = real(ez)/(imag(ez)+real(ez)) ENDIF ez = fn1(ez) smooth = cabs(ez)*scale ez = cos(smooth)+flip(sin(smooth)) float angle = atan2(ez) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle * @palrange / (#pi * 512) default: title = "Special Decomposition" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param test caption = "Type" default = 0 enum = "normal" "real" "imaginary" "sum" "difference" "product" "ratio" endparam param colors caption = "Color Spread" default = 2.0 hint = "2.0 approximates the iteration count. \ Use 10.0 for convergent fractals." endparam param palrange caption = "Palette Range" default = 256.0 hint = "256 means use the whole palette." endparam } PWCStyleTraps {; Ron Barnett, June 1999 ; based on Paul Carlson's trap methods init: int count = 0 int rangenum = 0 int col = 0 float test = 0.0 float temp = 0 float index_factor = (@colors-1)/@dist float color_index = 0 float ang = 0 complex f1 = 0 complex f2 = 0 complex function = 0 bool c1 = false bool c2 = false bool c3 = false bool c4 = false float r1 = @dist + @dist*@r float r2 = @dist*@dist float f = 1 - 2*@r - @r*@r float k = @r*@dist + @dist*sqrt(f) float plsqd = 2*r2*f float delta_i = 0 float delta_r = 0 complex prev_w = #z loop: IF (@type == 0) ang = atan(imag(#z)/real(#z)) f1 = fn1(ang)^real(@power) f2 = fn2(ang)^imag(@power) function = @r*(f1 + flip(f2)) test = abs(|#z|-|function|) ELSEIF (@type == 1) temp = (real(#z)-r1)*(real(#z)-r1) + \ imag(#z)*imag(#z) c1 = (temp < r2) temp = (imag(#z)+r1)*(imag(#z)+r1) + \ real(#z)*real(#z) c2 = (temp < r2) temp = (real(#z)+r1)*(real(#z)+r1) + \ imag(#z)*imag(#z) c3 = (temp < r2) temp = (imag(#z)-r1)*(imag(#z)-r1) + \ real(#z)*real(#z) c4 = (temp < r2) IF (c1 && c4) test = (real(#z)-k)*(real(#z)-k) + \ (imag(#z)-k)*(imag(#z)-k) ELSEIF (c1 && c2) test = (real(#z)-k)*(real(#z)-k) + \ (imag(#z)+k)*(imag(#z)+k) ELSEIF (c2 && c3) test = (real(#z)+k)*(real(#z)+k) + \ (imag(#z)+k)*(imag(#z)+k) ELSEIF (c3 && c4) test = (real(#z)+k)*(real(#z)+k) + \ (imag(#z)-k)*(imag(#z)-k) ELSE test = 0 ENDIF ELSEIF (@type == 2) delta_i = imag(#z) - imag(prev_w) delta_r = real(#z) - real(prev_w) ang = abs(atan(delta_i/delta_r)) IF (delta_r < 0) ang = #pi - ang ENDIF prev_w = #z ENDIF count = count + 1 IF (@skip==false) || (count > 1) IF (col == 0) IF (@type == 0) IF (test < @dist ) col = 1 rangenum = count % @range color_index = index_factor*test + \ rangenum*@colors ENDIF ELSEIF (@type == 1) IF (test > 0) col = 1 rangenum = count % @range index_factor = (@colors-1)*test/plsqd color_index = index_factor + \ rangenum*@colors ENDIF ENDIF ENDIF ENDIF final: IF (col == 0) IF (@type != 2) #solid = true ELSE rangenum = count % @range index_factor = (@colors-1)*ang/#pi color_index = index_factor + \ rangenum*@colors #index = ((color_index + 1) % 256) / 256 ENDIF ELSEIF (col == 1) #index = ((color_index + 1) % 256) / 256 ENDIF default: title = "Some PWC Trap Types" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param type caption = "Trap type" default = 0 enum = "General Astroid" "Petals" "Orbit Angle" endparam param dist caption = "Trap distance" default = 0.1 hint = "determines how close to the function \ an orbit has to come to be caught" endparam param r caption = "Function Radius" default = 0.5 endparam param power caption = "Function Power" default = (3,3) endparam param range caption = "# of Color Ranges" default = 8 endparam param colors caption = "Colors in Range" default = 30 endparam param skip caption = "Skip first iteration?" default = true hint = "Check to ignore the first iteration" endparam func fn1 caption = "Real Portion" default = cos() endfunc func fn2 caption = "Imag Portion" default = sin() endfunc } ApollonianGasket_IFS { ; Ron Barnett March 31, 2005 ; Implements the mapping algorithm of Susan Chambless ; and Gaussian filtering. ; Based upon equations of Kravchenko Alexei and Mekhontsev Dmitriy $define debug global: int w = 0 int h = 0 float Inc = @percentInc*0.01 float wd = Inc*#width float ht = Inc*#height int wd2 = round(wd*0.5) int ht2 = round(ht*0.5) int clor[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))] int count[round(#width*(1+@percentInc*0.01)),round(#height*(1+@percentInc*0.01))] float fx = 0.1 float ffx = 0.0 float xx = 0.0 float fy = 0.1 float ffy = 0.0 int iter = 0 int px = 0 int py = 0 float cy = imag(#center) float cx = real(#center) float txmax = 4.0/#magn float tymax = txmax*#height/#width float xmin = cx - txmax/2 float ymin = cy - tymax/2 float iterate = @density*10000000 float ra = sqrt(3) float x = 0.2 float y = 0.3 float aa = 0 float a0 = 0 float b0 = 0 float a1 = -0.5 float b1 = 0.5*ra float a2 = -0.5 float b2 = -0.5*ra float x1 = 0 float y1 = 0 float f1x = 0 float f1y = 0 float s1 = 0.250 float s2 = s1 int fn = 0 int seed = 123456789 float ra = sqrt(3) ; ; initialize hit array ; while(h < #height+wd) while(w < #width+ht) clor[w,h] = 0 count[w,h] = 0 w = w + 1 endwhile w = 0 h = h + 1 endwhile ; ; fill the hit array ; while (iter < (iterate*sqr(#width*#magn/400))) seed = random(seed) aa = abs(seed)/#randomrange a0 = 3*(1 + ra - x)/((1 + ra - x)^2 + y^2) - (1 + ra)/(2 + ra) b0 = 3*y/((1 + ra - x)^2 + y^2) f1x = a0/(a0^2 + b0^2) f1y = -b0/(a0^2 + b0^2) if aa <= 1/3 && aa >= 0 x1 = 3*(1 + ra - x)/((1 + ra - x)^2 + y^2) - (1 + ra)/(2 + ra) y1 = 3*y/((1 + ra - x)^2 + y^2) fn = 1 endif if aa <= 2/3 && aa > 1/3 x1 = f1x*a1 - f1y*b1 y1 = f1x*b1 + f1y*a1 fn = 2 endif if aa <= 1 && aa > 2/3 x1 = f1x*a2 - f1y*b2 y1 = f1x*b2 + f1y*a2 fn = 3 endif x = x1 y = y1 fx = s1*x fy = s2*y ; ; translate values to pixels ; ffx = fx - xmin ffy = fy - ymin ffy = tymax - ffy ffx = ffx/txmax ffy = ffy/tymax xx = ffx ffx = (0.5*#width + (ffx - 0.5)*cos(#angle)*#width - (ffy - 0.5)*sin(#angle)*#height) ffy = (0.5*#height + (ffy - 0.5)*cos(#angle)*#height + (xx - 0.5)*sin(#angle)*#width) px = round(ffx)+wd2 py = round(ffy)+ht2 if px > 0 && py > 0 && px < #width+wd && py < #height+ht count[px,py] = count[px,py] + 1 clor[px,py] = fn endif iter = iter + 1 endwhile ; init: int clr = 0 int nhit=0 float r = 2/log(20)*@filter^2 float gauss[2*@filter+1,2*@filter+1] float gweight = 0 int gx = 0 int gy = 0 float a = 0 loop: final: int xcrd = #x int ycrd = #y bool inside = true ; create the filter array and weight ; gx = -@filter gy = -@filter while gy <= @filter while gx <= @filter a = (gx^2 + gy^2)/r gauss[gx+@filter,gy+@filter] = exp(-a) gweight = gweight + gauss[gx+@filter,gy+@filter] gx = gx + 1 endwhile gx = -@filter gy = gy + 1 endwhile ; if @applymapping==true ; generate the x and y location in the image float dxx = (real(#pixel)-real(#center))*(#width)/4*#magn float dyy = (imag(#pixel)-imag(#center))*(#width)/4*#magn float transx = (#width+wd)*0.5; float transy = (#height+ht)*0.5; float cosan = cos(#angle); float sinan = sin(#angle); xcrd = round((transx + (dxx*cosan + dyy*sinan))) ycrd = round((transy + (dxx*sinan - dyy*cosan))) ; is this in our image? if (xcrd+wd2<0 || xcrd>=#width+wd2 || ycrd+ht2<0 || ycrd>=#height+ht2) inside = false endif endif if inside == true && count[xcrd,ycrd] > @thresh if @filter == 0 nhit=count[xcrd,ycrd] clr=clor[xcrd,ycrd] else ; apply the Gaussian filter nhit=0 clr=0 gx = -@filter gy = -@filter while gy <= @filter while gx <= @filter nhit = nhit + round(gauss[gx+@filter,gy+@filter]*count[xcrd+gx,ycrd+gy]) clr = clr + round(gauss[gx+@filter,gy+@filter]*clor[xcrd+gx,ycrd+gy]) gx = gx + 1 endwhile gx = -@filter gy = gy + 1 endwhile nhit = round(nhit/gweight) clr = round(clr/gweight) endif else #solid=true endif if((nhit==0)&&(@solid==true)) #solid=true elseif @method == 0 #index=((nhit+1)/log(iterate))^@scale elseif @method == 1 #index=((nhit+1)/log(iterate))^@scale + clr/4 endif default: heading caption="IFS Apollonian Attractor" endheading heading caption="Use with Pixel formula in mt.ufm" endheading heading caption="Set drawing method to one-pass" endheading title="IFS Apollonian Attractor" render=false param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param solid caption="solid background?" default=true endparam param applyMapping caption = "Apply Mapping" default = false endparam param percentInc caption = "Oversize by (%)" default = 0.0 visible = @applyMapping == true endparam param density caption = "Hit Density" default = 0.1 hint = "Coloring density for the strange attractor." endparam param filter caption = "Filter Width" default = 1 min = 0 endparam param scale caption = "Color Scaling" default = 0.2 endparam param method caption = "Coloring Method" enum = "Count" "IFS Count" default = 0 endparam param thresh caption = "Hit Threshold" default = 0.0 endparam } Ninefold { ; Ron Barnett, January 2001 ; concept from Triptych by Sylvie Gallet final: float h = #height/3 float w = #width/3 int position = 0 float hxp = real(#screenpixel) float hyp = imag(#screenpixel) float bh = @border*#width/4.8 position = 3*trunc(hxp/w) + trunc(hyp/h) IF position != @part #solid = true ELSE float h2 = h/2 float w2 = w/2 float bh = @border*#width/4.8 hyp = abs (hyp - h * trunc(hyp/h) - h2) - h2 + bh hxp = abs (hxp - w * trunc(hxp/w) - w2) - w2 + bh IF (hyp < 0) && (hxp < 0) IF @usesolid #solid = true ELSE #index = (@color+1) / 400 - 0.0025 ENDIF ELSEIF hyp > 0 && hxp < hyp #index = hyp/bh+@randomness*real(#random)*(1-hyp/bh) - 0.01 ELSE #index = hxp/bh+@randomness*real(#random)*(1-hxp/bh) - 0.01 ENDIF ENDIF default: title = "Ninefold" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param part caption = "Region" enum = "A1" "B1" "C1" "A2" "B2" "C2" "A3" "B3" "C3" hint = "A, B, and C rows; 1, 2 and 3 are columns" endparam param border caption = "Border Width" default = 0.2 endparam param @color caption = "Inside color" default = 200 min = 0 max = 399 endparam param usesolid caption = "Use solid color" default = false endparam param randomness caption = "Randomize border" default = 0.0 endparam } StrangeAttractorColor {; Ron Barnett, January 2001 ; Coloring for the strange attractor formulas ; Revised March 6, 2002 to add solid background support ; for slope strange attractors ; final: float angle = 0 IF @coloring == 0 #index = real(#z)*@spread*100 ELSEIF @coloring == 1 #index = imag(#z)*@spread*100 ELSEIF @coloring == 2 #index = #numiter/#maxiter*@spread ELSEIF @coloring == 3 #index = abs(real(#z))/cabs(#z)*@spread ELSEIF @coloring == 4 #index = abs(imag(#z))/cabs(#z)*@spread ELSEIF @coloring == 5 angle = atan2(#z) IF (angle < 0) angle = angle + #pi * 2 ENDIF #index = angle / (#pi * 2) ELSEIF @coloring == 6 #index = cabs(#z)*@spread ELSEIF @coloring == 7 #index = abs(real(#z))*@spread ELSEIF @coloring == 8 #index = abs(imag(#z))*@spread ENDIF if @solidb == true && cabs(#z) == 0 #solid = true endif default: title = "Strange Attractor Coloring" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param coloring caption = "coloring" enum = "distance" "magnitude" "iteration" \ "z value real" "zvalue imag" \ "z value angle" "z value magnitude" \ "z maximum" "z minimum" default = 0 hint = "The coloring choice requires setting \ the 'z type' in the Strange Attractor \ formula appropriately. 'Distance', \ 'magnitude' and 'iteration' are \ available from the default Strange \ Attractor formula setting." endparam param spread caption = "spread" default = 1.0 endparam param solidb caption = "use solid background" default = true endparam } Funky_Gradient { ; Ron Barnett, April 2001 final: #index = @base + @scale * cabs(@fn1(#pixel)) default: title = "Funky Gradient" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param base caption = "Index Base" default = 10.0 endparam param scale caption = "Funky Scale" default = 0.1 endparam func fn1 caption = "Funky Function" default = asin() endfunc } OrbitTrends {; Ron Barnett, September 2000 ; This coloring method uses various aspects ; of the last three points in the orbit ; It is intended for use with formulas that have bailout options ; such as Mandelbrot Bailout and Julia Bailout init: float iterexp = 0 float scale = @colors*#pi/128 complex zold = 0 complex zm2 = 0 complex zm1 = 0 complex fzm = 0 complex zm12 = 0 complex ez = 0 complex fz = 0 int i = 0 float angle = 0 float angle2 = 0 float smooth = 0 float dot = 0 float cdot = 0 float v1x = 0 float v1y = 0 float v2x = 0 float v2y = 0 float d1 = 0 float d2 = 0 float mdist = 0 float m1 = 0 float m2 = 0 float b1 = 0 float b2 = 0 loop: IF (@converge > 0) iterexp = iterexp + exp(-cabs(#z)) ELSE iterexp = iterexp + exp(-1/(cabs(zold - #z))) ENDIF zold = #z zm2 = zm1 zm1 = #z i = i + 1 final: IF i > 1 fz = #z fz = fn1(fz) zm1 = fn2(zm1) zm2 = fn3(zm2) v1x = real(fz) - real(zm1) v1y = imag(fz) - imag(zm1) v2x = real(zm1) - real(zm2) v2y = imag(zm1) - imag(zm2) m1 = v1y/v1x m2 = v2y/v2x b1 = (imag(zm1)*real(fz)-imag(fz)*real(zm1))/v1x b2 = (imag(zm2)*real(zm1)-imag(zm1)*real(zm2))/v2x d1 = sqrt(v1x*v1x + v1y*v1y) d2 = sqrt(v2x*v2x + v2y*v2y) dot = v1x*v2x + v1y*v2y cdot = v1x*v2x - v1y*v2y fzm = (fz + zm1)/2 zm12 = (zm1 + zm2)/2 mdist = sqrt((real(fzm) - real(zm12))^2 + (imag(fzm) - imag(zm12))^2) IF @lmethod == 0 angle = acos(dot/(d1*d2)) ELSEIF @lmethod == 1 angle = acos(cdot/(d1*d2)) ENDIF smooth = iterexp*scale ez = cos(smooth)+flip(sin(smooth)) angle2 = atan2(ez) IF (angle2 < 0) angle2 = angle2 + #pi*2 ENDIF IF (angle < 0) angle = angle + #pi*2 ENDIF IF @lmethod ==2 #index = exp(@weight*log(mdist/cabs(fz)) + (1-@weight)*log(angle2/(#pi*2))) ELSEIF @lmethod == 3 IF abs(m1) < abs(m2) #index = exp(@weight*log(abs(m1/m2)/iterexp) + (1-@weight)*log(angle2/(#pi*2))) ELSE #index = exp(@weight*log(abs(m2/m1)/iterexp) + (1-@weight)*log(angle2/(#pi*2))) ENDIF ELSEIF @lmethod == 4 IF abs(b1) < abs(b2) #index = exp(@weight*log(abs(b1/b2)/iterexp) + (1-@weight)*log(angle2/(#pi*2))) ELSE #index = exp(@weight*log(abs(b2/b1)/iterexp) + (1-@weight)*log(angle2/(#pi*2))) ENDIF ELSE #index = exp(@weight*log(angle/(#pi*2)) + (1-@weight)*log(angle2/(#pi*2))) ENDIF ENDIF if @solidb && cabs(#z) == 0 #solid = true endif default: title = "Orbit Trends" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam bool param solidb caption = "Solid background" default = false endparam param colors caption = "Color Spread" default = 2.0 hint = "2.0 approximates the iteration count. \ Use 10.0 for convergent fractals." endparam param converge caption = "Fractal Type" default = 1 enum = "Convergent" "Divergent" hint = "Mandelbrot is Divergent, Newton is Convergent." endparam param weight caption = "Color Method Weighting" default = 0.75 min = 0 max = 1 endparam param lmethod caption = "Coloring Method" enum = "Vector Angle" "Complex Angle" "Segment Distance" "Slope Ratio"\ "Intercept Ratio" default = 0 endparam func fn1 caption = "Final Point" default = ident() endfunc func fn2 caption = "Middle Point" default = ident() endfunc func fn3 caption = "First Point" default = ident() endfunc } SlopeAttractorColor {; Ron Barnett, December 2004 ; for coloring slope attractors ; final: if @coloring == 0 #index = (real(#z)/imag(#z))^(@spread/10) elseif @coloring == 1 #index = real(#z)^(@spread/20) elseif @coloring == 2 #index = imag(#z)^(@spread/20) elseif @coloring == 3 #index = cabs(#z)^(@spread/20) endif if @solidb == true && cabs(#z) == 0 #solid = true endif default: title = "Slope Attractor Coloring" param version caption = "Formula Version" default = 1.0 hint = "You should never see this parameter; it's used internally to track \ which version of the formula was used to create your image, so that \ if a bug is found which breaks backwards-compatibility, the formula \ can adapt transparently." visible = false endparam param coloring caption = "coloring" enum = "count" "x value" "y value" \ "magnitude" default = 0 endparam param spread caption = "spread" default = 1 endparam param solidb caption = "use solid background" default = true endparam }