好久没看过UF中的范例了,昨晚打开后,看到一个以前似没见过的新图,试作之,弄不出正品。程序中间有一段循环的子程序,我先将这子程序进行迭代,搞出终点后,再进行下一步的迭代,扫出的图十万八千。大家拾柴火焰高,我将代码与图帖上,没事时大家作作。此分形位于pdf.ufm中。代码不算复杂。
pgd_Mandelnewton {
; Iterates Newton's method for roots of (((c^2+c)^2+c)^2+c)^2+c... = 0.
; The number of nested Mandelbrot iterations is determined via parameter.
; The higher the number the "busier" the fractal, and the more the
; outlines of the M-set are revealed. The fractals themselves are
; Julia sets with 2^n basins of attraction.
; All points bail out. Use decomp, iterations, or similar color methods.
; Orbit traps might be interesting too.
init:
z = #pixel
float b = 1/@bailout
float b2 = b*b
complex zz = z
loop:
complex oz = z
complex zd = 1
int i = 1
WHILE (i < @numi)
i = i + 1
zd = 2*zd*z + 1
z = sqr(z) + oz
IF (|zd| > @bailout)
i = @numi
ENDIF
ENDWHILE
; z is now m(oz) and zd is m'(oz), with m(x) = (x^2+x)^2+x...
z = oz - (z/zd) ; Apply Newton's method once
IF (@zeroinside)
IF (|z| < b2)
z = zz ; Trap z
ENDIF
ENDIF
bailout:
|z - oz| > b
default:
title = "Mandelnewton Julia sets"
periodicity = 0
maxiter = 1000
center = (-0.5,0)
param numi
caption = "Order"
default = 6
min = 1
endparam
param zeroinside
caption = "A(0) inside"
default = false
endparam
param bailout
caption = "Bailout"
default = 100000
min = 0
endparam
}作者: 柳烟 时间: 2011-11-26 08:39
这个嵌套子迭代也有趣得紧
代码:
Lacunary1_M {
; iteration of f(z) = c + z + z^2 + z^4 + ... + z^(2^n)
init:
if (@degree==1)
z = -0.5
elseif (@degree==2)
z = -0.38545849852963
elseif (@degree==3)
z = -0.3828986970212
else
z = -0.38289643077689
endif
loop:
complex summand = z
int k=0
z = z+#pixel
while (k<@degree)
summand = sqr(summand)
z = z + summand
k = k+1
endwhile
bailout:
|z| < @bailout
default:
title = "Lacunary 1 Mandel"
int param degree
caption="degree n"
hint="If your coloring algorithm requires a 'power' or 'exponent', set it to 2^n. \
If you use large values here, you may have to set a small bailout or increase the precision."
default=2
min=1
endparam
float param bailout
caption = "Bailout value"
hint = "Iteration stops when z becomes larger than this bailout."
min=0
default=1e4
endparam
switch:
type="Lacunary1"
c=#pixel
degree=degree
bailout=bailout
}