返回列表 回复 发帖
加点变换:
未命名.jpg
2014-6-13 09:13

太极图加点变换.gsp (12.61 KB)
16# xiaongxp
代数法似可将此太极图作为陷阱,造复分形,不知几何法造复分形如何
此陷阱造复分形,我试了试,看来我是服侍不了这道题了,那位高人试试。
未命名.gif
2014-6-13 09:14

红色代表离卦,属火,至刚之物。蓝色代表坎卦,属水,天地至柔之物。太极图中的二色,可代表阴阳,刚柔。
太极图陷阱UF代码:
Taijitu20140611 {

init:
  int iter = 0
  float x = 0
  float y = 0
  float d1 = 0
  float d2 = 0
  float d3 = 0
  float L1 = 0
  float L2 = 0
  float Circle = 0
  float ZtoPsqd = 0
  float Rc1 = @r
  float Rc2 = 0.45*Rc1
  float Rc4= 1/6*Rc1
  float Phi = #pi * @angle/180
  float xx= Rc2*cos(Phi)
  float yy= Rc2*sin(Phi)
  float Ty =0
  bool Trapped = false
loop:
  iter = iter + 1
  x = real(#z)
  y = imag(#z)

    d1 = sqrt((x-@ox)^2 + (y - @oy)^2)
    d2 = sqrt((x - xx-@ox)^2 + (y - yy-@oy)^2)
    d3 = sqrt((x + xx-@ox)^2 + (y +yy-@oy)^2)
    L1=(x-@ox)*sin(Phi)-(y-@oy)*cos(Phi)
    L2=(x-@ox)*cos(Phi)+(y-@oy)*sin(Phi)
    Ty=((x-@ox)*cos(-Phi)-(y-@oy)*sin(-Phi))^2/(2*Rc2)^2+ ((x-@ox)*sin(-Phi)+(y-@oy)*cos(-Phi))^2/Rc1^2
if iter > @skip && !Trapped
    if (d2< Rc2 && L1<=0 && L2>=0 && d2>Rc4)||(Ty<1 && L1>=0 && L2>=0 && d2>=Rc4)||(d3>=Rc2 && L1>=0 && d1<Rc1 && L2<=0)||(Ty>=1 && L1<=0 && d1<Rc1 && L2<=0)
      Trapped = true
      ZtoPsqd= 1
      Circle = 1

    elseif (d3<Rc2 && L1>=0 && L2<=0 && d3>=Rc4)||(Ty<1 && L1<=0 && L2<=0 && d3>=Rc4)||(d2>=Rc2 && L1<=0 && d1<Rc1 && L2>=0)||(Ty>=1 && L1>=0 && d1<Rc1 && L2>=0 )
      Trapped = true
      ZtoPsqd= 1
      Circle = 2
    elseif d2 < Rc4
      trapped = true
      ZtoPsqd = d2/Rc4
      Circle = 3
    elseif d3 < Rc4
      trapped = true
      ZtoPsqd = d3/Rc4
      Circle = 4
   endif
endif
final:
  if !trapped
    #solid = true
  else
    Circle = (Circle + @off) % 4
    float Ratio =ZtoPsqd
    float ColorIndex = 29 * Ratio + Circle * 30
    #index = (ColorIndex + 1) % 256 /256
  endif
default:
  title = "Taijitu20140611"
  param r
    caption = "Circle radius"
    default = 1.0
  endparam
  param ox
    caption = "ox"
    default = 0.0
  endparam
  param oy
    caption = "oy"
    default = 0.0
  endparam
  param angle
    caption = "angle"
    default = 45.0
  endparam
  param skip
    caption = "Iters to skip"
    default = 1
    hint = "Iterations to skip."
  endparam
  param off
    caption = "Hue cycle"
    default = 0
    min = 0
    max = 4
    hint = "This rotates the coloring order of the balls."
  endparam
}
今日编了个太极图陷阱的UF代码,但作色仍不成熟,还须研究完善。在UF中扫一个J集:
3.gif
2015-2-1 17:25

UF中的这个陷阱分形,有些鱼眼看起来没有,但放大后有,这是UF要改进的地方。用GSP作,我想是不会出现这个问题的。
UF中的太极图柳烟作品:
Fractal2.jpg
2014-6-13 08:58

Fractal2.jpg
2014-6-13 08:57
未命名.jpg
2014-6-13 08:56

太极陷阱J20140611.gsp (26.03 KB)
未命名.jpg
2014-6-13 08:55
问题再请教:如何求出一点(椭圆内外)到椭圆上的最短距离?我想造另一种陷阱,要用到这个计算。
太极陷阱扫图:
未命名.jpg
2014-6-13 08:53

Circly Koch Curve(20140611)太极陷阱.gsp (29.62 KB)
感觉到比UF中的效果还好。
未命名.jpg
2014-6-13 08:49
未命名.jpg
2014-6-13 08:47
返回列表