Chapter 7 – Star Systems (Galaxy)Posted: March 31, 2013
Tri-star Orbits, places two companion stars in orbit around a central star
Binary-star Orbit, a more normal situation, one star orbiting another
Spirals, various options
Galaxy, simulate the Milky Way.
This program enables the user to simulate the probable appearance of our Milky Way galaxy as seen from intergalactic space. It uses an inverse video type of presentation (BORDER 0: PAPER 0: INK 7) and appears almost photographic in clarity. The screen COPYs, Figures 7.10 and 7.11, are mere shadows of the screen effect.
The user may tilt the galaxy at any angle from 0° (edge-on) to 90° (plan view) via the variable t. The program itself is divided into five sections as the REM statements indicate. It may be of interest to expound on these a little, starting with the galaxy DRAW routine from Line 100 to 150. Here two FOR/NEXT loops PLOT the stars to form six spiral arms in Line 130 and the galactic centre in Line 140. The constant use of RND in this PLOTting produces a clumping effect of star distribution which is known to exist. The actual length of the FOR/NEXT n loop is controlled by the variable tt (which in turn has the initial value of t — the INPUT tilt) and limits the total number of stars PLOTted in this section. Effectively, at low angles of tilt fewer stars would be seen because of the intervening dust between them, so few stars are actually PLOTted.
The next sequence from Line 160 PLOTs the haze of ‘globular clusters’ that form a spherical shell which orbits the galactic centre. Each pixel represents hundreds of thousands of stars.
Our Milky Way galaxy almost edge-on. All the stars seen from Earth (without optical aid) are within the small circle on the right.
The galaxy’s spiral arms become evident as the system is tilted.
This section from Line 220 is used to punctuate the PLOTting with PRINT comments for each sequence. Notice how each PRINT line is the same length, 32 characters. In this way it is not necessary to delete the previous PRINT comment but simply to overPRINT it with the next. Line 230 locates the PRINT statement as a separate GOSUB routine.
The final sequence from Line 270 indicates the immensity of the universe by CIRCLEing a 2000 light year radius about the solar system (which would be totally invisible to this scale). But a telescope on the planet Earth can see up to 15,000,000,000 light years into intergalactic space with a collecting surface only 200 inches across (Hale Reflector). This is the equivalent, on a typical screen presentation of this program, of seeing over 20 miles in all directions from your TV set, from a subatomic particle in the small circle centre right. The subatomic particle would be about 0.000 000 000 000 01mm diameter!
10 REM Galaxy
20 BORDER 0: PAPER 0: INK 7
30 CLS : LET z=75: LET x=148: LET y=80
50 PRINT AT 20,0;”Galaxy”‘”Tilt=”;: INPUT “0”; CHR$ 130; “to 90; CHR$ 130;t
60 PRINT t; CHR$ 130; TAB 9;”< 100000LY >”: LET tt=t
70 PLOT 76,3: DRAW OVER 1;143,0: GO SUB 230: GO SUB 240
80 LET t=1/SIN ((.1+t)/180*PI)
100 LET q=4+1/t*6
110 FOR n=1 TO tt/10+2
120 FOR f=1 TO z
130 PLOT x+f*(SIN f)+RND*q,y+f*COS f/t+RND*q-2
140 PLOT x+f*SIN f/4+RND*3,y+f*COS f/6+RND*2
150 NEXT f: NEXT n
170 GO SUB 230: GO SUB 250
180 FOR f=1 TO z
190 PLOT x-10+f*SIN f+RND*20,y-10+f*COS f+RND*20: NEXT f
200 GO SUB 230: GO SUB 260
230 PRINT AT 0,0;: RETURN
240 PRINT FLASH 1;” Galactic centre & spiral ‘arms'”: RETURN
250 PRINT FLASH 1;” surrounding globular clusters “: RETURN
260 PRINT FLASH 1;” O=2000 LY radius from Sun whichtakes 225M years to orbit galaxy”
280 CIRCLE FLASH 1;x+52,y,3