UF范例二:Alternating (位于ahm.ufm中)
Alternating {
; Alternates the iterations between "z^2", "z^2 + c", "z + c", and
; "z^2 + c" again. Plans include changing the period via parameter.
init:
z=@Perturb c=#pixel
loop:
IF (@Period == 0)
z=z*z
z=z*z + c + c
z=z*z + c
柳烟注:这里的(@Period == 0)与后面的(@Period == 1)等均为开关项,相当于拉第一个开关,产生一个复分形,拉另一个开关,又产生另一个不同的复分形,此程序后面的Period
caption="Period"
enum="z^2, z^2+c, z+c, z^2+c" "z+c, z^2+c, z^2, z^2+c" "z+c, z^2, z^2, z+c, z^2"
其中enum部分没多大意义,其实这三个引号内的部分就是开关,你点开UF面板去找找,就心明如镜了。能不能象UF一样,在画板中将这三个复分形造来由开关控制?能。不过,有时文件过于庞大,过于复杂,我喜欢一个个造。这个分形,造在一个文件中,估计能扫得动,大家可先开动开动脑筋。当你只造第一个开关项的复分形时,后面的IF部分,就不要理了。
ELSEIF (@Period == 1)
z=z + c
z=z*z + c
z=z*z
z=z*z + c
ELSEIF (@Period == 2)
z=z+c
z=z*z
z=z*z
z=z+c
z=z*z
ENDIF
bailout:
|z| < @Bailout
default:
center=(-0.25,0)
magn=1.5
title="Alternating"
float param Bailout
default=4
min=1
hint="Upper limit of absolute value for points in the set."
endparam
complex param Perturb
caption="Perturbation"
default=(0,0) hint="This allows you to change the initial value."
endparam
param Period
caption="Period"
enum="z^2, z^2+c, z+c, z^2+c" "z+c, z^2+c, z^2, z^2+c" "z+c, z^2, z^2, z+c, z^2"
default = 2
hint = "This is the mapping that is repeated. They are all \
combinations of squaring and constant addition.The first two \
options look alike, but with different perturbations they \
produce different results."
endparam
}
大家按我前面说的,这里的Bbaiout=4
z=@Perturb中,Z的初值为(0,0) |