Chapter 7 – Star Systems (Spirals)

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.


I wouldn’t want to suggest that the following short programs have any strict relevance to astronomy. Mainly, I want to find a use for the spiral graphics the Spectrum produces so easily! There are three areas where such shapes do have some connection with astronomy:

  1. Spiral form of our Milky Way galaxy.
  2. Some exotic binary stars losing matter to space as a gas trail.
  3. Shadow of an eclipsing binary traversing space.

Eclipsing binary shadow
The basic Spiral program could well mimic the third option for the eclipsing star Algol (the Demon Star) in Perseus. Here a fainter companion eclipses the brighter star every 70 hours as seen from our direction in space. Algol is about 100 light years away so we do not see these events instantly but 100 years and some 12,500 eclipses later. The intervening space between Algol and Earth is separated at 70 light hours distance by this ‘shadow event’ in one continuous spiral as if from a giant LP record centred on Algol. The program depicts only the first five sweeps of the shadow event in the vicinity of Algol to a distance of about 15 light days at hourly intervals.

The program (in Figure 7.6) also poses an interesting paradox concerning the finite speed of light (and any physical form) at 300,000 km/s. As the orbiting of Algol’s companion is constant, like the revolutions of a record, then the velocity of the shadow event on this disc, away from the centre, will soon exceed the speed of light by a factor of thousands in the vicinity of Earth. Thus although light has a finite speed it would appear that a shadow (the absence of light) can move at infinite speed. Or can it?

Figure 7.6


1 PRINT “Spiral @”
10 FOR f=0 TO PI*10 STEP .05
20 PLOT 140+SIN f*40*f/10,80+COS f*40*f/20
40 NEXT f

Spiral galaxy
The programs Twin Spiral (Figure 7.7) and Twin Spiral 2 (Figure 7.8) could well represent the spiral form of many galaxies — the largest known objects in the universe. Only two ‘arms’, as they are called, are depicted and some galaxies may have many more.

The program is identical to the first of this series, Spiral, except that a second line of PLOTting (for the second arm) is included in Line 30. Note that the SIN and COS values are now negative, causing the second spiral to be PLOTted 180° from the first spiral.

The PLOTting is controlled by the FOR/NEXT f loop for five orbital sweeps (PI*10) with a STEP value of 0.05. Changing the STEP value will alter the PLOTting interval. In Twin Spiral 2 the arms are more widely spaced by halving the values applied to variable f in Lines 20 and 30 in the form:

SIN … f/5 and COS … f/10

By having the second value (10) double that of the first (5), the spiral form is displayed as if inclined to the observer where the major (horizontal) axis is twice that of the minor (vertical) axis. Try amending these proportions with perhaps a larger or smaller number in the form:

COS … f/(new value)

This must be done with identical values in both Lines 20 and 30. Some permutations may cause the program to crash by attempting to PLOT beyond the screen confines.

Figure 7.7


1 PRINT “Twin Spiral @”
10 FOR f=0 TO PI*10 STEP .05
20 PLOT 140+SIN f*40*f/10,80+COS f*40*f/20
30 PLOT 140-SIN f*40*f/10,80-COS f*40*f/20
40 NEXT f

Figure 7.8


1 PRINT “Twin Spiral 2 @”
10 FOR f=0 TO PI*10 STEP .05
20 PLOT 140+SIN f*40*f/5,80+COS f*40*f/10
30 PLOT 140-SIN f*40*f/5,80-COS f*40*f/10
40 NEXT f

Stargas Spiral
The last of this series (Figure 7.9) performs precisely as the Twin Spiral program but has been rewritten in a neater form. Two small CIRCLES are added to represent a close binary system spraying matter into surrounding space as the stars orbit each other in violent conflict. Our knowledge of such possible events has not been witnessed at first hand but has been deduced by analysis of the spectrum (with a small s you will note!) via the spectroscope on giant telescopes. You could give this program a little more realism by using as a direct command before RUNnng:


You can also add a few coloured fireworks to the point of the gas trails origin between the two stars with an additional line:

12 PLOT INK RND*9; a,b

As this line will affect the whole character square containing the two stars, these will appear involved in the action too.

Figure 7.9


1 BORDER 0: PAPER 0: INK 2: CLS : PRINT “Stargas Spiral @”
3 LET a=140: LET b=80
5 CIRCLE a+3,b+3,3
6 CIRCLE a-3,b-3,3
10 FOR f=0 TO PI*10 STEP .05
12 PLOT INK RND*9;a,b
15 LET x=SIN f*40*f
16 LET y=COS f*40*f
20 PLOT a+x/5,b+y/10
30 PLOT a-x/5,b-y/10
40 NEXT f

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s