返回列表 回复 发帖
受24楼文件启发:
Mandelbrot同向阵列 {

init:
  z = @start
  c= #pixel
  x=real(c)
  y=imag(c)
  x=x+13-trunc(x+13)
  y=y+13-trunc(y+13)
  c=4*(x+flip(y)+(-0.7,-0.5))
loop:
   z = z^@power + c
bailout:
  |z| <= @bailout
default:
  title = "Mandelbrot同向阵列"
  center = (0, 0)
  helpfile = "Uf*.chm"
  helptopic = "Html\formulas\standard\mandelbrot.html"
$IFDEF VER50
  rating = recommended
$ENDIF
  param start
    caption = "Starting point"
    default = (0,0)
    hint = "The starting point parameter can be used to distort the Mandelbrot \
            set. Use (0, 0) for the standard Mandelbrot set."
  endparam
  param power
    caption = "Power"
    default = (2,0)

  endparam
  float param bailout
    caption = "Bailout value"
    default = 4.0
    min = 1.0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This parameter defines how soon an orbit bails out while \
            iterating. Larger values give smoother outlines; values around 4 \
            give more interesting shapes around the set. Values less than 4 \
            will distort the fractal."
  endparam

}
Fractal2.png
将就原M集,加点变换:
3.gif
M集(20150219同向乌龟阵).gsp (15.94 KB)
M集反向乌龟阵UF法:
Mandelbrot阵列 {
;
; Generic Mandelbrot set.
;
init:
  z = @start
  c= #pixel
  x=tan(cos(real(c)))-1
  y=tan(cos(imag(c)))
  c=x+flip(y)
loop:
  z = z^@power + c
bailout:
  |z| <= @bailout
default:
  title = "Mandelbrot反向乌龟阵"
  center = (-0.5, 0)
  helpfile = "Uf*.chm"
  helptopic = "Html\formulas\standard\mandelbrot.html"
$IFDEF VER50
  rating = recommended
$ENDIF
  param start
    caption = "Starting point"
    default = (0,0)
    hint = "The starting point parameter can be used to distort the Mandelbrot \
            set. Use (0, 0) for the standard Mandelbrot set."
  endparam
  param power
    caption = "Power"
    default = (2,0)
    hint = "This parameter sets the exponent for the Mandelbrot formula. \
            Increasing the real part to 3, 4, and so on, will add discs to \
            the Mandelbrot figure. Non-integer real values and non-zero \
            imaginary values will create distorted Mandelbrot sets. Use (2, 0) \
            for the standard Mandelbrot set."
  endparam
  float param bailout
    caption = "Bailout value"
    default = 4.0
    min = 1.0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This parameter defines how soon an orbit bails out while \
            iterating. Larger values give smoother outlines; values around 4 \
            give more interesting shapes around the set. Values less than 4 \
            will distort the fractal."
  endparam
switch:
  type = "Julia"
  seed = #pixel
  power = power
  bailout = bailout
}
Fractal4.png
4.gif
M集阵列(20140220).gsp (16.96 KB)
M集行阵(20150221(1)).gsp (18.42 KB)
5.gif
6.gif
Mandelbrot阵列20150221(1号) {

init:
  z = @start
  c= 4*#pixel
  x=real(c)
  y=imag(c)
  int  k=0
  while (k<@hp)
  x=abs(x)-6
  y=abs(y)-6
  k=k+1
  endwhile
  x=abs(x)-3
  y=abs(y)-3
  m=sqrt(3)*x-y
  n=sqrt(3)*x+y
  IF n>0&&y>0
  s=2*pi/3

  elseif m>0&&y<0
  s=-2*pi/3
  endif
  c=x+flip(y)
  c=c*exp(1i*s)+1
loop:
  z = z^@power + c
bailout:
  |z| <= @bailout
default:
  title = "Mandelbrot乌龟阵20150221(1号)"
  center = (0, 0)
  helpfile = "Uf*.chm"
  helptopic = "Html\formulas\standard\mandelbrot.html"
$IFDEF VER50
  rating = recommended
$ENDIF
  param start
    caption = "Starting point"
    default = (0,0)
    hint = "The starting point parameter can be used to distort the Mandelbrot \
            set. Use (0, 0) for the standard Mandelbrot set."
  endparam
  param power
    caption = "Power"
    default = (2,0)

  endparam
   param hp
    caption = "hp"
    default = 1

  endparam
  float param bailout
    caption = "Bailout value"
    default = 4.0
    min = 1.0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This parameter defines how soon an orbit bails out while \
            iterating. Larger values give smoother outlines; values around 4 \
            give more interesting shapes around the set. Values less than 4 \
            will distort the fractal."
  endparam

}
7.gif
Mandelbrot阵列20150221(2号) {

init:
  z = @start
  c= 7*#pixel
  x=real(c)
  y=imag(c)
  int  k=0
  while (k<@hp)
  x=abs(x)-6
  y=abs(y)-6
  k=k+1
  endwhile
  x=abs(x)-3
  y=abs(y)-3
  m=x-y
  n=x+y
  IF m<0&&n<0
  s=0
elseif m<0&&n>0
  s=pi/2
elseif m>0&&n>0
  s=-pi
elseif m>0&&n<0
  s=3*pi/2
  endif
  c=x+flip(y)
  c=c*exp(1i*s)+1
loop:
  z = z^@power + c
bailout:
  |z| <= @bailout
default:
  title = "Mandelbrot乌龟阵20150221(2号)"
  center = (0, 0)
  helpfile = "Uf*.chm"
  helptopic = "Html\formulas\standard\mandelbrot.html"
$IFDEF VER50
  rating = recommended
$ENDIF
  param start
    caption = "Starting point"
    default = (0,0)
    hint = "The starting point parameter can be used to distort the Mandelbrot \
            set. Use (0, 0) for the standard Mandelbrot set."
  endparam
  param power
    caption = "Power"
    default = (2,0)

  endparam
   param hp
    caption = "hp"
    default = 1

  endparam
  float param bailout
    caption = "Bailout value"
    default = 4.0
    min = 1.0
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This parameter defines how soon an orbit bails out while \
            iterating. Larger values give smoother outlines; values around 4 \
            give more interesting shapes around the set. Values less than 4 \
            will distort the fractal."
  endparam
}
Fractal4.png
造阵列,受启发,终于完成了五角星科赫雪花的UF代码:
五角星科赫雪花20150221 {
init:
z = pixel
s=0.5
arg=atan2(z)
if abs(arg+pi/10)>4*pi/5
z=z*exp(1i*4*pi/5)
endif
loop:
arg=atan2(z)
x = real(z)
y = imag(z)
L13=-y+0.30902
L35=1.11803*x+1.53884*y+0.587785
L25=1.80902*x+0.587785*y-0.587785
L24=1.80902*x-0.587785*y+0.587785
L14=1.11803*x-1.53884*y-0.587785
L1=0.32492*x+y
L2=1.37638*x-y
m1=x-(1+s)*0.95106
n1=y-(1+s)*0.30902
m2=x-(1+s)*0.58779
n2=y+(1+s)*0.80902
n3=x+(1+s)*0.58779
if  abs(arg-pi/10) <pi/5
v=m1+flip(n1)
b=-pi/5
elseif abs(arg-13*pi/20) <7*pi/20
v=x+flip(y-(1+s))
b=-3*pi/5
elseif abs(arg+3*pi/10) <pi/5
v=m2+flip(n2)
b=pi/5
elseif abs(arg+pi/4)<3*pi/4
v=n3+flip(n2)
b=3*pi/5
endif
z=1/s*v*exp(1i*b)
bailout:
(L13<=0&&L24>=0&&L25>=0)||(L13<=0&&L24<0)||(L14>=0&&L13>0&&L25>=0&&L35>=0)||(L14>=0&&L35<0)||(L13>0&&L35<0&&L24<0&&L14<0)
default:
  title = "五角星科赫雪花20150221"
  helpfile = "sam-help/various.htm"
  helptopic = "sierp2"
  center = (0,0)

}
Fractal5.png
1.gif
可惜的是,原始陷阱搞掉了,在UF中不知如何用代码实现。
8.gif
返回列表