juliatrap(BOTH) {
; By Samuel Monnier, 1999
init:
bool first = true
count = 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
trz = x + flip(y)
zz = trz
float i = 0
iter = @niter
float dz = 0.0
start = zz
zz = @seed
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 first
stdz = dz
first = false
elseif dz > stdz
stdz = dz
endif
final:
#index = .1*stdz
default:
title = "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
}
更新了代码。 |