nutate.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "astro.h"
  10. void
  11. nutate(void)
  12. {
  13. /*
  14. * uses radian, radsec
  15. * sets phi, eps, dphi, deps, obliq, gst, tobliq
  16. */
  17. double msun, mnom, noded, dmoon;
  18. /*
  19. * nutation of the equinoxes is a wobble of the pole
  20. * of the earths rotation whose magnitude is about
  21. * 9 seconds of arc and whose period is about 18.6 years.
  22. *
  23. * it depends upon the pull of the sun and moon on the
  24. * equatorial bulge of the earth.
  25. *
  26. * phi and eps are the two angles which specify the
  27. * true pole with respect to the mean pole.
  28. *
  29. * all coeffieients are from Exp. Supp. pp.44-45
  30. */
  31. mnom = 296.104608 + 13.0649924465*eday + 9.192e-3*capt2
  32. + 14.38e-6*capt3;
  33. mnom *= radian;
  34. msun = 358.475833 + .9856002669*eday - .150e-3*capt2
  35. - 3.33e-6*capt3;
  36. msun *= radian;
  37. noded = 11.250889 + 13.2293504490*eday - 3.211e-3*capt2
  38. - 0.33e-6*capt3;
  39. noded *= radian;
  40. dmoon = 350.737486 + 12.1907491914*eday - 1.436e-3*capt2
  41. + 1.89e-6*capt3;
  42. dmoon *= radian;
  43. node = 259.183275 - .0529539222*eday + 2.078e-3*capt2
  44. + 2.22e-6*capt3;
  45. node *= radian;
  46. /*
  47. * long period terms
  48. */
  49. phi = 0.;
  50. eps = 0.;
  51. dphi = 0.;
  52. deps = 0.;
  53. icosadd(nutfp, nutcp);
  54. phi = -(17.2327+.01737*capt)*sin(node);
  55. phi += sinadd(4, node, noded, dmoon, msun);
  56. eps = cosadd(4, node, noded, dmoon, msun);
  57. /*
  58. * short period terms
  59. */
  60. dphi = sinadd(4, node, noded, mnom, dmoon);
  61. deps = cosadd(3, node, noded, mnom);
  62. phi = (phi+dphi)*radsec;
  63. eps = (eps+deps)*radsec;
  64. dphi *= radsec;
  65. deps *= radsec;
  66. obliq = 23.452294 - .0130125*capt - 1.64e-6*capt2
  67. + 0.503e-6*capt3;
  68. obliq *= radian;
  69. tobliq = obliq + eps;
  70. gst = 99.690983 + 360.9856473354*eday + .000387*capt2;
  71. gst -= 180.;
  72. gst = fmod(gst, 360.);
  73. if(gst < 0.)
  74. gst += 360.;
  75. gst *= radian;
  76. gst += phi*cos(obliq);
  77. }