Board logo

标题: UF分形的画板实现4(esa.ufm) [打印本页]

作者: 柳烟    时间: 2010-8-30 16:15     标题: UF分形的画板实现4(esa.ufm)

dubeau0 Phi 0(1).gsp (25.13 KB)
未命名.JPG

图片附件: 未命名.JPG (2010-8-30 16:15, 32.46 KB) / 下载次数 3251
http://forums.netpad.net.cn/attachment.php?aid=6905&k=19730bf27a08d9a35e92fa8bf9d80090&t=1792507075&sid=CTrxzc



附件: dubeau0 Phi 0(1).gsp (2010-9-2 23:43, 25.13 KB) / 下载次数 5507
http://forums.netpad.net.cn/attachment.php?aid=6906&k=c260bada808f1a14332ed7965e57afcb&t=1792507075&sid=CTrxzc
作者: 柳烟    时间: 2010-8-30 16:21

这是一楼中UF中的代码
DubeauPhi0 {
; by Etienne Saint-Amant
; 2009/06
; Based on the article of Francois Dubeau that appeared on the Journal of
; Computational and Appied Mathematics 224 in 2009, pp. 66-76.
; doi:10.1016/j.cam.2008.04.014

global:
  ;$define DEBUG
init:
  ; factorial
  int func factorial(int i)
    int total
    total = 1
    while i >= 1
      total = total * i
      i = i - 1
    endwhile
    return total
  endfunc
  ; num function
  float func num(float delta, int i)
     float total
     float vardelta
     total = 1
     vardelta = delta
     while i >= 1
       total = total * vardelta
       vardelta = vardelta - 1
       i = i - 1
     endwhile
     return total
   endfunc
  ; binomial delta function
  float func binomialdelta(float delta, int i)
    float result
    if i == 0
      result = 1
    else
      result = num(delta,i)/factorial(i)
    endif
    return result
  endfunc
  z = pixel
loop:
  complex sumNum
  complex sumDenum
  int i
  sumNum = 0
  sumDenum = 0
  i = 1
  while i <= @p - 1
    sumNum = sumNum + binomialdelta(1/cabs(@n),i) * (z^@n/@r - 1)^(i-1)
    sumDenum = sumDenum + i * binomialdelta(1/cabs(@n),i) * (z^@n/@r - 1)^(i-1)
    i = i + 1
  endwhile
  zold = z
  z = z - ((z^@n - @r) * sumNum) / (@n * z^(@n - 1) * sumDenum)
bailout:
  |z - zold| >= @bailout
default:
  title = "Dubeau Phi 0"
  periodicity = 0
$IFDEF VER50
  rating = recommended
$ENDIF
  maxiter = 100
  param n
    caption = "Exponent"
    default = (3,0)
    hint = "Specifies the exponent of the equation that is solved by \
            Dubeau's method. Use real numbers (set the imaginary part \
            to zero) to obtain the correct Dubeau's Method"
  endparam
  param r
    caption = "Root"
    default = (1,0)
    hint = "Specifies the root of the equation that is solved. Use larger \
            numbers for slower convergence."
  endparam
  int param p
    caption = "Order of convergence"
    default = 2
    hint = "Must be a natural number greater than 2.  2 will generate a \
           standard Newton's method."
    min = 2
  endparam
  param bailout
    caption = "Bailout value"
    default = 0.00001
    min = 0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This parameter defines how soon a convergent orbit bails out while \
            iterating. Smaller values give more precise results but usually \
            require more iterations."
  endparam
}
作者: inRm    时间: 2010-8-30 21:46

1# 柳烟

漂亮!
作者: 柳烟    时间: 2010-9-2 23:37

dubeau0 Phi 0(2).gsp (31.14 KB)
未命名.JPG

附件: dubeau0 Phi 0(2).gsp (2010-9-2 23:37, 31.14 KB) / 下载次数 5490
http://forums.netpad.net.cn/attachment.php?aid=6978&k=3a4d12afcac90c8bbee559d232d2a063&t=1792507075&sid=CTrxzc

图片附件: 未命名.JPG (2010-9-2 23:37, 32.89 KB) / 下载次数 3297
http://forums.netpad.net.cn/attachment.php?aid=6979&k=67880bf5a52ffde891d66973eb10835e&t=1792507075&sid=CTrxzc


作者: 柳烟    时间: 2010-9-3 10:06

