home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
TURBOM2
/
M2ASTRO.LBR
/
ASTROLIB.DZF
/
ASTROLIB.DEF
Wrap
Text File
|
2000-06-30
|
3KB
|
96 lines
DEFINITION MODULE AstroLib;
(*
AstroLib is a library of general Astronomical functions. This
release while having been reasonably tested should be considered
preliminary. Corrections and additions are likely to be made!
Jim Lill August, 1987
GEnie [JIMLILL]
Lillipute 2
Z-Node Central
Sage
LONGREAL is used because many of these will be used in chain calculations
where cumulative errors would be intolerable. Conversion to REAL may be
desirable for user interface but is left to the calling MODULE.
Parameters:
- execpt for HMS, all procedures return "decimal" results.
- yr, mo, day and hr, min, sec are CARDINAL as that's what RTC
applications will need.
- hrs is decimal hours and often will be a global variable initialized
in the calling module.
- nd is the number of days from Jan 0, year to current date
- tc is the number of years from Jan 0, 1900 to current date
- gst is Greenwich Sidereal Time
- lst is Local Sidereal Time
- long is the local longitude
- ra is Right Ascension
- lha is Local Hour Angle
- oe is obliquity of ecliptic
- dec is Declination
- az is azimuth (compass heading)
- alt is altitude (elevation above horizon)
- elat and elong are the ecliptic coordinates
- l and b are galactic coordinates
*)
VAR JD0 : LONGREAL; (* Julian Date for Jan 0 1980 *)
PROCEDURE DLONG(dnum:LONGREAL):LONGREAL;
(* DOUBLE(LONG(dnum)) *)
PROCEDURE JD(yr,mo,day:CARDINAL; hrs:LONGREAL):LONGREAL;
(* JD Day Number *)
PROCEDURE HRS(hr, min, sec:CARDINAL):LONGREAL;
(* Decimal time or angle from HMS *)
PROCEDURE HMS(VAR hr,min,sec:CARDINAL; hrs:LONGREAL);
(* HMS from Dec time or angle *)
PROCEDURE ND(yr:CARDINAL; jd:LONGREAL):LONGREAL;
(* # of days from Jan 0, year to jd *)
PROCEDURE TC(yr:CARDINAL):LONGREAL;
(* # of centuries from Jan 0, 1900 to yr *)
PROCEDURE GST(nd,tc,hrs:LONGREAL; yr:CARDINAL):LONGREAL;
(* Greenwich Sidereal Time *)
PROCEDURE LST(gst, long:LONGREAL):LONGREAL;
(* Local Sidereal Time *)
PROCEDURE LHA(ra,lst:LONGREAL):LONGREAL;
(* Right Asc ==> Local Hr Angle *)
PROCEDURE RA(lha,lst:LONGREAL):LONGREAL;
(* LHA ==> Right Asc *)
PROCEDURE OE(tc:LONGREAL):LONGREAL;
(* Mean Obliquity of Ecliptic from TD (above) *)
PROCEDURE Equ2Hor(lha,dec,lat:LONGREAL; VAR az,alt:LONGREAL);
(* Equatorial ==> Horizon *)
PROCEDURE Hor2Equ(az,alt,lat:LONGREAL; VAR lha,dec:LONGREAL);
(* Horizon ==> Equatorial *)
PROCEDURE Ecl2Equ(elong,elat:LONGREAL; VAR ra,dec:LONGREAL);
(* Ecliptic ==> Equatorial *)
PROCEDURE Equ2Ecl(ra,dec:LONGREAL; VAR elong,elat:LONGREAL);
(* Equatorial ==> Ecliptic *)
PROCEDURE Equ2Gal(ra,dec:LONGREAL; VAR l,b:LONGREAL);
(* Equatorial ==> Galactic *)
PROCEDURE Gal2Equ(l,b:LONGREAL; VAR ra,dec:LONGREAL);
(* Galactic ==> Equatorial *)
END AstroLib.