ROM Computer Magazine Archive ROM MAGAZINE ISSUE 1 — AUGUST/SEPTEMBER 1983 / PAGE 17

Satellite
By Bob Cockroft

    This program below illustrates a satellite which orbits a planet. The satellite changes different colors as it travels around the planet and you can actually see its elliptical orbit.
    This program requires at least 16K.

Sattilite screen

8 GRAPHICS 8
9 COLOR 1
11 PLOT 20,130:PLOT 234,20
12 SETCOLOR 2,16,1
18 B=101
19 A=201
20 COLOR 1
35 FOR X=100 TO 150
40 Y=-SOR(-(X-150)*(X-150)+2500)+95
54 A=A-1
55 PLOT X,Y:DRAWTO A,Y
60 NEXT X
65 FOR X=200 TO 145 STEP -1
70 Y=SQR(-(X-150)*(X-150)+2500)+95
84 B=B+1
85 PLOT X,Y:DRAWTO B,Y
90 NEXT X
100 PLOT 40,10:PLOT 200,50:PLOT 310,143
120 FOR X=70 TO 231
130 Y=SQR(-100*(X-150)*(X-150)/6561+100)+95
135 PLOT X,Y
137 IF X>125 THEN 139
138 GOTO 141
139 IF X<177 THEN 142
141 R=X-1
142 Y=SQR(-100*(R-150)*(R-150)/6561+100)+95
143 COLOR 0
144 PLOT R,Y
145 COLOR 1
150 NEXT X
160 FOR X=230 TO 69 STEP -1
161 IF X>198 THEN 170
162 IF X<102 THEN 163
163 IF X>102 THEN 165
164 GOTO 250
165 IF X<199 THEN 166
166 IF X>175 THEN 190
167 IF X<175 THEN 169
168 GOTO 170
169 IF X<126 THEN 200
170 Y=-SQR(-100*(X-150)*(X-150)/6561+100)+95
180 PLOT X,Y
185 IF X<175 THEN 240
190 R=X+1
200 Y=-SQR(-100*(R-150)*(R-150)/6561+100)+95
210 COLOR 0
220 PLOT R,Y
230 COLOR 1
240 NEXT X
250 FOR X=101 TO 69 STEP -1
255 COLOR 1
260 Y=-SQR(-100*(X-150)*(X-150)/6561+100)+95
265 PLOT X,Y
270 R=X+1
280 Y=-SQR(-100*(R-150)*(R-150) /6561+100)+95
290 COLOR 0
300 PLOT R,Y
310 COLOR 1
320 NEXT X
330 GOTO 120
400 FOR X=151 TO 170
405 COLOR 1
407 PLOT 151,133:DRAWT0 169,133
408 PLOT 150,141:DRAWTO 168,141
409 PLOT 148,95:DRAWTO 152,95
410 Y=SQR(-4096*(X-160)*(X-160)/100+4096)+95
415 COLOR 1
420 PLOT X,Y
450 R=X-1
460 Y=SQR(-4096*(R-160)*(R-160)/100+4096)+95
470 COLOR 0
480 PLOT R,Y
490 NEXT X
495 COLOR 1
500 FOR X=169 TO 150 STEP -1
501 PLOT 168,95:DRAWTO 172,95
502 PLOT 150,49:DRAWTO 170,49
503 PLOT 150,57:DRAWTO 170,57
510 Y=-SQR(-4096*(X-160)*(X-160)/100+4096)+95
520 PLOT X,Y
530 R=X+1
540 Y=-SQR(-4096*(R-160)*(R-160)/100+4096)+95
550 COLOR 0
560 PLOT R,Y
570 COLOR 1
580 NEXT X
590 GOTO 400
1000 R=INT(RND(0)*75)+1
1010 A=150-R
1020 B=150
1030 FOR X=A TO B
1040 Y=SQR(-(X-150)*(X-150)+R*R)+80
1050 E=150-X
1055 F=150+E
1060 PLOT X,Y;DRAWTO F,Y
1065 PLOT 10,30:PLOT 200,100:PLOT 140,130:PLOT 230,50
1070 NEXT X
1080 FOR X=A TO B
1090 Y=-SQR(-(X-150)*(X-150)+R*R)+80
1100 E=150-X
1110 F=150+E
1120 PLOT X,Y:DRAWTO F,Y
1121 PLOT 250,140
1122 NEXT X
1123 H=INT(RND(Q)*11)
1124 T=INT(RND(0)*18)
1125 L=INT(RND(0)*10)
1126 X=INT(RND(0)*13)
1127 Y=INT(RND(0)*11)
1128 Z=INT(RND(0)*6)
1129 DIM C$(10)
1130 S=INT(RND(0)*6)+1
1131 B=INT(RND(0)*11)+1
1133 DIM A$(10)
1134 DIM B$(10)
1135 GOTO 1135

You're Fired