DubeauPhi1 {
; by Etienne Saint-Amant
; 2009/06
; Based on the article of Francois Dubeau that appeared on the Journal of
; Computational and Appied Mathematics 224 in 2009, pp. 66-76.
; doi:10.1016/j.cam.2008.04.014

global:
  ;$define DEBUG
init:
  ; factorial
  int func factorial(int i)
    int total
    total = 1
    while i >= 1
      total = total * i
      i = i - 1
    endwhile
    return total
  endfunc
  ; num function
  float func num(float delta, int i)
     float total
     float vardelta
     total = 1
     vardelta = delta
     while i >= 1
       total = total * vardelta
       vardelta = vardelta - 1
       i = i - 1
     endwhile
     return total
   endfunc
  ; binomial delta function
  float func binomialdelta(float delta, int i)
    float result
    if i == 0
      result = 1
    else
      result = num(delta,i)/factorial(i)
    endif
    return result
  endfunc
  z = pixel
loop:
  complex sum
  int i
  sum = 0
  i = 0
  while i <= @p - 1
    print(1/cabs(@n),":",i,":",binomialdelta(1/cabs(@n),i))
    sum = sum + binomialdelta(1/cabs(@n),i) * (@r/z^@n - 1)^i
    i = i + 1
  endwhile
  zold = z
  z = z * sum
bailout:
  |z - zold| >= @bailout
default:
  title = "Dubeau Phi 1"
  periodicity = 0
$IFDEF VER50
  rating = recommended
$ENDIF
  maxiter = 100
  param n
    caption = "Exponent"
    default = (3,0)
    hint = "Specifies the exponent of the equation that is solved by \
            Dubeau's method. Use real numbers (set the imaginary part \
            to zero) to obtain the correct Dubeau's Method"
  endparam
  param r
    caption = "Root"
    default = (1,0)
    hint = "Specifies the root of the equation that is solved. Use larger \
            numbers for slower convergence."
  endparam
  int param p
    caption = "Order of convergence"
    default = 2
    hint = "Must be a natural number greater than 2.  2 will generate a \
           standard Newton's method."
    min = 2
  endparam
  param bailout
    caption = "Bailout value"
    default = 0.00001
    min = 0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This parameter defines how soon a convergent orbit bails out while \
            iterating. Smaller values give more precise results but usually \
            require more iterations."
  endparam
}
未命名.JPG
DubeauPhi1(1).gsp (21.07 KB)

图片附件: 未命名.JPG (2010-9-3 10:06, 34.64 KB) / 下载次数 3291
http://forums.netpad.net.cn/attachment.php?aid=6980&k=e8dda52371011806969aa1e3c44c1609&t=1792507075&sid=CTrxzc



附件: DubeauPhi1(1).gsp (2010-9-3 10:08, 21.07 KB) / 下载次数 5277
http://forums.netpad.net.cn/attachment.php?aid=6981&k=bfc03e76570e5aca0738484b6a4888bb&t=1792507075&sid=CTrxzc
作者: 柳烟    时间: 2010-9-3 10:46

未命名.JPG
DubeauPhi1(2).gsp (23.61 KB)

图片附件: 未命名.JPG (2010-9-3 10:46, 29.31 KB) / 下载次数 3267
http://forums.netpad.net.cn/attachment.php?aid=6982&k=f463324387e8fca8f5f0795794d70be9&t=1792507075&sid=CTrxzc



附件: DubeauPhi1(2).gsp (2010-9-3 10:46, 23.61 KB) / 下载次数 5407
http://forums.netpad.net.cn/attachment.php?aid=6983&k=8592f536315a4b4852ddbd9030531e50&t=1792507075&sid=CTrxzc
作者: 柳烟    时间: 2010-9-3 19:50

DubeauPhiMixture.gsp (37.62 KB)
文件中的lambdy的横坐标lambdy-x与纵坐标lambdy-y设为(1,0),则为5楼图,若设为(0,1),则为1楼图,若为其它,则扫出其余的分形,自已扫去,有趣。
未命名1.JPG
未命名2.JPG

图片附件: 未命名1.JPG (2010-9-3 19:50, 30.15 KB) / 下载次数 3283
http://forums.netpad.net.cn/attachment.php?aid=6990&k=5ef90abbe7596307156b392f77a504e1&t=1792507075&sid=CTrxzc



图片附件: 未命名2.JPG (2010-9-3 20:24, 32.34 KB) / 下载次数 3268
http://forums.netpad.net.cn/attachment.php?aid=6991&k=ab2e765de744a0f0c2c51320ebd1165c&t=1792507075&sid=CTrxzc



