Next page | Contents page |

Exercise 12 - Charts

Still using the star data from exercises 8 and 10 (but not the corrupted version of exercise 11), plot the stars on a chart.

The scale should be 30 pixels per degree (making a chart about 600 pixels high and somewhat less wide). Note that in computer graphics the vertical axis starts with zero at the top of the canvas and works downwards (historically because TV scans go downwards). Also, astronomically, the RA coordinate increases from right to left (because of the apparent direction of rotation of the sky around the Earth).

Each star should be a circle filled in black. The radius of the circle should reflect the star's magnitude (see box below).

Join stars with thin black lines in an appropriate pattern to show the shape of the constellation.

Label each star with its Greek symbol. Unfortunately you cannot use the HTML entities as you did in Exercise 9. Instead you will need the Unicode character code for each. You can easily find the codes by searching on the Internet, eg, for "unicode alpha". Use the \uxxxx notation to put them in your program.


The magnitude scale is a logarithmic scale of inverse brightness. The brightest stars have magnitude 0 and the faintest that can be seen by the naked eye (from a rural location, away from street lights) is about 6. So a smaller magnitude value means a brighter star.

For the purposes of this exercise, where the magnitude range is from 0.18 to 2.25, use this formula for the radius of the circular dot to represent a star:

r = (2.75 - vmag) * 4;

Next page | Contents page |