Skip to main content Accessibility help
×
Hostname: page-component-84b7d79bbc-rnpqb Total loading time: 0 Render date: 2024-07-26T21:16:03.185Z Has data issue: false hasContentIssue false

MINSEC: converts between decimal hours/degrees and minutes/seconds form

Published online by Cambridge University Press:  17 February 2010

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

Summary

The starting and finishing points of astronomical calculations are usually angles, expressed as degrees, minutes and seconds of arc, or times, measured in hours, minutes, and seconds. Yet computers often cannot handle these quantities as they stand. They must first be converted to decimal degrees or hours before the computation can begin, and then the result converted back into the more-familiar minutes and seconds form. Consider, for example, the problem of finding the time corresponding to 1 hour 37 minutes before 3 : 25 in the afternoon. We first convert the times to their decimal forms, 1.616667 hours and 3.416667 hours, then subtract the former from the latter to get 1.800 hours, and finally convert back to minutes and seconds: 1 : 48 pm.

Your computer can deal with the problem of converting angles or times between decimal and minutes/seconds forms with the aid of the subroutine MINSEC. The direction in which the conversion is carried out is controlled by the switch SW(1). When SW(1) has the value +1, then the quantity represented by the input argument X (decimal degrees/hours) is converted into degrees/hours, minutes, and seconds which are returned by the output arguments XD, XM, XS respectively. XD and XM represent whole numbers while XS represents the seconds correct to two decimal places. The sign of X is returned by the string variable S$ which has the value ‘ + ’ unless X is negative when S$ becomes ‘―’. The real variable SN also carries this information since SN = +1 if X is positive, SN = 0 if X is zero, and SN = −1 if X is negative.

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
×