home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / hobby / palmoon / palmoon.EXE / moontool.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-21  |  3.0 KB  |  65 lines

  1. #ifndef _H_MOONTOOL_
  2. #define _H_MOONTOOL_
  3.  
  4. #include <PalmOS.h>
  5. #include "MathLib.h"
  6.  
  7. /*  Astronomical constants  */
  8.  
  9. #define epoch       2444238.5      /* 1980 January 0.0 */
  10.  
  11. /*  Constants defining the Sun's apparent orbit  */
  12.  
  13. #define elonge      278.833540     /* Ecliptic longitude of the Sun
  14.                                       at epoch 1980.0 */
  15. #define elongp      282.596403     /* Ecliptic longitude of the Sun at
  16.                                       perigee */
  17. #define eccent      0.016718       /* Eccentricity of Earth's orbit */
  18. #define sunsmax     1.495985e8     /* Semi-major axis of Earth's orbit, km */
  19. #define sunangsiz   0.533128       /* Sun's angular size, degrees, at
  20.                                       semi-major axis distance */
  21.  
  22. /*  Elements of the Moon's orbit, epoch 1980.0  */
  23.  
  24. #define mmlong      64.975464      /* Moon's mean lonigitude at the epoch */
  25. #define mmlongp     349.383063     /* Mean longitude of the perigee at the
  26.                                       epoch */
  27. #define mlnode      151.950429     /* Mean longitude of the node at the
  28.                                       epoch */
  29. #define minc        5.145396       /* Inclination of the Moon's orbit */
  30. #define mecc        0.054900       /* Eccentricity of the Moon's orbit */
  31. #define mangsiz     0.5181         /* Moon's angular size at distance a
  32.                                       from Earth */
  33. #define msmax       384401.0       /* Semi-major axis of Moon's orbit in km */
  34. #define mparallax   0.9507         /* Parallax at distance a from Earth */
  35. #define synmonth    29.53058868    /* Synodic month (new Moon to new Moon) */
  36. #define lunatbase   2423436.0      /* Base date for E. W. Brown's numbered
  37.                                       series of lunations (1923 January 16) */
  38.  
  39. /*  Properties of the Earth  */
  40.  
  41. #define earthrad    6378.16        /* Radius of Earth in kilometres */
  42.  
  43. #define PI 3.14159265358979323846  /* Assume not near black hole nor in
  44.                                       Tennessee */
  45.  
  46. #define abs(x) ((x) < 0 ? (-(x)) : (x))                   /* Absolute val */
  47. #define fixangle(a) ((a) - 360.0 * (floor((a) / 360.0)))  /* Fix angle    */
  48. #define torad(d) ((d) * (PI / 180.0))                     /* Deg->Rad     */
  49. #define todeg(d) ((d) * (180.0 / PI))                     /* Rad->Deg     */
  50. #define dsin(x) (sin(torad((x))))                         /* Sin from deg */
  51. #define dcos(x) (cos(torad((x))))                         /* Cos from deg */
  52.  
  53.  
  54. double kepler(double m, double ecc);
  55. double phase(double pdate,double *pphase,double *mage,double *dist,
  56.              double *angdia,double *sudist,double *suangdia);
  57. FlpCompDouble *jtime(const DateTimeType *t, FlpCompDouble *j);
  58. void jyear(double td, Int32 *yy, Int16 *mm, Int16 *dd);
  59. void jhms(double j, Int16 *h, Int16 *m, Int16 *s);
  60. double meanphase(double sdate, double k);
  61. double truephase(double k, double phase);
  62. void phasehunt(double sdate, double phases[5]);
  63.  
  64. #endif /* _H_MOONTOOL_ */
  65.