Book contents
- Frontmatter
- Contents
- Preface
- Using your personal computer for astronomy
- DEFAULT: default value input routnine & YESNO: ‘Y’ or ‘N’ input routine
- MINSEC: converts between decimal hours/degrees and minutes/seconds form
- JULDAY: calendar date to Julian day number since 1900 January 0.5
- CALDAY: Julian day number since 1900 January 0.5 to calendar date
- TIME: converts between local civil and sidereal times
- EQHOR: converts between equatorial and horizon coordinates
- HRANG: converts between right ascension and hour angle
- OBLIQ: calculates the value of the obliquity of the ecliptic
- NUTAT: finds corrections for nutation in longitude and obliquity
- EQECL: converts between equatorial and ecliptic coordinates
- EQGAL: converts between equatorial and galactic coordinates
- GENCON: converts between any of the coordinate systems
- PRCESS1: approximate precession of equatorial coordinates & PRCESS2: rigorous precession of equatorial coordinates
- PARALLX: converts between geocentric and apparent position
- REFRACT: calculates the effect of atmospheric refraction
- RISET: finds the circumstances of rising and setting
- ANOMALY: solves Kepler's equation for elliptical motion
- SUN: finds the ecliptic coordinates of the Sun
- SUNRS: finds the circumstances of sunrise and sunset
- PELMENT: returns the orbital elements of the major planets
- PLANS: finds the position of a planet
- MOON: finds the position and parallax of the Moon
- MOONRS: finds the circumstances of moonrise and moonset
- MOONNF: finds the times of new and full moon
- ECLIPSE: finds the circumstances of lunar and solar eclipses
- DISPLAY: displays an eclipse in graphical form
- ELOSC: finds positions from osculating elliptical elements
- RELEM: converts elliptic orbital elements from one epoch to another
- PCOMET: finds the position of a comet from parabolic elements
- PFIT: finds parabolic elements from observations & EFIT: finds elliptical elements from observations
- List of variables
- Bibliography
- Index
- PROGRAMS AVAILABLE ON DISK
DISPLAY: displays an eclipse in graphical form
Published online by Cambridge University Press: 17 February 2010
- Frontmatter
- Contents
- Preface
- Using your personal computer for astronomy
- DEFAULT: default value input routnine & YESNO: ‘Y’ or ‘N’ input routine
- MINSEC: converts between decimal hours/degrees and minutes/seconds form
- JULDAY: calendar date to Julian day number since 1900 January 0.5
- CALDAY: Julian day number since 1900 January 0.5 to calendar date
- TIME: converts between local civil and sidereal times
- EQHOR: converts between equatorial and horizon coordinates
- HRANG: converts between right ascension and hour angle
- OBLIQ: calculates the value of the obliquity of the ecliptic
- NUTAT: finds corrections for nutation in longitude and obliquity
- EQECL: converts between equatorial and ecliptic coordinates
- EQGAL: converts between equatorial and galactic coordinates
- GENCON: converts between any of the coordinate systems
- PRCESS1: approximate precession of equatorial coordinates & PRCESS2: rigorous precession of equatorial coordinates
- PARALLX: converts between geocentric and apparent position
- REFRACT: calculates the effect of atmospheric refraction
- RISET: finds the circumstances of rising and setting
- ANOMALY: solves Kepler's equation for elliptical motion
- SUN: finds the ecliptic coordinates of the Sun
- SUNRS: finds the circumstances of sunrise and sunset
- PELMENT: returns the orbital elements of the major planets
- PLANS: finds the position of a planet
- MOON: finds the position and parallax of the Moon
- MOONRS: finds the circumstances of moonrise and moonset
- MOONNF: finds the times of new and full moon
- ECLIPSE: finds the circumstances of lunar and solar eclipses
- DISPLAY: displays an eclipse in graphical form
- ELOSC: finds positions from osculating elliptical elements
- RELEM: converts elliptic orbital elements from one epoch to another
- PCOMET: finds the position of a comet from parabolic elements
- PFIT: finds parabolic elements from observations & EFIT: finds elliptical elements from observations
- List of variables
- Bibliography
- Index
- PROGRAMS AVAILABLE ON DISK
Summary
The eclipse pictures printed in Figure 7, which show lunar and solar eclipses at various stages, were produced by subroutine DISPLAY listed later in this section. Unfortunately, it is not possible to write code which will work equally well on every computer since the mechanics of producing graphics displays varies so much from machine to machine. You will certainly have to modify DISPLAY to suit the particular characteristics of your own computer. To help you do so, I have collected all the graphics commands into a number of function calls; for example, FNCLGS clears the graphics screen to black. You can use DISPLAY just as it is provided you can define the functions so that they work on your machine. Alternatively, you may replace the functions with calls to procedures or subroutines to do the same thing. Thus, if your BASIC includes the graphics command ‘HOME’, for example, which clears the screen, you could substitute ‘GOSUB 9000’ for ‘X = FNCLGS’ and include the extra subroutine
9000 Home : RETURN
at the end. Obviously, more complex procedures will require several lines of code each.
The graphics screen on my computer measures 392 pixels in the horizontal, or X direction, and 256 in the vertical, or Y direction. You can think of the screen as a large sheet of graph paper, with the point X = 0, Y = 0 at the bottom left-hand corner of the screen.
- Type
- Chapter
- Information
- Astronomy with your Personal Computer , pp. 187 - 196Publisher: Cambridge University PressPrint publication year: 1990