返回列表 回复 发帖
http://www.tech-ex.com/learning/swdiy/00412240.html
这里有东东,我先学学这个线的迭代希儿伯特曲线。
希尔伯特曲线.gsp (9 KB)
未命名.GIF
在那个类别中,我空了去看看,如果代码过于吓人,我也要打退堂鼓了。UF中有几个分形,确实太美,里面的程序长得很,有6个页面之多,条件判断多,有些语句至今仍是玛雅文字,不知何意,只好望洋兴叹了。
位于drd.ufm中:
pseudobrot_generalized {
  init:
    z = #pixel
    v = #pixel
    c = #pixel
  loop:
    d = v^2/c^2
    z = fn1(fn2(1-d))
    v = #pixel
    c = d^z
  bailout:
    |z| <= 4
  default:
    title = "pseudobrot_generalized"
    method = multipass
    maxiter = 100
    func fn2
      caption = "Primary function"
      hint = "This is the first function applied"
      default = sqrt()
    endfunc
    func fn1
      caption = "Secondary function"
      hint = "This is the second function applied"
      default = sqr()
    endfunc

}
Fractal2.png
乍看代码不烦,可我干了大半天,弄出的图总是有众多白色块溢出。
19# 榕坚
如何补的?此分形奇怪。
dmj-NovaIJulia {
;
; This is the Nova fractal (Julia form), a
; modified Newtonian-style fractal.  The formula
; was first shown to me by Paul Derbyshire (who
; named it Nova).  It has also appeared elsewhere
; under other names.  If you leave the Julia
; seed at the default (0,0), you can use this as
; a general Newton-style fractal as in FractInt.
;
; This variant uses Kerry Mitchell's inverted
; computation so that it works with coloring
; methods expecting divergent z.
;
init:
  complex zsquared = (0,0)
  complex zcubed = (0,0)

  complex zcurrent = #pixel
  z = (0,0)
  
loop:
  IF (@power == (3,0)); special optimized routine for power 3
    zsquared = sqr(zcurrent)
    zcubed = zsquared * zcurrent
    z = @relax * (zcubed-1) / (3*zsquared) - @seed
    zcurrent = zcurrent - z
    z = 1/z
  ELSE
    z = @relax * (zcurrent^@power-1) / (@power * zcurrent^(@power-1)) - @seed
    zcurrent = zcurrent - z
    z = 1/z
  ENDIF
  IF (@fudge == true &&\
      |z| > 4); fudging angle
    z = z * zcurrent/cabs(zcurrent)
  ENDIF
  
bailout:
  |z| < @bailout
  
default:
  title = "Nova-I (Julia)"
  helpfile = "dmj-pub\dmj-pub-uf-ni.htm"
  maxiter = 1000
  periodicity = 0
  center = (0,0)
  magn = 1.5
  
  param seed
    caption = "Julia Seed"
    default = (0,0)
    hint = "This is the Julia seed, a constant parameter which \
            defines the shape of the fractal."
  endparam
  param power
    caption = "Exponent"
    default = (3,0)
    hint = "Overall exponent for the equation.  (3,0) gives \
            the classic NovaM type."
  endparam
  param bailout
    caption = "Bailout"
    default = 10000.0
    hint = "Bailout value; larger values will cause more \
            iterations to be done for each point."
  endparam
  param relax
    caption = "Relaxation"
    default = (1,0)
    hint = "This can be used to slow down the convergence of \
            the formula."
  endparam
  param fudge
    caption = "Fudge z Angle"
    default = false
    hint = "Modifies angle of z based on starting point. \
            Turning this on will make decomposition more \
    consistent between iterations, regardless of \
    the root converged on."
  endparam

switch:
  type = "dmj-NovaIMandel"
  power = @power
  bailout = @bailout
  relax = @relax
  fudge = @fudge
}
位于dmj.ufm中,代码看似不长,算起来长。数据我已弄好,可就是扫出的没多少东西,不对劲。不知是不是fudge这个变量我没用对,实不知该如何用。
Nova-I (Julia).gsp (65.23 KB)

Nova-I (Julia).gsp (112.81 KB)

23# 榕坚
这两天老是碰到数据溢出,且漏洞不好补,还碰到扫出的图怪怪的。
25# 榕坚
好象是想在常规牛集中,引入一些参数改变一点算法,即所谓Nova分形。
这个分形原来做过,与UF中的一比较,总有些差别。这个分形困扰到现在,没获圆满解决,今天我重作此分形,结果差别更加大了,从代码看,并不难解,但就是不成。这是代码:
Carr2382(YAXIS) {
; Updated for UF by Erik Reckase, March 2000
                  ; Modified Sylvie Gallet frm.
init:
  pixel2=-abs(real(pixel))+flip(imag(pixel))
  c=(-.8006,-.1645)
  z=pixel2^6-(atan(1/pixel2)-cabs(acos(2/pixel2)))^-6-.09
  d1=flip(-.00060756/pixel2+flip(.0001/pixel2))
  iter=0, nextzoom=iterspace=real(p1)
loop:
  IF (iter==nextzoom)
    z=0, c=p2*c + p3
    nextzoom=nextzoom + iterspace
  ENDIF
  c=c + d1
  z=z*z + c
  iter=iter + 1
bailout:
  |z| <= 16
default:
  title="Carr 2382"
  periodicity=0
  maxiter=2000
  magn=1.4
  center=(0,0)
  method=multipass
  param p1
    caption="Nextzoom"
    default=128
    hint="The number of iteration steps between value resets."
  endparam
  param p2
    caption="C-Mult"
    default=(1.2,.1)
    hint="C is mutliplied by this value when the number of \
            iterations equals nextzoom (p1)"
  endparam
  param p3
    caption="C-Add"
    default=(-.05,-.06)
    hint="This value is added to C when the number of \
            iterations equals nextzoom (p1)"
  endparam
}
Fractal2.jpg
我原来扫出的图是:
未命名.jpg
邻近的Carr2379等几个,用画板造不能做到与UF中的一致,至少有百分之二十不一致。
返回列表