home *** CD-ROM | disk | FTP | other *** search
/ Collection of Education / collectionofeducationcarat1997.iso / SCIENCE / DE118I.ZIP / PRECESS.C < prev    next >
C/C++ Source or Header  |  1993-01-30  |  13KB  |  473 lines

  1. /* Precession of the equinox and ecliptic
  2.  * from epoch Julian date J to or from J2000.0
  3.  *
  4.  * Program by Steve Moshier.
  5.  *
  6.  *
  7.  * The IAU formula is not used in this version.
  8.  * IAU Coefficients are from:
  9.  * J. H. Lieske, T. Lederle, W. Fricke, and B. Morando,
  10.  * "Expressions for the Precession Quantities Based upon the IAU
  11.  * (1976) System of Astronomical Constants,"  Astronomy and
  12.  * Astrophysics 58, 1-16 (1977).
  13.  *
  14.  * Newer formulas that cover a much longer time span are from:
  15.  * J. Laskar, "Secular terms of classical planetary theories
  16.  * using the results of general theory," Astronomy and Astrophysics
  17.  * 157, 59070 (1986).
  18.  *
  19.  * See also:
  20.  * P. Bretagnon and G. Francou, "Planetary theories in rectangular
  21.  * and spherical variables. VSOP87 solutions," Astronomy and
  22.  * Astrophysics 202, 309-315 (1988).
  23.  *
  24.  * Laskar's expansions are said by Bretagnon and Francou
  25.  * to have "a precision of about 1" over 10000 years before
  26.  * and after J2000.0 in so far as the precession constants p^0_A
  27.  * and epsilon^0_A are perfectly known."
  28.  *
  29.  * Bretagnon and Francou's expansions for the node and inclination
  30.  * of the ecliptic were derived from Laskar's data but were truncated
  31.  * after the term in T**6. I have recomputed these expansions from
  32.  * Laskar's data, retaining powers up to T**10 in the result.
  33.  *
  34.  * The following table indicates the differences between the result
  35.  * of the IAU formula and Laskar's formula using four different test
  36.  * vectors, checking at J2000 plus and minus the indicated number
  37.  * of years.
  38.  *
  39.  *   Years       Arc
  40.  * from J2000  Seconds
  41.  * ----------  -------
  42.  *        0      0
  43.  *      100    .006    
  44.  *      200     .006
  45.  *      500     .015
  46.  *     1000     .28
  47.  *     2000    6.4
  48.  *     3000   38.
  49.  *    10000 9400.
  50.  */
  51.  
  52. #ifndef NOINCS
  53. #include "mconf.h"
  54. #include "prec.h"
  55. #endif
  56. #if LDOUBLE
  57. #if UNK
  58. /* Precession coefficients taken from Laskar's paper: */
  59. static DOUBLE pAcof[10] = {
  60. -8.66000000000000000000E-10L,
  61. -4.75900000000000000000E-8L,
  62.  2.42400000000000000000E-7L,
  63.  1.30950000000000000000E-5L,
  64.  1.74510000000000000000E-4L,
  65. -1.80550000000000000000E-3L,
  66. -2.35316000000000000000E-1L,
  67.  7.73200000000000000000E-2L,
  68.  1.11197100000000000000E2L,
  69.  5.02909660000000000000E4L
  70. };
  71. /* Node and inclination of the earth's orbit computed from
  72.  * Laskar's data as done in Bretagnon and Francou's paper:
  73.  */
  74. static DOUBLE nodecof[11] = {
  75.  6.64020000000000000000E-16L,
  76. -2.69151000000000000000E-15L,
  77. -1.54702100000000000000E-12L,
  78.  7.52131300000000000000E-12L,
  79.  6.31901310000000000000E-10L,
  80. -3.48388152000000000000E-9L,
  81. -1.81306589600000000000E-7L,
  82.  2.75036225000000000000E-8L,
  83.  7.43945314260000000000E-5L,
  84. -4.20786043170000000000E-2L,
  85.  3.05211265497500000000E0L
  86. };
  87. static DOUBLE inclcof[11] = {
  88.  1.21470000000000000000E-16L,
  89.  7.37590000000000000000E-17L,
  90. -8.26287000000000000000E-14L,
  91.  2.50341000000000000000E-13L,
  92.  2.46508390000000000000E-11L,
  93. -5.40004410000000000000E-11L,
  94.  1.32115526000000000000E-9L,
  95. -5.99873702700000000000E-7L,
  96. -1.62427970910000000000E-5L,
  97.  2.27849553700000000000E-3L,
  98.  0.00000000000000000000E0L
  99. };
  100. #endif
  101. #if IBMPC
  102. static short pAcof[] = {
  103. 0x3761,0xf547,0x551b,0xee0b,0xbfe0, XPD
  104. 0x6a6d,0x43d6,0xc224,0xcc65,0xbfe6, XPD
  105. 0x3ffe,0x5966,0x33cb,0x8223,0x3fe9, XPD
  106. 0x9413,0x06aa,0x98c4,0xdbb2,0x3fee, XPD
  107. 0xdda4,0x9c6c,0xabe2,0xb6fc,0x3ff2, XPD
  108. 0xc6e3,0xe62d,0x86e7,0xeca6,0xbff5, XPD
  109. 0xe8c0,0xe6f2,0xad70,0xf0f6,0xbffc, XPD
  110. 0x6018,0x9d1f,0xf2ba,0x9e59,0x3ffb, XPD
  111. 0x4c98,0x8c15,0xea4a,0xde64,0x4005, XPD
  112. 0xef9e,0xc6a7,0xf74b,0xc472,0x400e, XPD
  113. };
  114. static short nodecof[] = {
  115. 0x38c8,0xf647,0x072a,0xbf64,0x3fcc, XPD
  116. 0x9b76,0xc03f,0x989c,0xc1f1,0xbfce, XPD
  117. 0x88e7,0x5905,0x4e3b,0xd9b9,0xbfd7, XPD
  118. 0xa57c,0x25f2,0xfb80,0x8450,0x3fda, XPD
  119. 0xf7b9,0x5a5a,0x1a04,0xadb2,0x3fe0, XPD
  120. 0x41a8,0xe90f,0x1783,0xef69,0xbfe2, XPD
  121. 0x8c7c,0x7312,0x2d05,0xc2ad,0xbfe8, XPD
  122. 0xe099,0x5ad6,0x1b01,0xec41,0x3fe5, XPD
  123. 0x8ff0,0x1112,0x428b,0x9c04,0x3ff1, XPD
  124. 0xbe8d,0x7207,0x9d56,0xac5a,0xbffa, XPD
  125. 0xa4e6,0x34d2,0xd051,0xc355,0x4000, XPD
  126. };
  127. static short inclcof[] = {
  128. 0x0681,0xeffb,0x9db4,0x8c0b,0x3fca, XPD
  129. 0xf1e2,0xed33,0xa0f0,0xaa13,0x3fc9, XPD
  130. 0xcd60,0x3987,0x33db,0xba10,0xbfd3, XPD
  131. 0xb113,0x604a,0xf0b7,0x8ced,0x3fd5, XPD
  132. 0x206c,0xe1ba,0xc131,0xd8d4,0x3fdb, XPD
  133. 0xb3b2,0xfa51,0x176b,0xed7f,0xbfdc, XPD
  134. 0xd03a,0x5b5d,0x04ac,0xb594,0x3fe1, XPD
  135. 0xe322,0xf2f6,0x01c7,0xa107,0xbfea, XPD
  136. 0x7f4e,0x73db,0x2422,0x8841,0xbfef, XPD
  137. 0x9c64,0xc468,0xcfd0,0x9552,0x3ff6, XPD
  138. 0x0000,0x0000,0x0000,0x0000,0x0000, XPD
  139. };
  140. #endif
  141. #if MIEEE
  142. static long pAcof[30] = {
  143. 0xbfe00000,0xee0b551b,0xf5473761,
  144. 0xbfe60000,0xcc65c224,0x43d66a6d,
  145. 0x3fe90000,0x822333cb,0x59663ffe,
  146. 0x3fee0000,0xdbb298c4,0x06aa9413,
  147. 0x3ff20000,0xb6fcabe2,0x9c6cdda4,
  148. 0xbff50000,0xeca686e7,0xe62dc6e3,
  149. 0xbffc0000,0xf0f6ad70,0xe6f2e8c0,
  150. 0x3ffb0000,0x9e59f2ba,0x9d1f6018,
  151. 0x40050000,0xde64ea4a,0x8c154c98,
  152. 0x400e0000,0xc472f74b,0xc6a7ef9e
  153. };
  154. static long nodecof[33] = {
  155. 0x3fcc0000,0xbf64072a,0xf64738c8,
  156. 0xbfce0000,0xc1f1989c,0xc03f9b76,
  157. 0xbfd70000,0xd9b94e3b,0x590588e7,
  158. 0x3fda0000,0x8450fb80,0x25f2a57c,
  159. 0x3fe00000,0xadb21a04,0x5a5af7b9,
  160. 0xbfe20000,0xef691783,0xe90f41a8,
  161. 0xbfe80000,0xc2ad2d05,0x73128c7c,
  162. 0x3fe50000,0xec411b01,0x5ad6e099,
  163. 0x3ff10000,0x9c04428b,0x11128ff0,
  164. 0xbffa0000,0xac5a9d56,0x7207be8d,
  165. 0x40000000,0xc355d051,0x34d2a4e6
  166. };
  167. static long inclcof[33] = {
  168. 0x3fca0000,0x8c0b9db4,0xeffb0681,
  169. 0x3fc90000,0xaa13a0f0,0xed33f1e2,
  170. 0xbfd30000,0xba1033db,0x3987cd60,
  171. 0x3fd50000,0x8cedf0b7,0x604ab113,
  172. 0x3fdb0000,0xd8d4c131,0xe1ba206c,
  173. 0xbfdc0000,0xed7f176b,0xfa51b3b2,
  174. 0x3fe10000,0xb59404ac,0x5b5dd03a,
  175. 0xbfea0000,0xa10701c7,0xf2f6e322,
  176. 0xbfef0000,0x88412422,0x73db7f4e,
  177. 0x3ff60000,0x9552cfd0,0xc4689c64,
  178. 0x00000000,0x00000000,0x00000000
  179. };
  180. #endif
  181.  
  182. #else /* regular double */
  183. #if UNK
  184. static DOUBLE pAcof[10] = {
  185. -8.66000000000000000000E-10,
  186. -4.75900000000000000000E-8,
  187.  2.42400000000000000000E-7,
  188.  1.30950000000000000000E-5,
  189.  1.74510000000000000000E-4,
  190. -1.80550000000000000000E-3,
  191. -2.35316000000000000000E-1,
  192.  7.73200000000000000000E-2,
  193.  1.11197100000000000000E2,
  194.  5.02909660000000000000E4
  195. };
  196. static DOUBLE nodecof[11] = {
  197.  6.64020000000000000000E-16,
  198. -2.69151000000000000000E-15,
  199. -1.54702100000000000000E-12,
  200.  7.52131300000000000000E-12,
  201.  6.31901310000000000000E-10,
  202. -3.48388152000000000000E-9,
  203. -1.81306589600000000000E-7,
  204.  2.75036225000000000000E-8,
  205.  7.43945314260000000000E-5,
  206. -4.20786043170000000000E-2,
  207.  3.05211265497500000000E0
  208. };
  209. static DOUBLE inclcof[11] = {
  210.  1.21470000000000000000E-16,
  211.  7.37590000000000000000E-17,
  212. -8.26287000000000000000E-14,
  213.  2.50341000000000000000E-13,
  214.  2.46508390000000000000E-11,
  215. -5.40004410000000000000E-11,
  216.  1.32115526000000000000E-9,
  217. -5.99873702700000000000E-7,
  218. -1.62427970910000000000E-5,
  219.  2.27849553700000000000E-3,
  220.  0.00000000000000000000E0
  221. };
  222. #endif
  223. #if DEC
  224. static short pAcof[40] = {
  225. 0130556,0005525,0015765,0043467,
  226. 0132114,0062702,0022103,0153152,
  227. 0032602,0021463,0145531,0063100,
  228. 0034133,0131230,0142006,0125224,
  229. 0035066,0176253,0161234,0066336,
  230. 0135754,0123206,0163746,0026707,
  231. 0137560,0173255,0070346,0171351,
  232. 0037236,0054762,0135235,0017540,
  233. 0041736,0062352,0045214,0012515,
  234. 0044104,0071367,0045706,0123760
  235. };
  236. static short nodecof[44] = {
  237. 0023477,0062007,0025366,0043471,
  238. 0124101,0170630,0116300,0037633,
  239. 0126331,0134516,0035531,0002611,
  240. 0027004,0050373,0100045,0171245,
  241. 0030455,0131032,0002132,0055370,
  242. 0131157,0064427,0101751,0007502,
  243. 0132502,0126455,0002563,0011214,
  244. 0031754,0040433,0000532,0153341,
  245. 0034634,0002102,0105421,0011220,
  246. 0137054,0055235,0053162,0003677,
  247. 0040503,0052720,0050464,0151245
  248. };
  249. static short inclcof[44] = {
  250. 0023014,0005635,0132357,0175406,
  251. 0022652,0011640,0170355,0031762,
  252. 0125272,0010063,0155471,0103715,
  253. 0025614,0166760,0133540,0045261,
  254. 0027330,0152301,0030741,0135040,
  255. 0127555,0077427,0065772,0050664,
  256. 0030665,0112004,0126133,0056720,
  257. 0133041,0003401,0143762,0173343,
  258. 0134210,0040444,0021163,0155577,
  259. 0036025,0051317,0150304,0064234,
  260. 0000000,0000000,0000000,0000000,
  261. };
  262. #endif
  263. #if IBMPC
  264. static short pAcof[40] = {
  265. 0xa8e7,0xa37e,0xc16a,0xbe0d,
  266. 0x7acd,0x4488,0x8cb8,0xbe69