rp-AS-xx2{ ;rui parracho 2002 INIT: FLOAT radius = 0.0 FLOAT rmin = 1.0e12 FLOAT rad = 0 FLOAT orad = 0 FLOAT alpha = 0 FLOAT theta = 0 COMPLEX x = 0 COMPLEX z = 0 COMPLEX y = 0 COMPLEX w = 0 LOOP: ;------------------------------------------------------------------- ; perturb #z into the new value w ;------------------------------------------------------------------- IF @trans == 0 x = .5 * @c1 * real( @fn3( 7 * @c2 * flip( @c3 * @fn1( #z ) ) ) ) y = .5 * @c1 * real( @fn3( 7 * @c2 * real( @c3 * @fn2( #z ) ) ) ) ELSEIF @trans == 1 x = 2 * @c1 * ( @fn1( @c2 * @fn2( 2 * @c3 * @fn3( #z ) ) ) ) y = 2 * @c1 * flip( @fn1( @c2 * @fn2( 2 * @c3 * @fn3( #z ) ) ) ) ELSEIF @trans == 2 x = real( @c1 * @fn1( #z + @c2 * @fn2( #z + @c3 * @fn3( #z ) ) ) ) y = real( @c1 * @fn1( #z + @c2 * @fn2( #z + @c3 * @fn3( #z ) ) ) ) ELSEIF @trans == 3 x = ( @c1 * @fn1( 6 * @c2 / @fn2( @c3 / @fn3(#z) ) ) ) y = ( @c1 * @fn1( 6 * @c2 / @fn2( @c3 / @fn3(#z) ) ) ) ELSEIF @trans == 4 x = 1.2*@c1*cabs(@c2*@fn1(@c3*#z)) y = 1.2*@c1*atan2(@c2*@fn1(@c3*#z)) ELSEIF @trans == 5, rad = cabs(@fn1(#z)), alpha = abs(atan2(@fn2(#z))) orad = rad rad = rad + 1.5*@c1 * sin(6*@c2 * alpha) alpha = alpha + 1.5*@c1 * cos(6*@c2 * orad) x = rad * cos(@c3*alpha) y = rad * sin(@c3*alpha) ELSEIF @trans == 6 x = @c1 * real(@fn3(@c2 * imag(@c3*@fn1(#z)))) y = @c1 * real(@fn3(@c2 * imag(@c3*@fn2(#z)))) ELSEIF @trans == 7 x = @c1 * real(@fn3(@c2 * real(@c3*@fn1(#z)))) y = @c1 * imag(@fn3(@c2 * imag(@c3*@fn2(#z)))) ELSEIF @trans == 8 theta = abs(atan2(@c2*@fn2(#z))) alpha = 1 + (theta)^3 x = 3*@c1 * theta/alpha y = 3*@c1 * sqr(@c3*theta)/alpha ELSEIF @trans == 9 theta = cabs(atan(@c2*@fn2(#z))) alpha = 1 + theta^4 x = 3*@c1 * theta/alpha y = 3*@c1 * sqr(theta)/alpha ENDIF w = x + flip(y) ;------------------------------------------------------------------- ; pick a coordinate system ;------------------------------------------------------------------- IF @coord == 1 rad = cabs(w) theta = abs(atan2(w)) x = rad y = theta ELSEIF @coord ==2 rad = cabs(w) x = rad * cosh(real(w)) y = rad * sinh(imag(w)) ELSEIF @coord ==3 rad = cabs(w-#pixel) x = rad * cos(real(w)) y = rad * sin(imag(w)) ENDIF ;------------------------------------------------------------------- ; calculate the z variable ;------------------------------------------------------------------- z= @zsx * @fnx(x * @zpx) + @zsy * @fny(y * @zpy) ;------------------------------------------------------------------- ; calculate the distance perturbed and filter out the least value ;------------------------------------------------------------------- radius=cabs(#z-z) IF(radius0 repeat w = (@p*w - @off/(w^@p))/(@p+@off) nw = nw + 1 until nw >= @it endif z = w*(@scale + @fuzz*#rand) radius=cabs(#z - z + @push) IF(radius 1, dind = (dind)- floor(dind), endif final: #index = cabs(dind) + log(#numiter)/10 default: title = "First-rsp" func fn1 caption = "coloring function" default = atanh() endfunc param iters caption = "color loop iter" default = 5 endparam param str caption = "color loop step" default = 1.0 endparam } newfin(BOTH) { init: float n = 1 float zmin = 1e12 float ztemp = 0 float zmax = 0 float x = 0 float y = 0 loop: n = n+1 x = real(fn1(#z)) y = imag(fn2(#z)) ztemp = cabs(#z-x - flip(y)) if ztemp < zmin, zmin = ztemp, endif if x > zmax || y >zmax, zmax =cabs(x+flip(y)),endif final: #index = zmin;*exp(log( n)*log((1/n))-log(n))*zmax default: title = "newfin" } QuadColor(BOTH) { init: if real(#pixel) > 0 if imag(#pixel) > 0, float quad = 1, endif if imag(#pixel) < 0, float quad = 4, endif else if imag(#pixel) > 0, float quad = 2, endif if imag(#pixel) < 0, float quad = 3, endif endif float q1 = 0, float q2 = 0, float q3 = 0, float q4 = 0 float n = 0, float m = 0, float quad =0, FLOAT BIC = 0 loop: n = n +1 oldquad = quad ; Determine quadrant of current iterate if real(#z) > 0 if imag(#z) > 0, quad = 1, endif if imag(#z) < 0, quad = 4, endif elseif real(#z) <0 if imag(#z) > 0, quad = 2, endif if imag(#z) < 0, quad = 3, endif endif ; Sum of the quadrant touches if quad == 1, q1 = q1 + 1 elseif quad == 2, q2 = q2 + 1 elseif quad == 3, q3 = q3 + 1 elseif quad == 4, q4 = q4 + 1 endif ;number of quadrant changes if oldquad == quad, M=M, ELSE, m = m+1, endif complex oz = #z final: if @meander == 0, bic = m/n elseif @meander == 1, BIC = cabs(#z-oz)*(q1+q2);((m-q1)/(n-m)) elseif @meander == 2, if ((q1+q2) < (q3+q4)), BIC = cabs((q1+q2)/(q3+q4) + (m%n)/n), else, BIC = cabs((q3+q4)/(q1+q2) + (m%n)/n), endif elseif @meander == 3, BIC = (q1-q2)*(q3-q4)/(q3-q2)/(q1-q4) endif ;if bic > 1, bic = bic-1, elseif bic <1, bic = bic +1, endif #INDEX = BIC default: title = "QuadColor" param meander enum = "Q-C Ratio" "cross ratio""mobius" "cross 2" default = 0 endparam param scale default = 1.0 caption = "density scale" endparam } rp-AS-x22(BOTH) { init: float rmin = 1e6 complex z = 0 float radius = 0 int c = 1 loop: c=c+1 z = fn1(1/fn2(1/fn3(#z - #pixel/@p))) radius = @sc*cabs((fn4(z - #z/c) + @push)*(1+@fuzz*#rand)) IF(radiusrmax) rmax = radius/@maxdiv zmag_max = cabs(z) iter_max = c/@iterdiv rz_max = real(#z) iz_max = imag(#z) ang_max = atan2(#z)/(2*#pi)+1 ENDIF final: if @colorby == 0, #index = rmin elseif @colorby == 1, #index = zmag_min elseif @colorby == 2, #index = iter_min elseif @colorby == 3, #index = rz_min elseif @colorby == 4, #index = iz_min elseif @colorby == 5, #index = ang_min elseif @colorby == 6, #index = rmax elseif @colorby == 7, #index = zmag_max elseif @colorby == 8, #index = iter_max elseif @colorby == 9, #index = rz_max elseif @colorby == 10, #index = iz_max elseif @colorby == 11, #index = ang_max endif default: title = "rp-AS-x23" param function enum = "1" "2" "3" "4" "5" "6" default =0 caption = "Stress Type" endparam param colorby enum = "min dist" "min zmag" "min iter" "min real" "min imag" "min angle"\ "max dist" "max zmag" "max iter" "max real" "max imag" "max angle" default =0 caption = "Color Using:" endparam param p, caption = "Pixel Divisor", default = 1.0, endparam param sc, caption = "Distance Scaler", default = 1.0, ENDPARAM param push, caption = "Radius Push", default = 0.0, ENDPARAM param fuzz, caption = "Fuzz Factor", default = 0.0, endparam param iterdiv, caption = "MaxMin Iter Divider", default = 100.0, endparam param maxdiv, caption = "Max dist Divider", default = 1.0, endparam func fn1, caption = "Outside Function", default = cabs(), endfunc func fn2, caption = "Middle Function", default = sqr(), endfunc func fn3, caption = "Inner Function", default = atanh(), endfunc func fn4, caption = "Radius Function", default = cotan(), endfunc }