home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1988 April / 64er_Magazin_88-04_1988_Markt__Technik_de_Side_A.d64 / listing.1 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  84 lines

  1. 10 rem *******************************
  2. 20 rem *  julia-mengen von z=z^2+c   *
  3. 30 rem *  1987 by stefan vilsmeier   *
  4. 40 rem *******************************
  5. 50 :
  6. 60 if a=0 then a=1:load "fractal.obj",8,1
  7. 70 open 1,8,15,"u9":close1:rem diese zeile kann bei problemen mit dem
  8. 80 rem floppyspeeder weggelassen werden!
  9. 90 poke53280,0:poke53281,0:sys50194
  10. 100 dimf(320),f2(320),g(320),g2(320),z(320),z2(320)
  11. 110 :
  12. 120 :
  13. 130 rem ********** eingaben *******
  14. 140 :
  15. 150 input"[147]anfang realteil         ";x1
  16. 160 input"ende realteil           ";x2
  17. 170 input"anfang imaginaerteil    ";y1
  18. 180 input"ende imaginaerteil      ";y2
  19. 190 input"realteil von c          ";cr
  20. 200 input"imaginaerteil von c     ";cr
  21. 210 input"anzahl der iterationen  ";z
  22. 220 input"toleranz                ";mx
  23. 230 :
  24. 240 :
  25. 250 rem ******************************
  26. 260 rem *      hauptschleife         *
  27. 270 rem ******************************
  28. 280 :
  29. 290 dx=(x2-x1)/320:dy=(y1-y2)/200
  30. 300 sys50176,14,0:sys50179,1
  31. 310 r=2:v=4:h=a:ef=s/8:gh=t/8:sw=.2
  32. 320 :
  33. 330 foryy=199to199
  34. 340 :forxx=0to319
  35. 350 : zz=0
  36. 360 : x=x1+xx*dx
  37. 370 : y=y2+yy*dy
  38. 380 : gosub680:rem ** 'iteration' ***
  39. 390 : if zz<z and ra<4 then goto 380
  40. 400 : f2(xx)=x:g2(xx)=y:z2(xx)=zz
  41. 410 :
  42. 420 :
  43. 430 : rem ***** 'toleranz' *********
  44. 440 :
  45. 450 : ifyy=0orxx=0goto540
  46. 460 :   if z(xx-1)<z and z(xx)<z and z2(xx-1)<z and z2(xx)<z goto 540
  47. 470 :   p1=f(xx-1):p2=f(xx):p3=f2(xx):p4=f2(xx-1)
  48. 480 :   q1=g(xx-1):q2=g(xx):q3=g2(xx):q4=g2(xx-1)
  49. 490 :   d1=abs(p1-p2)^2+abs(q1-q2)^2
  50. 500 :   d2=abs(p2-p3)^2+abs(q2-q3)^2
  51. 510 :   d3=abs(p3-p4)^2+abs(q3-q4)^2
  52. 520 :   d4=abs(p4-p1)^2+abs(q4-q1)^2
  53. 530 : if d1>mx or d2>mx or d3>mx or d4>mx then sys 50182,xx,yy,1
  54. 540 :nextxx
  55. 550 :forse=0to320:f(se)=f2(se):g(se)=g2(se):z(se)=z2(se):next
  56. 560 nextyy
  57. 570 :
  58. 580 :
  59. 590 geta$:ifa$=""goto590
  60. 600 sys50179,0:if a$="s" then gosub 810:rem 'grafik speichern'
  61. 610 goto 70:rem neustart
  62. 620 :
  63. 630 :
  64. 640 rem ******************************
  65. 650 rem *        'iteration'         *
  66. 660 rem ******************************
  67. 670 :
  68. 680 xq=x*x
  69. 690 yq=y*y
  70. 700 y=2*x*y+ci
  71. 710 x=xq-yq+cr
  72. 720 zz=zz+1
  73. 730 ra=xq+yq
  74. 740 return
  75. 750 :
  76. 760 :
  77. 770 rem ***************************
  78. 780 rem *   'grafik speichern'    *
  79. 790 rem ***************************
  80. 800 :
  81. 810 input "grafik-name ";n$
  82. 820 open 2,8,2,"pi."+n$+",p,w":sys 50191:close 2
  83. 830 return
  84.