Home » Personal collection » Acorn hard disk » misc » dcfprogs » Astronomy2

Astronomy2

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn hard disk » misc » dcfprogs
Filename: Astronomy2
Read OK:
File size: 0467 bytes
Load address: 0000
Exec address: 0000
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM Solar System Simulator
   20REM
   30:
   40ON ERROR REPORT:PRINT" @ ";ERL:END
   50MODE 0
   60READ n
   70DIM n$(n),r(n),m(n),d(n),x(n),y(n),yr(n),v(n),dr(n)
   80FOR p=1 TO n
   90READ n$(p),d(p),r(p),m(p),yr(p)
  100x(p)=d(p):y(p)=0:v(p)=((1/180*PI*d(p))/yr(p))*100:v(p)=0:dr(p)=90
  110NEXT
  120:
  130REPEAT
  140FOR p=1 TO n
  150xvel=0:yvel=0
  160FOR pp=1 TO n
  170IF pp<>p THEN
  180 tfor=10*m(pp)/(SQR((x(pp)-x(p))^2+(y(pp)-y(p))^2)^2)
  190 tdir=180*ATN((y(pp)-y(p))/(x(pp)-x(p)))/PI
  200 xvel=xvel+tfor*COS(PI*tdir/180)
  210 yvel=yvel+tfor*SIN(PI*tdir/180)
  220ENDIF
  230NEXT
  240dr(p)=dr(p)-90
  250xvn=COS(PI*dr(p)/180)*v(p)+xvel
  260yvn=SIN(PI*dr(p)/180)*v(p)+yvel
  270IF yvn=0 THEN dr(p)=90 ELSE dr(p)=180*ATN(xvn/yvn)/PI
  280v(p)=SQR(xvn^2+yvn^2)
  290:
  300GCOL 0,0:POINT x(p)/12+500,y(p)/12+500
  310x(p)=x(p)+COS(PI*dr(p)/180)*v(p)
  320y(p)=y(p)+SIN(PI*dr(p)/180)*v(p)
  330GCOL 0,1:POINT x(p)/12+500,y(p)/12+500
  340NEXT
  350UNTIL FALSE
  360:
  370REM Name,Distance,Radius,Mass,Year
  380DATA 10
  390:
  400DATA "Sun",0,103,335,1
  410DATA "Mercury",58,0.4,0.06,0.2
  420DATA "Venus",108,0.95,0.8,0.6
  430DATA "Earth",150,1,1,1
  440DATA "Mars",228,0.5,0.1,1.9
  450DATA "Jupiter",778,11,320,12
  460DATA "Saturn",1427,9,95,30
  470DATA "Uranus",2870,4,15,84
  480DATA "Neptune",4497,4,17,165
  490DATA "Pluto",5900,0.2,0.002,248

