返回列表 回复 发帖
119# lnszdzg
中看,好!
我打算做成烟花的样子,没做成。只能将就了。
New.jpg
吻之陷阱
New.jpg
上个联通结陷阱没做好,参考了月城的做法,重新来过!
New1.jpg
New.jpg
UF效果
捕获uf4.PNG
Mathcad效果
捕获400002.PNG
UF做的中间的那个心怎么就不见了?请老师帮助!
UF代码,由于才开始学习UF,照猫画虎做的,代码不够简练,而且着色很不得法啊!
heart {
init:
  int iter = 0
  float num = @n
  float Xabs = 0
  float Yabs = 0
  float Dsgd0 = 0
  float Circle = 0
  float ZtoPsqd = 0
  float Rc = @r
  int n1 = @n
  float RcSqd = Rc^2
  bool Trapped = false
loop:
  iter = iter + 1
  if iter>skip && !Trapped
    Xabs = real(#z)
    Yabs = imag(#z)
    Dsgd0 = (Xabs^2+Yabs^2-1/64)-Xabs^(2/3)*Yabs

    if Dsgd0 < 0
      Trapped = true
      ZtoPsqd= abs(Dsgd0)
        Circle = iter

   endif
endif

final:
  if !trapped
    #solid = true
  else
    Circle = ((Circle + @off) % num)
    float Ratio = sqrt(ZtoPsqd/Rcsqd)
    float ColorIndex = 50 * Ratio + Circle * 50
    #index = (ColorIndex + 1) % 256 /256
  endif
default:
  title = "heart"
  param r
    caption = "Circle radius"
    default = 0.4
  endparam
  param n
    caption = "num"
    default = 4
    min = 1
    max = 19
  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
}
128# lnszdzg
在几何画板点陷阱迭代中,设z=pixel,如诱捕半径为|z|,则原点处有陷阱图像,如诱捕半径为|z^2+c|,则原点处无陷阱图像。从算理上看UF中可能亦是吧.
125# lnszdzg
请问老兄,月城先生算法是怎么个算法?
返回列表