home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1988 April
/
64er_Magazin_88-04_1988_Markt__Technik_de_Side_A.d64
/
listing.2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
2KB
|
63 lines
10 rem *****************************
20 rem * magnetismus-modell *
30 rem * 1987 by stefan vilsmeier *
40 rem *****************************
50 :
60 ifa=0 then a=1:load"fractal.obj",8,1
70 poke53280,0:poke53281,0:sys50194
80 open 1,8,15,"u9":close1:rem diese zeile kann bei problemen mit dem
90 rem floppyspeeder weggelassen werden!
100 input"[147]anfang realteil ";x1
110 input"ende realteil ";x2
120 input"anfang imaginaerteil ";y1
130 input"ende imaginaerteil ";y2
140 input"realteil von c ";cr
150 input"imaginaerteil von c ";ci
160 input"maximum ";z
170 :
180 :
190 rem *****************************
200 rem * hauptschleife *
210 rem *****************************
220 :
230 dx=(x2-x1)/320:dy=(y1-y2)/200
240 sys50176,14,0:sys50179,1
250 foryy=0to199
260 :forxx=0to319
270 : x=x1+xx*dx
280 : y=y1+yy+dx
290 : zz=0
300 : gosub 440:rem 'iteration'
310 : ifra<120andzz<zgoto300
320 : ifint(zz/2)=zz/2 or zz=z then sys 50182,xx,yy,1
330 :nextxx
340 nextyy
350 get a$:if a$="" goto 350
360 sys50179,0:ifa$="s" then gosub 600:rem 'grafik speichern'
370 goto 80:rem neustart
380 :
390 :
400 rem *****************************
410 rem * 'iteration' *
420 rem *****************************
430 :
440 a1=x*x-y*y+cr-1:b1=2*x*y+ci
450 a2=a1*a1-b1*b1:b2=2*a1*b1
460 a3=2*x+cr-2:b3=2*y+ci
470 a4=a3*a3-b3*b3:b4=2*a3*b3
480 ag=(a4*a4+b4*b4):ifag=0thenag=.0001
490 x=(a2*a4+b2*b4)/ag
500 y=(a4*b2-a2*b4)/ag
510 zz=zz+1
520 ra=x*x+y*y
530 return
540 :
550 :
560 rem *****************************
570 rem * 'grafik speichern' *
580 rem *****************************
590 :
600 input "grafik-name ";n$
610 open 2,8,2,"pi."+n$+",p,w":sys 50191:close 2
620 return