home *** CD-ROM | disk | FTP | other *** search
- 10 rem *******************************
- 20 rem * julia-mengen von z=z^2+c *
- 30 rem * 1987 by stefan vilsmeier *
- 40 rem *******************************
- 50 :
- 60 if a=0 then a=1:load "fractal.obj",8,1
- 70 open 1,8,15,"u9":close1:rem diese zeile kann bei problemen mit dem
- 80 rem floppyspeeder weggelassen werden!
- 90 poke53280,0:poke53281,0:sys50194
- 100 dimf(320),f2(320),g(320),g2(320),z(320),z2(320)
- 110 :
- 120 :
- 130 rem ********** eingaben *******
- 140 :
- 150 input"[147]anfang realteil ";x1
- 160 input"ende realteil ";x2
- 170 input"anfang imaginaerteil ";y1
- 180 input"ende imaginaerteil ";y2
- 190 input"realteil von c ";cr
- 200 input"imaginaerteil von c ";cr
- 210 input"anzahl der iterationen ";z
- 220 input"toleranz ";mx
- 230 :
- 240 :
- 250 rem ******************************
- 260 rem * hauptschleife *
- 270 rem ******************************
- 280 :
- 290 dx=(x2-x1)/320:dy=(y1-y2)/200
- 300 sys50176,14,0:sys50179,1
- 310 r=2:v=4:h=a:ef=s/8:gh=t/8:sw=.2
- 320 :
- 330 foryy=199to199
- 340 :forxx=0to319
- 350 : zz=0
- 360 : x=x1+xx*dx
- 370 : y=y2+yy*dy
- 380 : gosub680:rem ** 'iteration' ***
- 390 : if zz<z and ra<4 then goto 380
- 400 : f2(xx)=x:g2(xx)=y:z2(xx)=zz
- 410 :
- 420 :
- 430 : rem ***** 'toleranz' *********
- 440 :
- 450 : ifyy=0orxx=0goto540
- 460 : if z(xx-1)<z and z(xx)<z and z2(xx-1)<z and z2(xx)<z goto 540
- 470 : p1=f(xx-1):p2=f(xx):p3=f2(xx):p4=f2(xx-1)
- 480 : q1=g(xx-1):q2=g(xx):q3=g2(xx):q4=g2(xx-1)
- 490 : d1=abs(p1-p2)^2+abs(q1-q2)^2
- 500 : d2=abs(p2-p3)^2+abs(q2-q3)^2
- 510 : d3=abs(p3-p4)^2+abs(q3-q4)^2
- 520 : d4=abs(p4-p1)^2+abs(q4-q1)^2
- 530 : if d1>mx or d2>mx or d3>mx or d4>mx then sys 50182,xx,yy,1
- 540 :nextxx
- 550 :forse=0to320:f(se)=f2(se):g(se)=g2(se):z(se)=z2(se):next
- 560 nextyy
- 570 :
- 580 :
- 590 geta$:ifa$=""goto590
- 600 sys50179,0:if a$="s" then gosub 810:rem 'grafik speichern'
- 610 goto 70:rem neustart
- 620 :
- 630 :
- 640 rem ******************************
- 650 rem * 'iteration' *
- 660 rem ******************************
- 670 :
- 680 xq=x*x
- 690 yq=y*y
- 700 y=2*x*y+ci
- 710 x=xq-yq+cr
- 720 zz=zz+1
- 730 ra=xq+yq
- 740 return
- 750 :
- 760 :
- 770 rem ***************************
- 780 rem * 'grafik speichern' *
- 790 rem ***************************
- 800 :
- 810 input "grafik-name ";n$
- 820 open 2,8,2,"pi."+n$+",p,w":sys 50191:close 2
- 830 return
-