home *** CD-ROM | disk | FTP | other *** search
- #ifndef _H_MOONTOOL_
- #define _H_MOONTOOL_
-
- #include <PalmOS.h>
- #include "MathLib.h"
-
- /* Astronomical constants */
-
- #define epoch 2444238.5 /* 1980 January 0.0 */
-
- /* Constants defining the Sun's apparent orbit */
-
- #define elonge 278.833540 /* Ecliptic longitude of the Sun
- at epoch 1980.0 */
- #define elongp 282.596403 /* Ecliptic longitude of the Sun at
- perigee */
- #define eccent 0.016718 /* Eccentricity of Earth's orbit */
- #define sunsmax 1.495985e8 /* Semi-major axis of Earth's orbit, km */
- #define sunangsiz 0.533128 /* Sun's angular size, degrees, at
- semi-major axis distance */
-
- /* Elements of the Moon's orbit, epoch 1980.0 */
-
- #define mmlong 64.975464 /* Moon's mean lonigitude at the epoch */
- #define mmlongp 349.383063 /* Mean longitude of the perigee at the
- epoch */
- #define mlnode 151.950429 /* Mean longitude of the node at the
- epoch */
- #define minc 5.145396 /* Inclination of the Moon's orbit */
- #define mecc 0.054900 /* Eccentricity of the Moon's orbit */
- #define mangsiz 0.5181 /* Moon's angular size at distance a
- from Earth */
- #define msmax 384401.0 /* Semi-major axis of Moon's orbit in km */
- #define mparallax 0.9507 /* Parallax at distance a from Earth */
- #define synmonth 29.53058868 /* Synodic month (new Moon to new Moon) */
- #define lunatbase 2423436.0 /* Base date for E. W. Brown's numbered
- series of lunations (1923 January 16) */
-
- /* Properties of the Earth */
-
- #define earthrad 6378.16 /* Radius of Earth in kilometres */
-
- #define PI 3.14159265358979323846 /* Assume not near black hole nor in
- Tennessee */
-
- #define abs(x) ((x) < 0 ? (-(x)) : (x)) /* Absolute val */
- #define fixangle(a) ((a) - 360.0 * (floor((a) / 360.0))) /* Fix angle */
- #define torad(d) ((d) * (PI / 180.0)) /* Deg->Rad */
- #define todeg(d) ((d) * (180.0 / PI)) /* Rad->Deg */
- #define dsin(x) (sin(torad((x)))) /* Sin from deg */
- #define dcos(x) (cos(torad((x)))) /* Cos from deg */
-
-
- double kepler(double m, double ecc);
- double phase(double pdate,double *pphase,double *mage,double *dist,
- double *angdia,double *sudist,double *suangdia);
- FlpCompDouble *jtime(const DateTimeType *t, FlpCompDouble *j);
- void jyear(double td, Int32 *yy, Int16 *mm, Int16 *dd);
- void jhms(double j, Int16 *h, Int16 *m, Int16 *s);
- double meanphase(double sdate, double k);
- double truephase(double k, double phase);
- void phasehunt(double sdate, double phases[5]);
-
- #endif /* _H_MOONTOOL_ */
-