返回列表 回复 发帖
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中不知如何用代码实现。
36# 柳烟
五角星科赫雪花中的相邻两级迭代五角星的半径比约为1-0.618
8.gif
Fractal1.png
MJ阵列20150222 {

init:
  z1 = @start
  c1= #pixel
  x=real(c1)
  c2=6*(c1+(23,23)-trunc(c1+(23,23)))-3
  x=real(c2)
if x>0
  z=z1
  c=1.2*(c2+(-2,-3))
  else
  z=1.2*(c2+(1.5,-3))
  c=@JJ
  endif
loop:
  z = z^@power + c
bailout:
  |z| <= @bailout
default:
  title = "MJ集阵列20150222"
  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)

  endparam
   param JJ
    caption = "J集定位"
    default = (0.356180,0.07463)

  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

}
我想将行距压缩一下,结果搞了许久,没成功。用了向老师前面文件同向乌龟中的函数trunc.
MJ集平移阵列20150223.gsp (16.04 KB)
New.gif
如何在GSP中将行距减少。当我减少行距时,MJ集沿纵轴方向压扁了,不好看。
返回列表