我将UF中的复分形陷阱文件,抽出M集陷阱,代码如下:
juliatrap1(BOTH) {
; By Samuel Monnier, 1999
init:
float dz = 0.0
float stdz = 0.0
start = @seed
loop:
trz = exp(flip(-pi/180*@rot))*(#z-@center)/@size
x = 1/sqrt(@r)*real(trz)
y = sqrt(@r)*imag(trz)
if @freq != 0
x = 2*sin(2*pi*@freq*x)
y = 2*sin(2*pi*@freq*y)
endif
start = x + flip(y)
iter = @niter
zz = @seed
float i = 0
while i < @niter
i = i + 1
zz = zz^2 + start
if |zz| > 1e20
iter = i
i = @niter
endif
endwhile
float logp = 1/log(2)
float logb = log(log(1e20))
dz = real(iter + logp*logb - logp*log(log(cabs(zz))))
if dz >stdz
stdz = dz
endif
final:
#index = .1*stdz
default:
title = "Copy of Julia Trap"
helpfile = "sam-help/juliatrap.htm"
param seed
caption = "Seed (for 'custom')"
default = (0,0)
endparam
param center
caption = "Center"
default = (1,1)
endparam
param rot
caption = "Rotation"
default = -30.0
endparam
param size
caption = "Size"
default = 0.38750
endparam
param r
caption = "Ratio Width/Heigh"
default = 1.0
endparam
param @niter
caption = "Julia Iterations"
default = 100
endparam
param freq
caption = "Trap Frequency"
default = 0.0
endparam
}
此代码,我用于谢氏三角形,得到上楼效果,但我将其用于牛集时,连无数小乌龟影子都没看到,怪哉。 |