home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
calcultr
/
sun.arc
/
SUN.DOC
< prev
next >
Wrap
Text File
|
1988-03-30
|
3KB
|
54 lines
SUN.C documentation
SUN.C Version 1.0 Michael Schwartz December 25, 1984
Update for ANSI compatibility March 1, 1988
This program uses the USNO algorithm to calculate sunrise and sunset
times from standard lattitudes and longitudes. It has been set up as
system independently as possible, with the exception being a function
which gets the current (default) date and day of the year.
Inquiries can reach me at PO BOX 24536, Denver, Colorado 80224
(a place no longer 'out of the way')
Ref: Almanac for Computers, pub. by US NAVAL OBSERVATORY
Usage:
sun [-c] [-l[lat]] [-L[long]] [-M] [-m[1-12|a]] [-d[day]]
[-t<S|C|N|A>] [-<12|24>]
Latitude in deg,min'sec" N; Longitude in deg,min'sec" W
NOTE THAT LONGITUDE IS NEGATIVE OF USUAL NOTATION (I'm a Western
Hemisphere chauvinist). Also, use of -l or -L will cause the
time zone to default to GMT!!!
-c: Calendar-ish output
-M: multiple invocation
-m: Choose a month of times (e.g. -m5 for may) or all 12 months (-ma)
-d: Day of year
-t: S:Sunset, C: Civil Twilight N: Nautical Twilight A: Astronomical Twilight
-12: 12 hour clock (default)
-24: 24 hour clock
-j: Candle lighting & Havdalah
Accuracy: The USNO claims accuracy withing 2 minutes except at extreme
northern or southern lattitudes. Comparison to local NWS charts for
sunrise and sunset (which are cheap and easy to come by) shows that with
the double precision calculations, the charts produced by this program
are no more than 1 minute removed from those charts in lattitudes lower
than 41 degrees. Candle lighting times agree with those on popular
calendars also to the 1 minute accuracy.
The program, unlike its Fortran predecessor has a number of
important options and defaults. It is capable of getting today's
sunrise and sunset at a default location (now Denver, of course),
producing a calendar-like table of a month or a year, and allowing the
user to produce reams of data without reinvoking the program.
Bugs: No method of calculating DST or aligning years to Fridays/Saturdays
or holidays has been provided in the MS-DOS version: However,
as more MS-DOS compilers support the ANSI time standards, the MS-DOS
option may not be necessary for your compiler.
This program has not been tested under UNIX since the ANSI updates.
The locations of the include files may need to be fixed.
Rights: All rights to this program are placed in the public domain.