修改了那段费解代码,按下面代码作,在UF中对照了一下,好象与UF中的效果一致。
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
}
我按此代码作出图后,逃逸区,参数值与面板上的值不完全一致,有问题。这变种图是:
|