Skip to main content Accessibility help
×
Hostname: page-component-84b7d79bbc-lrf7s Total loading time: 0 Render date: 2024-07-26T23:15:39.559Z Has data issue: false hasContentIssue false

DISPLAY: displays an eclipse in graphical form

Published online by Cambridge University Press:  17 February 2010

Peter Duffett-Smith
Affiliation:
Downing College, Cambridge
Get access

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
Publisher: Cambridge University Press
Print publication year: 1990

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×