我将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