- UID
- 7
- 帖子
- 2888
- 精华
- 10
- 积分
- 2836
|
这是UF中一个当型循环比较简单的范例,可一直没办法用几何画板来实现,请大家一起想想办法。如何使几何画板也能实现这类分形。
Lacunary1_M {
; iteration of f(z) = c + z + z^2 + z^4 + ... + z^(2^n)
init:
if (@degree==1)
z = -0.5
elseif (@degree==2)
z = -0.38545849852963
elseif (@degree==3)
z = -0.3828986970212
else
z = -0.38289643077689
endif
loop:
complex summand = z
int k=0
z = z+#pixel
while (k<@degree)
summand = sqr(summand)
z = z + summand
k = k+1
endwhile
bailout:
|z| < @bailout
default:
title = "Lacunary 1 Mandel"
int param degree
caption="degree n"
hint="If your coloring algorithm requires a 'power' or 'exponent', set it to 2^n. \
If you use large values here, you may have to set a small bailout or increase the precision."
default=2
min=1
endparam
float param bailout
caption = "Bailout value"
hint = "Iteration stops when z becomes larger than this bailout."
min=0
default=1e4
endparam
switch:
type="Lacunary1"
c=#pixel
degree=degree
bailout=bailout
} |
|