142# changxde
这个代码精简得不错。改变代码中的中心角度数为90度,扫出的图不正常。中心角为120度正常。稍稍修正一下,则正常并与UF中的效果图没什么两样。
KochCurvecir {
init:
z = #pixel
int i=0
loop:
i = i+1
arg = atan2(z)
arg2 = 2*pi/@n*round(@n*arg/(2*pi))
if i > 1 && arg2 == 0
if arg>0
arg2 = 2*pi/@n
else
arg2 = -2*pi/@n
endif
endif
if |z|>1
z = z*exp(-1i*arg2)
z = - @s*z + (1 +@s)
endif
bailout:
|z|>1
default:
title = "Circly Koch Curve"
helpfile = "sam-help/kochcurves.htm"
magn = .5
center = (0.00021,0.0002)
maxiter = 20
periodicity = 0
param n
caption = "Magnification step"
default = 4
endparam
param s
caption = "Magnification step"
default = 1.7
endparam
}
这代码好象也方便分区法造? |