home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / astrnomy / de118i.zip / JPLMP.C < prev    next >
C/C++ Source or Header  |  1993-01-31  |  30KB  |  856 lines

  1. /* Orbits of the five minor planets as implemented in the
  2.  * JPL DE102 and DE118/DE200 numerical integrations.
  3.  * This program was written with the aid of documentation
  4.  * kindly supplied by E. M. Standish of JPL.
  5.  *
  6.  * Note that in this model the orbits are fixed Keplerian ellipses.
  7.  * Each is specified by a perihelion date and period
  8.  * of revolution, together with a set of Chebyshev
  9.  * expansions for the x, y, and z coordinates covering
  10.  * one period.  The result is in 1950 coordinates, which
  11.  * are then rotated into the J2000 FK5 system.
  12.  */
  13.  
  14. #ifndef NOINCS
  15. #include "mconf.h"
  16. #include "prec.h"
  17. #include "ssystem.h"
  18. #include "const.h"
  19. #endif
  20.  
  21. #if LDOUBLE
  22. #if IBMPC
  23. /* Julian date of perihelion
  24.  */
  25. short mpperihdi[] = {
  26. 0x410b,0x4a0e,0xbe78,0x94e8,0x4014, XPD
  27. 0x7271,0x43bf,0x97f1,0x94e9,0x4014, XPD
  28. 0x9082,0x602c,0x1c62,0x94e8,0x4014, XPD
  29. 0x90ac,0x93f2,0xd46a,0x94cb,0x4014, XPD
  30. 0x5a1d,0x3b64,0x1b1f,0x94c3,0x4014, XPD
  31. };
  32.  
  33. /* Orbital period, in days
  34.  */
  35. short mpperiodi[] = {
  36. 0x7c07,0x187e,0x3c21,0xd212,0x4009, XPD
  37. 0xc41e,0x14ce,0xaf3a,0xd255,0x4009, XPD
  38. 0x5547,0x4413,0x07dd,0xa5bc,0x4009, XPD
  39. 0x443d,0x3ba3,0x9d88,0xa849,0x4009, XPD
  40. 0x872b,0xd916,0xf7ce,0xc903,0x4009, XPD
  41. };
  42.  
  43. /* Chebyshev coefficients for one complete revolution
  44.  */
  45. short chi[] = {
  46. 0x2ef3,0x70e8,0xb8e6,0xeada,0xbffd, XPD
  47. 0x8620,0x0338,0x48c9,0xcb6b,0x3ffe, XPD
  48. 0x7b6b,0x2410,0xf574,0x95a2,0xc000, XPD
  49. 0x7684,0x9374,0x50fe,0xe642,0xbffe, XPD
  50. 0xf073,0xc30c,0x823d,0xa68d,0x3ffe, XPD
  51. 0xc9d5,0xe3fe,0xf69b,0xce0e,0x3ffb, XPD
  52. 0xab89,0xcef9,0x1f96,0x97ed,0xbff9, XPD
  53. 0xc1a5,0x558e,0x5783,0xb558,0x3ff7, XPD
  54. 0x91b7,0xf90b,0xad04,0xdbd4,0xbff7, XPD
  55. 0x5ea0,0xef12,0x6321,0xa3bf,0xbff5, XPD
  56. 0x30a9,0xe055,0x4d7a,0x87b3,0x3ff3, XPD
  57. 0xf94b,0x022b,0x03ca,0x9f56,0xbff1, XPD
  58. 0x50e4,0x3cf3,0xf3ed,0xd162,0x3ff1, XPD
  59. 0xe899,0x6c6e,0x5e31,0xa98a,0x3fef, XPD
  60. 0xfa1d,0x23ec,0x9c7c,0xb2a2,0xbfec, XPD
  61. 0x1d2e,0x641a,0x2fd3,0xd453,0x3ffc, XPD
  62. 0xd7c0,0xa169,0x104c,0xaa2c,0x3fff, XPD
  63. 0xd4e5,0xc6e1,0x322d,0x8748,0x3fff, XPD
  64. 0x137a,0x48af,0x16e8,0xc0a0,0xbfff, XPD
  65. 0x8dd6,0x7ab6,0x51a9,0x9693,0xbffd, XPD
  66. 0x1ae2,0x4178,0x4f29,0xac61,0x3ffc, XPD
  67. 0xb606,0x9528,0x2154,0x895a,0x3ff8, XPD
  68. 0x1ad3,0xec28,0xb714,0x97b4,0x3ff8, XPD
  69. 0x95a0,0x7d95,0x16d9,0xc6be,0x3ff6, XPD
  70. 0xd94f,0xc4a7,0x0daf,0x88fc,0xbff6, XPD
  71. 0x0fed,0xdd4f,0x90d8,0xf55d,0xbff1, XPD
  72. 0xa0e8,0xa08a,0x4435,0x854b,0xbff2, XPD
  73. 0x9c20,0x05c8,0xdad6,0xbd4c,0xbff0, XPD
  74. 0xd655,0x1ee2,0xa79f,0x8dd4,0x3ff0, XPD
  75. 0x13ab,0xc44e,0xb3bc,0xa17f,0x3feb, XPD
  76. 0xffc5,0xaff0,0x0443,0xc3dc,0x3ffc, XPD
  77. 0x2ee1,0x191e,0x8db2,0xedc3,0x3ffd, XPD
  78. 0xfbca,0x5bef,0x0890,0xf995,0x3ffe, XPD
  79. 0x4c05,0x8b00,0x5657,0x8691,0xbffe, XPD
  80. 0xd402,0x9d7c,0x06fc,0x8ae6,0xbffd, XPD
  81. 0x9332,0xe3a5,0x5003,0xf0d9,0x3ffa, XPD
  82. 0xb0c5,0x709e,0xb5e2,0xfd66,0x3ff7, XPD
  83. 0xfa7a,0x33ee,0x84e5,0xd3f6,0x3ff6, XPD
  84. 0x7d23,0x7fc5,0x9030,0xb754,0x3ff6, XPD
  85. 0xd544,0x20ba,0xf561,0xbf64,0xbff4, XPD
  86. 0xdd09,0x1278,0x75c0,0xe256,0xbff1, XPD
  87. 0x8c84,0x654a,0xe7cd,0xba3c,0xbff0, XPD
  88. 0xef05,0xd1f3,0xc832,0xae9e,0xbff0, XPD
  89. 0x9838,0x76b0,0x527c,0xc62a,0x3fee, XPD
  90. 0x6a50,0x9181,0x8e02,0x94f9,0x3feb, XPD
  91. 0x8c47,0x7619,0xe834,0xafbb,0x3ffa, XPD
  92. 0x4d6a,0xe040,0x3340,0xb118,0x3fff, XPD
  93. 0x2c42,0xaea5,0x7368,0xcbf2,0xbfff, XPD
  94. 0x26a5,0x107e,0x003e,0xb8f0,0xbfff, XPD
  95. 0x78ec,0x227e,0x6b87,0xa7d8,0x3ffd, XPD
  96. 0x776c,0x8870,0xce5a,0xc14b,0x3ff9, XPD
  97. 0x0ec4,0x64dd,0x82c9,0xb1c2,0x3ffa, XPD
  98. 0x5d24,0x1da0,0x578b,0x8cd8,0x3ffa, XPD
  99. 0x541b,0x49ff,0x0ad1,0xdb8b,0xbff6, XPD
  100. 0xc49c,0xdf10,0xfe16,0x8d68,0x3ff7, XPD
  101. 0x1518,0xac23,0x97ee,0x8728,0xbff6, XPD
  102. 0xba10,0x5f9b,0x1bea,0xbeec,0xbff4, XPD
  103. 0x461d,0xce2a,0x21da,0xa4b0,0xbff2, XPD
  104. 0xa48d,0xa0f2,0x32bf,0x9b07,0xbff3, XPD
  105. 0xef2e,0x0919,0x1bea,0xc26b,0x3ff0, XPD
  106. 0x6970,0xc64d,0x74c0,0x806b,0xbffb, XPD
  107. 0x938b,0xe7cf,0x3de2,0xe7bd,0x3ffe, XPD
  108. 0xb439,0xdd69,0x6ac6,0x9509,0x4000, XPD
  109. 0x10db,0xfa33,0x92f5,0xf200,0xbffe, XPD
  110. 0xc3b0,0x23b9,0x6213,0xf54f,0xbffd, XPD
  111. 0x2a99,0xc5b8,0xa470,0xfcf0,0x3ff8, XPD
  112. 0xb9f6,0xaf91,0x6e9c,0x81e6,0xbffb, XPD
  113. 0x9a8b,0xe3e0,0xf81f,0xb84d,0x3ff9, XPD
  114. 0xa385,0xdb36,0x0d2d,0xa06f,0x3ff7, XPD
  115. 0x6aa0,0x7dd1,0x40e6,0xb90b,0x3ff6, XPD
  116. 0x0e5c,0xfb38,0x9a44,0xc589,0x3ff6, XPD
  117. 0x20c4,0x1c5d,0x6ed5,0xf9d5,0xbff3, XPD
  118. 0xa99d,0xf919,0x0d0d,0xf0b2,0x3ff2, XPD
  119. 0xa18a,0x7e4f,0x2bba,0xcadd,0xbff2, XPD
  120. 0x055f,0xfbea,0xd6b1,0x8e12,0xbff1, XPD
  121. 0xcc99,0xfbeb,0xcf20,0x97cc,0x3ff8, XPD
  122. 0x9768,0x3556,0xed1b,0x8f84,0xbffd, XPD
  123. 0x3993,0x43ba,0xaeef,0xb02b,0xbffd, XPD
  124. 0xc0bc,0xf3b2,0x1196,0x95e0,0x3ffd, XPD
  125. 0x0dcc,0x1e08,0x5d61,0x90fc,0x3ffb, XPD
  126. 0x6aa4,0x865f,0x305e,0x9ca6,0xbff7, XPD
  127. 0x27b1,0x0fe6,0xc833,0x998c,0x3ff8, XPD
  128. 0x1e15,0xa40e,0xddad,0xe448,0xbff7, XPD
  129. 0x9b53,0xf51a,0x81a6,0xbda4,0xbff4, XPD
  130. 0x181c,0xdd8a,0x518d,0xe533,0xbff4, XPD
  131. 0x8aca,0xe178,0x60a5,0xe980,0xbff3, XPD
  132. 0x8b23,0x944a,0xb479,0x9ab9,0x3ff2, XPD
  133. 0x5757,0xee6c,0x2943,0x8e42,0xbff0, XPD
  134. 0x16dc,0x5faa,0xd53e,0xfb45,0x3ff0, XPD
  135. 0x6400,0x2b18,0x90eb,0xa7f0,0x3fee, XPD
  136. 0x555b,0xdcc2,0x4156,0xf43e,0xbffb, XPD
  137. 0x3be7,0x40e7,0xd8a6,0xa8d5,0xbfff, XPD
  138. 0xe1a1,0x101d,0x0863,0xa7ec,0xbffe, XPD
  139. 0x1459,0x02d3,0x061f,0xbe3d,0x3fff, XPD
  140. 0x3773,0x59ea,0xaecd,0xb7fc,0x3ffc, XPD
  141. 0x95e8,0x2fe3,0xb6c0,0xa17d,0xbffc, XPD
  142. 0x5e07,0x5492,0x734b,0xe5ae,0xbff6, XPD
  143. 0x5afd,0x3fa2,0x14d1,0xc01a,0xbff8, XPD
  144. 0x2114,0xf426,0xc723,0x8892,0xbff6, XPD
  145. 0x6732,0x62bc,0x7de4,0x86f5,0x3ff6, XPD
  146. 0x9449,0x2d19,0xbf48,0x92b7,0x3ff0, XPD
  147. 0x6aa0,0x19fb,0x2e9d,0xcceb,0x3ff2, XPD
  148. 0xe484,0xc4ee,0x7659,0x9095,0x3ff0, XPD
  149. 0x1dcc,0xf144,0xc00c,0x9247,0xbff0, XPD
  150. 0xdfa5,0x5d17,0x2500,0xa9f3,0x3fe9, XPD
  151. 0xf8da,0x1811,0x21ee,0xc5af,0xbffd, XPD
  152. 0x1f70,0x719b,0xaf10,0x9abc,0x3ffd, XPD
  153. 0xcc3d,0x36d5,0x66a8,0x87e9,0xc000, XPD
  154. 0xe678,0xc70c,0x5525,0xae5a,0xbffd, XPD
  155. 0xfa51,0x8321,0x12d1,0x94ea,0x3ffe, XPD
  156. 0x722f,0x798a,0x8c6a,0x9401,0x3ffa, XPD
  157. 0xb83c,0x3073,0xf19b,0xb9e5,0xbff8, XPD
  158. 0xc320,0xbc1b,0x8ddf,0xb00f,0x3ff6, XPD
  159. 0x27d6,0x65dc,0xef54,0xdd13,0xbff7, XPD
  160. 0x984e,0xdb57,0xff51,0xf760,0xbff3, XPD
  161. 0x31ad,0xaee8,0xc63b,0xed7f,0x3ff1, XPD
  162. 0x90b1,0x4db9,0xac2c,0xbbce,0xbff0, XPD
  163. 0x7731,0xd1c6,0x7a05,0xea0b,0x3ff1, XPD
  164. 0x8527,0xb467,0xbe45,0x8610,0x3fee, XPD
  165. 0xd169,0x20b6,0x8e7f,0x898d,0x3feb, XPD
  166. 0xd014,0x1c7e,0x8db7,0x8dc9,0xbffc, XPD
  167. 0x9b21,0x7f40,0xbee1,0x9631,0x3ffd, XPD
  168. 0x1ba5,0x1fb9,0x9120,0xc2f6,0xbffe, XPD
  169. 0xd16d,0x1090,0xf860,0xa93b,0xbffd, XPD
  170. 0xcfea,0xd7ed,0x7e4d,0xd59d,0x3ffc, XPD
  171. 0x55f1,0xd81f,0x3296,0x8fa9,0x3ffa, XPD
  172. 0x9e4e,0xf6dc,0x7fdf,0x8555,0xbff7, XPD
  173. 0x797e,0x0960,0x5b21,0xaae4,0x3ff6, XPD
  174. 0x0359,0x504d,0xf928,0x9e90,0xbff6, XPD
  175. 0x4f40,0xf9c3,0xcd59,0xf01d,0xbff3, XPD
  176. 0xd618,0x1c5d,0x2494,0xaa58,0x3ff0, XPD
  177. 0xb6dd,0xaf8d,0x3132,0xb64b,0xbff0, XPD
  178. 0x5030,0x78bf,0xe337,0xa7dd,0x3ff0, XPD
  179. 0x3db1,0xb6a3,0x2a13,0x8221,0x3fee, XPD
  180. 0x04ff,0x6457,0x45f6,0xc551,0x3fe9, XPD
  181. 0x5a94,0x3c56,0x3e1f,0x83f7,0xbffa, XPD
  182. 0x0be3,0x034a,0x7513,0xfda3,0x3ffe, XPD
  183. 0x28a8,0x2266,0x2da6,0xe1ed,0x3fff, XPD
  184. 0x2ad2,0x5864,0xe694,0x84e6,0xbfff, XPD
  185. 0xb12f,0x263c,0xdd05,0xbca6,0xbffd, XPD
  186. 0x2b50,0xb5a2,0xe4d8,0xac3f,0x3ff9, XPD
  187. 0x54e3,0x252a,0xbd8d,0xbcd6,0xbffa, XPD
  188. 0xcb52,0x036a,0x4ef8,0xc830,0x3ff9, XPD
  189. 0x7f13,0x58e7,0xf385,0x8774,0x3ff7, XPD
  190. 0xf419,0xffc4,0x71c3,0xb740,0x3ff6, XPD
  191. 0x861a,0xc66e,0xcd61,0x90f0,0x3ff6, XPD
  192. 0x43c6,0x2f73,0xe63e,0x8e1c,0xbff4, XPD
  193. 0xe9fe,0x75f0,0x3a4f,0x9042,0x3ff2, XPD
  194. 0x660d,0xa227,0x10d0,0xce2c,0xbff2, XPD
  195. 0xe264,0x95d0,0x9394,0xe3fd,0xbff0, XPD
  196. 0xa931,0xb65d,0xa9d9,0xdf89,0xbff9, XPD
  197. 0x33c7,0x6312,0x62c2,0x8059,0xbfff, XPD
  198. 0x6786,0x1c17,0x64db,0xbf59,0x3fff, XPD
  199. 0x8286,0xc022,0x57d4,0x8681,0x3fff, XPD
  200. 0x246b,0xc515,0x7f7d,0x9fc7,0xbffd, XPD
  201. 0xa745,0xb941,0xda9e,0xae53,0xbff9, XPD
  202. 0xa930,0xb04b,0x0c33,0x9ff0,0xbffa, XPD
  203. 0x6aac,0xe9ab,0x8d9c,0xca9a,0xbff9, XPD
  204. 0x0bd5,0x1fe1,0x85c3,0xe573,0x3ff6, XPD
  205. 0xb83e,0x44c4,0x61eb,0xb976,0xbff6, XPD
  206. 0x86c5,0xe2ff,0x1366,0xf584,0x3ff5, XPD
  207. 0xc16c,0x7a8d,0xc9b9,0x8fd3,0x3ff4, XPD
  208. 0xeaea,0xad75,0x5ce4,0xf45c,0x3ff1, XPD
  209. 0xf303,0xe966,0xc9ff,0xd0a8,0x3ff2, XPD
  210. 0xefe5,0xa5ba,0xec2e,0xc118,0xbff0, XPD
  211. 0x695b,0x19a3,0xf63a,0xeed4,0xbff8, XPD
  212. 0x3cee,0x8591,0x08c3,0xa023,0xbffd, XPD
  213. 0xdcdc,0x164f,0xe7a2,0xcc70,0x3ffe, XPD
  214. 0xf945,0x9bd5,0x4d5a,0xa7d1,0x3ffd, XPD
  215. 0xd0c9,0x4f37,0x0e9b,0xaab6,0xbffc, XPD
  216. 0x5893,0x4535,0xa4e0,0xd980,0xbff7, XPD
  217. 0x7ed7,0xfca6,0x618c,0xaae1,0xbff9, XPD
  218. 0x9884,0x5e45,0x1ef7,0xfcc8,0xbff7, XPD
  219. 0xf482,0x53fa,0x659d,0xf526,0x3ff5, XPD
  220. 0x7c45,0xddde,0x2699,0xe765,0xbff4, XPD
  221. 0x30b6,0xafc4,0x29a1,0x8328,0x3ff5, XPD
  222. 0x9f99,0x5542,0xc9a5,0xb372,0x3ff2, XPD
  223. 0x6958,0xfcda,0x30a5,0x828a,0x3ff1, XPD
  224. 0xaac5,0x0a8e,0x2609,0x822b,0x3ff1, XPD
  225. 0x385d,0x20a1,0x0d7e,0xce4f,0xbfef, XPD
  226. 0x67ab,0xfaa3,0x0bf2,0xe2bf,0xbffd, XPD
  227. 0x1431,0x3df7,0x25ef,0xa7d1,0x3ffd, XPD
  228. 0x2351,0x0015,0x4537,0xae88,0x4000, XPD
  229. 0x3f7b,0x0bef,0xb2a4,0xa52c,0xbffd, XPD
  230. 0xf810,0x7089,0xa3e6,0xdbb8,0xbffd, XPD
  231. 0x061c,0x2fe2,0xdff6,0xf54b,0xbff8, XPD
  232. 0x224a,0x8eb7,0xf194,0xe79e,0xbffb, XPD
  233. 0x20fc,0xce98,0x453c,0xef1b,0x3ff7, XPD
  234. 0x2272,0x99fc,0x2dc4,0x9559,0xbff8, XPD
  235. 0x6006,0x9ff4,0x5bc7,0xa2d7,0x3ff6, XPD
  236. 0x1ec5,0xab24,0xd820,0xed40,0x3ff6, XPD
  237. 0x5259,0xfbe7,0x3c49,0x8e03,0x3ff2, XPD
  238. 0x3be4,0xfafe,0xae90,0xc15b,0x3ff5, XPD
  239. 0xcd84,0xe436,0xf8c3,0xdf07,0xbff1, XPD
  240. 0xc9f0,0xd207,0x4674,0xcd8f,0x3ff2, XPD
  241. 0x444a,0x86c7,0x1225,0xd490,0xbffa, XPD
  242. 0x3a84,0xd553,0xcb88,0xaeda,0xbfff, XPD
  243. 0xdfc0,0x042e,0x6ac5,0xa39d,0x3ffd, XPD
  244. 0x2c2a,0x0fdb,0xfa04,0xac19,0x3fff, XPD
  245. 0xec6f,0xe120,0x28ac,0xcdfa,0xbffa, XPD
  246. 0x0101,0x4363,0x52e6,0xff95,0x3ffa, XPD
  247. 0xabc2,0x7c25,0xe8b8,0xd921,0xbff8, XPD
  248. 0x48d2,0x83a1,0x4434,0xf922,0xbff9, XPD
  249. 0x1020,0xd87a,0x9b17,0x8c01,0xbff5, XPD
  250. 0x37ce,0xce84,0x963f,0xa9ab,0xbff8, XPD
  251. 0x2487,0x7733,0x9d8e,0xde69,0x3ff3, XPD
  252. 0xe9ec,0x0aa9,0xda3d,0x93f7,0xbff4, XPD
  253. 0x46c3,0x54d7,0x5d05,0xb543,0x3ff2, XPD
  254. 0x8cef,0x7f0d,0x62c6,0xe862,0x3ff3, XPD
  255. 0x5180,0x6fc8,0x919a,0xc0b3,0x3fef, XPD
  256. 0x4b84,0x8b57,0x0d1c,0xb3cc,0xbffb, XPD
  257. 0xb11c,0xf620,0x5ea2,0xd88e,0xbffe, XPD
  258. 0x83e9,0x9d21,0xf293,0x8a64,0x3ffe, XPD
  259. 0x81d6,0x8300,0x7524,0xd525,0x3ffe, XPD
  260. 0xf35a,0x2872,0x040c,0xae3a,0xbffb, XPD
  261. 0x71fc,0x2a7c,0xd9fd,0x9e44,0x3ffa, XPD
  262. 0xd10e,0xe0ca,0x9042,0xb7a9,0xbff9, XPD
  263. 0x72e4,0xc712,0x70d2,0x9a46,0xbff9, XPD
  264. 0xc8d7,0x1694,0x8804,0xecd9,0xbff5, XPD
  265. 0x28c2,0xaa89,0xa200,0xd222,0xbff7, XPD
  266. 0xc2a8,0x29b5,0xe8e7,0xbc20,0x3ff4, XPD
  267. 0xdd89,0x6e7a,0xe641,0xb741,0xbff3, XPD
  268. 0x89c0,0x4520,0x7873,0x9952,0x3ff3, XPD
  269. 0xba02,0x8866,0x3001,0x8fe7,0x3ff3, XPD
  270. 0x79a8,0xb088,0x4e04,0xa2ff,0x3ff0, XPD
  271. };
  272.  
  273. short RK00i[] = {0x9673,0x7f73,0x211a,0xfffb,0x3ffe, XPD};
  274. short RK01i[] = {0x8fe4,0x3565,0xa8be,0xb732,0xbff8, XPD};
  275. short RK02i[] = {0x758a,0x4022,0x473d,0x9f38,0xbff7, XPD};
  276. short RK10i[] = {0xbc29,0x7734,0xa8c3,0xb732,0x3ff8, XPD};
  277. short RK11i[] = {0x65df,0x4b69,0xe72a,0xfffb,0x3ffe, XPD};
  278. short RK12i[] = {0xb6fb,0x11e1,0x30e9,0xe3db,0xbfef, XPD};
  279. short RK20i[] = {0x4b30,0x0e3c,0x4725,0x9f38,0x3ff7, XPD};
  280. short RK21i[] = {0x06d2,0xd97a,0x186c,0xe3ec,0xbfef, XPD};
  281. short RK22i[] = {0x37c9,0x340a,0x39f0,0xffff,0x3ffe, XPD};
  282. short RL00i[] = {0xda14,0x5ac6,0x21c1,0xfffb,0x3ffe, XPD};
  283.  
  284. short RL01i[] = {0x51b0,0x8730,0x1eee,0xb725,0xbff8, XPD};
  285. short RL02i[] = {0xfe33,0xf924,0x834c,0x9f33,0xbff7, XPD};
  286. short RL10i[] = {0x203d,0xad12,0x1eeb,0xb725,0x3ff8, XPD};
  287. short RL11i[] = {0x6580,0x4bc1,0xe7c5,0xfffb,0x3ffe, XPD};
  288. short RL12i[] = {0xb887,0x8995,0x9199,0xe3d0,0xbfef, XPD};
  289. short RL20i[] = {0x7326,0x18e6,0x835a,0x9f33,0x3ff7, XPD};
  290. short RL21i[] = {0x00a4,0xbe4b,0x6591,0xe3c7,0xbfef, XPD};
  291. short RL22i[] = {0x7bc9,0x0f05,0x39fc,0xffff,0x3ffe, XPD};
  292.  
  293. #endif
  294. #if MIEEE
  295. long mpperihdi[] = {
  296. 0x40140000,0x94e8be78,0x4a0e410b,
  297. 0x40140000,0x94e997f1,0x43bf7271,
  298. 0x40140000,0x94e81c62,0x602c9082,
  299. 0x40140000,0x94cbd46a,0x93f290ac,
  300. 0x40140000,0x94c31b1f,0x3b645a1d,
  301. };
  302. long mpperiodi[] = {
  303. 0x40090000,0xd2123c21,0x187e7c07,
  304. 0x40090000,0xd255af3a,0x14cec41e,
  305. 0x40090000,0xa5bc07dd,0x44135547,
  306. 0x40090000,0xa8499d88,0x3ba3443d,
  307. 0x40090000,0xc903f7ce,0xd916872b,
  308. };
  309. long chi[] = {
  310. 0xbffd0000,0xeadab8e6,0x70e82ef3,
  311. 0x3ffe0000,0xcb6b48c9,0x03388620,
  312. 0xc0000000,0x95a2f574,0x24107b6b,
  313. 0xbffe0000,0xe64250fe,0x93747684,
  314. 0x3ffe0000,0xa68d823d,0xc30cf073,
  315. 0x3ffb0000,0xce0ef69b,0xe3fec9d5,
  316. 0xbff90000,0x97ed1f96,0xcef9ab89,
  317. 0x3ff70000,0xb5585783,0x558ec1a5,
  318. 0xbff70000,0xdbd4ad04,0xf90b91b7,
  319. 0xbff50000,0xa3bf6321,0xef125ea0,
  320. 0x3ff30000,0x87b34d7a,0xe05530a9,
  321. 0xbff10000,0x9f5603ca,0x022bf94b,
  322. 0x3ff10000,0xd162f3ed,0x3cf350e4,
  323. 0x3fef0000,0xa98a5e31,0x6c6ee899,
  324. 0xbfec0000,0xb2a29c7c,0x23ecfa1d,
  325. 0x3ffc0000,0xd4532fd3,0x641a1d2e,
  326. 0x3fff0000,0xaa2c104c,0xa169d7c0,
  327. 0x3fff0000,0x8748322d,0xc6e1d4e5,
  328. 0xbfff0000,0xc0a016e8,0x48af137a,
  329. 0xbffd0000,0x969351a9,0x7ab68dd6,
  330. 0x3ffc0000,0xac614f29,0x41781ae2,
  331. 0x3ff80000,0x895a2154,0x9528b606,
  332. 0x3ff80000,0x97b4b714,0xec281ad3,
  333. 0x3ff60000,0xc6be16d9,0x7d9595a0,
  334. 0xbff60000,0x88fc0daf,0xc4a7d94f,
  335. 0xbff10000,0xf55d90d8,0xdd4f0fed,
  336. 0xbff20000,0x854b4435,0xa08aa0e8,
  337. 0xbff00000,0xbd4cdad6,0x05c89c20,
  338. 0x3ff00000,0x8dd4a79f,0x1ee2d655,
  339. 0x3feb0000,0xa17fb3bc,0xc44e13ab,
  340. 0x3ffc0000,0xc3dc0443,0xaff0ffc5,
  341. 0x3ffd0000,0xedc38db2,0x191e2ee1,
  342. 0x3ffe0000,0xf9950890,0x5beffbca,
  343. 0xbffe0000,0x86915657,0x8b004c05,
  344. 0xbffd0000,0x8ae606fc,0x9d7cd402,
  345. 0x3ffa0000,0xf0d95003,0xe3a59332,
  346. 0x3ff70000,0xfd66b5e2,0x709eb0c5,
  347. 0x3ff60000,0xd3f684e5,0x33eefa7a,
  348. 0x3ff60000,0xb7549030,0x7fc57d23,
  349. 0xbff40000,0xbf64f561,0x20bad544,
  350. 0xbff10000,0xe25675c0,0x1278dd09,
  351. 0xbff00000,0xba3ce7cd,0x654a8c84,
  352. 0xbff00000,0xae9ec832,0xd1f3ef05,
  353. 0x3fee0000,0xc62a527c,0x76b09838,
  354. 0x3feb0000,0x94f98e02,0x91816a50,
  355. 0x3ffa0000,0xafbbe834,0x76198c47,
  356. 0x3fff0000,0xb1183340,0xe0404d6a,
  357. 0xbfff0000,0xcbf27368,0xaea52c42,
  358. 0xbfff0000,0xb8f0003e,0x107e26a5,
  359. 0x3ffd0000,0xa7d86b87,0x227e78ec,
  360. 0x3ff90000,0xc14bce5a,0x8870776c,
  361. 0x3ffa0000,0xb1c282c9,0x64dd0ec4,
  362. 0x3ffa0000,0x8cd8578b,0x1da05d24,
  363. 0xbff60000,0xdb8b0ad1,0x49ff541b,
  364. 0x3ff70000,0x8d68fe16,0xdf10c49c,
  365. 0xbff60000,0x872897ee,0xac231518,
  366. 0xbff40000,0xbeec1bea,0x5f9bba10,
  367. 0xbff20000,0xa4b021da,0xce2a461d,
  368. 0xbff30000,0x9b0732bf,0xa0f2a48d,
  369. 0x3ff00000,0xc26b1bea,0x0919ef2e,
  370. 0xbffb0000,0x806b74c0,0xc64d6970,
  371. 0x3ffe0000,0xe7bd3de2,0xe7cf938b,
  372. 0x40000000,0x95096ac6,0xdd69b439,
  373. 0xbffe0000,0xf20092f5,0xfa3310db,
  374. 0xbffd0000,0xf54f6213,0x23b9c3b0,
  375. 0x3ff80000,0xfcf0a470,0xc5b82a99,
  376. 0xbffb0000,0x81e66e9c,0xaf91b9f6,
  377. 0x3ff90000,0xb84df81f,0xe3e09a8b,
  378. 0x3ff70000,0xa06f0d2d,0xdb36a385,
  379. 0x3ff60000,0xb90b40e6,0x7dd16aa0,
  380. 0x3ff60000,0xc5899a44,0xfb380e5c,
  381. 0xbff30000,0xf9d56ed5,0x1c5d20c4,
  382. 0x3ff20000,0xf0b20d0d,0xf919a99d,
  383. 0xbff20000,0xcadd2bba,0x7e4fa18a,
  384. 0xbff10000,0x8e12d6b1,0xfbea055f,
  385. 0x3ff80000,0x97cccf20,0xfbebcc99,
  386. 0xbffd0000,0x8f84ed1b,0x35569768,
  387. 0xbffd0000,0xb02baeef,0x43ba3993,
  388. 0x3ffd0000,0x95e01196,0xf3b2c0bc,
  389. 0x3ffb0000,0x90fc5d61,0x1e080dcc,
  390. 0xbff70000,0x9ca6305e,0x865f6aa4,
  391. 0x3ff80000,0x998cc833,0x0fe627b1,
  392. 0xbff70000,0xe448ddad,0xa40e1e15,
  393. 0xbff40000,0xbda481a6,0xf51a9b53,
  394. 0xbff40000,0xe533518d,0xdd8a181c,
  395. 0xbff30000,0xe98060a5,0xe1788aca,
  396. 0x3ff20000,0x9ab9b479,0x944a8b23,
  397. 0xbff00000,0x8e422943,0xee6c5757,
  398. 0x3ff00000,0xfb45d53e,0x5faa16dc,
  399. 0x3fee0000,0xa7f090eb,0x2b186400,
  400. 0xbffb0000,0xf43e4156,0xdcc2555b,
  401. 0xbfff0000,0xa8d5d8a6,0x40e73be7,
  402. 0xbffe0000,0xa7ec0863,0x101de1a1,
  403. 0x3fff0000,0xbe3d061f,0x02d31459,
  404. 0x3ffc0000,0xb7fcaecd,0x59ea3773,
  405. 0xbffc0000,0xa17db6c0,0x2fe395e8,
  406. 0xbff60000,0xe5ae734b,0x54925e07,
  407. 0xbff80000,0xc01a14d1,0x3fa25afd,
  408. 0xbff60000,0x8892c723,0xf4262114,
  409. 0x3ff60000,0x86f57de4,0x62bc6732,
  410. 0x3ff00000,0x92b7bf48,0x2d199449,
  411. 0x3ff20000,0xcceb2e9d,0x19fb6aa0,
  412. 0x3ff00000,0x90957659,0xc4eee484,
  413. 0xbff00000,0x9247c00c,0xf1441dcc,
  414. 0x3fe90000,0xa9f32500,0x5d17dfa5,
  415. 0xbffd0000,0xc5af21ee,0x1811f8da,
  416. 0x3ffd0000,0x9abcaf10,0x719b1f70,
  417. 0xc0000000,0x87e966a8,0x36d5cc3d,
  418. 0xbffd0000,0xae5a5525,0xc70ce678,
  419. 0x3ffe0000,0x94ea12d1,0x8321fa51,
  420. 0x3ffa0000,0x94018c6a,0x798a722f,
  421. 0xbff80000,0xb9e5f19b,0x3073b83c,
  422. 0x3ff60000,0xb00f8ddf,0xbc1bc320,
  423. 0xbff70000,0xdd13ef54,0x65dc27d6,
  424. 0xbff30000,0xf760ff51,0xdb57984e,
  425. 0x3ff10000,0xed7fc63b,0xaee831ad,
  426. 0xbff00000,0xbbceac2c,0x4db990b1,
  427. 0x3ff10000,0xea0b7a05,0xd1c67731,
  428. 0x3fee0000,0x8610be45,0xb4678527,
  429. 0x3feb0000,0x898d8e7f,0x20b6d169,
  430. 0xbffc0000,0x8dc98db7,0x1c7ed014,
  431. 0x3ffd0000,0x9631bee1,0x7f409b21,
  432. 0xbffe0000,0xc2f69120,0x1fb91ba5,
  433. 0xbffd0000,0xa93bf860,0x1090d16d,
  434. 0x3ffc0000,0xd59d7e4d,0xd7edcfea,
  435. 0x3ffa0000,0x8fa93296,0xd81f55f1,
  436. 0xbff70000,0x85557fdf,0xf6dc9e4e,
  437. 0x3ff60000,0xaae45b21,0x0960797e,
  438. 0xbff60000,0x9e90f928,0x504d0359,
  439. 0xbff30000,0xf01dcd59,0xf9c34f40,
  440. 0x3ff00000,0xaa582494,0x1c5dd618,
  441. 0xbff00000,0xb64b3132,0xaf8db6dd,
  442. 0x3ff00000,0xa7dde337,0x78bf5030,
  443. 0x3fee0000,0x82212a13,0xb6a33db1,
  444. 0x3fe90000,0xc55145f6,0x645704ff,
  445. 0xbffa0000,0x83f73e1f,0x3c565a94,
  446. 0x3ffe0000,0xfda37513,0x034a0be3,
  447. 0x3fff0000,0xe1ed2da6,0x226628a8,
  448. 0xbfff0000,0x84e6e694,0x58642ad2,
  449. 0xbffd0000,0xbca6dd05,0x263cb12f,
  450. 0x3ff90000,0xac3fe4d8,0xb5a22b50,
  451. 0xbffa0000,0xbcd6bd8d,0x252a54e3,
  452. 0x3ff90000,0xc8304ef8,0x036acb52,
  453. 0x3ff70000,0x8774f385,0x58e77f13,
  454. 0x3ff60000,0xb74071c3,0xffc4f419,
  455. 0x3ff60000,0x90f0cd61,0xc66e861a,
  456. 0xbff40000,0x8e1ce63e,0x2f7343c6,
  457. 0x3ff20000,0x90423a4f,0x75f0e9fe,
  458. 0xbff20000,0xce2c10d0,0xa227660d,
  459. 0xbff00000,0xe3fd9394,0x95d0e264,
  460. 0xbff90000,0xdf89a9d9,0xb65da931,
  461. 0xbfff0000,0x805962c2,0x631233c7,
  462. 0x3fff0000,0xbf5964db,0x1c176786,
  463. 0x3fff0000,0x868157d4,0xc0228286,
  464. 0xbffd0000,0x9fc77f7d,0xc515246b,
  465. 0xbff90000,0xae53da9e,0xb941a745,
  466. 0xbffa0000,0x9ff00c33,0xb04ba930,
  467. 0xbff90000,0xca9a8d9c,0xe9ab6aac,
  468. 0x3ff60000,0xe57385c3,0x1fe10bd5,
  469. 0xbff60000,0xb97661eb,0x44c4b83e,
  470. 0x3ff50000,0xf5841366,0xe2ff86c5,
  471. 0x3ff40000,0x8fd3c9b9,0x7a8dc16c,
  472. 0x3ff10000,0xf45c5ce4,0xad75eaea,
  473. 0x3ff20000,0xd0a8c9ff,0xe966f303,
  474. 0xbff00000,0xc118ec2e,0xa5baefe5,
  475. 0xbff80000,0xeed4f63a,0x19a3695b,
  476. 0xbffd0000,0xa02308c3,0x85913cee,
  477. 0x3ffe0000,0xcc70e7a2,0x164fdcdc,
  478. 0x3ffd0000,0xa7d14d5a,0x9bd5f945,
  479. 0xbffc0000,0xaab60e9b,0x4f37d0c9,
  480. 0xbff70000,0xd980a4e0,0x45355893,
  481. 0xbff90000,0xaae1618c,0xfca67ed7,
  482. 0xbff70000,0xfcc81ef7,0x5e459884,
  483. 0x3ff50000,0xf526659d,0x53faf482,
  484. 0xbff40000,0xe7652699,0xddde7c45,
  485. 0x3ff50000,0x832829a1,0xafc430b6,
  486. 0x3ff20000,0xb372c9a5,0x55429f99,
  487. 0x3ff10000,0x828a30a5,0xfcda6958,
  488. 0x3ff10000,0x822b2609,0x0a8eaac5,
  489. 0xbfef0000,0xce4f0d7e,0x20a1385d,
  490. 0xbffd0000,0xe2bf0bf2,0xfaa367ab,
  491. 0x3ffd0000,0xa7d125ef,0x3df71431,
  492. 0x40000000,0xae884537,0x00152351,
  493. 0xbffd0000,0xa52cb2a4,0x0bef3f7b,
  494. 0xbffd0000,0xdbb8a3e6,0x7089f810,
  495. 0xbff80000,0xf54bdff6,0x2fe2061c,
  496. 0xbffb0000,0xe79ef194,0x8eb7224a,
  497. 0x3ff70000,0xef1b453c,0xce9820fc,
  498. 0xbff80000,0x95592dc4,0x99fc2272,
  499. 0x3ff60000,0xa2d75bc7,0x9ff46006,
  500. 0x3ff60000,0xed40d820,0xab241ec5,
  501. 0x3ff20000,0x8e033c49,0xfbe75259,
  502. 0x3ff50000,0xc15bae90,0xfafe3be4,
  503. 0xbff10000,0xdf07f8c3,0xe436cd84,
  504. 0x3ff20000,0xcd8f4674,0xd207c9f0,
  505. 0xbffa0000,0xd4901225,0x86c7444a,
  506. 0xbfff0000,0xaedacb88,0xd5533a84,
  507. 0x3ffd0000,0xa39d6ac5,0x042edfc0,
  508. 0x3fff0000,0xac19fa04,0x0fdb2c2a,
  509. 0xbffa0000,0xcdfa28ac,0xe120ec6f,
  510. 0x3ffa0000,0xff9552e6,0x43630101,
  511. 0xbff80000,0xd921e8b8,0x7c25abc2,
  512. 0xbff90000,0xf9224434,0x83a148d2,
  513. 0xbff50000,0x8c019b17,0xd87a1020,
  514. 0xbff80000,0xa9ab963f,0xce8437ce,
  515. 0x3ff30000,0xde699d8e,0x77332487,
  516. 0xbff40000,0x93f7da3d,0x0aa9e9ec,
  517. 0x3ff20000,0xb5435d05,0x54d746c3,
  518. 0x3ff30000,0xe86262c6,0x7f0d8cef,
  519. 0x3fef0000,0xc0b3919a,0x6fc85180,
  520. 0xbffb0000,0xb3cc0d1c,0x8b574b84,
  521. 0xbffe0000,0xd88e5ea2,0xf620b11c,
  522. 0x3ffe0000,0x8a64f293,0x9d2183e9,
  523. 0x3ffe0000,0xd5257524,0x830081d6,
  524. 0xbffb0000,0xae3a040c,0x2872f35a,
  525. 0x3ffa0000,0x9e44d9fd,0x2a7c71fc,
  526. 0xbff90000,0xb7a99042,0xe0cad10e,
  527. 0xbff90000,0x9a4670d2,0xc71272e4,
  528. 0xbff50000,0xecd98804,0x1694c8d7,
  529. 0xbff70000,0xd222a200,0xaa8928c2,
  530. 0x3ff40000,0xbc20e8e7,0x29b5c2a8,
  531. 0xbff30000,0xb741e641,0x6e7add89,
  532. 0x3ff30000,0x99527873,0x452089c0,
  533. 0x3ff30000,0x8fe73001,0x8866ba02,
  534. 0x3ff00000,0xa2ff4e04,0xb08879a8,
  535. };
  536. long RK00i[] = {0x3ffe0000,0xfffb211a,0x7f739673};
  537. long RK01i[] = {0xbff80000,0xb732a8be,0x35658fe4};
  538. long RK02i[] = {0xbff70000,0x9f38473d,0x4022758a};
  539. long RK10i[] = {0x3ff80000,0xb732a8c3,0x7734bc29};
  540. long RK11i[] = {0x3ffe0000,0xfffbe72a,0x4b6965df};
  541. long RK12i[] = {0xbfef0000,0xe3db30e9,0x11e1b6fb};
  542. long RK20i[] = {0x3ff70000,0x9f384725,0x0e3c4b30};
  543. long RK21i[] = {0xbfef0000,0xe3ec186c,0xd97a06d2};
  544. long RK22i[] = {0x3ffe0000,0xffff39f0,0x340a37c9};
  545. long RL00i[] = {0x3ffe0000,0xfffb21c1,0x5ac6da14};
  546. long RL01i[] = {0xbff80000,0xb7251eee,0x873051b0};
  547. long RL02i[] = {0xbff70000,0x9f33834c,0xf924fe33};
  548. long RL10i[] = {0x3ff80000,0xb7251eeb,0xad12203d};
  549. long RL11i[] = {0x3ffe0000,0xfffbe7c5,0x4bc16580};
  550. long RL12i[] = {0xbfef0000,0xe3d09199,0x8995b887};
  551. long RL20i[] = {0x3ff70000,0x9f33835a,0x18e67326};
  552. long RL21i[] = {0xbfef0000,0xe3c76591,0xbe4b00a4};
  553. long RL22i[] = {0x3ffe0000,0xffff39fc,0x0f057bc9};
  554. #endif
  555.  
  556. #if !UNK
  557. #define mpperihd ((long double *)mpperihdi)
  558. #define mpperiod ((long double *)mpperiodi)
  559. #define ch ((long double *)chi)
  560.  
  561. #define RK00 (*(long double *)RK00i)
  562. #define RK01 (*(long double *)RK01i)
  563. #define RK02 (*(long double *)RK02i)
  564. #define RK10 (*(long double *)RK10i)
  565. #define RK11 (*(long double *)RK11i)
  566. #define RK12 (*(long double *)RK12i)
  567. #define RK20 (*(long double *)RK20i)
  568. #define RK21 (*(long double *)RK21i)
  569. #define RK22 (*(long double *)RK22i)
  570.  
  571. #define RL00 (*(long double *)RL00i)
  572. #define RL01 (*(long double *)RL01i)
  573. #define RL02 (*(long double *)RL02i)
  574. #define RL10 (*(long double *)RL10i)
  575. #define RL11 (*(long double *)RL11i)
  576. #define RL12 (*(long double *)RL12i)
  577. #define RL20 (*(long double *)RL20i)
  578. #define RL21 (*(long double *)RL21i)
  579. #define RL22 (*(long double *)RL22i)
  580. #endif
  581. #endif /* LDOUBLE */
  582.  
  583. #if UNK || !(LDOUBLE)
  584.  
  585. /* Julian date of perihelion
  586.  */
  587. DOUBLE mpperihd[] = {
  588. 2439727.61747, /* Ceres */
  589. 2439781.98561, /* Pallas */
  590. 2439687.09607, /* Vesta */
  591. 2437877.10408, /* Iris */
  592. 2437318.78050 /* Bamberga */
  593. };
  594.  
  595. /* Orbital period, in days
  596.  */
  597. DOUBLE mpperiod[] = {
  598. 1680.56984,
  599. 1682.67764,
  600. 1325.87596,
  601. 1346.30048,
  602. 1608.124
  603. };
  604.  
  605. /* Chebyshev coefficients for one complete revolution
  606.  */
  607. DOUBLE ch[] = {
  608. /* Ceres, X coordinate */
  609. -4.586999684620e-1,  7.946057787660e-1, -2.338071216029e0,
  610. -8.994494077228e-1,  6.505967522417e-1,  1.006144777607e-1,
  611. -1.854568643327e-2,  5.534212809533e-3, -6.708702547208e-3,
  612. -1.249295092718e-3,  2.588279743209e-4, -7.597732320643e-5,
  613.  9.984328008949e-5,  2.021080252791e-5, -2.661871914125e-6,
  614. /* Ceres, Y coordinate */
  615.  2.073485825322e-1,  1.329469716470e0,   1.056890747406e0,
  616. -1.504885543270e0,  -2.940927047142e-1,  1.683399552279e-1,
  617.  8.383305119724e-3,  9.259394446135e-3,  3.032570436963e-3,
  618. -2.090218869642e-3, -1.169993836602e-4, -1.271190734330e-4,
  619. -4.513268808669e-5,  3.381506984284e-5,  1.203260096346e-6,
  620. /* Ceres, Z coordinate */
  621.  1.912689844430e-1,  4.643825797944e-1,  9.749303200187e-1,
  622. -5.256551707962e-1, -2.712862189644e-1,  5.880099540648e-2,
  623.  7.733191309744e-3,  3.234298176906e-3,  2.797398760321e-3,
  624. -7.301115768150e-4, -1.079262419828e-4, -4.440257835932e-5,
  625. -4.163271004842e-5,  1.181157357331e-5,  1.109948926800e-6,
  626.  
  627. /* Pallas */
  628.  4.290381150293e-2,  1.383551031759e0,  -1.593336511721e0,
  629. -1.444824247651e0,   3.278230287990e-1,  2.359571746298e-2,
  630.  4.339839066079e-2,  3.438600727700e-2, -3.349962368965e-3,
  631.  4.315494601308e-3, -2.062356083727e-3, -7.283107794077e-4,
  632. -1.570587316340e-4, -2.956926691273e-4,  4.635295741246e-5,
  633.  
  634. -6.270495618154e-2,  9.052313498467e-1,  2.328699773983e0,
  635. -9.453212595492e-1, -4.791212700237e-1,  1.543823298115e-2,
  636. -6.342779555957e-2,  2.249811612921e-2,  4.896050868149e-3,
  637.  2.823546738447e-3,  3.014183200304e-3, -4.765200088867e-4,
  638.  2.295451275798e-4, -1.934661374033e-4, -6.774596619107e-5,
  639.  
  640.  9.265138887655e-3, -2.803110213960e-1, -3.440832774230e-1,
  641.  2.927251335876e-1,  7.079384758595e-2, -4.780553453247e-3,
  642.  9.371943957602e-3, -6.966694108343e-3, -7.234291203889e-4,
  643. -8.743303801260e-4, -4.453687185879e-4,  1.475576496875e-4,
  644. -3.391705564484e-5,  5.990810038801e-5,  1.000998683469e-5,
  645.  
  646. /* Vesta */
  647. -1.192593674310e-1, -1.319026070765e0,  -6.559453241208e-1,
  648.  1.486237301962e0,   1.796748459660e-1, -1.577061228563e-1,
  649. -3.504660747540e-3, -1.172496827075e-2, -2.083943956635e-3,
  650.  2.059310183891e-3,  3.498024045962e-5,  1.954256820853e-4,
  651.  3.447147301144e-5, -3.487593512748e-5,  3.165561395639e-7,
  652.  
  653. -3.861017802374e-1,  3.022207934926e-1, -2.123620666763e0,
  654. -3.405329331031e-1,  5.816966783051e-1,  3.613428926437e-2,
  655. -1.134632677418e-2,  2.686473977278e-3, -6.746761188693e-3,
  656. -4.718377988248e-4,  1.132484047640e-4, -4.477675310431e-5,
  657.  1.116012719484e-4,  7.990920741835e-6,  1.024849381860e-6,
  658.  
  659. -1.384641783726e-1,  2.933482790246e-1, -7.615748122623e-1,
  660. -3.305356614367e-1,  2.086086020481e-1,  3.507346879406e-2,
  661. -4.069030226609e-3,  2.607605217269e-3, -2.419529752218e-3,
  662. -4.579857152266e-4,  4.061324790585e-5, -4.346220957083e-5,
  663.  4.002255160844e-5,  7.756325500855e-6,  3.675324354182e-7,
  664.  
  665. /* Iris */
  666. -3.221821085369e-2,  9.907754107874e-1,  1.765050607796e0,
  667. -1.038296530184e0,  -3.684605664049e-1,  2.102656075083e-2,
  668. -4.610322993751e-2,  2.443709777445e-2,  4.133814722713e-3,
  669.  2.796199583826e-3,  2.211618558954e-3, -5.421176461335e-4,
  670.  1.375758192501e-4, -1.966210666429e-4, -5.435717896184e-5,
  671.  
  672. -2.728732274927e-2, -1.002727837482e0,   1.494915587413e0,
  673.  1.050822237856e0,  -3.120689240482e-1, -2.128021907064e-2,
  674. -3.904728666659e-2, -2.473189982202e-2,  3.501148373402e-3,
  675. -2.829932123194e-3,  1.873137825390e-3,  5.486575959091e-4,
  676.  1.165203058428e-4,  1.989930460645e-4, -4.603799673429e-5,
  677.  
  678. -1.457714124299e-2, -3.127672899889e-1,  7.985977907868e-1,
  679.  3.277687237841e-1, -1.667101175588e-1, -6.637650018584e-3,
  680. -2.085942318799e-2, -7.714285965209e-3,  1.870345977899e-3,
  681. -8.827023325163e-4,  1.000647623044e-3,  1.711353200638e-4,
  682.  6.224622956062e-5,  6.206920105118e-5, -2.459392543221e-5,
  683.  
  684. /* Bamberga */
  685. -4.428638204675e-1,  3.277675489944e-1,  2.727067283355e0,
  686. -3.226066422703e-1, -4.291430681990e-1, -1.497170325524e-2,
  687. -1.130961297475e-1,  7.296952063929e-3, -9.115500159538e-3,
  688.  2.484760195898e-3,  3.620198026209e-3,  1.354338061210e-4,
  689.  1.475205478064e-3, -1.063495348004e-4,  1.960369766505e-4,
  690.  
  691. -5.189520920287e-2, -1.366052095235e0,   3.195603719233e-1,
  692.  1.344542743667e0,  -5.028739823144e-2,  6.239826567272e-2,
  693. -1.325271345735e-2, -3.041184731784e-2, -1.068163091916e-3,
  694. -1.035585091379e-2,  4.242182929449e-4, -5.644537880111e-4,
  695.  1.728659993507e-4,  4.432379144528e-4,  2.297180181498e-5,
  696.  
  697. -8.779154055939e-2, -8.459223888259e-1,  5.406028375993e-1,
  698.  8.326028074398e-1, -8.507159387687e-2,  3.863988067556e-2,
  699. -2.241972137474e-2, -1.883241687594e-2, -1.807020047676e-3,
  700. -6.412819960435e-3,  7.176534798334e-4, -3.495357888632e-4,
  701.  2.924387939936e-4,  2.744733357682e-4,  3.886158089997e-5
  702. };
  703.  
  704. DOUBLE RK00 =  0.9999256791774783;
  705. DOUBLE RK01 = -0.0111815116768724;
  706. DOUBLE RK02 = -0.0048590038154553;
  707. DOUBLE RK10 =  0.0111815116959975;
  708. DOUBLE RK11 =  0.9999374845751042;
  709. DOUBLE RK12 = -0.0000271625775175;
  710. DOUBLE RK20 =  0.0048590037714450;
  711. DOUBLE RK21 = -0.0000271704492210;
  712. DOUBLE RK22 =  0.9999881946023742;
  713.  
  714. DOUBLE RL00 =  0.9999257180268403;
  715. DOUBLE RL01 = -0.0111782838886141;
  716. DOUBLE RL02 = -0.0048584357372842;
  717. DOUBLE RL10 =  0.0111782838782385;
  718. DOUBLE RL11 =  0.9999375206641666;
  719. DOUBLE RL12 = -0.0000271576311202;
  720. DOUBLE RL20 =  0.0048584357611567;
  721. DOUBLE RL21 = -0.0000271533600777;
  722. DOUBLE RL22 =  0.9999881973626738;
  723. #endif /* not LDOUBLE */
  724.  
  725.  
  726. #define NCOF 15
  727. DOUBLE pcofs[NCOF];
  728. DOUBLE vcofs[NCOF];
  729.  
  730. DOUBLE FLOOR(), SQRT();
  731.  
  732.  
  733. aroids( JD, y )
  734. DOUBLE JD;
  735. register DOUBLE y[];
  736. {
  737. DOUBLE t, psum, vsum, per;
  738. DOUBLE v[3], p[3];
  739. DOUBLE *pans;
  740. int i, j, k, iob;
  741.  
  742.  
  743. pans = &y[6*IAROIDS]; /* output pointer */
  744.  
  745. for( iob=0; iob<5; iob++ )
  746.     {
  747.     per = mpperiod[iob];
  748.     t = (JD - mpperihd[iob])/per;
  749.     t -= FLOOR(t);
  750.     t = Two * t - One;
  751.  
  752. /* Chebyshev expansion
  753.  */
  754.     pcofs[0] = One;
  755.     pcofs[1] = t;
  756.     vcofs[0] = Zero;
  757.     vcofs[1] = One;
  758.     t *= Two;
  759.     for( i=2; i<NCOF; i++ )
  760.         {
  761.         pcofs[i] = t * pcofs[i-1]  -  pcofs[i-2];
  762.         vcofs[i] = Two * pcofs[i-1] + t * vcofs[i-1] - vcofs[i-2];
  763.         }
  764.  
  765.     j = 45 * iob;
  766.     for( k=0; k<3; k++ )
  767.         {
  768.         psum = Zero;
  769.         vsum = Zero;
  770.         for( i=NCOF-1; i>=0; i-- )
  771.             {
  772.             psum += pcofs[i] * ch[j+i];
  773.             vsum += vcofs[i] * ch[j+i];
  774.             }
  775.         p[k] = psum;
  776.         v[k] = vsum / ( Half * per );
  777.         j += NCOF;
  778.         }
  779. #if DE200
  780.     r118_200(p);
  781.     r118_200(v);
  782. #endif
  783.     for( j=0; j<3; j++ )
  784.         {
  785. /* Convert from heliocentric to barycentric coordinates */
  786.         v[j] += y[(6*ISUN)+2*j];
  787.         p[j] += y[(6*ISUN+1)+2*j];
  788.  
  789.         *pans++ = v[j];
  790.         *pans++ = p[j];
  791.         }
  792.     }
  793. }
  794.  
  795.  
  796.  
  797. /* Rotate from DE118 (FK4) to DE200 (FK5)
  798.  */
  799.  
  800. r118_200( vec )
  801. DOUBLE vec[];
  802. {
  803. DOUBLE x, y, z;
  804.  
  805. x = RK00*vec[0] + RK01*vec[1] + RK02*vec[2];
  806. y = RK10*vec[0] + RK11*vec[1] + RK12*vec[2];
  807. z = RK20*vec[0] + RK21*vec[1] + RK22*vec[2];
  808. vec[0] = x;
  809. vec[1] = y;
  810. vec[2] = z;
  811. }
  812.  
  813. /* Rotate DE200 to DE118 */
  814. r200_118( vec )
  815. DOUBLE vec[];
  816. {
  817. DOUBLE x, y, z;
  818.  
  819. x = RK00*vec[0] + RK10*vec[1] + RK20*vec[2];
  820. y = RK01*vec[0] + RK11*vec[1] + RK21*vec[2];
  821. z = RK02*vec[0] + RK12*vec[1] + RK22*vec[2];
  822. vec[0] = x;
  823. vec[1] = y;
  824. vec[2] = z;
  825. }
  826.  
  827.  
  828. /* Rotate DE102 to DE200 */
  829. r102_200( vec )
  830. DOUBLE vec[];
  831. {
  832. DOUBLE x, y, z;
  833.  
  834. x = RL00*vec[0] + RL01*vec[1] + RL02*vec[2];
  835. y = RL10*vec[0] + RL11*vec[1] + RL12*vec[2];
  836. z = RL20*vec[0] + RL21*vec[1] + RL22*vec[2];
  837. vec[0] = x;
  838. vec[1] = y;
  839. vec[2] = z;
  840. }
  841.  
  842. /* Rotate DE200 to DE102 */
  843. r200_102( vec )
  844. DOUBLE vec[];
  845. {
  846. DOUBLE x, y, z;
  847.  
  848. x = RL00*vec[0] + RL10*vec[1] + RL20*vec[2];
  849. y = RL01*vec[0] + RL11*vec[1] + RL21*vec[2];
  850. z = RL02*vec[0] + RL12*vec[1] + RL22*vec[2];
  851. vec[0] = x;
  852. vec[1] = y;
  853. vec[2] = z;
  854. }
  855.  
  856.