Cayley-jul {
; Ron Barnett, February 1999
; based upon the formula of Mark Townsend
init:
complex fz = 0
complex fzp = 0
complex fzp2 = 0
#z = #pixel
oldz = 0
a = @p1
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 Julia"
maxiter = 1000
center = (0, 0)
magn = 32
method = multipass
periodicity = 0
heading
caption = "Cayley Julia"
endheading
$ifdef VER40
heading
text = "This is a 'convergent' fractal that uses multiple convergence \
methods and has Julia-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 Julia-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
param p1
caption = "Parameter 1"
default = (0.360968017578125,0.00074462890625)
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-mand"
bailout = @bailout
converge = @converge
custom = @custom
}
Cayley-jul-NEWTON.gsp (22.09 KB)
|