� Solar System Simulator
�
:
(� � �:�" @ ";�:�
2� 0
<� n
F5� n$(n),r(n),m(n),d(n),x(n),y(n),yr(n),v(n),dr(n)
P
� p=1 � n
Z � n$(p),d(p),r(p),m(p),yr(p)
dDx(p)=d(p):y(p)=0:v(p)=((1/180*�*d(p))/yr(p))*100:v(p)=0:dr(p)=90
n�
x:
��
�
� p=1 � n
�xvel=0:yvel=0
�� pp=1 � n
�
� pp<>p �
�7 tfor=10*m(pp)/(�((x(pp)-x(p))^2+(y(pp)-y(p))^2)^2)
�, tdir=180*�((y(pp)-y(p))/(x(pp)-x(p)))/�
�! xvel=xvel+tfor*�(�*tdir/180)
�! yvel=yvel+tfor*�(�*tdir/180)
��
��
�dr(p)=dr(p)-90
� xvn=�(�*dr(p)/180)*v(p)+xvel
 yvn=�(�*dr(p)/180)*v(p)+yvel
/� yvn=0 � dr(p)=90 � dr(p)=180*�(xvn/yvn)/�
v(p)=�(xvn^2+yvn^2)
":
,$� 0,0:Ȓ x(p)/12+500,y(p)/12+500
6!x(p)=x(p)+�(�*dr(p)/180)*v(p)
@!y(p)=y(p)+�(�*dr(p)/180)*v(p)
J$� 0,1:Ȓ x(p)/12+500,y(p)/12+500
T�
^� �
h:
r$� Name,Distance,Radius,Mass,Year
|� 10
�:
�� "Sun",0,103,335,1
�� "Mercury",58,0.4,0.06,0.2
�� "Venus",108,0.95,0.8,0.6
�� "Earth",150,1,1,1
�� "Mars",228,0.5,0.1,1.9
�� "Jupiter",778,11,320,12
�� "Saturn",1427,9,95,30
�� "Uranus",2870,4,15,84
�� "Neptune",4497,4,17,165
� � "Pluto",5900,0.2,0.002,248
�
00000000  0d 00 0a 1c f4 20 53 6f  6c 61 72 20 53 79 73 74  |..... Solar Syst|
00000010  65 6d 20 53 69 6d 75 6c  61 74 6f 72 0d 00 14 05  |em Simulator....|
00000020  f4 0d 00 1e 05 3a 0d 00  28 14 ee 20 85 20 f6 3a  |.....:..(.. . .:|
00000030  f1 22 20 40 20 22 3b 9e  3a e0 0d 00 32 07 eb 20  |." @ ";.:...2.. |
00000040  30 0d 00 3c 07 f3 20 6e  0d 00 46 35 de 20 6e 24  |0..<.. n..F5. n$|
00000050  28 6e 29 2c 72 28 6e 29  2c 6d 28 6e 29 2c 64 28  |(n),r(n),m(n),d(|
00000060  6e 29 2c 78 28 6e 29 2c  79 28 6e 29 2c 79 72 28  |n),x(n),y(n),yr(|
00000070  6e 29 2c 76 28 6e 29 2c  64 72 28 6e 29 0d 00 50  |n),v(n),dr(n)..P|
00000080  0d e3 20 70 3d 31 20 b8  20 6e 0d 00 5a 20 f3 20  |.. p=1 . n..Z . |
00000090  6e 24 28 70 29 2c 64 28  70 29 2c 72 28 70 29 2c  |n$(p),d(p),r(p),|
000000a0  6d 28 70 29 2c 79 72 28  70 29 0d 00 64 44 78 28  |m(p),yr(p)..dDx(|
000000b0  70 29 3d 64 28 70 29 3a  79 28 70 29 3d 30 3a 76  |p)=d(p):y(p)=0:v|
000000c0  28 70 29 3d 28 28 31 2f  31 38 30 2a af 2a 64 28  |(p)=((1/180*.*d(|
000000d0  70 29 29 2f 79 72 28 70  29 29 2a 31 30 30 3a 76  |p))/yr(p))*100:v|
000000e0  28 70 29 3d 30 3a 64 72  28 70 29 3d 39 30 0d 00  |(p)=0:dr(p)=90..|
000000f0  6e 05 ed 0d 00 78 05 3a  0d 00 82 05 f5 0d 00 8c  |n....x.:........|
00000100  0d e3 20 70 3d 31 20 b8  20 6e 0d 00 96 11 78 76  |.. p=1 . n....xv|
00000110  65 6c 3d 30 3a 79 76 65  6c 3d 30 0d 00 a0 0e e3  |el=0:yvel=0.....|
00000120  20 70 70 3d 31 20 b8 20  6e 0d 00 aa 0d e7 20 70  | pp=1 . n..... p|
00000130  70 3c 3e 70 20 8c 0d 00  b4 37 20 74 66 6f 72 3d  |p<>p ....7 tfor=|
00000140  31 30 2a 6d 28 70 70 29  2f 28 b6 28 28 78 28 70  |10*m(pp)/(.((x(p|
00000150  70 29 2d 78 28 70 29 29  5e 32 2b 28 79 28 70 70  |p)-x(p))^2+(y(pp|
00000160  29 2d 79 28 70 29 29 5e  32 29 5e 32 29 0d 00 be  |)-y(p))^2)^2)...|
00000170  2c 20 74 64 69 72 3d 31  38 30 2a 99 28 28 79 28  |, tdir=180*.((y(|
00000180  70 70 29 2d 79 28 70 29  29 2f 28 78 28 70 70 29  |pp)-y(p))/(x(pp)|
00000190  2d 78 28 70 29 29 29 2f  af 0d 00 c8 21 20 78 76  |-x(p)))/....! xv|
000001a0  65 6c 3d 78 76 65 6c 2b  74 66 6f 72 2a 9b 28 af  |el=xvel+tfor*.(.|
000001b0  2a 74 64 69 72 2f 31 38  30 29 0d 00 d2 21 20 79  |*tdir/180)...! y|
000001c0  76 65 6c 3d 79 76 65 6c  2b 74 66 6f 72 2a b5 28  |vel=yvel+tfor*.(|
000001d0  af 2a 74 64 69 72 2f 31  38 30 29 0d 00 dc 05 cd  |.*tdir/180).....|
000001e0  0d 00 e6 05 ed 0d 00 f0  12 64 72 28 70 29 3d 64  |.........dr(p)=d|
000001f0  72 28 70 29 2d 39 30 0d  00 fa 20 78 76 6e 3d 9b  |r(p)-90... xvn=.|
00000200  28 af 2a 64 72 28 70 29  2f 31 38 30 29 2a 76 28  |(.*dr(p)/180)*v(|
00000210  70 29 2b 78 76 65 6c 0d  01 04 20 79 76 6e 3d b5  |p)+xvel... yvn=.|
00000220  28 af 2a 64 72 28 70 29  2f 31 38 30 29 2a 76 28  |(.*dr(p)/180)*v(|
00000230  70 29 2b 79 76 65 6c 0d  01 0e 2f e7 20 79 76 6e  |p)+yvel.../. yvn|
00000240  3d 30 20 8c 20 64 72 28  70 29 3d 39 30 20 8b 20  |=0 . dr(p)=90 . |
00000250  64 72 28 70 29 3d 31 38  30 2a 99 28 78 76 6e 2f  |dr(p)=180*.(xvn/|
00000260  79 76 6e 29 2f af 0d 01  18 17 76 28 70 29 3d b6  |yvn)/.....v(p)=.|
00000270  28 78 76 6e 5e 32 2b 79  76 6e 5e 32 29 0d 01 22  |(xvn^2+yvn^2).."|
00000280  05 3a 0d 01 2c 24 e6 20  30 2c 30 3a c8 92 20 78  |.:..,$. 0,0:.. x|
00000290  28 70 29 2f 31 32 2b 35  30 30 2c 79 28 70 29 2f  |(p)/12+500,y(p)/|
000002a0  31 32 2b 35 30 30 0d 01  36 21 78 28 70 29 3d 78  |12+500..6!x(p)=x|
000002b0  28 70 29 2b 9b 28 af 2a  64 72 28 70 29 2f 31 38  |(p)+.(.*dr(p)/18|
000002c0  30 29 2a 76 28 70 29 0d  01 40 21 79 28 70 29 3d  |0)*v(p)..@!y(p)=|
000002d0  79 28 70 29 2b b5 28 af  2a 64 72 28 70 29 2f 31  |y(p)+.(.*dr(p)/1|
000002e0  38 30 29 2a 76 28 70 29  0d 01 4a 24 e6 20 30 2c  |80)*v(p)..J$. 0,|
000002f0  31 3a c8 92 20 78 28 70  29 2f 31 32 2b 35 30 30  |1:.. x(p)/12+500|
00000300  2c 79 28 70 29 2f 31 32  2b 35 30 30 0d 01 54 05  |,y(p)/12+500..T.|
00000310  ed 0d 01 5e 07 fd 20 a3  0d 01 68 05 3a 0d 01 72  |...^.. ...h.:..r|
00000320  24 f4 20 4e 61 6d 65 2c  44 69 73 74 61 6e 63 65  |$. Name,Distance|
00000330  2c 52 61 64 69 75 73 2c  4d 61 73 73 2c 59 65 61  |,Radius,Mass,Yea|
00000340  72 0d 01 7c 08 dc 20 31  30 0d 01 86 05 3a 0d 01  |r..|.. 10....:..|
00000350  90 17 dc 20 22 53 75 6e  22 2c 30 2c 31 30 33 2c  |... "Sun",0,103,|
00000360  33 33 35 2c 31 0d 01 9a  1f dc 20 22 4d 65 72 63  |335,1..... "Merc|
00000370  75 72 79 22 2c 35 38 2c  30 2e 34 2c 30 2e 30 36  |ury",58,0.4,0.06|
00000380  2c 30 2e 32 0d 01 a4 1e  dc 20 22 56 65 6e 75 73  |,0.2..... "Venus|
00000390  22 2c 31 30 38 2c 30 2e  39 35 2c 30 2e 38 2c 30  |",108,0.95,0.8,0|
000003a0  2e 36 0d 01 ae 17 dc 20  22 45 61 72 74 68 22 2c  |.6..... "Earth",|
000003b0  31 35 30 2c 31 2c 31 2c  31 0d 01 b8 1c dc 20 22  |150,1,1,1..... "|
000003c0  4d 61 72 73 22 2c 32 32  38 2c 30 2e 35 2c 30 2e  |Mars",228,0.5,0.|
000003d0  31 2c 31 2e 39 0d 01 c2  1d dc 20 22 4a 75 70 69  |1,1.9..... "Jupi|
000003e0  74 65 72 22 2c 37 37 38  2c 31 31 2c 33 32 30 2c  |ter",778,11,320,|
000003f0  31 32 0d 01 cc 1b dc 20  22 53 61 74 75 72 6e 22  |12..... "Saturn"|
00000400  2c 31 34 32 37 2c 39 2c  39 35 2c 33 30 0d 01 d6  |,1427,9,95,30...|
00000410  1b dc 20 22 55 72 61 6e  75 73 22 2c 32 38 37 30  |.. "Uranus",2870|
00000420  2c 34 2c 31 35 2c 38 34  0d 01 e0 1d dc 20 22 4e  |,4,15,84..... "N|
00000430  65 70 74 75 6e 65 22 2c  34 34 39 37 2c 34 2c 31  |eptune",4497,4,1|
00000440  37 2c 31 36 35 0d 01 ea  20 dc 20 22 50 6c 75 74  |7,165... . "Plut|
00000450  6f 22 2c 35 39 30 30 2c  30 2e 32 2c 30 2e 30 30  |o",5900,0.2,0.00|
00000460  32 2c 32 34 38 0d ff                              |2,248..|
00000467