返回列表 回复 发帖
100# lnszdzg
      在几何画板中,可通过设置动态迭代次数来提速,即在需要精细扫描的地方使用大迭代次数,其余地方设为较小的迭代次数。
Mathcad中,放大倒不是太难,但中心的选择比较难
New.jpg
New.jpg
New.jpg
Mathcad中,放大倒不是太难,但中心的选择比较难
lnszdzg 发表于 2014-5-31 20:00
定位中心一般选择在边界分枝尖点、边界分枝连接点、螺旋中心。这些点在M集中叫Misiurewicz点,它附近必有一个小M集(数学家谭蕾证明了围绕小M集的边界分枝交点列的维数,当n→∞时以2为极限)。
New.jpg
New.jpg
六切圆
New.jpg
UF代码及效果
6Circles {
init:
  int iter = 0
  float num = 5
  float Xabs = 0
  float Yabs = 0
  float Dsgd0 = 0
  float Dsgd1 = 0
  float Circle = 0
  float ZtoPsqd = 0
  float Rc = @r
  float Phi = #pi /6
  float Rm = Rc * sin(Phi)
  float RcSqd = Rm^2
  bool Trapped = false
loop:
  iter = iter + 1
  if iter > @skip && !Trapped
    Xabs = abs(real(#z))
    Yabs = abs(imag(#z))
    Dsgd0 = (Xabs-Rc*sin(phi))^2 + (Yabs - Rc*cos(phi))^2
    Dsgd1 = (Xabs-Rc*sin(3*phi))^2 + (Yabs - Rc*cos(3*phi))^2
    if Dsgd0 < RcSqd
      Trapped = true
      ZtoPsqd= Dsgd0
        Circle = iter
    elseif Dsgd1 < RcSqd
      Trapped = true
      ZtoPsqd= Dsgd1
        Circle = iter
   endif
endif
final:
  if !trapped
    #solid = true
  else
    Circle = ((Circle + @off) % num)/(num-1)
    float Ratio = sqrt(ZtoPsqd/Rcsqd)
    float ColorIndex = 110 * Ratio + Circle * 140
    #index = (ColorIndex + 1) % 256 /256
  endif
default:
  title = "6 Circles"
  param r
    caption = "Circle radius"
    default = 0.4
  endparam
  param skip
    caption = "Iters to skip"
    default = 0
    hint = "Iterations to skip."
  endparam
  param off
    caption = "Hue cycle"
    default = 0
    min = 0
    max = 7
    hint = "This rotates the coloring order of the balls."
  endparam
}

New.jpg
七切圆陷阱
7Circles {
init:
  int iter = 0
  float num = 5
  float Xabs = 0
  float Yabs = 0
  float Dsgd0 = 0
  float Dsgd1 = 0
  float Dsgd2 = 0
  float Circle = 0
  float ZtoPsqd = 0
  float Rc = @r
  int n1 = @n
  float Phi = #pi /n1
  float Rm = Rc * sin(Phi)
  float RcSqd = Rm^2
  bool Trapped = false
loop:
  iter = iter + 1
  if iter > @skip && !Trapped
    Xabs = abs(real(#z))
    Yabs = abs(imag(#z))
    Dsgd0 = (Xabs-Rc*sin(phi))^2 + (Yabs - Rc*cos(phi))^2
    Dsgd1 = (Xabs-Rc*sin(3*phi))^2 + (Yabs - Rc*cos(3*phi))^2
    Dsgd2 = (Xabs-0)^2 + (Yabs - 0)^2
    if Dsgd0 < RcSqd
      Trapped = true
      ZtoPsqd= Dsgd0
        Circle = iter
    elseif Dsgd1 < RcSqd
      Trapped = true
      ZtoPsqd= Dsgd1
        Circle = iter
    elseif Dsgd2 < RcSqd
      Trapped = true
      ZtoPsqd = Dsgd2
        Circle = iter
   endif
endif
final:
  if !trapped
    #solid = true
  else
    Circle = ((Circle + @off) % num)/(num-1)
    float Ratio = sqrt(ZtoPsqd/Rcsqd)
    float ColorIndex = 110 * Ratio + Circle * 140
    #index = (ColorIndex + 1) % 256 /256
  endif
default:
  title = "7 Circles"
  param r
    caption = "Circle radius"
    default = 0.18
  endparam
  param n
    caption = "Circle numbers"
    default = 6
    min = 4
    max = 9
  endparam
  param skip
    caption = "Iters to skip"
    default = 0
    hint = "Iterations to skip."
  endparam
  param off
    caption = "Hue cycle"
    default = 1
    min = 0
    max = 7
    hint = "This rotates the coloring order of the balls."
  endparam
}

New.jpg
返回列表