附件: DubeauPhiMixture.gsp (2010-9-3 21:20, 37.62 KB) / 下载次数 5686
http://forums.netpad.net.cn/attachment.php?aid=6993&k=68197d064599d1fdf7cd2bde588e5553&t=1792507075&sid=CTrxzc
作者: 榕坚    时间: 2010-9-3 20:20

7# 柳烟


不错,比UF的效果好看。
作者: 柳烟    时间: 2010-9-4 14:36

加点变换,扫妙图。

图片附件: 未命名1.JPG (2010-9-4 14:36, 34.07 KB) / 下载次数 3034
http://forums.netpad.net.cn/attachment.php?aid=7002&k=5c944704b129106954e4228fc76d1158&t=1792507075&sid=CTrxzc



图片附件: 未命名2.JPG (2010-9-4 16:31, 43.45 KB) / 下载次数 3102
http://forums.netpad.net.cn/attachment.php?aid=7003&k=4c0273cd750363f2331125c7847f9b3d&t=1792507075&sid=CTrxzc


作者: 柳烟    时间: 2010-9-4 19:48

边学UF分形代码中的算法,又发了些奇思怪想,弄出的图:

图片附件: 未命名3.JPG (2010-9-4 19:48, 33.81 KB) / 下载次数 3106
http://forums.netpad.net.cn/attachment.php?aid=7006&k=49435bcb78f501c23b18c61fd9d6ac1f&t=1792507075&sid=CTrxzc


作者: xiaongxp    时间: 2010-9-5 00:05

10# 柳烟
好看!
作者: 柳烟    时间: 2010-9-7 10:41

FnGlynn {
;
; Based on GLYNN, a formula by Jon Horner.
; Mutated Fractint and UF version by Bradley Beacham.
; See blb.txt for comments.
; 13 March 2003
;
global:
  power = @p1
  c = @p2
  fc = fn1(@p2)

init:
  z = #pixel

loop:
  if @FuncAffects == "Z"
    z = fn1(z^power) + c
  elseif @FuncAffects == "C"
    z = z^power + fc
  elseif @FuncAffects == "Whole"
    z = fn1(z^power + c)
  else  ;"Both"
    z = fn1(z^power) + fc
  endif

bailout:
  |z| <= @bailout

default:
  title = "FnGlynn"
  param p1
    caption = "Power"
    default = (1.5,0)
  endparam
  param p2
    caption = "Julia Seed"
    default = (-0.2,0)
  endparam
  param bailout
    caption = "Bailout value"
    default = 4
    min = 0
  endparam
  func fn1
    caption = "Function"
    default = ident()
  endfunc
  param FuncAffects
    caption = "Function Affects"
    enum = "Z" "C" "Whole" "Both"
    default = 2  ; "Whole" is the default
    hint = "What part of iterated function is affected by the user function? \
    Options are 'Z': [fn(z^power)] + c; 'C': z^power + fn(c); \
    'Whole': fn(z^power + c); and 'Both': fn(z^power) + fn(c)."
  endparam
}

FnGlynn.gsp (14.51 KB)
未命名1.JPG

附件: FnGlynn.gsp (2010-9-7 10:41, 14.51 KB) / 下载次数 3197
http://forums.netpad.net.cn/attachment.php?aid=7059&k=4a4d48686b80f5b724b464211141fdce&t=1792507075&sid=CTrxzc

图片附件: 未命名1.JPG (2010-9-7 10:41, 26.58 KB) / 下载次数 1689
http://forums.netpad.net.cn/attachment.php?aid=7060&k=1c0f0ca4c8fda2abe2190614ebe70f3c&t=1792507075&sid=CTrxzc


作者: 榕坚    时间: 2010-9-7 10:59

12# 柳烟


可以再加大迭代次数,淡化等势圈。
作者: 柳烟    时间: 2010-9-7 19:30

13# 榕坚
按此建议,重新扫一张,并把一小块放大。
未命名.JPG

图片附件: 未命名.JPG (2010-9-7 19:30, 36.65 KB) / 下载次数 1640
http://forums.netpad.net.cn/attachment.php?aid=7069&k=dcfcdef29def3efd2f58fa7282ca406a&t=1792507075&sid=CTrxzc


作者: 榕坚    时间: 2010-9-7 20:38

这个分形有点象谢宾斯基分形图的味道。




欢迎光临 inRm3D: 画板论坛 (http://forums.netpad.net.cn/) Powered by Discuz! 7.0.0