# Chapter 7 – Star Systems (Binary-star Orbit)

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.

## Binary-star Orbit

This program is, in comparison to the Tri-star Orbit, a little tame, but at least it is known to exist fairly commonly for star systems. In fact a fairly high percentage of stars prove to be binaries and the expression had been in use long before its adaptation to computer terminology! The sample screen COPYs show typical results by varying the INPUT of orbit tilt and diameter of the two component stars. As previously mentioned for the Tri-star Orbits, low orbital tilt and large diameter stars simulate eclipse effects. See Figures 7.3 and 7.4.

Figure 7.3
A single companion star orbits a massive primary star. Figure 7.4
Mutual eclipses occur at low angles of orbital tilt. Mutual centre of gravity
You will notice that in both programs the central star remains fixed, implying that the mass of the orbiting star (or stars) is insignificant. However, in some star systems the mass of the component stars may not be too dissimilar and so both stars orbit about the common centre of gravity for the system, as in Figure 7.5.

Figure 7.5
Two stars of comparable mass orbit around a common centre of gravity marked with a single pixel. As such a binary bears a greater relationship to the Tri-star Orbit with the above modification for a Lagrangian orbit, it is easier to deal with this program as a further modification to the Tri-star Orbits program. However, assuming that the Binary-star Orbit has been keyed in, the modifications for orbits about a mutual centre of gravity are as follows:

80 LET h=60: PLOT x,y
101 LET sx1=INT (SIN f*h/2)
111 LET cy1=INT (COS f*h/z/2)
121 PLOT x – sx1, y-cy1
141 CIRCLE x-sx1, y-cy1,d1

The PLOT in Line 80 puts a single pixel at the centre of gravity for the system Lines 101 and 111 calculate the orbital position of the central star now shifted from a fixed point. The last value, 2, controls the orbital radius of the central star. Try other values from 1 to 5 and see the effect created. A value of less than 1 (eg 0.7) will make the former central star orbit further out than the so-called outer star. Beware that the orbits are still contained on the screen, otherwise the program will crash.

10 CLS : PRINT “Binary-star Orbit: “;
30 INPUT “Orbit tilt (0”; CHR\$ 130; “to 90″; CHR\$ 130;”) “;z
35 PRINT “tilt=”;z;” CHR\$ 130
40 LET z=1/SIN ((.1+z)/180*PI)
50 INPUT “Star 1 diameter (1-20): “;d1
60 INPUT “Star 2 diameter (1-20): “;d2
70 LET x=128: LET y=88
80 LET h=60: CIRCLE x,y,d1
90 FOR f=0 TO PI*2 STEP .1
100 LET sx=INT (SIN f*h)
110 LET cy=INT (COS f*h/z)
120 PLOT x+sx,y+cy
140 OVER 1: FOR n=0 TO 1
150 CIRCLE x+sx,y+cy,d2
170 NEXT n: OVER 0: NEXT f