The title was just meant to get your attention. We are not specifically going to look at the Milky Way but will try to depict a typical spiral galaxy for stereo viewing by using a fairly simple QBasic program. After the Big Bang, the universe was not absolutely uniform and regions of higher density responded to gravity by contracting and pulling in matter from the surrounding less-dense regions. This happened at all scales, forming stars, galaxies, clusters of galaxies, superclusters of same and ginormous bubbles of emptyish spaces bordered by walls of galaxies. The shape assumed by any congregation of matter is greatly influenced by the net angular momentum that congregation happens to have. If there is little angular momentum, the components mill about in a fuzzy ball with many near misses or collisions that transfer kinetic energy between units, occasionally whipping some of them out of the ball. This is seen in spherical galaxies and in the so-called globular clusters, of perhaps a mere million stars, in the haloes of spiral galaxies. With somewhat more net angular momentum, the sphere is flattened, as in ellipsoidal galaxies, with the shortest axis being the axis of nett rotation--somewhat akin to the earth's shape. With greater rotation, a disk is formed with a concentration at the galaxy centre, and the disk thinning further out. A similar mechanism applies in the formation of galaxies or planetary systems. Nature does all of this as a matter of course, having had lots of practice with probably a couple of hundred billion galaxies, each containing perhaps a couple of hundred billion stars. The statistical mathematics to describe these processes are best left to those who devote their lives to such pursuits. Our aims are much less ambitious and we will use some easy maths to get a shape which looks something like that which books and magazines publish. I haven't seen an estimate of the proportion of such galaxies; perhaps it is only a few tens of billions, but, whatever we produce, there are certainly a few out that resemble it. As the disk thins down, higher density regions in it will also tend to gather material. Processes, which we might refer to vaguely as resonances, lead to the forming of rings, as with Saturn, or the arms of spiral galaxies. Planets and moons result from the bunching up of the rings. The gravitational attraction of adjacent parts of an arm obviously favours retention of a continuous arm; a fundamental fact about orbits is that bodies further out move slower, both in velocity and in angular velocity, which leads to the arms being swept back into a spiral. It is not, however, a simple case of individual stars obeying the orbital laws about the galaxy centre; stars in the tapering arms are towed along by the greater density of the stars ahead of them so that, at some sweep angle, they maintain the same angular velocity and the whole pattern rotates. Perhaps some stars trail off the end or are ejected after a close encounter with another. Our Sun orbits our galaxy centre in about 250 million years but stars closer
in must be going faster or they would be drawn closer to the centre. The pattern
is not completely static, as not every star is necessarily in a perfect circular
orbit in the central disk plane. Some, like the globular clusters, are well out
of the plane, which they must pass through twice during each orbit, no doubt
causing considerable upset to the locals. Hope one doesn't come our way. In the QBasic listing, we make much use of the random number generator, RND,
which returns numbers between 0 and 1 that we can manipulate to position
individual stars in the galaxy. Using the 640 x 480 screen, we put the origin
three quarters of the way across the screen and draw the right eye view on the
right, between x = -160 and x = 159. The left eye view is calculated on the
right but then mirror flipped about x = -160 before plotting to lie between -160
and -480. The 5000 stars might not cut the mustard for your average galaxy, but
it'll do for your average screen.
By raising the first RND to power 2.5 to allot the radius, we concentrate
stars towards the centre but this gives a very dense central axle, so we add 0.4
to RND first to remove this. You may vary the concentration by varying the
exponent. The angle, a, is 1.26 radians (2II/5) multiplied by a random integer,
0 to 4, to define 5 arms. Now, we want to smear stars circumferentially in each
arm; in the centre, "sa", the smear angle, is uniform over the range
+/- 0.63 radians (2II/10), but in the outer arms, stars are concentrated near
the arm, by squaring RND, and "sa" falls off by the inverse square of
the radius, to give thin arms at the rim, smearing into a more continuous disk
towards the centre. RND greater or less than 0.5 is used to distribute stars
fore or aft.
We now sweep the arms back, proportional to radius, to get the spiral effect.
The axis of the galaxy is, initially, the x axis so we resolve the radius into
its y and z co-ordinates, using the calculated angle. We now need to distribute
stars each side of the disk. Near the centre, we have a flat ellipsoid so the x
co-ordinate is randomly allotted within the appropriately calculated range. In
the outer disk, the x range tapers off inversely as the radius. With the galaxy
in this position, we would get an edge-on view of the shape, but will rotate it
about the y axis for a better view of the whole.
To transpose each star's position to screen pixels for each eye, we first
calculate a "z factor" that is the ratio of the screen-to-star
distance to the eye-to-star distance. Using similar triangles, this is used to
transpose the x and y co-ordinates. The left eye pixel has to be flipped across
the centreline so that you can use a mirror on the centreline, facing left, to
flip it right back to give you a true stereo picture on the right. Stars are
randomly coloured as this can assist the eyes to marry up the correct pairs to
make individual stars easier to see stereoscopically; also we avoid copying over
earlier star plots by checking for both clear black pixels before plotting. Note
that the code uses a black background which is more realistic and effective; for
publication we have to use a white background since printing coloured dots on a
black background is bleedin' unsatisfactory. Also added are a few globular
clusters, four pixels apiece, near the galaxy and a couple of distant galaxies;
these are about two metres beyond the page and you need to consciously focus on
them to see them in stereo.
By changing the variables and the exponents you can get a wide assortment of
shapes, but a common feature will be that they are much too regular for a
natural object--but this is what you get from simple calculations; if you want
to re-create the variability of nature you need to do a bit more work. The
turbulence equations used in ray-tracing programs for clouds and marble patterns
are quite elegant--or you can deliberately build in variations by code which
might not quite earn that description. Place
mirror edge up centreline, mirror facing left. Right eye looks at
right screen, left eye at reflection in mirror.
|