1#柳烟
UF范例1:(位于ahm.ufm中)
ChaosbrotJulia {
;Julia set of the "Chaosbrot" fractal.
;This once was on Wikipedia, but it got deleted.
lease petition at Talk:Chaosbrot to get it reinstated! Please!
;And I didn't even invent them!!!
init:
c=@Constant(柳烟注:这是J集,J集最后是对z赋色,所以c应定位于一固定的点。横标是什么呢?代码后面可看到Constant,后面的值就是。)
z=#Pixel
loop:
x=Real(z)
y=Imag(z)
xTemp=x^2 - y^2
y=@J*x*y
x=xTemp
z=x + y*1i + cbailout:
|z|<=@Bailout(|z|,相当于精典M集讲义中的z’的模,但这里应按UF中的约定行事。)default:
title="Chaosbrot (Julia)"
float param Bailout
default=10(这是阈值。大家看到我源文件中的baiout,就知这是阈值。)
画板中的M集与J集的逃逸参数:p=0.5*(1-sgn(0.5+sgn(|z|-baiout))) endparam
complex param J
caption="J"
hint="This is the unnamed parameter that primarily determines the fractal."
default=1.5(这是J的值,但是我看面板,发现那里的J不是一个实数,而是一个复数,而这里只是个特殊情况,所以决定造得更一般化。看代码应结合面板进行,有时代码不太明白的参数,一看面板上的,就了然了。) endparam
complex param Constant hint="This is the 'normal' parameter for the Julia Set, where its value \
corresponds with a point in the M-Set, yada yada."
default=(0.317,0.647)(柳烟注:这就是c的定位值。)
endparam
switch:
type="ChaosbrotMandel"
Perturbation=#pixel
J=J
}作者: 柳烟 时间: 2011-1-18 23:18
UF中该系列的旁边的ChaosbrotMandel 的代码:
ChaosbrotMandel {
;It was sad day when this page was deleted from Wikipedia.
;Tip: In general, The Julia sets look a lot better than the M-Sets.
init:
c=#pixel
z=@Perturbation
loop:
x=Real(z)
y=Imag(z)
xTemp=x^2 - y^2
y=@J*x*y
x=xTemp
z=x + y*1i + c
bailout:
|z|<=@Bailout
switch:
type="ChaosbrotJulia"
Constant=#pixel
J=J
default:
title="Chaosbrot (Mandelbrot)"
center=(-0.5,0)
float param Bailout
default=20
endparam
complex param J
caption="J"
hint="This is the unnamed parameter that primarily determines the fractal."
default=0.6
endparam
complex param Perturbation
default=(0,0)
endparam
}
这是个M集,大家可比照前面范例,轻二易举地造出该M集,因为迭代公式完全一样,可完全比照精典M集的逃逸时间算法,将其用画板搞出。作者: 柳烟 时间: 2011-1-19 00:20
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)作者: xiaongxp 时间: 2011-1-19 00:53
param start
caption = "Starting point"
default = (0,0)
hint = "Perturbation. Use (0,0) for the standard Mandelbrot set."
(这告诉你z的定位的横纵坐标,与面板上的一致,这定位点,你可改换其它的定位坐标试试,说不定会看到比面板上还美的分形。)
endparam
param power
caption = "Power"
default = (2,0)
hint = "This defines the power of the Mandelbrot set. Use (2,0) \
for the standard Mandelbrot set."
(这是前面loop:
z = z^@power + #pixel中,z的指数。)
endparam
param bailout
caption = "Bailout value"
default = 4.0(这是阈值)
hint = "Defines how soon an orbit bails out, i.e. doesn't belong \
to the inner set anymore."
endparam
switch:
type = "MoebiusJulia"
seed = #pixel
power = power
bailout = bailout
limit = limit
mode = mode
Newton {
;
; Standard Newton fractal.
;
(这是常规N集,代码简单,通过看这种代码,便于熟悉UF的代码格式及意义,对解读复杂代码,并用画板造复杂分形打下基础。万丈高楼平地起。如果果复函数为f(z),则牛迭的迭代式为z-f(z)/f’(z)如果f(z)=z^3,导函数f’(x)=3z^2,则牛迭的迭代式为:z-(z^3-1)/3z^2,其余仿此)init:
z = pixel
loop:
zold = z
z = ((p1 - 1) * z^p1 + @r) / (p1 * z ^ (p1 - 1))
(p1的值后面有告诉,为可变参数,(3,0),@r的值后面有告诉。)
bailout:
|z - zold| >= 0.00001
(注意,这步与M集的p值不一样,这里的p=0.5*(1-sgn(0.5+sgn(|z - zold|-0.00001))),此式右边的0.00001即为阈值,也就是面板上的bailout)
default:
title = "Newton"
helpfile = "Uf3.chm"
helptopic = "Html\formulas\standard\newton.html"
maxiter = 100
param p1
caption = "Exponent"
default = (3,0)
hint = "Specifies the exponent of the equation that is solved by \
Newton's method. Use real numbers (set the imaginary component \
to zero) to obtain classic Newton fractals."
endparam
param r
caption = "Root"
default = (1,0)
(这是@r值。)
hint = "Specifies the root of the equation that is solved. Use larger \
numbers for slower convergence."
endparam
}作者: 柳烟 时间: 2011-1-23 15:31
carr2003的制作:
Carr2003 {
; Updated for UF2 by Erik Reckase, March 2000
; Modified Sylvie Gallet frm. [101324,3444], 1996
init:
z=c=pixel, z1=imag(p1-cos(pixel))*z-p2
int iter=0, int limit=round(real(p1)), float bailout=16
loop:
IF (iter==limit)
z = z1, c = p3
ENDIF
z=z*z+c
iter=iter+1
bailout:
|z| <= bailout
default:
title = "Carr 2003"
periodicity = 0
maxiter = 500
magn = 1.3
center = (-.4,0)
method = multipass
param p1
caption = "Iter Lim/Julia Scale"
default = (50,1)
hint = "The real part of this parameter acts as an \
iteration limit, where the formula's calculation \
changes. The imaginary part of this parameter \
scales the Julia structure."
endparam
param p2
caption = "Julia Center"
default = (-0.3,0)
endparam
param p3
caption = "Julia Params"
default = (-0.65,-0.4)
endparam
}
程序很易解读,结合下楼的视频,相互参照,易造出此分形。这一分形,经历过无数失败与多人研究,才得以成功。UF分形的画板制作,我与此版的朋友,费了尽一年的心血研究UF分形,几乎业余时间都坐在电脑前,按UF程序造复分形,其中的兄味,如人饮水,冷热自知。作者: 柳烟 时间: 2011-2-10 19:52
;
; Mutation of 'M-SetInNewton'.
; Fractint and UF versions by Bradley Beacham
; Original formula by Jon Horner [100112,1700]
; For 'M-SetInNewton', use defaults
;
; See blb.txt for comments.
; 18 April 2003
;
init:
if @ThisMode == "Mandelbrot"
z = (0,0)
c = @CFunc(#pixel)
else ;Julia
z = #pixel
c = @CFunc(@seed)
endif
complex c1 = c - 1
complex k = @ConInit
complex k1 = k - 1
complex LastZ = (0,0)
complex nm = (0,0)
complex dn = (0,0)
Carr2056 {
; Updated for UF2 by Erik Reckase, March 2000
; Modified Sylvie Gallet frm.
init:
z=conj(pixel)^4-tan(.0002/pixel)-sin(.0002/pixel)
c=(-.7456,-.03)+.009/pixel
float compt=0, float limit=real(p1*cos(pixel/5))
float bailout=4
loop:
IF (compt>=limit)
c = (-.745680900000982,-.131850030300002)
ENDIF
z=z*z + c
compt=compt+1
bailout:
|z|<=bailout
default:
title = "Carr 2056"
periodicity = 0
maxiter = 500
magn = 1.3
center = (0,0)
method = multipass
param p1
caption = "Iter Limit"
default = (100,0)
hint = "This iteration limit is scaled by the cosine of \
the current pixel divided by 5. The real part of \
this scaled iteration limit signals a change in the \
value of c."
endparam
} http://u.115.com/file/f6c0dbd92e# Carr2056.gsp (33.04 KB)
Carr1960 {
; Updated for UF2 by Erik Reckase, March 2000
; Modified Sylvie Gallet frm.
init:
z=c=1/(pixel-conj(1/pixel)-flip(1/pixel))
int compt=0, int limit=round(real(p1)), float bailout=4
loop:
IF (compt>limit)
c = (-.743380900000982,-.131850030300002)
ENDIF
z=z*z+c
compt=compt+1
bailout:
|z|<=bailout
default:
title = "Carr 1960"
periodicity = 0
maxiter = 500
magn = 1
center = (0,0)
method = multipass
param p1
caption = "Iter Limit"
default = (100,0)
hint = "The real part of this parameter signals a change \
in the value of c. The imaginary part is not used."
endparam
} http://u.115.com/file/f6d0cc5337# Carr1960.gsp (48.89 KB)