好久没看过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
} |