UF中的另一问题,也困扰着我好几天了,我将UF中的代码及效果图帖于此,再将我作的图帖于此,两相比较会发现,图有差别,但找不到原因何在,大家帮忙找找看。
该分形位于rab.ufm中的Cayley-mand。代码如下:
Cayley-mand {
; Ron Barnett, February 1999
; based upon the formula z = z^3 - az - c + 1
; convergence methods added 10/2/2004
init:
complex fz = 0
complex fzp = 0
complex fzp2 = 0
#z = 0
complex oldz = 0
complex a = #pixel
float iterate = 0
loop:
iterate = iterate + 1
oldz = #z
fz = #z^3 - a*z - a + 1
fzp = 3*#z^2 - a
fzp2 = 6*#z
if @converge == 0 ; Newton
#z = #z - fz/fzp
elseif @converge == 1 ; Householder
#z = #z - fz/fzp*(1 + fz*fzp2/(2*fzp^2))
elseif @converge == 2 ; Halley
#z = #z - 2*fz*fzp/(2*fzp^2 - fz*fzp2)
elseif @converge == 3 ; Schroder
#z = #z - fz*fzp/(fzp^2 - fz*fzp2)
elseif @converge == 4 ; Ho custom
#z = #z - fz/fzp*(1 + fz*fzp2/(@custom*fzp^2))
elseif @converge == 5 ; Ha custom
#z = #z - 2*fz*fzp/(@custom*fzp^2 - fz*fzp2)
elseif @converge == 6 ; H_S custom
#z = #z - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2)
elseif @converge == 7 ; Mixed1
if iterate % 2 == 0
#z = #z - fz/fzp*(1 + fz*fzp2/(2*fzp^2))
else
#z = #z - fz/fzp
endif
elseif @converge == 8 ; Mixed2
if iterate % 2 == 0
#z = #z - 2*fz*fzp/(2*fzp^2 - fz*fzp2)
else
#z = #z - fz/fzp
endif
elseif @converge == 9 ; Mixed3
if iterate % 2 == 0
#z = #z - fz*fzp/(fzp^2 - fz*fzp2)
else
#z = #z - fz/fzp
endif
elseif @converge == 10 ; Mixed4
if iterate % 2 == 0
#z = #z - @custom*fz*fzp/(@custom*fzp^2 - fz*fzp2)
else
#z = #z - fz/fzp
endif
endif
bailout:
|#z - oldz| >= @bailout
default:
title = "Cayley Mandel"
maxiter = 1000
center = (0.3593516980975, 0)
magn = 360
method = multipass
periodicity = 0
heading
caption = "Cayley Mandelbrot"
endheading
$ifdef VER40
heading
text = "This is a 'convergent' fractal that uses multiple convergence \
methods and has Mandelbrot-like regions for several convergence methods."
endheading
$else
heading
caption = "This is a 'convergent' fractal"
endheading
heading
caption = "that uses multiple convergence"
endheading
heading
caption = "methods and has Mandelbrot-like regions"
endheading
heading
caption = "for several convergence methods."
endheading
$endif
param version
caption = "Formula Version"
default = 1.0
hint = "You should never see this parameter; it's used internally to track \
which version of the formula was used to create your image, so that \
if a bug is found which breaks backwards-compatibility, the formula \
can adapt transparently."
visible = false
endparam
param bailout
caption = "Bailout value"
default = 0.000001
endparam
heading
caption = "Convergence Methods"
endheading
param converge
caption = "Convergence Method"
default = 0
enum = "Newton" "Householder" "Halley" "Schroder" "Ho Custom" \
"Ha Custom" "H_S Custom" "Mixed1" "Mixed2" "Mixed3" "Mixed4"
endparam
float param custom
caption = "H_S Constant"
default = 1.5
visible = @converge==4 || @converge==5 || @converge==6 || @converge==10
endparam
switch:
type = "Cayley-jul"
bailout = @bailout
converge = @converge
p1 = #pixel
custom = @custom
} |