View Javadoc

1   /*
2    * $Id$
3    * 
4    * Created on 26 Jan 2010 by Paul Harrison (paul.harrison@manchester.ac.uk)
5    *
6    * Adapted from official SOFA C implementation http://www.iausofa.org/
7    */ 
8   
9   package org.jastronomy.jsofa;
10  
11  import static java.lang.Math.cos;
12  import static java.lang.Math.sin;
13  import static java.lang.Math.atan;
14  import static java.lang.Math.atan2;
15  import static java.lang.Math.min;
16  import static java.lang.Math.max;
17  import static java.lang.Math.ceil;
18  import static java.lang.Math.floor;
19  import static java.lang.Math.sqrt;
20  import static java.lang.Math.abs;
21  import static java.lang.Math.pow;
22  
23  
24  
25  
26  
27  
28  
29  
30  /**
31   * Java implementation of Standards of Fundamental Astronomy. <a href="http://www.iausofa.org/">http://www.iausofa.org/</a>
32   * 
33   * This code has been created by hand translating the official C version.
34   * 
35   * @author Paul Harrison (paul.harrison@manchester.ac.uk) 02 Apr 2014
36   * @version JSOFA Release 20180130
37   * @since 26 Jan 2010
38   */
39  public class JSOFA {
40      /** tracked IAU SOFA release {@value}. */
41      public final static String SOFA_RELEASE = "2021-05-12";
42      
43      /** JSOFA release {@value}*/
44      public final static String JSOFA_RELEASE = "20210512";
45  
46      /** tracked IAU SOFA revision {@value}. */
47      public final static String SOFA_REVISION = "18";
48  
49      /** Release year for this version of jauDat {@value} */
50  public final static int IYV = 2021;
51      /** The latest confirmed omission of a leap second form IERS */
52  public final static JulianDate latestConfirmedNoLeapSecondChange;
53  static {
54      JulianDate tmpval = new JulianDate(0,0);
55      try {
56          tmpval = jauCal2jd(2021,06,30); // this is from the IERS
57      } catch (JSOFAIllegalParameter e) {
58          // should not happen
59          e.printStackTrace();
60      }
61      latestConfirmedNoLeapSecondChange = tmpval;
62  }
63  static class LeapInfo {
64      final public int iyear, month;
65      final public double delat;
66      public LeapInfo(int i, int m, double t) {
67         iyear = i;
68         month = m;
69         delat = t;
70      }
71   }
72  
73  /* Dates and Delta(AT)s */
74  static final LeapInfo leapSeconds[] = {
75       new LeapInfo( 1960,  1,  1.4178180 ),
76       new LeapInfo( 1961,  1,  1.4228180 ),
77       new LeapInfo( 1961,  8,  1.3728180 ),
78       new LeapInfo( 1962,  1,  1.8458580 ),
79       new LeapInfo( 1963, 11,  1.9458580 ),
80       new LeapInfo( 1964,  1,  3.2401300 ),
81       new LeapInfo( 1964,  4,  3.3401300 ),
82       new LeapInfo( 1964,  9,  3.4401300 ),
83       new LeapInfo( 1965,  1,  3.5401300 ),
84       new LeapInfo( 1965,  3,  3.6401300 ),
85       new LeapInfo( 1965,  7,  3.7401300 ),
86       new LeapInfo( 1965,  9,  3.8401300 ),
87       new LeapInfo( 1966,  1,  4.3131700 ),
88       new LeapInfo( 1968,  2,  4.2131700 ),
89       new LeapInfo( 1972,  1, 10.0       ),
90       new LeapInfo( 1972,  7, 11.0       ),
91       new LeapInfo( 1973,  1, 12.0       ),
92       new LeapInfo( 1974,  1, 13.0       ),
93       new LeapInfo( 1975,  1, 14.0       ),
94       new LeapInfo( 1976,  1, 15.0       ),
95       new LeapInfo( 1977,  1, 16.0       ),
96       new LeapInfo( 1978,  1, 17.0       ),
97       new LeapInfo( 1979,  1, 18.0       ),
98       new LeapInfo( 1980,  1, 19.0       ),
99       new LeapInfo( 1981,  7, 20.0       ),
100      new LeapInfo( 1982,  7, 21.0       ),
101      new LeapInfo( 1983,  7, 22.0       ),
102      new LeapInfo( 1985,  7, 23.0       ),
103      new LeapInfo( 1988,  1, 24.0       ),
104      new LeapInfo( 1990,  1, 25.0       ),
105      new LeapInfo( 1991,  1, 26.0       ),
106      new LeapInfo( 1992,  7, 27.0       ),
107      new LeapInfo( 1993,  7, 28.0       ),
108      new LeapInfo( 1994,  7, 29.0       ),
109      new LeapInfo( 1996,  1, 30.0       ),
110      new LeapInfo( 1997,  7, 31.0       ),
111      new LeapInfo( 1999,  1, 32.0       ),
112      new LeapInfo( 2006,  1, 33.0       ),
113      new LeapInfo( 2009,  1, 34.0       ),
114      new LeapInfo( 2012,  7, 35.0       ),
115      new LeapInfo( 2015,  7, 36.0       ),
116      new LeapInfo( 2017,  1, 37.0       )
117   };
118 
119 
120     /** Seconds of time to radians {@value} */
121     public final static double DS2R = (7.272205216643039903848712e-5);
122 
123     /** Pi {@value}*/
124     public final static double DPI = (3.141592653589793238462643);
125 
126     /** 2Pi {@value}*/
127     public final static double D2PI = (6.283185307179586476925287);
128 
129     /** Radians to degrees {@value} */
130     public final static double DR2D = (57.29577951308232087679815);
131 
132     /** Degrees to radians {@value}*/
133     public final static double DD2R = (1.745329251994329576923691e-2);
134 
135     /** Radians to arcseconds {@value}*/
136     public final static double DR2AS = (206264.8062470963551564734);
137 
138     /** Arcseconds to radians {@value}*/
139     public final static double DAS2R = (4.848136811095359935899141e-6);
140 
141     /** Arcseconds in a full circle {@value}*/
142     public final static double TURNAS = (1296000.0);
143 
144     /** Milliarcseconds to radians {@value}*/
145     public final static double DMAS2R = (DAS2R / 1e3);
146 
147     /** Length of tropical year B1900 (days) {@value}*/
148     public final static double DTY = (365.242198781);
149 
150     /** Reference epoch (J2000.0), Julian Date {@value}*/
151     public final static double DJ00 = (2451545.0);
152 
153     /** Julian Date of Modified Julian Date zero {@value}*/
154     public final static double DJM0 = (2400000.5);
155 
156     /** Reference epoch (J2000.0), Modified Julian Date {@value} */
157     public final static double DJM00 = (51544.5);
158 
159     /** Seconds per day. {@value}*/
160     public final static double DAYSEC = (86400.0);
161 
162     /** Days per Julian year */
163     public final static double DJY = (365.25);
164 
165     /** Days per Julian century {@value} */
166     public final static double DJC = (36525.0);
167 
168     /** Days per Julian millennium {@value} */
169     public final static double DJM = (365250.0);
170     
171     /** 1977 Jan 1.0 as MJD */
172     public final static double DJM77 = (43144.0);
173 
174     /** TT minus TAI (s) */
175     public final static double TTMTAI = (32.184);
176 
177 
178     /**  Astronomical unit (m) IAU 2012 {@value} */
179     public final static double DAU = (149597870.7e3);
180     
181     /** Speed of light (m/s) {@value} */
182     public final static double CMPS = 299792458.0;
183 
184     /** Light time for 1 au (s) {@value} */
185     public final static double AULT = (DAU/CMPS);
186 
187 
188     /** Speed of light (au per day) {@value} */
189     public final static double DC = (DAYSEC / AULT);
190     
191     /** L_G = 1 - d(TT)/d(TCG) */
192     public final static double ELG = (6.969290134e-10);
193 
194     /** L_B = 1 - d(TDB)/d(TCB) at TAI 1977/1/1.0 */
195     public final static double ELB = (1.550519768e-8);
196     
197     /** Schwarzschild radius of the Sun (au) {@value}
198      = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
199     public final static double SRS = 1.97412574336e-8;
200 
201     
202     /** TDB (s) at TAI 1977/1/1.0 */
203     public final static double TDB0 = (-6.55e-5);
204 
205     private final static double TANGENT_TINY = 1e-6;
206 
207     private static final double DBL_EPSILON = Math.ulp(1.0);
208 
209     /** dint(A) - truncate to nearest whole number towards zero (double)  */
210     private static double dint(final double A){ return ((A)<0.0?ceil(A):floor(A));}
211 
212     /** dnint(A) - round to nearest whole number (double)  */
213     private static double dnint(final double A){return (abs(A)<0.5?0.0
214                                 :((A)<0.0?ceil((A)-0.5):floor((A)+0.5)));}
215 
216     /** dsign(A,B) - magnitude of A with sign of B (double) */
217     private static double dsign(final double A, double B){return ((B)<0.0?-abs(A):abs(A));}
218 
219      
220     
221     /**
222      * Julian Date representation. The actual date is djm0+djm1, apportioned in any
223      *     convenient way between the two arguments.  For example,
224      *     JD(TT)=2450123.7 could be expressed in any of these ways,
225      *     among others:
226      *<pre>
227      *            djm0          djm1
228      *
229      *         2450123.7           0.0       (JD method)
230      *         2451545.0       -1421.3       (J2000 method)
231      *         2400000.5       50123.2       (MJD method)
232      *         2450123.5           0.2       (date &amp;time method)
233      *</pre>
234      * 
235      * The JD method is the most natural and convenient to use in
236      *     cases where the loss of several decimal digits of resolution
237      *     is acceptable.  The J2000 method is best matched to the way
238      *     the argument is handled internally and will deliver the
239      *     optimum resolution.  The MJD method and the date &amp;time methods
240      *     are both good compromises between resolution and convenience.
241      * 
242      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Jan 2010
243      * 
244      * 
245      */
246     public static class JulianDate implements Comparable<JulianDate>{
247         /**  MJD zero-point */
248         public double djm0;  
249         /** MJD offset */
250         public double djm1;
251         public JulianDate(double d1, double d2) {
252             djm0 = d1;
253             djm1 = d2;
254         }
255         /**
256          * {@inheritDoc}
257          * overrides @see java.lang.Comparable#compareTo(java.lang.Object)
258          */
259         @Override
260         public int compareTo(JulianDate o) {
261             if(this == o) return 0;
262             final Double thismjd = this.djm0 + this.djm1;
263             final Double thatmjd = o.djm0 + o.djm1;
264 
265             return thismjd.compareTo(thatmjd);
266         }
267         /**
268          * {@inheritDoc}
269          * overrides @see java.lang.Object#hashCode()
270          */
271         @Override
272         public int hashCode() {
273             final int prime = 31;
274             int result = 1;
275             long temp;
276             temp = Double.doubleToLongBits(djm0);
277             result = prime * result + (int) (temp ^ (temp >>> 32));
278             temp = Double.doubleToLongBits(djm1);
279             result = prime * result + (int) (temp ^ (temp >>> 32));
280             return result;
281         }
282         /**
283          * {@inheritDoc}
284          * overrides @see java.lang.Object#equals(java.lang.Object)
285          */
286         @Override
287         public boolean equals(Object obj) {
288             if (this == obj)
289                 return true;
290             if (obj == null)
291                 return false;
292             if (!(obj instanceof JulianDate))
293                 return false;
294             JulianDate other = (JulianDate) obj;
295             if (Double.doubleToLongBits(djm0) != Double
296                     .doubleToLongBits(other.djm0))
297                 return false;
298             if (Double.doubleToLongBits(djm1) != Double
299                     .doubleToLongBits(other.djm1))
300                 return false;
301             return true;
302         }
303         /**
304          * {@inheritDoc}
305          * overrides @see java.lang.Object#toString()
306          */
307         @Override
308         public String toString() {        
309             return "MJD=" +Double.toString(djm0 + djm1  - DJM0);
310         }
311     }
312  
313     /**
314     * Decompose radians into degrees, arcminutes, arcseconds, fraction.
315     *  
316     *
317     *  <p>This function is derived from the International Astronomical Union's
318     *  SOFA (Standards Of Fundamental Astronomy) software collection.
319     *
320     *  <p>Status:  vector/matrix support function.
321     *  
322     *
323     *
324     *<p>Called:<ul>
325     *     <li>{@link #jauD2tf}      decompose days to hms
326     *</ul>
327     * <p>Notes:
328     *<ol>
329     *  <li> The argument ndp is interpreted as follows:
330     *
331     * <pre>
332     *     ndp         resolution
333     *      :      ...0000 00 00
334     *     -7         1000 00 00
335     *     -6          100 00 00
336     *     -5           10 00 00
337     *     -4            1 00 00
338     *     -3            0 10 00
339     *     -2            0 01 00
340     *     -1            0 00 10
341     *      0            0 00 01
342     *      1            0 00 00.1
343     *      2            0 00 00.01
344     *      3            0 00 00.001
345     *      :            0 00 00.000...
346     *</pre>
347     *  <li> The largest positive useful value for ndp is determined by the
348     *     size of angle, the format of doubles on the target platform, and
349     *     the risk of overflowing idmsf[3].  On a typical platform, for
350     *     angle up to 2pi, the available floating-point precision might
351     *     correspond to ndp=12.  However, the practical limit is typically
352     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
353     *     only 16 bits.
354     *
355     *  <li> The absolute value of angle may exceed 2pi.  In cases where it
356     *     does not, it is up to the caller to test for and handle the
357     *     case where angle is very nearly 2pi and rounds up to 360 degrees,
358     *     by testing for idmsf[0]=360 and setting idmsf[0-3] to zero.
359     *</ol>
360     *@version 2008 May 27
361     *
362     *  @since Release 20101201
363     *
364     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
365     * <!-- Given: -->
366     *    @param ndp     int     resolution (Note 1)
367     *    @param angle   double  angle in radians
368     *    @param idmsf   int[4] <u>returned</u> degrees, arcminutes, arcseconds, fraction
369     * <!-- Returned: -->
370     *    @return sign    char    '+' or '-'
371     */
372     public static char jauA2af(final int ndp, final double angle,  int idmsf[] ){
373         /* Hours to degrees * radians to turns */
374         final double F = 15.0 / D2PI;
375 
376 
377      /* Scale then use days to h,m,s function. */
378         char retval = jauD2tf(ndp, angle*F, idmsf);
379 
380         return retval;
381 
382         
383     }
384     
385 
386     
387     /**
388     *  Decompose radians into hours, minutes, seconds, fraction.
389     *
390     *<p>This function is derived from the International Astronomical Union's
391     *  SOFA (Standards Of Fundamental Astronomy) software collection.
392     *
393     *<p>Status:  vector/matrix support function.
394     *
395     *<!-- Given: -->
396     *     @param ndp      int      resolution (Note 1)
397     *     @param angle    double   angle in radians
398     *
399     *<!-- Returned: -->
400     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
401     *     @return sign     char      <u>returned</u> '+' or '-'
402     *
403     *<p>Called:<ul>
404     *     <li>{@link #jauD2tf} decompose days to hms
405     * </ul>
406     * <p>Notes:
407     * <ol>
408     *
409     * <li> The argument ndp is interpreted as follows:
410     * <pre>
411     *     ndp         resolution
412     *      :      ...0000 00 00
413     *     -7         1000 00 00
414     *     -6          100 00 00
415     *     -5           10 00 00
416     *     -4            1 00 00
417     *     -3            0 10 00
418     *     -2            0 01 00
419     *     -1            0 00 10
420     *      0            0 00 01
421     *      1            0 00 00.1
422     *      2            0 00 00.01
423     *      3            0 00 00.001
424     *      :            0 00 00.000...
425     *</pre>
426     * <li> The largest positive useful value for ndp is determined by the
427     *     size of angle, the format of doubles on the target platform, and
428     *     the risk of overflowing ihmsf[3].  On a typical platform, for
429     *     angle up to 2pi, the available floating-point precision might
430     *     correspond to ndp=12.  However, the practical limit is typically
431     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
432     *     only 16 bits.
433     *
434     * <li> The absolute value of angle may exceed 2pi.  In cases where it
435     *     does not, it is up to the caller to test for and handle the
436     *     case where angle is very nearly 2pi and rounds up to 24 hours,
437     *     by testing for ihmsf[0]=24 and setting ihmsf(0-3) to zero.
438     *</ol>
439     *  @version 2008 May 11
440     *
441     *  @since Release 20101201
442     *
443     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
444     */
445     public static char jauA2tf(final int ndp, final double angle, int ihmsf[])
446     {
447     /* Scale then use days to h,m,s function. */
448      return  jauD2tf(ndp, angle/D2PI, ihmsf);
449 
450      }
451     
452 
453     /**
454     *  Normalize angle into the range {@code 0 <= a < 2pi}.
455     *
456     *<p>This function is derived from the International Astronomical Union's
457     *  SOFA (Standards Of Fundamental Astronomy) software collection.
458     *
459     *<p>Status:  vector/matrix support function.
460     *
461     *<!-- Given: -->
462     *     @param a         double      angle (radians)
463     *
464     * <!-- Returned (function value): -->
465     *  @return double     angle in range 0-2pi
466     *
467     *@version 2008 May 16
468     *
469     *  @since Release 20101201
470     *
471     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
472     */
473     public static double jauAnp(final double a)
474    {
475        double w;
476 
477 
478        w = fmod(a, D2PI);
479        if (w < 0) w += D2PI;
480 
481        return w;
482 
483     }
484     
485 
486     /**
487     *  Normalize angle into the range  {@code -pi <= a < +pi}.
488     *
489     *<p>This function is derived from the International Astronomical Union's
490     *  SOFA (Standards Of Fundamental Astronomy) software collection.
491     *
492     *<p>Status:  vector/matrix support function.
493     *
494     *<!-- Given: -->
495     *     @param a         double      angle (radians)
496     *
497     * <!-- Returned (function value): -->
498     *  @return double     angle in range +/-pi
499     *
500     *@version 2008 May 16
501     *
502     *  @since Release 20101201
503     *
504     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
505     */
506     public static double jauAnpm(final double a)
507     {
508        double w;
509 
510 
511        w = fmod(a, D2PI);
512        if (abs(w) >= DPI) w -= dsign(D2PI, a);
513 
514        return w;
515 
516         }
517     /**
518      * Frame bias components of IAU 2000 precession-nutation models.
519      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 2 Feb 2010
520      * 
521      * @since AIDA Stage 1
522      */
523     public static class FrameBias {
524         /** longitude  corrections */
525         public double dpsibi;
526         /**obliquity corrections */
527         public double depsbi;
528         /** the ICRS RA of the J2000.0 mean equinox */
529         public double dra;
530     };
531 
532     /**
533     *  Frame bias components of IAU 2000 precession-nutation models part
534     *  of the Mathews-Herring-Buffett (MHB2000) nutation series, with additions.
535     *
536     *<p>This function is derived from the International Astronomical Union's
537     *  SOFA (Standards Of Fundamental Astronomy) software collection.
538     *
539     *<p>Status:  canonical model.
540     *
541     *<!-- Returned: -->
542     *     @return dpsibi,depsbi   double    <u>returned</u> longitude and obliquity corrections
543     *             dra             double    <u>returned</u> the ICRS RA of the J2000.0 mean equinox
544     *
545     * <p>Notes:
546     * <ol>
547     *
548     * <li> The frame bias corrections in longitude and obliquity (radians)
549     *     are required in order to correct for the offset between the GCRS
550     *     pole and the mean J2000.0 pole.  They define, with respect to the
551     *     GCRS frame, a J2000.0 mean pole that is consistent with the rest
552     *     of the IAU 2000A precession-nutation model.
553     *
554     * <li> In addition to the displacement of the pole, the complete
555     *     description of the frame bias requires also an offset in right
556     *     ascension.  This is not part of the IAU 2000A model, and is from
557     *     Chapront et al. (2002).  It is returned in radians.
558     *
559     * <li> This is a supplemented implementation of one aspect of the IAU
560     *     2000A nutation model, formally adopted by the IAU General
561     *     Assembly in 2000, namely MHB2000 (Mathews et al. 2002).
562     *</ol>
563     *<p>References:
564     *
565     *     Chapront, J., Chapront-Touze, M. &amp;Francou, G., Astron.
566     *     Astrophys., 387, 700, 2002.
567     *
568     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
569     *     and precession   New nutation series for nonrigid Earth and
570     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
571     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
572     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
573     *
574     *@version 2009 December 17
575     *
576     *  @since Release 20101201
577     *
578     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
579     */
580     public static FrameBias jauBi00()
581    {
582     /* The frame bias corrections in longitude and obliquity */
583        final double DPBIAS = -0.041775  * DAS2R,
584                     DEBIAS = -0.0068192 * DAS2R;
585 
586     /* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */
587        final double DRA0 = -0.0146 * DAS2R;
588 
589 
590     /* Return the results (which are fixed). */
591        FrameBias retval = new FrameBias();
592        retval.dpsibi = DPBIAS;
593        retval.depsbi = DEBIAS;
594        retval.dra = DRA0;
595 
596        return retval;
597 
598         }
599     
600 
601     /**
602     *  Frame bias and precession, IAU 2000.
603     *
604     *<p>This function is derived from the International Astronomical Union's
605     *  SOFA (Standards Of Fundamental Astronomy) software collection.
606     *
607     *<p>Status:  canonical model.
608     *
609     *<!-- Given: -->
610     *      @param date1  double          TT as a 2-part Julian Date (Note 1)
611     *      @param date2   double          TT as a 2-part Julian Date (Note 1)
612     *
613     *<!-- Returned: -->
614     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
615     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
616     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
617     *
618     * <p>Notes:
619     * <ol>
620     *
621     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
622     *     convenient way between the two arguments.  For example,
623     *     JD(TT)=2450123.7 could be expressed in any of these ways,
624     *     among others:
625     *<pre>
626     *             date1         date2
627     *
628     *         2450123.7           0.0       (JD method)
629     *         2451545.0       -1421.3       (J2000 method)
630     *         2400000.5       50123.2       (MJD method)
631     *         2450123.5           0.2       (date &amp;time method)
632     *</pre>
633     *     The JD method is the most natural and convenient to use in
634     *     cases where the loss of several decimal digits of resolution
635     *     is acceptable.  The J2000 method is best matched to the way
636     *     the argument is handled internally and will deliver the
637     *     optimum resolution.  The MJD method and the date &amp;time methods
638     *     are both good compromises between resolution and convenience.
639     *
640     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
641     *     applying frame bias.
642     *
643     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
644     *     equinox to mean equator and equinox of date by applying
645     *     precession.
646     *
647     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
648     *     equinox of date by applying frame bias then precession.  It is
649     *     the product rp x rb.
650     *
651     * <li> It is permissible to re-use the same array in the returned
652     *     arguments.  The arrays are filled in the order given.
653     *</ol>
654     *<p>Called:<ul>
655     *     <li>{@link #jauBi00} frame bias components, IAU 2000
656     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
657     *     <li>{@link #jauIr} initialize r-matrix to identity
658     *     <li>{@link #jauRx} rotate around X-axis
659     *     <li>{@link #jauRy} rotate around Y-axis
660     *     <li>{@link #jauRz} rotate around Z-axis
661     *     <li>{@link #jauCr} copy r-matrix
662     *     <li>{@link #jauRxr} product of two r-matrices
663     * </ul>
664     *<p>Reference:
665     *     "Expressions for the Celestial Intermediate Pole and Celestial
666     *     Ephemeris Origin consistent with the IAU 2000A precession-
667     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
668     *
669     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
670     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
671     *
672     *@version 2010 January 18
673     *
674     *  @since Release 20101201
675     *
676     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
677     */
678     public static void jauBp00(final double  date1, final double date2,
679             double rb[][], double rp[][], double rbp[][])
680     {
681     /* J2000.0 obliquity (Lieske et al. 1977) */
682        final double EPS0 = 84381.448 * DAS2R;
683 
684        double t, dpsibi, depsbi;
685        double dra0, psia77, oma77, chia, dpsipr, depspr, psia, oma,
686               rbw[][] = new double[3][3];
687 
688 
689     /* Interval between fundamental epoch J2000.0 and current date (JC). */
690        t = ((date1 - DJ00) + date2) / DJC;
691 
692     /* Frame bias. */
693        FrameBias fb = jauBi00();
694        dpsibi = fb.dpsibi;
695        depsbi = fb.depsbi;
696        dra0 = fb.dra;
697     /* Precession angles (Lieske et al. 1977) */
698        psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * DAS2R;
699        oma77  =       EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * DAS2R;
700        chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
701 
702     /* Apply IAU 2000 precession corrections. */
703        PrecessionDeltaTerms pc = jauPr00(date1, date2);
704        dpsipr = pc.dpsipr;  depspr = pc.depspr;
705        psia = psia77 + dpsipr;
706        oma  = oma77  + depspr;
707 
708     /* Frame bias matrix: GCRS to J2000.0. */
709        jauIr(rbw);
710        jauRz(dra0, rbw);
711        jauRy(dpsibi * sin(EPS0), rbw);
712        jauRx(-depsbi, rbw);
713        jauCr(rbw, rb);
714 
715     /* Precession matrix: J2000.0 to mean of date. */
716        jauIr(rp);
717        jauRx(EPS0,  rp);
718        jauRz(-psia, rp);
719        jauRx(-oma,  rp);
720        jauRz(chia,  rp);
721 
722     /* Bias-precession matrix: GCRS to mean of date. */
723        double[][] rt = jauRxr(rp, rbw );
724        jauCr(rt, rbp);
725        return;
726 
727         }
728     
729 
730     /**
731     *  Frame bias and precession, IAU 2006.
732     *
733     *<p>This function is derived from the International Astronomical Union's
734     *  SOFA (Standards Of Fundamental Astronomy) software collection.
735     *
736     *<p>Status:  support function.
737     *
738     *<!-- Given: -->
739     *     @param date1 double TT as a 2-part Julian Date (Note 1)
740     *     @param date2 double TT as a 2-part Julian Date (Note 1)
741     *
742     *<!-- Returned: -->
743     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
744     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
745     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
746     *
747     * <p>Notes:
748     * <ol>
749     *
750     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
751     *     convenient way between the two arguments.  For example,
752     *     JD(TT)=2450123.7 could be expressed in any of these ways,
753     *     among others:
754     *<pre>
755     *             date1         date2
756     *
757     *         2450123.7           0.0       (JD method)
758     *         2451545.0       -1421.3       (J2000 method)
759     *         2400000.5       50123.2       (MJD method)
760     *         2450123.5           0.2       (date &amp;time method)
761     *</pre>
762     *     The JD method is the most natural and convenient to use in
763     *     cases where the loss of several decimal digits of resolution
764     *     is acceptable.  The J2000 method is best matched to the way
765     *     the argument is handled internally and will deliver the
766     *     optimum resolution.  The MJD method and the date &amp;time methods
767     *     are both good compromises between resolution and convenience.
768     *
769     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
770     *     applying frame bias.
771     *
772     * <li> The matrix rp transforms vectors from mean J2000.0 to mean of
773     *     date by applying precession.
774     *
775     * <li> The matrix rbp transforms vectors from GCRS to mean of date by
776     *     applying frame bias then precession.  It is the product rp x rb.
777     * 
778     *  <li> It is permissible to re-use the same array in the returned
779     *        arguments.  The arrays are filled in the order given.
780     *</ol>
781     *<p>Called:<ul>
782     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
783     *     <li>{@link #jauFw2m} F-W angles to r-matrix
784     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
785     *     <li>{@link #jauTr} transpose r-matrix
786     *     <li>{@link #jauRxr} product of two r-matrices
787     * </ul>
788     *<p>References:
789     *
790     *     <p>Capitaine, N. &amp;Wallace, P.T., 2006, Astron.Astrophys. 450, 855
791     *
792     *     <p>Wallace, P.T. &amp;Capitaine, N., 2006, Astron.Astrophys. 459, 981
793     *
794     *@version 2009 December 17
795     *
796     *  @since Release 20101201
797     *
798     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
799     */
800         public static void jauBp06(final double date1, final double date2,
801                  double rb[][], double rp[][], double rbp[][])
802     {
803        double rbt[][];
804 
805 
806     /* B matrix. */
807        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
808        double[][] rt = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
809        jauCr(rt, rb);
810 
811     /* PxB matrix. */
812        rt = jauPmat06(date1, date2 );
813        jauCr(rt, rbp);
814 
815     /* P matrix. */
816        rbt = jauTr(rb);
817        rt = jauRxr(rbp, rbt);
818        jauCr(rt, rp);
819 
820        return;
821 
822         }
823     
824      /**
825      * The components x,y are components of the Celestial Intermediate
826      *     Pole unit vector in the Geocentric Celestial Reference System.
827      *     
828      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Jan 2010
829      * 
830      * @since AIDA Stage 1
831      */
832     public static class CelestialIntermediatePole {
833          public double x; 
834          public double y;
835          public CelestialIntermediatePole(double x, double y) {
836             this.x = x;
837             this.y = y;
838         }
839      }
840     /**
841     *  Extract from the bias-precession-nutation matrix the X,Y coordinates
842     *  of the Celestial Intermediate Pole.
843     *
844     *<p>This function is derived from the International Astronomical Union's
845     *  SOFA (Standards Of Fundamental Astronomy) software collection.
846     *
847     *<p>Status:  support function.
848     *
849     *<!-- Given: -->
850     *     @param rbpn       double[3][3]   celestial-to-true matrix (Note 1)
851     *
852     *<!-- Returned: -->
853     *     @return     <u>returned</u> Celestial Intermediate Pole (Note 2)
854     *
855     * <p>Notes:
856     * <ol>
857     *
858     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
859     *     CIO or equinox) of date, and therefore the Celestial Intermediate
860     *     Pole unit vector is the bottom row of the matrix.
861     *
862     * <li> The arguments x,y are components of the Celestial Intermediate
863     *     Pole unit vector in the Geocentric Celestial Reference System.
864     *</ol>
865     *<p>Reference:
866     *
867     *     "Expressions for the Celestial Intermediate Pole and Celestial
868     *     Ephemeris Origin consistent with the IAU 2000A precession-
869     *     nutation model", Astron.Astrophys. 400, 1145-1154
870     *     (2003)
871     *
872     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
873     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
874     *
875     *@version 2010 January 18
876     *
877     *  @since Release 20101201
878     *
879     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
880     */
881         public static CelestialIntermediatePole  jauBpn2xy(double rbpn[][])
882     {
883     /* Extract the X,Y coordinates. */
884 
885        return new CelestialIntermediatePole(rbpn[2][0], rbpn[2][1]);
886 
887         }
888     
889 
890     /**
891     *  Form the celestial-to-intermediate matrix for a given date using the
892     *  IAU 2000A precession-nutation model.
893     *
894     *<p>This function is derived from the International Astronomical Union's
895     *  SOFA (Standards Of Fundamental Astronomy) software collection.
896     *
897     *<p>Status:  support function.
898     *
899     *<!-- Given: -->
900     *     @param date1 double TT as a 2-part Julian Date (Note 1)
901     *     @param date2 double TT as a 2-part Julian Date (Note 1)
902     *
903     *<!-- Returned: -->
904     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
905     *
906     * <p>Notes:
907     * <ol>
908     *
909     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
910     *     convenient way between the two arguments.  For example,
911     *     JD(TT)=2450123.7 could be expressed in any of these ways,
912     *     among others:
913     *<pre>
914     *            date1          date2
915     *
916     *         2450123.7           0.0       (JD method)
917     *         2451545.0       -1421.3       (J2000 method)
918     *         2400000.5       50123.2       (MJD method)
919     *         2450123.5           0.2       (date &amp;time method)
920     *</pre>
921     *     The JD method is the most natural and convenient to use in
922     *     cases where the loss of several decimal digits of resolution
923     *     is acceptable.  The J2000 method is best matched to the way
924     *     the argument is handled internally and will deliver the
925     *     optimum resolution.  The MJD method and the date &amp;time methods
926     *     are both good compromises between resolution and convenience.
927     *
928     * <li> The matrix rc2i is the first stage in the transformation from
929     *     celestial to terrestrial coordinates:
930     *
931     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
932     *
933     *               =  rc2t * [CRS]
934     *
935     *     where [CRS] is a vector in the Geocentric Celestial Reference
936     *     System and [TRS] is a vector in the International Terrestrial
937     *     Reference System (see IERS Conventions 2003), ERA is the Earth
938     *     Rotation Angle and RPOM is the polar motion matrix.
939     *
940     * <li> A faster, but slightly less accurate, result (about 1 mas), can be
941     *     obtained by using instead the jauC2i00b function.
942     *</ol>
943     *<p>Called:<ul>
944     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
945     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
946     * </ul>
947     *<p>References:
948     *<ul>
949     *     <li>"Expressions for the Celestial Intermediate Pole and Celestial
950     *     Ephemeris Origin consistent with the IAU 2000A precession-
951     *     nutation model", Astron.Astrophys. 400, 1145-1154
952     *     (2003)
953     *
954     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
955     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
956     *
957     *    <li>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
958     *     IERS Technical Note No. 32, BKG (2004)
959     *</ul>
960     *@version 2010 January 18
961     *
962     *  @since Release 20101201
963     *
964     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
965     */
966     public static double[][] jauC2i00a(double date1, double date2)
967     {
968 
969 
970     /* Obtain the celestial-to-true matrix (IAU 2000A). */
971        double rbpn[][] = jauPnm00a(date1, date2);
972 
973     /* Form the celestial-to-intermediate matrix. */
974        double rc2i[][]  =jauC2ibpn(date1, date2, rbpn);
975 
976        return rc2i;
977 
978         }
979     
980 
981     /**
982     *  Form the celestial-to-intermediate matrix for a given date using the
983     *  IAU 2000B precession-nutation model.
984     *
985     *<p>This function is derived from the International Astronomical Union's
986     *  SOFA (Standards Of Fundamental Astronomy) software collection.
987     *
988     *<p>Status:  support function.
989     *
990     *<!-- Given: -->
991     *     @param date1 double TT as a 2-part Julian Date (Note 1)
992     *     @param date2 double TT as a 2-part Julian Date (Note 1)
993     *
994     *<!-- Returned: -->
995     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
996     *
997     * <p>Notes:
998     * <ol>
999     *
1000     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1001     *     convenient way between the two arguments.  For example,
1002     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1003     *     among others:
1004     *<pre>
1005     *            date1          date2
1006     *
1007     *         2450123.7           0.0       (JD method)
1008     *         2451545.0       -1421.3       (J2000 method)
1009     *         2400000.5       50123.2       (MJD method)
1010     *         2450123.5           0.2       (date &amp;time method)
1011     *</pre>
1012     *     The JD method is the most natural and convenient to use in
1013     *     cases where the loss of several decimal digits of resolution
1014     *     is acceptable.  The J2000 method is best matched to the way
1015     *     the argument is handled internally and will deliver the
1016     *     optimum resolution.  The MJD method and the date &amp;time methods
1017     *     are both good compromises between resolution and convenience.
1018     *
1019     * <li> The matrix rc2i is the first stage in the transformation from
1020     *     celestial to terrestrial coordinates:
1021     *
1022     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1023     *
1024     *               =  rc2t * [CRS]
1025     *
1026     *     where [CRS] is a vector in the Geocentric Celestial Reference
1027     *     System and [TRS] is a vector in the International Terrestrial
1028     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1029     *     Rotation Angle and RPOM is the polar motion matrix.
1030     *
1031     * <li> The present function is faster, but slightly less accurate (about
1032     *     1 mas), than the jauC2i00a function.
1033     *</ol>
1034     *<p>Called:<ul>
1035     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
1036     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
1037     * </ul>
1038     *<p>References:
1039     *
1040     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1041     *     Ephemeris Origin consistent with the IAU 2000A precession-
1042     *     nutation model", Astron.Astrophys. 400, 1145-1154
1043     *     (2003)
1044     *
1045     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1046     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1047     *
1048     *    <p> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1049     *     IERS Technical Note No. 32, BKG (2004)
1050     *
1051     *@version 2010 January 18
1052     *
1053     *  @since Release 20101201
1054     *
1055     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1056     */
1057     public static double[][] jauC2i00b(double date1, double date2)
1058     {
1059        double rbpn[][];
1060        double rc2i[][];
1061 
1062     /* Obtain the celestial-to-true matrix (IAU 2000B). */
1063        rbpn = jauPnm00b(date1, date2 );
1064 
1065     /* Form the celestial-to-intermediate matrix. */
1066        rc2i = jauC2ibpn(date1, date2, rbpn);
1067 
1068        return rc2i;
1069 
1070         }
1071     
1072 
1073     /**
1074     *  Form the celestial-to-intermediate matrix for a given date using the
1075     *  IAU 2006 precession and IAU 2000A nutation models.
1076     *
1077     *<p>This function is derived from the International Astronomical Union's
1078     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1079     *
1080     *<p>Status:  support function.
1081     *
1082     *<!-- Given: -->
1083     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1084     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1085     *
1086     *<!-- Returned: -->
1087     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
1088     *
1089     * <p>Notes:
1090     * <ol>
1091     *
1092     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1093     *     convenient way between the two arguments.  For example,
1094     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1095     *     among others:
1096     *<pre>
1097     *            date1          date2
1098     *
1099     *         2450123.7           0.0       (JD method)
1100     *         2451545.0       -1421.3       (J2000 method)
1101     *         2400000.5       50123.2       (MJD method)
1102     *         2450123.5           0.2       (date &amp;time method)
1103     *</pre>
1104     *     The JD method is the most natural and convenient to use in
1105     *     cases where the loss of several decimal digits of resolution
1106     *     is acceptable.  The J2000 method is best matched to the way
1107     *     the argument is handled internally and will deliver the
1108     *     optimum resolution.  The MJD method and the date &amp;time methods
1109     *     are both good compromises between resolution and convenience.
1110     *
1111     * <li> The matrix rc2i is the first stage in the transformation from
1112     *     celestial to terrestrial coordinates:
1113     *
1114     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1115     *
1116     *               =  RC2T * [CRS]
1117     *
1118     *     where [CRS] is a vector in the Geocentric Celestial Reference
1119     *     System and [TRS] is a vector in the International Terrestrial
1120     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1121     *     Rotation Angle and RPOM is the polar motion matrix.
1122     *</ol>
1123     *<p>Called:<ul>
1124     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
1125     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1126     *     <li>{@link #jauS06} the CIO locator s, Given X,Y, IAU 2006
1127     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, Given X,Y and s
1128     * </ul>
1129     *<p>References:
1130     *
1131     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1132     *     IERS Technical Note No. 32, BKG
1133     *
1134     *@version 2008 May 13
1135     *
1136     *  @since Release 20101201
1137     *
1138     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1139     */
1140     public static double[][] jauC2i06a(double date1, double date2)
1141     {
1142        double rbpn[][], s,  rc2i[][];
1143 
1144 
1145     /* Obtain the celestial-to-true matrix (IAU 2006/2000A). */
1146        rbpn = jauPnm06a(date1, date2);
1147 
1148     /* Extract the X,Y coordinates. */
1149        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1150 
1151     /* Obtain the CIO locator. */
1152        s = jauS06(date1, date2, cip.x, cip.y);
1153 
1154     /* Form the celestial-to-intermediate matrix. */
1155        rc2i = jauC2ixys(cip.x, cip.y, s);
1156 
1157        return rc2i;
1158 
1159         }
1160     
1161 
1162     /**
1163     *  Form the celestial-to-intermediate matrix for a given date given
1164     *  the bias-precession-nutation matrix.  IAU 2000.
1165     *
1166     *<p>This function is derived from the International Astronomical Union's
1167     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1168     *
1169     *<p>Status:  support function.
1170     *
1171     *<!-- Given: -->
1172     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1173     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1174     *     @param rbpn         double[3][3]  celestial-to-true matrix (Note 2)
1175     *
1176     *<!-- Returned: -->
1177     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1178     *
1179     * <p>Notes:
1180     * <ol>
1181     *
1182     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1183     *     convenient way between the two arguments.  For example,
1184     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1185     *     among others:
1186     *<pre>
1187     *            date1          date2
1188     *
1189     *         2450123.7           0.0       (JD method)
1190     *         2451545.0       -1421.3       (J2000 method)
1191     *         2400000.5       50123.2       (MJD method)
1192     *         2450123.5           0.2       (date &amp;time method)
1193     *</pre>
1194     *     The JD method is the most natural and convenient to use in
1195     *     cases where the loss of several decimal digits of resolution
1196     *     is acceptable.  The J2000 method is best matched to the way
1197     *     the argument is handled internally and will deliver the
1198     *     optimum resolution.  The MJD method and the date &amp;time methods
1199     *     are both good compromises between resolution and convenience.
1200     *
1201     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
1202     *     CIO or equinox) of date.  Only the CIP (bottom row) is used.
1203     *
1204     * <li> The matrix rc2i is the first stage in the transformation from
1205     *     celestial to terrestrial coordinates:
1206     *
1207     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1208     *
1209     *              = RC2T * [CRS]
1210     *
1211     *     where [CRS] is a vector in the Geocentric Celestial Reference
1212     *     System and [TRS] is a vector in the International Terrestrial
1213     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1214     *     Rotation Angle and RPOM is the polar motion matrix.
1215     *
1216     * <li> Although its name does not include "00", This function is in fact
1217     *     specific to the IAU 2000 models.
1218     *</ol>
1219     *<p>Called:<ul>
1220     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1221     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
1222     * </ul>
1223     *<p>References:
1224     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1225     *     Ephemeris Origin consistent with the IAU 2000A precession-
1226     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
1227     *
1228     *     <p>n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1229     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1230     *
1231     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1232     *     IERS Technical Note No. 32, BKG (2004)
1233     *
1234     *@version 2010 January 18
1235     *
1236     *  @since Release 20101201
1237     *
1238     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1239     */
1240     public static double[][] jauC2ibpn(double date1, double date2, double rbpn[][])
1241     {
1242 
1243     /* Extract the X,Y coordinates. */
1244        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1245        
1246        
1247     /* Form the celestial-to-intermediate matrix (n.b. IAU 2000 specific). */
1248        double rc2i[][] =jauC2ixy(date1, date2, cip.x, cip.y);
1249 
1250        return rc2i;
1251 
1252         }
1253     
1254 
1255     /**
1256     *  Form the celestial to intermediate-frame-of-date matrix for a given
1257     *  date when the CIP X,Y coordinates are known.  IAU 2000.
1258     *
1259     *<p>This function is derived from the International Astronomical Union's
1260     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1261     *
1262     *<p>Status:  support function.
1263     *
1264     *<!-- Given: -->
1265     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1266     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1267     *     @param x double        Celestial Intermediate Pole (Note 2)
1268     *     @param y double        Celestial Intermediate Pole (Note 2) 
1269     *
1270     *<!-- Returned: -->
1271     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1272     *
1273     * <p>Notes:
1274     * <ol>
1275     *
1276     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1277     *     convenient way between the two arguments.  For example,
1278     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1279     *     among others:
1280     *<pre>
1281     *            date1          date2
1282     *
1283     *         2450123.7           0.0       (JD method)
1284     *         2451545.0       -1421.3       (J2000 method)
1285     *         2400000.5       50123.2       (MJD method)
1286     *         2450123.5           0.2       (date &amp;time method)
1287     *</pre>
1288     *     The JD method is the most natural and convenient to use in
1289     *     cases where the loss of several decimal digits of resolution
1290     *     is acceptable.  The J2000 method is best matched to the way
1291     *     the argument is handled internally and will deliver the
1292     *     optimum resolution.  The MJD method and the date &amp;time methods
1293     *     are both good compromises between resolution and convenience.
1294     *
1295     * <li> The Celestial Intermediate Pole coordinates are the x,y components
1296     *     of the unit vector in the Geocentric Celestial Reference System.
1297     *
1298     * <li> The matrix rc2i is the first stage in the transformation from
1299     *     celestial to terrestrial coordinates:
1300     *
1301     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1302     *
1303     *              = RC2T * [CRS]
1304     *
1305     *     where [CRS] is a vector in the Geocentric Celestial Reference
1306     *     System and [TRS] is a vector in the International Terrestrial
1307     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1308     *     Rotation Angle and RPOM is the polar motion matrix.
1309     *
1310     * <li> Although its name does not include "00", This function is in fact
1311     *     specific to the IAU 2000 models.
1312     *</ol>
1313     *<p>Called:<ul>
1314     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
1315     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
1316     * </ul>
1317     *<p>Reference:
1318     *
1319     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1320     *     IERS Technical Note No. 32, BKG (2004)
1321     *
1322     *@version 2008 May 11
1323     *
1324     *  @since Release 20101201
1325     *
1326     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1327     */
1328 
1329     public static  double[][] jauC2ixy(double date1, double date2, double x, double y)
1330     {
1331     /* Compute s and then the matrix. */
1332        double rc2i[][] = jauC2ixys(x, y, jauS00(date1, date2, x, y));
1333 
1334        return rc2i;
1335 
1336         }
1337     
1338 
1339     /**
1340     *  Form the celestial to intermediate-frame-of-date matrix given the CIP
1341     *  X,Y and the CIO locator s.
1342     *
1343     *<p>This function is derived from the International Astronomical Union's
1344     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1345     *
1346     *<p>Status:  support function.
1347     *
1348     *<!-- Given: -->
1349     *     @param x double          Celestial Intermediate Pole (Note 1)
1350     *     @param y double          Celestial Intermediate Pole (Note 1) 
1351     *     @param s         double          the CIO locator s (Note 2)
1352     *
1353     *<!-- Returned: -->
1354     *     @return rc2i      double[3][3]     <u>returned</u> celestial-to-intermediate matrix (Note 3)
1355     *
1356     * <p>Notes:
1357     * <ol>
1358     *
1359     * <li> The Celestial Intermediate Pole coordinates are the x,y
1360     *     components of the unit vector in the Geocentric Celestial
1361     *     Reference System.
1362     *
1363     * <li> The CIO locator s (in radians) positions the Celestial
1364     *     Intermediate Origin on the equator of the CIP.
1365     *
1366     * <li> The matrix rc2i is the first stage in the transformation from
1367     *     celestial to terrestrial coordinates:
1368     *
1369     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1370     *
1371     *              = RC2T * [CRS]
1372     *
1373     *     where [CRS] is a vector in the Geocentric Celestial Reference
1374     *     System and [TRS] is a vector in the International Terrestrial
1375     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1376     *     Rotation Angle and RPOM is the polar motion matrix.
1377     *</ol>
1378     *<p>Called:<ul>
1379     *     <li>{@link #jauIr} initialize r-matrix to identity
1380     *     <li>{@link #jauRz} rotate around Z-axis
1381     *     <li>{@link #jauRy} rotate around Y-axis
1382     * </ul>
1383     *<p>Reference:
1384     *
1385     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1386     *     IERS Technical Note No. 32, BKG (2004)
1387     *
1388     *@version 2008 May 11
1389     *
1390     *  @since Release 20101201
1391     *
1392     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1393     */
1394     public static double[][] jauC2ixys(double x, double y, double s)
1395     {
1396        double r2, e, d;
1397        double rc2i[][] = new double[3][3];
1398 
1399     /* Obtain the spherical angles E and d. */
1400        r2 = x*x + y*y;
1401        e = (r2 > 0.0) ? atan2(y, x) : 0.0;
1402        d = atan(sqrt(r2 / (1.0 - r2)));
1403 
1404     /* Form the matrix. */
1405        jauIr(rc2i);
1406        jauRz(e, rc2i);
1407        jauRy(d, rc2i);
1408        jauRz(-(e+s), rc2i);
1409 
1410        return rc2i;
1411 
1412         }
1413     
1414     /**
1415     *  P-vector to spherical coordinates.
1416     *
1417     *<p>This function is derived from the International Astronomical Union's
1418     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1419     *
1420     *<p>Status:  vector/matrix support function.
1421     *
1422     *<!-- Given: -->
1423     *     @param p       double[3]     p-vector
1424     *
1425     *<!-- Returned: -->
1426     *     @return theta   double         <u>returned</u> longitude angle (radians)
1427     *             phi     double         <u>returned</u> latitude angle (radians)
1428     *
1429     * <p>Notes:
1430     * <ol>
1431     *
1432     * <li> The vector p can have any magnitude; only its direction is used.
1433     *
1434     * <li> If p is null, zero theta and phi are returned.
1435     *
1436     * <li> At either pole, zero theta is returned.
1437     *</ol>
1438     *@version 2008 May 11
1439     *
1440     *  @since Release 20101201
1441     *
1442     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1443     */
1444     public static SphericalCoordinate jauC2s(double p[])
1445     {
1446        double x, y, z, d2;
1447 
1448 
1449        x  = p[0];
1450        y  = p[1];
1451        z  = p[2];
1452        d2 = x*x + y*y;
1453 
1454        double theta = (d2 == 0.0) ? 0.0 : atan2(y, x);
1455        double phi = (z == 0.0) ? 0.0 : atan2(z, sqrt(d2));
1456 
1457        return new SphericalCoordinate(theta, phi);
1458 
1459         }
1460     
1461 
1462     /**
1463     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1464     *  the polar motion, using the IAU 2000A nutation model.
1465     *
1466     *<p>This function is derived from the International Astronomical Union's
1467     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1468     *
1469     *<p>Status:  support function.
1470     *
1471     *<!-- Given: -->
1472     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1473     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1474     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1475     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1476     *     @param xp double          CIP coordinates (radians, Note 2)
1477     *     @param yp double          CIP coordinates (radians, Note 2) 
1478     *
1479     *<!-- Returned: -->
1480     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1481     *
1482     * <p>Notes:
1483     * <ol>
1484     *
1485     *   <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1486     *     apportioned in any convenient way between the arguments uta and
1487     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1488     *     these ways, among others:
1489     *<pre>
1490     *             uta            utb
1491     *
1492     *         2450123.7           0.0       (JD method)
1493     *         2451545.0       -1421.3       (J2000 method)
1494     *         2400000.5       50123.2       (MJD method)
1495     *         2450123.5           0.2       (date &amp;time method)
1496     *</pre>
1497     *     The JD method is the most natural and convenient to use in
1498     *     cases where the loss of several decimal digits of resolution is
1499     *     acceptable.  The J2000 and MJD methods are good compromises
1500     *     between resolution and convenience.  In the case of uta,utb, the
1501     *     date &amp;time method is best matched to the Earth rotation angle
1502     *     algorithm used:  maximum precision is delivered when the uta
1503     *     argument is for 0hrs UT1 on the day in question and the utb
1504     *     argument lies in the range 0 to 1, or vice versa.
1505     *
1506     *  <li> The arguments xp and yp are the coordinates (in radians) of the
1507     *     Celestial Intermediate Pole with respect to the International
1508     *     Terrestrial Reference System (see IERS Conventions 2003),
1509     *     measured along the meridians 0 and 90 deg west respectively.
1510     *
1511     * <li> The matrix rc2t transforms from celestial to terrestrial
1512     *     coordinates:
1513     *
1514     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1515     *
1516     *              = rc2t * [CRS]
1517     *
1518     *     where [CRS] is a vector in the Geocentric Celestial Reference
1519     *     System and [TRS] is a vector in the International Terrestrial
1520     *     Reference System (see IERS Conventions 2003), RC2I is the
1521     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1522     *     angle and RPOM is the polar motion matrix.
1523     *
1524     * <li> A faster, but slightly less accurate, result (about 1 mas), can
1525     *     be obtained by using instead the jauC2t00b function.
1526     *</ol>
1527     *<p>Called:<ul>
1528     *     <li>{@link #jauC2i00a} celestial-to-intermediate matrix, IAU 2000A
1529     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1530     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1531     *     <li>{@link #jauPom00} polar motion matrix
1532     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1533     * </ul>
1534     *<p>Reference:
1535     *
1536     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1537     *     IERS Technical Note No. 32, BKG (2004)
1538     *
1539     *@version 2009 April 1
1540     *
1541     *  @since Release 20101201
1542     *
1543     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1544     */
1545     public static  double[][] jauC2t00a(final double tta, final double ttb, final double uta, final double utb,
1546                    final double xp, final double yp)
1547     {
1548        double rc2i[][]= new double[3][3], era, sp, rpom[][];
1549 
1550 
1551     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000A). */
1552        rc2i = jauC2i00a(tta, ttb);
1553 
1554     /* Predict the Earth rotation angle for this UT1. */
1555        era = jauEra00(uta, utb);
1556 
1557     /* Estimate s'. */
1558        sp = jauSp00(tta, ttb);
1559 
1560     /* Form the polar motion matrix. */
1561        rpom = jauPom00(xp, yp, sp );
1562 
1563     /* Combine to form the celestial-to-terrestrial matrix. */
1564        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
1565 
1566        return rc2t;
1567 
1568         }
1569     
1570 
1571     /**
1572     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1573     *  the polar motion, using the IAU 2000B precession-nutation model.
1574     *
1575     *<p>This function is derived from the International Astronomical Union's
1576     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1577     *
1578     *<p>Status:  support function.
1579     *
1580     *<!-- Given: -->
1581     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1582     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1583     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1584     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1585     *     @param xp double          coordinates of the pole (radians, Note 2)
1586     *     @param yp double          coordinates of the pole (radians, Note 2) 
1587     *
1588     *<!-- Returned: -->
1589     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1590     *
1591     * <p>Notes:
1592     * <ol>
1593     *
1594     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1595     *     apportioned in any convenient way between the arguments uta and
1596     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1597     *     these ways, among others:
1598     *<pre>
1599     *             uta            utb
1600     *
1601     *         2450123.7           0.0       (JD method)
1602     *         2451545.0       -1421.3       (J2000 method)
1603     *         2400000.5       50123.2       (MJD method)
1604     *         2450123.5           0.2       (date &amp;time method)
1605     *</pre>
1606     *     The JD method is the most natural and convenient to use in
1607     *     cases where the loss of several decimal digits of resolution is
1608     *     acceptable.  The J2000 and MJD methods are good compromises
1609     *     between resolution and convenience.  In the case of uta,utb, the
1610     *     date &amp;time method is best matched to the Earth rotation angle
1611     *     algorithm used:  maximum precision is delivered when the uta
1612     *     argument is for 0hrs UT1 on the day in question and the utb
1613     *     argument lies in the range 0 to 1, or vice versa.
1614     *
1615     * <li> The arguments xp and yp are the coordinates (in radians) of the
1616     *     Celestial Intermediate Pole with respect to the International
1617     *     Terrestrial Reference System (see IERS Conventions 2003),
1618     *     measured along the meridians 0 and 90 deg west respectively.
1619     *
1620     * <li> The matrix rc2t transforms from celestial to terrestrial
1621     *     coordinates:
1622     *
1623     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1624     *
1625     *              = rc2t * [CRS]
1626     *
1627     *     where [CRS] is a vector in the Geocentric Celestial Reference
1628     *     System and [TRS] is a vector in the International Terrestrial
1629     *     Reference System (see IERS Conventions 2003), RC2I is the
1630     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1631     *     angle and RPOM is the polar motion matrix.
1632     *
1633     * <li> The present function is faster, but slightly less accurate (about
1634     *     1 mas), than the jauC2t00a function.
1635     *</ol>
1636     *<p>Called:<ul>
1637     *     <li>{@link #jauC2i00b} celestial-to-intermediate matrix, IAU 2000B
1638     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1639     *     <li>{@link #jauPom00} polar motion matrix
1640     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1641     * </ul>
1642     *<p>Reference:
1643     *
1644     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1645     *     IERS Technical Note No. 32, BKG (2004)
1646     *
1647     *@version 2009 April 1
1648     *
1649     *  @since Release 20101201
1650     *
1651     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1652     */
1653     public static double[][] jauC2t00b(final double tta, final double ttb, final double uta, final double utb,
1654                    final double xp, final double yp )
1655     {
1656        double rc2i[][], era, rpom[][];
1657        double rc2t[][];
1658 
1659     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */
1660        rc2i =jauC2i00b(tta, ttb);
1661 
1662     /* Predict the Earth rotation angle for this UT1. */
1663        era = jauEra00(uta, utb);
1664 
1665     /* Form the polar motion matrix (neglecting s'). */
1666        rpom = jauPom00(xp, yp, 0.0 );
1667 
1668     /* Combine to form the celestial-to-terrestrial matrix. */
1669        rc2t = jauC2tcio(rc2i, era, rpom );
1670 
1671        return rc2t;
1672 
1673         }
1674     
1675 
1676     /**
1677     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1678     *  the polar motion, using the IAU 2006/2000A precession-nutation
1679     *  nutation model.
1680     *
1681     *<p>This function is derived from the International Astronomical Union's
1682     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1683     *
1684     *<p>Status:  support function.
1685     *
1686     *<!-- Given: -->
1687     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1688     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1689     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1690     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1691     *     @param xp double          coordinates of the pole (radians, Note 2)
1692     *     @param yp double          coordinates of the pole (radians, Note 2) 
1693     *
1694     *<!-- Returned: -->
1695     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1696     *
1697     * <p>Notes:
1698     * <ol>
1699     *
1700     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1701     *     apportioned in any convenient way between the arguments uta and
1702     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1703     *     these ways, among others:
1704     *<pre>
1705     *             uta            utb
1706     *
1707     *         2450123.7           0.0       (JD method)
1708     *         2451545.0       -1421.3       (J2000 method)
1709     *         2400000.5       50123.2       (MJD method)
1710     *         2450123.5           0.2       (date &amp;time method)
1711     *</pre>
1712     *     The JD method is the most natural and convenient to use in
1713     *     cases where the loss of several decimal digits of resolution is
1714     *     acceptable.  The J2000 and MJD methods are good compromises
1715     *     between resolution and convenience.  In the case of uta,utb, the
1716     *     date &amp;time method is best matched to the Earth rotation angle
1717     *     algorithm used:  maximum precision is delivered when the uta
1718     *     argument is for 0hrs UT1 on the day in question and the utb
1719     *     argument lies in the range 0 to 1, or vice versa.
1720     *
1721     * <li> The arguments xp and yp are the coordinates (in radians) of the
1722     *     Celestial Intermediate Pole with respect to the International
1723     *     Terrestrial Reference System (see IERS Conventions 2003),
1724     *     measured along the meridians 0 and 90 deg west respectively.
1725     *
1726     * <li> The matrix rc2t transforms from celestial to terrestrial
1727     *     coordinates:
1728     *
1729     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1730     *
1731     *              = rc2t * [CRS]
1732     *
1733     *     where [CRS] is a vector in the Geocentric Celestial Reference
1734     *     System and [TRS] is a vector in the International Terrestrial
1735     *     Reference System (see IERS Conventions 2003), RC2I is the
1736     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1737     *     angle and RPOM is the polar motion matrix.
1738     *</ol>
1739     *<p>Called:<ul>
1740     *     <li>{@link #jauC2i06a} celestial-to-intermediate matrix, IAU 2006/2000A
1741     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1742     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1743     *     <li>{@link #jauPom00} polar motion matrix
1744     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1745     * </ul>
1746     *<p>Reference:
1747     *
1748     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1749     *     IERS Technical Note No. 32, BKG
1750     *
1751     *@version 2009 April 1
1752     *
1753     *  @since Release 20101201
1754     *
1755     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1756     */
1757     public static double[][] jauC2t06a(final double tta, final double ttb, final double uta, final double utb,
1758                   final double xp, final double yp)
1759     {
1760        double rc2i[][], era, sp, rpom[][], rc2t[][];
1761 
1762 
1763     /* Form the celestial-to-intermediate matrix for this TT. */
1764        rc2i = jauC2i06a(tta, ttb);
1765 
1766     /* Predict the Earth rotation angle for this UT1. */
1767        era = jauEra00(uta, utb);
1768 
1769     /* Estimate s'. */
1770        sp = jauSp00(tta, ttb);
1771 
1772     /* Form the polar motion matrix. */
1773        rpom = jauPom00(xp, yp, sp );
1774 
1775     /* Combine to form the celestial-to-terrestrial matrix. */
1776        rc2t = jauC2tcio(rc2i, era, rpom );
1777 
1778        return rc2t;
1779 
1780         }
1781     
1782 
1783     /**
1784     *  Assemble the celestial to terrestrial matrix from CIO-based
1785     *  components (the celestial-to-intermediate matrix, the Earth Rotation
1786     *  Angle and the polar motion matrix).
1787     *
1788     *<p>This function is derived from the International Astronomical Union's
1789     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1790     *
1791     *<p>Status:  support function.
1792     *
1793     *<!-- Given: -->
1794     *     @param rc2i      double[3][3]     celestial-to-intermediate matrix
1795     *     @param era       double           Earth rotation angle (radians)
1796     *     @param rpom      double[3][3]     polar-motion matrix
1797     *
1798     *<!-- Returned: -->
1799     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix
1800     *
1801     * <p>Notes:
1802     * <ol>
1803     *
1804     * <li> This function constructs the rotation matrix that transforms
1805     *     vectors in the celestial system into vectors in the terrestrial
1806     *     system.  It does so starting from precomputed components, namely
1807     *     the matrix which rotates from celestial coordinates to the
1808     *     intermediate frame, the Earth rotation angle and the polar motion
1809     *     matrix.  One use of the present function is when generating a
1810     *     series of celestial-to-terrestrial matrices where only the Earth
1811     *     Rotation Angle changes, avoiding the considerable overhead of
1812     *     recomputing the precession-nutation more often than necessary to
1813     *     achieve given accuracy objectives.
1814     *
1815     * <li> The relationship between the arguments is as follows:
1816     *
1817     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1818     *
1819     *              = rc2t * [CRS]
1820     *
1821     *     where [CRS] is a vector in the Geocentric Celestial Reference
1822     *     System and [TRS] is a vector in the International Terrestrial
1823     *     Reference System (see IERS Conventions 2003).
1824     *</ol>
1825     *<p>Called:<ul>
1826     *     <li>{@link #jauCr} copy r-matrix
1827     *     <li>{@link #jauRz} rotate around Z-axis
1828     *     <li>{@link #jauRxr} product of two r-matrices
1829     * </ul>
1830     *<p>Reference:
1831     *
1832     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1833     *     IERS Technical Note No. 32, BKG
1834     *
1835     *@version 2008 May 11
1836     *
1837     *  @since Release 20101201
1838     *
1839     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1840     */
1841     public static double[][] jauC2tcio(final double rc2i[][], final double era, final double rpom[][])
1842     {
1843        double r[][] = new double[3][3];
1844 
1845 
1846     /* Construct the matrix. */
1847        jauCr(rc2i, r);
1848        jauRz(era, r);
1849        double[][] rc2t = jauRxr(rpom, r);
1850 
1851        return rc2t;
1852 
1853         }
1854     
1855 
1856     /**
1857     *  Assemble the celestial to terrestrial matrix from equinox-based
1858     *  components (the celestial-to-true matrix, the Greenwich Apparent
1859     *  Sidereal Time and the polar motion matrix).
1860     *
1861     *<p>This function is derived from the International Astronomical Union's
1862     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1863     *
1864     *<p>Status:  support function.
1865     *
1866     *<!-- Given: -->
1867     *     @param rbpn      double[3][3]     celestial-to-true matrix
1868     *     @param gst       double           Greenwich (apparent) Sidereal Time (radians)
1869     *     @param rpom      double[3][3]     polar-motion matrix
1870     *
1871     *<!-- Returned: -->
1872     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix (Note 2)
1873     *
1874     * <p>Notes:
1875     * <ol>
1876     *
1877     * <li> This function constructs the rotation matrix that transforms
1878     *     vectors in the celestial system into vectors in the terrestrial
1879     *     system.  It does so starting from precomputed components, namely
1880     *     the matrix which rotates from celestial coordinates to the
1881     *     true equator and equinox of date, the Greenwich Apparent Sidereal
1882     *     Time and the polar motion matrix.  One use of the present function
1883     *     is when generating a series of celestial-to-terrestrial matrices
1884     *     where only the Sidereal Time changes, avoiding the considerable
1885     *     overhead of recomputing the precession-nutation more often than
1886     *     necessary to achieve given accuracy objectives.
1887     *
1888     * <li> The relationship between the arguments is as follows:
1889     *
1890     *        [TRS] = rpom * R_3(gst) * rbpn * [CRS]
1891     *
1892     *              = rc2t * [CRS]
1893     *
1894     *     where [CRS] is a vector in the Geocentric Celestial Reference
1895     *     System and [TRS] is a vector in the International Terrestrial
1896     *     Reference System (see IERS Conventions 2003).
1897     *</ol>
1898     *<p>Called:<ul>
1899     *     <li>{@link #jauCr} copy r-matrix
1900     *     <li>{@link #jauRz} rotate around Z-axis
1901     *     <li>{@link #jauRxr} product of two r-matrices
1902     * </ul>
1903     *<p>Reference:
1904     *
1905     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1906     *     IERS Technical Note No. 32, BKG (2004)
1907     *
1908     *@version 2008 May 11
1909     *
1910     *  @since Release 20101201
1911     *
1912     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1913     */
1914     public static double[][] jauC2teqx(final double rbpn[][], final double gst, final double rpom[][] )
1915     {
1916        double r[][] = new double[3][3], rc2t[][];
1917 
1918 
1919     /* Construct the matrix. */
1920        jauCr(rbpn, r);
1921        jauRz(gst, r);
1922        rc2t = jauRxr(rpom, r);
1923 
1924        return rc2t;
1925 
1926         }
1927     
1928 
1929     /**
1930     *  Form the celestial to terrestrial matrix given the date, the UT1,
1931     *  the nutation and the polar motion.  IAU 2000.
1932     *
1933     *<p>This function is derived from the International Astronomical Union's
1934     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1935     *
1936     *<p>Status:  support function.
1937     *
1938     *<!-- Given: -->
1939     *     @param tta double         TT as a 2-part Julian Date (Note 1)
1940     *     @param ttb double         TT as a 2-part Julian Date (Note 1) 
1941     *     @param uta double         UT1 as a 2-part Julian Date (Note 1)
1942     *     @param utb double         UT1 as a 2-part Julian Date (Note 1) 
1943     *     @param dpsi double         nutation (Note 2)
1944     *     @param deps double         nutation (Note 2) 
1945     *     @param xp double         coordinates of the pole (radians, Note 3)
1946     *     @param yp double         coordinates of the pole (radians, Note 3) 
1947     *
1948     *<!-- Returned: -->
1949     *     @return rc2t        double[3][3]    <u>returned</u> celestial-to-terrestrial matrix (Note 4)
1950     *
1951     * <p>Notes:
1952     * <ol>
1953     *
1954     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1955     *     apportioned in any convenient way between the arguments uta and
1956     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1957     *     these ways, among others:
1958     *<pre>
1959     *             uta            utb
1960     *
1961     *         2450123.7           0.0       (JD method)
1962     *         2451545.0       -1421.3       (J2000 method)
1963     *         2400000.5       50123.2       (MJD method)
1964     *         2450123.5           0.2       (date &amp;time method)
1965     *</pre>
1966     *     The JD method is the most natural and convenient to use in
1967     *     cases where the loss of several decimal digits of resolution is
1968     *     acceptable.  The J2000 and MJD methods are good compromises
1969     *     between resolution and convenience.  In the case of uta,utb, the
1970     *     date &amp;time method is best matched to the Earth rotation angle
1971     *     algorithm used:  maximum precision is delivered when the uta
1972     *     argument is for 0hrs UT1 on the day in question and the utb
1973     *     argument lies in the range 0 to 1, or vice versa.
1974     *
1975     * <li> The caller is responsible for providing the nutation components;
1976     *     they are in longitude and obliquity, in radians and are with
1977     *     respect to the equinox and ecliptic of date.  For high-accuracy
1978     *     applications, free core nutation should be included as well as
1979     *     any other relevant corrections to the position of the CIP.
1980     *
1981     * <li> The arguments xp and yp are the coordinates (in radians) of the
1982     *     Celestial Intermediate Pole with respect to the International
1983     *     Terrestrial Reference System (see IERS Conventions 2003),
1984     *     measured along the meridians 0 and 90 deg west respectively.
1985     *
1986     * <li> The matrix rc2t transforms from celestial to terrestrial
1987     *     coordinates:
1988     *
1989     *        [TRS] = RPOM * R_3(GST) * RBPN * [CRS]
1990     *
1991     *              = rc2t * [CRS]
1992     *
1993     *     where [CRS] is a vector in the Geocentric Celestial Reference
1994     *     System and [TRS] is a vector in the International Terrestrial
1995     *     Reference System (see IERS Conventions 2003), RBPN is the
1996     *     bias-precession-nutation matrix, GST is the Greenwich (apparent)
1997     *     Sidereal Time and RPOM is the polar motion matrix.
1998     *
1999     * <li> Although its name does not include "00", This function is in fact
2000     *     specific to the IAU 2000 models.
2001     *</ol>
2002     *<p>Called:<ul>
2003     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
2004     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
2005     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
2006     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
2007     *     <li>{@link #jauPom00} polar motion matrix
2008     *     <li>{@link #jauC2teqx} form equinox-based celestial-to-terrestrial matrix
2009     * </ul>
2010     *<p>Reference:
2011     *
2012     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
2013     *     IERS Technical Note No. 32, BKG (2004)
2014     *
2015     *@version 2009 April 1
2016     *
2017     *  @since Release 20101201
2018     *
2019     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2020     */
2021     public static double[][] jauC2tpe(final double tta, final double ttb, final double uta, final double utb,
2022             final double dpsi, final double deps, final double xp, final double yp)
2023     {
2024        double rpom[][]; 
2025 
2026     /* Form the celestial-to-true matrix for this TT. */
2027        PrecessionNutation pn = jauPn00(tta, ttb, dpsi, deps);
2028 
2029     /* Predict the Greenwich Mean Sidereal Time for this UT1 and TT. */
2030        double gmst = jauGmst00(uta, utb, tta, ttb);
2031 
2032     /* Predict the equation of the equinoxes given TT and nutation. */
2033        double ee = jauEe00(tta, ttb, pn.epsa, dpsi);
2034 
2035     /* Estimate s'. */
2036        double sp = jauSp00(tta, ttb);
2037 
2038     /* Form the polar motion matrix. */
2039        rpom = jauPom00(xp, yp, sp);
2040 
2041     /* Combine to form the celestial-to-terrestrial matrix. */
2042        double[][] rc2t = jauC2teqx(pn.rbpn, gmst + ee, rpom );
2043 
2044        return rc2t;
2045 
2046         }
2047     
2048 
2049     /**
2050     *  Form the celestial to terrestrial matrix given the date, the UT1,
2051     *  the CIP coordinates and the polar motion.  IAU 2000.
2052     *
2053     *<p>This function is derived from the International Astronomical Union's
2054     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2055     *
2056     *<p>Status:  support function.
2057     *
2058     *<!-- Given: -->
2059     *     @param tta double          TT as a 2-part Julian Date (Note 1)
2060     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
2061     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
2062     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
2063     *     @param x double          Celestial Intermediate Pole (Note 2)
2064     *     @param y double          Celestial Intermediate Pole (Note 2) 
2065     *     @param xp double          coordinates of the pole (radians, Note 3)
2066     *     @param yp double          coordinates of the pole (radians, Note 3) 
2067     *
2068     *<!-- Returned: -->
2069     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 4)
2070     *
2071     * <p>Notes:
2072     * <ol>
2073     *
2074     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
2075     *     apportioned in any convenient way between the arguments uta and
2076     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any o
2077     *     these ways, among others:
2078     *<pre>
2079     *             uta            utb
2080     *
2081     *         2450123.7           0.0       (JD method)
2082     *         2451545.0       -1421.3       (J2000 method)
2083     *         2400000.5       50123.2       (MJD method)
2084     *         2450123.5           0.2       (date &amp;time method)
2085     *</pre>
2086     *     The JD method is the most natural and convenient to use in
2087     *     cases where the loss of several decimal digits of resolution is
2088     *     acceptable.  The J2000 and MJD methods are good compromises
2089     *     between resolution and convenience.  In the case of uta,utb, the
2090     *     date &amp;time method is best matched to the Earth rotation angle
2091     *     algorithm used:  maximum precision is delivered when the uta
2092     *     argument is for 0hrs UT1 on the day in question and the utb
2093     *     argument lies in the range 0 to 1, or vice versa.
2094     *
2095     * <li> The Celestial Intermediate Pole coordinates are the x,y
2096     *     components of the unit vector in the Geocentric Celestial
2097     *     Reference System.
2098     *
2099     * <li> The arguments xp and yp are the coordinates (in radians) of the
2100     *     Celestial Intermediate Pole with respect to the International
2101     *     Terrestrial Reference System (see IERS Conventions 2003),
2102     *     measured along the meridians 0 and 90 deg west respectively.
2103     *
2104     * <li> The matrix rc2t transforms from celestial to terrestrial
2105     *     coordinates:
2106     *
2107     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
2108     *
2109     *              = rc2t * [CRS]
2110     *
2111     *     where [CRS] is a vector in the Geocentric Celestial Reference
2112     *     System and [TRS] is a vector in the International Terrestrial
2113     *     Reference System (see IERS Conventions 2003), ERA is the Earth
2114     *     Rotation Angle and RPOM is the polar motion matrix.
2115     *
2116     * <li> Although its name does not include "00", This function is in fact
2117     *     specific to the IAU 2000 models.
2118     *</ol>
2119     *<p>Called:<ul>
2120     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
2121     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
2122     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
2123     *     <li>{@link #jauPom00} polar motion matrix
2124     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
2125     * </ul>
2126     * Reference:
2127     *
2128     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
2129     *     IERS Technical Note No. 32, BKG (2004)
2130     *
2131     *@version 2009 April 1
2132     *
2133     *  @since Release 20101201
2134     *
2135     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2136     */
2137     public static double[][] jauC2txy(double tta, double ttb, double uta, double utb,
2138                   double x, double y, double xp, double yp)
2139     {
2140        double rc2i[][] = new double[3][3], era, sp, rpom[][] = new double[3][3];
2141 
2142 
2143     /* Form the celestial-to-intermediate matrix for this TT. */
2144        rc2i = jauC2ixy(tta, ttb, x, y);
2145 
2146     /* Predict the Earth rotation angle for this UT1. */
2147        era = jauEra00(uta, utb);
2148 
2149     /* Estimate s'. */
2150        sp = jauSp00(tta, ttb);
2151 
2152     /* Form the polar motion matrix. */
2153        rpom = jauPom00(xp, yp, sp);
2154 
2155     /* Combine to form the celestial-to-terrestrial matrix. */
2156        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
2157 
2158        return rc2t;
2159 
2160         }
2161     
2162     /**
2163     *  Gregorian Calendar to Julian Date.
2164     *
2165     *<p>This function is derived from the International Astronomical Union's
2166     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2167     *
2168     *<p>Status:  support function.
2169     *
2170     *<!-- Given: -->
2171     *     @param iy  int      year in Gregorian calendar (Note 1)
2172     *     @param im  int      month in Gregorian calendar (Note 1)
2173     *     @param id   int     day in Gregorian calendar (Note 1)
2174     *
2175     *<!-- Returned: -->
2176     *     @return d MJD zero-point: always 2400000.5
2177     *       <u>returned</u> Modified Julian Date for 0 hrs
2178     *
2179     * <!-- Returned (function value): -->
2180     *  @throws JSOFAIllegalParameter      status:
2181     *                           0 = OK
2182     *                          -1 = bad year   (Note 3: JD not computed)
2183     *                          -2 = bad month  (JD not computed)
2184     *                          -3 = bad day    (JD computed)
2185     *
2186     * <p>Notes:
2187     * <ol>
2188     *
2189     * <li> The algorithm used is valid from -4800 March 1, but this
2190     *     implementation rejects dates before -4799 January 1.
2191     *
2192     * <li> The Julian Date is returned in two pieces, in the usual JSOFA
2193     *     manner, which is designed to preserve time resolution.  The
2194     *     Julian Date is available as a single number by adding djm0 and
2195     *     djm.
2196     *
2197     * <li> In early eras the conversion is from the "Proleptic Gregorian
2198     *     Calendar";  no account is taken of the date(s) of adoption of
2199     *     the Gregorian Calendar, nor is the AD/BC numbering convention
2200     *     observed.
2201     *</ol>
2202     *<p>Reference:
2203     *
2204     *     <p>Explanatory Supplement to the Astronomical Almanac,
2205     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
2206     *     Section 12.92 (p604).
2207     *
2208     *@version 2009 October 19
2209     *
2210     *  @since Release 20101201
2211     *
2212     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2213     */
2214     public static JulianDate jauCal2jd(int iy, int im, int id) throws JSOFAIllegalParameter
2215     {
2216        int ly, my;
2217        long iypmy;
2218        double djm0, djm;
2219 
2220     /* Earliest year allowed (4800BC) */
2221        final int IYMIN = -4799;
2222 
2223     /* Month lengths in days */
2224        final int mtab[]
2225                          = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
2226 
2227 
2228     /* Validate year and month. */
2229        if (iy < IYMIN) throw new JSOFAIllegalParameter("bad year", -1);
2230        if (im < 1 || im > 12) throw new JSOFAIllegalParameter("bad month", -2);
2231 
2232     /* If February in a leap year, 1, otherwise 0. */
2233        ly = ((im == 2) &&(iy%4 == 0) && (iy%100 != 0 || (iy%400 == 0)))?1:0;
2234 
2235     /* Validate day, taking into account leap years. */
2236        if ( (id < 1) || (id > (mtab[im-1] + ly))) {
2237     }
2238 
2239     /* Return result. */
2240        my = (im - 14) / 12;
2241        iypmy = (long) (iy + my);
2242        djm0 = DJM0;
2243        djm = (double)((1461L * (iypmy + 4800L)) / 4L
2244                      + (367L * (long) (im - 2 - 12 * my)) / 12L
2245                      - (3L * ((iypmy + 4900L) / 100L)) / 4L
2246                      + (long) id - 2432076L);
2247 
2248     /* Return status. */
2249        return new JulianDate(djm0, djm);
2250 
2251         }
2252     
2253 
2254     /**
2255     *  Copy a p-vector.
2256     *
2257     *<p>This function is derived from the International Astronomical Union's
2258     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2259     *
2260     *<p>Status:  vector/matrix support function.
2261     *
2262     *<!-- Given: -->
2263     *     @param p         double[3]      p-vector to be copied
2264     *
2265     *<!-- Returned: -->
2266     *     @param c         double[3]       <u>given and returned</u> copy
2267     *     @return  double[3]       <u>given and returned</u> copy
2268     *
2269     *@version 2008 May 11
2270     *
2271     *  @since Release 20101201
2272     *
2273     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2274     */
2275     public static double[] jauCp(double p[], double c[])
2276     {
2277        
2278        c[0] = p[0];
2279        c[1] = p[1];
2280        c[2] = p[2];
2281 
2282        return c;
2283 
2284     }
2285     
2286 
2287     /**
2288     *  Copy a position/velocity vector.
2289     *
2290     *<p>This function is derived from the International Astronomical Union's
2291     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2292     *
2293     *<p>Status:  vector/matrix support function.
2294     *
2295     *<!-- Given: -->
2296     *     @param pv      double[2][3]     position/velocity vector to be copied
2297     *     @param c       double[2][3]      <u>returned</u> copy
2298     *
2299     *<!-- Returned: -->
2300     *     @return        double[2][3]      <u>returned c</u> copy
2301     *
2302     *<p>Called:<ul>
2303     *     <li>{@link #jauCp} copy p-vector
2304     * </ul>
2305     *@version 2008 May 11
2306     *
2307     *  @since Release 20101201
2308     *
2309     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2310     */
2311     public static double[][] jauCpv(double pv[][],  double c[][])
2312     {
2313 
2314         c[0]=jauCp(pv[0], c[0]);
2315         c[1]=jauCp(pv[1], c[1]);
2316 
2317        return c;
2318 
2319         }
2320     
2321 
2322     /**
2323     *  Copy an r-matrix.
2324     *
2325     *<p>This function is derived from the International Astronomical Union's
2326     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2327     *
2328     *<p>Status:  vector/matrix support function.
2329     *
2330     *<!-- Given: -->
2331     *     @param r         double[3][3]     r-matrix to be copied.
2332     *
2333     *<!-- Returned: -->
2334     *   @param c      double[3][3]      <u>given and returned</u> the elements of r are copied into this.
2335     *
2336     *<p>Called:<ul>
2337     *     <li>{@link #jauCp} copy p-vector
2338     * </ul>
2339     *@version 2008 May 11
2340     *
2341     *  @since Release 20101201
2342     *
2343     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2344     */
2345     public static void jauCr(double r[][], double c[][] )
2346     {
2347 
2348        jauCp(r[0], c[0]);
2349        jauCp(r[1], c[1]);
2350        jauCp(r[2], c[2]);
2351 
2352        return;
2353 
2354         }
2355     
2356 
2357     /**
2358     *  Decompose days to hours, minutes, seconds, fraction.
2359     *
2360     *<p>This function is derived from the International Astronomical Union's
2361     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2362     *
2363     *<p>Status:  vector/matrix support function.
2364     *
2365     *<!-- Given: -->
2366     *     @param ndp      int      resolution (Note 1)
2367     *     @param days     double   interval in days
2368     *
2369     *<!-- Returned: -->
2370     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
2371     *     @return sign     char      <u>returned</u> '+' or '-'
2372     *
2373     * <p>Notes:
2374     * <ol>
2375     *
2376     * <li> The argument ndp is interpreted as follows:
2377     *
2378     *     ndp         resolution
2379     *      :      ...0000 00 00
2380     *     -7         1000 00 00
2381     *     -6          100 00 00
2382     *     -5           10 00 00
2383     *     -4            1 00 00
2384     *     -3            0 10 00
2385     *     -2            0 01 00
2386     *     -1            0 00 10
2387     *      0            0 00 01
2388     *      1            0 00 00.1
2389     *      2            0 00 00.01
2390     *      3            0 00 00.001
2391     *      :            0 00 00.000...
2392     *
2393     * <li> The largest positive useful value for ndp is determined by the
2394     *     size of days, the format of double on the target platform, and
2395     *     the risk of overflowing ihmsf[3].  On a typical platform, for
2396     *     days up to 1.0, the available floating-point precision might
2397     *     correspond to ndp=12.  However, the practical limit is typically
2398     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
2399     *     only 16 bits.
2400     *
2401     * <li> The absolute value of days may exceed 1.0.  In cases where it
2402     *     does not, it is up to the caller to test for and handle the
2403     *     case where days is very nearly 1.0 and rounds up to 24 hours,
2404     *     by testing for ihms[0]=24 and setting ihmsf[0-3] to zero.
2405     *</ol>
2406     *@version 2008 May 11
2407     *
2408     *  @since Release 20101201
2409     *
2410     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2411     */
2412    public static char jauD2tf(final int ndp, final double days, int ihmsf[])
2413     {
2414        int nrs, n;
2415        double rs, rm, rh, a, w, ah, am, as, af;
2416 
2417 
2418     /* Handle sign. */
2419       char sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
2420 
2421     /* Interval in seconds. */
2422        a = DAYSEC * abs(days);
2423 
2424     /* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
2425        if (ndp < 0) {
2426           nrs = 1;
2427           for (n = 1; n <= -ndp; n++) {
2428               nrs *= (n == 2 || n == 4) ? 6 : 10;
2429           }
2430           rs = (double) nrs;
2431           w = a / rs;
2432           a = rs * dnint(w);
2433        }
2434 
2435     /* Express the unit of each field in resolution units. */
2436        nrs = 1;
2437        for (n = 1; n <= ndp; n++) {
2438           nrs *= 10;
2439        }
2440        rs = (double) nrs;
2441        rm = rs * 60.0;
2442        rh = rm * 60.0;
2443 
2444     /* Round the interval and express in resolution units. */
2445        a = dnint(rs * a);
2446 
2447     /* Break into fields. */
2448        ah = a / rh;
2449        ah = dint(ah);
2450        a -= ah * rh;
2451        am = a / rm;
2452        am = dint(am);
2453        a -= am * rm;
2454        as = a / rs;
2455        as = dint(as);
2456        af = a - as * rs;
2457 
2458     /* Return results. */
2459        ihmsf[0] = (int) ah;
2460        ihmsf[1] = (int) am;
2461        ihmsf[2] = (int) as;
2462        ihmsf[3] = (int) af;
2463 
2464        return sign;
2465 
2466         }
2467  
2468    /**
2469     * Representation of Gregorian Calendar with fractional day.
2470     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2471     * 
2472     * @since AIDA Stage 1
2473     */
2474    public static class Calendar {
2475        public final int iy;
2476        public final int im;
2477        public final int id;
2478        public final double fd;
2479        public Calendar (int iy, int im, int id, double fd)
2480        {
2481            this.iy = iy;
2482            this.im = im;
2483            this.id = id;
2484            this.fd = fd;
2485        }
2486    }
2487 
2488    /**
2489     * Representation of Gregorian Calendar with integer hours minutes and seconds.
2490     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2491     * 
2492     * @since AIDA Stage 1
2493     */
2494    public static class CalendarHMS {
2495        public final int iy;
2496        public final int im;
2497        public final int id;
2498        public final int ihmsf[];
2499        public CalendarHMS (int iy, int im, int id, int hmsf[]){
2500            this.iy = iy;
2501            this.im = im;
2502            this.id = id;
2503            this.ihmsf = hmsf;
2504        }
2505    }
2506    
2507 /**
2508 *
2509 *  Format for output a 2-part Julian Date (or in the case of UTC a
2510 *  quasi-JD form that includes special provision for leap seconds).
2511 *
2512 *<p>This function is derived from the International Astronomical Union's
2513 *  SOFA (Standards of Fundamental Astronomy) software collection.
2514 *
2515 *<p>Status:  support function.
2516 *
2517 *<!-- Given: -->
2518 *     @param scale     char[]  time scale ID (Note 1)
2519 *     @param ndp       int     resolution (Note 2)
2520 *     @param d1     double  time as a 2-part Julian Date (Notes 3,4)
2521 *     @param d2     double  time as a 2-part Julian Date (Notes 3,4)
2522 *
2523 *<!-- Returned:-->
2524 *   @return the date as a Gregorian calendar
2525 *     iy,im,id  int     year, month, day in Gregorian calendar (Note 5)
2526 *     ihmsf     int[4]  hours, minutes, seconds, fraction (Note 1)
2527 *
2528 *  Returned (function value):
2529 *               int     status: +1 = dubious year (Note 5)
2530 *                                0 = OK
2531 *                               -1 = unacceptable date (Note 6)
2532 *
2533 *<p>Notes:
2534 *<ol>
2535 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2536 *     case) is significant, and enables handling of leap seconds (see
2537 *     Note 4).
2538 *
2539 * <li> ndp is the number of decimal places in the seconds field, and can
2540 *     have negative as well as positive values, such as:
2541 *
2542 *     ndp         resolution
2543 *     -4            1 00 00
2544 *     -3            0 10 00
2545 *     -2            0 01 00
2546 *     -1            0 00 10
2547 *      0            0 00 01
2548 *      1            0 00 00.1
2549 *      2            0 00 00.01
2550 *      3            0 00 00.001
2551 *
2552 *     The limits are platform dependent, but a safe range is -5 to +9.
2553 *
2554 * <li> d1+d2 is Julian Date, apportioned in any convenient way between
2555 *     the two arguments, for example where d1 is the Julian Day Number
2556 *     and d2 is the fraction of a day.  In the case of UTC, where the
2557 *     use of JD is problematical, special conventions apply:  see the
2558 *     next note.
2559 *
2560 * <li> JD cannot unambiguously represent UTC during a leap second unless
2561 *     special measures are taken.  The SOFA internal convention is that
2562 *     the quasi-JD day represents UTC days whether the length is 86399,
2563 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2564 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2565 *     expression was changed, and these "mini-leaps" are also included
2566 *     in the SOFA convention.
2567 *
2568 * <li> The warning status "dubious year" flags UTCs that predate the
2569 *     introduction of the time scale or that are too far in the future
2570 *     to be trusted.  See iauDat for further details.
2571 *
2572 * <li> For calendar conventions and limitations, see iauCal2jd.
2573 *</ol>
2574 *  Called:
2575 *     iauJd2cal    JD to Gregorian calendar
2576 *     iauD2tf      decompose days to hms
2577 *     iauDat       delta(AT) = TAI-UTC
2578 *
2579 *@version 2014 February 15
2580 *
2581 *@since JSOFA release 20131202
2582 *
2583 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2584  * @throws JSOFAInternalError an internal error has occured
2585  * @throws JSOFAIllegalParameter unacceptable date (notes 5,6)
2586 */
2587 public static CalendarHMS jauD2dtf(final String scale, int ndp, double d1, double d2 ) throws JSOFAIllegalParameter, JSOFAInternalError
2588 {
2589  boolean leap;
2590  int iy1, im1, id1, iy2, im2, id2, ihmsf1[] = new int[4];
2591  double a1, b1, fd, dat0, dat12, dat24, dleap;
2592 
2593 
2594 /* The two-part JD. */
2595  a1 = d1;
2596  b1 = d2;
2597 
2598 /* Provisional calendar date. */
2599  Calendar cal = jauJd2cal(a1, b1);
2600  iy1 = cal.iy;
2601  im1 = cal.im;
2602  id1 = cal.id;
2603  fd = cal.fd;
2604 
2605 /* Is this a leap second day? */
2606  leap = false;
2607  if ( scale.equalsIgnoreCase("UTC") ) {
2608 
2609  /* TAI-UTC at 0h today. */
2610      dat0 = jauDat(iy1, im1, id1, 0.0 );
2611 
2612  /* TAI-UTC at 12h today (to detect drift). */
2613      dat12 = jauDat(iy1, im1, id1, 0.5);
2614 
2615  /* TAI-UTC at 0h tomorrow (to detect jumps). */
2616     cal = jauJd2cal(a1+1.5, b1-fd);
2617     iy2 = cal.iy;
2618     im2 = cal.im;
2619     id2 = cal.id;
2620     dat24 = jauDat(iy2, im2, id2, 0.0);
2621 
2622  /* Any sudden change in TAI-UTC (seconds). */
2623     dleap = dat24 - (2.0*dat12 - dat0);
2624 
2625  /* If leap second day, scale the fraction of a day into SI. */
2626     leap = (abs(dleap) > 0.5);
2627     if (leap) fd += fd * dleap/DAYSEC;
2628  }
2629 
2630 jauD2tf ( ndp, fd, ihmsf1 );
2631 
2632 /* Has the (rounded) time gone past 24h? */
2633  if ( ihmsf1[0] > 23 ) {
2634 
2635  /* Yes.  We probably need tomorrow's calendar date. */
2636     cal = jauJd2cal(a1+1.5, b1-fd);
2637     iy2 = cal.iy; im2 = cal.im; id2 = cal.id; 
2638     
2639  /* Is today a leap second day? */
2640     if ( ! leap ) {
2641 
2642     /* No.  Use 0h tomorrow. */
2643        iy1 = iy2;
2644        im1 = im2;
2645        id1 = id2;
2646        ihmsf1[0] = 0;
2647        ihmsf1[1] = 0;
2648        ihmsf1[2] = 0;
2649 
2650     } else {
2651 
2652     /* Yes.  Are we past the leap second itself? */
2653        if ( ihmsf1[2] > 0 ) {
2654 
2655        /* Yes.  Use tomorrow but allow for the leap second. */
2656           iy1 = iy2;
2657           im1 = im2;
2658           id1 = id2;
2659           ihmsf1[0] = 0;
2660           ihmsf1[1] = 0;
2661           ihmsf1[2] = 0;
2662 
2663        } else {
2664 
2665        /* No.  Use 23 59 60... today. */
2666           ihmsf1[0] = 23;
2667           ihmsf1[1] = 59;
2668           ihmsf1[2] = 60;
2669        }
2670 
2671     /* If rounding to 10s or coarser always go up to new day. */
2672        if ( ndp < 0 && ihmsf1[2] == 60 ) {
2673           iy1 = iy2;
2674           im1 = im2;
2675           id1 = id2;
2676           ihmsf1[0] = 0;
2677           ihmsf1[1] = 0;
2678           ihmsf1[2] = 0;
2679        }
2680     }
2681  }
2682 
2683 /* Results. */
2684  
2685  return new CalendarHMS(iy1, im1, id1, ihmsf1);
2686 
2687 }   
2688 
2689 /**
2690 *  Encode date and time fields into 2-part Julian Date (or in the case
2691 *  of UTC a quasi-JD form that includes special provision for leap
2692 *  seconds).
2693 *
2694 *<p>This function is derived from the International Astronomical Union's
2695 *  SOFA (Standards of Fundamental Astronomy) software collection.
2696 *
2697 *  <p>Status:  support function.
2698 *
2699 * <!-- Given: -->
2700 *    @param scale     char  time scale ID (Note 1)
2701 *    @param iy  int     year in Gregorian calendar (Note 2)
2702 *    @param im   int    month in Gregorian calendar (Note 2)
2703 *    @param id  int      day in Gregorian calendar (Note 2)
2704 *    @param ihr  int     hour
2705 *    @param imn   int    minute
2706 *    @param sec       double  seconds
2707 *
2708 * <!-- Returned: -->
2709 *     @return     2-part Julian Date (Notes 3,4)
2710 *
2711 * @throws JSOFAIllegalParameter bad year
2712 * 
2713 * @throws JSOFAInternalError          {@code    status: +3 = both of next two
2714 *                               +2 = time is after end of day (Note 5)
2715 *                               +1 = dubious year (Note 6)
2716 *                                0 = OK
2717 *                               -1 = bad year
2718 *                               -2 = bad month
2719 *                               -3 = bad day
2720 *                               -4 = bad hour
2721 *                               -5 = bad minute
2722 *                               -6 = bad second (<0)}
2723 *
2724 *<p>Notes:
2725 *<ol>
2726 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2727 *     case) is significant, and enables handling of leap seconds (see
2728 *     Note 4).
2729 *
2730 * <li> For calendar conventions and limitations, see iauCal2jd.
2731 *
2732 * <li> The sum of the results, d1+d2, is Julian Date, where normally d1
2733 *     is the Julian Day Number and d2 is the fraction of a day.  In the
2734 *     case of UTC, where the use of JD is problematical, special
2735 *     conventions apply:  see the next note.
2736 *
2737 * <li> JD cannot unambiguously represent UTC during a leap second unless
2738 *     special measures are taken.  The SOFA internal convention is that
2739 *     the quasi-JD day represents UTC days whether the length is 86399,
2740 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2741 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2742 *     expression was changed, and these "mini-leaps" are also included
2743 *     in the SOFA convention.
2744 *
2745 * <li> The warning status "time is after end of day" usually means that
2746 *     the sec argument is greater than 60.0.  However, in a day ending
2747 *     in a leap second the limit changes to 61.0 (or 59.0 in the case
2748 *     of a negative leap second).
2749 *
2750 * <li> The warning status "dubious year" flags UTCs that predate the
2751 *     introduction of the time scale or that are too far in the future
2752 *     to be trusted.  See iauDat for further details.
2753 *
2754 * <li> Only in the case of continuous and regular time scales (TAI, TT,
2755 *     TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly
2756 *     speaking.  In the other cases (UT1 and UTC) the result must be
2757 *     used with circumspection;  in particular the difference between
2758 *     two such results cannot be interpreted as a precise time
2759 *     interval.
2760 *</ol>
2761 *  Called:
2762 *     iauCal2jd    Gregorian calendar to JD
2763 *     iauDat       delta(AT) = TAI-UTC
2764 *     iauJd2cal    JD to Gregorian calendar
2765 *
2766 *@version 2013 July 26
2767 *
2768 *@since JSOFA release 20131202
2769 *
2770 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2771 */
2772 public static JulianDate jauDtf2d(final String scale, int iy, int im, int id,
2773         int ihr, int imn, double sec) throws JSOFAIllegalParameter, JSOFAInternalError
2774 {
2775 int js = 0, iy2, im2, id2;
2776 double dj, w, day, seclim, dat0, dat12, dat24, dleap, time;
2777 
2778 
2779 /* Today's Julian Day Number. */
2780 JulianDate jd = jauCal2jd(iy, im, id);
2781 dj = jd.djm0; w = jd.djm1;
2782 dj += w;
2783 
2784 /* Day length and final minute length in seconds (provisional). */
2785 day = DAYSEC;
2786 seclim = 60.0;
2787 
2788 /* Deal with the UTC leap second case. */
2789 if (  scale.equals("UTC") ) {
2790 
2791 /* TAI-UTC at 0h today. */
2792     dat0 = jauDat(iy, im, id, 0.0);
2793 
2794 /* TAI-UTC at 12h today (to detect drift). */
2795     dat12 = jauDat(iy, im, id, 0.5);
2796 
2797 /* TAI-UTC at 0h tomorrow (to detect jumps). */
2798  Calendar cal = jauJd2cal ( dj, 1.5);
2799  iy2 = cal.iy; im2 = cal.im; id2 = cal.id; w = cal.fd;
2800  
2801  dat24 = jauDat(iy2, im2, id2, 0.0);
2802 
2803 /* Any sudden change in TAI-UTC between today and tomorrow. */
2804  dleap = dat24 - (2.0*dat12 - dat0);
2805 
2806 /* If leap second day, correct the day and final minute lengths. */
2807  day += dleap;
2808  if ( ihr == 23 && imn == 59 ) seclim += dleap;
2809 
2810 /* End of UTC-specific actions. */
2811 }
2812 
2813 /* Validate the time. */
2814 if ( ihr >= 0 && ihr <= 23 ) {
2815  if ( imn >= 0 && imn <= 59 ) {
2816     if ( sec >= 0 ) {
2817        if ( sec >= seclim ) {
2818           js += 2;
2819        }
2820     } else {
2821        js = -6;
2822     }
2823  } else {
2824     js = -5;
2825  }
2826 } else {
2827  js = -4;
2828 }
2829 if ( js < 0 ) throw new JSOFAInternalError("problem with time", js);
2830 
2831 /* The time in days. */
2832 time  = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day;
2833 
2834 /* Return the date and time. */
2835 return new JulianDate(dj, time) ;
2836 
2837 }
2838 
2839 /**
2840  * the date of the last leap second. Note that this is not a SOFA standard fumction.
2841  * @return the {@link JulianDate} of the last leap second.
2842  */
2843 public static JulianDate lastLeapSecondDate()
2844 {
2845     final LeapInfo lastentry = leapSeconds[leapSeconds.length -1];
2846     JulianDate retval = new JulianDate(0, 0);
2847     try {
2848         retval = jauCal2jd(lastentry.iyear,lastentry.month,1);
2849     } catch (JSOFAIllegalParameter e) {
2850         //should not happen
2851          e.printStackTrace();
2852     }
2853     return retval;
2854     
2855 }
2856  
2857 
2858     /**
2859     *  For a given UTC date, calculate delta(AT) = TAI-UTC.
2860     *<pre>
2861     *     :------------------------------------------:
2862     *     :                                          :
2863     *     :                 IMPORTANT                :
2864     *     :                                          :
2865     *     :  A new version of this function must be  :
2866     *     :  produced whenever a new leap second is  :
2867     *     :  announced.  There are four items to     :
2868     *     :  change on each such occasion:           :
2869     *     :                                          :
2870     *     :  1) A new line must be added to the set  :
2871     *     :     of statements that initialize the    :
2872     *     :     array "changes".                     :
2873     *     :                                          :
2874     *     :  2) The parameter IYV must be set to     :
2875     *     :     the current year.                    :
2876     *     :                                          :
2877     *     :  3) The "Latest leap second" comment     :
2878     *     :     below must be set to the new leap    :
2879     *     :     second date.                         :
2880     *     :                                          :
2881     *     :  4) The "This revision" comment, later,  :
2882     *     :     must be set to the current date.     :
2883     *     :                                          :
2884     *     :  Change (2) must also be carried out     :
2885     *     :  whenever the function is re-issued,     :
2886     *     :  even if no leap seconds have been       :
2887     *     :  added.                                  :
2888     *     :                                          :
2889     *     :  Latest leap second:  2017 Jan 01        :
2890     *     :                                          :
2891     *     :__________________________________________:
2892     *</pre>
2893     *<p>This function is derived from the International Astronomical Union's
2894     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2895     *
2896     *<p>Status:  support function.
2897     *
2898     *<!-- Given: -->
2899     *     @param iy      int       UTC:  year (Notes 1 and 2)
2900     *     @param im      int             month (Note 2)
2901     *     @param id      int             day (Notes 2 and 3)
2902     *     @param fd      double          fraction of day (Note 4)
2903     *
2904     *<!-- Returned: -->
2905     *     @return deltat  double     <u>returned</u> TAI minus UTC, seconds
2906     *
2907     *  @throws     JSOFAIllegalParameter   status (Note 5):
2908     *                       1 = dubious year (Note 1)
2909     *                       0 = OK
2910     *                      -1 = bad year
2911     *                      -2 = bad month
2912     *                      -3 = bad day (Note 3)
2913     *                      -4 = bad fraction (Note 4)
2914     *                      
2915     * @throws JSOFAInternalError
2916     *
2917     * <p>Notes:
2918     * <ol>
2919     *
2920     * <li> UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
2921     *     to call the function with an earlier date.  If this is attempted,
2922     *     zero is returned together with a warning status.
2923     *
2924     *     Because leap seconds cannot, in principle, be predicted in
2925     *     advance, a reliable check for dates beyond the valid range is
2926     *     impossible.  To guard against gross errors, a year five or more
2927     *     after the release year of the present function (see parameter
2928     *     IYV) is considered dubious.  In this case a warning status is
2929     *     returned but the result is computed in the normal way.
2930     *
2931     *     For both too-early and too-late years, the warning status is
2932     *     j=+1.  This is distinct from the error status j=-1, which
2933     *     signifies a year so early that JD could not be computed.
2934     *
2935     * <li> If the specified date is for a day which ends with a leap second,
2936     *     the TAI-UTC value returned is for the period leading up to the
2937     *     leap second.  If the date is for a day which begins as a leap
2938     *     second ends, the TAI-UTC returned is for the period following the
2939     *     leap second.
2940     *
2941     * <li> The day number must be in the normal calendar range, for example
2942     *     1 through 30 for April.  The "almanac" convention of allowing
2943     *     such dates as January 0 and December 32 is not supported in this
2944     *     function, in order to avoid confusion near leap seconds.
2945     *
2946     * <li> The fraction of day is used only for dates before the
2947     *     introduction of leap seconds, the first of which occurred at the
2948     *     end of 1971.  It is tested for validity (zero to less than 1 is
2949     *     the valid range) even if not used;  if invalid, zero is used and
2950     *     status j=-4 is returned.  For many applications, setting fd to
2951     *     zero is acceptable;  the resulting error is always less than 3 ms
2952     *     (and occurs only pre-1972).
2953     *
2954     * <li> The status value returned in the case where there are multiple
2955     *     errors refers to the first error detected.  For example, if the
2956     *     month and day are 13 and 32 respectively, j=-2 (bad month)
2957     *     will be returned.
2958     *
2959     * <li> In cases where a valid result is not available, zero is returned.
2960     *
2961     *<p>References:
2962     *
2963     * <li> For dates from 1961 January 1 onwards, the expressions from the
2964     *     file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
2965     *
2966     * <li> The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of
2967     *     the 1992 Explanatory Supplement.
2968     *</ol>
2969     *<p>Called:<ul>
2970     *     <li>{@link #jauCal2jd} Gregorian calendar to Julian Day number
2971     * </ul>
2972     *<p>@version 20160729
2973     *
2974     *  @since Release 20101201
2975     *
2976     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2977     */
2978     public static double jauDat(int iy, int im, int id, double fd ) throws JSOFAIllegalParameter, JSOFAInternalError
2979     {
2980 
2981     /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
2982       final double drift[][] = {
2983           { 37300.0, 0.0012960 },
2984           { 37300.0, 0.0012960 },
2985           { 37300.0, 0.0012960 },
2986           { 37665.0, 0.0011232 },
2987           { 37665.0, 0.0011232 },
2988           { 38761.0, 0.0012960 },
2989           { 38761.0, 0.0012960 },
2990           { 38761.0, 0.0012960 },
2991           { 38761.0, 0.0012960 },
2992           { 38761.0, 0.0012960 },
2993           { 38761.0, 0.0012960 },
2994           { 38761.0, 0.0012960 },
2995           { 39126.0, 0.0025920 },
2996           { 39126.0, 0.0025920 }
2997        };
2998 
2999     /* Number of Delta(AT) expressions before leap seconds were introduced */
3000     final int NERA1 = drift.length;
3001 
3002 
3003     /* Number of Delta(AT) changes */
3004        final int NDAT = leapSeconds.length;
3005 
3006     /* Miscellaneous local variables */
3007        int i, m;
3008        double da, djm;
3009 
3010 
3011     /* Initialize the result to zero. */
3012        double deltat = da = 0.0;
3013 
3014     /* If invalid fraction of a day, set error status and give up. */
3015        if (fd < 0.0 || fd > 1.0) throw new JSOFAIllegalParameter("bad day fraction", -4);
3016 
3017     /* Convert the date into an MJD. */
3018        JulianDate jd = jauCal2jd(iy, im, id);
3019        djm = jd.djm1;
3020 
3021     /* If pre-UTC year, set warning status and give up. */ 
3022        if (iy < leapSeconds[0].iyear) throw new JSOFAInternalError("year before UTC start", 1);
3023 
3024     /* If suspiciously late year, set warning status but proceed. */
3025        if (iy > IYV + 5) {
3026     }
3027 
3028     /* Combine year and month to form a date-ordered integer... */
3029        m = 12*iy + im;
3030 
3031     /* ...and use it to find the preceding table entry. */
3032        for (i = NDAT-1; i >=0; i--) {
3033           if (m >= (12 * leapSeconds[i].iyear + leapSeconds[i].month)) break;
3034        }
3035 
3036     /* Get the Delta(AT). */
3037        da = leapSeconds[i].delat;
3038 
3039     /* If pre-1972, adjust for drift. */
3040        if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];
3041 
3042     /* Return the Delta(AT) value. */
3043        deltat = da;
3044 
3045     /* Return the value. */
3046        return deltat;
3047 
3048         }
3049     
3050 
3051     /**
3052     *  An approximation to TDB-TT, the difference between barycentric
3053     *  dynamical time and terrestrial time, for an observer on the Earth.
3054     *
3055     *  The different time scales - proper, coordinate and realized - are
3056     *  related to each other:
3057     *  {@code
3058     *            TAI             <-  physically realized
3059     *             :
3060     *          offset            <-  observed (nominally +32.184s)
3061     *             :
3062     *            TT              <-  terrestrial time
3063     *             :
3064     *    rate adjustment (L_G)   <-  definition of TT
3065     *             :
3066     *            TCG             <-  time scale for GCRS
3067     *             :
3068     *      "periodic" terms      <-  jauDtdb  is an implementation
3069     *             :
3070     *    rate adjustment (L_C)   <-  function of solar-system ephemeris
3071     *             :
3072     *            TCB             <-  time scale for BCRS
3073     *             :
3074     *    rate adjustment (-L_B)  <-  definition of TDB
3075     *             :
3076     *            TDB             <-  TCB scaled to track TT
3077     *             :
3078     *      "periodic" terms      <-  -jau_DTDB is an approximation
3079     *             :
3080     *            TT              <-  terrestrial time
3081     *}
3082     *  Adopted values for the various constants can be found in the IERS
3083     *  Conventions (McCarthy &amp; Petit 2003).
3084     *
3085     *<p>This function is derived from the International Astronomical Union's
3086     *  SOFA (Standards Of Fundamental Astronomy) software collection.
3087     *
3088     *<p>Status:  canonical model.
3089     *
3090     *<!-- Given: -->
3091     *     @param date1 double   date, TDB (Notes 1-3)
3092     *     @param date2 double   date, TDB (Notes 1-3) 
3093     *     @param ut             double   universal time (UT1, fraction of one day)
3094     *     @param elong          double   longitude (east positive, radians)
3095     *     @param u              double   distance from Earth spin axis (km)
3096     *     @param v              double   distance north of equatorial plane (km)
3097     *
3098     * <!-- Returned (function value): -->
3099     *  @return            double  TDB-TT (seconds)
3100     *
3101     * <p>Notes:
3102     * <ol>
3103     *
3104     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
3105     *     convenient way between the two arguments.  For example,
3106     *     JD(TT)=2450123.7 could be expressed in any of these ways,
3107     *     among others:
3108     *<pre>
3109     *            date1          date2
3110     *
3111     *         2450123.7           0.0       (JD method)
3112     *         2451545.0       -1421.3       (J2000 method)
3113     *         2400000.5       50123.2       (MJD method)
3114     *         2450123.5           0.2       (date &amp; time method)
3115     *</pre>
3116     *     The JD method is the most natural and convenient to use in
3117     *     cases where the loss of several decimal digits of resolution
3118     *     is acceptable.  The J2000 method is best matched to the way
3119     *     the argument is handled internally and will deliver the
3120     *     optimum resolution.  The MJD method and the date &amp; time methods
3121     *     are both good compromises between resolution and convenience.
3122     *
3123     *     Although the date is, formally, barycentric dynamical time (TDB),
3124     *     the terrestrial dynamical time (TT) can be used with no practical
3125     *     effect on the accuracy of the prediction.
3126     *
3127     * <li> TT can be regarded as a coordinate time that is realized as an
3128     *     offset of 32.184s from International Atomic Time, TAI.  TT is a
3129     *     specific linear transformation of geocentric coordinate time TCG,
3130     *     which is the time scale for the Geocentric Celestial Reference
3131     *     System, GCRS.
3132     *
3133     * <li> TDB is a coordinate time, and is a specific linear transformation
3134     *     of barycentric coordinate time TCB, which is the time scale for
3135     *     the Barycentric Celestial Reference System, BCRS.
3136     *
3137     * <li> The difference TCG-TCB depends on the masses and positions of the
3138     *     bodies of the solar system and the velocity of the Earth.  It is
3139     *     dominated by a rate difference, the residual being of a periodic
3140     *     character.  The latter, which is modeled by the present function,
3141     *     comprises a main (annual) sinusoidal term of amplitude
3142     *     approximately 0.00166 seconds, plus planetary terms up to about
3143     *     20 microseconds, and lunar and diurnal terms up to 2 microseconds.
3144     *     These effects come from the changing transverse Doppler effect
3145     *     and gravitational red-shift as the observer (on the Earth's
3146     *     surface) experiences variations in speed (with respect to the
3147     *     BCRS) and gravitational potential.
3148     *
3149     * <li> TDB can be regarded as the same as TCB but with a rate adjustment
3150     *     to keep it close to TT, which is convenient for many applications.
3151     *     The history of successive attempts to define TDB is set out in
3152     *     Resolution 3 adopted by the IAU General Assembly in 2006, which
3153     *     defines a fixed TDB(TCB) transformation that is consistent with
3154     *     contemporary solar-system ephemerides.  Future ephemerides will
3155     *     imply slightly changed transformations between TCG and TCB, which
3156     *     could introduce a linear drift between TDB and TT;  however, any
3157     *     such drift is unlikely to exceed 1 nanosecond per century.
3158     *
3159     * <li> The geocentric TDB-TT model used in the present function is that of
3160     *     Fairhead &amp; Bretagnon (1990), in its full form.  It was originally
3161     *     supplied by Fairhead (private communications with P.T.Wallace,
3162     *     1990) as a Fortran subroutine.  The present C function contains an
3163     *     adaptation of the Fairhead code.  The numerical results are
3164     *     essentially unaffected by the changes, the differences with
3165     *     respect to the Fairhead &amp; Bretagnon original being at the 1e-20 s
3166     *     level.
3167     *
3168     *     The topocentric part of the model is from Moyer (1981) and
3169     *     Murray (1983), with fundamental arguments adapted from
3170     *     Simon et al. 1994.  It is an approximation to the expression
3171     *     ( v / c ) . ( r / c ), where v is the barycentric velocity of
3172     *     the Earth, r is the geocentric position of the observer and
3173     *     c is the speed of light.
3174     *
3175     *     By supplying zeroes for u and v, the topocentric part of the
3176     *     model can be nullified, and the function will return the Fairhead
3177     *     &amp; Bretagnon result alone.
3178     *
3179     * <li> During the interval 1950-2050, the absolute accuracy is better
3180     *     than +/- 3 nanoseconds relative to time ephemerides obtained by
3181     *     direct numerical integrations based on the JPL DE405 solar system
3182     *     ephemeris.
3183     *
3184     * <li> It must be stressed that the present function is merely a model,
3185     *     and that numerical integration of solar-system ephemerides is the
3186     *     definitive method for predicting the relationship between TCG and
3187     *     TCB and hence between TT and TDB.
3188     *</ol>
3189     *<p>References:
3190     *
3191     *     <p>Fairhead, L., &amp; Bretagnon, P., Astron.Astrophys., 229, 240-247
3192     *     (1990).
3193     *
3194     *     <p>IAU 2006 Resolution 3.
3195     *
3196     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
3197     *     IERS Technical Note No. 32, BKG (2004)
3198     *
3199     *     <p>Moyer, T.D., Cel.Mech., 23, 33 (1981).
3200     *
3201     *     <p>Murray, C.A., Vectorial Astrometry, Adam Hilger (1983).
3202     *
3203     *     <p>Seidelmann, P.K. et al., Explanatory Supplement to the
3204     *     Astronomical Almanac, Chapter 2, University Science Books (1992).
3205     *
3206     *     <p>Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
3207     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 282, 663-683 (1994).
3208     *
3209     *@version 2009 December 17
3210     *
3211     *  @since Release 20101201
3212     *
3213     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
3214     */
3215     public static  double jauDtdb(double date1, double date2,
3216                    double ut, double elong, double u, double v)
3217     {
3218        double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4,
3219               wf, wj;
3220        int j;
3221 
3222     /*
3223     * =====================
3224     * Fairhead et al. model
3225     * =====================
3226     *
3227     * 787 sets of three coefficients.
3228     *
3229     * Each set is
3230     *    amplitude (microseconds)
3231     *      frequency (radians per Julian millennium since J2000.0)
3232     *      phase (radians)
3233     *
3234     * Sets   1-474 are the T**0 terms
3235     *  "   475-679  "   "  T**1
3236     *  "   680-764  "   "  T**2
3237     *  "   765-784  "   "  T**3
3238     *  "   785-787  "   "  T**4
3239     */
3240 
3241        final double fairhd[][] = {
3242        /* 1, 10 */
3243           { 1656.674564e-6,     6283.075849991,  6.240054195 },
3244           {   22.417471e-6,     5753.384884897,  4.296977442 },
3245           {   13.839792e-6,    12566.151699983,  6.196904410 },
3246           {    4.770086e-6,      529.690965095,  0.444401603 },
3247           {    4.676740e-6,     6069.776754553,  4.021195093 },
3248           {    2.256707e-6,      213.299095438,  5.543113262 },
3249           {    1.694205e-6,      -3.523118349,   5.025132748 },
3250           {    1.554905e-6,    77713.771467920,  5.198467090 },
3251           {    1.276839e-6,     7860.419392439,  5.988822341 },
3252           {    1.193379e-6,     5223.693919802,  3.649823730 },
3253        /* 11, 20 */
3254           {    1.115322e-6,     3930.209696220,  1.422745069 },
3255           {    0.794185e-6,    11506.769769794,  2.322313077 },
3256           {    0.447061e-6,       26.298319800,  3.615796498 },
3257           {    0.435206e-6,     -398.149003408,  4.349338347 },
3258           {    0.600309e-6,     1577.343542448,  2.678271909 },
3259           {    0.496817e-6,     6208.294251424,  5.696701824 },
3260           {    0.486306e-6,     5884.926846583,  0.520007179 },
3261           {    0.432392e-6,       74.781598567,  2.435898309 },
3262           {    0.468597e-6,     6244.942814354,  5.866398759 },
3263           {    0.375510e-6,     5507.553238667,  4.103476804 },
3264        /* 21, 30 */
3265           {    0.243085e-6,     -775.522611324,  3.651837925 },
3266           {    0.173435e-6,    18849.227549974,  6.153743485 },
3267           {    0.230685e-6,     5856.477659115,  4.773852582 },
3268           {    0.203747e-6,    12036.460734888,  4.333987818 },
3269           {    0.143935e-6,     -796.298006816,  5.957517795 },
3270           {    0.159080e-6,    10977.078804699,  1.890075226 },
3271           {    0.119979e-6,       38.133035638,  4.551585768 },
3272           {    0.118971e-6,     5486.777843175,  1.914547226 },
3273           {    0.116120e-6,     1059.381930189,  0.873504123 },
3274           {    0.137927e-6,    11790.629088659,  1.135934669 },
3275        /* 31, 40 */
3276           {    0.098358e-6,     2544.314419883,  0.092793886 },
3277           {    0.101868e-6,    -5573.142801634,  5.984503847 },
3278           {    0.080164e-6,      206.185548437,  2.095377709 },
3279           {    0.079645e-6,     4694.002954708,  2.949233637 },
3280           {    0.062617e-6,       20.775395492,  2.654394814 },
3281           {    0.075019e-6,     2942.463423292,  4.980931759 },
3282           {    0.064397e-6,     5746.271337896,  1.280308748 },
3283           {    0.063814e-6,     5760.498431898,  4.167901731 },
3284           {    0.048042e-6,     2146.165416475,  1.495846011 },
3285           {    0.048373e-6,      155.420399434,  2.251573730 },
3286        /* 41, 50 */
3287           {    0.058844e-6,      426.598190876,  4.839650148 },
3288           {    0.046551e-6,       -0.980321068,  0.921573539 },
3289           {    0.054139e-6,    17260.154654690,  3.411091093 },
3290           {    0.042411e-6,     6275.962302991,  2.869567043 },
3291           {    0.040184e-6,       -7.113547001,  3.565975565 },
3292           {    0.036564e-6,     5088.628839767,  3.324679049 },
3293           {    0.040759e-6,    12352.852604545,  3.981496998 },
3294           {    0.036507e-6,      801.820931124,  6.248866009 },
3295           {    0.036955e-6,     3154.687084896,  5.071801441 },
3296           {    0.042732e-6,      632.783739313,  5.720622217 },
3297        /* 51, 60 */
3298           {    0.042560e-6,   161000.685737473,  1.270837679 },
3299           {    0.040480e-6,    15720.838784878,  2.546610123 },
3300           {    0.028244e-6,    -6286.598968340,  5.069663519 },
3301           {    0.033477e-6,     6062.663207553,  4.144987272 },
3302           {    0.034867e-6,      522.577418094,  5.210064075 },
3303           {    0.032438e-6,     6076.890301554,  0.749317412 },
3304           {    0.030215e-6,     7084.896781115,  3.389610345 },
3305           {    0.029247e-6,   -71430.695617928,  4.183178762 },
3306           {    0.033529e-6,     9437.762934887,  2.404714239 },
3307           {    0.032423e-6,     8827.390269875,  5.541473556 },
3308        /* 61, 70 */
3309           {    0.027567e-6,     6279.552731642,  5.040846034 },
3310           {    0.029862e-6,    12139.553509107,  1.770181024 },
3311           {    0.022509e-6,    10447.387839604,  1.460726241 },
3312           {    0.020937e-6,     8429.241266467,  0.652303414 },
3313           {    0.020322e-6,      419.484643875,  3.735430632 },
3314           {    0.024816e-6,    -1194.447010225,  1.087136918 },
3315           {    0.025196e-6,     1748.016413067,  2.901883301 },
3316           {    0.021691e-6,    14143.495242431,  5.952658009 },
3317           {    0.017673e-6,     6812.766815086,  3.186129845 },
3318           {    0.022567e-6,     6133.512652857,  3.307984806 },
3319        /* 71, 80 */
3320           {    0.016155e-6,    10213.285546211,  1.331103168 },
3321           {    0.014751e-6,     1349.867409659,  4.308933301 },
3322           {    0.015949e-6,     -220.412642439,  4.005298270 },
3323           {    0.015974e-6,    -2352.866153772,  6.145309371 },
3324           {    0.014223e-6,    17789.845619785,  2.104551349 },
3325           {    0.017806e-6,       73.297125859,  3.475975097 },
3326           {    0.013671e-6,     -536.804512095,  5.971672571 },
3327           {    0.011942e-6,     8031.092263058,  2.053414715 },
3328           {    0.014318e-6,    16730.463689596,  3.016058075 },
3329           {    0.012462e-6,      103.092774219,  1.737438797 },
3330        /* 81, 90 */
3331           {    0.010962e-6,        3.590428652,  2.196567739 },
3332           {    0.015078e-6,    19651.048481098,  3.969480770 },
3333           {    0.010396e-6,      951.718406251,  5.717799605 },
3334           {    0.011707e-6,    -4705.732307544,  2.654125618 },
3335           {    0.010453e-6,     5863.591206116,  1.913704550 },
3336           {    0.012420e-6,     4690.479836359,  4.734090399 },
3337           {    0.011847e-6,     5643.178563677,  5.489005403 },
3338           {    0.008610e-6,     3340.612426700,  3.661698944 },
3339           {    0.011622e-6,     5120.601145584,  4.863931876 },
3340           {    0.010825e-6,      553.569402842,  0.842715011 },
3341        /* 91, 100 */
3342           {    0.008666e-6,     -135.065080035,  3.293406547 },
3343           {    0.009963e-6,      149.563197135,  4.870690598 },
3344           {    0.009858e-6,     6309.374169791,  1.061816410 },
3345           {    0.007959e-6,      316.391869657,  2.465042647 },
3346           {    0.010099e-6,      283.859318865,  1.942176992 },
3347           {    0.007147e-6,     -242.728603974,  3.661486981 },
3348           {    0.007505e-6,     5230.807466803,  4.920937029 },
3349           {    0.008323e-6,    11769.853693166,  1.229392026 },
3350           {    0.007490e-6,    -6256.777530192,  3.658444681 },
3351           {    0.009370e-6,   149854.400134205,  0.673880395 },
3352        /* 101, 110 */
3353           {    0.007117e-6,       38.027672636,  5.294249518 },
3354           {    0.007857e-6,    12168.002696575,  0.525733528 },
3355           {    0.007019e-6,     6206.809778716,  0.837688810 },
3356           {    0.006056e-6,      955.599741609,  4.194535082 },
3357           {    0.008107e-6,    13367.972631107,  3.793235253 },
3358           {    0.006731e-6,     5650.292110678,  5.639906583 },
3359           {    0.007332e-6,       36.648562930,  0.114858677 },
3360           {    0.006366e-6,     4164.311989613,  2.262081818 },
3361           {    0.006858e-6,     5216.580372801,  0.642063318 },
3362           {    0.006919e-6,     6681.224853400,  6.018501522 },
3363        /* 111, 120 */
3364           {    0.006826e-6,     7632.943259650,  3.458654112 },
3365           {    0.005308e-6,    -1592.596013633,  2.500382359 },
3366           {    0.005096e-6,    11371.704689758,  2.547107806 },
3367           {    0.004841e-6,     5333.900241022,  0.437078094 },
3368           {    0.005582e-6,     5966.683980335,  2.246174308 },
3369           {    0.006304e-6,    11926.254413669,  2.512929171 },
3370           {    0.006603e-6,    23581.258177318,  5.393136889 },
3371           {    0.005123e-6,       -1.484472708,  2.999641028 },
3372           {    0.004648e-6,     1589.072895284,  1.275847090 },
3373           {    0.005119e-6,     6438.496249426,  1.486539246 },
3374        /* 121, 130 */
3375           {    0.004521e-6,     4292.330832950,  6.140635794 },
3376           {    0.005680e-6,    23013.539539587,  4.557814849 },
3377           {    0.005488e-6,       -3.455808046,  0.090675389 },
3378           {    0.004193e-6,     7234.794256242,  4.869091389 },
3379           {    0.003742e-6,     7238.675591600,  4.691976180 },
3380           {    0.004148e-6,     -110.206321219,  3.016173439 },
3381           {    0.004553e-6,    11499.656222793,  5.554998314 },
3382           {    0.004892e-6,     5436.993015240,  1.475415597 },
3383           {    0.004044e-6,     4732.030627343,  1.398784824 },
3384           {    0.004164e-6,    12491.370101415,  5.650931916 },
3385        /* 131, 140 */
3386           {    0.004349e-6,    11513.883316794,  2.181745369 },
3387           {    0.003919e-6,    12528.018664345,  5.823319737 },
3388           {    0.003129e-6,     6836.645252834,  0.003844094 },
3389           {    0.004080e-6,    -7058.598461315,  3.690360123 },
3390           {    0.003270e-6,       76.266071276,  1.517189902 },
3391           {    0.002954e-6,     6283.143160294,  4.447203799 },
3392           {    0.002872e-6,       28.449187468,  1.158692983 },
3393           {    0.002881e-6,      735.876513532,  0.349250250 },
3394           {    0.003279e-6,     5849.364112115,  4.893384368 },
3395           {    0.003625e-6,     6209.778724132,  1.473760578 },
3396        /* 141, 150 */
3397           {    0.003074e-6,      949.175608970,  5.185878737 },
3398           {    0.002775e-6,     9917.696874510,  1.030026325 },
3399           {    0.002646e-6,    10973.555686350,  3.918259169 },
3400           {    0.002575e-6,    25132.303399966,  6.109659023 },
3401           {    0.003500e-6,      263.083923373,  1.892100742 },
3402           {    0.002740e-6,    18319.536584880,  4.320519510 },
3403           {    0.002464e-6,      202.253395174,  4.698203059 },
3404           {    0.002409e-6,        2.542797281,  5.325009315 },
3405           {    0.003354e-6,   -90955.551694697,  1.942656623 },
3406           {    0.002296e-6,     6496.374945429,  5.061810696 },
3407        /* 151, 160 */
3408           {    0.003002e-6,     6172.869528772,  2.797822767 },
3409           {    0.003202e-6,    27511.467873537,  0.531673101 },
3410           {    0.002954e-6,    -6283.008539689,  4.533471191 },
3411           {    0.002353e-6,      639.897286314,  3.734548088 },
3412           {    0.002401e-6,    16200.772724501,  2.605547070 },
3413           {    0.003053e-6,   233141.314403759,  3.029030662 },
3414           {    0.003024e-6,    83286.914269554,  2.355556099 },
3415           {    0.002863e-6,    17298.182327326,  5.240963796 },
3416           {    0.002103e-6,    -7079.373856808,  5.756641637 },
3417           {    0.002303e-6,    83996.847317911,  2.013686814 },
3418        /* 161, 170 */
3419           {    0.002303e-6,    18073.704938650,  1.089100410 },
3420           {    0.002381e-6,       63.735898303,  0.759188178 },
3421           {    0.002493e-6,     6386.168624210,  0.645026535 },
3422           {    0.002366e-6,        3.932153263,  6.215885448 },
3423           {    0.002169e-6,    11015.106477335,  4.845297676 },
3424           {    0.002397e-6,     6243.458341645,  3.809290043 },
3425           {    0.002183e-6,     1162.474704408,  6.179611691 },
3426           {    0.002353e-6,     6246.427287062,  4.781719760 },
3427           {    0.002199e-6,     -245.831646229,  5.956152284 },
3428           {    0.001729e-6,     3894.181829542,  1.264976635 },
3429        /* 171, 180 */
3430           {    0.001896e-6,    -3128.388765096,  4.914231596 },
3431           {    0.002085e-6,       35.164090221,  1.405158503 },
3432           {    0.002024e-6,    14712.317116458,  2.752035928 },
3433           {    0.001737e-6,     6290.189396992,  5.280820144 },
3434           {    0.002229e-6,      491.557929457,  1.571007057 },
3435           {    0.001602e-6,    14314.168113050,  4.203664806 },
3436           {    0.002186e-6,      454.909366527,  1.402101526 },
3437           {    0.001897e-6,    22483.848574493,  4.167932508 },
3438           {    0.001825e-6,    -3738.761430108,  0.545828785 },
3439           {    0.001894e-6,     1052.268383188,  5.817167450 },
3440        /* 181, 190 */
3441           {    0.001421e-6,       20.355319399,  2.419886601 },
3442           {    0.001408e-6,    10984.192351700,  2.732084787 },
3443           {    0.001847e-6,    10873.986030480,  2.903477885 },
3444           {    0.001391e-6,    -8635.942003763,  0.593891500 },
3445           {    0.001388e-6,       -7.046236698,  1.166145902 },
3446           {    0.001810e-6,   -88860.057071188,  0.487355242 },
3447           {    0.001288e-6,    -1990.745017041,  3.913022880 },
3448           {    0.001297e-6,    23543.230504682,  3.063805171 },
3449           {    0.001335e-6,     -266.607041722,  3.995764039 },
3450           {    0.001376e-6,    10969.965257698,  5.152914309 },
3451        /* 191, 200 */
3452           {    0.001745e-6,   244287.600007027,  3.626395673 },
3453           {    0.001649e-6,    31441.677569757,  1.952049260 },
3454           {    0.001416e-6,     9225.539273283,  4.996408389 },
3455           {    0.001238e-6,     4804.209275927,  5.503379738 },
3456           {    0.001472e-6,     4590.910180489,  4.164913291 },
3457           {    0.001169e-6,     6040.347246017,  5.841719038 },
3458           {    0.001039e-6,     5540.085789459,  2.769753519 },
3459           {    0.001004e-6,     -170.672870619,  0.755008103 },
3460           {    0.001284e-6,    10575.406682942,  5.306538209 },
3461           {    0.001278e-6,       71.812653151,  4.713486491 },
3462        /* 201, 210 */
3463           {    0.001321e-6,    18209.330263660,  2.624866359 },
3464           {    0.001297e-6,    21228.392023546,  0.382603541 },
3465           {    0.000954e-6,     6282.095528923,  0.882213514 },
3466           {    0.001145e-6,     6058.731054289,  1.169483931 },
3467           {    0.000979e-6,     5547.199336460,  5.448375984 },
3468           {    0.000987e-6,    -6262.300454499,  2.656486959 },
3469           {    0.001070e-6,  -154717.609887482,  1.827624012 },
3470           {    0.000991e-6,     4701.116501708,  4.387001801 },
3471           {    0.001155e-6,      -14.227094002,  3.042700750 },
3472           {    0.001176e-6,      277.034993741,  3.335519004 },
3473        /* 211, 220 */
3474           {    0.000890e-6,    13916.019109642,  5.601498297 },
3475           {    0.000884e-6,    -1551.045222648,  1.088831705 },
3476           {    0.000876e-6,     5017.508371365,  3.969902609 },
3477           {    0.000806e-6,    15110.466119866,  5.142876744 },
3478           {    0.000773e-6,    -4136.910433516,  0.022067765 },
3479           {    0.001077e-6,      175.166059800,  1.844913056 },
3480           {    0.000954e-6,    -6284.056171060,  0.968480906 },
3481           {    0.000737e-6,     5326.786694021,  4.923831588 },
3482           {    0.000845e-6,     -433.711737877,  4.749245231 },
3483           {    0.000819e-6,     8662.240323563,  5.991247817 },
3484        /* 221, 230 */
3485           {    0.000852e-6,      199.072001436,  2.189604979 },
3486           {    0.000723e-6,    17256.631536341,  6.068719637 },
3487           {    0.000940e-6,     6037.244203762,  6.197428148 },
3488           {    0.000885e-6,    11712.955318231,  3.280414875 },
3489           {    0.000706e-6,    12559.038152982,  2.824848947 },
3490           {    0.000732e-6,     2379.164473572,  2.501813417 },
3491           {    0.000764e-6,    -6127.655450557,  2.236346329 },
3492           {    0.000908e-6,      131.541961686,  2.521257490 },
3493           {    0.000907e-6,    35371.887265976,  3.370195967 },
3494           {    0.000673e-6,     1066.495477190,  3.876512374 },
3495        /* 231, 240 */
3496           {    0.000814e-6,    17654.780539750,  4.627122566 },
3497           {    0.000630e-6,       36.027866677,  0.156368499 },
3498           {    0.000798e-6,      515.463871093,  5.151962502 },
3499           {    0.000798e-6,      148.078724426,  5.909225055 },
3500           {    0.000806e-6,      309.278322656,  6.054064447 },
3501           {    0.000607e-6,      -39.617508346,  2.839021623 },
3502           {    0.000601e-6,      412.371096874,  3.984225404 },
3503           {    0.000646e-6,    11403.676995575,  3.852959484 },
3504           {    0.000704e-6,    13521.751441591,  2.300991267 },
3505           {    0.000603e-6,   -65147.619767937,  4.140083146 },
3506        /* 241, 250 */
3507           {    0.000609e-6,    10177.257679534,  0.437122327 },
3508           {    0.000631e-6,     5767.611978898,  4.026532329 },
3509           {    0.000576e-6,    11087.285125918,  4.760293101 },
3510           {    0.000674e-6,    14945.316173554,  6.270510511 },
3511           {    0.000726e-6,     5429.879468239,  6.039606892 },
3512           {    0.000710e-6,    28766.924424484,  5.672617711 },
3513           {    0.000647e-6,    11856.218651625,  3.397132627 },
3514           {    0.000678e-6,    -5481.254918868,  6.249666675 },
3515           {    0.000618e-6,    22003.914634870,  2.466427018 },
3516           {    0.000738e-6,     6134.997125565,  2.242668890 },
3517        /* 251, 260 */
3518           {    0.000660e-6,      625.670192312,  5.864091907 },
3519           {    0.000694e-6,     3496.032826134,  2.668309141 },
3520           {    0.000531e-6,     6489.261398429,  1.681888780 },
3521           {    0.000611e-6,  -143571.324284214,  2.424978312 },
3522           {    0.000575e-6,    12043.574281889,  4.216492400 },
3523           {    0.000553e-6,    12416.588502848,  4.772158039 },
3524           {    0.000689e-6,     4686.889407707,  6.224271088 },
3525           {    0.000495e-6,     7342.457780181,  3.817285811 },
3526           {    0.000567e-6,     3634.621024518,  1.649264690 },
3527           {    0.000515e-6,    18635.928454536,  3.945345892 },
3528        /* 261, 270 */
3529           {    0.000486e-6,     -323.505416657,  4.061673868 },
3530           {    0.000662e-6,    25158.601719765,  1.794058369 },
3531           {    0.000509e-6,      846.082834751,  3.053874588 },
3532           {    0.000472e-6,   -12569.674818332,  5.112133338 },
3533           {    0.000461e-6,     6179.983075773,  0.513669325 },
3534           {    0.000641e-6,    83467.156352816,  3.210727723 },
3535           {    0.000520e-6,    10344.295065386,  2.445597761 },
3536           {    0.000493e-6,    18422.629359098,  1.676939306 },
3537           {    0.000478e-6,     1265.567478626,  5.487314569 },
3538           {    0.000472e-6,      -18.159247265,  1.999707589 },
3539        /* 271, 280 */
3540           {    0.000559e-6,    11190.377900137,  5.783236356 },
3541           {    0.000494e-6,     9623.688276691,  3.022645053 },
3542           {    0.000463e-6,     5739.157790895,  1.411223013 },
3543           {    0.000432e-6,    16858.482532933,  1.179256434 },
3544           {    0.000574e-6,    72140.628666286,  1.758191830 },
3545           {    0.000484e-6,    17267.268201691,  3.290589143 },
3546           {    0.000550e-6,     4907.302050146,  0.864024298 },
3547           {    0.000399e-6,       14.977853527,  2.094441910 },
3548           {    0.000491e-6,      224.344795702,  0.878372791 },
3549           {    0.000432e-6,    20426.571092422,  6.003829241 },
3550        /* 281, 290 */
3551           {    0.000481e-6,     5749.452731634,  4.309591964 },
3552           {    0.000480e-6,     5757.317038160,  1.142348571 },
3553           {    0.000485e-6,     6702.560493867,  0.210580917 },
3554           {    0.000426e-6,     6055.549660552,  4.274476529 },
3555           {    0.000480e-6,     5959.570433334,  5.031351030 },
3556           {    0.000466e-6,    12562.628581634,  4.959581597 },
3557           {    0.000520e-6,    39302.096962196,  4.788002889 },
3558           {    0.000458e-6,    12132.439962106,  1.880103788 },
3559           {    0.000470e-6,    12029.347187887,  1.405611197 },
3560           {    0.000416e-6,    -7477.522860216,  1.082356330 },
3561        /* 291, 300 */
3562           {    0.000449e-6,    11609.862544012,  4.179989585 },
3563           {    0.000465e-6,    17253.041107690,  0.353496295 },
3564           {    0.000362e-6,    -4535.059436924,  1.583849576 },
3565           {    0.000383e-6,    21954.157609398,  3.747376371 },
3566           {    0.000389e-6,       17.252277143,  1.395753179 },
3567           {    0.000331e-6,    18052.929543158,  0.566790582 },
3568           {    0.000430e-6,    13517.870106233,  0.685827538 },
3569           {    0.000368e-6,    -5756.908003246,  0.731374317 },
3570           {    0.000330e-6,    10557.594160824,  3.710043680 },
3571           {    0.000332e-6,    20199.094959633,  1.652901407 },
3572        /* 301, 310 */
3573           {    0.000384e-6,    11933.367960670,  5.827781531 },
3574           {    0.000387e-6,    10454.501386605,  2.541182564 },
3575           {    0.000325e-6,    15671.081759407,  2.178850542 },
3576           {    0.000318e-6,      138.517496871,  2.253253037 },
3577           {    0.000305e-6,     9388.005909415,  0.578340206 },
3578           {    0.000352e-6,     5749.861766548,  3.000297967 },
3579           {    0.000311e-6,     6915.859589305,  1.693574249 },
3580           {    0.000297e-6,    24072.921469776,  1.997249392 },
3581           {    0.000363e-6,     -640.877607382,  5.071820966 },
3582           {    0.000323e-6,    12592.450019783,  1.072262823 },
3583        /* 311, 320 */
3584           {    0.000341e-6,    12146.667056108,  4.700657997 },
3585           {    0.000290e-6,     9779.108676125,  1.812320441 },
3586           {    0.000342e-6,     6132.028180148,  4.322238614 },
3587           {    0.000329e-6,     6268.848755990,  3.033827743 },
3588           {    0.000374e-6,    17996.031168222,  3.388716544 },
3589           {    0.000285e-6,     -533.214083444,  4.687313233 },
3590           {    0.000338e-6,     6065.844601290,  0.877776108 },
3591           {    0.000276e-6,       24.298513841,  0.770299429 },
3592           {    0.000336e-6,    -2388.894020449,  5.353796034 },
3593           {    0.000290e-6,     3097.883822726,  4.075291557 },
3594        /* 321, 330 */
3595           {    0.000318e-6,      709.933048357,  5.941207518 },
3596           {    0.000271e-6,    13095.842665077,  3.208912203 },
3597           {    0.000331e-6,     6073.708907816,  4.007881169 },
3598           {    0.000292e-6,      742.990060533,  2.714333592 },
3599           {    0.000362e-6,    29088.811415985,  3.215977013 },
3600           {    0.000280e-6,    12359.966151546,  0.710872502 },
3601           {    0.000267e-6,    10440.274292604,  4.730108488 },
3602           {    0.000262e-6,      838.969287750,  1.327720272 },
3603           {    0.000250e-6,    16496.361396202,  0.898769761 },
3604           {    0.000325e-6,    20597.243963041,  0.180044365 },
3605        /* 331, 340 */
3606           {    0.000268e-6,     6148.010769956,  5.152666276 },
3607           {    0.000284e-6,     5636.065016677,  5.655385808 },
3608           {    0.000301e-6,     6080.822454817,  2.135396205 },
3609           {    0.000294e-6,     -377.373607916,  3.708784168 },
3610           {    0.000236e-6,     2118.763860378,  1.733578756 },
3611           {    0.000234e-6,     5867.523359379,  5.575209112 },
3612           {    0.000268e-6,  -226858.238553767,  0.069432392 },
3613           {    0.000265e-6,   167283.761587465,  4.369302826 },
3614           {    0.000280e-6,    28237.233459389,  5.304829118 },
3615           {    0.000292e-6,    12345.739057544,  4.096094132 },
3616        /* 341, 350 */
3617           {    0.000223e-6,    19800.945956225,  3.069327406 },
3618           {    0.000301e-6,    43232.306658416,  6.205311188 },
3619           {    0.000264e-6,    18875.525869774,  1.417263408 },
3620           {    0.000304e-6,    -1823.175188677,  3.409035232 },
3621           {    0.000301e-6,      109.945688789,  0.510922054 },
3622           {    0.000260e-6,      813.550283960,  2.389438934 },
3623           {    0.000299e-6,   316428.228673312,  5.384595078 },
3624           {    0.000211e-6,     5756.566278634,  3.789392838 },
3625           {    0.000209e-6,     5750.203491159,  1.661943545 },
3626           {    0.000240e-6,    12489.885628707,  5.684549045 },
3627        /* 351, 360 */
3628           {    0.000216e-6,     6303.851245484,  3.862942261 },
3629           {    0.000203e-6,     1581.959348283,  5.549853589 },
3630           {    0.000200e-6,     5642.198242609,  1.016115785 },
3631           {    0.000197e-6,      -70.849445304,  4.690702525 },
3632           {    0.000227e-6,     6287.008003254,  2.911891613 },
3633           {    0.000197e-6,      533.623118358,  1.048982898 },
3634           {    0.000205e-6,    -6279.485421340,  1.829362730 },
3635           {    0.000209e-6,   -10988.808157535,  2.636140084 },
3636           {    0.000208e-6,     -227.526189440,  4.127883842 },
3637           {    0.000191e-6,      415.552490612,  4.401165650 },
3638        /* 361, 370 */
3639           {    0.000190e-6,    29296.615389579,  4.175658539 },
3640           {    0.000264e-6,    66567.485864652,  4.601102551 },
3641           {    0.000256e-6,    -3646.350377354,  0.506364778 },
3642           {    0.000188e-6,    13119.721102825,  2.032195842 },
3643           {    0.000185e-6,     -209.366942175,  4.694756586 },
3644           {    0.000198e-6,    25934.124331089,  3.832703118 },
3645           {    0.000195e-6,     4061.219215394,  3.308463427 },
3646           {    0.000234e-6,     5113.487598583,  1.716090661 },
3647           {    0.000188e-6,     1478.866574064,  5.686865780 },
3648           {    0.000222e-6,    11823.161639450,  1.942386641 },
3649        /* 371, 380 */
3650           {    0.000181e-6,    10770.893256262,  1.999482059 },
3651           {    0.000171e-6,     6546.159773364,  1.182807992 },
3652           {    0.000206e-6,       70.328180442,  5.934076062 },
3653           {    0.000169e-6,    20995.392966449,  2.169080622 },
3654           {    0.000191e-6,    10660.686935042,  5.405515999 },
3655           {    0.000228e-6,    33019.021112205,  4.656985514 },
3656           {    0.000184e-6,    -4933.208440333,  3.327476868 },
3657           {    0.000220e-6,     -135.625325010,  1.765430262 },
3658           {    0.000166e-6,    23141.558382925,  3.454132746 },
3659           {    0.000191e-6,     6144.558353121,  5.020393445 },
3660        /* 381, 390 */
3661           {    0.000180e-6,     6084.003848555,  0.602182191 },
3662           {    0.000163e-6,    17782.732072784,  4.960593133 },
3663           {    0.000225e-6,    16460.333529525,  2.596451817 },
3664           {    0.000222e-6,     5905.702242076,  3.731990323 },
3665           {    0.000204e-6,      227.476132789,  5.636192701 },
3666           {    0.000159e-6,    16737.577236597,  3.600691544 },
3667           {    0.000200e-6,     6805.653268085,  0.868220961 },
3668           {    0.000187e-6,    11919.140866668,  2.629456641 },
3669           {    0.000161e-6,      127.471796607,  2.862574720 },
3670           {    0.000205e-6,     6286.666278643,  1.742882331 },
3671        /* 391, 400 */
3672           {    0.000189e-6,      153.778810485,  4.812372643 },
3673           {    0.000168e-6,    16723.350142595,  0.027860588 },
3674           {    0.000149e-6,    11720.068865232,  0.659721876 },
3675           {    0.000189e-6,     5237.921013804,  5.245313000 },
3676           {    0.000143e-6,     6709.674040867,  4.317625647 },
3677           {    0.000146e-6,     4487.817406270,  4.815297007 },
3678           {    0.000144e-6,     -664.756045130,  5.381366880 },
3679           {    0.000175e-6,     5127.714692584,  4.728443327 },
3680           {    0.000162e-6,     6254.626662524,  1.435132069 },
3681           {    0.000187e-6,    47162.516354635,  1.354371923 },
3682        /* 401, 410 */
3683           {    0.000146e-6,    11080.171578918,  3.369695406 },
3684           {    0.000180e-6,     -348.924420448,  2.490902145 },
3685           {    0.000148e-6,      151.047669843,  3.799109588 },
3686           {    0.000157e-6,     6197.248551160,  1.284375887 },
3687           {    0.000167e-6,      146.594251718,  0.759969109 },
3688           {    0.000133e-6,    -5331.357443741,  5.409701889 },
3689           {    0.000154e-6,       95.979227218,  3.366890614 },
3690           {    0.000148e-6,    -6418.140930027,  3.384104996 },
3691           {    0.000128e-6,    -6525.804453965,  3.803419985 },
3692           {    0.000130e-6,    11293.470674356,  0.939039445 },
3693        /* 411, 420 */
3694           {    0.000152e-6,    -5729.506447149,  0.734117523 },
3695           {    0.000138e-6,      210.117701700,  2.564216078 },
3696           {    0.000123e-6,     6066.595360816,  4.517099537 },
3697           {    0.000140e-6,    18451.078546566,  0.642049130 },
3698           {    0.000126e-6,    11300.584221356,  3.485280663 },
3699           {    0.000119e-6,    10027.903195729,  3.217431161 },
3700           {    0.000151e-6,     4274.518310832,  4.404359108 },
3701           {    0.000117e-6,     6072.958148291,  0.366324650 },
3702           {    0.000165e-6,    -7668.637425143,  4.298212528 },
3703           {    0.000117e-6,    -6245.048177356,  5.379518958 },
3704        /* 421, 430 */
3705           {    0.000130e-6,    -5888.449964932,  4.527681115 },
3706           {    0.000121e-6,     -543.918059096,  6.109429504 },
3707           {    0.000162e-6,     9683.594581116,  5.720092446 },
3708           {    0.000141e-6,     6219.339951688,  0.679068671 },
3709           {    0.000118e-6,    22743.409379516,  4.881123092 },
3710           {    0.000129e-6,     1692.165669502,  0.351407289 },
3711           {    0.000126e-6,     5657.405657679,  5.146592349 },
3712           {    0.000114e-6,      728.762966531,  0.520791814 },
3713           {    0.000120e-6,       52.596639600,  0.948516300 },
3714           {    0.000115e-6,       65.220371012,  3.504914846 },
3715        /* 431, 440 */
3716           {    0.000126e-6,     5881.403728234,  5.577502482 },
3717           {    0.000158e-6,   163096.180360983,  2.957128968 },
3718           {    0.000134e-6,    12341.806904281,  2.598576764 },
3719           {    0.000151e-6,    16627.370915377,  3.985702050 },
3720           {    0.000109e-6,     1368.660252845,  0.014730471 },
3721           {    0.000131e-6,     6211.263196841,  0.085077024 },
3722           {    0.000146e-6,     5792.741760812,  0.708426604 },
3723           {    0.000146e-6,      -77.750543984,  3.121576600 },
3724           {    0.000107e-6,     5341.013788022,  0.288231904 },
3725           {    0.000138e-6,     6281.591377283,  2.797450317 },
3726        /* 441, 450 */
3727           {    0.000113e-6,    -6277.552925684,  2.788904128 },
3728           {    0.000115e-6,     -525.758811831,  5.895222200 },
3729           {    0.000138e-6,     6016.468808270,  6.096188999 },
3730           {    0.000139e-6,    23539.707386333,  2.028195445 },
3731           {    0.000146e-6,    -4176.041342449,  4.660008502 },
3732           {    0.000107e-6,    16062.184526117,  4.066520001 },
3733           {    0.000142e-6,    83783.548222473,  2.936315115 },
3734           {    0.000128e-6,     9380.959672717,  3.223844306 },
3735           {    0.000135e-6,     6205.325306007,  1.638054048 },
3736           {    0.000101e-6,     2699.734819318,  5.481603249 },
3737        /* 451, 460 */
3738           {    0.000104e-6,     -568.821874027,  2.205734493 },
3739           {    0.000103e-6,     6321.103522627,  2.440421099 },
3740           {    0.000119e-6,     6321.208885629,  2.547496264 },
3741           {    0.000138e-6,     1975.492545856,  2.314608466 },
3742           {    0.000121e-6,      137.033024162,  4.539108237 },
3743           {    0.000123e-6,    19402.796952817,  4.538074405 },
3744           {    0.000119e-6,    22805.735565994,  2.869040566 },
3745           {    0.000133e-6,    64471.991241142,  6.056405489 },
3746           {    0.000129e-6,      -85.827298831,  2.540635083 },
3747           {    0.000131e-6,    13613.804277336,  4.005732868 },
3748        /* 461, 470 */
3749           {    0.000104e-6,     9814.604100291,  1.959967212 },
3750           {    0.000112e-6,    16097.679950283,  3.589026260 },
3751           {    0.000123e-6,     2107.034507542,  1.728627253 },
3752           {    0.000121e-6,    36949.230808424,  6.072332087 },
3753           {    0.000108e-6,   -12539.853380183,  3.716133846 },
3754           {    0.000113e-6,    -7875.671863624,  2.725771122 },
3755           {    0.000109e-6,     4171.425536614,  4.033338079 },
3756           {    0.000101e-6,     6247.911759770,  3.441347021 },
3757           {    0.000113e-6,     7330.728427345,  0.656372122 },
3758           {    0.000113e-6,    51092.726050855,  2.791483066 },
3759        /* 471, 480 */
3760           {    0.000106e-6,     5621.842923210,  1.815323326 },
3761           {    0.000101e-6,      111.430161497,  5.711033677 },
3762           {    0.000103e-6,      909.818733055,  2.812745443 },
3763           {    0.000101e-6,     1790.642637886,  1.965746028 },
3764 
3765        /* T */
3766           {  102.156724e-6,     6283.075849991,  4.249032005 },
3767           {    1.706807e-6,    12566.151699983,  4.205904248 },
3768           {    0.269668e-6,      213.299095438,  3.400290479 },
3769           {    0.265919e-6,      529.690965095,  5.836047367 },
3770           {    0.210568e-6,       -3.523118349,  6.262738348 },
3771           {    0.077996e-6,     5223.693919802,  4.670344204 },
3772        /* 481, 490 */
3773           {    0.054764e-6,     1577.343542448,  4.534800170 },
3774           {    0.059146e-6,       26.298319800,  1.083044735 },
3775           {    0.034420e-6,     -398.149003408,  5.980077351 },
3776           {    0.032088e-6,    18849.227549974,  4.162913471 },
3777           {    0.033595e-6,     5507.553238667,  5.980162321 },
3778           {    0.029198e-6,     5856.477659115,  0.623811863 },
3779           {    0.027764e-6,      155.420399434,  3.745318113 },
3780           {    0.025190e-6,     5746.271337896,  2.980330535 },
3781           {    0.022997e-6,     -796.298006816,  1.174411803 },
3782           {    0.024976e-6,     5760.498431898,  2.467913690 },
3783        /* 491, 500 */
3784           {    0.021774e-6,      206.185548437,  3.854787540 },
3785           {    0.017925e-6,     -775.522611324,  1.092065955 },
3786           {    0.013794e-6,      426.598190876,  2.699831988 },
3787           {    0.013276e-6,     6062.663207553,  5.845801920 },
3788           {    0.011774e-6,    12036.460734888,  2.292832062 },
3789           {    0.012869e-6,     6076.890301554,  5.333425680 },
3790           {    0.012152e-6,     1059.381930189,  6.222874454 },
3791           {    0.011081e-6,       -7.113547001,  5.154724984 },
3792           {    0.010143e-6,     4694.002954708,  4.044013795 },
3793           {    0.009357e-6,     5486.777843175,  3.416081409 },
3794        /* 501, 510 */
3795           {    0.010084e-6,      522.577418094,  0.749320262 },
3796           {    0.008587e-6,    10977.078804699,  2.777152598 },
3797           {    0.008628e-6,     6275.962302991,  4.562060226 },
3798           {    0.008158e-6,     -220.412642439,  5.806891533 },
3799           {    0.007746e-6,     2544.314419883,  1.603197066 },
3800           {    0.007670e-6,     2146.165416475,  3.000200440 },
3801           {    0.007098e-6,       74.781598567,  0.443725817 },
3802           {    0.006180e-6,     -536.804512095,  1.302642751 },
3803           {    0.005818e-6,     5088.628839767,  4.827723531 },
3804           {    0.004945e-6,    -6286.598968340,  0.268305170 },
3805        /* 511, 520 */
3806           {    0.004774e-6,     1349.867409659,  5.808636673 },
3807           {    0.004687e-6,     -242.728603974,  5.154890570 },
3808           {    0.006089e-6,     1748.016413067,  4.403765209 },
3809           {    0.005975e-6,    -1194.447010225,  2.583472591 },
3810           {    0.004229e-6,      951.718406251,  0.931172179 },
3811           {    0.005264e-6,      553.569402842,  2.336107252 },
3812           {    0.003049e-6,     5643.178563677,  1.362634430 },
3813           {    0.002974e-6,     6812.766815086,  1.583012668 },
3814           {    0.003403e-6,    -2352.866153772,  2.552189886 },
3815           {    0.003030e-6,      419.484643875,  5.286473844 },
3816        /* 521, 530 */
3817           {    0.003210e-6,       -7.046236698,  1.863796539 },
3818           {    0.003058e-6,     9437.762934887,  4.226420633 },
3819           {    0.002589e-6,    12352.852604545,  1.991935820 },
3820           {    0.002927e-6,     5216.580372801,  2.319951253 },
3821           {    0.002425e-6,     5230.807466803,  3.084752833 },
3822           {    0.002656e-6,     3154.687084896,  2.487447866 },
3823           {    0.002445e-6,    10447.387839604,  2.347139160 },
3824           {    0.002990e-6,     4690.479836359,  6.235872050 },
3825           {    0.002890e-6,     5863.591206116,  0.095197563 },
3826           {    0.002498e-6,     6438.496249426,  2.994779800 },
3827        /* 531, 540 */
3828           {    0.001889e-6,     8031.092263058,  3.569003717 },
3829           {    0.002567e-6,      801.820931124,  3.425611498 },
3830           {    0.001803e-6,   -71430.695617928,  2.192295512 },
3831           {    0.001782e-6,        3.932153263,  5.180433689 },
3832           {    0.001694e-6,    -4705.732307544,  4.641779174 },
3833           {    0.001704e-6,    -1592.596013633,  3.997097652 },
3834           {    0.001735e-6,     5849.364112115,  0.417558428 },
3835           {    0.001643e-6,     8429.241266467,  2.180619584 },
3836           {    0.001680e-6,       38.133035638,  4.164529426 },
3837           {    0.002045e-6,     7084.896781115,  0.526323854 },
3838        /* 541, 550 */
3839           {    0.001458e-6,     4292.330832950,  1.356098141 },
3840           {    0.001437e-6,       20.355319399,  3.895439360 },
3841           {    0.001738e-6,     6279.552731642,  0.087484036 },
3842           {    0.001367e-6,    14143.495242431,  3.987576591 },
3843           {    0.001344e-6,     7234.794256242,  0.090454338 },
3844           {    0.001438e-6,    11499.656222793,  0.974387904 },
3845           {    0.001257e-6,     6836.645252834,  1.509069366 },
3846           {    0.001358e-6,    11513.883316794,  0.495572260 },
3847           {    0.001628e-6,     7632.943259650,  4.968445721 },
3848           {    0.001169e-6,      103.092774219,  2.838496795 },
3849        /* 551, 560 */
3850           {    0.001162e-6,     4164.311989613,  3.408387778 },
3851           {    0.001092e-6,     6069.776754553,  3.617942651 },
3852           {    0.001008e-6,    17789.845619785,  0.286350174 },
3853           {    0.001008e-6,      639.897286314,  1.610762073 },
3854           {    0.000918e-6,    10213.285546211,  5.532798067 },
3855           {    0.001011e-6,    -6256.777530192,  0.661826484 },
3856           {    0.000753e-6,    16730.463689596,  3.905030235 },
3857           {    0.000737e-6,    11926.254413669,  4.641956361 },
3858           {    0.000694e-6,     3340.612426700,  2.111120332 },
3859           {    0.000701e-6,     3894.181829542,  2.760823491 },
3860        /* 561, 570 */
3861           {    0.000689e-6,     -135.065080035,  4.768800780 },
3862           {    0.000700e-6,    13367.972631107,  5.760439898 },
3863           {    0.000664e-6,     6040.347246017,  1.051215840 },
3864           {    0.000654e-6,     5650.292110678,  4.911332503 },
3865           {    0.000788e-6,     6681.224853400,  4.699648011 },
3866           {    0.000628e-6,     5333.900241022,  5.024608847 },
3867           {    0.000755e-6,     -110.206321219,  4.370971253 },
3868           {    0.000628e-6,     6290.189396992,  3.660478857 },
3869           {    0.000635e-6,    25132.303399966,  4.121051532 },
3870           {    0.000534e-6,     5966.683980335,  1.173284524 },
3871        /* 571, 580 */
3872           {    0.000543e-6,     -433.711737877,  0.345585464 },
3873           {    0.000517e-6,    -1990.745017041,  5.414571768 },
3874           {    0.000504e-6,     5767.611978898,  2.328281115 },
3875           {    0.000485e-6,     5753.384884897,  1.685874771 },
3876           {    0.000463e-6,     7860.419392439,  5.297703006 },
3877           {    0.000604e-6,      515.463871093,  0.591998446 },
3878           {    0.000443e-6,    12168.002696575,  4.830881244 },
3879           {    0.000570e-6,      199.072001436,  3.899190272 },
3880           {    0.000465e-6,    10969.965257698,  0.476681802 },
3881           {    0.000424e-6,    -7079.373856808,  1.112242763 },
3882        /* 581, 590 */
3883           {    0.000427e-6,      735.876513532,  1.994214480 },
3884           {    0.000478e-6,    -6127.655450557,  3.778025483 },
3885           {    0.000414e-6,    10973.555686350,  5.441088327 },
3886           {    0.000512e-6,     1589.072895284,  0.107123853 },
3887           {    0.000378e-6,    10984.192351700,  0.915087231 },
3888           {    0.000402e-6,    11371.704689758,  4.107281715 },
3889           {    0.000453e-6,     9917.696874510,  1.917490952 },
3890           {    0.000395e-6,      149.563197135,  2.763124165 },
3891           {    0.000371e-6,     5739.157790895,  3.112111866 },
3892           {    0.000350e-6,    11790.629088659,  0.440639857 },
3893        /* 591, 600 */
3894           {    0.000356e-6,     6133.512652857,  5.444568842 },
3895           {    0.000344e-6,      412.371096874,  5.676832684 },
3896           {    0.000383e-6,      955.599741609,  5.559734846 },
3897           {    0.000333e-6,     6496.374945429,  0.261537984 },
3898           {    0.000340e-6,     6055.549660552,  5.975534987 },
3899           {    0.000334e-6,     1066.495477190,  2.335063907 },
3900           {    0.000399e-6,    11506.769769794,  5.321230910 },
3901           {    0.000314e-6,    18319.536584880,  2.313312404 },
3902           {    0.000424e-6,     1052.268383188,  1.211961766 },
3903           {    0.000307e-6,       63.735898303,  3.169551388 },
3904        /* 601, 610 */
3905           {    0.000329e-6,       29.821438149,  6.106912080 },
3906           {    0.000357e-6,     6309.374169791,  4.223760346 },
3907           {    0.000312e-6,    -3738.761430108,  2.180556645 },
3908           {    0.000301e-6,      309.278322656,  1.499984572 },
3909           {    0.000268e-6,    12043.574281889,  2.447520648 },
3910           {    0.000257e-6,    12491.370101415,  3.662331761 },
3911           {    0.000290e-6,      625.670192312,  1.272834584 },
3912           {    0.000256e-6,     5429.879468239,  1.913426912 },
3913           {    0.000339e-6,     3496.032826134,  4.165930011 },
3914           {    0.000283e-6,     3930.209696220,  4.325565754 },
3915        /* 611, 620 */
3916           {    0.000241e-6,    12528.018664345,  3.832324536 },
3917           {    0.000304e-6,     4686.889407707,  1.612348468 },
3918           {    0.000259e-6,    16200.772724501,  3.470173146 },
3919           {    0.000238e-6,    12139.553509107,  1.147977842 },
3920           {    0.000236e-6,     6172.869528772,  3.776271728 },
3921           {    0.000296e-6,    -7058.598461315,  0.460368852 },
3922           {    0.000306e-6,    10575.406682942,  0.554749016 },
3923           {    0.000251e-6,    17298.182327326,  0.834332510 },
3924           {    0.000290e-6,     4732.030627343,  4.759564091 },
3925           {    0.000261e-6,     5884.926846583,  0.298259862 },
3926        /* 621, 630 */
3927           {    0.000249e-6,     5547.199336460,  3.749366406 },
3928           {    0.000213e-6,    11712.955318231,  5.415666119 },
3929           {    0.000223e-6,     4701.116501708,  2.703203558 },
3930           {    0.000268e-6,     -640.877607382,  0.283670793 },
3931           {    0.000209e-6,     5636.065016677,  1.238477199 },
3932           {    0.000193e-6,    10177.257679534,  1.943251340 },
3933           {    0.000182e-6,     6283.143160294,  2.456157599 },
3934           {    0.000184e-6,     -227.526189440,  5.888038582 },
3935           {    0.000182e-6,    -6283.008539689,  0.241332086 },
3936           {    0.000228e-6,    -6284.056171060,  2.657323816 },
3937        /* 631, 640 */
3938           {    0.000166e-6,     7238.675591600,  5.930629110 },
3939           {    0.000167e-6,     3097.883822726,  5.570955333 },
3940           {    0.000159e-6,     -323.505416657,  5.786670700 },
3941           {    0.000154e-6,    -4136.910433516,  1.517805532 },
3942           {    0.000176e-6,    12029.347187887,  3.139266834 },
3943           {    0.000167e-6,    12132.439962106,  3.556352289 },
3944           {    0.000153e-6,      202.253395174,  1.463313961 },
3945           {    0.000157e-6,    17267.268201691,  1.586837396 },
3946           {    0.000142e-6,    83996.847317911,  0.022670115 },
3947           {    0.000152e-6,    17260.154654690,  0.708528947 },
3948        /* 641, 650 */
3949           {    0.000144e-6,     6084.003848555,  5.187075177 },
3950           {    0.000135e-6,     5756.566278634,  1.993229262 },
3951           {    0.000134e-6,     5750.203491159,  3.457197134 },
3952           {    0.000144e-6,     5326.786694021,  6.066193291 },
3953           {    0.000160e-6,    11015.106477335,  1.710431974 },
3954           {    0.000133e-6,     3634.621024518,  2.836451652 },
3955           {    0.000134e-6,    18073.704938650,  5.453106665 },
3956           {    0.000134e-6,     1162.474704408,  5.326898811 },
3957           {    0.000128e-6,     5642.198242609,  2.511652591 },
3958           {    0.000160e-6,      632.783739313,  5.628785365 },
3959        /* 651, 660 */
3960           {    0.000132e-6,    13916.019109642,  0.819294053 },
3961           {    0.000122e-6,    14314.168113050,  5.677408071 },
3962           {    0.000125e-6,    12359.966151546,  5.251984735 },
3963           {    0.000121e-6,     5749.452731634,  2.210924603 },
3964           {    0.000136e-6,     -245.831646229,  1.646502367 },
3965           {    0.000120e-6,     5757.317038160,  3.240883049 },
3966           {    0.000134e-6,    12146.667056108,  3.059480037 },
3967           {    0.000137e-6,     6206.809778716,  1.867105418 },
3968           {    0.000141e-6,    17253.041107690,  2.069217456 },
3969           {    0.000129e-6,    -7477.522860216,  2.781469314 },
3970        /* 661, 670 */
3971           {    0.000116e-6,     5540.085789459,  4.281176991 },
3972           {    0.000116e-6,     9779.108676125,  3.320925381 },
3973           {    0.000129e-6,     5237.921013804,  3.497704076 },
3974           {    0.000113e-6,     5959.570433334,  0.983210840 },
3975           {    0.000122e-6,     6282.095528923,  2.674938860 },
3976           {    0.000140e-6,      -11.045700264,  4.957936982 },
3977           {    0.000108e-6,    23543.230504682,  1.390113589 },
3978           {    0.000106e-6,   -12569.674818332,  0.429631317 },
3979           {    0.000110e-6,     -266.607041722,  5.501340197 },
3980           {    0.000115e-6,    12559.038152982,  4.691456618 },
3981        /* 671, 680 */
3982           {    0.000134e-6,    -2388.894020449,  0.577313584 },
3983           {    0.000109e-6,    10440.274292604,  6.218148717 },
3984           {    0.000102e-6,     -543.918059096,  1.477842615 },
3985           {    0.000108e-6,    21228.392023546,  2.237753948 },
3986           {    0.000101e-6,    -4535.059436924,  3.100492232 },
3987           {    0.000103e-6,       76.266071276,  5.594294322 },
3988           {    0.000104e-6,      949.175608970,  5.674287810 },
3989           {    0.000101e-6,    13517.870106233,  2.196632348 },
3990           {    0.000100e-6,    11933.367960670,  4.056084160 },
3991 
3992        /* T^2 */
3993           {    4.322990e-6,     6283.075849991,  2.642893748 },
3994        /* 681, 690 */
3995           {    0.406495e-6,        0.000000000,  4.712388980 },
3996           {    0.122605e-6,    12566.151699983,  2.438140634 },
3997           {    0.019476e-6,      213.299095438,  1.642186981 },
3998           {    0.016916e-6,      529.690965095,  4.510959344 },
3999           {    0.013374e-6,       -3.523118349,  1.502210314 },
4000           {    0.008042e-6,       26.298319800,  0.478549024 },
4001           {    0.007824e-6,      155.420399434,  5.254710405 },
4002           {    0.004894e-6,     5746.271337896,  4.683210850 },
4003           {    0.004875e-6,     5760.498431898,  0.759507698 },
4004           {    0.004416e-6,     5223.693919802,  6.028853166 },
4005        /* 691, 700 */
4006           {    0.004088e-6,       -7.113547001,  0.060926389 },
4007           {    0.004433e-6,    77713.771467920,  3.627734103 },
4008           {    0.003277e-6,    18849.227549974,  2.327912542 },
4009           {    0.002703e-6,     6062.663207553,  1.271941729 },
4010           {    0.003435e-6,     -775.522611324,  0.747446224 },
4011           {    0.002618e-6,     6076.890301554,  3.633715689 },
4012           {    0.003146e-6,      206.185548437,  5.647874613 },
4013           {    0.002544e-6,     1577.343542448,  6.232904270 },
4014           {    0.002218e-6,     -220.412642439,  1.309509946 },
4015           {    0.002197e-6,     5856.477659115,  2.407212349 },
4016        /* 701, 710 */
4017           {    0.002897e-6,     5753.384884897,  5.863842246 },
4018           {    0.001766e-6,      426.598190876,  0.754113147 },
4019           {    0.001738e-6,     -796.298006816,  2.714942671 },
4020           {    0.001695e-6,      522.577418094,  2.629369842 },
4021           {    0.001584e-6,     5507.553238667,  1.341138229 },
4022           {    0.001503e-6,     -242.728603974,  0.377699736 },
4023           {    0.001552e-6,     -536.804512095,  2.904684667 },
4024           {    0.001370e-6,     -398.149003408,  1.265599125 },
4025           {    0.001889e-6,    -5573.142801634,  4.413514859 },
4026           {    0.001722e-6,     6069.776754553,  2.445966339 },
4027        /* 711, 720 */
4028           {    0.001124e-6,     1059.381930189,  5.041799657 },
4029           {    0.001258e-6,      553.569402842,  3.849557278 },
4030           {    0.000831e-6,      951.718406251,  2.471094709 },
4031           {    0.000767e-6,     4694.002954708,  5.363125422 },
4032           {    0.000756e-6,     1349.867409659,  1.046195744 },
4033           {    0.000775e-6,      -11.045700264,  0.245548001 },
4034           {    0.000597e-6,     2146.165416475,  4.543268798 },
4035           {    0.000568e-6,     5216.580372801,  4.178853144 },
4036           {    0.000711e-6,     1748.016413067,  5.934271972 },
4037           {    0.000499e-6,    12036.460734888,  0.624434410 },
4038        /* 721, 730 */
4039           {    0.000671e-6,    -1194.447010225,  4.136047594 },
4040           {    0.000488e-6,     5849.364112115,  2.209679987 },
4041           {    0.000621e-6,     6438.496249426,  4.518860804 },
4042           {    0.000495e-6,    -6286.598968340,  1.868201275 },
4043           {    0.000456e-6,     5230.807466803,  1.271231591 },
4044           {    0.000451e-6,     5088.628839767,  0.084060889 },
4045           {    0.000435e-6,     5643.178563677,  3.324456609 },
4046           {    0.000387e-6,    10977.078804699,  4.052488477 },
4047           {    0.000547e-6,   161000.685737473,  2.841633844 },
4048           {    0.000522e-6,     3154.687084896,  2.171979966 },
4049        /* 731, 740 */
4050           {    0.000375e-6,     5486.777843175,  4.983027306 },
4051           {    0.000421e-6,     5863.591206116,  4.546432249 },
4052           {    0.000439e-6,     7084.896781115,  0.522967921 },
4053           {    0.000309e-6,     2544.314419883,  3.172606705 },
4054           {    0.000347e-6,     4690.479836359,  1.479586566 },
4055           {    0.000317e-6,      801.820931124,  3.553088096 },
4056           {    0.000262e-6,      419.484643875,  0.606635550 },
4057           {    0.000248e-6,     6836.645252834,  3.014082064 },
4058           {    0.000245e-6,    -1592.596013633,  5.519526220 },
4059           {    0.000225e-6,     4292.330832950,  2.877956536 },
4060        /* 741, 750 */
4061           {    0.000214e-6,     7234.794256242,  1.605227587 },
4062           {    0.000205e-6,     5767.611978898,  0.625804796 },
4063           {    0.000180e-6,    10447.387839604,  3.499954526 },
4064           {    0.000229e-6,      199.072001436,  5.632304604 },
4065           {    0.000214e-6,      639.897286314,  5.960227667 },
4066           {    0.000175e-6,     -433.711737877,  2.162417992 },
4067           {    0.000209e-6,      515.463871093,  2.322150893 },
4068           {    0.000173e-6,     6040.347246017,  2.556183691 },
4069           {    0.000184e-6,     6309.374169791,  4.732296790 },
4070           {    0.000227e-6,   149854.400134205,  5.385812217 },
4071        /* 751, 760 */
4072           {    0.000154e-6,     8031.092263058,  5.120720920 },
4073           {    0.000151e-6,     5739.157790895,  4.815000443 },
4074           {    0.000197e-6,     7632.943259650,  0.222827271 },
4075           {    0.000197e-6,       74.781598567,  3.910456770 },
4076           {    0.000138e-6,     6055.549660552,  1.397484253 },
4077           {    0.000149e-6,    -6127.655450557,  5.333727496 },
4078           {    0.000137e-6,     3894.181829542,  4.281749907 },
4079           {    0.000135e-6,     9437.762934887,  5.979971885 },
4080           {    0.000139e-6,    -2352.866153772,  4.715630782 },
4081           {    0.000142e-6,     6812.766815086,  0.513330157 },
4082        /* 761, 770 */
4083           {    0.000120e-6,    -4705.732307544,  0.194160689 },
4084           {    0.000131e-6,   -71430.695617928,  0.000379226 },
4085           {    0.000124e-6,     6279.552731642,  2.122264908 },
4086           {    0.000108e-6,    -6256.777530192,  0.883445696 },
4087 
4088        /* T^3 */
4089           {    0.143388e-6,     6283.075849991,  1.131453581 },
4090           {    0.006671e-6,    12566.151699983,  0.775148887 },
4091           {    0.001480e-6,      155.420399434,  0.480016880 },
4092           {    0.000934e-6,      213.299095438,  6.144453084 },
4093           {    0.000795e-6,      529.690965095,  2.941595619 },
4094           {    0.000673e-6,     5746.271337896,  0.120415406 },
4095        /* 771, 780 */
4096           {    0.000672e-6,     5760.498431898,  5.317009738 },
4097           {    0.000389e-6,     -220.412642439,  3.090323467 },
4098           {    0.000373e-6,     6062.663207553,  3.003551964 },
4099           {    0.000360e-6,     6076.890301554,  1.918913041 },
4100           {    0.000316e-6,      -21.340641002,  5.545798121 },
4101           {    0.000315e-6,     -242.728603974,  1.884932563 },
4102           {    0.000278e-6,      206.185548437,  1.266254859 },
4103           {    0.000238e-6,     -536.804512095,  4.532664830 },
4104           {    0.000185e-6,      522.577418094,  4.578313856 },
4105           {    0.000245e-6,    18849.227549974,  0.587467082 },
4106        /* 781, 787 */
4107           {    0.000180e-6,      426.598190876,  5.151178553 },
4108           {    0.000200e-6,      553.569402842,  5.355983739 },
4109           {    0.000141e-6,     5223.693919802,  1.336556009 },
4110           {    0.000104e-6,     5856.477659115,  4.239842759 },
4111 
4112        /* T^4 */
4113           {    0.003826e-6,     6283.075849991,  5.705257275 },
4114           {    0.000303e-6,    12566.151699983,  5.407132842 },
4115           {    0.000209e-6,      155.420399434,  1.989815753 }
4116        };
4117 
4118 
4119     /* Time since J2000.0 in Julian millennia. */
4120        t = ((date1 - DJ00) + date2) / DJM;
4121 
4122     /* ================= */
4123     /* Topocentric terms */
4124     /* ================= */
4125 
4126     /* Convert UT to local solar time in radians. */
4127        tsol = fmod(ut, 1.0) * D2PI + elong;
4128 
4129     /* FUNDAMENTAL ARGUMENTS:  Simon et al. 1994. */
4130 
4131     /* Combine time argument (millennia) with deg/arcsec factor. */
4132        w = t / 3600.0;
4133 
4134     /* Sun Mean Longitude. */
4135        elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * DD2R;
4136 
4137     /* Sun Mean Anomaly. */
4138        emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * DD2R;
4139 
4140     /* Mean Elongation of Moon from Sun. */
4141        d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * DD2R;
4142 
4143     /* Mean Longitude of Jupiter. */
4144        elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * DD2R;
4145 
4146     /* Mean Longitude of Saturn. */
4147        els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * DD2R;
4148 
4149     /* TOPOCENTRIC TERMS:  Moyer 1981 and Murray 1983. */
4150        wt =   +  0.00029e-10 * u * sin(tsol + elsun - els)
4151               +  0.00100e-10 * u * sin(tsol - 2.0 * emsun)
4152               +  0.00133e-10 * u * sin(tsol - d)
4153               +  0.00133e-10 * u * sin(tsol + elsun - elj)
4154               -  0.00229e-10 * u * sin(tsol + 2.0 * elsun + emsun)
4155               -  0.02200e-10 * v * cos(elsun + emsun)
4156               +  0.05312e-10 * u * sin(tsol - emsun)
4157               -  0.13677e-10 * u * sin(tsol + 2.0 * elsun)
4158               -  1.31840e-10 * v * cos(elsun)
4159               +  3.17679e-10 * u * sin(tsol);
4160 
4161     /* ===================== */
4162     /* Fairhead et al. model */
4163     /* ===================== */
4164 
4165     /* T**0 */
4166        w0 = 0;
4167        for (j = 473; j >= 0; j--) {
4168           w0 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4169        }
4170 
4171     /* T**1 */
4172        w1 = 0;
4173        for (j = 678; j >= 474; j--) {
4174           w1 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4175        }
4176 
4177     /* T**2 */
4178        w2 = 0;
4179        for (j = 763; j >= 679; j--) {
4180           w2 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4181        }
4182 
4183     /* T**3 */
4184        w3 = 0;
4185        for (j = 783; j >= 764; j--) {
4186           w3 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4187        }
4188 
4189     /* T**4 */
4190        w4 = 0;
4191        for (j = 786; j >= 784; j--) {
4192           w4 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4193        }
4194 
4195     /* Multiply by powers of T and combine. */
4196        wf = t * (t * (t * (t * w4 + w3) + w2) + w1) + w0;
4197 
4198     /* Adjustments to use JPL planetary masses instead of IAU. */
4199        wj =   0.00065e-6 * sin(6069.776754 * t + 4.021194) +
4200               0.00033e-6 * sin( 213.299095 * t + 5.543132) +
4201             (-0.00196e-6 * sin(6208.294251 * t + 5.696701)) +
4202             (-0.00173e-6 * sin(  74.781599 * t + 2.435900)) +
4203               0.03638e-6 * t * t;
4204 
4205     /* ============ */
4206     /* Final result */
4207     /* ============ */
4208 
4209     /* TDB-TT in seconds. */
4210        w = wt + wf + wj;
4211 
4212        return w;
4213 
4214         }
4215     
4216 
4217     /**
4218     *  The equation of the equinoxes, compatible with IAU 2000 resolutions,
4219     *  given the nutation in longitude and the mean obliquity.
4220     *
4221     *<p>This function is derived from the International Astronomical Union's
4222     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4223     *
4224     *<p>Status:  canonical model.
4225     *
4226     *<!-- Given: -->
4227     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4228     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4229     *     @param epsa          double     mean obliquity (Note 2)
4230     *     @param dpsi          double     nutation in longitude (Note 3)
4231     *
4232     * <!-- Returned (function value): -->
4233     *  @return double    equation of the equinoxes (Note 4)
4234     *
4235     * <p>Notes:
4236     * <ol>
4237     *
4238     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4239     *     convenient way between the two arguments.  For example,
4240     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4241     *     among others:
4242     *<pre>
4243     *            date1          date2
4244     *
4245     *         2450123.7           0.0       (JD method)
4246     *         2451545.0       -1421.3       (J2000 method)
4247     *         2400000.5       50123.2       (MJD method)
4248     *         2450123.5           0.2       (date &amp; time method)
4249     *</pre>
4250     *     The JD method is the most natural and convenient to use in
4251     *     cases where the loss of several decimal digits of resolution
4252     *     is acceptable.  The J2000 method is best matched to the way
4253     *     the argument is handled internally and will deliver the
4254     *     optimum resolution.  The MJD method and the date &amp; time methods
4255     *     are both good compromises between resolution and convenience.
4256     *
4257     * <li> The obliquity, in radians, is mean of date.
4258     *
4259     * <li> The result, which is in radians, operates in the following sense:
4260     *
4261     *        Greenwich apparent ST = GMST + equation of the equinoxes
4262     *
4263     * <li> The result is compatible with the IAU 2000 resolutions.  For
4264     *     further details, see IERS Conventions 2003 and Capitaine et al.
4265     *     (2002).
4266     *</ol>
4267     *<p>Called:<ul>
4268     *     <li>{@link #jauEect00} equation of the equinoxes complementary terms
4269     * </ul>
4270     *
4271     *
4272     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4273     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4274     *     Astrophysics, 406, 1135-1149 (2003)
4275     *
4276     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4277     *     IERS Technical Note No. 32, BKG (2004)
4278     *
4279     *@version 2008 May 16
4280     *
4281     *  @since Release 20101201
4282     *
4283     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4284     */
4285     public static double jauEe00(double date1, double date2, double epsa, double dpsi)
4286     {
4287        double ee;
4288 
4289 
4290     /* Equation of the equinoxes. */
4291        ee = dpsi * cos(epsa) + jauEect00(date1, date2);
4292 
4293        return ee;
4294 
4295         }
4296     
4297 
4298     /**
4299     *  Equation of the equinoxes, compatible with IAU 2000 resolutions.
4300     *
4301     *<p>This function is derived from the International Astronomical Union's
4302     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4303     *
4304     *<p>Status:  support function.
4305     *
4306     *<!-- Given: -->
4307     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4308     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4309     *
4310     * <!-- Returned (function value): -->
4311     *  @return double    equation of the equinoxes (Note 2)
4312     *
4313     * <p>Notes:
4314     * <ol>
4315     *
4316     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4317     *     convenient way between the two arguments.  For example,
4318     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4319     *     among others:
4320     *<pre>
4321     *            date1          date2
4322     *
4323     *         2450123.7           0.0       (JD method)
4324     *         2451545.0       -1421.3       (J2000 method)
4325     *         2400000.5       50123.2       (MJD method)
4326     *         2450123.5           0.2       (date &amp; time method)
4327     *</pre>
4328     *     The JD method is the most natural and convenient to use in
4329     *     cases where the loss of several decimal digits of resolution
4330     *     is acceptable.  The J2000 method is best matched to the way
4331     *     the argument is handled internally and will deliver the
4332     *     optimum resolution.  The MJD method and the date &amp; time methods
4333     *     are both good compromises between resolution and convenience.
4334     *
4335     * <li> The result, which is in radians, operates in the following sense:
4336     *
4337     *        Greenwich apparent ST = GMST + equation of the equinoxes
4338     *
4339     * <li> The result is compatible with the IAU 2000 resolutions.  For
4340     *     further details, see IERS Conventions 2003 and Capitaine et al.
4341     *     (2002).
4342     *</ol>
4343     *<p>Called:<ul>
4344     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4345     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4346     *     <li>{@link #jauNut00a} nutation, IAU 2000A
4347     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4348     * </ul>
4349     *<p>References:
4350     *
4351     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4352     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4353     *     Astrophysics, 406, 1135-1149 (2003).
4354     *
4355     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4356     *     IERS Technical Note No. 32, BKG (2004).
4357     *
4358     *@version 2008 May 16
4359     *
4360     *  @since Release 20101201
4361     *
4362     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4363     */
4364     public static double jauEe00a(double date1, double date2)
4365     {
4366        double epsa,  ee;
4367 
4368 
4369     /* IAU 2000 precession-rate adjustments. */
4370        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4371 
4372     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4373        epsa = jauObl80(date1, date2) + nutd.depspr;
4374 
4375     /* Nutation in longitude. */
4376        NutationTerms nut = jauNut00a(date1, date2);
4377 
4378     /* Equation of the equinoxes. */
4379        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4380 
4381        return ee;
4382 
4383         }
4384     
4385 
4386     /**
4387     *  Equation of the equinoxes, compatible with IAU 2000 resolutions but
4388     *  using the truncated nutation model IAU 2000B.
4389     *
4390     *<p>This function is derived from the International Astronomical Union's
4391     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4392     *
4393     *<p>Status:  support function.
4394     *
4395     *<!-- Given: -->
4396     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4397     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4398     *
4399     * <!-- Returned (function value): -->
4400     *  @return double    equation of the equinoxes (Note 2)
4401     *
4402     * <p>Notes:
4403     * <ol>
4404     *
4405     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4406     *     convenient way between the two arguments.  For example,
4407     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4408     *     among others:
4409     *<pre>
4410     *            date1          date2
4411     *
4412     *         2450123.7           0.0       (JD method)
4413     *         2451545.0       -1421.3       (J2000 method)
4414     *         2400000.5       50123.2       (MJD method)
4415     *         2450123.5           0.2       (date &amp; time method)
4416     *</pre>
4417     *     The JD method is the most natural and convenient to use in
4418     *     cases where the loss of several decimal digits of resolution
4419     *     is acceptable.  The J2000 method is best matched to the way
4420     *     the argument is handled internally and will deliver the
4421     *     optimum resolution.  The MJD method and the date &amp; time methods
4422     *     are both good compromises between resolution and convenience.
4423     *
4424     * <li> The result, which is in radians, operates in the following sense:
4425     *
4426     *        Greenwich apparent ST = GMST + equation of the equinoxes
4427     *
4428     * <li> The result is compatible with the IAU 2000 resolutions except
4429     *     that accuracy has been compromised (1 mas) for the sake of speed.  For
4430     *     further details, see McCarthy &amp; Luzum (2001), IERS Conventions
4431     *     2003 and Capitaine et al. (2003).
4432     *</ol>
4433     *<p>Called:<ul>
4434     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4435     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4436     *     <li>{@link #jauNut00b} nutation, IAU 2000B
4437     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4438     * </ul>
4439     *
4440     *
4441     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4442     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4443     *     Astrophysics, 406, 1135-1149 (2003)
4444     *
4445     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
4446     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
4447     *     Dynamical Astronomy, 85, 37-49 (2003)
4448     *
4449     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4450     *     IERS Technical Note No. 32, BKG (2004)
4451     *
4452     *@version 2008 May 18
4453     *
4454     *  @since Release 20101201
4455     *
4456     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4457     */
4458     public static  double jauEe00b(double date1, double date2)
4459     {
4460        double  ee;
4461 
4462 
4463     /* IAU 2000 precession-rate adjustments. */
4464        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4465 
4466     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4467        double epsa = jauObl80(date1, date2) + nutd.depspr;
4468 
4469     /* Nutation in longitude. dpsi, deps*/
4470        NutationTerms nut = jauNut00b(date1, date2 );
4471 
4472     /* Equation of the equinoxes. */
4473        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4474 
4475        return ee;
4476 
4477         }
4478  
4479     /**
4480     *  Equation of the equinoxes, compatible with IAU 2000 resolutions and
4481     *  IAU 2006/2000A precession-nutation.
4482     *
4483     *<p>This function is derived from the International Astronomical Union's
4484     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4485     *
4486     *<p>Status:  support function.
4487     *
4488     *<!-- Given: -->
4489     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4490     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4491     *
4492     * <!-- Returned (function value): -->
4493     *  @return double    equation of the equinoxes (Note 2)
4494     *
4495     * <p>Notes:
4496     * <ol>
4497     *
4498     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4499     *     convenient way between the two arguments.  For example,
4500     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4501     *     among others:
4502     *<pre>
4503     *            date1          date2
4504     *
4505     *         2450123.7           0.0       (JD method)
4506     *         2451545.0       -1421.3       (J2000 method)
4507     *         2400000.5       50123.2       (MJD method)
4508     *         2450123.5           0.2       (date &amp; time method)
4509     *</pre>
4510     *     The JD method is the most natural and convenient to use in
4511     *     cases where the loss of several decimal digits of resolution
4512     *     is acceptable.  The J2000 method is best matched to the way
4513     *     the argument is handled internally and will deliver the
4514     *     optimum resolution.  The MJD method and the date &amp; time methods
4515     *     are both good compromises between resolution and convenience.
4516     *
4517     * <li> The result, which is in radians, operates in the following sense:
4518     *
4519     *        Greenwich apparent ST = GMST + equation of the equinoxes
4520     *</ol>
4521     *<p>Called:<ul>
4522     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
4523     *     <li>{@link #jauGst06a} Greenwich apparent sidereal time, IAU 2006/2000A
4524     *     <li>{@link #jauGmst06} Greenwich mean sidereal time, IAU 2006
4525     * </ul>
4526     *<p>Reference:
4527     *
4528     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
4529     *     IERS Technical Note No. 32, BKG
4530     *
4531     *@version 2008 May 18
4532     *
4533     *  @since Release 20101201
4534     *
4535     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4536     */
4537     public static double jauEe06a(double date1, double date2)
4538     {
4539        double gst06a, gmst06, ee;
4540 
4541 
4542     /* Apparent and mean sidereal times. */
4543        gst06a = jauGst06a(0.0, 0.0, date1, date2);
4544        gmst06 = jauGmst06(0.0, 0.0, date1, date2);
4545 
4546     /* Equation of the equinoxes. */
4547        ee  = jauAnpm(gst06a - gmst06);
4548 
4549        return ee;
4550 
4551         }
4552  
4553     private static class TERM {
4554         final int nfa[];      /* coefficients of l,l',F,D,Om,LVe,LE,pA */
4555         final double s, c;     /* sine and cosine coefficients */
4556         public TERM(int nfa[], double s, double c) {
4557             this.nfa = nfa;
4558             this.s = s;
4559             this.c = c;
4560         }
4561        
4562      } 
4563 
4564 
4565     /**
4566     *  Equation of the equinoxes complementary terms, consistent with
4567     *  IAU 2000 resolutions.
4568     *
4569     *<p>This function is derived from the International Astronomical Union's
4570     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4571     *
4572     *<p>Status:  canonical model.
4573     *
4574     *<!-- Given: -->
4575     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4576     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4577     *
4578     * <!-- Returned (function value): -->
4579     *  @return double   complementary terms (Note 2)
4580     *
4581     * <p>Notes:
4582     * <ol>
4583     *
4584     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4585     *     convenient way between the two arguments.  For example,
4586     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4587     *     among others:
4588     *<pre>
4589     *            date1          date2
4590     *
4591     *         2450123.7           0.0       (JD method)
4592     *         2451545.0       -1421.3       (J2000 method)
4593     *         2400000.5       50123.2       (MJD method)
4594     *         2450123.5           0.2       (date &amp; time method)
4595     *</pre>
4596     *     The JD method is the most natural and convenient to use in
4597     *     cases where the loss of several decimal digits of resolution
4598     *     is acceptable.  The J2000 method is best matched to the way
4599     *     the argument is handled internally and will deliver the
4600     *     optimum resolution.  The MJD method and the date &amp; time methods
4601     *     are both good compromises between resolution and convenience.
4602     *
4603     * <li> The "complementary terms" are part of the equation of the
4604     *     equinoxes (EE), classically the difference between apparent and
4605     *     mean Sidereal Time:
4606     *
4607     *        GAST = GMST + EE
4608     *
4609     *     with:
4610     *
4611     *        EE = dpsi * cos(eps)
4612     *
4613     *     where dpsi is the nutation in longitude and eps is the obliquity
4614     *     of date.  However, if the rotation of the Earth were constant in
4615     *     an inertial frame the classical formulation would lead to
4616     *     apparent irregularities in the UT1 timescale traceable to side-
4617     *     effects of precession-nutation.  In order to eliminate these
4618     *     effects from UT1, "complementary terms" were introduced in 1994
4619     *     (IAU, 1994) and took effect from 1997 (Capitaine and Gontier,
4620     * <li>:
4621     *
4622     *        GAST = GMST + CT + EE
4623     *
4624     *     By convention, the complementary terms are included as part of
4625     *     the equation of the equinoxes rather than as part of the mean
4626     *     Sidereal Time.  This slightly compromises the "geometrical"
4627     *     interpretation of mean sidereal time but is otherwise
4628     *     inconsequential.
4629     *
4630     *     The present function computes CT in the above expression,
4631     *     compatible with IAU 2000 resolutions (Capitaine et al., 2002, and
4632     *     IERS Conventions 2003).
4633     *</ol>
4634     *<p>Called:<ul>
4635     *     <li>{@link #jauFal03} mean anomaly of the Moon
4636     *     <li>{@link #jauFalp03} mean anomaly of the Sun
4637     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
4638     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
4639     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
4640     *     <li>{@link #jauFave03} mean longitude of Venus
4641     *     <li>{@link #jauFae03} mean longitude of Earth
4642     *     <li>{@link #jauFapa03} general accumulated precession in longitude
4643     * </ul>
4644     *<p>References:
4645     *
4646     *     <p>Capitaine, N. &amp; Gontier, A.-M., Astron. Astrophys., 275,
4647     *     645-650 (1993)
4648     *
4649     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4650     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4651     *     Astrophysics, 406, 1135-1149 (2003)
4652     *
4653     *     <p>IAU Resolution C7, Recommendation 3 (1994)
4654     *
4655     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4656     *     IERS Technical Note No. 32, BKG (2004)
4657     *
4658     *@version 2009 December 17
4659     *
4660     *  @since Release 20101201
4661     *
4662     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4663     */
4664     public static double jauEect00(double date1, double date2)
4665     {
4666     /* Time since J2000.0, in Julian centuries */
4667        double t;
4668 
4669     /* Miscellaneous */
4670        int i, j;
4671        double a, s0, s1;
4672 
4673     /* Fundamental arguments */
4674        double fa[] = new double[14];
4675 
4676     /* Returned value. */
4677        double eect;
4678 
4679     /* ----------------------------------------- */
4680     /* The series for the EE complementary terms */
4681     /* ----------------------------------------- */
4682 
4683 
4684     /* Terms of order t^0 */
4685        final TERM e0[] = {
4686 
4687        /* 1-10 */
4688           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, 2640.96e-6, -0.39e-6 ),
4689           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   63.52e-6, -0.02e-6 ),
4690           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   11.75e-6,  0.01e-6 ),
4691           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   11.21e-6,  0.01e-6 ),
4692           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},   -4.55e-6,  0.00e-6 ),
4693           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    2.02e-6,  0.00e-6 ),
4694           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    1.98e-6,  0.00e-6 ),
4695           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},   -1.72e-6,  0.00e-6 ),
4696           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},   -1.41e-6, -0.01e-6 ),
4697           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},   -1.26e-6, -0.01e-6 ),
4698 
4699        /* 11-20 */
4700           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4701           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4702           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    0.46e-6,  0.00e-6 ),
4703           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    0.45e-6,  0.00e-6 ),
4704           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    0.36e-6,  0.00e-6 ),
4705           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},   -0.24e-6, -0.12e-6 ),
4706           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    0.32e-6,  0.00e-6 ),
4707           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    0.28e-6,  0.00e-6 ),
4708           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    0.27e-6,  0.00e-6 ),
4709           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    0.26e-6,  0.00e-6 ),
4710 
4711        /* 21-30 */
4712           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},   -0.21e-6,  0.00e-6 ),
4713           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    0.19e-6,  0.00e-6 ),
4714           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    0.18e-6,  0.00e-6 ),
4715           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},   -0.10e-6,  0.05e-6 ),
4716           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    0.15e-6,  0.00e-6 ),
4717           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4718           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4719           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4720           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4721           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    0.13e-6,  0.00e-6 ),
4722 
4723        /* 31-33 */
4724           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},   -0.11e-6,  0.00e-6 ),
4725           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    0.11e-6,  0.00e-6 ),
4726           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    0.11e-6,  0.00e-6 )
4727        };
4728 
4729     /* Terms of order t^1 */
4730        final TERM e1[] = {
4731           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.87e-6,  0.00e-6 )
4732        };
4733 
4734     /* Number of terms in the series */
4735        final int NE0 = e0.length;
4736        final int NE1 = e1.length;
4737 
4738     /*--------------------------------------------------------------------*/
4739 
4740     /* Interval between fundamental epoch J2000.0 and current date (JC). */
4741        t = ((date1 - DJ00) + date2) / DJC;
4742 
4743     /* Fundamental Arguments (from IERS Conventions 2003) */
4744 
4745     /* Mean anomaly of the Moon. */
4746        fa[0] = jauFal03(t);
4747 
4748     /* Mean anomaly of the Sun. */
4749        fa[1] = jauFalp03(t);
4750 
4751     /* Mean longitude of the Moon minus that of the ascending node. */
4752        fa[2] = jauFaf03(t);
4753 
4754     /* Mean elongation of the Moon from the Sun. */
4755        fa[3] = jauFad03(t);
4756 
4757     /* Mean longitude of the ascending node of the Moon. */
4758        fa[4] = jauFaom03(t);
4759 
4760     /* Mean longitude of Venus. */
4761        fa[5] = jauFave03(t);
4762 
4763     /* Mean longitude of Earth. */
4764        fa[6] = jauFae03(t);
4765 
4766     /* General precession in longitude. */
4767        fa[7] = jauFapa03(t);
4768 
4769     /* Evaluate the EE complementary terms. */
4770        s0 = 0.0;
4771        s1 = 0.0;
4772 
4773        for (i = NE0-1; i >= 0; i--) {
4774           a = 0.0;
4775           for (j = 0; j < 8; j++) {
4776              a += (double)(e0[i].nfa[j]) * fa[j];
4777           }
4778           s0 += e0[i].s * sin(a) + e0[i].c * cos(a);
4779        }
4780 
4781        for (i = NE1-1; i >= 0; i--) {
4782           a = 0.0;
4783           for (j = 0; j < 8; j++) {
4784              a += (double)(e1[i].nfa[j]) * fa[j];
4785           }
4786           s1 += e1[i].s * sin(a) + e1[i].c * cos(a);
4787        }
4788 
4789        eect = (s0 + s1 * t ) * DAS2R;
4790 
4791        return eect;
4792 
4793         }
4794     
4795     /**
4796      * Reference Ellipsoid of Earth.
4797      * 
4798      * The ellipsoid parameters are returned in the form of equatorial
4799     *     radius in meters (a) and flattening (f).  The latter is a number
4800     *     around 0.00335, i.e. around 1/298.
4801     *
4802      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
4803      * 
4804      * @since AIDA Stage 1
4805      */
4806     public static class ReferenceEllipsoid{
4807         /** equatorial radius (meters, Note 2) */
4808         public double a; 
4809         /** flattening (Note 2) */
4810         public double f ;
4811         public ReferenceEllipsoid(double a, double f ) {
4812             this.a = a;
4813             this.f = f;
4814         }
4815     }
4816     /**
4817     *  Earth reference ellipsoids.
4818     *
4819     *<p>This function is derived from the International Astronomical Union's
4820     *  JSOFA (Standards of Fundamental Astronomy) software collection.
4821     *
4822     *<p>Status:  canonical.
4823     *
4824     *<!-- Given: -->
4825     *     @param n        int       ellipsoid identifier (Note 1)
4826     *
4827     *<!-- Returned: -->
4828     *     @return  a        double     <u>returned</u> equatorial radius (meters, Note 2)
4829     *              f        double     <u>returned</u> flattening (Note 2)
4830     *
4831     * <!-- Returned (function value): -->
4832     *  @throws JSOFAIllegalParameter int       status:
4833     *                          0 = OK
4834     *                         -1 = illegal identifier (Note 3)
4835     *
4836     * <p>Notes:
4837     * <ol>
4838     *
4839     * <li> The identifier n is a number that specifies the choice of
4840     *     reference ellipsoid.  The following are supported:
4841     *
4842     *        n   ellipsoid
4843     *
4844     *        1    WGS84
4845     *        2    GRS80
4846     *        3    WGS72
4847     *
4848     *     The number n has no significance outside the JSOFA software.
4849     *
4850     * <li> The ellipsoid parameters are returned in the form of equatorial
4851     *     radius in meters (a) and flattening (f).  The latter is a number
4852     *     around 0.00335, i.e. around 1/298.
4853     *
4854     * <li> For the case where an unsupported n value is supplied, zero a and
4855     *     f are returned, as well as error status.
4856     *</ol>
4857     *<p>References:
4858     *
4859     *     <p>Department of Defense World Geodetic System 1984, National
4860     *     Imagery and Mapping Agency Technical Report 8350.2, Third
4861     *     Edition, p3-2.
4862     *
4863     *     <p>Moritz, H., Bull. Geodesique 66-2, 187 (1992).
4864     *
4865     *     <p>The Department of Defense World Geodetic System 1972, World
4866     *     Geodetic System Committee, May 1974.
4867     *
4868     *     <p>Explanatory Supplement to the Astronomical Almanac,
4869     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
4870     *     p220.
4871     *
4872     *@version 2010 January 18
4873     *
4874     *  @since Release 20101201
4875     *
4876     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4877     */
4878     public static  ReferenceEllipsoid jauEform ( int n ) throws JSOFAIllegalParameter
4879     {
4880       double a,f;
4881     /* Look up a and f for the specified reference ellipsoid. */
4882        switch ( n ) {
4883        case 1:
4884 
4885        /* WGS84. */
4886           a = 6378137.0;
4887           f = 1.0 / 298.257223563;
4888           break;
4889 
4890        case 2:
4891 
4892        /* GRS80. */
4893           a = 6378137.0;
4894           f = 1.0 / 298.257222101;
4895           break;
4896 
4897        case 3:
4898 
4899        /* WGS72. */
4900           a = 6378135.0;
4901           f = 1.0 / 298.26;
4902           break;
4903 
4904        default:
4905 
4906        /* Invalid identifier. */
4907           a = 0.0;
4908           f = 0.0;
4909           throw new JSOFAIllegalParameter("illegal ellipsoid identifier", -1);
4910 
4911        }
4912 
4913     /* OK status. */
4914        return new ReferenceEllipsoid(a, f);
4915 
4916     
4917     }
4918     
4919 
4920     /**
4921     *  Equation of the origins, IAU 2006 precession and IAU 2000A nutation.
4922     *
4923     *<p>This function is derived from the International Astronomical Union's
4924     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4925     *
4926     *<p>Status:  support function.
4927     *
4928     *<!-- Given: -->
4929     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4930     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4931     *
4932     * <!-- Returned (function value): -->
4933     *  @return double    the equation of the origins in radians
4934     *
4935     * <p>Notes:
4936     * <ol>
4937     *
4938     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4939     *     convenient way between the two arguments.  For example,
4940     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4941     *     among others:
4942     *<pre>
4943     *            date1          date2
4944     *
4945     *         2450123.7           0.0       (JD method)
4946     *         2451545.0       -1421.3       (J2000 method)
4947     *         2400000.5       50123.2       (MJD method)
4948     *         2450123.5           0.2       (date &amp; time method)
4949     *</pre>
4950     *     The JD method is the most natural and convenient to use in
4951     *     cases where the loss of several decimal digits of resolution
4952     *     is acceptable.  The J2000 method is best matched to the way
4953     *     the argument is handled internally and will deliver the
4954     *     optimum resolution.  The MJD method and the date &amp; time methods
4955     *     are both good compromises between resolution and convenience.
4956     *
4957     * <li> The equation of the origins is the distance between the true
4958     *     equinox and the celestial intermediate origin and, equivalently,
4959     *     the difference between Earth rotation angle and Greenwich
4960     *     apparent sidereal time (ERA-GST).  It comprises the precession
4961     *     (since J2000.0) in right ascension plus the equation of the
4962     *     equinoxes (including the small correction terms).
4963     *</ol>
4964     *<p>Called:<ul>
4965     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
4966     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
4967     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
4968     *     <li>{@link #jauEors} equation of the origins, Given NPB matrix and s
4969     * </ul>
4970     *<p>References:
4971     *
4972     *     <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
4973     *
4974     *     <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
4975     *
4976     *@version 2008 May 16
4977     *
4978     *  @since Release 20101201
4979     *
4980     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4981     */
4982     public static double jauEo06a(double date1, double date2)
4983     {
4984        double r[][], s, eo;
4985 
4986 
4987     /* Classical nutation x precession x bias matrix. */
4988        r = jauPnm06a(date1, date2);
4989 
4990     /* Extract CIP coordinates. */
4991        CelestialIntermediatePole cip = jauBpn2xy(r);
4992 
4993     /* The CIO locator, s. */
4994        s = jauS06(date1, date2, cip.x, cip.y);
4995 
4996     /* Solve for the EO. */
4997        eo = jauEors(r, s);
4998 
4999        return eo;
5000 
5001         }
5002     
5003 
5004     /**
5005     *  Equation of the origins, given the classical NPB matrix and the
5006     *  quantity s.
5007     *
5008     *<p>This function is derived from the International Astronomical Union's
5009     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5010     *
5011     *<p>Status:  support function.
5012     *
5013     *<!-- Given: -->
5014     *     @param rnpb   double[3][3]   classical nutation x precession x bias matrix
5015     *     @param s      double         the quantity s (the CIO locator) in radians
5016     *
5017     * <!-- Returned (function value): -->
5018     *  @return double        the equation of the origins in radians.
5019     *
5020     * <p>Notes:
5021     * <ol>
5022     *
5023     * <li>  The equation of the origins is the distance between the true
5024     *      equinox and the celestial intermediate origin and, equivalently,
5025     *      the difference between Earth rotation angle and Greenwich
5026     *      apparent sidereal time (ERA-GST).  It comprises the precession
5027     *      (since J2000.0) in right ascension plus the equation of the
5028     *      equinoxes (including the small correction terms).
5029     *
5030     * <li>  The algorithm is from Wallace &amp; Capitaine (2006).
5031     *</ol>
5032     * References:
5033     *
5034     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
5035     *
5036     *    <p>Wallace, P. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
5037     *
5038     *@version 2008 May 26
5039     *
5040     *  @since Release 20101201
5041     *
5042     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5043     */
5044     public static double jauEors(double rnpb[][], double s)
5045     {
5046        double x, ax, xs, ys, zs, p, q, eo;
5047 
5048 
5049     /* Evaluate Wallace &amp; Capitaine (2006) expression (16). */
5050        x = rnpb[2][0];
5051        ax = x / (1.0 + rnpb[2][2]);
5052        xs = 1.0 - ax * x;
5053        ys = -ax * rnpb[2][1];
5054        zs = -x;
5055        p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs;
5056        q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs;
5057        eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s;
5058 
5059        return eo;
5060 
5061         }
5062     
5063 
5064     /**
5065     *  Julian Date to Besselian Epoch.
5066     *
5067     *<p>This function is derived from the International Astronomical Union's
5068     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5069     *
5070     *<p>Status:  support function.
5071     *
5072     *<!-- Given: -->
5073     *     @param dj1 double      Julian Date (see note)
5074     *     @param dj2 double      Julian Date (see note) 
5075     *
5076     * <!-- Returned (function value): -->
5077     *  @return double     Besselian Epoch.
5078     *
5079     *  Note:
5080     *
5081     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5082     *     manner, which is designed to preserve time resolution.  The
5083     *     Julian Date is available as a single number by adding dj1 and
5084     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5085     *     (J2000.0).
5086     *
5087     *<p>Reference:
5088     *
5089     *     Lieske,J.H., 1979. Astron.Astrophys.,73,282.
5090     *
5091     *@version 2009 December 16
5092     *
5093     *  @since Release 20101201
5094     *
5095     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5096     */
5097     public static double jauEpb(double dj1, double dj2)
5098     {
5099     /* J2000.0 minus B1900.0 (2415019.81352) in Julian days */
5100        final double D1900 = 36524.68648;
5101 
5102        return 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
5103 
5104         }
5105     
5106     /**
5107     *  Besselian Epoch to Julian Date.
5108     *
5109     *<p>This function is derived from the International Astronomical Union's
5110     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5111     *
5112     *<p>Status:  support function.
5113     *
5114     *<!-- Given: -->
5115     *     @param epb       double     Besselian Epoch (e.g. 1957.3D0)
5116     *
5117     *<!-- Returned: -->
5118     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5119     *
5120     *  Note:
5121     *
5122     *     The Julian Date is returned in two pieces, in the usual JSOFA
5123     *     manner, which is designed to preserve time resolution.  The
5124     *     Julian Date is available as a single number by adding djm0 and
5125     *     djm.
5126     *
5127     *<p>Reference:
5128     *
5129     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5130     *
5131     *@version 2008 May 24
5132     *
5133     *  @since Release 20101201
5134     *
5135     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5136     */
5137     public static JulianDate jauEpb2jd(double epb)
5138     {
5139         double djm0, djm;
5140        djm0 = 2400000.5;
5141        djm  =   15019.81352 + (epb - 1900.0) * DTY;
5142 
5143        return new JulianDate(djm0, djm);
5144 
5145         }
5146     
5147 
5148     /**
5149     *  Julian Date to Julian Epoch.
5150     *
5151     *<p>This function is derived from the International Astronomical Union's
5152     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5153     *
5154     *<p>Status:  support function.
5155     *
5156     *<!-- Given: -->
5157     *     @param dj1 double      Julian Date (see note)
5158     *     @param dj2 double      Julian Date (see note) 
5159     *
5160     * <!-- Returned (function value): -->
5161     *  @return double     Julian Epoch
5162     *
5163     *  Note:
5164     *
5165     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5166     *     manner, which is designed to preserve time resolution.  The
5167     *     Julian Date is available as a single number by adding dj1 and
5168     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5169     *     (J2000.0).
5170     *
5171     *<p>Reference:
5172     *
5173     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5174     *
5175     *@version 2009 December 16
5176     *
5177     *  @since Release 20101201
5178     *
5179     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5180     */
5181     public static double jauEpj(double dj1, double dj2)
5182     {
5183        return 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
5184 
5185      }
5186     
5187 
5188     /**
5189     *  Julian Epoch to Julian Date.
5190     *
5191     *<p>This function is derived from the International Astronomical Union's
5192     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5193     *
5194     *<p>Status:  support function.
5195     *
5196     *<!-- Given: -->
5197     *     @param epj       double     Julian Epoch (e.g. 1996.8D0)
5198     *
5199     *<!-- Returned: -->
5200     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5201     *
5202     *  Note:
5203     *
5204     *     The Julian Date is returned in two pieces, in the usual JSOFA
5205     *     manner, which is designed to preserve time resolution.  The
5206     *     Julian Date is available as a single number by adding djm0 and
5207     *     djm.
5208     *
5209     *<p>Reference:
5210     *
5211     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5212     *
5213     *@version 2008 May 11
5214     *
5215     *  @since Release 20101201
5216     *
5217     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5218     */
5219     public static JulianDate jauEpj2jd(double epj)
5220     {
5221        double djm0, djm;
5222        djm0 = 2400000.5;
5223        djm  =   51544.5 + (epj - 2000.0) * 365.25;
5224 
5225        return new JulianDate(djm0, djm);
5226 
5227         }
5228     
5229 
5230     /*
5231      * A utility class to get round 65536 byte limit on functions in java - The static initializer is too large on its own. - So split into two classes for no real semantic reason
5232      */        
5233     static private final class Ephemeris extends SSB {
5234        
5235 
5236     /**
5237     * ----------------------
5238     * Ephemeris Coefficients
5239     * ----------------------
5240     *
5241     * The ephemeris consists of harmonic terms for predicting (i) the Sun
5242     * to Earth vector and (ii) the Solar-System-barycenter to Sun vector
5243     * respectively.  The coefficients are stored in arrays which, although
5244     * 1-demensional, contain groups of three.  Each triplet of
5245     * coefficients is the amplitude, phase and frequency for one term in
5246     * the model, and each array contains the number of terms called for by
5247     * the model.
5248     *
5249     * There are eighteen such arrays, named as follows:
5250     *<pre>
5251     *     array         model      power of T      component
5252     *
5253     *      e0x      Sun-to-Earth        0              x
5254     *      e0y      Sun-to-Earth        0              y
5255     *      e0z      Sun-to-Earth        0              z
5256     *
5257     *      e1x      Sun-to-Earth        1              x
5258     *      e1y      Sun-to-Earth        1              y
5259     *      e1z      Sun-to-Earth        1              z
5260     *
5261     *      e2x      Sun-to-Earth        2              x
5262     *      e2y      Sun-to-Earth        2              y
5263     *      e2z      Sun-to-Earth        2              z
5264     *
5265     *      s0x      SSB-to-Sun          0              x
5266     *      s0y      SSB-to-Sun          0              y
5267     *      s0z      SSB-to-Sun          0              z
5268     *
5269     *      s1x      SSB-to-Sun          1              x
5270     *      s1y      SSB-to-Sun          1              y
5271     *      s1z      SSB-to-Sun          1              z
5272     *
5273     *      s2x      SSB-to-Sun          2              x
5274     *      s2y      SSB-to-Sun          2              y
5275     *      s2z      SSB-to-Sun          2              z
5276     *<pre>
5277     */
5278 
5279     /* Sun-to-Earth, T^0, X */
5280       static final double e0x[] = {
5281           0.9998292878132e+00, 0.1753485171504e+01, 0.6283075850446e+01,
5282           0.8352579567414e-02, 0.1710344404582e+01, 0.1256615170089e+02,
5283           0.5611445335148e-02, 0.0000000000000e+00, 0.0000000000000e+00,
5284           0.1046664295572e-03, 0.1667225416770e+01, 0.1884922755134e+02,
5285           0.3110842534677e-04, 0.6687513390251e+00, 0.8399684731857e+02,
5286           0.2552413503550e-04, 0.5830637358413e+00, 0.5296909721118e+00,
5287           0.2137207845781e-04, 0.1092330954011e+01, 0.1577343543434e+01,
5288           0.1680240182951e-04, 0.4955366134987e+00, 0.6279552690824e+01,
5289           0.1679012370795e-04, 0.6153014091901e+01, 0.6286599010068e+01,
5290           0.1445526946777e-04, 0.3472744100492e+01, 0.2352866153506e+01,
5291 
5292           0.1091038246184e-04, 0.3689845786119e+01, 0.5223693906222e+01,
5293           0.9344399733932e-05, 0.6073934645672e+01, 0.1203646072878e+02,
5294           0.8993182910652e-05, 0.3175705249069e+01, 0.1021328554739e+02,
5295           0.5665546034116e-05, 0.2152484672246e+01, 0.1059381944224e+01,
5296           0.6844146703035e-05, 0.1306964099750e+01, 0.5753384878334e+01,
5297           0.7346610905565e-05, 0.4354980070466e+01, 0.3981490189893e+00,
5298           0.6815396474414e-05, 0.2218229211267e+01, 0.4705732307012e+01,
5299           0.6112787253053e-05, 0.5384788425458e+01, 0.6812766822558e+01,
5300           0.4518120711239e-05, 0.6087604012291e+01, 0.5884926831456e+01,
5301           0.4521963430706e-05, 0.1279424524906e+01, 0.6256777527156e+01,
5302 
5303           0.4497426764085e-05, 0.5369129144266e+01, 0.6309374173736e+01,
5304           0.4062190566959e-05, 0.5436473303367e+00, 0.6681224869435e+01,
5305           0.5412193480192e-05, 0.7867838528395e+00, 0.7755226100720e+00,
5306           0.5469839049386e-05, 0.1461440311134e+01, 0.1414349524433e+02,
5307           0.5205264083477e-05, 0.4432944696116e+01, 0.7860419393880e+01,
5308           0.2149759935455e-05, 0.4502237496846e+01, 0.1150676975667e+02,
5309           0.2279109618501e-05, 0.1239441308815e+01, 0.7058598460518e+01,
5310           0.2259282939683e-05, 0.3272430985331e+01, 0.4694002934110e+01,
5311           0.2558950271319e-05, 0.2265471086404e+01, 0.1216800268190e+02,
5312           0.2561581447555e-05, 0.1454740653245e+01, 0.7099330490126e+00,
5313 
5314           0.1781441115440e-05, 0.2962068630206e+01, 0.7962980379786e+00,
5315           0.1612005874644e-05, 0.1473255041006e+01, 0.5486777812467e+01,
5316           0.1818630667105e-05, 0.3743903293447e+00, 0.6283008715021e+01,
5317           0.1818601377529e-05, 0.6274174354554e+01, 0.6283142985870e+01,
5318           0.1554475925257e-05, 0.1624110906816e+01, 0.2513230340178e+02,
5319           0.2090948029241e-05, 0.5852052276256e+01, 0.1179062909082e+02,
5320           0.2000176345460e-05, 0.4072093298513e+01, 0.1778984560711e+02,
5321           0.1289535917759e-05, 0.5217019331069e+01, 0.7079373888424e+01,
5322           0.1281135307881e-05, 0.4802054538934e+01, 0.3738761453707e+01,
5323           0.1518229005692e-05, 0.8691914742502e+00, 0.2132990797783e+00,
5324 
5325           0.9450128579027e-06, 0.4601859529950e+01, 0.1097707878456e+02,
5326           0.7781119494996e-06, 0.1844352816694e+01, 0.8827390247185e+01,
5327           0.7733407759912e-06, 0.3582790154750e+01, 0.5507553240374e+01,
5328           0.7350644318120e-06, 0.2695277788230e+01, 0.1589072916335e+01,
5329           0.6535928827023e-06, 0.3651327986142e+01, 0.1176985366291e+02,
5330           0.6324624183656e-06, 0.2241302375862e+01, 0.6262300422539e+01,
5331           0.6298565300557e-06, 0.4407122406081e+01, 0.6303851278352e+01,
5332           0.8587037089179e-06, 0.3024307223119e+01, 0.1672837615881e+03,
5333           0.8299954491035e-06, 0.6192539428237e+01, 0.3340612434717e+01,
5334           0.6311263503401e-06, 0.2014758795416e+01, 0.7113454667900e-02,
5335 
5336           0.6005646745452e-06, 0.3399500503397e+01, 0.4136910472696e+01,
5337           0.7917715109929e-06, 0.2493386877837e+01, 0.6069776770667e+01,
5338           0.7556958099685e-06, 0.4159491740143e+01, 0.6496374930224e+01,
5339           0.6773228244949e-06, 0.4034162934230e+01, 0.9437762937313e+01,
5340           0.5370708577847e-06, 0.1562219163734e+01, 0.1194447056968e+01,
5341           0.5710804266203e-06, 0.2662730803386e+01, 0.6282095334605e+01,
5342           0.5709824583726e-06, 0.3985828430833e+01, 0.6284056366286e+01,
5343           0.5143950896447e-06, 0.1308144688689e+01, 0.6290189305114e+01,
5344           0.5088010604546e-06, 0.5352817214804e+01, 0.6275962395778e+01,
5345           0.4960369085172e-06, 0.2644267922349e+01, 0.6127655567643e+01,
5346 
5347           0.4803137891183e-06, 0.4008844192080e+01, 0.6438496133249e+01,
5348           0.5731747768225e-06, 0.3794550174597e+01, 0.3154687086868e+01,
5349           0.4735947960579e-06, 0.6107118308982e+01, 0.3128388763578e+01,
5350           0.4808348796625e-06, 0.4771458618163e+01, 0.8018209333619e+00,
5351           0.4115073743137e-06, 0.3327111335159e+01, 0.8429241228195e+01,
5352           0.5230575889287e-06, 0.5305708551694e+01, 0.1336797263425e+02,
5353           0.5133977889215e-06, 0.5784230738814e+01, 0.1235285262111e+02,
5354           0.5065815825327e-06, 0.2052064793679e+01, 0.1185621865188e+02,
5355           0.4339831593868e-06, 0.3644994195830e+01, 0.1726015463500e+02,
5356           0.3952928638953e-06, 0.4930376436758e+01, 0.5481254917084e+01,
5357 
5358           0.4898498111942e-06, 0.4542084219731e+00, 0.9225539266174e+01,
5359           0.4757490209328e-06, 0.3161126388878e+01, 0.5856477690889e+01,
5360           0.4727701669749e-06, 0.6214993845446e+00, 0.2544314396739e+01,
5361           0.3800966681863e-06, 0.3040132339297e+01, 0.4265981595566e+00,
5362           0.3257301077939e-06, 0.8064977360087e+00, 0.3930209696940e+01,
5363           0.3255810528674e-06, 0.1974147981034e+01, 0.2146165377750e+01,
5364           0.3252029748187e-06, 0.2845924913135e+01, 0.4164311961999e+01,
5365           0.3255505635308e-06, 0.3017900824120e+01, 0.5088628793478e+01,
5366           0.2801345211990e-06, 0.6109717793179e+01, 0.1256967486051e+02,
5367           0.3688987740970e-06, 0.2911550235289e+01, 0.1807370494127e+02,
5368 
5369           0.2475153429458e-06, 0.2179146025856e+01, 0.2629832328990e-01,
5370           0.3033457749150e-06, 0.1994161050744e+01, 0.4535059491685e+01,
5371           0.2186743763110e-06, 0.5125687237936e+01, 0.1137170464392e+02,
5372           0.2764777032774e-06, 0.4822646860252e+00, 0.1256262854127e+02,
5373           0.2199028768592e-06, 0.4637633293831e+01, 0.1255903824622e+02,
5374           0.2046482824760e-06, 0.1467038733093e+01, 0.7084896783808e+01,
5375           0.2611209147507e-06, 0.3044718783485e+00, 0.7143069561767e+02,
5376           0.2286079656818e-06, 0.4764220356805e+01, 0.8031092209206e+01,
5377           0.1855071202587e-06, 0.3383637774428e+01, 0.1748016358760e+01,
5378           0.2324669506784e-06, 0.6189088449251e+01, 0.1831953657923e+02,
5379 
5380           0.1709528015688e-06, 0.5874966729774e+00, 0.4933208510675e+01,
5381           0.2168156875828e-06, 0.4302994009132e+01, 0.1044738781244e+02,
5382           0.2106675556535e-06, 0.3800475419891e+01, 0.7477522907414e+01,
5383           0.1430213830465e-06, 0.1294660846502e+01, 0.2942463415728e+01,
5384           0.1388396901944e-06, 0.4594797202114e+01, 0.8635942003952e+01,
5385           0.1922258844190e-06, 0.4943044543591e+00, 0.1729818233119e+02,
5386           0.1888460058292e-06, 0.2426943912028e+01, 0.1561374759853e+03,
5387           0.1789449386107e-06, 0.1582973303499e+00, 0.1592596075957e+01,
5388           0.1360803685374e-06, 0.5197240440504e+01, 0.1309584267300e+02,
5389           0.1504038014709e-06, 0.3120360916217e+01, 0.1649636139783e+02,
5390 
5391           0.1382769533389e-06, 0.6164702888205e+01, 0.7632943190217e+01,
5392           0.1438059769079e-06, 0.1437423770979e+01, 0.2042657109477e+02,
5393           0.1326303260037e-06, 0.3609688799679e+01, 0.1213955354133e+02,
5394           0.1159244950540e-06, 0.5463018167225e+01, 0.5331357529664e+01,
5395           0.1433118149136e-06, 0.6028909912097e+01, 0.7342457794669e+01,
5396           0.1234623148594e-06, 0.3109645574997e+01, 0.6279485555400e+01,
5397           0.1233949875344e-06, 0.3539359332866e+01, 0.6286666145492e+01,
5398           0.9927196061299e-07, 0.1259321569772e+01, 0.7234794171227e+01,
5399           0.1242302191316e-06, 0.1065949392609e+01, 0.1511046609763e+02,
5400           0.1098402195201e-06, 0.2192508743837e+01, 0.1098880815746e+02,
5401 
5402           0.1158191395315e-06, 0.4054411278650e+01, 0.5729506548653e+01,
5403           0.9048475596241e-07, 0.5429764748518e+01, 0.9623688285163e+01,
5404           0.8889853269023e-07, 0.5046586206575e+01, 0.6148010737701e+01,
5405           0.1048694242164e-06, 0.2628858030806e+01, 0.6836645152238e+01,
5406           0.1112308378646e-06, 0.4177292719907e+01, 0.1572083878776e+02,
5407           0.8631729709901e-07, 0.1601345232557e+01, 0.6418140963190e+01,
5408           0.8527816951664e-07, 0.2463888997513e+01, 0.1471231707864e+02,
5409           0.7892139456991e-07, 0.3154022088718e+01, 0.2118763888447e+01,
5410           0.1051782905236e-06, 0.4795035816088e+01, 0.1349867339771e+01,
5411           0.1048219943164e-06, 0.2952983395230e+01, 0.5999216516294e+01,
5412 
5413           0.7435760775143e-07, 0.5420547991464e+01, 0.6040347114260e+01,
5414           0.9869574106949e-07, 0.3695646753667e+01, 0.6566935184597e+01,
5415           0.9156886364226e-07, 0.3922675306609e+01, 0.5643178611111e+01,
5416           0.7006834356188e-07, 0.1233968624861e+01, 0.6525804586632e+01,
5417           0.9806170182601e-07, 0.1919542280684e+01, 0.2122839202813e+02,
5418           0.9052289673607e-07, 0.4615902724369e+01, 0.4690479774488e+01,
5419           0.7554200867893e-07, 0.1236863719072e+01, 0.1253985337760e+02,
5420           0.8215741286498e-07, 0.3286800101559e+00, 0.1097355562493e+02,
5421           0.7185178575397e-07, 0.5880942158367e+01, 0.6245048154254e+01,
5422           0.7130726476180e-07, 0.7674871987661e+00, 0.6321103546637e+01,
5423 
5424           0.6650894461162e-07, 0.6987129150116e+00, 0.5327476111629e+01,
5425           0.7396888823688e-07, 0.3576824794443e+01, 0.5368044267797e+00,
5426           0.7420588884775e-07, 0.5033615245369e+01, 0.2354323048545e+02,
5427           0.6141181642908e-07, 0.9449927045673e+00, 0.1296430071988e+02,
5428           0.6373557924058e-07, 0.6206342280341e+01, 0.9517183207817e+00,
5429           0.6359474329261e-07, 0.5036079095757e+01, 0.1990745094947e+01,
5430           0.5740173582646e-07, 0.6105106371350e+01, 0.9555997388169e+00,
5431           0.7019864084602e-07, 0.7237747359018e+00, 0.5225775174439e+00,
5432           0.6398054487042e-07, 0.3976367969666e+01, 0.2407292145756e+02,
5433           0.7797092650498e-07, 0.4305423910623e+01, 0.2200391463820e+02,
5434 
5435           0.6466760000900e-07, 0.3500136825200e+01, 0.5230807360890e+01,
5436           0.7529417043890e-07, 0.3514779246100e+01, 0.1842262939178e+02,
5437           0.6924571140892e-07, 0.2743457928679e+01, 0.1554202828031e+00,
5438           0.6220798650222e-07, 0.2242598118209e+01, 0.1845107853235e+02,
5439           0.5870209391853e-07, 0.2332832707527e+01, 0.6398972393349e+00,
5440           0.6263953473888e-07, 0.2191105358956e+01, 0.6277552955062e+01,
5441           0.6257781390012e-07, 0.4457559396698e+01, 0.6288598745829e+01,
5442           0.5697304945123e-07, 0.3499234761404e+01, 0.1551045220144e+01,
5443           0.6335438746791e-07, 0.6441691079251e+00, 0.5216580451554e+01,
5444           0.6377258441152e-07, 0.2252599151092e+01, 0.5650292065779e+01,
5445 
5446           0.6484841818165e-07, 0.1992812417646e+01, 0.1030928125552e+00,
5447           0.4735551485250e-07, 0.3744672082942e+01, 0.1431416805965e+02,
5448           0.4628595996170e-07, 0.1334226211745e+01, 0.5535693017924e+00,
5449           0.6258152336933e-07, 0.4395836159154e+01, 0.2608790314060e+02,
5450           0.6196171366594e-07, 0.2587043007997e+01, 0.8467247584405e+02,
5451           0.6159556952126e-07, 0.4782499769128e+01, 0.2394243902548e+03,
5452           0.4987741172394e-07, 0.7312257619924e+00, 0.7771377146812e+02,
5453           0.5459280703142e-07, 0.3001376372532e+01, 0.6179983037890e+01,
5454           0.4863461189999e-07, 0.3767222128541e+01, 0.9027992316901e+02,
5455           0.5349912093158e-07, 0.3663594450273e+01, 0.6386168663001e+01,
5456 
5457           0.5673725607806e-07, 0.4331187919049e+01, 0.6915859635113e+01,
5458           0.4745485060512e-07, 0.5816195745518e+01, 0.6282970628506e+01,
5459           0.4745379005326e-07, 0.8323672435672e+00, 0.6283181072386e+01,
5460           0.4049002796321e-07, 0.3785023976293e+01, 0.6254626709878e+01,
5461           0.4247084014515e-07, 0.2378220728783e+01, 0.7875671926403e+01,
5462           0.4026912363055e-07, 0.2864103423269e+01, 0.6311524991013e+01,
5463           0.4062935011774e-07, 0.2415408595975e+01, 0.3634620989887e+01,
5464           0.5347771048509e-07, 0.3343479309801e+01, 0.2515860172507e+02,
5465           0.4829494136505e-07, 0.2821742398262e+01, 0.5760498333002e+01,
5466           0.4342554404599e-07, 0.5624662458712e+01, 0.7238675589263e+01,
5467 
5468           0.4021599184361e-07, 0.5557250275009e+00, 0.1101510648075e+02,
5469           0.4104900474558e-07, 0.3296691780005e+01, 0.6709674010002e+01,
5470           0.4376532905131e-07, 0.3814443999443e+01, 0.6805653367890e+01,
5471           0.3314590480650e-07, 0.3560229189250e+01, 0.1259245002418e+02,
5472           0.3232421839643e-07, 0.5185389180568e+01, 0.1066495398892e+01,
5473           0.3541176318876e-07, 0.3921381909679e+01, 0.9917696840332e+01,
5474           0.3689831242681e-07, 0.4190658955386e+01, 0.1192625446156e+02,
5475           0.3890605376774e-07, 0.5546023371097e+01, 0.7478166569050e-01,
5476           0.3038559339780e-07, 0.6231032794494e+01, 0.1256621883632e+02,
5477           0.3137083969782e-07, 0.6207063419190e+01, 0.4292330755499e+01,
5478 
5479           0.4024004081854e-07, 0.1195257375713e+01, 0.1334167431096e+02,
5480           0.3300234879283e-07, 0.1804694240998e+01, 0.1057540660594e+02,
5481           0.3635399155575e-07, 0.5597811343500e+01, 0.6208294184755e+01,
5482           0.3032668691356e-07, 0.3191059366530e+01, 0.1805292951336e+02,
5483           0.2809652069058e-07, 0.4094348032570e+01, 0.3523159621801e-02,
5484           0.3696955383823e-07, 0.5219282738794e+01, 0.5966683958112e+01,
5485           0.3562894142503e-07, 0.1037247544554e+01, 0.6357857516136e+01,
5486           0.3510598524148e-07, 0.1430020816116e+01, 0.6599467742779e+01,
5487           0.3617736142953e-07, 0.3002911403677e+01, 0.6019991944201e+01,
5488           0.2624524910730e-07, 0.2437046757292e+01, 0.6702560555334e+01,
5489 
5490           0.2535824204490e-07, 0.1581594689647e+01, 0.3141537925223e+02,
5491           0.3519787226257e-07, 0.5379863121521e+01, 0.2505706758577e+03,
5492           0.2578406709982e-07, 0.4904222639329e+01, 0.1673046366289e+02,
5493           0.3423887981473e-07, 0.3646448997315e+01, 0.6546159756691e+01,
5494           0.2776083886467e-07, 0.3307829300144e+01, 0.1272157198369e+02,
5495           0.3379592818379e-07, 0.1747541251125e+01, 0.1494531617769e+02,
5496           0.3050255426284e-07, 0.1784689432607e-01, 0.4732030630302e+01,
5497           0.2652378350236e-07, 0.4420055276260e+01, 0.5863591145557e+01,
5498           0.2374498173768e-07, 0.3629773929208e+01, 0.2388894113936e+01,
5499           0.2716451255140e-07, 0.3079623706780e+01, 0.1202934727411e+02,
5500 
5501           0.3038583699229e-07, 0.3312487903507e+00, 0.1256608456547e+02,
5502           0.2220681228760e-07, 0.5265520401774e+01, 0.1336244973887e+02,
5503           0.3044156540912e-07, 0.4766664081250e+01, 0.2908881142201e+02,
5504           0.2731859923561e-07, 0.5069146530691e+01, 0.1391601904066e+02,
5505           0.2285603018171e-07, 0.5954935112271e+01, 0.6076890225335e+01,
5506           0.2025006454555e-07, 0.4061789589267e+01, 0.4701116388778e+01,
5507           0.2012597519804e-07, 0.2485047705241e+01, 0.6262720680387e+01,
5508           0.2003406962258e-07, 0.4163779209320e+01, 0.6303431020504e+01,
5509           0.2207863441371e-07, 0.6923839133828e+00, 0.6489261475556e+01,
5510           0.2481374305624e-07, 0.5944173595676e+01, 0.1204357418345e+02,
5511 
5512           0.2130923288870e-07, 0.4641013671967e+01, 0.5746271423666e+01,
5513           0.2446370543391e-07, 0.6125796518757e+01, 0.1495633313810e+00,
5514           0.1932492759052e-07, 0.2234572324504e+00, 0.1352175143971e+02,
5515           0.2600122568049e-07, 0.4281012405440e+01, 0.4590910121555e+01,
5516           0.2431754047488e-07, 0.1429943874870e+00, 0.1162474756779e+01,
5517           0.1875902869209e-07, 0.9781803816948e+00, 0.6279194432410e+01,
5518           0.1874381139426e-07, 0.5670368130173e+01, 0.6286957268481e+01,
5519           0.2156696047173e-07, 0.2008985006833e+01, 0.1813929450232e+02,
5520           0.1965076182484e-07, 0.2566186202453e+00, 0.4686889479442e+01,
5521           0.2334816372359e-07, 0.4408121891493e+01, 0.1002183730415e+02,
5522 
5523           0.1869937408802e-07, 0.5272745038656e+01, 0.2427287361862e+00,
5524           0.2436236460883e-07, 0.4407720479029e+01, 0.9514313292143e+02,
5525           0.1761365216611e-07, 0.1943892315074e+00, 0.1351787002167e+02,
5526           0.2156289480503e-07, 0.1418570924545e+01, 0.6037244212485e+01,
5527           0.2164748979255e-07, 0.4724603439430e+01, 0.2301353951334e+02,
5528           0.2222286670853e-07, 0.2400266874598e+01, 0.1266924451345e+02,
5529           0.2070901414929e-07, 0.5230348028732e+01, 0.6528907488406e+01,
5530           0.1792745177020e-07, 0.2099190328945e+01, 0.6819880277225e+01,
5531           0.1841802068445e-07, 0.3467527844848e+00, 0.6514761976723e+02,
5532           0.1578401631718e-07, 0.7098642356340e+00, 0.2077542790660e-01,
5533 
5534           0.1561690152531e-07, 0.5943349620372e+01, 0.6272439236156e+01,
5535           0.1558591045463e-07, 0.7040653478980e+00, 0.6293712464735e+01,
5536           0.1737356469576e-07, 0.4487064760345e+01, 0.1765478049437e+02,
5537           0.1434755619991e-07, 0.2993391570995e+01, 0.1102062672231e+00,
5538           0.1482187806654e-07, 0.2278049198251e+01, 0.1052268489556e+01,
5539           0.1424812827089e-07, 0.1682114725827e+01, 0.1311972100268e+02,
5540           0.1380282448623e-07, 0.3262668602579e+01, 0.1017725758696e+02,
5541           0.1811481244566e-07, 0.3187771221777e+01, 0.1887552587463e+02,
5542           0.1504446185696e-07, 0.5650162308647e+01, 0.7626583626240e-01,
5543           0.1740776154137e-07, 0.5487068607507e+01, 0.1965104848470e+02,
5544 
5545           0.1374339536251e-07, 0.5745688172201e+01, 0.6016468784579e+01,
5546           0.1761377477704e-07, 0.5748060203659e+01, 0.2593412433514e+02,
5547           0.1535138225795e-07, 0.6226848505790e+01, 0.9411464614024e+01,
5548           0.1788140543676e-07, 0.6189318878563e+01, 0.3301902111895e+02,
5549           0.1375002807996e-07, 0.5371812884394e+01, 0.6327837846670e+00,
5550           0.1242115758632e-07, 0.1471687569712e+01, 0.3894181736510e+01,
5551           0.1450977333938e-07, 0.4143836662127e+01, 0.1277945078067e+02,
5552           0.1297579575023e-07, 0.9003477661957e+00, 0.6549682916313e+01,
5553           0.1462667934821e-07, 0.5760505536428e+01, 0.1863592847156e+02,
5554           0.1381774374799e-07, 0.1085471729463e+01, 0.2379164476796e+01,
5555 
5556           0.1682333169307e-07, 0.5409870870133e+01, 0.1620077269078e+02,
5557           0.1190812918837e-07, 0.1397205174601e+01, 0.1149965630200e+02,
5558           0.1221434762106e-07, 0.9001804809095e+00, 0.1257326515556e+02,
5559           0.1549934644860e-07, 0.4262528275544e+01, 0.1820933031200e+02,
5560           0.1252138953050e-07, 0.1411642012027e+01, 0.6993008899458e+01,
5561           0.1237078905387e-07, 0.2844472403615e+01, 0.2435678079171e+02,
5562           0.1446953389615e-07, 0.5295835522223e+01, 0.3813291813120e-01,
5563           0.1388446457170e-07, 0.4969428135497e+01, 0.2458316379602e+00,
5564           0.1019339179228e-07, 0.2491369561806e+01, 0.6112403035119e+01,
5565           0.1258880815343e-07, 0.4679426248976e+01, 0.5429879531333e+01,
5566 
5567           0.1297768238261e-07, 0.1074509953328e+01, 0.1249137003520e+02,
5568           0.9913505718094e-08, 0.4735097918224e+01, 0.6247047890016e+01,
5569           0.9830453155969e-08, 0.4158649187338e+01, 0.6453748665772e+01,
5570           0.1192615865309e-07, 0.3438208613699e+01, 0.6290122169689e+01,
5571           0.9835874798277e-08, 0.1913300781229e+01, 0.6319103810876e+01,
5572           0.9639087569277e-08, 0.9487683644125e+00, 0.8273820945392e+01,
5573           0.1175716107001e-07, 0.3228141664287e+01, 0.6276029531202e+01,
5574           0.1018926508678e-07, 0.2216607854300e+01, 0.1254537627298e+02,
5575           0.9500087869225e-08, 0.2625116459733e+01, 0.1256517118505e+02,
5576           0.9664192916575e-08, 0.5860562449214e+01, 0.6259197520765e+01,
5577 
5578           0.9612858712203e-08, 0.7885682917381e+00, 0.6306954180126e+01,
5579           0.1117645675413e-07, 0.3932148831189e+01, 0.1779695906178e+02,
5580           0.1158864052160e-07, 0.9995605521691e+00, 0.1778273215245e+02,
5581           0.9021043467028e-08, 0.5263769742673e+01, 0.6172869583223e+01,
5582           0.8836134773563e-08, 0.1496843220365e+01, 0.1692165728891e+01,
5583           0.1045872200691e-07, 0.7009039517214e+00, 0.2204125344462e+00,
5584           0.1211463487798e-07, 0.4041544938511e+01, 0.8257698122054e+02,
5585           0.8541990804094e-08, 0.1447586692316e+01, 0.6393282117669e+01,
5586           0.1038720703636e-07, 0.4594249718112e+00, 0.1550861511662e+02,
5587           0.1126722351445e-07, 0.3925550579036e+01, 0.2061856251104e+00,
5588 
5589           0.8697373859631e-08, 0.4411341856037e+01, 0.9491756770005e+00,
5590           0.8869380028441e-08, 0.2402659724813e+01, 0.3903911373650e+01,
5591           0.9247014693258e-08, 0.1401579743423e+01, 0.6267823317922e+01,
5592           0.9205062930950e-08, 0.5245978000814e+01, 0.6298328382969e+01,
5593           0.8000745038049e-08, 0.3590803356945e+01, 0.2648454860559e+01,
5594           0.9168973650819e-08, 0.2470150501679e+01, 0.1498544001348e+03,
5595           0.1075444949238e-07, 0.1328606161230e+01, 0.3694923081589e+02,
5596           0.7817298525817e-08, 0.6162256225998e+01, 0.4804209201333e+01,
5597           0.9541469226356e-08, 0.3942568967039e+01, 0.1256713221673e+02,
5598           0.9821910122027e-08, 0.2360246287233e+00, 0.1140367694411e+02,
5599 
5600           0.9897822023777e-08, 0.4619805634280e+01, 0.2280573557157e+02,
5601           0.7737289283765e-08, 0.3784727847451e+01, 0.7834121070590e+01,
5602           0.9260204034710e-08, 0.2223352487601e+01, 0.2787043132925e+01,
5603           0.7320252888486e-08, 0.1288694636874e+01, 0.6282655592598e+01,
5604           0.7319785780946e-08, 0.5359869567774e+01, 0.6283496108294e+01,
5605           0.7147219933778e-08, 0.5516616675856e+01, 0.1725663147538e+02,
5606           0.7946502829878e-08, 0.2630459984567e+01, 0.1241073141809e+02,
5607           0.9001711808932e-08, 0.2849815827227e+01, 0.6281591679874e+01,
5608           0.8994041507257e-08, 0.3795244450750e+01, 0.6284560021018e+01,
5609           0.8298582787358e-08, 0.5236413127363e+00, 0.1241658836951e+02,
5610 
5611           0.8526596520710e-08, 0.4794605424426e+01, 0.1098419223922e+02,
5612           0.8209822103197e-08, 0.1578752370328e+01, 0.1096996532989e+02,
5613           0.6357049861094e-08, 0.5708926113761e+01, 0.1596186371003e+01,
5614           0.7370473179049e-08, 0.3842402530241e+01, 0.4061219149443e+01,
5615           0.7232154664726e-08, 0.3067548981535e+01, 0.1610006857377e+03,
5616           0.6328765494903e-08, 0.1313930030069e+01, 0.1193336791622e+02,
5617           0.8030064908595e-08, 0.3488500408886e+01, 0.8460828644453e+00,
5618           0.6275464259232e-08, 0.1532061626198e+01, 0.8531963191132e+00,
5619           0.7051897446325e-08, 0.3285859929993e+01, 0.5849364236221e+01,
5620           0.6161593705428e-08, 0.1477341999464e+01, 0.5573142801433e+01,
5621 
5622           0.7754683957278e-08, 0.1586118663096e+01, 0.8662240327241e+01,
5623           0.5889928990701e-08, 0.1304887868803e+01, 0.1232342296471e+02,
5624           0.5705756047075e-08, 0.4555333589350e+01, 0.1258692712880e+02,
5625           0.5964178808332e-08, 0.3001762842062e+01, 0.5333900173445e+01,
5626           0.6712446027467e-08, 0.4886780007595e+01, 0.1171295538178e+02,
5627           0.5941809275464e-08, 0.4701509603824e+01, 0.9779108567966e+01,
5628           0.5466993627395e-08, 0.4588357817278e+01, 0.1884211409667e+02,
5629           0.6340512090980e-08, 0.1164543038893e+01, 0.5217580628120e+02,
5630           0.6325505710045e-08, 0.3919171259645e+01, 0.1041998632314e+02,
5631           0.6164789509685e-08, 0.2143828253542e+01, 0.6151533897323e+01,
5632 
5633           0.5263330812430e-08, 0.6066564434241e+01, 0.1885275071096e+02,
5634           0.5597087780221e-08, 0.2926316429472e+01, 0.4337116142245e+00,
5635           0.5396556236817e-08, 0.3244303591505e+01, 0.6286362197481e+01,
5636           0.5396615148223e-08, 0.3404304703662e+01, 0.6279789503410e+01,
5637           0.7091832443341e-08, 0.8532377803192e+00, 0.4907302013889e+01,
5638           0.6572352589782e-08, 0.4901966774419e+01, 0.1176433076753e+02,
5639           0.5960236060795e-08, 0.1874672315797e+01, 0.1422690933580e-01,
5640           0.5125480043511e-08, 0.3735726064334e+01, 0.1245594543367e+02,
5641           0.5928241866410e-08, 0.4502033899935e+01, 0.6414617803568e+01,
5642           0.5249600357424e-08, 0.4372334799878e+01, 0.1151388321134e+02,
5643 
5644           0.6059171276087e-08, 0.2581617302908e+01, 0.6062663316000e+01,
5645           0.5295235081662e-08, 0.2974811513158e+01, 0.3496032717521e+01,
5646           0.5820561875933e-08, 0.1796073748244e+00, 0.2838593341516e+00,
5647           0.4754696606440e-08, 0.1981998136973e+01, 0.3104930017775e+01,
5648           0.6385053548955e-08, 0.2559174171605e+00, 0.6133512519065e+01,
5649           0.6589828273941e-08, 0.2750967106776e+01, 0.4087944051283e+02,
5650           0.5383376567189e-08, 0.6325947523578e+00, 0.2248384854122e+02,
5651           0.5928941683538e-08, 0.1672304519067e+01, 0.1581959461667e+01,
5652           0.4816060709794e-08, 0.3512566172575e+01, 0.9388005868221e+01,
5653           0.6003381586512e-08, 0.5610932219189e+01, 0.5326786718777e+01,
5654 
5655           0.5504225393105e-08, 0.4037501131256e+01, 0.6503488384892e+01,
5656           0.5353772620129e-08, 0.6122774968240e+01, 0.1735668374386e+03,
5657           0.5786253768544e-08, 0.5527984999515e+01, 0.1350651127443e+00,
5658           0.5065706702002e-08, 0.9980765573624e+00, 0.1248988586463e+02,
5659           0.5972838885276e-08, 0.6044489493203e+01, 0.2673594526851e+02,
5660           0.5323585877961e-08, 0.3924265998147e+01, 0.4171425416666e+01,
5661           0.5210772682858e-08, 0.6220111376901e+01, 0.2460261242967e+02,
5662           0.4726549040535e-08, 0.3716043206862e+01, 0.7232251527446e+01,
5663           0.6029425105059e-08, 0.8548704071116e+00, 0.3227113045244e+03,
5664           0.4481542826513e-08, 0.1426925072829e+01, 0.5547199253223e+01,
5665 
5666           0.5836024505068e-08, 0.7135651752625e-01, 0.7285056171570e+02,
5667           0.4137046613272e-08, 0.5330767643283e+01, 0.1087398597200e+02,
5668           0.5171977473924e-08, 0.4494262335353e+00, 0.1884570439172e+02,
5669           0.5694429833732e-08, 0.2952369582215e+01, 0.9723862754494e+02,
5670           0.4009158925298e-08, 0.3500003416535e+01, 0.6244942932314e+01,
5671           0.4784939596873e-08, 0.6196709413181e+01, 0.2929661536378e+02,
5672           0.3983725022610e-08, 0.5103690031897e+01, 0.4274518229222e+01,
5673           0.3870535232462e-08, 0.3187569587401e+01, 0.6321208768577e+01,
5674           0.5140501213951e-08, 0.1668924357457e+01, 0.1232032006293e+02,
5675           0.3849034819355e-08, 0.4445722510309e+01, 0.1726726808967e+02,
5676 
5677           0.4002383075060e-08, 0.5226224152423e+01, 0.7018952447668e+01,
5678           0.3890719543549e-08, 0.4371166550274e+01, 0.1491901785440e+02,
5679           0.4887084607881e-08, 0.5973556689693e+01, 0.1478866649112e+01,
5680           0.3739939287592e-08, 0.2089084714600e+01, 0.6922973089781e+01,
5681           0.5031925918209e-08, 0.4658371936827e+01, 0.1715706182245e+02,
5682           0.4387748764954e-08, 0.4825580552819e+01, 0.2331413144044e+03,
5683           0.4147398098865e-08, 0.3739003524998e+01, 0.1376059875786e+02,
5684           0.3719089993586e-08, 0.1148941386536e+01, 0.6297302759782e+01,
5685           0.3934238461056e-08, 0.1559893008343e+01, 0.7872148766781e+01,
5686           0.3672471375622e-08, 0.5516145383612e+01, 0.6268848941110e+01,
5687 
5688           0.3768911277583e-08, 0.6116053700563e+01, 0.4157198507331e+01,
5689           0.4033388417295e-08, 0.5076821746017e+01, 0.1567108171867e+02,
5690           0.3764194617832e-08, 0.8164676232075e+00, 0.3185192151914e+01,
5691           0.4840628226284e-08, 0.1360479453671e+01, 0.1252801878276e+02,
5692           0.4949443923785e-08, 0.2725622229926e+01, 0.1617106187867e+03,
5693           0.4117393089971e-08, 0.6054459628492e+00, 0.5642198095270e+01,
5694           0.3925754020428e-08, 0.8570462135210e+00, 0.2139354194808e+02,
5695           0.3630551757923e-08, 0.3552067338279e+01, 0.6294805223347e+01,
5696           0.3627274802357e-08, 0.3096565085313e+01, 0.6271346477544e+01,
5697           0.3806143885093e-08, 0.6367751709777e+00, 0.1725304118033e+02,
5698 
5699           0.4433254641565e-08, 0.4848461503937e+01, 0.7445550607224e+01,
5700           0.3712319846576e-08, 0.1331950643655e+01, 0.4194847048887e+00,
5701           0.3849847534783e-08, 0.4958368297746e+00, 0.9562891316684e+00,
5702           0.3483955430165e-08, 0.2237215515707e+01, 0.1161697602389e+02,
5703           0.3961912730982e-08, 0.3332402188575e+01, 0.2277943724828e+02,
5704           0.3419978244481e-08, 0.5785600576016e+01, 0.1362553364512e+02,
5705           0.3329417758177e-08, 0.9812676559709e-01, 0.1685848245639e+02,
5706           0.4207206893193e-08, 0.9494780468236e+00, 0.2986433403208e+02,
5707           0.3268548976410e-08, 0.1739332095686e+00, 0.5749861718712e+01,
5708           0.3321880082685e-08, 0.1423354800666e+01, 0.6279143387820e+01,
5709 
5710           0.4503173010852e-08, 0.2314972675293e+00, 0.1385561574497e+01,
5711           0.4316599090954e-08, 0.1012646782616e+00, 0.4176041334900e+01,
5712           0.3283493323850e-08, 0.5233306881265e+01, 0.6287008313071e+01,
5713           0.3164033542343e-08, 0.4005597257511e+01, 0.2099539292909e+02,
5714           0.4159720956725e-08, 0.5365676242020e+01, 0.5905702259363e+01,
5715           0.3565176892217e-08, 0.4284440620612e+01, 0.3932462625300e-02,
5716           0.3514440950221e-08, 0.4270562636575e+01, 0.7335344340001e+01,
5717           0.3540596871909e-08, 0.5953553201060e+01, 0.1234573916645e+02,
5718           0.2960769905118e-08, 0.1115180417718e+01, 0.2670964694522e+02,
5719           0.2962213739684e-08, 0.3863811918186e+01, 0.6408777551755e+00,
5720 
5721           0.3883556700251e-08, 0.1268617928302e+01, 0.6660449441528e+01,
5722           0.2919225516346e-08, 0.4908605223265e+01, 0.1375773836557e+01,
5723           0.3115158863370e-08, 0.3744519976885e+01, 0.3802769619140e-01,
5724           0.4099438144212e-08, 0.4173244670532e+01, 0.4480965020977e+02,
5725           0.2899531858964e-08, 0.5910601428850e+01, 0.2059724391010e+02,
5726           0.3289733429855e-08, 0.2488050078239e+01, 0.1081813534213e+02,
5727           0.3933075612875e-08, 0.1122363652883e+01, 0.3773735910827e+00,
5728           0.3021403764467e-08, 0.4951973724904e+01, 0.2982630633589e+02,
5729           0.2798598949757e-08, 0.5117057845513e+01, 0.1937891852345e+02,
5730           0.3397421302707e-08, 0.6104159180476e+01, 0.6923953605621e+01,
5731 
5732           0.3720398002179e-08, 0.1184933429829e+01, 0.3066615496545e+02,
5733           0.3598484186267e-08, 0.3505282086105e+01, 0.6147450479709e+01,
5734           0.3694594027310e-08, 0.2286651088141e+01, 0.2636725487657e+01,
5735           0.2680444152969e-08, 0.1871816775482e+00, 0.6816289982179e+01,
5736           0.3497574865641e-08, 0.3143251755431e+01, 0.6418701221183e+01,
5737           0.3130274129494e-08, 0.2462167316018e+01, 0.1235996607578e+02,
5738           0.3241119069551e-08, 0.4256374004686e+01, 0.1652265972112e+02,
5739           0.2601960842061e-08, 0.4970362941425e+01, 0.1045450126711e+02,
5740           0.2690601527504e-08, 0.2372657824898e+01, 0.3163918923335e+00,
5741           0.2908688152664e-08, 0.4232652627721e+01, 0.2828699048865e+02,
5742 
5743           0.3120456131875e-08, 0.3925747001137e+00, 0.2195415756911e+02,
5744           0.3148855423384e-08, 0.3093478330445e+01, 0.1172006883645e+02,
5745           0.3051044261017e-08, 0.5560948248212e+01, 0.6055599646783e+01,
5746           0.2826006876660e-08, 0.5072790310072e+01, 0.5120601093667e+01,
5747           0.3100034191711e-08, 0.4998530231096e+01, 0.1799603123222e+02,
5748           0.2398771640101e-08, 0.2561739802176e+01, 0.6255674361143e+01,
5749           0.2384002842728e-08, 0.4087420284111e+01, 0.6310477339748e+01,
5750           0.2842146517568e-08, 0.2515048217955e+01, 0.5469525544182e+01,
5751           0.2847674371340e-08, 0.5235326497443e+01, 0.1034429499989e+02,
5752           0.2903722140764e-08, 0.1088200795797e+01, 0.6510552054109e+01,
5753 
5754           0.3187610710605e-08, 0.4710624424816e+01, 0.1693792562116e+03,
5755           0.3048869992813e-08, 0.2857975896445e+00, 0.8390110365991e+01,
5756           0.2860216950984e-08, 0.2241619020815e+01, 0.2243449970715e+00,
5757           0.2701117683113e-08, 0.6651573305272e-01, 0.6129297044991e+01,
5758           0.2509891590152e-08, 0.1285135324585e+01, 0.1044027435778e+02,
5759           0.2623200252223e-08, 0.2981229834530e+00, 0.6436854655901e+01,
5760           0.2622541669202e-08, 0.6122470726189e+01, 0.9380959548977e+01,
5761           0.2818435667099e-08, 0.4251087148947e+01, 0.5934151399930e+01,
5762           0.2365196797465e-08, 0.3465070460790e+01, 0.2470570524223e+02,
5763           0.2358704646143e-08, 0.5791603815350e+01, 0.8671969964381e+01,
5764 
5765           0.2388299481390e-08, 0.4142483772941e+01, 0.7096626156709e+01,
5766           0.1996041217224e-08, 0.2101901889496e+01, 0.1727188400790e+02,
5767           0.2687593060336e-08, 0.1526689456959e+01, 0.7075506709219e+02,
5768           0.2618913670810e-08, 0.2397684236095e+01, 0.6632000300961e+01,
5769           0.2571523050364e-08, 0.5751929456787e+00, 0.6206810014183e+01,
5770           0.2582135006946e-08, 0.5595464352926e+01, 0.4873985990671e+02,
5771           0.2372530190361e-08, 0.5092689490655e+01, 0.1590676413561e+02,
5772           0.2357178484712e-08, 0.4444363527851e+01, 0.3097883698531e+01,
5773           0.2451590394723e-08, 0.3108251687661e+01, 0.6612329252343e+00,
5774           0.2370045949608e-08, 0.2608133861079e+01, 0.3459636466239e+02,
5775 
5776           0.2268997267358e-08, 0.3639717753384e+01, 0.2844914056730e-01,
5777           0.1731432137906e-08, 0.1741898445707e+00, 0.2019909489111e+02,
5778           0.1629869741622e-08, 0.3902225646724e+01, 0.3035599730800e+02,
5779           0.2206215801974e-08, 0.4971131250731e+01, 0.6281667977667e+01,
5780           0.2205469554680e-08, 0.1677462357110e+01, 0.6284483723224e+01,
5781           0.2148792362509e-08, 0.4236259604006e+01, 0.1980482729015e+02,
5782           0.1873733657847e-08, 0.5926814998687e+01, 0.2876692439167e+02,
5783           0.2026573758959e-08, 0.4349643351962e+01, 0.2449240616245e+02,
5784           0.1807770325110e-08, 0.5700940482701e+01, 0.2045286941806e+02,
5785           0.1881174408581e-08, 0.6601286363430e+00, 0.2358125818164e+02,
5786 
5787           0.1368023671690e-08, 0.2211098592752e+01, 0.2473415438279e+02,
5788           0.1720017916280e-08, 0.4942488551129e+01, 0.1679593901136e+03,
5789           0.1702427665131e-08, 0.1452233856386e+01, 0.3338575901272e+03,
5790           0.1414032510054e-08, 0.5525357721439e+01, 0.1624205518357e+03,
5791           0.1652626045364e-08, 0.4108794283624e+01, 0.8956999012000e+02,
5792           0.1642957769686e-08, 0.7344335209984e+00, 0.5267006960365e+02,
5793           0.1614952403624e-08, 0.3541213951363e+01, 0.3332657872986e+02,
5794           0.1535988291188e-08, 0.4031094072151e+01, 0.3852657435933e+02,
5795           0.1593193738177e-08, 0.4185136203609e+01, 0.2282781046519e+03,
5796           0.1074569126382e-08, 0.1720485636868e+01, 0.8397383534231e+02,
5797 
5798           0.1074408214509e-08, 0.2758613420318e+01, 0.8401985929482e+02,
5799           0.9700199670465e-09, 0.4216686842097e+01, 0.7826370942180e+02,
5800           0.1258433517061e-08, 0.2575068876639e+00, 0.3115650189215e+03,
5801           0.1240303229539e-08, 0.4800844956756e+00, 0.1784300471910e+03,
5802           0.9018345948127e-09, 0.3896756361552e+00, 0.5886454391678e+02,
5803           0.1135301432805e-08, 0.3700805023550e+00, 0.7842370451713e+02,
5804           0.9215887951370e-09, 0.4364579276638e+01, 0.1014262087719e+03,
5805           0.1055401054147e-08, 0.2156564222111e+01, 0.5660027930059e+02,
5806           0.1008725979831e-08, 0.5454015785234e+01, 0.4245678405627e+02,
5807           0.7217398104321e-09, 0.1597772562175e+01, 0.2457074661053e+03,
5808 
5809           0.6912033134447e-09, 0.5824090621461e+01, 0.1679936946371e+03,
5810           0.6833881523549e-09, 0.3578778482835e+01, 0.6053048899753e+02,
5811           0.4887304205142e-09, 0.3724362812423e+01, 0.9656299901946e+02,
5812           0.5173709754788e-09, 0.5422427507933e+01, 0.2442876000072e+03,
5813           0.4671353097145e-09, 0.2396106924439e+01, 0.1435713242844e+03,
5814           0.5652608439480e-09, 0.2804028838685e+01, 0.8365903305582e+02,
5815           0.5604061331253e-09, 0.1638816006247e+01, 0.8433466158131e+02,
5816           0.4712723365400e-09, 0.8979003224474e+00, 0.3164282286739e+03,
5817           0.4909967465112e-09, 0.3210426725516e+01, 0.4059982187939e+03,
5818           0.4771358267658e-09, 0.5308027211629e+01, 0.1805255418145e+03,
5819 
5820           0.3943451445989e-09, 0.2195145341074e+01, 0.2568537517081e+03,
5821           0.3952109120244e-09, 0.5081189491586e+01, 0.2449975330562e+03,
5822           0.3788134594789e-09, 0.4345171264441e+01, 0.1568131045107e+03,
5823           0.3738330190479e-09, 0.2613062847997e+01, 0.3948519331910e+03,
5824           0.3099866678136e-09, 0.2846760817689e+01, 0.1547176098872e+03,
5825           0.2002962716768e-09, 0.4921360989412e+01, 0.2268582385539e+03,
5826           0.2198291338754e-09, 0.1130360117454e+00, 0.1658638954901e+03,
5827           0.1491958330784e-09, 0.4228195232278e+01, 0.2219950288015e+03,
5828           0.1475384076173e-09, 0.3005721811604e+00, 0.3052819430710e+03,
5829           0.1661626624624e-09, 0.7830125621203e+00, 0.2526661704812e+03,
5830 
5831           0.9015823460025e-10, 0.3807792942715e+01, 0.4171445043968e+03 };
5832 
5833     /* Sun-to-Earth, T^0, Y */
5834       static final double e0y[] = {
5835           0.9998921098898e+00, 0.1826583913846e+00, 0.6283075850446e+01,
5836          -0.2442700893735e-01, 0.0000000000000e+00, 0.0000000000000e+00,
5837           0.8352929742915e-02, 0.1395277998680e+00, 0.1256615170089e+02,
5838           0.1046697300177e-03, 0.9641423109763e-01, 0.1884922755134e+02,
5839           0.3110841876663e-04, 0.5381140401712e+01, 0.8399684731857e+02,
5840           0.2570269094593e-04, 0.5301016407128e+01, 0.5296909721118e+00,
5841           0.2147389623610e-04, 0.2662510869850e+01, 0.1577343543434e+01,
5842           0.1680344384050e-04, 0.5207904119704e+01, 0.6279552690824e+01,
5843           0.1679117312193e-04, 0.4582187486968e+01, 0.6286599010068e+01,
5844           0.1440512068440e-04, 0.1900688517726e+01, 0.2352866153506e+01,
5845 
5846           0.1135139664999e-04, 0.5273108538556e+01, 0.5223693906222e+01,
5847           0.9345482571018e-05, 0.4503047687738e+01, 0.1203646072878e+02,
5848           0.9007418719568e-05, 0.1605621059637e+01, 0.1021328554739e+02,
5849           0.5671536712314e-05, 0.5812849070861e+00, 0.1059381944224e+01,
5850           0.7451401861666e-05, 0.2807346794836e+01, 0.3981490189893e+00,
5851           0.6393470057114e-05, 0.6029224133855e+01, 0.5753384878334e+01,
5852           0.6814275881697e-05, 0.6472990145974e+00, 0.4705732307012e+01,
5853           0.6113705628887e-05, 0.3813843419700e+01, 0.6812766822558e+01,
5854           0.4503851367273e-05, 0.4527804370996e+01, 0.5884926831456e+01,
5855           0.4522249141926e-05, 0.5991783029224e+01, 0.6256777527156e+01,
5856 
5857           0.4501794307018e-05, 0.3798703844397e+01, 0.6309374173736e+01,
5858           0.5514927480180e-05, 0.3961257833388e+01, 0.5507553240374e+01,
5859           0.4062862799995e-05, 0.5256247296369e+01, 0.6681224869435e+01,
5860           0.5414900429712e-05, 0.5499032014097e+01, 0.7755226100720e+00,
5861           0.5463153987424e-05, 0.6173092454097e+01, 0.1414349524433e+02,
5862           0.5071611859329e-05, 0.2870244247651e+01, 0.7860419393880e+01,
5863           0.2195112094455e-05, 0.2952338617201e+01, 0.1150676975667e+02,
5864           0.2279139233919e-05, 0.5951775132933e+01, 0.7058598460518e+01,
5865           0.2278386100876e-05, 0.4845456398785e+01, 0.4694002934110e+01,
5866           0.2559088003308e-05, 0.6945321117311e+00, 0.1216800268190e+02,
5867 
5868           0.2561079286856e-05, 0.6167224608301e+01, 0.7099330490126e+00,
5869           0.1792755796387e-05, 0.1400122509632e+01, 0.7962980379786e+00,
5870           0.1818715656502e-05, 0.4703347611830e+01, 0.6283142985870e+01,
5871           0.1818744924791e-05, 0.5086748900237e+01, 0.6283008715021e+01,
5872           0.1554518791390e-05, 0.5331008042713e-01, 0.2513230340178e+02,
5873           0.2063265737239e-05, 0.4283680484178e+01, 0.1179062909082e+02,
5874           0.1497613520041e-05, 0.6074207826073e+01, 0.5486777812467e+01,
5875           0.2000617940427e-05, 0.2501426281450e+01, 0.1778984560711e+02,
5876           0.1289731195580e-05, 0.3646340599536e+01, 0.7079373888424e+01,
5877           0.1282657998934e-05, 0.3232864804902e+01, 0.3738761453707e+01,
5878 
5879           0.1528915968658e-05, 0.5581433416669e+01, 0.2132990797783e+00,
5880           0.1187304098432e-05, 0.5453576453694e+01, 0.9437762937313e+01,
5881           0.7842782928118e-06, 0.2823953922273e+00, 0.8827390247185e+01,
5882           0.7352892280868e-06, 0.1124369580175e+01, 0.1589072916335e+01,
5883           0.6570189360797e-06, 0.2089154042840e+01, 0.1176985366291e+02,
5884           0.6324967590410e-06, 0.6704855581230e+00, 0.6262300422539e+01,
5885           0.6298289872283e-06, 0.2836414855840e+01, 0.6303851278352e+01,
5886           0.6476686465855e-06, 0.4852433866467e+00, 0.7113454667900e-02,
5887           0.8587034651234e-06, 0.1453511005668e+01, 0.1672837615881e+03,
5888           0.8068948788113e-06, 0.9224087798609e+00, 0.6069776770667e+01,
5889 
5890           0.8353786011661e-06, 0.4631707184895e+01, 0.3340612434717e+01,
5891           0.6009324532132e-06, 0.1829498827726e+01, 0.4136910472696e+01,
5892           0.7558158559566e-06, 0.2588596800317e+01, 0.6496374930224e+01,
5893           0.5809279504503e-06, 0.5516818853476e+00, 0.1097707878456e+02,
5894           0.5374131950254e-06, 0.6275674734960e+01, 0.1194447056968e+01,
5895           0.5711160507326e-06, 0.1091905956872e+01, 0.6282095334605e+01,
5896           0.5710183170746e-06, 0.2415001635090e+01, 0.6284056366286e+01,
5897           0.5144373590610e-06, 0.6020336443438e+01, 0.6290189305114e+01,
5898           0.5103108927267e-06, 0.3775634564605e+01, 0.6275962395778e+01,
5899           0.4960654697891e-06, 0.1073450946756e+01, 0.6127655567643e+01,
5900 
5901           0.4786385689280e-06, 0.2431178012310e+01, 0.6438496133249e+01,
5902           0.6109911263665e-06, 0.5343356157914e+01, 0.3154687086868e+01,
5903           0.4839898944024e-06, 0.5830833594047e-01, 0.8018209333619e+00,
5904           0.4734822623919e-06, 0.4536080134821e+01, 0.3128388763578e+01,
5905           0.4834741473290e-06, 0.2585090489754e+00, 0.7084896783808e+01,
5906           0.5134858581156e-06, 0.4213317172603e+01, 0.1235285262111e+02,
5907           0.5064004264978e-06, 0.4814418806478e+00, 0.1185621865188e+02,
5908           0.3753476772761e-06, 0.1599953399788e+01, 0.8429241228195e+01,
5909           0.4935264014283e-06, 0.2157417556873e+01, 0.2544314396739e+01,
5910           0.3950929600897e-06, 0.3359394184254e+01, 0.5481254917084e+01,
5911 
5912           0.4895849789777e-06, 0.5165704376558e+01, 0.9225539266174e+01,
5913           0.4215241688886e-06, 0.2065368800993e+01, 0.1726015463500e+02,
5914           0.3796773731132e-06, 0.1468606346612e+01, 0.4265981595566e+00,
5915           0.3114178142515e-06, 0.3615638079474e+01, 0.2146165377750e+01,
5916           0.3260664220838e-06, 0.4417134922435e+01, 0.4164311961999e+01,
5917           0.3976996123008e-06, 0.4700866883004e+01, 0.5856477690889e+01,
5918           0.2801459672924e-06, 0.4538902060922e+01, 0.1256967486051e+02,
5919           0.3638931868861e-06, 0.1334197991475e+01, 0.1807370494127e+02,
5920           0.2487013269476e-06, 0.3749275558275e+01, 0.2629832328990e-01,
5921           0.3034165481994e-06, 0.4236622030873e+00, 0.4535059491685e+01,
5922 
5923           0.2676278825586e-06, 0.5970848007811e+01, 0.3930209696940e+01,
5924           0.2764903818918e-06, 0.5194636754501e+01, 0.1256262854127e+02,
5925           0.2485149930507e-06, 0.1002434207846e+01, 0.5088628793478e+01,
5926           0.2199305540941e-06, 0.3066773098403e+01, 0.1255903824622e+02,
5927           0.2571106500435e-06, 0.7588312459063e+00, 0.1336797263425e+02,
5928           0.2049751817158e-06, 0.3444977434856e+01, 0.1137170464392e+02,
5929           0.2599707296297e-06, 0.1873128542205e+01, 0.7143069561767e+02,
5930           0.1785018072217e-06, 0.5015891306615e+01, 0.1748016358760e+01,
5931           0.2324833891115e-06, 0.4618271239730e+01, 0.1831953657923e+02,
5932           0.1709711119545e-06, 0.5300003455669e+01, 0.4933208510675e+01,
5933 
5934           0.2107159351716e-06, 0.2229819815115e+01, 0.7477522907414e+01,
5935           0.1750333080295e-06, 0.6161485880008e+01, 0.1044738781244e+02,
5936           0.2000598210339e-06, 0.2967357299999e+01, 0.8031092209206e+01,
5937           0.1380920248681e-06, 0.3027007923917e+01, 0.8635942003952e+01,
5938           0.1412460470299e-06, 0.6037597163798e+01, 0.2942463415728e+01,
5939           0.1888459803001e-06, 0.8561476243374e+00, 0.1561374759853e+03,
5940           0.1788370542585e-06, 0.4869736290209e+01, 0.1592596075957e+01,
5941           0.1360893296167e-06, 0.3626411886436e+01, 0.1309584267300e+02,
5942           0.1506846530160e-06, 0.1550975377427e+01, 0.1649636139783e+02,
5943           0.1800913376176e-06, 0.2075826033190e+01, 0.1729818233119e+02,
5944 
5945           0.1436261390649e-06, 0.6148876420255e+01, 0.2042657109477e+02,
5946           0.1220227114151e-06, 0.4382583879906e+01, 0.7632943190217e+01,
5947           0.1337883603592e-06, 0.2036644327361e+01, 0.1213955354133e+02,
5948           0.1159326650738e-06, 0.3892276994687e+01, 0.5331357529664e+01,
5949           0.1352853128569e-06, 0.1447950649744e+01, 0.1673046366289e+02,
5950           0.1433408296083e-06, 0.4457854692961e+01, 0.7342457794669e+01,
5951           0.1234701666518e-06, 0.1538818147151e+01, 0.6279485555400e+01,
5952           0.1234027192007e-06, 0.1968523220760e+01, 0.6286666145492e+01,
5953           0.1244024091797e-06, 0.5779803499985e+01, 0.1511046609763e+02,
5954           0.1097934945516e-06, 0.6210975221388e+00, 0.1098880815746e+02,
5955 
5956           0.1254611329856e-06, 0.2591963807998e+01, 0.1572083878776e+02,
5957           0.1158247286784e-06, 0.2483612812670e+01, 0.5729506548653e+01,
5958           0.9039078252960e-07, 0.3857554579796e+01, 0.9623688285163e+01,
5959           0.9108024978836e-07, 0.5826368512984e+01, 0.7234794171227e+01,
5960           0.8887068108436e-07, 0.3475694573987e+01, 0.6148010737701e+01,
5961           0.8632374035438e-07, 0.3059070488983e-01, 0.6418140963190e+01,
5962           0.7893186992967e-07, 0.1583194837728e+01, 0.2118763888447e+01,
5963           0.8297650201172e-07, 0.8519770534637e+00, 0.1471231707864e+02,
5964           0.1019759578988e-06, 0.1319598738732e+00, 0.1349867339771e+01,
5965           0.1010037696236e-06, 0.9937860115618e+00, 0.6836645152238e+01,
5966 
5967           0.1047727548266e-06, 0.1382138405399e+01, 0.5999216516294e+01,
5968           0.7351993881086e-07, 0.3833397851735e+01, 0.6040347114260e+01,
5969           0.9868771092341e-07, 0.2124913814390e+01, 0.6566935184597e+01,
5970           0.7007321959390e-07, 0.5946305343763e+01, 0.6525804586632e+01,
5971           0.6861411679709e-07, 0.4574654977089e+01, 0.7238675589263e+01,
5972           0.7554519809614e-07, 0.5949232686844e+01, 0.1253985337760e+02,
5973           0.9541880448335e-07, 0.3495242990564e+01, 0.2122839202813e+02,
5974           0.7185606722155e-07, 0.4310113471661e+01, 0.6245048154254e+01,
5975           0.7131360871710e-07, 0.5480309323650e+01, 0.6321103546637e+01,
5976           0.6651142021039e-07, 0.5411097713654e+01, 0.5327476111629e+01,
5977 
5978           0.8538618213667e-07, 0.1827849973951e+01, 0.1101510648075e+02,
5979           0.8634954288044e-07, 0.5443584943349e+01, 0.5643178611111e+01,
5980           0.7449415051484e-07, 0.2011535459060e+01, 0.5368044267797e+00,
5981           0.7421047599169e-07, 0.3464562529249e+01, 0.2354323048545e+02,
5982           0.6140694354424e-07, 0.5657556228815e+01, 0.1296430071988e+02,
5983           0.6353525143033e-07, 0.3463816593821e+01, 0.1990745094947e+01,
5984           0.6221964013447e-07, 0.1532259498697e+01, 0.9517183207817e+00,
5985           0.5852480257244e-07, 0.1375396598875e+01, 0.9555997388169e+00,
5986           0.6398637498911e-07, 0.2405645801972e+01, 0.2407292145756e+02,
5987           0.7039744069878e-07, 0.5397541799027e+01, 0.5225775174439e+00,
5988 
5989           0.6977997694382e-07, 0.4762347105419e+01, 0.1097355562493e+02,
5990           0.7460629558396e-07, 0.2711944692164e+01, 0.2200391463820e+02,
5991           0.5376577536101e-07, 0.2352980430239e+01, 0.1431416805965e+02,
5992           0.7530607893556e-07, 0.1943940180699e+01, 0.1842262939178e+02,
5993           0.6822928971605e-07, 0.4337651846959e+01, 0.1554202828031e+00,
5994           0.6220772380094e-07, 0.6716871369278e+00, 0.1845107853235e+02,
5995           0.6586950799043e-07, 0.2229714460505e+01, 0.5216580451554e+01,
5996           0.5873800565771e-07, 0.7627013920580e+00, 0.6398972393349e+00,
5997           0.6264346929745e-07, 0.6202785478961e+00, 0.6277552955062e+01,
5998           0.6257929115669e-07, 0.2886775596668e+01, 0.6288598745829e+01,
5999 
6000           0.5343536033409e-07, 0.1977241012051e+01, 0.4690479774488e+01,
6001           0.5587849781714e-07, 0.1922923484825e+01, 0.1551045220144e+01,
6002           0.6905100845603e-07, 0.3570757164631e+01, 0.1030928125552e+00,
6003           0.6178957066649e-07, 0.5197558947765e+01, 0.5230807360890e+01,
6004           0.6187270224331e-07, 0.8193497368922e+00, 0.5650292065779e+01,
6005           0.5385664291426e-07, 0.5406336665586e+01, 0.7771377146812e+02,
6006           0.6329363917926e-07, 0.2837760654536e+01, 0.2608790314060e+02,
6007           0.4546018761604e-07, 0.2933580297050e+01, 0.5535693017924e+00,
6008           0.6196091049375e-07, 0.4157871494377e+01, 0.8467247584405e+02,
6009           0.6159555108218e-07, 0.3211703561703e+01, 0.2394243902548e+03,
6010 
6011           0.4995340539317e-07, 0.1459098102922e+01, 0.4732030630302e+01,
6012           0.5457031243572e-07, 0.1430457676136e+01, 0.6179983037890e+01,
6013           0.4863461418397e-07, 0.2196425916730e+01, 0.9027992316901e+02,
6014           0.5342947626870e-07, 0.2086612890268e+01, 0.6386168663001e+01,
6015           0.5674296648439e-07, 0.2760204966535e+01, 0.6915859635113e+01,
6016           0.4745783120161e-07, 0.4245368971862e+01, 0.6282970628506e+01,
6017           0.4745676961198e-07, 0.5544725787016e+01, 0.6283181072386e+01,
6018           0.4049796869973e-07, 0.2213984363586e+01, 0.6254626709878e+01,
6019           0.4248333596940e-07, 0.8075781952896e+00, 0.7875671926403e+01,
6020           0.4027178070205e-07, 0.1293268540378e+01, 0.6311524991013e+01,
6021 
6022           0.4066543943476e-07, 0.3986141175804e+01, 0.3634620989887e+01,
6023           0.4858863787880e-07, 0.1276112738231e+01, 0.5760498333002e+01,
6024           0.5277398263530e-07, 0.4916111741527e+01, 0.2515860172507e+02,
6025           0.4105635656559e-07, 0.1725805864426e+01, 0.6709674010002e+01,
6026           0.4376781925772e-07, 0.2243642442106e+01, 0.6805653367890e+01,
6027           0.3235827894693e-07, 0.3614135118271e+01, 0.1066495398892e+01,
6028           0.3073244740308e-07, 0.2460873393460e+01, 0.5863591145557e+01,
6029           0.3088609271373e-07, 0.5678431771790e+01, 0.9917696840332e+01,
6030           0.3393022279836e-07, 0.3814017477291e+01, 0.1391601904066e+02,
6031           0.3038686508802e-07, 0.4660216229171e+01, 0.1256621883632e+02,
6032 
6033           0.4019677752497e-07, 0.5906906243735e+01, 0.1334167431096e+02,
6034           0.3288834998232e-07, 0.9536146445882e+00, 0.1620077269078e+02,
6035           0.3889973794631e-07, 0.3942205097644e+01, 0.7478166569050e-01,
6036           0.3050438987141e-07, 0.1624810271286e+01, 0.1805292951336e+02,
6037           0.3601142564638e-07, 0.4030467142575e+01, 0.6208294184755e+01,
6038           0.3689015557141e-07, 0.3648878818694e+01, 0.5966683958112e+01,
6039           0.3563471893565e-07, 0.5749584017096e+01, 0.6357857516136e+01,
6040           0.2776183170667e-07, 0.2630124187070e+01, 0.3523159621801e-02,
6041           0.2922350530341e-07, 0.1790346403629e+01, 0.1272157198369e+02,
6042           0.3511076917302e-07, 0.6142198301611e+01, 0.6599467742779e+01,
6043 
6044           0.3619351007632e-07, 0.1432421386492e+01, 0.6019991944201e+01,
6045           0.2561254711098e-07, 0.2302822475792e+01, 0.1259245002418e+02,
6046           0.2626903942920e-07, 0.8660470994571e+00, 0.6702560555334e+01,
6047           0.2550187397083e-07, 0.6069721995383e+01, 0.1057540660594e+02,
6048           0.2535873526138e-07, 0.1079020331795e-01, 0.3141537925223e+02,
6049           0.3519786153847e-07, 0.3809066902283e+01, 0.2505706758577e+03,
6050           0.3424651492873e-07, 0.2075435114417e+01, 0.6546159756691e+01,
6051           0.2372676630861e-07, 0.2057803120154e+01, 0.2388894113936e+01,
6052           0.2710980779541e-07, 0.1510068488010e+01, 0.1202934727411e+02,
6053           0.3038710889704e-07, 0.5043617528901e+01, 0.1256608456547e+02,
6054 
6055           0.2220364130585e-07, 0.3694793218205e+01, 0.1336244973887e+02,
6056           0.3025880825460e-07, 0.5450618999049e-01, 0.2908881142201e+02,
6057           0.2784493486864e-07, 0.3381164084502e+01, 0.1494531617769e+02,
6058           0.2294414142438e-07, 0.4382309025210e+01, 0.6076890225335e+01,
6059           0.2012723294724e-07, 0.9142212256518e+00, 0.6262720680387e+01,
6060           0.2036357831958e-07, 0.5676172293154e+01, 0.4701116388778e+01,
6061           0.2003474823288e-07, 0.2592767977625e+01, 0.6303431020504e+01,
6062           0.2207144900109e-07, 0.5404976271180e+01, 0.6489261475556e+01,
6063           0.2481664905135e-07, 0.4373284587027e+01, 0.1204357418345e+02,
6064           0.2674949182295e-07, 0.5859182188482e+01, 0.4590910121555e+01,
6065 
6066           0.2450554720322e-07, 0.4555381557451e+01, 0.1495633313810e+00,
6067           0.2601975986457e-07, 0.3933165584959e+01, 0.1965104848470e+02,
6068           0.2199860022848e-07, 0.5227977189087e+01, 0.1351787002167e+02,
6069           0.2448121172316e-07, 0.4858060353949e+01, 0.1162474756779e+01,
6070           0.1876014864049e-07, 0.5690546553605e+01, 0.6279194432410e+01,
6071           0.1874513219396e-07, 0.4099539297446e+01, 0.6286957268481e+01,
6072           0.2156380842559e-07, 0.4382594769913e+00, 0.1813929450232e+02,
6073           0.1981691240061e-07, 0.1829784152444e+01, 0.4686889479442e+01,
6074           0.2329992648539e-07, 0.2836254278973e+01, 0.1002183730415e+02,
6075           0.1765184135302e-07, 0.2803494925833e+01, 0.4292330755499e+01,
6076 
6077           0.2436368366085e-07, 0.2836897959677e+01, 0.9514313292143e+02,
6078           0.2164089203889e-07, 0.6127522446024e+01, 0.6037244212485e+01,
6079           0.1847755034221e-07, 0.3683163635008e+01, 0.2427287361862e+00,
6080           0.1674798769966e-07, 0.3316993867246e+00, 0.1311972100268e+02,
6081           0.2222542124356e-07, 0.8294097805480e+00, 0.1266924451345e+02,
6082           0.2071074505925e-07, 0.3659492220261e+01, 0.6528907488406e+01,
6083           0.1608224471835e-07, 0.4774492067182e+01, 0.1352175143971e+02,
6084           0.1857583439071e-07, 0.2873120597682e+01, 0.8662240327241e+01,
6085           0.1793018836159e-07, 0.5282441177929e+00, 0.6819880277225e+01,
6086           0.1575391221692e-07, 0.1320789654258e+01, 0.1102062672231e+00,
6087 
6088           0.1840132009557e-07, 0.1917110916256e+01, 0.6514761976723e+02,
6089           0.1760917288281e-07, 0.2972635937132e+01, 0.5746271423666e+01,
6090           0.1561779518516e-07, 0.4372569261981e+01, 0.6272439236156e+01,
6091           0.1558687885205e-07, 0.5416424926425e+01, 0.6293712464735e+01,
6092           0.1951359382579e-07, 0.3094448898752e+01, 0.2301353951334e+02,
6093           0.1569144275614e-07, 0.2802103689808e+01, 0.1765478049437e+02,
6094           0.1479130389462e-07, 0.2136435020467e+01, 0.2077542790660e-01,
6095           0.1467828510764e-07, 0.7072627435674e+00, 0.1052268489556e+01,
6096           0.1627627337440e-07, 0.3947607143237e+01, 0.6327837846670e+00,
6097           0.1503498479758e-07, 0.4079248909190e+01, 0.7626583626240e-01,
6098 
6099           0.1297967708237e-07, 0.6269637122840e+01, 0.1149965630200e+02,
6100           0.1374416896634e-07, 0.4175657970702e+01, 0.6016468784579e+01,
6101           0.1783812325219e-07, 0.1476540547560e+01, 0.3301902111895e+02,
6102           0.1525884228756e-07, 0.4653477715241e+01, 0.9411464614024e+01,
6103           0.1451067396763e-07, 0.2573001128225e+01, 0.1277945078067e+02,
6104           0.1297713111950e-07, 0.5612799618771e+01, 0.6549682916313e+01,
6105           0.1462784012820e-07, 0.4189661623870e+01, 0.1863592847156e+02,
6106           0.1384185980007e-07, 0.2656915472196e+01, 0.2379164476796e+01,
6107           0.1221497599801e-07, 0.5612515760138e+01, 0.1257326515556e+02,
6108           0.1560574525896e-07, 0.4783414317919e+01, 0.1887552587463e+02,
6109 
6110           0.1544598372036e-07, 0.2694431138063e+01, 0.1820933031200e+02,
6111           0.1531678928696e-07, 0.4105103489666e+01, 0.2593412433514e+02,
6112           0.1349321503795e-07, 0.3082437194015e+00, 0.5120601093667e+01,
6113           0.1252030290917e-07, 0.6124072334087e+01, 0.6993008899458e+01,
6114           0.1459243816687e-07, 0.3733103981697e+01, 0.3813291813120e-01,
6115           0.1226103625262e-07, 0.1267127706817e+01, 0.2435678079171e+02,
6116           0.1019449641504e-07, 0.4367790112269e+01, 0.1725663147538e+02,
6117           0.1380789433607e-07, 0.3387201768700e+01, 0.2458316379602e+00,
6118           0.1019453421658e-07, 0.9204143073737e+00, 0.6112403035119e+01,
6119           0.1297929434405e-07, 0.5786874896426e+01, 0.1249137003520e+02,
6120 
6121           0.9912677786097e-08, 0.3164232870746e+01, 0.6247047890016e+01,
6122           0.9829386098599e-08, 0.2586762413351e+01, 0.6453748665772e+01,
6123           0.1226807746104e-07, 0.6239068436607e+01, 0.5429879531333e+01,
6124           0.1192691755997e-07, 0.1867380051424e+01, 0.6290122169689e+01,
6125           0.9836499227081e-08, 0.3424716293727e+00, 0.6319103810876e+01,
6126           0.9642862564285e-08, 0.5661372990657e+01, 0.8273820945392e+01,
6127           0.1165184404862e-07, 0.5768367239093e+01, 0.1778273215245e+02,
6128           0.1175794418818e-07, 0.1657351222943e+01, 0.6276029531202e+01,
6129           0.1018948635601e-07, 0.6458292350865e+00, 0.1254537627298e+02,
6130           0.9500383606676e-08, 0.1054306140741e+01, 0.1256517118505e+02,
6131 
6132           0.1227512202906e-07, 0.2505278379114e+01, 0.2248384854122e+02,
6133           0.9664792009993e-08, 0.4289737277000e+01, 0.6259197520765e+01,
6134           0.9613285666331e-08, 0.5500597673141e+01, 0.6306954180126e+01,
6135           0.1117906736211e-07, 0.2361405953468e+01, 0.1779695906178e+02,
6136           0.9611378640782e-08, 0.2851310576269e+01, 0.2061856251104e+00,
6137           0.8845354852370e-08, 0.6208777705343e+01, 0.1692165728891e+01,
6138           0.1054046966600e-07, 0.5413091423934e+01, 0.2204125344462e+00,
6139           0.1215539124483e-07, 0.5613969479755e+01, 0.8257698122054e+02,
6140           0.9932460955209e-08, 0.1106124877015e+01, 0.1017725758696e+02,
6141           0.8785804715043e-08, 0.2869224476477e+01, 0.9491756770005e+00,
6142 
6143           0.8538084097562e-08, 0.6159640899344e+01, 0.6393282117669e+01,
6144           0.8648994369529e-08, 0.1374901198784e+01, 0.4804209201333e+01,
6145           0.1039063219067e-07, 0.5171080641327e+01, 0.1550861511662e+02,
6146           0.8867983926439e-08, 0.8317320304902e+00, 0.3903911373650e+01,
6147           0.8327495955244e-08, 0.3605591969180e+01, 0.6172869583223e+01,
6148           0.9243088356133e-08, 0.6114299196843e+01, 0.6267823317922e+01,
6149           0.9205657357835e-08, 0.3675153683737e+01, 0.6298328382969e+01,
6150           0.1033269714606e-07, 0.3313328813024e+01, 0.5573142801433e+01,
6151           0.8001706275552e-08, 0.2019980960053e+01, 0.2648454860559e+01,
6152           0.9171858254191e-08, 0.8992015524177e+00, 0.1498544001348e+03,
6153 
6154           0.1075327150242e-07, 0.2898669963648e+01, 0.3694923081589e+02,
6155           0.9884866689828e-08, 0.4946715904478e+01, 0.1140367694411e+02,
6156           0.9541835576677e-08, 0.2371787888469e+01, 0.1256713221673e+02,
6157           0.7739903376237e-08, 0.2213775190612e+01, 0.7834121070590e+01,
6158           0.7311962684106e-08, 0.3429378787739e+01, 0.1192625446156e+02,
6159           0.9724904869624e-08, 0.6195878564404e+01, 0.2280573557157e+02,
6160           0.9251628983612e-08, 0.6511509527390e+00, 0.2787043132925e+01,
6161           0.7320763787842e-08, 0.6001083639421e+01, 0.6282655592598e+01,
6162           0.7320296650962e-08, 0.3789073265087e+01, 0.6283496108294e+01,
6163           0.7947032271039e-08, 0.1059659582204e+01, 0.1241073141809e+02,
6164 
6165           0.9005277053115e-08, 0.1280315624361e+01, 0.6281591679874e+01,
6166           0.8995601652048e-08, 0.2224439106766e+01, 0.6284560021018e+01,
6167           0.8288040568796e-08, 0.5234914433867e+01, 0.1241658836951e+02,
6168           0.6359381347255e-08, 0.4137989441490e+01, 0.1596186371003e+01,
6169           0.8699572228626e-08, 0.1758411009497e+01, 0.6133512519065e+01,
6170           0.6456797542736e-08, 0.5919285089994e+01, 0.1685848245639e+02,
6171           0.7424573475452e-08, 0.5414616938827e+01, 0.4061219149443e+01,
6172           0.7235671196168e-08, 0.1496516557134e+01, 0.1610006857377e+03,
6173           0.8104015182733e-08, 0.1919918242764e+01, 0.8460828644453e+00,
6174           0.8098576535937e-08, 0.3819615855458e+01, 0.3894181736510e+01,
6175 
6176           0.6275292346625e-08, 0.6244264115141e+01, 0.8531963191132e+00,
6177           0.6052432989112e-08, 0.5037731872610e+00, 0.1567108171867e+02,
6178           0.5705651535817e-08, 0.2984557271995e+01, 0.1258692712880e+02,
6179           0.5789650115138e-08, 0.6087038140697e+01, 0.1193336791622e+02,
6180           0.5512132153377e-08, 0.5855668994076e+01, 0.1232342296471e+02,
6181           0.7388890819102e-08, 0.2443128574740e+01, 0.4907302013889e+01,
6182           0.5467593991798e-08, 0.3017561234194e+01, 0.1884211409667e+02,
6183           0.6388519802999e-08, 0.5887386712935e+01, 0.5217580628120e+02,
6184           0.6106777149944e-08, 0.3483461059895e+00, 0.1422690933580e-01,
6185           0.7383420275489e-08, 0.5417387056707e+01, 0.2358125818164e+02,
6186 
6187           0.5505208141738e-08, 0.2848193644783e+01, 0.1151388321134e+02,
6188           0.6310757462877e-08, 0.2349882520828e+01, 0.1041998632314e+02,
6189           0.6166904929691e-08, 0.5728575944077e+00, 0.6151533897323e+01,
6190           0.5263442042754e-08, 0.4495796125937e+01, 0.1885275071096e+02,
6191           0.5591828082629e-08, 0.1355441967677e+01, 0.4337116142245e+00,
6192           0.5397051680497e-08, 0.1673422864307e+01, 0.6286362197481e+01,
6193           0.5396992745159e-08, 0.1833502206373e+01, 0.6279789503410e+01,
6194           0.6572913000726e-08, 0.3331122065824e+01, 0.1176433076753e+02,
6195           0.5123421866413e-08, 0.2165327142679e+01, 0.1245594543367e+02,
6196           0.5930495725999e-08, 0.2931146089284e+01, 0.6414617803568e+01,
6197 
6198           0.6431797403933e-08, 0.4134407994088e+01, 0.1350651127443e+00,
6199           0.5003182207604e-08, 0.3805420303749e+01, 0.1096996532989e+02,
6200           0.5587731032504e-08, 0.1082469260599e+01, 0.6062663316000e+01,
6201           0.5935263407816e-08, 0.8384333678401e+00, 0.5326786718777e+01,
6202           0.4756019827760e-08, 0.3552588749309e+01, 0.3104930017775e+01,
6203           0.6599951172637e-08, 0.4320826409528e+01, 0.4087944051283e+02,
6204           0.5902606868464e-08, 0.4811879454445e+01, 0.5849364236221e+01,
6205           0.5921147809031e-08, 0.9942628922396e-01, 0.1581959461667e+01,
6206           0.5505382581266e-08, 0.2466557607764e+01, 0.6503488384892e+01,
6207           0.5353771071862e-08, 0.4551978748683e+01, 0.1735668374386e+03,
6208 
6209           0.5063282210946e-08, 0.5710812312425e+01, 0.1248988586463e+02,
6210           0.5926120403383e-08, 0.1333998428358e+01, 0.2673594526851e+02,
6211           0.5211016176149e-08, 0.4649315360760e+01, 0.2460261242967e+02,
6212           0.5347075084894e-08, 0.5512754081205e+01, 0.4171425416666e+01,
6213           0.4872609773574e-08, 0.1308025299938e+01, 0.5333900173445e+01,
6214           0.4727711321420e-08, 0.2144908368062e+01, 0.7232251527446e+01,
6215           0.6029426018652e-08, 0.5567259412084e+01, 0.3227113045244e+03,
6216           0.4321485284369e-08, 0.5230667156451e+01, 0.9388005868221e+01,
6217           0.4476406760553e-08, 0.6134081115303e+01, 0.5547199253223e+01,
6218           0.5835268277420e-08, 0.4783808492071e+01, 0.7285056171570e+02,
6219 
6220           0.5172183602748e-08, 0.5161817911099e+01, 0.1884570439172e+02,
6221           0.5693571465184e-08, 0.1381646203111e+01, 0.9723862754494e+02,
6222           0.4060634965349e-08, 0.3876705259495e+00, 0.4274518229222e+01,
6223           0.3967398770473e-08, 0.5029491776223e+01, 0.3496032717521e+01,
6224           0.3943754005255e-08, 0.1923162955490e+01, 0.6244942932314e+01,
6225           0.4781323427824e-08, 0.4633332586423e+01, 0.2929661536378e+02,
6226           0.3871483781204e-08, 0.1616650009743e+01, 0.6321208768577e+01,
6227           0.5141741733997e-08, 0.9817316704659e-01, 0.1232032006293e+02,
6228           0.4002385978497e-08, 0.3656161212139e+01, 0.7018952447668e+01,
6229           0.4901092604097e-08, 0.4404098713092e+01, 0.1478866649112e+01,
6230 
6231           0.3740932630345e-08, 0.5181188732639e+00, 0.6922973089781e+01,
6232           0.4387283718538e-08, 0.3254859566869e+01, 0.2331413144044e+03,
6233           0.5019197802033e-08, 0.3086773224677e+01, 0.1715706182245e+02,
6234           0.3834931695175e-08, 0.2797882673542e+01, 0.1491901785440e+02,
6235           0.3760413942497e-08, 0.2892676280217e+01, 0.1726726808967e+02,
6236           0.3719717204628e-08, 0.5861046025739e+01, 0.6297302759782e+01,
6237           0.4145623530149e-08, 0.2168239627033e+01, 0.1376059875786e+02,
6238           0.3932788425380e-08, 0.6271811124181e+01, 0.7872148766781e+01,
6239           0.3686377476857e-08, 0.3936853151404e+01, 0.6268848941110e+01,
6240           0.3779077950339e-08, 0.1404148734043e+01, 0.4157198507331e+01,
6241 
6242           0.4091334550598e-08, 0.2452436180854e+01, 0.9779108567966e+01,
6243           0.3926694536146e-08, 0.6102292739040e+01, 0.1098419223922e+02,
6244           0.4841000253289e-08, 0.6072760457276e+01, 0.1252801878276e+02,
6245           0.4949340130240e-08, 0.1154832815171e+01, 0.1617106187867e+03,
6246           0.3761557737360e-08, 0.5527545321897e+01, 0.3185192151914e+01,
6247           0.3647396268188e-08, 0.1525035688629e+01, 0.6271346477544e+01,
6248           0.3932405074189e-08, 0.5570681040569e+01, 0.2139354194808e+02,
6249           0.3631322501141e-08, 0.1981240601160e+01, 0.6294805223347e+01,
6250           0.4130007425139e-08, 0.2050060880201e+01, 0.2195415756911e+02,
6251           0.4433905965176e-08, 0.3277477970321e+01, 0.7445550607224e+01,
6252 
6253           0.3851814176947e-08, 0.5210690074886e+01, 0.9562891316684e+00,
6254           0.3485807052785e-08, 0.6653274904611e+00, 0.1161697602389e+02,
6255           0.3979772816991e-08, 0.1767941436148e+01, 0.2277943724828e+02,
6256           0.3402607460500e-08, 0.3421746306465e+01, 0.1087398597200e+02,
6257           0.4049993000926e-08, 0.1127144787547e+01, 0.3163918923335e+00,
6258           0.3420511182382e-08, 0.4214794779161e+01, 0.1362553364512e+02,
6259           0.3640772365012e-08, 0.5324905497687e+01, 0.1725304118033e+02,
6260           0.3323037987501e-08, 0.6135761838271e+01, 0.6279143387820e+01,
6261           0.4503141663637e-08, 0.1802305450666e+01, 0.1385561574497e+01,
6262           0.4314560055588e-08, 0.4812299731574e+01, 0.4176041334900e+01,
6263 
6264           0.3294226949110e-08, 0.3657547059723e+01, 0.6287008313071e+01,
6265           0.3215657197281e-08, 0.4866676894425e+01, 0.5749861718712e+01,
6266           0.4129362656266e-08, 0.3809342558906e+01, 0.5905702259363e+01,
6267           0.3137762976388e-08, 0.2494635174443e+01, 0.2099539292909e+02,
6268           0.3514010952384e-08, 0.2699961831678e+01, 0.7335344340001e+01,
6269           0.3327607571530e-08, 0.3318457714816e+01, 0.5436992986000e+01,
6270           0.3541066946675e-08, 0.4382703582466e+01, 0.1234573916645e+02,
6271           0.3216179847052e-08, 0.5271066317054e+01, 0.3802769619140e-01,
6272           0.2959045059570e-08, 0.5819591585302e+01, 0.2670964694522e+02,
6273           0.3884040326665e-08, 0.5980934960428e+01, 0.6660449441528e+01,
6274 
6275           0.2922027539886e-08, 0.3337290282483e+01, 0.1375773836557e+01,
6276           0.4110846382042e-08, 0.5742978187327e+01, 0.4480965020977e+02,
6277           0.2934508411032e-08, 0.2278075804200e+01, 0.6408777551755e+00,
6278           0.3966896193000e-08, 0.5835747858477e+01, 0.3773735910827e+00,
6279           0.3286695827610e-08, 0.5838898193902e+01, 0.3932462625300e-02,
6280           0.3720643094196e-08, 0.1122212337858e+01, 0.1646033343740e+02,
6281           0.3285508906174e-08, 0.9182250996416e+00, 0.1081813534213e+02,
6282           0.3753880575973e-08, 0.5174761973266e+01, 0.5642198095270e+01,
6283           0.3022129385587e-08, 0.3381611020639e+01, 0.2982630633589e+02,
6284           0.2798569205621e-08, 0.3546193723922e+01, 0.1937891852345e+02,
6285 
6286           0.3397872070505e-08, 0.4533203197934e+01, 0.6923953605621e+01,
6287           0.3708099772977e-08, 0.2756168198616e+01, 0.3066615496545e+02,
6288           0.3599283541510e-08, 0.1934395469918e+01, 0.6147450479709e+01,
6289           0.3688702753059e-08, 0.7149920971109e+00, 0.2636725487657e+01,
6290           0.2681084724003e-08, 0.4899819493154e+01, 0.6816289982179e+01,
6291           0.3495993460759e-08, 0.1572418915115e+01, 0.6418701221183e+01,
6292           0.3130770324995e-08, 0.8912190180489e+00, 0.1235996607578e+02,
6293           0.2744353821941e-08, 0.3800821940055e+01, 0.2059724391010e+02,
6294           0.2842732906341e-08, 0.2644717440029e+01, 0.2828699048865e+02,
6295           0.3046882682154e-08, 0.3987793020179e+01, 0.6055599646783e+01,
6296 
6297           0.2399072455143e-08, 0.9908826440764e+00, 0.6255674361143e+01,
6298           0.2384306274204e-08, 0.2516149752220e+01, 0.6310477339748e+01,
6299           0.2977324500559e-08, 0.5849195642118e+01, 0.1652265972112e+02,
6300           0.3062835258972e-08, 0.1681660100162e+01, 0.1172006883645e+02,
6301           0.3109682589231e-08, 0.5804143987737e+00, 0.2751146787858e+02,
6302           0.2903920355299e-08, 0.5800768280123e+01, 0.6510552054109e+01,
6303           0.2823221989212e-08, 0.9241118370216e+00, 0.5469525544182e+01,
6304           0.3187949696649e-08, 0.3139776445735e+01, 0.1693792562116e+03,
6305           0.2922559771655e-08, 0.3549440782984e+01, 0.2630839062450e+00,
6306           0.2436302066603e-08, 0.4735540696319e+01, 0.3946258593675e+00,
6307 
6308           0.3049473043606e-08, 0.4998289124561e+01, 0.8390110365991e+01,
6309           0.2863682575784e-08, 0.6709515671102e+00, 0.2243449970715e+00,
6310           0.2641750517966e-08, 0.5410978257284e+01, 0.2986433403208e+02,
6311           0.2704093466243e-08, 0.4778317207821e+01, 0.6129297044991e+01,
6312           0.2445522177011e-08, 0.6009020662222e+01, 0.1171295538178e+02,
6313           0.2623608810230e-08, 0.5010449777147e+01, 0.6436854655901e+01,
6314           0.2079259704053e-08, 0.5980943768809e+01, 0.2019909489111e+02,
6315           0.2820225596771e-08, 0.2679965110468e+01, 0.5934151399930e+01,
6316           0.2365221950927e-08, 0.1894231148810e+01, 0.2470570524223e+02,
6317           0.2359682077149e-08, 0.4220752950780e+01, 0.8671969964381e+01,
6318 
6319           0.2387577137206e-08, 0.2571783940617e+01, 0.7096626156709e+01,
6320           0.1982102089816e-08, 0.5169765997119e+00, 0.1727188400790e+02,
6321           0.2687502389925e-08, 0.6239078264579e+01, 0.7075506709219e+02,
6322           0.2207751669135e-08, 0.2031184412677e+01, 0.4377611041777e+01,
6323           0.2618370214274e-08, 0.8266079985979e+00, 0.6632000300961e+01,
6324           0.2591951887361e-08, 0.8819350522008e+00, 0.4873985990671e+02,
6325           0.2375055656248e-08, 0.3520944177789e+01, 0.1590676413561e+02,
6326           0.2472019978911e-08, 0.1551431908671e+01, 0.6612329252343e+00,
6327           0.2368157127199e-08, 0.4178610147412e+01, 0.3459636466239e+02,
6328           0.1764846605693e-08, 0.1506764000157e+01, 0.1980094587212e+02,
6329 
6330           0.2291769608798e-08, 0.2118250611782e+01, 0.2844914056730e-01,
6331           0.2209997316943e-08, 0.3363255261678e+01, 0.2666070658668e+00,
6332           0.2292699097923e-08, 0.4200423956460e+00, 0.1484170571900e-02,
6333           0.1629683015329e-08, 0.2331362582487e+01, 0.3035599730800e+02,
6334           0.2206492862426e-08, 0.3400274026992e+01, 0.6281667977667e+01,
6335           0.2205746568257e-08, 0.1066051230724e+00, 0.6284483723224e+01,
6336           0.2026310767991e-08, 0.2779066487979e+01, 0.2449240616245e+02,
6337           0.1762977622163e-08, 0.9951450691840e+00, 0.2045286941806e+02,
6338           0.1368535049606e-08, 0.6402447365817e+00, 0.2473415438279e+02,
6339           0.1720598775450e-08, 0.2303524214705e+00, 0.1679593901136e+03,
6340 
6341           0.1702429015449e-08, 0.6164622655048e+01, 0.3338575901272e+03,
6342           0.1414033197685e-08, 0.3954561185580e+01, 0.1624205518357e+03,
6343           0.1573768958043e-08, 0.2028286308984e+01, 0.3144167757552e+02,
6344           0.1650705184447e-08, 0.2304040666128e+01, 0.5267006960365e+02,
6345           0.1651087618855e-08, 0.2538461057280e+01, 0.8956999012000e+02,
6346           0.1616409518983e-08, 0.5111054348152e+01, 0.3332657872986e+02,
6347           0.1537175173581e-08, 0.5601130666603e+01, 0.3852657435933e+02,
6348           0.1593191980553e-08, 0.2614340453411e+01, 0.2282781046519e+03,
6349           0.1499480170643e-08, 0.3624721577264e+01, 0.2823723341956e+02,
6350           0.1493807843235e-08, 0.4214569879008e+01, 0.2876692439167e+02,
6351 
6352           0.1074571199328e-08, 0.1496911744704e+00, 0.8397383534231e+02,
6353           0.1074406983417e-08, 0.1187817671922e+01, 0.8401985929482e+02,
6354           0.9757576855851e-09, 0.2655703035858e+01, 0.7826370942180e+02,
6355           0.1258432887565e-08, 0.4969896184844e+01, 0.3115650189215e+03,
6356           0.1240336343282e-08, 0.5192460776926e+01, 0.1784300471910e+03,
6357           0.9016107005164e-09, 0.1960356923057e+01, 0.5886454391678e+02,
6358           0.1135392360918e-08, 0.5082427809068e+01, 0.7842370451713e+02,
6359           0.9216046089565e-09, 0.2793775037273e+01, 0.1014262087719e+03,
6360           0.1061276615030e-08, 0.3726144311409e+01, 0.5660027930059e+02,
6361           0.1010110596263e-08, 0.7404080708937e+00, 0.4245678405627e+02,
6362 
6363           0.7217424756199e-09, 0.2697449980577e-01, 0.2457074661053e+03,
6364           0.6912003846756e-09, 0.4253296276335e+01, 0.1679936946371e+03,
6365           0.6871814664847e-09, 0.5148072412354e+01, 0.6053048899753e+02,
6366           0.4887158016343e-09, 0.2153581148294e+01, 0.9656299901946e+02,
6367           0.5161802866314e-09, 0.3852750634351e+01, 0.2442876000072e+03,
6368           0.5652599559057e-09, 0.1233233356270e+01, 0.8365903305582e+02,
6369           0.4710812608586e-09, 0.5610486976767e+01, 0.3164282286739e+03,
6370           0.4909977500324e-09, 0.1639629524123e+01, 0.4059982187939e+03,
6371           0.4772641839378e-09, 0.3737100368583e+01, 0.1805255418145e+03,
6372           0.4487562567153e-09, 0.1158417054478e+00, 0.8433466158131e+02,
6373 
6374           0.3943441230497e-09, 0.6243502862796e+00, 0.2568537517081e+03,
6375           0.3952236913598e-09, 0.3510377382385e+01, 0.2449975330562e+03,
6376           0.3788898363417e-09, 0.5916128302299e+01, 0.1568131045107e+03,
6377           0.3738329328831e-09, 0.1042266763456e+01, 0.3948519331910e+03,
6378           0.2451199165151e-09, 0.1166788435700e+01, 0.1435713242844e+03,
6379           0.2436734402904e-09, 0.3254726114901e+01, 0.2268582385539e+03,
6380           0.2213605274325e-09, 0.1687210598530e+01, 0.1658638954901e+03,
6381           0.1491521204829e-09, 0.2657541786794e+01, 0.2219950288015e+03,
6382           0.1474995329744e-09, 0.5013089805819e+01, 0.3052819430710e+03,
6383           0.1661939475656e-09, 0.5495315428418e+01, 0.2526661704812e+03,
6384 
6385           0.9015946748003e-10, 0.2236989966505e+01, 0.4171445043968e+03 };
6386 
6387     /* Sun-to-Earth, T^0, Z */
6388       static final double e0z[] = {
6389           0.2796207639075e-05, 0.3198701560209e+01, 0.8433466158131e+02,
6390           0.1016042198142e-05, 0.5422360395913e+01, 0.5507553240374e+01,
6391           0.8044305033647e-06, 0.3880222866652e+01, 0.5223693906222e+01,
6392           0.4385347909274e-06, 0.3704369937468e+01, 0.2352866153506e+01,
6393           0.3186156414906e-06, 0.3999639363235e+01, 0.1577343543434e+01,
6394           0.2272412285792e-06, 0.3984738315952e+01, 0.1047747311755e+01,
6395           0.1645620103007e-06, 0.3565412516841e+01, 0.5856477690889e+01,
6396           0.1815836921166e-06, 0.4984507059020e+01, 0.6283075850446e+01,
6397           0.1447461676364e-06, 0.3702753570108e+01, 0.9437762937313e+01,
6398           0.1430760876382e-06, 0.3409658712357e+01, 0.1021328554739e+02,
6399 
6400           0.1120445753226e-06, 0.4829561570246e+01, 0.1414349524433e+02,
6401           0.1090232840797e-06, 0.2080729178066e+01, 0.6812766822558e+01,
6402           0.9715727346551e-07, 0.3476295881948e+01, 0.4694002934110e+01,
6403           0.1036267136217e-06, 0.4056639536648e+01, 0.7109288135493e+02,
6404           0.8752665271340e-07, 0.4448159519911e+01, 0.5753384878334e+01,
6405           0.8331864956004e-07, 0.4991704044208e+01, 0.7084896783808e+01,
6406           0.6901658670245e-07, 0.4325358994219e+01, 0.6275962395778e+01,
6407           0.9144536848998e-07, 0.1141826375363e+01, 0.6620890113188e+01,
6408           0.7205085037435e-07, 0.3624344170143e+01, 0.5296909721118e+00,
6409           0.7697874654176e-07, 0.5554257458998e+01, 0.1676215758509e+03,
6410 
6411           0.5197545738384e-07, 0.6251760961735e+01, 0.1807370494127e+02,
6412           0.5031345378608e-07, 0.2497341091913e+01, 0.4705732307012e+01,
6413           0.4527110205840e-07, 0.2335079920992e+01, 0.6309374173736e+01,
6414           0.4753355798089e-07, 0.7094148987474e+00, 0.5884926831456e+01,
6415           0.4296951977516e-07, 0.1101916352091e+01, 0.6681224869435e+01,
6416           0.3855341568387e-07, 0.1825495405486e+01, 0.5486777812467e+01,
6417           0.5253930970990e-07, 0.4424740687208e+01, 0.7860419393880e+01,
6418           0.4024630496471e-07, 0.5120498157053e+01, 0.1336797263425e+02,
6419           0.4061069791453e-07, 0.6029771435451e+01, 0.3930209696940e+01,
6420           0.3797883804205e-07, 0.4435193600836e+00, 0.3154687086868e+01,
6421 
6422           0.2933033225587e-07, 0.5124157356507e+01, 0.1059381944224e+01,
6423           0.3503000930426e-07, 0.5421830162065e+01, 0.6069776770667e+01,
6424           0.3670096214050e-07, 0.4582101667297e+01, 0.1219403291462e+02,
6425           0.2905609437008e-07, 0.1926566420072e+01, 0.1097707878456e+02,
6426           0.2466827821713e-07, 0.6090174539834e+00, 0.6496374930224e+01,
6427           0.2691647295332e-07, 0.1393432595077e+01, 0.2200391463820e+02,
6428           0.2150554667946e-07, 0.4308671715951e+01, 0.5643178611111e+01,
6429           0.2237481922680e-07, 0.8133968269414e+00, 0.8635942003952e+01,
6430           0.1817741038157e-07, 0.3755205127454e+01, 0.3340612434717e+01,
6431           0.2227820762132e-07, 0.2759558596664e+01, 0.1203646072878e+02,
6432 
6433           0.1944713772307e-07, 0.5699645869121e+01, 0.1179062909082e+02,
6434           0.1527340520662e-07, 0.1986749091746e+01, 0.3981490189893e+00,
6435           0.1577282574914e-07, 0.3205017217983e+01, 0.5088628793478e+01,
6436           0.1424738825424e-07, 0.6256747903666e+01, 0.2544314396739e+01,
6437           0.1616563121701e-07, 0.2601671259394e+00, 0.1729818233119e+02,
6438           0.1401210391692e-07, 0.4686939173506e+01, 0.7058598460518e+01,
6439           0.1488726974214e-07, 0.2815862451372e+01, 0.2593412433514e+02,
6440           0.1692626442388e-07, 0.4956894109797e+01, 0.1564752902480e+03,
6441           0.1123571582910e-07, 0.2381192697696e+01, 0.3738761453707e+01,
6442           0.9903308606317e-08, 0.4294851657684e+01, 0.9225539266174e+01,
6443 
6444           0.9174533187191e-08, 0.3075171510642e+01, 0.4164311961999e+01,
6445           0.8645985631457e-08, 0.5477534821633e+00, 0.8429241228195e+01,
6446          -0.1085876492688e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6447           0.9264309077815e-08, 0.5968571670097e+01, 0.7079373888424e+01,
6448           0.8243116984954e-08, 0.1489098777643e+01, 0.1044738781244e+02,
6449           0.8268102113708e-08, 0.3512977691983e+01, 0.1150676975667e+02,
6450           0.9043613988227e-08, 0.1290704408221e+00, 0.1101510648075e+02,
6451           0.7432912038789e-08, 0.1991086893337e+01, 0.2608790314060e+02,
6452           0.8586233727285e-08, 0.4238357924414e+01, 0.2986433403208e+02,
6453           0.7612230060131e-08, 0.2911090150166e+01, 0.4732030630302e+01,
6454 
6455           0.7097787751408e-08, 0.1908938392390e+01, 0.8031092209206e+01,
6456           0.7640237040175e-08, 0.6129219000168e+00, 0.7962980379786e+00,
6457           0.7070445688081e-08, 0.1380417036651e+01, 0.2146165377750e+01,
6458           0.7690770957702e-08, 0.1680504249084e+01, 0.2122839202813e+02,
6459           0.8051292542594e-08, 0.5127423484511e+01, 0.2942463415728e+01,
6460           0.5902709104515e-08, 0.2020274190917e+01, 0.7755226100720e+00,
6461           0.5134567496462e-08, 0.2606778676418e+01, 0.1256615170089e+02,
6462           0.5525802046102e-08, 0.1613011769663e+01, 0.8018209333619e+00,
6463           0.5880724784221e-08, 0.4604483417236e+01, 0.4690479774488e+01,
6464           0.5211699081370e-08, 0.5718964114193e+01, 0.8827390247185e+01,
6465 
6466           0.4891849573562e-08, 0.3689658932196e+01, 0.2132990797783e+00,
6467           0.5150246069997e-08, 0.4099769855122e+01, 0.6480980550449e+02,
6468           0.5102434319633e-08, 0.5660834602509e+01, 0.3379454372902e+02,
6469           0.5083405254252e-08, 0.9842221218974e+00, 0.4136910472696e+01,
6470           0.4206562585682e-08, 0.1341363634163e+00, 0.3128388763578e+01,
6471           0.4663249683579e-08, 0.8130132735866e+00, 0.5216580451554e+01,
6472           0.4099474416530e-08, 0.5791497770644e+01, 0.4265981595566e+00,
6473           0.4628251220767e-08, 0.1249802769331e+01, 0.1572083878776e+02,
6474           0.5024068728142e-08, 0.4795684802743e+01, 0.6290189305114e+01,
6475           0.5120234327758e-08, 0.3810420387208e+01, 0.5230807360890e+01,
6476 
6477           0.5524029815280e-08, 0.1029264714351e+01, 0.2397622045175e+03,
6478           0.4757415718860e-08, 0.3528044781779e+01, 0.1649636139783e+02,
6479           0.3915786131127e-08, 0.5593889282646e+01, 0.1589072916335e+01,
6480           0.4869053149991e-08, 0.3299636454433e+01, 0.7632943190217e+01,
6481           0.3649365703729e-08, 0.1286049002584e+01, 0.6206810014183e+01,
6482           0.3992493949002e-08, 0.3100307589464e+01, 0.2515860172507e+02,
6483           0.3320247477418e-08, 0.6212683940807e+01, 0.1216800268190e+02,
6484           0.3287123739696e-08, 0.4699118445928e+01, 0.7234794171227e+01,
6485           0.3472776811103e-08, 0.2630507142004e+01, 0.7342457794669e+01,
6486           0.3423253294767e-08, 0.2946432844305e+01, 0.9623688285163e+01,
6487 
6488           0.3896173898244e-08, 0.1224834179264e+01, 0.6438496133249e+01,
6489           0.3388455337924e-08, 0.1543807616351e+01, 0.1494531617769e+02,
6490           0.3062704716523e-08, 0.1191777572310e+01, 0.8662240327241e+01,
6491           0.3270075600400e-08, 0.5483498767737e+01, 0.1194447056968e+01,
6492           0.3101209215259e-08, 0.8000833804348e+00, 0.3772475342596e+02,
6493           0.2780883347311e-08, 0.4077980721888e+00, 0.5863591145557e+01,
6494           0.2903605931824e-08, 0.2617490302147e+01, 0.1965104848470e+02,
6495           0.2682014743119e-08, 0.2634703158290e+01, 0.7238675589263e+01,
6496           0.2534360108492e-08, 0.6102446114873e+01, 0.6836645152238e+01,
6497           0.2392564882509e-08, 0.3681820208691e+01, 0.5849364236221e+01,
6498 
6499           0.2656667254856e-08, 0.6216045388886e+01, 0.6133512519065e+01,
6500           0.2331242096773e-08, 0.5864949777744e+01, 0.4535059491685e+01,
6501           0.2287898363668e-08, 0.4566628532802e+01, 0.7477522907414e+01,
6502           0.2336944521306e-08, 0.2442722126930e+01, 0.1137170464392e+02,
6503           0.3156632236269e-08, 0.1626628050682e+01, 0.2509084901204e+03,
6504           0.2982612402766e-08, 0.2803604512609e+01, 0.1748016358760e+01,
6505           0.2774031674807e-08, 0.4654002897158e+01, 0.8223916695780e+02,
6506           0.2295236548638e-08, 0.4326518333253e+01, 0.3378142627421e+00,
6507           0.2190714699873e-08, 0.4519614578328e+01, 0.2908881142201e+02,
6508           0.2191495845045e-08, 0.3012626912549e+01, 0.1673046366289e+02,
6509 
6510           0.2492901628386e-08, 0.1290101424052e+00, 0.1543797956245e+03,
6511           0.1993778064319e-08, 0.3864046799414e+01, 0.1778984560711e+02,
6512           0.1898146479022e-08, 0.5053777235891e+01, 0.2042657109477e+02,
6513           0.1918280127634e-08, 0.2222470192548e+01, 0.4165496312290e+02,
6514           0.1916351061607e-08, 0.8719067257774e+00, 0.7737595720538e+02,
6515           0.1834720181466e-08, 0.4031491098040e+01, 0.2358125818164e+02,
6516           0.1249201523806e-08, 0.5938379466835e+01, 0.3301902111895e+02,
6517           0.1477304050539e-08, 0.6544722606797e+00, 0.9548094718417e+02,
6518           0.1264316431249e-08, 0.2059072853236e+01, 0.8399684731857e+02,
6519           0.1203526495039e-08, 0.3644813532605e+01, 0.4558517281984e+02,
6520 
6521           0.9221681059831e-09, 0.3241815055602e+01, 0.7805158573086e+02,
6522           0.7849278367646e-09, 0.5043812342457e+01, 0.5217580628120e+02,
6523           0.7983392077387e-09, 0.5000024502753e+01, 0.1501922143975e+03,
6524           0.7925395431654e-09, 0.1398734871821e-01, 0.9061773743175e+02,
6525           0.7640473285886e-09, 0.5067111723130e+01, 0.4951538251678e+02,
6526           0.5398937754482e-09, 0.5597382200075e+01, 0.1613385000004e+03,
6527           0.5626247550193e-09, 0.2601338209422e+01, 0.7318837597844e+02,
6528           0.5525197197855e-09, 0.5814832109256e+01, 0.1432335100216e+03,
6529           0.5407629837898e-09, 0.3384820609076e+01, 0.3230491187871e+03,
6530           0.3856739119801e-09, 0.1072391840473e+01, 0.2334791286671e+03,
6531 
6532           0.3856425239987e-09, 0.2369540393327e+01, 0.1739046517013e+03,
6533           0.4350867755983e-09, 0.5255575751082e+01, 0.1620484330494e+03,
6534           0.3844113924996e-09, 0.5482356246182e+01, 0.9757644180768e+02,
6535           0.2854869155431e-09, 0.9573634763143e+00, 0.1697170704744e+03,
6536           0.1719227671416e-09, 0.1887203025202e+01, 0.2265204242912e+03,
6537           0.1527846879755e-09, 0.3982183931157e+01, 0.3341954043900e+03,
6538           0.1128229264847e-09, 0.2787457156298e+01, 0.3119028331842e+03 };
6539 
6540     /* Sun-to-Earth, T^1, X */
6541       static final double e1x[] = {
6542           0.1234046326004e-05, 0.0000000000000e+00, 0.0000000000000e+00,
6543           0.5150068824701e-06, 0.6002664557501e+01, 0.1256615170089e+02,
6544           0.1290743923245e-07, 0.5959437664199e+01, 0.1884922755134e+02,
6545           0.1068615564952e-07, 0.2015529654209e+01, 0.6283075850446e+01,
6546           0.2079619142538e-08, 0.1732960531432e+01, 0.6279552690824e+01,
6547           0.2078009243969e-08, 0.4915604476996e+01, 0.6286599010068e+01,
6548           0.6206330058856e-09, 0.3616457953824e+00, 0.4705732307012e+01,
6549           0.5989335313746e-09, 0.3802607304474e+01, 0.6256777527156e+01,
6550           0.5958495663840e-09, 0.2845866560031e+01, 0.6309374173736e+01,
6551           0.4866923261539e-09, 0.5213203771824e+01, 0.7755226100720e+00,
6552 
6553           0.4267785823142e-09, 0.4368189727818e+00, 0.1059381944224e+01,
6554           0.4610675141648e-09, 0.1837249181372e-01, 0.7860419393880e+01,
6555           0.3626989993973e-09, 0.2161590545326e+01, 0.5753384878334e+01,
6556           0.3563071194389e-09, 0.1452631954746e+01, 0.5884926831456e+01,
6557           0.3557015642807e-09, 0.4470593393054e+01, 0.6812766822558e+01,
6558           0.3210412089122e-09, 0.5195926078314e+01, 0.6681224869435e+01,
6559           0.2875473577986e-09, 0.5916256610193e+01, 0.2513230340178e+02,
6560           0.2842913681629e-09, 0.1149902426047e+01, 0.6127655567643e+01,
6561           0.2751248215916e-09, 0.5502088574662e+01, 0.6438496133249e+01,
6562           0.2481432881127e-09, 0.2921989846637e+01, 0.5486777812467e+01,
6563 
6564           0.2059885976560e-09, 0.3718070376585e+01, 0.7079373888424e+01,
6565           0.2015522342591e-09, 0.5979395259740e+01, 0.6290189305114e+01,
6566           0.1995364084253e-09, 0.6772087985494e+00, 0.6275962395778e+01,
6567           0.1957436436943e-09, 0.2899210654665e+01, 0.5507553240374e+01,
6568           0.1651609818948e-09, 0.6228206482192e+01, 0.1150676975667e+02,
6569           0.1822980550699e-09, 0.1469348746179e+01, 0.1179062909082e+02,
6570           0.1675223159760e-09, 0.3813910555688e+01, 0.7058598460518e+01,
6571           0.1706491764745e-09, 0.3004380506684e+00, 0.7113454667900e-02,
6572           0.1392952362615e-09, 0.1440393973406e+01, 0.7962980379786e+00,
6573           0.1209868266342e-09, 0.4150425791727e+01, 0.4694002934110e+01,
6574 
6575           0.1009827202611e-09, 0.3290040429843e+01, 0.3738761453707e+01,
6576           0.1047261388602e-09, 0.4229590090227e+01, 0.6282095334605e+01,
6577           0.1047006652004e-09, 0.2418967680575e+01, 0.6284056366286e+01,
6578           0.9609993143095e-10, 0.4627943659201e+01, 0.6069776770667e+01,
6579           0.9590900593873e-10, 0.1894393939924e+01, 0.4136910472696e+01,
6580           0.9146249188071e-10, 0.2010647519562e+01, 0.6496374930224e+01,
6581           0.8545274480290e-10, 0.5529846956226e-01, 0.1194447056968e+01,
6582           0.8224377881194e-10, 0.1254304102174e+01, 0.1589072916335e+01,
6583           0.6183529510410e-10, 0.3360862168815e+01, 0.8827390247185e+01,
6584           0.6259255147141e-10, 0.4755628243179e+01, 0.8429241228195e+01,
6585 
6586           0.5539291694151e-10, 0.5371746955142e+01, 0.4933208510675e+01,
6587           0.7328259466314e-10, 0.4927699613906e+00, 0.4535059491685e+01,
6588           0.6017835843560e-10, 0.5776682001734e-01, 0.1255903824622e+02,
6589           0.7079827775243e-10, 0.4395059432251e+01, 0.5088628793478e+01,
6590           0.5170358878213e-10, 0.5154062619954e+01, 0.1176985366291e+02,
6591           0.4872301838682e-10, 0.6289611648973e+00, 0.6040347114260e+01,
6592           0.5249869411058e-10, 0.5617272046949e+01, 0.3154687086868e+01,
6593           0.4716172354411e-10, 0.3965901800877e+01, 0.5331357529664e+01,
6594           0.4871214940964e-10, 0.4627507050093e+01, 0.1256967486051e+02,
6595           0.4598076850751e-10, 0.6023631226459e+01, 0.6525804586632e+01,
6596 
6597           0.4562196089485e-10, 0.4138562084068e+01, 0.3930209696940e+01,
6598           0.4325493872224e-10, 0.1330845906564e+01, 0.7632943190217e+01,
6599           0.5673781176748e-10, 0.2558752615657e+01, 0.5729506548653e+01,
6600           0.3961436642503e-10, 0.2728071734630e+01, 0.7234794171227e+01,
6601           0.5101868209058e-10, 0.4113444965144e+01, 0.6836645152238e+01,
6602           0.5257043167676e-10, 0.6195089830590e+01, 0.8031092209206e+01,
6603           0.5076613989393e-10, 0.2305124132918e+01, 0.7477522907414e+01,
6604           0.3342169352778e-10, 0.5415998155071e+01, 0.1097707878456e+02,
6605           0.3545881983591e-10, 0.3727160564574e+01, 0.4164311961999e+01,
6606           0.3364063738599e-10, 0.2901121049204e+00, 0.1137170464392e+02,
6607 
6608           0.3357039670776e-10, 0.1652229354331e+01, 0.5223693906222e+01,
6609           0.4307412268687e-10, 0.4938909587445e+01, 0.1592596075957e+01,
6610           0.3405769115435e-10, 0.2408890766511e+01, 0.3128388763578e+01,
6611           0.3001926198480e-10, 0.4862239006386e+01, 0.1748016358760e+01,
6612           0.2778264787325e-10, 0.5241168661353e+01, 0.7342457794669e+01,
6613           0.2676159480666e-10, 0.3423593942199e+01, 0.2146165377750e+01,
6614           0.2954273399939e-10, 0.1881721265406e+01, 0.5368044267797e+00,
6615           0.3309362888795e-10, 0.1931525677349e+01, 0.8018209333619e+00,
6616           0.2810283608438e-10, 0.2414659495050e+01, 0.5225775174439e+00,
6617           0.3378045637764e-10, 0.4238019163430e+01, 0.1554202828031e+00,
6618 
6619           0.2558134979840e-10, 0.1828225235805e+01, 0.5230807360890e+01,
6620           0.2273755578447e-10, 0.5858184283998e+01, 0.7084896783808e+01,
6621           0.2294176037690e-10, 0.4514589779057e+01, 0.1726015463500e+02,
6622           0.2533506099435e-10, 0.2355717851551e+01, 0.5216580451554e+01,
6623           0.2716685375812e-10, 0.2221003625100e+01, 0.8635942003952e+01,
6624           0.2419043435198e-10, 0.5955704951635e+01, 0.4690479774488e+01,
6625           0.2521232544812e-10, 0.1395676848521e+01, 0.5481254917084e+01,
6626           0.2630195021491e-10, 0.5727468918743e+01, 0.2629832328990e-01,
6627           0.2548395840944e-10, 0.2628351859400e-03, 0.1349867339771e+01 };
6628 
6629     /* Sun-to-Earth, T^1, Y */
6630       static final double e1y[] = {
6631           0.9304690546528e-06, 0.0000000000000e+00, 0.0000000000000e+00,
6632           0.5150715570663e-06, 0.4431807116294e+01, 0.1256615170089e+02,
6633           0.1290825411056e-07, 0.4388610039678e+01, 0.1884922755134e+02,
6634           0.4645466665386e-08, 0.5827263376034e+01, 0.6283075850446e+01,
6635           0.2079625310718e-08, 0.1621698662282e+00, 0.6279552690824e+01,
6636           0.2078189850907e-08, 0.3344713435140e+01, 0.6286599010068e+01,
6637           0.6207190138027e-09, 0.5074049319576e+01, 0.4705732307012e+01,
6638           0.5989826532569e-09, 0.2231842216620e+01, 0.6256777527156e+01,
6639           0.5961360812618e-09, 0.1274975769045e+01, 0.6309374173736e+01,
6640           0.4874165471016e-09, 0.3642277426779e+01, 0.7755226100720e+00,
6641 
6642           0.4283834034360e-09, 0.5148765510106e+01, 0.1059381944224e+01,
6643           0.4652389287529e-09, 0.4715794792175e+01, 0.7860419393880e+01,
6644           0.3751707476401e-09, 0.6617207370325e+00, 0.5753384878334e+01,
6645           0.3559998806198e-09, 0.6155548875404e+01, 0.5884926831456e+01,
6646           0.3558447558857e-09, 0.2898827297664e+01, 0.6812766822558e+01,
6647           0.3211116927106e-09, 0.3625813502509e+01, 0.6681224869435e+01,
6648           0.2875609914672e-09, 0.4345435813134e+01, 0.2513230340178e+02,
6649           0.2843109704069e-09, 0.5862263940038e+01, 0.6127655567643e+01,
6650           0.2744676468427e-09, 0.3926419475089e+01, 0.6438496133249e+01,
6651           0.2481285237789e-09, 0.1351976572828e+01, 0.5486777812467e+01,
6652 
6653           0.2060338481033e-09, 0.2147556998591e+01, 0.7079373888424e+01,
6654           0.2015822358331e-09, 0.4408358972216e+01, 0.6290189305114e+01,
6655           0.2001195944195e-09, 0.5385829822531e+01, 0.6275962395778e+01,
6656           0.1953667642377e-09, 0.1304933746120e+01, 0.5507553240374e+01,
6657           0.1839744078713e-09, 0.6173567228835e+01, 0.1179062909082e+02,
6658           0.1643334294845e-09, 0.4635942997523e+01, 0.1150676975667e+02,
6659           0.1768051018652e-09, 0.5086283558874e+01, 0.7113454667900e-02,
6660           0.1674874205489e-09, 0.2243332137241e+01, 0.7058598460518e+01,
6661           0.1421445397609e-09, 0.6186899771515e+01, 0.7962980379786e+00,
6662           0.1255163958267e-09, 0.5730238465658e+01, 0.4694002934110e+01,
6663 
6664           0.1013945281961e-09, 0.1726055228402e+01, 0.3738761453707e+01,
6665           0.1047294335852e-09, 0.2658801228129e+01, 0.6282095334605e+01,
6666           0.1047103879392e-09, 0.8481047835035e+00, 0.6284056366286e+01,
6667           0.9530343962826e-10, 0.3079267149859e+01, 0.6069776770667e+01,
6668           0.9604637611690e-10, 0.3258679792918e+00, 0.4136910472696e+01,
6669           0.9153518537177e-10, 0.4398599886584e+00, 0.6496374930224e+01,
6670           0.8562458214922e-10, 0.4772686794145e+01, 0.1194447056968e+01,
6671           0.8232525360654e-10, 0.5966220721679e+01, 0.1589072916335e+01,
6672           0.6150223411438e-10, 0.1780985591923e+01, 0.8827390247185e+01,
6673           0.6272087858000e-10, 0.3184305429012e+01, 0.8429241228195e+01,
6674 
6675           0.5540476311040e-10, 0.3801260595433e+01, 0.4933208510675e+01,
6676           0.7331901699361e-10, 0.5205948591865e+01, 0.4535059491685e+01,
6677           0.6018528702791e-10, 0.4770139083623e+01, 0.1255903824622e+02,
6678           0.5150530724804e-10, 0.3574796899585e+01, 0.1176985366291e+02,
6679           0.6471933741811e-10, 0.2679787266521e+01, 0.5088628793478e+01,
6680           0.5317460644174e-10, 0.9528763345494e+00, 0.3154687086868e+01,
6681           0.4832187748783e-10, 0.5329322498232e+01, 0.6040347114260e+01,
6682           0.4716763555110e-10, 0.2395235316466e+01, 0.5331357529664e+01,
6683           0.4871509139861e-10, 0.3056663648823e+01, 0.1256967486051e+02,
6684           0.4598417696768e-10, 0.4452762609019e+01, 0.6525804586632e+01,
6685 
6686           0.5674189533175e-10, 0.9879680872193e+00, 0.5729506548653e+01,
6687           0.4073560328195e-10, 0.5939127696986e+01, 0.7632943190217e+01,
6688           0.5040994945359e-10, 0.4549875824510e+01, 0.8031092209206e+01,
6689           0.5078185134679e-10, 0.7346659893982e+00, 0.7477522907414e+01,
6690           0.3769343537061e-10, 0.1071317188367e+01, 0.7234794171227e+01,
6691           0.4980331365299e-10, 0.2500345341784e+01, 0.6836645152238e+01,
6692           0.3458236594757e-10, 0.3825159450711e+01, 0.1097707878456e+02,
6693           0.3578859493602e-10, 0.5299664791549e+01, 0.4164311961999e+01,
6694           0.3370504646419e-10, 0.5002316301593e+01, 0.1137170464392e+02,
6695           0.3299873338428e-10, 0.2526123275282e+01, 0.3930209696940e+01,
6696 
6697           0.4304917318409e-10, 0.3368078557132e+01, 0.1592596075957e+01,
6698           0.3402418753455e-10, 0.8385495425800e+00, 0.3128388763578e+01,
6699           0.2778460572146e-10, 0.3669905203240e+01, 0.7342457794669e+01,
6700           0.2782710128902e-10, 0.2691664812170e+00, 0.1748016358760e+01,
6701           0.2711725179646e-10, 0.4707487217718e+01, 0.5296909721118e+00,
6702           0.2981760946340e-10, 0.3190260867816e+00, 0.5368044267797e+00,
6703           0.2811672977772e-10, 0.3196532315372e+01, 0.7084896783808e+01,
6704           0.2863454474467e-10, 0.2263240324780e+00, 0.5223693906222e+01,
6705           0.3333464634051e-10, 0.3498451685065e+01, 0.8018209333619e+00,
6706           0.3312991747609e-10, 0.5839154477412e+01, 0.1554202828031e+00,
6707 
6708           0.2813255564006e-10, 0.8268044346621e+00, 0.5225775174439e+00,
6709           0.2665098083966e-10, 0.3934021725360e+01, 0.5216580451554e+01,
6710           0.2349795705216e-10, 0.5197620913779e+01, 0.2146165377750e+01,
6711           0.2330352293961e-10, 0.2984999231807e+01, 0.1726015463500e+02,
6712           0.2728001683419e-10, 0.6521679638544e+00, 0.8635942003952e+01,
6713           0.2484061007669e-10, 0.3468955561097e+01, 0.5230807360890e+01,
6714           0.2646328768427e-10, 0.1013724533516e+01, 0.2629832328990e-01,
6715           0.2518630264831e-10, 0.6108081057122e+01, 0.5481254917084e+01,
6716           0.2421901455384e-10, 0.1651097776260e+01, 0.1349867339771e+01,
6717           0.6348533267831e-11, 0.3220226560321e+01, 0.8433466158131e+02 };
6718 
6719     /* Sun-to-Earth, T^1, Z */
6720       static final double e1z[] = {
6721           0.2278290449966e-05, 0.3413716033863e+01, 0.6283075850446e+01,
6722           0.5429458209830e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6723           0.1903240492525e-07, 0.3370592358297e+01, 0.1256615170089e+02,
6724           0.2385409276743e-09, 0.3327914718416e+01, 0.1884922755134e+02,
6725           0.8676928342573e-10, 0.1824006811264e+01, 0.5223693906222e+01,
6726           0.7765442593544e-10, 0.3888564279247e+01, 0.5507553240374e+01,
6727           0.7066158332715e-10, 0.5194267231944e+01, 0.2352866153506e+01,
6728           0.7092175288657e-10, 0.2333246960021e+01, 0.8399684731857e+02,
6729           0.5357582213535e-10, 0.2224031176619e+01, 0.5296909721118e+00,
6730           0.3828035865021e-10, 0.2156710933584e+01, 0.6279552690824e+01,
6731 
6732           0.3824857220427e-10, 0.1529755219915e+01, 0.6286599010068e+01,
6733           0.3286995181628e-10, 0.4879512900483e+01, 0.1021328554739e+02 };
6734 
6735     /* Sun-to-Earth, T^2, X */
6736       static final double e2x[] = {
6737          -0.4143818297913e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6738           0.2171497694435e-10, 0.4398225628264e+01, 0.1256615170089e+02,
6739           0.9845398442516e-11, 0.2079720838384e+00, 0.6283075850446e+01,
6740           0.9256833552682e-12, 0.4191264694361e+01, 0.1884922755134e+02,
6741           0.1022049384115e-12, 0.5381133195658e+01, 0.8399684731857e+02 };
6742 
6743     /* Sun-to-Earth, T^2, Y */
6744       static final double e2y[] = {
6745           0.5063375872532e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6746           0.2173815785980e-10, 0.2827805833053e+01, 0.1256615170089e+02,
6747           0.1010231999920e-10, 0.4634612377133e+01, 0.6283075850446e+01,
6748           0.9259745317636e-12, 0.2620612076189e+01, 0.1884922755134e+02,
6749           0.1022202095812e-12, 0.3809562326066e+01, 0.8399684731857e+02 };
6750 
6751     /* Sun-to-Earth, T^2, Z */
6752       static final double e2z[] = {
6753           0.9722666114891e-10, 0.5152219582658e+01, 0.6283075850446e+01,
6754          -0.3494819171909e-11, 0.0000000000000e+00, 0.0000000000000e+00,
6755           0.6713034376076e-12, 0.6440188750495e+00, 0.1256615170089e+02 };
6756 
6757     }
6758       //subclassed the 
6759       private static class SSB {
6760     /* SSB-to-Sun, T^0, X */
6761       static final double s0x[] = {
6762           0.4956757536410e-02, 0.3741073751789e+01, 0.5296909721118e+00,
6763           0.2718490072522e-02, 0.4016011511425e+01, 0.2132990797783e+00,
6764           0.1546493974344e-02, 0.2170528330642e+01, 0.3813291813120e-01,
6765           0.8366855276341e-03, 0.2339614075294e+01, 0.7478166569050e-01,
6766           0.2936777942117e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6767           0.1201317439469e-03, 0.4090736353305e+01, 0.1059381944224e+01,
6768           0.7578550887230e-04, 0.3241518088140e+01, 0.4265981595566e+00,
6769           0.1941787367773e-04, 0.1012202064330e+01, 0.2061856251104e+00,
6770           0.1889227765991e-04, 0.3892520416440e+01, 0.2204125344462e+00,
6771           0.1937896968613e-04, 0.4797779441161e+01, 0.1495633313810e+00,
6772 
6773           0.1434506110873e-04, 0.3868960697933e+01, 0.5225775174439e+00,
6774           0.1406659911580e-04, 0.4759766557397e+00, 0.5368044267797e+00,
6775           0.1179022300202e-04, 0.7774961520598e+00, 0.7626583626240e-01,
6776           0.8085864460959e-05, 0.3254654471465e+01, 0.3664874755930e-01,
6777           0.7622752967615e-05, 0.4227633103489e+01, 0.3961708870310e-01,
6778           0.6209171139066e-05, 0.2791828325711e+00, 0.7329749511860e-01,
6779           0.4366435633970e-05, 0.4440454875925e+01, 0.1589072916335e+01,
6780           0.3792124889348e-05, 0.5156393842356e+01, 0.7113454667900e-02,
6781           0.3154548963402e-05, 0.6157005730093e+01, 0.4194847048887e+00,
6782           0.3088359882942e-05, 0.2494567553163e+01, 0.6398972393349e+00,
6783 
6784           0.2788440902136e-05, 0.4934318747989e+01, 0.1102062672231e+00,
6785           0.3039928456376e-05, 0.4895077702640e+01, 0.6283075850446e+01,
6786           0.2272258457679e-05, 0.5278394064764e+01, 0.1030928125552e+00,
6787           0.2162007057957e-05, 0.5802978019099e+01, 0.3163918923335e+00,
6788           0.1767632855737e-05, 0.3415346595193e-01, 0.1021328554739e+02,
6789           0.1349413459362e-05, 0.2001643230755e+01, 0.1484170571900e-02,
6790           0.1170141900476e-05, 0.2424750491620e+01, 0.6327837846670e+00,
6791           0.1054355266820e-05, 0.3123311487576e+01, 0.4337116142245e+00,
6792           0.9800822461610e-06, 0.3026258088130e+01, 0.1052268489556e+01,
6793           0.1091203749931e-05, 0.3157811670347e+01, 0.1162474756779e+01,
6794 
6795           0.6960236715913e-06, 0.8219570542313e+00, 0.1066495398892e+01,
6796           0.5689257296909e-06, 0.1323052375236e+01, 0.9491756770005e+00,
6797           0.6613172135802e-06, 0.2765348881598e+00, 0.8460828644453e+00,
6798           0.6277702517571e-06, 0.5794064466382e+01, 0.1480791608091e+00,
6799           0.6304884066699e-06, 0.7323555380787e+00, 0.2243449970715e+00,
6800           0.4897850467382e-06, 0.3062464235399e+01, 0.3340612434717e+01,
6801           0.3759148598786e-06, 0.4588290469664e+01, 0.3516457698740e-01,
6802           0.3110520548195e-06, 0.1374299536572e+01, 0.6373574839730e-01,
6803           0.3064708359780e-06, 0.4222267485047e+01, 0.1104591729320e-01,
6804           0.2856347168241e-06, 0.3714202944973e+01, 0.1510475019529e+00,
6805 
6806           0.2840945514288e-06, 0.2847972875882e+01, 0.4110125927500e-01,
6807           0.2378951599405e-06, 0.3762072563388e+01, 0.2275259891141e+00,
6808           0.2714229481417e-06, 0.1036049980031e+01, 0.2535050500000e-01,
6809           0.2323551717307e-06, 0.4682388599076e+00, 0.8582758298370e-01,
6810           0.1881790512219e-06, 0.4790565425418e+01, 0.2118763888447e+01,
6811           0.2261353968371e-06, 0.1669144912212e+01, 0.7181332454670e-01,
6812           0.2214546389848e-06, 0.3937717281614e+01, 0.2968341143800e-02,
6813           0.2184915594933e-06, 0.1129169845099e+00, 0.7775000683430e-01,
6814           0.2000164937936e-06, 0.4030009638488e+01, 0.2093666171530e+00,
6815           0.1966105136719e-06, 0.8745955786834e+00, 0.2172315424036e+00,
6816 
6817           0.1904742332624e-06, 0.5919743598964e+01, 0.2022531624851e+00,
6818           0.1657399705031e-06, 0.2549141484884e+01, 0.7358765972222e+00,
6819           0.1574070533987e-06, 0.5277533020230e+01, 0.7429900518901e+00,
6820           0.1832261651039e-06, 0.3064688127777e+01, 0.3235053470014e+00,
6821           0.1733615346569e-06, 0.3011432799094e+01, 0.1385174140878e+00,
6822           0.1549124014496e-06, 0.4005569132359e+01, 0.5154640627760e+00,
6823           0.1637044713838e-06, 0.1831375966632e+01, 0.8531963191132e+00,
6824           0.1123420082383e-06, 0.1180270407578e+01, 0.1990721704425e+00,
6825           0.1083754165740e-06, 0.3414101320863e+00, 0.5439178814476e+00,
6826           0.1156638012655e-06, 0.6130479452594e+00, 0.5257585094865e+00,
6827 
6828           0.1142548785134e-06, 0.3724761948846e+01, 0.5336234347371e+00,
6829           0.7921463895965e-07, 0.2435425589361e+01, 0.1478866649112e+01,
6830           0.7428600285231e-07, 0.3542144398753e+01, 0.2164800718209e+00,
6831           0.8323211246747e-07, 0.3525058072354e+01, 0.1692165728891e+01,
6832           0.7257595116312e-07, 0.1364299431982e+01, 0.2101180877357e+00,
6833           0.7111185833236e-07, 0.2460478875808e+01, 0.4155522422634e+00,
6834           0.6868090383716e-07, 0.4397327670704e+01, 0.1173197218910e+00,
6835           0.7226419974175e-07, 0.4042647308905e+01, 0.1265567569334e+01,
6836           0.6955642383177e-07, 0.2865047906085e+01, 0.9562891316684e+00,
6837           0.7492139296331e-07, 0.5014278994215e+01, 0.1422690933580e-01,
6838 
6839           0.6598363128857e-07, 0.2376730020492e+01, 0.6470106940028e+00,
6840           0.7381147293385e-07, 0.3272990384244e+01, 0.1581959461667e+01,
6841           0.6402909624032e-07, 0.5302290955138e+01, 0.9597935788730e-01,
6842           0.6237454263857e-07, 0.5444144425332e+01, 0.7084920306520e-01,
6843           0.5241198544016e-07, 0.4215359579205e+01, 0.5265099800692e+00,
6844           0.5144463853918e-07, 0.1218916689916e+00, 0.5328719641544e+00,
6845           0.5868164772299e-07, 0.2369402002213e+01, 0.7871412831580e-01,
6846           0.6233195669151e-07, 0.1254922242403e+01, 0.2608790314060e+02,
6847           0.6068463791422e-07, 0.5679713760431e+01, 0.1114304132498e+00,
6848           0.4359361135065e-07, 0.6097219641646e+00, 0.1375773836557e+01,
6849 
6850           0.4686510366826e-07, 0.4786231041431e+01, 0.1143987543936e+00,
6851           0.3758977287225e-07, 0.1167368068139e+01, 0.1596186371003e+01,
6852           0.4282051974778e-07, 0.1519471064319e+01, 0.2770348281756e+00,
6853           0.5153765386113e-07, 0.1860532322984e+01, 0.2228608264996e+00,
6854           0.4575129387188e-07, 0.7632857887158e+00, 0.1465949902372e+00,
6855           0.3326844933286e-07, 0.1298219485285e+01, 0.5070101000000e-01,
6856           0.3748617450984e-07, 0.1046510321062e+01, 0.4903339079539e+00,
6857           0.2816756661499e-07, 0.3434522346190e+01, 0.2991266627620e+00,
6858           0.3412750405039e-07, 0.2523766270318e+01, 0.3518164938661e+00,
6859           0.2655796761776e-07, 0.2904422260194e+01, 0.6256703299991e+00,
6860 
6861           0.2963597929458e-07, 0.5923900431149e+00, 0.1099462426779e+00,
6862           0.2539523734781e-07, 0.4851947722567e+01, 0.1256615170089e+02,
6863           0.2283087914139e-07, 0.3400498595496e+01, 0.6681224869435e+01,
6864           0.2321309799331e-07, 0.5789099148673e+01, 0.3368040641550e-01,
6865           0.2549657649750e-07, 0.3991856479792e-01, 0.1169588211447e+01,
6866           0.2290462303977e-07, 0.2788567577052e+01, 0.1045155034888e+01,
6867           0.1945398522914e-07, 0.3290896998176e+01, 0.1155361302111e+01,
6868           0.1849171512638e-07, 0.2698060129367e+01, 0.4452511715700e-02,
6869           0.1647199834254e-07, 0.3016735644085e+01, 0.4408250688924e+00,
6870           0.1529530765273e-07, 0.5573043116178e+01, 0.6521991896920e-01,
6871 
6872           0.1433199339978e-07, 0.1481192356147e+01, 0.9420622223326e+00,
6873           0.1729134193602e-07, 0.1422817538933e+01, 0.2108507877249e+00,
6874           0.1716463931346e-07, 0.3469468901855e+01, 0.2157473718317e+00,
6875           0.1391206061378e-07, 0.6122436220547e+01, 0.4123712502208e+00,
6876           0.1404746661924e-07, 0.1647765641936e+01, 0.4258542984690e-01,
6877           0.1410452399455e-07, 0.5989729161964e+01, 0.2258291676434e+00,
6878           0.1089828772168e-07, 0.2833705509371e+01, 0.4226656969313e+00,
6879           0.1047374564948e-07, 0.5090690007331e+00, 0.3092784376656e+00,
6880           0.1358279126532e-07, 0.5128990262836e+01, 0.7923417740620e-01,
6881           0.1020456476148e-07, 0.9632772880808e+00, 0.1456308687557e+00,
6882 
6883           0.1033428735328e-07, 0.3223779318418e+01, 0.1795258541446e+01,
6884           0.1412435841540e-07, 0.2410271572721e+01, 0.1525316725248e+00,
6885           0.9722759371574e-08, 0.2333531395690e+01, 0.8434341241180e-01,
6886           0.9657334084704e-08, 0.6199270974168e+01, 0.1272681024002e+01,
6887           0.1083641148690e-07, 0.2864222292929e+01, 0.7032915397480e-01,
6888           0.1067318403838e-07, 0.5833458866568e+00, 0.2123349582968e+00,
6889           0.1062366201976e-07, 0.4307753989494e+01, 0.2142632012598e+00,
6890           0.1236364149266e-07, 0.2873917870593e+01, 0.1847279083684e+00,
6891           0.1092759489593e-07, 0.2959887266733e+01, 0.1370332435159e+00,
6892           0.8912069362899e-08, 0.5141213702562e+01, 0.2648454860559e+01,
6893 
6894           0.9656467707970e-08, 0.4532182462323e+01, 0.4376440768498e+00,
6895           0.8098386150135e-08, 0.2268906338379e+01, 0.2880807454688e+00,
6896           0.7857714675000e-08, 0.4055544260745e+01, 0.2037373330570e+00,
6897           0.7288455940646e-08, 0.5357901655142e+01, 0.1129145838217e+00,
6898           0.9450595950552e-08, 0.4264926963939e+01, 0.5272426800584e+00,
6899           0.9381718247537e-08, 0.7489366976576e-01, 0.5321392641652e+00,
6900           0.7079052646038e-08, 0.1923311052874e+01, 0.6288513220417e+00,
6901           0.9259004415344e-08, 0.2970256853438e+01, 0.1606092486742e+00,
6902           0.8259801499742e-08, 0.3327056314697e+01, 0.8389694097774e+00,
6903           0.6476334355779e-08, 0.2954925505727e+01, 0.2008557621224e+01,
6904 
6905           0.5984021492007e-08, 0.9138753105829e+00, 0.2042657109477e+02,
6906           0.5989546863181e-08, 0.3244464082031e+01, 0.2111650433779e+01,
6907           0.6233108606023e-08, 0.4995232638403e+00, 0.4305306221819e+00,
6908           0.6877299149965e-08, 0.2834987233449e+01, 0.9561746721300e-02,
6909           0.8311234227190e-08, 0.2202951835758e+01, 0.3801276407308e+00,
6910           0.6599472832414e-08, 0.4478581462618e+01, 0.1063314406849e+01,
6911           0.6160491096549e-08, 0.5145858696411e+01, 0.1368660381889e+01,
6912           0.6164772043891e-08, 0.3762976697911e+00, 0.4234171675140e+00,
6913           0.6363248684450e-08, 0.3162246718685e+01, 0.1253008786510e-01,
6914           0.6448587520999e-08, 0.3442693302119e+01, 0.5287268506303e+00,
6915 
6916           0.6431662283977e-08, 0.8977549136606e+00, 0.5306550935933e+00,
6917           0.6351223158474e-08, 0.4306447410369e+01, 0.5217580628120e+02,
6918           0.5476721393451e-08, 0.3888529177855e+01, 0.2221856701002e+01,
6919           0.5341772572619e-08, 0.2655560662512e+01, 0.7466759693650e-01,
6920           0.5337055758302e-08, 0.5164990735946e+01, 0.7489573444450e-01,
6921           0.5373120816787e-08, 0.6041214553456e+01, 0.1274714967946e+00,
6922           0.5392351705426e-08, 0.9177763485932e+00, 0.1055449481598e+01,
6923           0.6688495850205e-08, 0.3089608126937e+01, 0.2213766559277e+00,
6924           0.5072003660362e-08, 0.4311316541553e+01, 0.2132517061319e+00,
6925           0.5070726650455e-08, 0.5790675464444e+00, 0.2133464534247e+00,
6926 
6927           0.5658012950032e-08, 0.2703945510675e+01, 0.7287631425543e+00,
6928           0.4835509924854e-08, 0.2975422976065e+01, 0.7160067364790e-01,
6929           0.6479821978012e-08, 0.1324168733114e+01, 0.2209183458640e-01,
6930           0.6230636494980e-08, 0.2860103632836e+01, 0.3306188016693e+00,
6931           0.4649239516213e-08, 0.4832259763403e+01, 0.7796265773310e-01,
6932           0.6487325792700e-08, 0.2726165825042e+01, 0.3884652414254e+00,
6933           0.4682823682770e-08, 0.6966602455408e+00, 0.1073608853559e+01,
6934           0.5704230804976e-08, 0.5669634104606e+01, 0.8731175355560e-01,
6935           0.6125413585489e-08, 0.1513386538915e+01, 0.7605151500000e-01,
6936           0.6035825038187e-08, 0.1983509168227e+01, 0.9846002785331e+00,
6937 
6938           0.4331123462303e-08, 0.2782892992807e+01, 0.4297791515992e+00,
6939           0.4681107685143e-08, 0.5337232886836e+01, 0.2127790306879e+00,
6940           0.4669105829655e-08, 0.5837133792160e+01, 0.2138191288687e+00,
6941           0.5138823602365e-08, 0.3080560200507e+01, 0.7233337363710e-01,
6942           0.4615856664534e-08, 0.1661747897471e+01, 0.8603097737811e+00,
6943           0.4496916702197e-08, 0.2112508027068e+01, 0.7381754420900e-01,
6944           0.4278479042945e-08, 0.5716528462627e+01, 0.7574578717200e-01,
6945           0.3840525503932e-08, 0.6424172726492e+00, 0.3407705765729e+00,
6946           0.4866636509685e-08, 0.4919244697715e+01, 0.7722995774390e-01,
6947           0.3526100639296e-08, 0.2550821052734e+01, 0.6225157782540e-01,
6948 
6949           0.3939558488075e-08, 0.3939331491710e+01, 0.5268983110410e-01,
6950           0.4041268772576e-08, 0.2275337571218e+01, 0.3503323232942e+00,
6951           0.3948761842853e-08, 0.1999324200790e+01, 0.1451108196653e+00,
6952           0.3258394550029e-08, 0.9121001378200e+00, 0.5296435984654e+00,
6953           0.3257897048761e-08, 0.3428428660869e+01, 0.5297383457582e+00,
6954           0.3842559031298e-08, 0.6132927720035e+01, 0.9098186128426e+00,
6955           0.3109920095448e-08, 0.7693650193003e+00, 0.3932462625300e-02,
6956           0.3132237775119e-08, 0.3621293854908e+01, 0.2346394437820e+00,
6957           0.3942189421510e-08, 0.4841863659733e+01, 0.3180992042600e-02,
6958           0.3796972285340e-08, 0.1814174994268e+01, 0.1862120789403e+00,
6959 
6960           0.3995640233688e-08, 0.1386990406091e+01, 0.4549093064213e+00,
6961           0.2875013727414e-08, 0.9178318587177e+00, 0.1905464808669e+01,
6962           0.3073719932844e-08, 0.2688923811835e+01, 0.3628624111593e+00,
6963           0.2731016580075e-08, 0.1188259127584e+01, 0.2131850110243e+00,
6964           0.2729549896546e-08, 0.3702160634273e+01, 0.2134131485323e+00,
6965           0.3339372892449e-08, 0.7199163960331e+00, 0.2007689919132e+00,
6966           0.2898833764204e-08, 0.1916709364999e+01, 0.5291709230214e+00,
6967           0.2894536549362e-08, 0.2424043195547e+01, 0.5302110212022e+00,
6968           0.3096872473843e-08, 0.4445894977497e+01, 0.2976424921901e+00,
6969           0.2635672326810e-08, 0.3814366984117e+01, 0.1485980103780e+01,
6970 
6971           0.3649302697001e-08, 0.2924200596084e+01, 0.6044726378023e+00,
6972           0.3127954585895e-08, 0.1842251648327e+01, 0.1084620721060e+00,
6973           0.2616040173947e-08, 0.4155841921984e+01, 0.1258454114666e+01,
6974           0.2597395859860e-08, 0.1158045978874e+00, 0.2103781122809e+00,
6975           0.2593286172210e-08, 0.4771850408691e+01, 0.2162200472757e+00,
6976           0.2481823585747e-08, 0.4608842558889e+00, 0.1062562936266e+01,
6977           0.2742219550725e-08, 0.1538781127028e+01, 0.5651155736444e+00,
6978           0.3199558469610e-08, 0.3226647822878e+00, 0.7036329877322e+00,
6979           0.2666088542957e-08, 0.1967991731219e+00, 0.1400015846597e+00,
6980           0.2397067430580e-08, 0.3707036669873e+01, 0.2125476091956e+00,
6981 
6982           0.2376570772738e-08, 0.1182086628042e+01, 0.2140505503610e+00,
6983           0.2547228007887e-08, 0.4906256820629e+01, 0.1534957940063e+00,
6984           0.2265575594114e-08, 0.3414949866857e+01, 0.2235935264888e+00,
6985           0.2464381430585e-08, 0.4599122275378e+01, 0.2091065926078e+00,
6986           0.2433408527044e-08, 0.2830751145445e+00, 0.2174915669488e+00,
6987           0.2443605509076e-08, 0.4212046432538e+01, 0.1739420156204e+00,
6988           0.2319779262465e-08, 0.9881978408630e+00, 0.7530171478090e-01,
6989           0.2284622835465e-08, 0.5565347331588e+00, 0.7426161660010e-01,
6990           0.2467268750783e-08, 0.5655708150766e+00, 0.2526561439362e+00,
6991           0.2808513492782e-08, 0.1418405053408e+01, 0.5636314030725e+00,
6992 
6993           0.2329528932532e-08, 0.4069557545675e+01, 0.1056200952181e+01,
6994           0.9698639532817e-09, 0.1074134313634e+01, 0.7826370942180e+02 };
6995 
6996     /* SSB-to-Sun, T^0, Y */
6997       static final double s0y[] = {
6998           0.4955392320126e-02, 0.2170467313679e+01, 0.5296909721118e+00,
6999           0.2722325167392e-02, 0.2444433682196e+01, 0.2132990797783e+00,
7000           0.1546579925346e-02, 0.5992779281546e+00, 0.3813291813120e-01,
7001           0.8363140252966e-03, 0.7687356310801e+00, 0.7478166569050e-01,
7002           0.3385792683603e-03, 0.0000000000000e+00, 0.0000000000000e+00,
7003           0.1201192221613e-03, 0.2520035601514e+01, 0.1059381944224e+01,
7004           0.7587125720554e-04, 0.1669954006449e+01, 0.4265981595566e+00,
7005           0.1964155361250e-04, 0.5707743963343e+01, 0.2061856251104e+00,
7006           0.1891900364909e-04, 0.2320960679937e+01, 0.2204125344462e+00,
7007           0.1937373433356e-04, 0.3226940689555e+01, 0.1495633313810e+00,
7008 
7009           0.1437139941351e-04, 0.2301626908096e+01, 0.5225775174439e+00,
7010           0.1406267683099e-04, 0.5188579265542e+01, 0.5368044267797e+00,
7011           0.1178703080346e-04, 0.5489483248476e+01, 0.7626583626240e-01,
7012           0.8079835186041e-05, 0.1683751835264e+01, 0.3664874755930e-01,
7013           0.7623253594652e-05, 0.2656400462961e+01, 0.3961708870310e-01,
7014           0.6248667483971e-05, 0.4992775362055e+01, 0.7329749511860e-01,
7015           0.4366353695038e-05, 0.2869706279678e+01, 0.1589072916335e+01,
7016           0.3829101568895e-05, 0.3572131359950e+01, 0.7113454667900e-02,
7017           0.3175733773908e-05, 0.4535372530045e+01, 0.4194847048887e+00,
7018           0.3092437902159e-05, 0.9230153317909e+00, 0.6398972393349e+00,
7019 
7020           0.2874168812154e-05, 0.3363143761101e+01, 0.1102062672231e+00,
7021           0.3040119321826e-05, 0.3324250895675e+01, 0.6283075850446e+01,
7022           0.2699723308006e-05, 0.2917882441928e+00, 0.1030928125552e+00,
7023           0.2134832683534e-05, 0.4220997202487e+01, 0.3163918923335e+00,
7024           0.1770412139433e-05, 0.4747318496462e+01, 0.1021328554739e+02,
7025           0.1377264209373e-05, 0.4305058462401e+00, 0.1484170571900e-02,
7026           0.1127814538960e-05, 0.8538177240740e+00, 0.6327837846670e+00,
7027           0.1055608090130e-05, 0.1551800742580e+01, 0.4337116142245e+00,
7028           0.9802673861420e-06, 0.1459646735377e+01, 0.1052268489556e+01,
7029           0.1090329461951e-05, 0.1587351228711e+01, 0.1162474756779e+01,
7030 
7031           0.6959590025090e-06, 0.5534442628766e+01, 0.1066495398892e+01,
7032           0.5664914529542e-06, 0.6030673003297e+01, 0.9491756770005e+00,
7033           0.6607787763599e-06, 0.4989507233927e+01, 0.8460828644453e+00,
7034           0.6269725742838e-06, 0.4222951804572e+01, 0.1480791608091e+00,
7035           0.6301889697863e-06, 0.5444316669126e+01, 0.2243449970715e+00,
7036           0.4891042662861e-06, 0.1490552839784e+01, 0.3340612434717e+01,
7037           0.3457083123290e-06, 0.3030475486049e+01, 0.3516457698740e-01,
7038           0.3032559967314e-06, 0.2652038793632e+01, 0.1104591729320e-01,
7039           0.2841133988903e-06, 0.1276744786829e+01, 0.4110125927500e-01,
7040           0.2855564444432e-06, 0.2143368674733e+01, 0.1510475019529e+00,
7041 
7042           0.2765157135038e-06, 0.5444186109077e+01, 0.6373574839730e-01,
7043           0.2382312465034e-06, 0.2190521137593e+01, 0.2275259891141e+00,
7044           0.2808060365077e-06, 0.5735195064841e+01, 0.2535050500000e-01,
7045           0.2332175234405e-06, 0.9481985524859e-01, 0.7181332454670e-01,
7046           0.2322488199659e-06, 0.5180499361533e+01, 0.8582758298370e-01,
7047           0.1881850258423e-06, 0.3219788273885e+01, 0.2118763888447e+01,
7048           0.2196111392808e-06, 0.2366941159761e+01, 0.2968341143800e-02,
7049           0.2183810335519e-06, 0.4825445110915e+01, 0.7775000683430e-01,
7050           0.2002733093326e-06, 0.2457148995307e+01, 0.2093666171530e+00,
7051           0.1967111767229e-06, 0.5586291545459e+01, 0.2172315424036e+00,
7052 
7053           0.1568473250543e-06, 0.3708003123320e+01, 0.7429900518901e+00,
7054           0.1852528314300e-06, 0.4310638151560e+01, 0.2022531624851e+00,
7055           0.1832111226447e-06, 0.1494665322656e+01, 0.3235053470014e+00,
7056           0.1746805502310e-06, 0.1451378500784e+01, 0.1385174140878e+00,
7057           0.1555730966650e-06, 0.1068040418198e+01, 0.7358765972222e+00,
7058           0.1554883462559e-06, 0.2442579035461e+01, 0.5154640627760e+00,
7059           0.1638380568746e-06, 0.2597913420625e+00, 0.8531963191132e+00,
7060           0.1159938593640e-06, 0.5834512021280e+01, 0.1990721704425e+00,
7061           0.1083427965695e-06, 0.5054033177950e+01, 0.5439178814476e+00,
7062           0.1156480369431e-06, 0.5325677432457e+01, 0.5257585094865e+00,
7063 
7064           0.1141308860095e-06, 0.2153403923857e+01, 0.5336234347371e+00,
7065           0.7913146470946e-07, 0.8642846847027e+00, 0.1478866649112e+01,
7066           0.7439752463733e-07, 0.1970628496213e+01, 0.2164800718209e+00,
7067           0.7280277104079e-07, 0.6073307250609e+01, 0.2101180877357e+00,
7068           0.8319567719136e-07, 0.1954371928334e+01, 0.1692165728891e+01,
7069           0.7137705549290e-07, 0.8904989440909e+00, 0.4155522422634e+00,
7070           0.6900825396225e-07, 0.2825717714977e+01, 0.1173197218910e+00,
7071           0.7245757216635e-07, 0.2481677513331e+01, 0.1265567569334e+01,
7072           0.6961165696255e-07, 0.1292955312978e+01, 0.9562891316684e+00,
7073           0.7571804456890e-07, 0.3427517575069e+01, 0.1422690933580e-01,
7074 
7075           0.6605425721904e-07, 0.8052192701492e+00, 0.6470106940028e+00,
7076           0.7375477357248e-07, 0.1705076390088e+01, 0.1581959461667e+01,
7077           0.7041664951470e-07, 0.4848356967891e+00, 0.9597935788730e-01,
7078           0.6322199535763e-07, 0.3878069473909e+01, 0.7084920306520e-01,
7079           0.5244380279191e-07, 0.2645560544125e+01, 0.5265099800692e+00,
7080           0.5143125704988e-07, 0.4834486101370e+01, 0.5328719641544e+00,
7081           0.5871866319373e-07, 0.7981472548900e+00, 0.7871412831580e-01,
7082           0.6300822573871e-07, 0.5979398788281e+01, 0.2608790314060e+02,
7083           0.6062154271548e-07, 0.4108655402756e+01, 0.1114304132498e+00,
7084           0.4361912339976e-07, 0.5322624319280e+01, 0.1375773836557e+01,
7085 
7086           0.4417005920067e-07, 0.6240817359284e+01, 0.2770348281756e+00,
7087           0.4686806749936e-07, 0.3214977301156e+01, 0.1143987543936e+00,
7088           0.3758892132305e-07, 0.5879809634765e+01, 0.1596186371003e+01,
7089           0.5151351332319e-07, 0.2893377688007e+00, 0.2228608264996e+00,
7090           0.4554683578572e-07, 0.5475427144122e+01, 0.1465949902372e+00,
7091           0.3442381385338e-07, 0.5992034796640e+01, 0.5070101000000e-01,
7092           0.2831093954933e-07, 0.5367350273914e+01, 0.3092784376656e+00,
7093           0.3756267090084e-07, 0.5758171285420e+01, 0.4903339079539e+00,
7094           0.2816374679892e-07, 0.1863718700923e+01, 0.2991266627620e+00,
7095           0.3419307025569e-07, 0.9524347534130e+00, 0.3518164938661e+00,
7096 
7097           0.2904250494239e-07, 0.5304471615602e+01, 0.1099462426779e+00,
7098           0.2471734511206e-07, 0.1297069793530e+01, 0.6256703299991e+00,
7099           0.2539620831872e-07, 0.3281126083375e+01, 0.1256615170089e+02,
7100           0.2281017868007e-07, 0.1829122133165e+01, 0.6681224869435e+01,
7101           0.2275319473335e-07, 0.5797198160181e+01, 0.3932462625300e-02,
7102           0.2547755368442e-07, 0.4752697708330e+01, 0.1169588211447e+01,
7103           0.2285979669317e-07, 0.1223205292886e+01, 0.1045155034888e+01,
7104           0.1913386560994e-07, 0.1757532993389e+01, 0.1155361302111e+01,
7105           0.1809020525147e-07, 0.4246116108791e+01, 0.3368040641550e-01,
7106           0.1649213300201e-07, 0.1445162890627e+01, 0.4408250688924e+00,
7107 
7108           0.1834972793932e-07, 0.1126917567225e+01, 0.4452511715700e-02,
7109           0.1439550648138e-07, 0.6160756834764e+01, 0.9420622223326e+00,
7110           0.1487645457041e-07, 0.4358761931792e+01, 0.4123712502208e+00,
7111           0.1731729516660e-07, 0.6134456753344e+01, 0.2108507877249e+00,
7112           0.1717747163567e-07, 0.1898186084455e+01, 0.2157473718317e+00,
7113           0.1418190430374e-07, 0.4180286741266e+01, 0.6521991896920e-01,
7114           0.1404844134873e-07, 0.7654053565412e-01, 0.4258542984690e-01,
7115           0.1409842846538e-07, 0.4418612420312e+01, 0.2258291676434e+00,
7116           0.1090948346291e-07, 0.1260615686131e+01, 0.4226656969313e+00,
7117           0.1357577323612e-07, 0.3558248818690e+01, 0.7923417740620e-01,
7118 
7119           0.1018154061960e-07, 0.5676087241256e+01, 0.1456308687557e+00,
7120           0.1412073972109e-07, 0.8394392632422e+00, 0.1525316725248e+00,
7121           0.1030938326496e-07, 0.1653593274064e+01, 0.1795258541446e+01,
7122           0.1180081567104e-07, 0.1285802592036e+01, 0.7032915397480e-01,
7123           0.9708510575650e-08, 0.7631889488106e+00, 0.8434341241180e-01,
7124           0.9637689663447e-08, 0.4630642649176e+01, 0.1272681024002e+01,
7125           0.1068910429389e-07, 0.5294934032165e+01, 0.2123349582968e+00,
7126           0.1063716179336e-07, 0.2736266800832e+01, 0.2142632012598e+00,
7127           0.1234858713814e-07, 0.1302891146570e+01, 0.1847279083684e+00,
7128           0.8912631189738e-08, 0.3570415993621e+01, 0.2648454860559e+01,
7129 
7130           0.1036378285534e-07, 0.4236693440949e+01, 0.1370332435159e+00,
7131           0.9667798501561e-08, 0.2960768892398e+01, 0.4376440768498e+00,
7132           0.8108314201902e-08, 0.6987781646841e+00, 0.2880807454688e+00,
7133           0.7648364324628e-08, 0.2499017863863e+01, 0.2037373330570e+00,
7134           0.7286136828406e-08, 0.3787426951665e+01, 0.1129145838217e+00,
7135           0.9448237743913e-08, 0.2694354332983e+01, 0.5272426800584e+00,
7136           0.9374276106428e-08, 0.4787121277064e+01, 0.5321392641652e+00,
7137           0.7100226287462e-08, 0.3530238792101e+00, 0.6288513220417e+00,
7138           0.9253056659571e-08, 0.1399478925664e+01, 0.1606092486742e+00,
7139           0.6636432145504e-08, 0.3479575438447e+01, 0.1368660381889e+01,
7140 
7141           0.6469975312932e-08, 0.1383669964800e+01, 0.2008557621224e+01,
7142           0.7335849729765e-08, 0.1243698166898e+01, 0.9561746721300e-02,
7143           0.8743421205855e-08, 0.3776164289301e+01, 0.3801276407308e+00,
7144           0.5993635744494e-08, 0.5627122113596e+01, 0.2042657109477e+02,
7145           0.5981008479693e-08, 0.1674336636752e+01, 0.2111650433779e+01,
7146           0.6188535145838e-08, 0.5214925208672e+01, 0.4305306221819e+00,
7147           0.6596074017566e-08, 0.2907653268124e+01, 0.1063314406849e+01,
7148           0.6630815126226e-08, 0.2127643669658e+01, 0.8389694097774e+00,
7149           0.6156772830040e-08, 0.5082160803295e+01, 0.4234171675140e+00,
7150           0.6446960563014e-08, 0.1872100916905e+01, 0.5287268506303e+00,
7151 
7152           0.6429324424668e-08, 0.5610276103577e+01, 0.5306550935933e+00,
7153           0.6302232396465e-08, 0.1592152049607e+01, 0.1253008786510e-01,
7154           0.6399244436159e-08, 0.2746214421532e+01, 0.5217580628120e+02,
7155           0.5474965172558e-08, 0.2317666374383e+01, 0.2221856701002e+01,
7156           0.5339293190692e-08, 0.1084724961156e+01, 0.7466759693650e-01,
7157           0.5334733683389e-08, 0.3594106067745e+01, 0.7489573444450e-01,
7158           0.5392665782110e-08, 0.5630254365606e+01, 0.1055449481598e+01,
7159           0.6682075673789e-08, 0.1518480041732e+01, 0.2213766559277e+00,
7160           0.5079130495960e-08, 0.2739765115711e+01, 0.2132517061319e+00,
7161           0.5077759793261e-08, 0.5290711290094e+01, 0.2133464534247e+00,
7162 
7163           0.4832037368310e-08, 0.1404473217200e+01, 0.7160067364790e-01,
7164           0.6463279674802e-08, 0.6038381695210e+01, 0.2209183458640e-01,
7165           0.6240592771560e-08, 0.1290170653666e+01, 0.3306188016693e+00,
7166           0.4672013521493e-08, 0.3261895939677e+01, 0.7796265773310e-01,
7167           0.6500650750348e-08, 0.1154522312095e+01, 0.3884652414254e+00,
7168           0.6344161389053e-08, 0.6206111545062e+01, 0.7605151500000e-01,
7169           0.4682518370646e-08, 0.5409118796685e+01, 0.1073608853559e+01,
7170           0.5329460015591e-08, 0.1202985784864e+01, 0.7287631425543e+00,
7171           0.5701588675898e-08, 0.4098715257064e+01, 0.8731175355560e-01,
7172           0.6030690867211e-08, 0.4132033218460e+00, 0.9846002785331e+00,
7173 
7174           0.4336256312655e-08, 0.1211415991827e+01, 0.4297791515992e+00,
7175           0.4688498808975e-08, 0.3765479072409e+01, 0.2127790306879e+00,
7176           0.4675578609335e-08, 0.4265540037226e+01, 0.2138191288687e+00,
7177           0.4225578112158e-08, 0.5237566010676e+01, 0.3407705765729e+00,
7178           0.5139422230028e-08, 0.1507173079513e+01, 0.7233337363710e-01,
7179           0.4619995093571e-08, 0.9023957449848e-01, 0.8603097737811e+00,
7180           0.4494776255461e-08, 0.5414930552139e+00, 0.7381754420900e-01,
7181           0.4274026276788e-08, 0.4145735303659e+01, 0.7574578717200e-01,
7182           0.5018141789353e-08, 0.3344408829055e+01, 0.3180992042600e-02,
7183           0.4866163952181e-08, 0.3348534657607e+01, 0.7722995774390e-01,
7184 
7185           0.4111986020501e-08, 0.4198823597220e+00, 0.1451108196653e+00,
7186           0.3356142784950e-08, 0.5609144747180e+01, 0.1274714967946e+00,
7187           0.4070575554551e-08, 0.7028411059224e+00, 0.3503323232942e+00,
7188           0.3257451857278e-08, 0.5624697983086e+01, 0.5296435984654e+00,
7189           0.3256973703026e-08, 0.1857842076707e+01, 0.5297383457582e+00,
7190           0.3830771508640e-08, 0.4562887279931e+01, 0.9098186128426e+00,
7191           0.3725024005962e-08, 0.2358058692652e+00, 0.1084620721060e+00,
7192           0.3136763921756e-08, 0.2049731526845e+01, 0.2346394437820e+00,
7193           0.3795147256194e-08, 0.2432356296933e+00, 0.1862120789403e+00,
7194           0.2877342229911e-08, 0.5631101279387e+01, 0.1905464808669e+01,
7195 
7196           0.3076931798805e-08, 0.1117615737392e+01, 0.3628624111593e+00,
7197           0.2734765945273e-08, 0.5899826516955e+01, 0.2131850110243e+00,
7198           0.2733405296885e-08, 0.2130562964070e+01, 0.2134131485323e+00,
7199           0.2898552353410e-08, 0.3462387048225e+00, 0.5291709230214e+00,
7200           0.2893736103681e-08, 0.8534352781543e+00, 0.5302110212022e+00,
7201           0.3095717734137e-08, 0.2875061429041e+01, 0.2976424921901e+00,
7202           0.2636190425832e-08, 0.2242512846659e+01, 0.1485980103780e+01,
7203           0.3645512095537e-08, 0.1354016903958e+01, 0.6044726378023e+00,
7204           0.2808173547723e-08, 0.6705114365631e-01, 0.6225157782540e-01,
7205           0.2625012866888e-08, 0.4775705748482e+01, 0.5268983110410e-01,
7206 
7207           0.2572233995651e-08, 0.2638924216139e+01, 0.1258454114666e+01,
7208           0.2604238824792e-08, 0.4826358927373e+01, 0.2103781122809e+00,
7209           0.2596886385239e-08, 0.3200388483118e+01, 0.2162200472757e+00,
7210           0.3228057304264e-08, 0.5384848409563e+01, 0.2007689919132e+00,
7211           0.2481601798252e-08, 0.5173373487744e+01, 0.1062562936266e+01,
7212           0.2745977498864e-08, 0.6250966149853e+01, 0.5651155736444e+00,
7213           0.2669878833811e-08, 0.4906001352499e+01, 0.1400015846597e+00,
7214           0.3203986611711e-08, 0.5034333010005e+01, 0.7036329877322e+00,
7215           0.3354961227212e-08, 0.6108262423137e+01, 0.4549093064213e+00,
7216           0.2400407324558e-08, 0.2135399294955e+01, 0.2125476091956e+00,
7217 
7218           0.2379905859802e-08, 0.5893721933961e+01, 0.2140505503610e+00,
7219           0.2550844302187e-08, 0.3331940762063e+01, 0.1534957940063e+00,
7220           0.2268824211001e-08, 0.1843418461035e+01, 0.2235935264888e+00,
7221           0.2464700891204e-08, 0.3029548547230e+01, 0.2091065926078e+00,
7222           0.2436814726024e-08, 0.4994717970364e+01, 0.2174915669488e+00,
7223           0.2443623894745e-08, 0.2645102591375e+01, 0.1739420156204e+00,
7224           0.2318701783838e-08, 0.5700547397897e+01, 0.7530171478090e-01,
7225           0.2284448700256e-08, 0.5268898905872e+01, 0.7426161660010e-01,
7226           0.2468848123510e-08, 0.5276280575078e+01, 0.2526561439362e+00,
7227           0.2814052350303e-08, 0.6130168623475e+01, 0.5636314030725e+00,
7228 
7229           0.2243662755220e-08, 0.6631692457995e+00, 0.8886590321940e-01,
7230           0.2330795855941e-08, 0.2499435487702e+01, 0.1056200952181e+01,
7231           0.9757679038404e-09, 0.5796846023126e+01, 0.7826370942180e+02 };
7232 
7233     /* SSB-to-Sun, T^0, Z */
7234       static  final double s0z[] = {
7235           0.1181255122986e-03, 0.4607918989164e+00, 0.2132990797783e+00,
7236           0.1127777651095e-03, 0.4169146331296e+00, 0.5296909721118e+00,
7237           0.4777754401806e-04, 0.4582657007130e+01, 0.3813291813120e-01,
7238           0.1129354285772e-04, 0.5758735142480e+01, 0.7478166569050e-01,
7239          -0.1149543637123e-04, 0.0000000000000e+00, 0.0000000000000e+00,
7240           0.3298730512306e-05, 0.5978801994625e+01, 0.4265981595566e+00,
7241           0.2733376706079e-05, 0.7665413691040e+00, 0.1059381944224e+01,
7242           0.9426389657270e-06, 0.3710201265838e+01, 0.2061856251104e+00,
7243           0.8187517749552e-06, 0.3390675605802e+00, 0.2204125344462e+00,
7244           0.4080447871819e-06, 0.4552296640088e+00, 0.5225775174439e+00,
7245 
7246           0.3169973017028e-06, 0.3445455899321e+01, 0.5368044267797e+00,
7247           0.2438098615549e-06, 0.5664675150648e+01, 0.3664874755930e-01,
7248           0.2601897517235e-06, 0.1931894095697e+01, 0.1495633313810e+00,
7249           0.2314558080079e-06, 0.3666319115574e+00, 0.3961708870310e-01,
7250           0.1962549548002e-06, 0.3167411699020e+01, 0.7626583626240e-01,
7251           0.2180518287925e-06, 0.1544420746580e+01, 0.7113454667900e-02,
7252           0.1451382442868e-06, 0.1583756740070e+01, 0.1102062672231e+00,
7253           0.1358439007389e-06, 0.5239941758280e+01, 0.6398972393349e+00,
7254           0.1050585898028e-06, 0.2266958352859e+01, 0.3163918923335e+00,
7255           0.1050029870186e-06, 0.2711495250354e+01, 0.4194847048887e+00,
7256 
7257           0.9934920679800e-07, 0.1116208151396e+01, 0.1589072916335e+01,
7258           0.1048395331560e-06, 0.3408619600206e+01, 0.1021328554739e+02,
7259           0.8370147196668e-07, 0.3810459401087e+01, 0.2535050500000e-01,
7260           0.7989856510998e-07, 0.3769910473647e+01, 0.7329749511860e-01,
7261           0.5441221655233e-07, 0.2416994903374e+01, 0.1030928125552e+00,
7262           0.4610812906784e-07, 0.5858503336994e+01, 0.4337116142245e+00,
7263           0.3923022803444e-07, 0.3354170010125e+00, 0.1484170571900e-02,
7264           0.2610725582128e-07, 0.5410600646324e+01, 0.6327837846670e+00,
7265           0.2455279767721e-07, 0.6120216681403e+01, 0.1162474756779e+01,
7266           0.2375530706525e-07, 0.6055443426143e+01, 0.1052268489556e+01,
7267 
7268           0.1782967577553e-07, 0.3146108708004e+01, 0.8460828644453e+00,
7269           0.1581687095238e-07, 0.6255496089819e+00, 0.3340612434717e+01,
7270           0.1594657672461e-07, 0.3782604300261e+01, 0.1066495398892e+01,
7271           0.1563448615040e-07, 0.1997775733196e+01, 0.2022531624851e+00,
7272           0.1463624258525e-07, 0.1736316792088e+00, 0.3516457698740e-01,
7273           0.1331585056673e-07, 0.4331941830747e+01, 0.9491756770005e+00,
7274           0.1130634557637e-07, 0.6152017751825e+01, 0.2968341143800e-02,
7275           0.1028949607145e-07, 0.2101792614637e+00, 0.2275259891141e+00,
7276           0.1024074971618e-07, 0.4071833211074e+01, 0.5070101000000e-01,
7277           0.8826956060303e-08, 0.4861633688145e+00, 0.2093666171530e+00,
7278 
7279           0.8572230171541e-08, 0.5268190724302e+01, 0.4110125927500e-01,
7280           0.7649332643544e-08, 0.5134543417106e+01, 0.2608790314060e+02,
7281           0.8581673291033e-08, 0.2920218146681e+01, 0.1480791608091e+00,
7282           0.8430589300938e-08, 0.3604576619108e+01, 0.2172315424036e+00,
7283           0.7776165501012e-08, 0.3772942249792e+01, 0.6373574839730e-01,
7284           0.8311070234408e-08, 0.6200412329888e+01, 0.3235053470014e+00,
7285           0.6927365212582e-08, 0.4543353113437e+01, 0.8531963191132e+00,
7286           0.6791574208598e-08, 0.2882188406238e+01, 0.7181332454670e-01,
7287           0.5593100811839e-08, 0.1776646892780e+01, 0.7429900518901e+00,
7288           0.4553381853021e-08, 0.3949617611240e+01, 0.7775000683430e-01,
7289 
7290           0.5758000450068e-08, 0.3859251775075e+01, 0.1990721704425e+00,
7291           0.4281283457133e-08, 0.1466294631206e+01, 0.2118763888447e+01,
7292           0.4206935661097e-08, 0.5421776011706e+01, 0.1104591729320e-01,
7293           0.4213751641837e-08, 0.3412048993322e+01, 0.2243449970715e+00,
7294           0.5310506239878e-08, 0.5421641370995e+00, 0.5154640627760e+00,
7295           0.3827450341320e-08, 0.8887314524995e+00, 0.1510475019529e+00,
7296           0.4292435241187e-08, 0.1405043757194e+01, 0.1422690933580e-01,
7297           0.3189780702289e-08, 0.1060049293445e+01, 0.1173197218910e+00,
7298           0.3226611928069e-08, 0.6270858897442e+01, 0.2164800718209e+00,
7299           0.2893897608830e-08, 0.5117563223301e+01, 0.6470106940028e+00,
7300 
7301           0.3239852024578e-08, 0.4079092237983e+01, 0.2101180877357e+00,
7302           0.2956892222200e-08, 0.1594917021704e+01, 0.3092784376656e+00,
7303           0.2980177912437e-08, 0.5258787667564e+01, 0.4155522422634e+00,
7304           0.3163725690776e-08, 0.3854589225479e+01, 0.8582758298370e-01,
7305           0.2662262399118e-08, 0.3561326430187e+01, 0.5257585094865e+00,
7306           0.2766689135729e-08, 0.3180732086830e+00, 0.1385174140878e+00,
7307           0.2411600278464e-08, 0.3324798335058e+01, 0.5439178814476e+00,
7308           0.2483527695131e-08, 0.4169069291947e+00, 0.5336234347371e+00,
7309           0.7788777276590e-09, 0.1900569908215e+01, 0.5217580628120e+02 };
7310 
7311     /* SSB-to-Sun, T^1, X */
7312       static  final double s1x[] = {
7313          -0.1296310361520e-07, 0.0000000000000e+00, 0.0000000000000e+00,
7314           0.8975769009438e-08, 0.1128891609250e+01, 0.4265981595566e+00,
7315           0.7771113441307e-08, 0.2706039877077e+01, 0.2061856251104e+00,
7316           0.7538303866642e-08, 0.2191281289498e+01, 0.2204125344462e+00,
7317           0.6061384579336e-08, 0.3248167319958e+01, 0.1059381944224e+01,
7318           0.5726994235594e-08, 0.5569981398610e+01, 0.5225775174439e+00,
7319           0.5616492836424e-08, 0.5057386614909e+01, 0.5368044267797e+00,
7320           0.1010881584769e-08, 0.3473577116095e+01, 0.7113454667900e-02,
7321           0.7259606157626e-09, 0.3651858593665e+00, 0.6398972393349e+00,
7322           0.8755095026935e-09, 0.1662835408338e+01, 0.4194847048887e+00,
7323 
7324           0.5370491182812e-09, 0.1327673878077e+01, 0.4337116142245e+00,
7325           0.5743773887665e-09, 0.4250200846687e+01, 0.2132990797783e+00,
7326           0.4408103140300e-09, 0.3598752574277e+01, 0.1589072916335e+01,
7327           0.3101892374445e-09, 0.4887822983319e+01, 0.1052268489556e+01,
7328           0.3209453713578e-09, 0.9702272295114e+00, 0.5296909721118e+00,
7329           0.3017228286064e-09, 0.5484462275949e+01, 0.1066495398892e+01,
7330           0.3200700038601e-09, 0.2846613338643e+01, 0.1495633313810e+00,
7331           0.2137637279911e-09, 0.5692163292729e+00, 0.3163918923335e+00,
7332           0.1899686386727e-09, 0.2061077157189e+01, 0.2275259891141e+00,
7333           0.1401994545308e-09, 0.4177771136967e+01, 0.1102062672231e+00,
7334 
7335           0.1578057810499e-09, 0.5782460597335e+01, 0.7626583626240e-01,
7336           0.1237713253351e-09, 0.5705900866881e+01, 0.5154640627760e+00,
7337           0.1313076837395e-09, 0.5163438179576e+01, 0.3664874755930e-01,
7338           0.1184963304860e-09, 0.3054804427242e+01, 0.6327837846670e+00,
7339           0.1238130878565e-09, 0.2317292575962e+01, 0.3961708870310e-01,
7340           0.1015959527736e-09, 0.2194643645526e+01, 0.7329749511860e-01,
7341           0.9017954423714e-10, 0.2868603545435e+01, 0.1990721704425e+00,
7342           0.8668024955603e-10, 0.4923849675082e+01, 0.5439178814476e+00,
7343           0.7756083930103e-10, 0.3014334135200e+01, 0.9491756770005e+00,
7344           0.7536503401741e-10, 0.2704886279769e+01, 0.1030928125552e+00,
7345 
7346           0.5483308679332e-10, 0.6010983673799e+01, 0.8531963191132e+00,
7347           0.5184339620428e-10, 0.1952704573291e+01, 0.2093666171530e+00,
7348           0.5108658712030e-10, 0.2958575786649e+01, 0.2172315424036e+00,
7349           0.5019424524650e-10, 0.1736317621318e+01, 0.2164800718209e+00,
7350           0.4909312625978e-10, 0.3167216416257e+01, 0.2101180877357e+00,
7351           0.4456638901107e-10, 0.7697579923471e+00, 0.3235053470014e+00,
7352           0.4227030350925e-10, 0.3490910137928e+01, 0.6373574839730e-01,
7353           0.4095456040093e-10, 0.5178888984491e+00, 0.6470106940028e+00,
7354           0.4990537041422e-10, 0.3323887668974e+01, 0.1422690933580e-01,
7355           0.4321170010845e-10, 0.4288484987118e+01, 0.7358765972222e+00,
7356 
7357           0.3544072091802e-10, 0.6021051579251e+01, 0.5265099800692e+00,
7358           0.3480198638687e-10, 0.4600027054714e+01, 0.5328719641544e+00,
7359           0.3440287244435e-10, 0.4349525970742e+01, 0.8582758298370e-01,
7360           0.3330628322713e-10, 0.2347391505082e+01, 0.1104591729320e-01,
7361           0.2973060707184e-10, 0.4789409286400e+01, 0.5257585094865e+00,
7362           0.2932606766089e-10, 0.5831693799927e+01, 0.5336234347371e+00,
7363           0.2876972310953e-10, 0.2692638514771e+01, 0.1173197218910e+00,
7364           0.2827488278556e-10, 0.2056052487960e+01, 0.2022531624851e+00,
7365           0.2515028239756e-10, 0.7411863262449e+00, 0.9597935788730e-01,
7366           0.2853033744415e-10, 0.3948481024894e+01, 0.2118763888447e+01 };
7367 
7368     /* SSB-to-Sun, T^1, Y */
7369       static  final double s1y[] = {
7370           0.8989047573576e-08, 0.5840593672122e+01, 0.4265981595566e+00,
7371           0.7815938401048e-08, 0.1129664707133e+01, 0.2061856251104e+00,
7372           0.7550926713280e-08, 0.6196589104845e+00, 0.2204125344462e+00,
7373           0.6056556925895e-08, 0.1677494667846e+01, 0.1059381944224e+01,
7374           0.5734142698204e-08, 0.4000920852962e+01, 0.5225775174439e+00,
7375           0.5614341822459e-08, 0.3486722577328e+01, 0.5368044267797e+00,
7376           0.1028678147656e-08, 0.1877141024787e+01, 0.7113454667900e-02,
7377           0.7270792075266e-09, 0.5077167301739e+01, 0.6398972393349e+00,
7378           0.8734141726040e-09, 0.9069550282609e-01, 0.4194847048887e+00,
7379           0.5377371402113e-09, 0.6039381844671e+01, 0.4337116142245e+00,
7380 
7381           0.4729719431571e-09, 0.2153086311760e+01, 0.2132990797783e+00,
7382           0.4458052820973e-09, 0.5059830025565e+01, 0.5296909721118e+00,
7383           0.4406855467908e-09, 0.2027971692630e+01, 0.1589072916335e+01,
7384           0.3101659310977e-09, 0.3317677981860e+01, 0.1052268489556e+01,
7385           0.3016749232545e-09, 0.3913703482532e+01, 0.1066495398892e+01,
7386           0.3198541352656e-09, 0.1275513098525e+01, 0.1495633313810e+00,
7387           0.2142065389871e-09, 0.5301351614597e+01, 0.3163918923335e+00,
7388           0.1902615247592e-09, 0.4894943352736e+00, 0.2275259891141e+00,
7389           0.1613410990871e-09, 0.2449891130437e+01, 0.1102062672231e+00,
7390           0.1576992165097e-09, 0.4211421447633e+01, 0.7626583626240e-01,
7391 
7392           0.1241637259894e-09, 0.4140803368133e+01, 0.5154640627760e+00,
7393           0.1313974830355e-09, 0.3591920305503e+01, 0.3664874755930e-01,
7394           0.1181697118258e-09, 0.1506314382788e+01, 0.6327837846670e+00,
7395           0.1238239742779e-09, 0.7461405378404e+00, 0.3961708870310e-01,
7396           0.1010107068241e-09, 0.6271010795475e+00, 0.7329749511860e-01,
7397           0.9226316616509e-10, 0.1259158839583e+01, 0.1990721704425e+00,
7398           0.8664946419555e-10, 0.3353244696934e+01, 0.5439178814476e+00,
7399           0.7757230468978e-10, 0.1447677295196e+01, 0.9491756770005e+00,
7400           0.7693168628139e-10, 0.1120509896721e+01, 0.1030928125552e+00,
7401           0.5487897454612e-10, 0.4439380426795e+01, 0.8531963191132e+00,
7402 
7403           0.5196118677218e-10, 0.3788856619137e+00, 0.2093666171530e+00,
7404           0.5110853339935e-10, 0.1386879372016e+01, 0.2172315424036e+00,
7405           0.5027804534813e-10, 0.1647881805466e+00, 0.2164800718209e+00,
7406           0.4922485922674e-10, 0.1594315079862e+01, 0.2101180877357e+00,
7407           0.6155599524400e-10, 0.0000000000000e+00, 0.0000000000000e+00,
7408           0.4447147832161e-10, 0.5480720918976e+01, 0.3235053470014e+00,
7409           0.4144691276422e-10, 0.1931371033660e+01, 0.6373574839730e-01,
7410           0.4099950625452e-10, 0.5229611294335e+01, 0.6470106940028e+00,
7411           0.5060541682953e-10, 0.1731112486298e+01, 0.1422690933580e-01,
7412           0.4293615946300e-10, 0.2714571038925e+01, 0.7358765972222e+00,
7413 
7414           0.3545659845763e-10, 0.4451041444634e+01, 0.5265099800692e+00,
7415           0.3479112041196e-10, 0.3029385448081e+01, 0.5328719641544e+00,
7416           0.3438516493570e-10, 0.2778507143731e+01, 0.8582758298370e-01,
7417           0.3297341285033e-10, 0.7898709807584e+00, 0.1104591729320e-01,
7418           0.2972585818015e-10, 0.3218785316973e+01, 0.5257585094865e+00,
7419           0.2931707295017e-10, 0.4260731012098e+01, 0.5336234347371e+00,
7420           0.2897198149403e-10, 0.1120753978101e+01, 0.1173197218910e+00,
7421           0.2832293240878e-10, 0.4597682717827e+00, 0.2022531624851e+00,
7422           0.2864348326612e-10, 0.2169939928448e+01, 0.9597935788730e-01,
7423           0.2852714675471e-10, 0.2377659870578e+01, 0.2118763888447e+01 };
7424 
7425     /* SSB-to-Sun, T^1, Z */
7426       static final double s1z[] = {
7427           0.5444220475678e-08, 0.1803825509310e+01, 0.2132990797783e+00,
7428           0.3883412695596e-08, 0.4668616389392e+01, 0.5296909721118e+00,
7429           0.1334341434551e-08, 0.0000000000000e+00, 0.0000000000000e+00,
7430           0.3730001266883e-09, 0.5401405918943e+01, 0.2061856251104e+00,
7431           0.2894929197956e-09, 0.4932415609852e+01, 0.2204125344462e+00,
7432           0.2857950357701e-09, 0.3154625362131e+01, 0.7478166569050e-01,
7433           0.2499226432292e-09, 0.3657486128988e+01, 0.4265981595566e+00,
7434           0.1937705443593e-09, 0.5740434679002e+01, 0.1059381944224e+01,
7435           0.1374894396320e-09, 0.1712857366891e+01, 0.5368044267797e+00,
7436           0.1217248678408e-09, 0.2312090870932e+01, 0.5225775174439e+00,
7437 
7438           0.7961052740870e-10, 0.5283368554163e+01, 0.3813291813120e-01,
7439           0.4979225949689e-10, 0.4298290471860e+01, 0.4194847048887e+00,
7440           0.4388552286597e-10, 0.6145515047406e+01, 0.7113454667900e-02,
7441           0.2586835212560e-10, 0.3019448001809e+01, 0.6398972393349e+00 };
7442 
7443     /* SSB-to-Sun, T^2, X */
7444       static  final double s2x[] = {
7445           0.1603551636587e-11, 0.4404109410481e+01, 0.2061856251104e+00,
7446           0.1556935889384e-11, 0.4818040873603e+00, 0.2204125344462e+00,
7447           0.1182594414915e-11, 0.9935762734472e+00, 0.5225775174439e+00,
7448           0.1158794583180e-11, 0.3353180966450e+01, 0.5368044267797e+00,
7449           0.9597358943932e-12, 0.5567045358298e+01, 0.2132990797783e+00,
7450           0.6511516579605e-12, 0.5630872420788e+01, 0.4265981595566e+00,
7451           0.7419792747688e-12, 0.2156188581957e+01, 0.5296909721118e+00,
7452           0.3951972655848e-12, 0.1981022541805e+01, 0.1059381944224e+01,
7453           0.4478223877045e-12, 0.0000000000000e+00, 0.0000000000000e+00 };
7454 
7455     /* SSB-to-Sun, T^2, Y */
7456       static final double s2y[] = {
7457           0.1609114495091e-11, 0.2831096993481e+01, 0.2061856251104e+00,
7458           0.1560330784946e-11, 0.5193058213906e+01, 0.2204125344462e+00,
7459           0.1183535479202e-11, 0.5707003443890e+01, 0.5225775174439e+00,
7460           0.1158183066182e-11, 0.1782400404928e+01, 0.5368044267797e+00,
7461           0.1032868027407e-11, 0.4036925452011e+01, 0.2132990797783e+00,
7462           0.6540142847741e-12, 0.4058241056717e+01, 0.4265981595566e+00,
7463           0.7305236491596e-12, 0.6175401942957e+00, 0.5296909721118e+00,
7464          -0.5580725052968e-12, 0.0000000000000e+00, 0.0000000000000e+00,
7465           0.3946122651015e-12, 0.4108265279171e+00, 0.1059381944224e+01 };
7466 
7467     /* SSB-to-Sun, T^2, Z */
7468       static final double s2z[] = {
7469           0.3749920358054e-12, 0.3230285558668e+01, 0.2132990797783e+00,
7470           0.2735037220939e-12, 0.6154322683046e+01, 0.5296909721118e+00 };
7471         }
7472       
7473         /**
7474          *  Earth position and velocity, heliocentric and barycentric, with
7475          *  respect to the Barycentric Celestial Reference System.
7476          *
7477          *<p>This function is derived from the International Astronomical Union's
7478          *  SOFA (Standards Of Fundamental Astronomy) software collection.
7479          *
7480          *<p>Status:  support function.
7481          *
7482          *<!-- Given: -->
7483          *     @param date1 double         TDB date (Note 1)
7484          *     @param date2 double         TDB date (Note 1) 
7485          *
7486          *<!-- Returned: -->
7487          *     @param pvh           double[2][3]    <u>returned</u> heliocentric Earth position/velocity (au, au/d)
7488          *     @param pvb           double[2][3]    <u>returned</u> barycentric Earth position/velocity (au, au/d)
7489          *
7490          * <!-- Returned (function value): -->
7491          *  @return int           status: 0 = OK
7492          *                                       +1 = warning: date outside
7493          *                                            the range 1900-2100 AD
7494          *
7495          * <p>Notes:
7496          * <ol>
7497          *
7498          * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
7499          *     convenient way between the two arguments.  For example,
7500          *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
7501          *     others:
7502          *<pre>
7503          *            date1          date2
7504          *
7505          *         2450123.7           0.0       (JD method)
7506          *         2451545.0       -1421.3       (J2000 method)
7507          *         2400000.5       50123.2       (MJD method)
7508          *         2450123.5           0.2       (date &amp; time method)
7509          *</pre>
7510          *     The JD method is the most natural and convenient to use in cases
7511          *     where the loss of several decimal digits of resolution is
7512          *     acceptable.  The J2000 method is best matched to the way the
7513          *     argument is handled internally and will deliver the optimum
7514          *     resolution.  The MJD method and the date &amp; time methods are both
7515          *     good compromises between resolution and convenience.  However,
7516          *     the accuracy of the result is more likely to be limited by the
7517          *     algorithm itself than the way the date has been expressed.
7518          *
7519          *     n.b. TT can be used instead of TDB in most applications.
7520          *
7521          * <li> On return, the arrays pvh and pvb contain the following:
7522          *
7523          *        pvh[0][0]  x       }
7524          *        pvh[0][1]  y       } heliocentric position, au
7525          *        pvh[0][2]  z       }
7526          *
7527          *        pvh[1][0]  xdot    }
7528          *        pvh[1][1]  ydot    } heliocentric velocity, au/d
7529          *        pvh[1][2]  zdot    }
7530          *
7531          *        pvb[0][0]  x       }
7532          *        pvb[0][1]  y       } barycentric position, au
7533          *        pvb[0][2]  z       }
7534          *
7535          *        pvb[1][0]  xdot    }
7536          *        pvb[1][1]  ydot    } barycentric velocity, au/d
7537          *        pvb[1][2]  zdot    }
7538          *
7539          *     The vectors are with respect to the Barycentric Celestial
7540          *     Reference System.  The time unit is one day in TDB.
7541          *
7542          * <li> The function is a SIMPLIFIED SOLUTION from the planetary theory
7543          *     VSOP2000 (X. Moisson, P. Bretagnon, 2001, Celes. Mechanics &amp;
7544          *     Dyn. Astron., 80, 3/4, 205-213) and is an adaptation of original
7545          *     Fortran code supplied by P. Bretagnon (private comm., 2000).
7546          *
7547          * <li> Comparisons over the time span 1900-2100 with this simplified
7548          *     solution and the JPL DE405 ephemeris give the following results:
7549          *
7550          *                                RMS    max
7551          *           Heliocentric:
7552          *              position error    3.7   11.2   km
7553          *              velocity error    1.4    5.0   mm/s
7554          *
7555          *           Barycentric:
7556          *              position error    4.6   13.4   km
7557          *              velocity error    1.4    4.9   mm/s
7558          *
7559          *     Comparisons with the JPL DE406 ephemeris show that by 1800 and
7560          *     2200 the position errors are approximately double their 1900-2100
7561          *     size.  By 1500 and 2500 the deterioration is a factor of 10 and
7562          *     by 1000 and 3000 a factor of 60.  The velocity accuracy falls off
7563          *     at about half that rate.
7564          *
7565          * <li> It is permissible to use the same array for pvh and pvb, which
7566          *     will receive the barycentric values.
7567          *</ol>
7568          *@version 2008 November 18
7569          *
7570          *  @since Release 20101201
7571          *
7572          *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7573          */
7574          public static int jauEpv00(final double date1, final double date2,
7575                       double pvh[][], double pvb[][])
7576          {
7577          /*
7578          * Matrix elements for orienting the analytical model to DE405.
7579          *
7580          * The corresponding Euler angles are:
7581          *
7582          *                       d  '  "
7583          *   1st rotation    -  23 26 21.4091 about the x-axis  (obliquity)
7584          *   2nd rotation    +         0.0475 about the z-axis  (RA offset)
7585          *
7586          * These were obtained empirically, by comparisons with DE405 over
7587          * 1900-2100.
7588          */
7589             final double am12 =  0.000000211284,
7590                                 am13 = -0.000000091603,
7591                                 am21 = -0.000000230286,
7592                                 am22 =  0.917482137087,
7593                                 am23 = -0.397776982902,
7594                                 am32 =  0.397776982902,
7595                                 am33 =  0.917482137087;
7596             
7597       
7598         
7599         
7600     /* Pointers to coefficient arrays, in x,y,z sets */
7601        final double ce0[][] = { Ephemeris.e0x, Ephemeris.e0y, Ephemeris.e0z },
7602                            ce1[][] = { Ephemeris.e1x, Ephemeris.e1y, Ephemeris.e1z },
7603                            ce2[][] = { Ephemeris.e2x, Ephemeris.e2y, Ephemeris.e2z },
7604                            cs0[][] = { Ephemeris.s0x, Ephemeris.s0y, Ephemeris.s0z },
7605                            cs1[][] = { Ephemeris.s1x, Ephemeris.s1y, Ephemeris.s1z },
7606                            cs2[][] = { Ephemeris.s2x, Ephemeris.s2y, Ephemeris.s2z };
7607        /* Numbers of terms for each component of the model, in x,y,z sets */
7608        final int ne0[] = {Ephemeris.e0x.length/3,
7609                Ephemeris.e0y.length/3,
7610                Ephemeris.e0z.length/3 },
7611                         ne1[] = {Ephemeris.e1x.length/3,
7612                Ephemeris.e1y.length/3,
7613                Ephemeris.e1z.length/3 },
7614                         ne2[] = {Ephemeris.e2x.length/3,
7615                Ephemeris.e2y.length/3,
7616                Ephemeris.e2z.length/3 },
7617                         ns0[] = {Ephemeris.s0x.length/3,
7618                Ephemeris.s0y.length/3,
7619                Ephemeris.s0z.length/3 },
7620                         ns1[] = {Ephemeris.s1x.length/3,
7621                Ephemeris.s1y.length/3,
7622                Ephemeris.s1z.length/3 },
7623                         ns2[] = {Ephemeris.s2x.length/3,
7624                Ephemeris.s2y.length/3,
7625                Ephemeris.s2z.length/3 };
7626        int nterms;
7627 
7628     /* Miscellaneous */
7629        int jstat, i, j;
7630        double t, t2, xyz, xyzd, a, b, c, ct, p, cp,
7631               ph[] = new double[3], vh[] = new double[3], pb[] = new double[3], vb[] = new double[3], x, y, z;
7632 
7633     /*--------------------------------------------------------------------*/
7634 
7635     /* Time since reference epoch, Julian years. */
7636        t = ((date1 - DJ00) + date2) / DJY;
7637        t2 = t*t;
7638 
7639     /* Set status. */
7640        jstat = abs(t) <= 100.0 ? 0 : 1;
7641 
7642     /* X then Y then Z. */
7643        for (i = 0; i < 3; i++) {
7644 
7645        /* Initialize position and velocity component. */
7646           xyz = 0.0;
7647           xyzd = 0.0;
7648 
7649        /* ------------------------------------------------ */
7650        /* Obtain component of Sun to Earth ecliptic vector */
7651        /* ------------------------------------------------ */
7652 
7653        /* Sun to Earth, T^0 terms. */
7654           nterms = ne0[i];
7655           int idx;
7656           for (j = 0, idx=0; j < nterms; j++) {
7657              a = ce0[i][idx++];
7658              b = ce0[i][idx++];
7659              c = ce0[i][idx++];
7660              p = b + c*t;
7661              xyz  += a*cos(p);
7662              xyzd -= a*c*sin(p);
7663           }
7664 
7665        /* Sun to Earth, T^1 terms. */
7666           nterms = ne1[i];
7667           for (j = 0, idx= 0; j < nterms; j++) {
7668              a = ce1[i][idx++];
7669              b = ce1[i][idx++];
7670              c = ce1[i][idx++];
7671              ct = c*t;
7672              p = b + ct;
7673              cp = cos(p);
7674              xyz  += a*t*cp;
7675              xyzd += a*( cp - ct*sin(p) );
7676           }
7677 
7678        /* Sun to Earth, T^2 terms. */
7679           nterms = ne2[i];
7680           for (j = 0, idx = 0; j < nterms; j++) {
7681              a = ce2[i][idx++];
7682              b = ce2[i][idx++];
7683              c = ce2[i][idx++];
7684              ct = c*t;
7685              p = b + ct;
7686              cp = cos(p);
7687              xyz  += a*t2*cp;
7688              xyzd += a*t*( 2.0*cp - ct*sin(p) );
7689           }
7690 
7691        /* Heliocentric Earth position and velocity component. */
7692           ph[i] = xyz;
7693           vh[i] = xyzd / DJY;
7694 
7695        /* ------------------------------------------------ */
7696        /* Obtain component of SSB to Earth ecliptic vector */
7697        /* ------------------------------------------------ */
7698 
7699        /* SSB to Sun, T^0 terms. */
7700           nterms = ns0[i];
7701           for (j = 0, idx = 0; j < nterms; j++) {
7702              a = cs0[i][idx++];
7703              b = cs0[i][idx++];
7704              c = cs0[i][idx++];
7705              p = b + c*t;
7706              xyz  += a*cos(p);
7707              xyzd -= a*c*sin(p);
7708           }
7709 
7710        /* SSB to Sun, T^1 terms. */
7711           nterms = ns1[i];
7712           for (j = 0, idx = 0; j < nterms; j++) {
7713              a = cs1[i][idx++];
7714              b = cs1[i][idx++];
7715              c = cs1[i][idx++];
7716              ct = c*t;
7717              p = b + ct;
7718              cp = cos(p);
7719              xyz  += a*t*cp;
7720              xyzd += a*(cp - ct*sin(p));
7721           }
7722 
7723        /* SSB to Sun, T^2 terms. */
7724           nterms = ns2[i];
7725           for (j = 0, idx = 0; j < nterms; j++) {
7726              a = cs2[i][idx++];
7727              b = cs2[i][idx++];
7728              c = cs2[i][idx++];
7729              ct = c*t;
7730              p = b + ct;
7731              cp = cos(p);
7732              xyz  += a*t2*cp;
7733              xyzd += a*t*(2.0*cp - ct*sin(p));
7734          }
7735 
7736        /* Barycentric Earth position and velocity component. */
7737          pb[i] = xyz;
7738          vb[i] = xyzd / DJY;
7739 
7740        /* Next Cartesian component. */
7741        }
7742 
7743     /* Rotate from ecliptic to BCRS coordinates. */
7744 
7745        x = ph[0];
7746        y = ph[1];
7747        z = ph[2];
7748        pvh[0][0] =      x + am12*y + am13*z;
7749        pvh[0][1] = am21*x + am22*y + am23*z;
7750        pvh[0][2] =          am32*y + am33*z;
7751 
7752        x = vh[0];
7753        y = vh[1];
7754        z = vh[2];
7755        pvh[1][0] =      x + am12*y + am13*z;
7756        pvh[1][1] = am21*x + am22*y + am23*z;
7757        pvh[1][2] =          am32*y + am33*z;
7758 
7759        x = pb[0];
7760        y = pb[1];
7761        z = pb[2];
7762        pvb[0][0] =      x + am12*y + am13*z;
7763        pvb[0][1] = am21*x + am22*y + am23*z;
7764        pvb[0][2] =          am32*y + am33*z;
7765 
7766        x = vb[0];
7767        y = vb[1];
7768        z = vb[2];
7769        pvb[1][0] =      x + am12*y + am13*z;
7770        pvb[1][1] = am21*x + am22*y + am23*z;
7771        pvb[1][2] =          am32*y + am33*z;
7772 
7773     /* Return the status. */
7774        return jstat;
7775 
7776         }
7777     
7778 
7779     /**
7780     *  Equation of the equinoxes, IAU 1994 model.
7781     *
7782     *<p>This function is derived from the International Astronomical Union's
7783     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7784     *
7785     *<p>Status:  canonical model.
7786     *
7787     *<!-- Given: -->
7788     *     @param date1 double      TDB date (Note 1)
7789     *     @param date2 double      TDB date (Note 1) 
7790     *
7791     * <!-- Returned (function value): -->
7792     *  @return double     equation of the equinoxes (Note 2)
7793     *
7794     * <p>Notes:
7795     * <ol>
7796     *
7797     * <li> The date date1+date2 is a Julian Date, apportioned in any
7798     *     convenient way between the two arguments.  For example,
7799     *     JD(TT)=2450123.7 could be expressed in any of these ways,
7800     *     among others:
7801     *<pre>
7802     *            date1          date2
7803     *
7804     *         2450123.7           0.0       (JD method)
7805     *         2451545.0       -1421.3       (J2000 method)
7806     *         2400000.5       50123.2       (MJD method)
7807     *         2450123.5           0.2       (date &amp; time method)
7808     *</pre>
7809     *     The JD method is the most natural and convenient to use in
7810     *     cases where the loss of several decimal digits of resolution
7811     *     is acceptable.  The J2000 method is best matched to the way
7812     *     the argument is handled internally and will deliver the
7813     *     optimum resolution.  The MJD method and the date &amp; time methods
7814     *     are both good compromises between resolution and convenience.
7815     *
7816     * <li> The result, which is in radians, operates in the following sense:
7817     *
7818     *        Greenwich apparent ST = GMST + equation of the equinoxes
7819     *</ol>
7820     *<p>Called:<ul>
7821     *     <li>{@link #jauNut80} nutation, IAU 1980
7822     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
7823     * </ul>
7824     *<p>References:
7825     *
7826     *     <p>IAU Resolution C7, Recommendation 3 (1994).
7827     *
7828     *     <p>Capitaine, N. &amp; Gontier, A.-M., 1993, Astron. Astrophys., 275,
7829     *     645-650.
7830     *
7831     *@version 2008 May 24
7832     *
7833     *  @since Release 20101201
7834     *
7835     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7836     */
7837     public static double jauEqeq94(double date1, double date2)
7838     {
7839        double t,  om,  eps0, ee;
7840 
7841 
7842     /* Interval between fundamental epoch J2000.0 and given date (JC). */
7843        t = ((date1 - DJ00) + date2) / DJC;
7844 
7845     /* Longitude of the mean ascending node of the lunar orbit on the */
7846     /* ecliptic, measured from the mean equinox of date. */
7847        om = jauAnpm((450160.280 + (-482890.539
7848                + (7.455 + 0.008 * t) * t) * t) * DAS2R
7849                + fmod(-5.0 * t, 1.0) * D2PI);
7850 
7851     /* Nutation components and mean obliquity. */
7852        NutationTerms nt = jauNut80(date1, date2);
7853        eps0 = jauObl80(date1, date2);
7854 
7855     /* Equation of the equinoxes. */
7856        ee = nt.dpsi*cos(eps0) + DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om));
7857 
7858        return ee;
7859 
7860         }
7861     
7862 
7863     /**
7864     *  Earth rotation angle (IAU 2000 model).
7865     *
7866     *<p>This function is derived from the International Astronomical Union's
7867     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7868     *
7869     *<p>Status:  canonical model.
7870     *
7871     *<!-- Given: -->
7872     *     @param dj1 double     UT1 as a 2-part Julian Date (see note)
7873     *     @param dj2 double     UT1 as a 2-part Julian Date (see note) 
7874     *
7875     * <!-- Returned (function value): -->
7876     *  @return double    Earth rotation angle (radians), range 0-2pi
7877     *
7878     * <p>Notes:
7879     * <ol>
7880     *
7881     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
7882     *     convenient way between the arguments dj1 and dj2.  For example,
7883     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
7884     *     among others:
7885     *<pre>
7886     *             dj1            dj2
7887     *
7888     *         2450123.7           0.0       (JD method)
7889     *         2451545.0       -1421.3       (J2000 method)
7890     *         2400000.5       50123.2       (MJD method)
7891     *         2450123.5           0.2       (date &amp; time method)
7892     *</pre>
7893     *     The JD method is the most natural and convenient to use in
7894     *     cases where the loss of several decimal digits of resolution
7895     *     is acceptable.  The J2000 and MJD methods are good compromises
7896     *     between resolution and convenience.  The date &amp; time method is
7897     *     best matched to the algorithm used:  maximum precision is
7898     *     delivered when the dj1 argument is for 0hrs UT1 on the day in
7899     *     question and the dj2 argument lies in the range 0 to 1, or vice
7900     *     versa.
7901     *
7902     * <li> The algorithm is adapted from Expression 22 of Capitaine et al.
7903     *     2000.  The time argument has been expressed in days directly,
7904     *     and, to retain precision, integer contributions have been
7905     *     eliminated.  The same formulation is given in IERS Conventions
7906     *     (2003), Chap. 5, Eq. 14.
7907     *</ol>
7908     *<p>Called:<ul>
7909     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
7910     * </ul>
7911     *<p>References:
7912     *
7913     *     <p>Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron.
7914     *     Astrophys., 355, 398-405.
7915     *
7916     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7917     *     IERS Technical Note No. 32, BKG (2004)
7918     *
7919     *@version 2008 May 24
7920     *
7921     *  @since Release 20101201
7922     *
7923     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7924     */
7925     public static double jauEra00(double dj1, double dj2)
7926     {
7927        double d1, d2, t, f, theta;
7928 
7929 
7930     /* Days since fundamental epoch. */
7931        if (dj1 < dj2) {
7932           d1 = dj1;
7933           d2 = dj2;
7934        } else {
7935           d1 = dj2;
7936           d2 = dj1;
7937        }
7938        t = d1 + (d2- DJ00);
7939 
7940     /* Fractional part of T (days). */
7941        f = fmod(d1, 1.0) + fmod(d2, 1.0);
7942 
7943     /* Earth rotation angle at this UT1. */
7944        theta = jauAnp(D2PI * (f + 0.7790572732640
7945                                 + 0.00273781191135448 * t));
7946 
7947        return theta;
7948 
7949         }
7950     
7951 
7952     /**
7953     *  Fundamental argument, IERS Conventions (2003):
7954     *  mean elongation of the Moon from the Sun.
7955     *
7956     *<p>This function is derived from the International Astronomical Union's
7957     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7958     *
7959     *<p>Status:  canonical model.
7960     *
7961     *<!-- Given: -->
7962     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
7963     *
7964     * <!-- Returned (function value): -->
7965     *  @return double    D, radians (Note 2)
7966     *
7967     * <p>Notes:
7968     * <ol>
7969     *
7970     * <li> Though t is strictly TDB, it is usually more convenient to use
7971     *     TT, which makes no significant difference.
7972     *
7973     * <li> The expression used is as adopted in IERS Conventions (2003) and
7974     *     is from Simon et al. (1994).
7975     *</ol>
7976     *<p>References:
7977     *
7978     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7979     *     IERS Technical Note No. 32, BKG (2004)
7980     *
7981     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
7982     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
7983     *
7984     *@version 2009 December 16
7985     *
7986     *  @since Release 20101201
7987     *
7988     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7989     */
7990     public static double jauFad03(double t)
7991     {
7992        double a;
7993 
7994 
7995     /* Mean elongation of the Moon from the Sun (IERS Conventions 2003). */
7996        a = fmod(          1072260.703692 +
7997                  t * ( 1602961601.2090 +
7998                  t * (        - 6.3706 +
7999                  t * (          0.006593 +
8000                  t * (        - 0.00003169 ) ) ) ), TURNAS ) * DAS2R;
8001 
8002        return a;
8003 
8004         }
8005     
8006 
8007     /**
8008     *  Fundamental argument, IERS Conventions (2003):
8009     *  mean longitude of Earth.
8010     *
8011     *<p>This function is derived from the International Astronomical Union's
8012     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8013     *
8014     *<p>Status:  canonical model.
8015     *
8016     *<!-- Given: -->
8017     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8018     *
8019     * <!-- Returned (function value): -->
8020     *  @return double    mean longitude of Earth, radians (Note 2)
8021     *
8022     * <p>Notes:
8023     * <ol>
8024     *
8025     * <li> Though t is strictly TDB, it is usually more convenient to use
8026     *     TT, which makes no significant difference.
8027     *
8028     * <li> The expression used is as adopted in IERS Conventions (2003) and
8029     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8030     *</ol>
8031     *<p>References:
8032     *
8033     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8034     *     IERS Technical Note No. 32, BKG (2004)
8035     *
8036     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8037     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8038     *
8039     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8040     *     Astron.Astrophys.Supp.Ser. 135, 111
8041     *
8042     *@version 2009 December 16
8043     *
8044     *  @since Release 20101201
8045     *
8046     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8047     */
8048     public static double jauFae03(double t)
8049     {
8050        double a;
8051 
8052 
8053     /* Mean longitude of Earth (IERS Conventions 2003). */
8054        a = fmod(1.753470314 + 628.3075849991 * t, D2PI);
8055 
8056        return a;
8057 
8058         }
8059     
8060 
8061     /**
8062     *  Fundamental argument, IERS Conventions (2003):
8063     *  mean longitude of the Moon minus mean longitude of the ascending
8064     *  node.
8065     *
8066     *<p>This function is derived from the International Astronomical Union's
8067     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8068     *
8069     *<p>Status:  canonical model.
8070     *
8071     *<!-- Given: -->
8072     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8073     *
8074     * <!-- Returned (function value): -->
8075     *  @return double    F, radians (Note 2)
8076     *
8077     * <p>Notes:
8078     * <ol>
8079     *
8080     * <li> Though t is strictly TDB, it is usually more convenient to use
8081     *     TT, which makes no significant difference.
8082     *
8083     * <li> The expression used is as adopted in IERS Conventions (2003) and
8084     *     is from Simon et al. (1994).
8085     *</ol>
8086     *<p>References:
8087     *
8088     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8089     *     IERS Technical Note No. 32, BKG (2004)
8090     *
8091     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8092     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8093     *
8094     *@version 2009 December 16
8095     *
8096     *  @since Release 20101201
8097     *
8098     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8099     */
8100     public static double jauFaf03(double t)
8101     {
8102        double a;
8103 
8104 
8105     /* Mean longitude of the Moon minus that of the ascending node */
8106     /* (IERS Conventions 2003).                                    */
8107        a = fmod(           335779.526232 +
8108                  t * ( 1739527262.8478 +
8109                  t * (       - 12.7512 +
8110                  t * (        - 0.001037 +
8111                  t * (          0.00000417 ) ) ) ), TURNAS ) * DAS2R;
8112 
8113        return a;
8114 
8115 
8116         }
8117     
8118 
8119     /**
8120     *  Fundamental argument, IERS Conventions (2003):
8121     *  mean longitude of Jupiter.
8122     *
8123     *<p>This function is derived from the International Astronomical Union's
8124     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8125     *
8126     *<p>Status:  canonical model.
8127     *
8128     *<!-- Given: -->
8129     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8130     *
8131     * <!-- Returned (function value): -->
8132     *  @return double    mean longitude of Jupiter, radians (Note 2)
8133     *
8134     * <p>Notes:
8135     * <ol>
8136     *
8137     * <li> Though t is strictly TDB, it is usually more convenient to use
8138     *     TT, which makes no significant difference.
8139     *
8140     * <li> The expression used is as adopted in IERS Conventions (2003) and
8141     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8142     *</ol>
8143     *<p>References:
8144     *
8145     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8146     *     IERS Technical Note No. 32, BKG (2004)
8147     *
8148     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8149     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8150     *
8151     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8152     *     Astron.Astrophys.Supp.Ser. 135, 111
8153     *
8154     *@version 2009 December 16
8155     *
8156     *  @since Release 20101201
8157     *
8158     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8159     */
8160     public static double jauFaju03(double t)
8161     {
8162        double a;
8163 
8164 
8165     /* Mean longitude of Jupiter (IERS Conventions 2003). */
8166        a = fmod(0.599546497 + 52.9690962641 * t, D2PI);
8167 
8168        return a;
8169 
8170         }
8171     
8172 
8173     /**
8174     *  Fundamental argument, IERS Conventions (2003):
8175     *  mean anomaly of the Moon.
8176     *
8177     *<p>This function is derived from the International Astronomical Union's
8178     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8179     *
8180     *<p>Status:  canonical model.
8181     *
8182     *<!-- Given: -->
8183     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8184     *
8185     * <!-- Returned (function value): -->
8186     *  @return double    l, radians (Note 2)
8187     *
8188     * <p>Notes:
8189     * <ol>
8190     *
8191     * <li> Though t is strictly TDB, it is usually more convenient to use
8192     *     TT, which makes no significant difference.
8193     *
8194     * <li> The expression used is as adopted in IERS Conventions (2003) and
8195     *     is from Simon et al. (1994).
8196     *</ol>
8197     *<p>References:
8198     *
8199     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8200     *     IERS Technical Note No. 32, BKG (2004)
8201     *
8202     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8203     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8204     *
8205     *@version 2009 December 16
8206     *
8207     *  @since Release 20101201
8208     *
8209     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8210     */
8211     public static double jauFal03(double t)
8212     {
8213        double a;
8214 
8215 
8216     /* Mean anomaly of the Moon (IERS Conventions 2003). */
8217        a = fmod(           485868.249036  +
8218                  t * ( 1717915923.2178 +
8219                  t * (         31.8792 +
8220                  t * (          0.051635 +
8221                  t * (        - 0.00024470 ) ) ) ), TURNAS ) * DAS2R;
8222 
8223        return a;
8224 
8225         }
8226     
8227 
8228     /**
8229     *  Fundamental argument, IERS Conventions (2003):
8230     *  mean anomaly of the Sun.
8231     *
8232     *<p>This function is derived from the International Astronomical Union's
8233     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8234     *
8235     *<p>Status:  canonical model.
8236     *
8237     *<!-- Given: -->
8238     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8239     *
8240     * <!-- Returned (function value): -->
8241     *  @return double    l', radians (Note 2)
8242     *
8243     * <p>Notes:
8244     * <ol>
8245     *
8246     * <li> Though t is strictly TDB, it is usually more convenient to use
8247     *     TT, which makes no significant difference.
8248     *
8249     * <li> The expression used is as adopted in IERS Conventions (2003) and
8250     *     is from Simon et al. (1994).
8251     *</ol>
8252     *<p>References:
8253     *
8254     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8255     *     IERS Technical Note No. 32, BKG (2004)
8256     *
8257     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8258     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8259     *
8260     *@version 2009 December 16
8261     *
8262     *  @since Release 20101201
8263     *
8264     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8265     */
8266     public static double jauFalp03(double t)
8267     {
8268        double a;
8269 
8270 
8271     /* Mean anomaly of the Sun (IERS Conventions 2003). */
8272        a = fmod(         1287104.793048 +
8273                  t * ( 129596581.0481 +
8274                  t * (       - 0.5532 +
8275                  t * (         0.000136 +
8276                  t * (       - 0.00001149 ) ) ) ), TURNAS ) * DAS2R;
8277 
8278        return a;
8279 
8280         }
8281     
8282 
8283     /**
8284     *  Fundamental argument, IERS Conventions (2003):
8285     *  mean longitude of Mars.
8286     *
8287     *<p>This function is derived from the International Astronomical Union's
8288     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8289     *
8290     *<p>Status:  canonical model.
8291     *
8292     *<!-- Given: -->
8293     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8294     *
8295     * <!-- Returned (function value): -->
8296     *  @return double    mean longitude of Mars, radians (Note 2)
8297     *
8298     * <p>Notes:
8299     * <ol>
8300     *
8301     * <li> Though t is strictly TDB, it is usually more convenient to use
8302     *     TT, which makes no significant difference.
8303     *
8304     * <li> The expression used is as adopted in IERS Conventions (2003) and
8305     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8306     *</ol>
8307     *<p>References:
8308     *
8309     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8310     *     IERS Technical Note No. 32, BKG (2004)
8311     *
8312     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8313     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8314     *
8315     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8316     *     Astron.Astrophys.Supp.Ser. 135, 111
8317     *
8318     *@version 2009 December 16
8319     *
8320     *  @since Release 20101201
8321     *
8322     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8323     */
8324     public static double jauFama03(double t)
8325     {
8326        double a;
8327 
8328 
8329     /* Mean longitude of Mars (IERS Conventions 2003). */
8330        a = fmod(6.203480913 + 334.0612426700 * t, D2PI);
8331 
8332        return a;
8333 
8334         }
8335     
8336 
8337     /**
8338     *  Fundamental argument, IERS Conventions (2003):
8339     *  mean longitude of Mercury.
8340     *
8341     *<p>This function is derived from the International Astronomical Union's
8342     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8343     *
8344     *<p>Status:  canonical model.
8345     *
8346     *<!-- Given: -->
8347     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8348     *
8349     * <!-- Returned (function value): -->
8350     *  @return double    mean longitude of Mercury, radians (Note 2)
8351     *
8352     * <p>Notes:
8353     * <ol>
8354     *
8355     * <li> Though t is strictly TDB, it is usually more convenient to use
8356     *     TT, which makes no significant difference.
8357     *
8358     * <li> The expression used is as adopted in IERS Conventions (2003) and
8359     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8360     *</ol>
8361     *<p>References:
8362     *
8363     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8364     *     IERS Technical Note No. 32, BKG (2004)
8365     *
8366     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8367     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8368     *
8369     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8370     *     Astron.Astrophys.Supp.Ser. 135, 111
8371     *
8372     *@version 2009 December 16
8373     *
8374     *  @since Release 20101201
8375     *
8376     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8377     */
8378     public static double jauFame03(double t)
8379     {
8380        double a;
8381 
8382 
8383     /* Mean longitude of Mercury (IERS Conventions 2003). */
8384        a = fmod(4.402608842 + 2608.7903141574 * t, D2PI);
8385 
8386        return a;
8387 
8388         }
8389     
8390 
8391 
8392     /**
8393     *  Fundamental argument, IERS Conventions (2003):
8394     *  mean longitude of Neptune.
8395     *
8396     *<p>This function is derived from the International Astronomical Union's
8397     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8398     *
8399     *<p>Status:  canonical model.
8400     *
8401     *<!-- Given: -->
8402     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8403     *
8404     * <!-- Returned (function value): -->
8405     *  @return double    mean longitude of Neptune, radians (Note 2)
8406     *
8407     * <p>Notes:
8408     * <ol>
8409     *
8410     * <li> Though t is strictly TDB, it is usually more convenient to use
8411     *     TT, which makes no significant difference.
8412     *
8413     * <li> The expression used is as adopted in IERS Conventions (2003) and
8414     *     is adapted from Simon et al. (1994).
8415     *</ol>
8416     *<p>References:
8417     *
8418     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8419     *     IERS Technical Note No. 32, BKG (2004)
8420     *
8421     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8422     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8423     *
8424     *@version 2009 December 16
8425     *
8426     *  @since Release 20101201
8427     *
8428     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8429     */
8430     public static double jauFane03(double t)
8431     {
8432        double a;
8433 
8434 
8435     /* Mean longitude of Neptune (IERS Conventions 2003). */
8436        a = fmod(5.311886287 + 3.8133035638 * t, D2PI);
8437 
8438        return a;
8439 
8440         }
8441     
8442 
8443     /**
8444     *  Fundamental argument, IERS Conventions (2003):
8445     *  mean longitude of the Moon's ascending node.
8446     *
8447     *<p>This function is derived from the International Astronomical Union's
8448     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8449     *
8450     *<p>Status:  canonical model.
8451     *
8452     *<!-- Given: -->
8453     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8454     *
8455     * <!-- Returned (function value): -->
8456     *  @return double    Omega, radians (Note 2)
8457     *
8458     * <p>Notes:
8459     * <ol>
8460     *
8461     * <li> Though t is strictly TDB, it is usually more convenient to use
8462     *     TT, which makes no significant difference.
8463     *
8464     * <li> The expression used is as adopted in IERS Conventions (2003) and
8465     *     is from Simon et al. (1994).
8466     *</ol>
8467     *<p>References:
8468     *
8469     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8470     *     IERS Technical Note No. 32, BKG (2004)
8471     *
8472     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8473     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8474     *
8475     *@version 2009 December 16
8476     *
8477     *  @since Release 20101201
8478     *
8479     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8480     */
8481     public static double jauFaom03(double t)
8482     {
8483        double a;
8484 
8485 
8486     /* Mean longitude of the Moon's ascending node */
8487     /* (IERS Conventions 2003).                    */
8488        a = fmod(          450160.398036 +
8489                  t * ( - 6962890.5431 +
8490                  t * (         7.4722 +
8491                  t * (         0.007702 +
8492                  t * (       - 0.00005939 ) ) ) ), TURNAS ) * DAS2R;
8493 
8494        return a;
8495 
8496         }
8497     
8498 
8499     /**
8500     *  Fundamental argument, IERS Conventions (2003):
8501     *  general accumulated precession in longitude.
8502     *
8503     *<p>This function is derived from the International Astronomical Union's
8504     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8505     *
8506     *<p>Status:  canonical model.
8507     *
8508     *<!-- Given: -->
8509     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8510     *
8511     * <!-- Returned (function value): -->
8512     *  @return double    general precession in longitude, radians (Note 2)
8513     *
8514     * <p>Notes:
8515     * <ol>
8516     *
8517     * <li> Though t is strictly TDB, it is usually more convenient to use
8518     *     TT, which makes no significant difference.
8519     *
8520     * <li> The expression used is as adopted in IERS Conventions (2003).  It
8521     *     is taken from Kinoshita &amp; Souchay (1990) and comes originally
8522     *     from Lieske et al. (1977).
8523     *</ol>
8524     *<p>References:
8525     *
8526     *     Kinoshita, H. and Souchay J. 1990, Celest.Mech. and Dyn.Astron.
8527     *     48, 187
8528     *
8529     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
8530     *     Astron.Astrophys. 58, 1-16
8531     *
8532     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8533     *     IERS Technical Note No. 32, BKG (2004)
8534     *
8535     *@version 2009 December 16
8536     *
8537     *  @since Release 20101201
8538     *
8539     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8540     */
8541     public static double jauFapa03(double t)
8542     {
8543        double a;
8544 
8545 
8546     /* General accumulated precession in longitude. */
8547        a = (0.024381750 + 0.00000538691 * t) * t;
8548 
8549        return a;
8550 
8551         }
8552     
8553 
8554     /**
8555     *  Fundamental argument, IERS Conventions (2003):
8556     *  mean longitude of Saturn.
8557     *
8558     *<p>This function is derived from the International Astronomical Union's
8559     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8560     *
8561     *<p>Status:  canonical model.
8562     *
8563     *<!-- Given: -->
8564     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8565     *
8566     * <!-- Returned (function value): -->
8567     *  @return double    mean longitude of Saturn, radians (Note 2)
8568     *
8569     * <p>Notes:
8570     * <ol>
8571     *
8572     * <li> Though t is strictly TDB, it is usually more convenient to use
8573     *     TT, which makes no significant difference.
8574     *
8575     * <li> The expression used is as adopted in IERS Conventions (2003) and
8576     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8577     *</ol>
8578     *<p>References:
8579     *
8580     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8581     *     IERS Technical Note No. 32, BKG (2004)
8582     *
8583     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8584     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8585     *
8586     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8587     *     Astron.Astrophys.Supp.Ser. 135, 111
8588     *
8589     *@version 2009 December 16
8590     *
8591     *  @since Release 20101201
8592     *
8593     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8594     */
8595     public static double jauFasa03(double t)
8596     {
8597        double a;
8598 
8599 
8600     /* Mean longitude of Saturn (IERS Conventions 2003). */
8601        a = fmod(0.874016757 + 21.3299104960 * t, D2PI);
8602 
8603        return a;
8604 
8605         }
8606     
8607 
8608     /**
8609     *  Fundamental argument, IERS Conventions (2003):
8610     *  mean longitude of Uranus.
8611     *
8612     *<p>This function is derived from the International Astronomical Union's
8613     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8614     *
8615     *<p>Status:  canonical model.
8616     *
8617     *<!-- Given: -->
8618     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8619     *
8620     * <!-- Returned  (function value): -->
8621     *      @return     double    mean longitude of Uranus, radians (Note 2)
8622     *
8623     * <p>Notes:
8624     * <ol>
8625     *
8626     * <li> Though t is strictly TDB, it is usually more convenient to use
8627     *     TT, which makes no significant difference.
8628     *
8629     * <li> The expression used is as adopted in IERS Conventions (2003) and
8630     *     is adapted from Simon et al. (1994).
8631     *</ol>
8632     *<p>References:
8633     *
8634     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8635     *     IERS Technical Note No. 32, BKG (2004)
8636     *
8637     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8638     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8639     *
8640     *@version 2009 December 16
8641     *
8642     *  @since Release 20101201
8643     *
8644     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8645     */
8646     public static double jauFaur03(double t)
8647     {
8648        double a;
8649 
8650 
8651     /* Mean longitude of Uranus (IERS Conventions 2003). */
8652        a = fmod(5.481293872 + 7.4781598567 * t, D2PI);
8653 
8654        return a;
8655 
8656         }
8657     
8658 
8659     /**
8660     *  Fundamental argument, IERS Conventions (2003):
8661     *  mean longitude of Venus.
8662     *
8663     *<p>This function is derived from the International Astronomical Union's
8664     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8665     *
8666     *<p>Status:  canonical model.
8667     *
8668     *<!-- Given: -->
8669     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8670     *
8671     * <!-- Returned (function value): -->
8672     *  @return double    mean longitude of Venus, radians (Note 2)
8673     *
8674     * <p>Notes:
8675     * <ol>
8676     *
8677     * <li> Though t is strictly TDB, it is usually more convenient to use
8678     *     TT, which makes no significant difference.
8679     *
8680     * <li> The expression used is as adopted in IERS Conventions (2003) and
8681     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8682     *</ol>
8683     *<p>References:
8684     *
8685     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8686     *     IERS Technical Note No. 32, BKG (2004)
8687     *
8688     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8689     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8690     *
8691     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8692     *     Astron.Astrophys.Supp.Ser. 135, 111
8693     *
8694     *@version 2009 December 16
8695     *
8696     *  @since Release 20101201
8697     *
8698     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8699     */
8700     public static double jauFave03(double t)
8701     {
8702        double a;
8703 
8704 
8705     /* Mean longitude of Venus (IERS Conventions 2003). */
8706        a = fmod(3.176146697 + 1021.3285546211 * t, D2PI);
8707 
8708        return a;
8709 
8710         }
8711     
8712 
8713     /**
8714     *  Transform FK5 (J2000.0) star data into the Hipparcos system.
8715     *
8716     *<p>This function is derived from the International Astronomical Union's
8717     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8718     *
8719     *<p>Status:  support function.
8720     *
8721     *  Given (all FK5, equinox J2000.0, epoch J2000.0):
8722     *    @param r5      double    RA (radians)
8723     *    @param d5      double    Dec (radians)
8724     *    @param dr5     double    proper motion in RA (dRA/dt, rad/Jyear)
8725     *    @param dd5     double    proper motion in Dec (dDec/dt, rad/Jyear)
8726     *    @param px5     double    parallax (arcsec)
8727     *    @param rv5     double    radial velocity (km/s, positive = receding)
8728     *
8729     *  Returned (all Hipparcos, epoch J2000.0):
8730     *  @return catalogue coordinates
8731     *
8732     * <p>Notes:
8733     * <ol>
8734     *
8735     * <li> This function transforms FK5 star positions and proper motions
8736     *     into the system of the Hipparcos catalog.
8737     *
8738     * <li> The proper motions in RA are dRA/dt rather than
8739     *     cos(Dec)*dRA/dt, and are per year rather than per century.
8740     *
8741     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8742     *     rotation and spin;  zonal errors in the FK5 catalog are not
8743     *     taken into account.
8744     *
8745     * <li> See also {@link #jauH2fk5}, {@link #jauFk5hz}, {@link #jauHfk5z}.
8746     *</ol>
8747     *<p>Called:<ul>
8748     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
8749     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8750     *     <li>{@link #jauRxp} product of r-matrix and p-vector
8751     *     <li>{@link #jauPxp} vector product of two p-vectors
8752     *     <li>{@link #jauPpp} p-vector plus p-vector
8753     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
8754     * </ul>
8755     *<p>Reference:
8756     *
8757     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8758     *
8759     *@version 2009 December 17
8760     *
8761     *  @since Release 20101201
8762     *
8763     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8764     */
8765     public static CatalogCoords jauFk52h(double r5, double d5,
8766                   double dr5, double dd5, double px5, double rv5)
8767     {
8768        int i;
8769        double pv5[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pvh[][] = new double[2][3];
8770 
8771 
8772     /* FK5 barycentric position/velocity pv-vector (normalized). */
8773        jauStarpv(r5, d5, dr5, dd5, px5, rv5, pv5);
8774 
8775     /* FK5 to Hipparcos orientation matrix and spin vector. */
8776        jauFk5hip(r5h, s5h);
8777 
8778     /* Make spin units per day instead of per year. */
8779        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
8780 
8781     /* Orient the FK5 position into the Hipparcos system. */
8782        pvh[0] = jauRxp(r5h, pv5[0]);
8783 
8784     /* Apply spin to the position giving an extra space motion component. */
8785        wxp = jauPxp(pv5[0],s5h);
8786 
8787     /* Add this component to the FK5 space motion. */
8788        vv = jauPpp(wxp, pv5[1]);
8789 
8790     /* Orient the FK5 space motion into the Hipparcos system. */
8791        pvh[1] = jauRxp(r5h, vv);
8792 
8793     /* Hipparcos pv-vector to spherical. */
8794        CatalogCoords cat = null;
8795        try {
8796            cat = jauPvstar(pvh);
8797        } catch (JSOFAInternalError e) {
8798            //original code ignored possibility of error too...
8799            e.printStackTrace();
8800        }
8801 
8802        return cat;
8803 
8804         }
8805     
8806 
8807     /**
8808     *  FK5 to Hipparcos rotation and spin.
8809     *
8810     *<p>This function is derived from the International Astronomical Union's
8811     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8812     *
8813     *<p>Status:  support function.
8814     *
8815     *<!-- Returned: -->
8816     *     @param r5h    double[3][3]    <u>returned</u> r-matrix: FK5 rotation wrt Hipparcos (Note 2)
8817     *     @param s5h    double[3]       <u>returned</u> r-vector: FK5 spin wrt Hipparcos (Note 3)
8818     *
8819     * <p>Notes:
8820     * <ol>
8821     *
8822     * <li> This function models the FK5 to Hipparcos transformation as a
8823     *     pure rotation and spin;  zonal errors in the FK5 catalogue are
8824     *     not taken into account.
8825     *
8826     * <li> The r-matrix r5h operates in the sense:
8827     *
8828     *           P_Hipparcos = r5h x P_FK5
8829     *
8830     *     where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is
8831     *     the equivalent Hipparcos p-vector.
8832     *
8833     * <li> The r-vector s5h represents the time derivative of the FK5 to
8834     *     Hipparcos rotation.  The units are radians per year (Julian,
8835     *     TDB).
8836     *</ol>
8837     *<p>Called:<ul>
8838     *     <li>{@link #jauRv2m} r-vector to r-matrix
8839     * </ul>
8840     *<p>Reference:
8841     *
8842     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8843     *
8844     *@version 2009 March 14
8845     *
8846     *  @since Release 20101201
8847     *
8848     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8849     */
8850     public static void jauFk5hip(double r5h[][], double s5h[] )
8851     {
8852        double v[] = new double[3];
8853 
8854     /* FK5 wrt Hipparcos orientation and spin (radians, radians/year) */
8855        double epx, epy, epz;
8856        double omx, omy, omz;
8857 
8858 
8859        epx = -19.9e-3 * DAS2R;
8860        epy =  -9.1e-3 * DAS2R;
8861        epz =  22.9e-3 * DAS2R;
8862 
8863        omx = -0.30e-3 * DAS2R;
8864        omy =  0.60e-3 * DAS2R;
8865        omz =  0.70e-3 * DAS2R;
8866 
8867     /* FK5 to Hipparcos orientation expressed as an r-vector. */
8868        v[0] = epx;
8869        v[1] = epy;
8870        v[2] = epz;
8871 
8872     /* Re-express as an r-matrix. */
8873        double[][] r5ht = jauRv2m(v);
8874        jauCr(r5ht, r5h);
8875 
8876     /* Hipparcos wrt FK5 spin expressed as an r-vector. */
8877        s5h[0] = omx;
8878        s5h[1] = omy;
8879        s5h[2] = omz;
8880 
8881        return;
8882 
8883         }
8884     
8885   /**
8886   * Position consisting of (&alpha;, &delta;) pairs in radians. Where &alpha; is right ascension (or longitude angle) and &delta; is declination (or latitude angle).
8887  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
8888  * 
8889  * @since AIDA Stage 1
8890  */
8891 public static class SphericalCoordinate {
8892       public double alpha;
8893       public double delta;
8894       public SphericalCoordinate(double alpha, double delta){
8895           this.alpha = alpha;
8896           this.delta = delta;
8897       }
8898   }
8899 
8900 /**
8901  * Spherical coordinate with equation of origins .
8902  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
8903  * @version $Revision$ $date$
8904  */
8905 public static class SphericalCoordinateEO {
8906     public SphericalCoordinate pos;
8907     public double eo;
8908     /**
8909      * @param pos the spherical position.
8910      * @param eo the equation of thr origins.
8911      */
8912     public SphericalCoordinateEO(SphericalCoordinate pos, double eo) {
8913         this.pos = pos;
8914         this.eo = eo;
8915     }
8916     
8917     
8918 }
8919     /**
8920     *  Transform an FK5 (J2000.0) star position into the system of the
8921     *  Hipparcos catalogue, assuming zero Hipparcos proper motion.
8922     *
8923     *<p>This function is derived from the International Astronomical Union's
8924     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8925     *
8926     *<p>Status:  support function.
8927     *
8928     *<!-- Given: -->
8929     *     @param r5            double    FK5 RA (radians), equinox J2000.0, at date
8930     *     @param d5            double    FK5 Dec (radians), equinox J2000.0, at date
8931     *     @param date1 double    TDB date (Notes 1,2)
8932     *     @param date2 double    TDB date (Notes 1,2) 
8933     *
8934     *<!-- Returned: -->
8935     *     @return rh            double     <u>returned</u> Hipparcos RA (radians)
8936     *             dh            double     <u>returned</u> Hipparcos Dec (radians)
8937     *
8938     * <p>Notes:
8939     * <ol>
8940     *
8941     * <li> This function converts a star position from the FK5 system to
8942     *     the Hipparcos system, in such a way that the Hipparcos proper
8943     *     motion is zero.  Because such a star has, in general, a non-zero
8944     *     proper motion in the FK5 system, the function requires the date
8945     *     at which the position in the FK5 system was determined.
8946     *
8947     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
8948     *     convenient way between the two arguments.  For example,
8949     *     JD(TT)=2450123.7 could be expressed in any of these ways,
8950     *     among others:
8951     *<pre>
8952     *            date1          date2
8953     *
8954     *         2450123.7           0.0       (JD method)
8955     *         2451545.0       -1421.3       (J2000 method)
8956     *         2400000.5       50123.2       (MJD method)
8957     *         2450123.5           0.2       (date &amp; time method)
8958     *</pre>
8959     *     The JD method is the most natural and convenient to use in
8960     *     cases where the loss of several decimal digits of resolution
8961     *     is acceptable.  The J2000 method is best matched to the way
8962     *     the argument is handled internally and will deliver the
8963     *     optimum resolution.  The MJD method and the date &amp; time methods
8964     *     are both good compromises between resolution and convenience.
8965     *
8966     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8967     *     rotation and spin;  zonal errors in the FK5 catalogue are not
8968     *     taken into account.
8969     *
8970     * <li> The position returned by this function is in the Hipparcos
8971     *     reference system but at date date1+date2.
8972     *
8973     * <li> See also jauFk52h, jauH2fk5, jauHfk5z.
8974     *</ol>
8975     *<p>Called:<ul>
8976     *     <li>{@link #jauS2c} spherical coordinates to unit vector
8977     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8978     *     <li>{@link #jauSxp} multiply p-vector by scalar
8979     *     <li>{@link #jauRv2m} r-vector to r-matrix
8980     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
8981     *     <li>{@link #jauPxp} vector product of two p-vectors
8982     *     <li>{@link #jauC2s} p-vector to spherical
8983     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
8984     * </ul>
8985     *<p>Reference:
8986     *
8987     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
8988     *
8989     *@version 2009 December 17
8990     *
8991     *  @since Release 20101201
8992     *
8993     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8994     */
8995     public static SphericalCoordinate jauFk5hz(double r5, double d5, double date1, double date2
8996                   )
8997     {
8998        double t, p5e[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], vst[] = new double[3], rst[][] = new double[3][3], p5[] = new double[3],
8999               ph[] = new double[3];
9000 
9001 
9002     /* Interval from given date to fundamental epoch J2000.0 (JY). */
9003        t = - ((date1 - DJ00) + date2) / DJY;
9004 
9005     /* FK5 barycentric position vector. */
9006        p5e = jauS2c(r5,d5);
9007 
9008     /* FK5 to Hipparcos orientation matrix and spin vector. */
9009        jauFk5hip(r5h, s5h);
9010 
9011     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
9012        vst = jauSxp(t,s5h);
9013 
9014     /* Express the accumulated spin as a rotation matrix. */
9015        rst = jauRv2m(vst);
9016 
9017     /* Derotate the vector's FK5 axes back to date. */
9018        p5 = jauTrxp(rst, p5e);
9019 
9020     /* Rotate the vector into the Hipparcos system. */
9021        ph = jauRxp(r5h, p5);
9022 
9023     /* Hipparcos vector to spherical. */
9024        SphericalCoordinate sc = jauC2s(ph);
9025        double rh = jauAnp(sc.alpha);
9026        sc.alpha = rh;
9027        
9028        return sc;
9029 
9030         }
9031     
9032 
9033     /**
9034     *  Form rotation matrix given the Fukushima-Williams angles.
9035     *
9036     *<p>This function is derived from the International Astronomical Union's
9037     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9038     *
9039     *<p>Status:  support function.
9040     *
9041     *<!-- Given: -->
9042     *     @param gamb      double          F-W angle gamma_bar (radians)
9043     *     @param phib      double          F-W angle phi_bar (radians)
9044     *     @param psi       double          F-W angle psi (radians)
9045     *     @param eps       double          F-W angle epsilon (radians)
9046     *
9047     *<!-- Returned: -->
9048     *     @return r         double[3][3]     <u>returned</u> rotation matrix
9049     *
9050     * <p>Notes:
9051     * <ol>
9052     *
9053     * <li> Naming the following points:
9054     *
9055     *           e = J2000.0 ecliptic pole,
9056     *           p = GCRS pole,
9057     *           E = ecliptic pole of date,
9058     *     and   P = CIP,
9059     *
9060     *     the four Fukushima-Williams angles are as follows:
9061     *
9062     *        gamb = gamma = epE
9063     *        phib = phi = pE
9064     *        psi = psi = pEP
9065     *        eps = epsilon = EP
9066     *
9067     * <li> The matrix representing the combined effects of frame bias,
9068     *     precession and nutation is:
9069     *
9070     *        NxPxB = R_1(-eps).R_3(-psi).R_1(phib).R_3(gamb)
9071     *
9072     * <li> Three different matrices can be constructed, depending on which angles are supplied as the arguments gamb,
9073     *      phib, psi and eps:
9074     *
9075     *     o  To obtain the nutation x precession x frame bias matrix,
9076     *        first generate the four precession angles known conventionally
9077     *        as gamma_bar, phi_bar, psi_bar and epsilon_A, then generate
9078     *        the nutation components Dpsi and Depsilon and add them to
9079     *        psi_bar and epsilon_A, and finally call the present function
9080     *        using those four angles as arguments.
9081     *
9082     *     o  To obtain the precession x frame bias matrix, generate the
9083     *        four precession angles and call the present function.
9084     *
9085     *     o  To obtain the frame bias matrix, generate the four precession
9086     *        angles for date J2000.0 and call the present function.
9087     *
9088     *     The nutation-only and precession-only matrices can if necessary
9089     *     be obtained by combining these three appropriately.
9090     *</ol>
9091     *<p>Called:<ul>
9092     *     <li>{@link #jauIr} initialize r-matrix to identity
9093     *     <li>{@link #jauRz} rotate around Z-axis
9094     *     <li>{@link #jauRx} rotate around X-axis
9095     * </ul>
9096     *<p>References:
9097     *
9098     *     Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
9099     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9100     *
9101     *@version 2020 November 13
9102     *
9103     *  @since Release 20101201
9104     *
9105     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9106     */
9107     public static double[][] jauFw2m(double gamb, double phib, double psi, double eps)
9108     {
9109     /* Construct the matrix. */
9110        double r[][] = new double[3][3];
9111        jauIr(r);
9112        jauRz(gamb, r);
9113        jauRx(phib, r);
9114        jauRz(-psi, r);
9115        jauRx(-eps, r);
9116 
9117        return r;
9118 
9119         }
9120     
9121 
9122     /**
9123     *  CIP X,Y given Fukushima-Williams bias-precession-nutation angles.
9124     *
9125     *<p>This function is derived from the International Astronomical Union's
9126     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9127     *
9128     *<p>Status:  support function.
9129     *
9130     *<!-- Given: -->
9131     *     @param gamb      double     F-W angle gamma_bar (radians)
9132     *     @param phib      double     F-W angle phi_bar (radians)
9133     *     @param psi       double     F-W angle psi (radians)
9134     *     @param eps       double     F-W angle epsilon (radians)
9135     *
9136     *<!-- Returned: -->
9137     *     @return CIP unit vector X,Y
9138     *
9139     * <p>Notes:
9140     * <ol>
9141     *
9142     * <li> Naming the following points:
9143     *
9144     *           e = J2000.0 ecliptic pole,
9145     *           p = GCRS pole
9146     *           E = ecliptic pole of date,
9147     *     and   P = CIP,
9148     *
9149     *     the four Fukushima-Williams angles are as follows:
9150     *
9151     *        gamb = gamma = epE
9152     *        phib = phi = pE
9153     *        psi = psi = pEP
9154     *        eps = epsilon = EP
9155     *
9156     * <li> The matrix representing the combined effects of frame bias,
9157     *     precession and nutation is:
9158     *
9159     *        NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
9160     *
9161     *       The returned values x,y are elements [2][0] and [2][1] of the
9162     *       matrix.  Near J2000.0, they are essentially angles in radians
9163     *       
9164     *     X,Y are elements (3,1) and (3,2) of the matrix.
9165     *</ol>
9166     *<p>Called:<ul>
9167     *     <li>{@link #jauFw2m} F-W angles to r-matrix
9168     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
9169     * </ul>
9170     *<p>Reference:
9171     *
9172     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9173     *
9174     *@version 2009 December 17
9175     *
9176     *  @since Release 20101201
9177     *
9178     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9179     */
9180     public static CelestialIntermediatePole jauFw2xy(double gamb, double phib, double psi, double eps)
9181     {
9182        double r[][] = new double[3][3];
9183 
9184 
9185     /* Form NxPxB matrix. */
9186        r = jauFw2m(gamb, phib, psi, eps);
9187 
9188     /* Extract CIP X,Y. */
9189        return jauBpn2xy(r);
9190 
9191     }
9192 
9193     /**
9194      * Geodetic coordinates.
9195      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
9196      * 
9197      * @since AIDA Stage 1
9198      */
9199     public static class GeodeticCoord {
9200         /** longitude (radians, east +ve) */
9201         public  double elong;
9202         /** latitude (geodetic, radians) */
9203         public double phi;
9204         /** height above ellipsoid (geodetic) */
9205         public double height;
9206         public GeodeticCoord(double elong, double phi, double height) {
9207             this.elong = elong;
9208             this.phi = phi;
9209             this.height = height;
9210         }
9211 }
9212     /**
9213     *  Transform geocentric coordinates to geodetic using the specified
9214     *  reference ellipsoid.
9215     *
9216     *<p>This function is derived from the International Astronomical Union's
9217     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9218     *
9219     *<p>Status:  canonical transformation.
9220     *
9221     *<!-- Given: -->
9222     *     @param n        int         ellipsoid identifier (Note 1)
9223     *     @param xyz      double[3]   geocentric vector (Note 2)
9224     *
9225     *<!-- Returned: -->
9226     *     @return elong    double       <u>returned</u> longitude (radians, east +ve)
9227     *             phi      double       <u>returned</u> latitude (geodetic, radians, Note 3)
9228     *             height   double       <u>returned</u> height above ellipsoid (geodetic, Notes 2,3)
9229     *
9230     * <!-- Returned (function value): -->
9231     *  @throws JSOFAIllegalParameter 0 = OK
9232     *                         -1 = illegal identifier (Note 3)
9233     *                         -2 = internal error (Note 3)
9234     *
9235     * <p>Notes:
9236     * <ol>
9237     *
9238     * <li> The identifier n is a number that specifies the choice of
9239     *     reference ellipsoid.  The following are supported:
9240     *
9241     *        n   ellipsoid
9242     *
9243     *        1    WGS84
9244     *        2    GRS80
9245     *
9246     *     The number n has no significance outside the JSOFA software.
9247     *
9248     * <li> The geocentric vector (xyz, given) and height (height, returned)
9249     *     are in meters.
9250     *
9251     * <li> An error status -1 means that the identifier n is illegal.  An
9252     *     error status -2 is theoretically impossible.  In all error cases,
9253     *     phi and height are both set to -1e9.
9254     *
9255     * <li> The inverse transformation is performed in the function jauGd2gc.
9256     *</ol>
9257     *<p>Called:<ul>
9258     *     <li>{@link #jauEform} Earth reference ellipsoids
9259     *     <li>{@link #jauGc2gde} geocentric to geodetic transformation, general
9260     * </ul>
9261     *@version 2010 January 18
9262     *
9263     *  @since Release 20101201
9264     *
9265     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9266     */
9267     public static GeodeticCoord jauGc2gd ( int n, double xyz[] ) throws JSOFAIllegalParameter
9268     {
9269       GeodeticCoord gc;
9270 
9271 
9272     /* Obtain reference ellipsoid parameters. */
9273        ReferenceEllipsoid el = jauEform ( n );
9274 
9275     /* If OK, transform x,y,z to longitude, geodetic latitude, height. */
9276        gc = jauGc2gde ( el.a, el.f, xyz);
9277 
9278     /* Return the status. */
9279        return gc;
9280 
9281     
9282     }
9283     
9284    /**
9285     *  Transform geocentric coordinates to geodetic for a reference
9286     *  ellipsoid of specified form.
9287     *
9288     *<p>This function is derived from the International Astronomical Union's
9289     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9290     *
9291     *<p>Status:  support function.
9292     *
9293     *<!-- Given: -->
9294     *     @param a        double      equatorial radius (Notes 2,4)
9295     *     @param f        double      flattening (Note 3)
9296     *     @param xyz      double[3]   geocentric vector (Note 4)
9297     *
9298     *<!-- Returned: -->
9299     *     @return GeodeticCoord   logitude  (radians, east +ve) latitude (geodetic, radians)  height above ellipsoid (geodetic, Note 4)
9300     *
9301     *  @throws JSOFAIllegalParameter int       status:
9302     *               
9303     *                         -1 = illegal a
9304     *                         -2 = illegal f
9305     *
9306     * <p>Notes:
9307     * <ol>
9308     *
9309     * <li> This function is based on the GCONV2H Fortran subroutine by
9310     *     Toshio Fukushima (see reference).
9311     *
9312     * <li> The equatorial radius, a, can be in any units, but meters is
9313     *     the conventional choice.
9314     *
9315     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9316     *     i.e. around 1/298.
9317     *
9318     * <li> The equatorial radius, a, and the geocentric vector, xyz,
9319     *     must be given in the same units, and determine the units of
9320     *     the returned height, height.
9321     *
9322     * <li> If an error occurs (status &lt; 0), elong, phi and height are
9323     *     unchanged.
9324     *
9325     * <li> The inverse transformation is performed in the function
9326     *     jauGd2gce.
9327     *
9328     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9329     *     more conveniently be performed by calling jauGc2gd, which uses a
9330     *     numerical code (1 for WGS84) to identify the required A and F
9331     *     values.
9332     *</ol>
9333     *<p>Reference:
9334     *
9335     *     Fukushima, T., "Transformation from Cartesian to geodetic
9336     *     coordinates accelerated by Halley's method", J.Geodesy (2006)
9337     *     79: 689-693
9338     *
9339     *@version 2009 November 2
9340     *
9341     *  @since Release 20101201
9342     *
9343     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9344  * 
9345     */
9346     public static GeodeticCoord jauGc2gde ( double a, double f, double xyz[] ) throws JSOFAIllegalParameter
9347         {
9348        double aeps2, e2, e4t, ec2, ec, b, x, y, z, p2, absz, p, s0, pn, zc,
9349                      c0, c02, c03, s02, s03, a02, a0, a03, d0, f0, b0, s1,
9350                      cc, s12, cc2;
9351 
9352       double  phi, height;
9353     /* ------------- */
9354     /* Preliminaries */
9355     /* ------------- */
9356 
9357     /* Validate ellipsoid parameters. */
9358        if ( f < 0.0 || f >= 1.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9359        if ( a <= 0.0 ) throw new JSOFAIllegalParameter("bad a", -2);
9360 
9361     /* Functions of ellipsoid parameters (with further validation of f). */
9362        aeps2 = a*a * 1e-32;
9363        e2 = (2.0 - f) * f;
9364        e4t = e2*e2 * 1.5;
9365        ec2 = 1.0 - e2;
9366        if ( ec2 <= 0.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9367        ec = sqrt(ec2);
9368        b = a * ec;
9369 
9370     /* Cartesian components. */
9371        x = xyz[0];
9372        y = xyz[1];
9373        z = xyz[2];
9374 
9375     /* Distance from polar axis squared. */
9376        p2 = x*x + y*y;
9377 
9378     /* Longitude. */
9379        double elong = p2 > 0.0 ? atan2(y, x) : 0.0;
9380 
9381     /* Unsigned z-coordinate. */
9382        absz = abs(z);
9383 
9384     /* Proceed unless polar case. */
9385        if ( p2 > aeps2 ) {
9386 
9387        /* Distance from polar axis. */
9388           p = sqrt(p2);
9389 
9390        /* Normalization. */
9391           s0 = absz / a;
9392           pn = p / a;
9393           zc = ec * s0;
9394 
9395        /* Prepare Newton correction factors. */
9396           c0 = ec * pn;
9397           c02 = c0 * c0;
9398           c03 = c02 * c0;
9399           s02 = s0 * s0;
9400           s03 = s02 * s0;
9401           a02 = c02 + s02;
9402           a0 = sqrt(a02);
9403           a03 = a02 * a0;
9404           d0 = zc*a03 + e2*s03;
9405           f0 = pn*a03 - e2*c03;
9406 
9407        /* Prepare Halley correction factor. */
9408           b0 = e4t * s02 * c02 * pn * (a0 - ec);
9409           s1 = d0*f0 - b0*s0;
9410           cc = ec * (f0*f0 - b0*c0);
9411 
9412        /* Evaluate latitude and height. */
9413           phi = atan(s1/cc);
9414           s12 = s1 * s1;
9415           cc2 = cc * cc;
9416           height = (p*cc + absz*s1 - a * sqrt(ec2*s12 + cc2)) /
9417                                                             sqrt(s12 + cc2);
9418        } else {
9419 
9420        /* Exception: pole. */
9421           phi = DPI / 2.0;
9422           height = absz - b;
9423        }
9424 
9425     /* Restore sign of latitude. */
9426        if ( z < 0 ) phi = -phi;
9427 
9428     /* OK status. */
9429        return new GeodeticCoord(elong, phi, height);
9430 
9431     
9432     }
9433     
9434 
9435     /**
9436     *  Transform geodetic coordinates to geocentric using the specified
9437     *  reference ellipsoid.
9438     *
9439     *<p>This function is derived from the International Astronomical Union's
9440     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9441     *
9442     *<p>Status:  canonical transformation.
9443     *
9444     *<!-- Given: -->
9445     *     @param n        int         ellipsoid identifier (Note 1)
9446     *     @param elong    double      longitude (radians, east +ve)
9447     *     @param phi      double      latitude (geodetic, radians, Note 3)
9448     *     @param height   double      height above ellipsoid (geodetic, Notes 2,3)
9449     *
9450     *<!-- Returned: -->
9451     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 2)
9452     *
9453     * <!-- Returned (function value): -->
9454     *  @throws JSOFAIllegalParameter    -1 = illegal identifier (Note 3)
9455     *                         -2 = illegal case (Note 3)
9456     *
9457     * <p>Notes:
9458     * <ol>
9459     *
9460     * <li> The identifier n is a number that specifies the choice of
9461     *     reference ellipsoid.  The following are supported:
9462     *
9463     *        n   ellipsoid
9464     *
9465     *        1    WGS84
9466     *        2    GRS80
9467     *
9468     *     The number n has no significance outside the JSOFA software.
9469     *
9470     * <li> The height (height, given) and the geocentric vector (xyz,
9471     *     returned) are in meters.
9472     *
9473     * <li> No validation is performed on the arguments elong, phi and
9474     *     height.  An error status -1 means that the identifier n is
9475     *     illegal.  An error status -2 protects against cases that would
9476     *     lead to arithmetic exceptions.  In all error cases, xyz is set
9477     *     to zeros.
9478     *
9479     * <li> The inverse transformation is performed in the function jauGc2gd.
9480     *</ol>
9481     *<p>Called:<ul>
9482     *     <li>{@link #jauEform} Earth reference ellipsoids
9483     *     <li>{@link #jauGd2gce} geodetic to geocentric transformation, general
9484     *     <li>{@link #jauZp} zero p-vector
9485     * </ul>
9486     *@version 2010 January 18
9487     *
9488     *  @since Release 20101201
9489     *
9490     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9491     */
9492     public static double[] jauGd2gc ( int n, double elong, double phi, double height ) throws JSOFAIllegalParameter, JSOFAInternalError
9493     {
9494 
9495 
9496     /* Obtain reference ellipsoid parameters. */
9497        ReferenceEllipsoid em = jauEform ( n );
9498 
9499     /* If OK, transform longitude, geodetic latitude, height to x,y,z. */
9500       return jauGd2gce ( em.a, em.f, elong, phi, height );
9501   
9502     
9503     }
9504     
9505 
9506     /**
9507     *  Transform geodetic coordinates to geocentric for a reference
9508     *  ellipsoid of specified form.
9509     *
9510     *<p>This function is derived from the International Astronomical Union's
9511     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9512     *
9513     *<p>Status:  support function.
9514     *
9515     *<!-- Given: -->
9516     *     @param a        double      equatorial radius (Notes 1,4)
9517     *     @param f        double      flattening (Notes 2,4)
9518     *     @param elong    double      longitude (radians, east +ve)
9519     *     @param phi      double      latitude (geodetic, radians, Note 4)
9520     *     @param height   double      height above ellipsoid (geodetic, Notes 3,4)
9521     *
9522     *<!-- Returned: -->
9523     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 3)
9524     *
9525     * <!-- Returned (function value): -->
9526     *  
9527     *  @throws JSOFAInternalError  0 = OK
9528     *                           -1 = illegal case (Note 4)
9529     * <p>Notes:
9530     * <ol>
9531     *
9532     * <li> The equatorial radius, a, can be in any units, but meters is
9533     *     the conventional choice.
9534     *
9535     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9536     *     i.e. around 1/298.
9537     *
9538     * <li> The equatorial radius, a, and the height, height, must be
9539     *     given in the same units, and determine the units of the
9540     *     returned geocentric vector, xyz.
9541     *
9542     * <li> No validation is performed on individual arguments.  The error
9543     *     status -1 protects against (unrealistic) cases that would lead
9544     *     to arithmetic exceptions.  If an error occurs, xyz is unchanged.
9545     *
9546     * <li> The inverse transformation is performed in the function
9547     *     jauGc2gde.
9548     *
9549     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9550     *     more conveniently be performed by calling jauGd2gc,  which uses a
9551     *     numerical code (1 for WGS84) to identify the required a and f
9552     *     values.
9553     *</ol>
9554     *<p>References:
9555     *
9556     *     <p>Green, R.M., Spherical Astronomy, Cambridge University Press,
9557     *     (1985) Section 4.5, p96.
9558     *
9559     *     <p>Explanatory Supplement to the Astronomical Almanac,
9560     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
9561     *     Section 4.22, p202.
9562     *
9563     *@version 2009 November 2
9564     *
9565     *  @since Release 20101201
9566     *
9567     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9568     */
9569     public static double[] jauGd2gce ( double a, double f, double elong, double phi,
9570                     double height ) throws JSOFAInternalError
9571     {
9572        double sp, cp, w, d, ac, as, r;
9573        double xyz[] = new double[3];
9574 
9575 
9576     /* Functions of geodetic latitude. */
9577        sp = sin(phi);
9578        cp = cos(phi);
9579        w = 1.0 - f;
9580        w = w * w;
9581        d = cp*cp + w*sp*sp;
9582        if ( d <= 0.0 ) throw new JSOFAInternalError("illegal combination of arguments d< 0", -1);
9583        ac = a / sqrt(d);
9584        as = w * ac;
9585 
9586     /* Geocentric vector. */
9587        r = (ac + height) * cp;
9588        xyz[0] = r * cos(elong);
9589        xyz[1] = r * sin(elong);
9590        xyz[2] = (as + height) * sp;
9591 
9592     /* Success. */
9593        return xyz;
9594 
9595     
9596     }
9597     
9598 
9599     /**
9600     *  Greenwich mean sidereal time (model consistent with IAU 2000
9601     *  resolutions).
9602     *
9603     *<p>This function is derived from the International Astronomical Union's
9604     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9605     *
9606     *<p>Status:  canonical model.
9607     *
9608     *<!-- Given: -->
9609     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9610     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9611     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9612     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9613     *
9614     * <!-- Returned (function value): -->
9615     *  @return double    Greenwich mean sidereal time (radians)
9616     *
9617     * <p>Notes:
9618     * <ol>
9619     *
9620     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9621     *     Julian Dates, apportioned in any convenient way between the
9622     *     argument pairs.  For example, JD(UT1)=2450123.7 could be expressed in
9623     *     any of these ways, among others:
9624     *<pre>
9625     *            Part A         Part B
9626     *
9627     *         2450123.7           0.0       (JD method)
9628     *         2451545.0       -1421.3       (J2000 method)
9629     *         2400000.5       50123.2       (MJD method)
9630     *         2450123.5           0.2       (date &amp; time method)
9631     *</pre>
9632     *     The JD method is the most natural and convenient to use in
9633     *     cases where the loss of several decimal digits of resolution
9634     *     is acceptable (in the case of UT;  the TT is not at all critical
9635     *     in this respect).  The J2000 and MJD methods are good compromises
9636     *     between resolution and convenience.  For UT, the date &amp; time
9637     *     method is best matched to the algorithm that is used by the Earth
9638     *     Rotation Angle function, called internally:  maximum precision is
9639     *     delivered when the uta argument is for 0hrs UT1 on the day in
9640     *     question and the utb argument lies in the range 0 to 1, or vice
9641     *     versa.
9642     *
9643     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9644     *     and TT to predict the effects of precession.  If UT1 is used for
9645     *     both purposes, errors of order 100 microarcseconds result.
9646     *
9647     * <li> This GMST is compatible with the IAU 2000 resolutions and must be
9648     *     used only in conjunction with other IAU 2000 compatible
9649     *     components such as precession-nutation and equation of the
9650     *     equinoxes.
9651     *
9652     * <li> The result is returned in the range 0 to 2pi.
9653     *
9654     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9655     *     Conventions 2003.
9656     *</ol>
9657     *<p>Called:<ul>
9658     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9659     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9660     * </ul>
9661     *<p>References:
9662     *
9663     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9664     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9665     *     Astrophysics, 406, 1135-1149 (2003)
9666     *
9667     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9668     *     IERS Technical Note No. 32, BKG (2004)
9669     *
9670     *@version 2009 March 16
9671     *
9672     *  @since Release 20101201
9673     *
9674     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9675     */
9676     public static double jauGmst00(double uta, double utb, double tta, double ttb)
9677     {
9678        double t, gmst;
9679 
9680 
9681     /* TT Julian centuries since J2000.0. */
9682        t = ((tta - DJ00) + ttb) / DJC;
9683 
9684     /* Greenwich Mean Sidereal Time, IAU 2000. */
9685        gmst = jauAnp(jauEra00(uta, utb) +
9686                        (     0.014506   +
9687                        (  4612.15739966 +
9688                        (     1.39667721 +
9689                        (    -0.00009344 +
9690                        (     0.00001882 )
9691               * t) * t) * t) * t) * DAS2R);
9692 
9693        return gmst;
9694 
9695         }
9696     
9697 
9698     /**
9699     *  Greenwich mean sidereal time (consistent with IAU 2006 precession).
9700     *
9701     *<p>This function is derived from the International Astronomical Union's
9702     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9703     *
9704     *<p>Status:  canonical model.
9705     *
9706     *<!-- Given: -->
9707     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9708     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9709     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9710     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9711     *
9712     * <!-- Returned (function value): -->
9713     *  @return double    Greenwich mean sidereal time (radians)
9714     *
9715     * <p>Notes:
9716     * <ol>
9717     *
9718     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9719     *     Julian Dates, apportioned in any convenient way between the
9720     *     argument pairs.  For example, JD(UT1)=450123.7 could be expressed in
9721     *     any of these ways, among others:
9722     *<pre>
9723     *            u1a              utb
9724     *
9725     *         2450123.7           0.0       (JD method)
9726     *         2451545.0       -1421.3       (J2000 method)
9727     *         2400000.5       50123.2       (MJD method)
9728     *         2450123.5           0.2       (date &amp; time method)
9729     *</pre>
9730     *     The JD method is the most natural and convenient to use in
9731     *     cases where the loss of several decimal digits of resolution
9732     *     is acceptable (in the case of UT;  the TT is not at all critical
9733     *     in this respect).  The J2000 and MJD methods are good compromises
9734     *     between resolution and convenience.  For UT, the date &amp; time
9735     *     method is best matched to the algorithm that is used by the Earth
9736     *     rotation angle function, called internally:  maximum precision is
9737     *     delivered when the uta argument is for 0hrs UT1 on the day in
9738     *     question and the utb argument lies in the range 0 to 1, or vice
9739     *     versa.
9740     *
9741     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9742     *     and TT to predict the effects of precession.  If UT1 is used for
9743     *     both purposes, errors of order 100 microarcseconds result.
9744     *
9745     * <li> This GMST is compatible with the IAU 2006 precession and must not
9746     *     be used with other precession models.
9747     *
9748     * <li> The result is returned in the range 0 to 2pi.
9749     *</ol>
9750     *<p>Called:<ul>
9751     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9752     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9753     * </ul>
9754     *<p>Reference:
9755     *
9756     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2005,
9757     *     Astron.Astrophys. 432, 355
9758     *
9759     *@version 2008 May 24
9760     *
9761     *  @since Release 20101201
9762     *
9763     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9764     */
9765     public static double jauGmst06(double uta, double utb, double tta, double ttb)
9766     {
9767        double t, gmst;
9768 
9769 
9770     /* TT Julian centuries since J2000.0. */
9771        t = ((tta - DJ00) + ttb) / DJC;
9772 
9773     /* Greenwich mean sidereal time, IAU 2006. */
9774        gmst = jauAnp(jauEra00(uta, utb) +
9775                       (    0.014506     +
9776                       (  4612.156534    +
9777                       (     1.3915817   +
9778                       (    -0.00000044  +
9779                       (    -0.000029956 +
9780                       (    -0.0000000368 )
9781               * t) * t) * t) * t) * t) * DAS2R);
9782 
9783        return gmst;
9784 
9785         }
9786     
9787 
9788     /**
9789     *  Universal Time to Greenwich mean sidereal time (IAU 1982 model).
9790     *
9791     *<p>This function is derived from the International Astronomical Union's
9792     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9793     *
9794     *<p>Status:  canonical model.
9795     *
9796     *<!-- Given: -->
9797     *     @param dj1 double     UT1 Julian Date (see note)
9798     *     @param dj2 double     UT1 Julian Date (see note) 
9799     *
9800     * <!-- Returned (function value): -->
9801     *  @return double    Greenwich mean sidereal time (radians)
9802     *
9803     * <p>Notes:
9804     * <ol>
9805     *
9806     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
9807     *     convenient way between the arguments dj1 and dj2.  For example,
9808     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
9809     *     among others:
9810     *<pre>
9811     *             dj1            dj2
9812     *
9813     *         2450123.7D0        0D0        (JD method)
9814     *          2451545D0      -1421.3D0     (J2000 method)
9815     *         2400000.5D0     50123.2D0     (MJD method)
9816     *         2450123.5D0       0.2D0       (date &amp; time method)
9817     *</pre>
9818     *     The JD method is the most natural and convenient to use in
9819     *     cases where the loss of several decimal digits of resolution
9820     *     is acceptable.  The J2000 and MJD methods are good compromises
9821     *     between resolution and convenience.  The date &amp; time method is
9822     *     best matched to the algorithm used:  maximum accuracy (or, at
9823     *     least, minimum noise) is delivered when the dj1 argument is for
9824     *     0hrs UT1 on the day in question and the dj2 argument lies in the
9825     *     range 0 to 1, or vice versa.
9826     *
9827     * <li> The algorithm is based on the IAU 1982 expression.  This is
9828     *     always described as giving the GMST at 0 hours UT1.  In fact, it
9829     *     gives the difference between the GMST and the UT, the steady
9830     *     4-minutes-per-day drawing-ahead of ST with respect to UT.  When
9831     *     whole days are ignored, the expression happens to equal the GMST
9832     *     at 0 hours UT1 each day.
9833     *
9834     * <li> In this function, the entire UT1 (the sum of the two arguments
9835     *     dj1 and dj2) is used directly as the argument for the standard
9836     *     formula, the constant term of which is adjusted by 12 hours to
9837     *     take account of the noon phasing of Julian Date.  The UT1 is then
9838     *     added, but omitting whole days to conserve accuracy.
9839     *</ol>
9840     *<p>Called:<ul>
9841     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9842     * </ul>
9843     *<p>References:
9844     *
9845     *     <p>Transactions of the International Astronomical Union,
9846     *     XVIII B, 67 (1983).
9847     *
9848     *     <p>Aoki et al., Astron. Astrophys. 105, 359-361 (1982).
9849     *
9850     *@version 2008 May 24
9851     *
9852     *  @since Release 20101201
9853     *
9854     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9855     */
9856     public static double jauGmst82(double dj1, double dj2)
9857     {
9858     /* Coefficients of IAU 1982 GMST-UT1 model */
9859        double A = 24110.54841  -  DAYSEC / 2.0;
9860        double B = 8640184.812866;
9861        double C = 0.093104;
9862        double D =  -6.2e-6;
9863 
9864     /* The first constant, A, has to be adjusted by 12 hours */
9865     /* because the UT1 is supplied as a Julian date, which begins  */
9866     /* at noon.                                                    */
9867 
9868        double d1, d2, t, f, gmst;
9869 
9870 
9871     /* Julian centuries since fundamental epoch. */
9872        if (dj1 < dj2) {
9873           d1 = dj1;
9874           d2 = dj2;
9875        } else {
9876           d1 = dj2;
9877           d2 = dj1;
9878        }
9879        t = (d1 + (d2 - DJ00)) / DJC;
9880 
9881     /* Fractional part of JD(UT1), in seconds. */
9882        f = DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
9883 
9884     /* GMST at this UT1. */
9885        gmst = jauAnp(DS2R * ((A + (B + (C + D * t) * t) * t) + f));
9886 
9887        return gmst;
9888 
9889         }
9890     
9891 
9892     /**
9893     *  Greenwich apparent sidereal time (consistent with IAU 2000
9894     *  resolutions).
9895     *
9896     *<p>This function is derived from the International Astronomical Union's
9897     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9898     *
9899     *<p>Status:  canonical model.
9900     *
9901     *<!-- Given: -->
9902     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9903     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9904     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9905     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9906     *
9907     * <!-- Returned (function value): -->
9908     *  @return double    Greenwich apparent sidereal time (radians)
9909     *
9910     * <p>Notes:
9911     * <ol>
9912     *
9913     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9914     *     Julian Dates, apportioned in any convenient way between the
9915     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9916     *     any of these ways, among others:
9917     *<pre>
9918     *            Part A        Part B
9919     *
9920     *         2450123.7           0.0       (JD method)
9921     *         2451545.0       -1421.3       (J2000 method)
9922     *         2400000.5       50123.2       (MJD method)
9923     *         2450123.5           0.2       (date &amp; time method)
9924     *</pre>
9925     *     The JD method is the most natural and convenient to use in
9926     *     cases where the loss of several decimal digits of resolution
9927     *     is acceptable (in the case of UT;  the TT is not at all critical
9928     *     in this respect).  The J2000 and MJD methods are good compromises
9929     *     between resolution and convenience.  For UT, the date &amp; time
9930     *     method is best matched to the algorithm that is used by the Earth
9931     *     Rotation Angle function, called internally:  maximum precision is
9932     *     delivered when the uta argument is for 0hrs UT1 on the day in
9933     *     question and the utb argument lies in the range 0 to 1, or vice
9934     *     versa.
9935     *
9936     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9937     *     and TT to predict the effects of precession-nutation.  If UT1 is
9938     *     used for both purposes, errors of order 100 microarcseconds
9939     *     result.
9940     *
9941     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
9942     *     used only in conjunction with other IAU 2000 compatible
9943     *     components such as precession-nutation.
9944     *
9945     * <li> The result is returned in the range 0 to 2pi.
9946     *
9947     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9948     *     Conventions 2003.
9949     *</ol>
9950     *<p>Called:<ul>
9951     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
9952     *     <li>{@link #jauEe00a} equation of the equinoxes, IAU 2000A
9953     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9954     * </ul>
9955     *<p>References:
9956     *
9957     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9958     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9959     *     Astrophysics, 406, 1135-1149 (2003)
9960     *
9961     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9962     *     IERS Technical Note No. 32, BKG (2004)
9963     *
9964     *@version 2008 May 16
9965     *
9966     *  @since Release 20101201
9967     *
9968     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9969     */
9970     public static double jauGst00a(double uta, double utb, double tta, double ttb)
9971     {
9972        double gmst00, ee00a, gst;
9973 
9974 
9975        gmst00 = jauGmst00(uta, utb, tta, ttb);
9976        ee00a = jauEe00a(tta, ttb);
9977        gst = jauAnp(gmst00 + ee00a);
9978 
9979        return gst;
9980 
9981         }
9982     
9983 
9984     /**
9985     *  Greenwich apparent sidereal time (consistent with IAU 2000
9986     *  resolutions but using the truncated nutation model IAU 2000B).
9987     *
9988     *<p>This function is derived from the International Astronomical Union's
9989     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9990     *
9991     *<p>Status:  support function.
9992     *
9993     *<!-- Given: -->
9994     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9995     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9996     *
9997     * <!-- Returned (function value): -->
9998     *  @return double    Greenwich apparent sidereal time (radians)
9999     *
10000     * <p>Notes:
10001     * <ol>
10002     *
10003     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
10004     *     convenient way between the argument pair.  For example,
10005     *     JD=2450123.7 could be expressed in any of these ways, among
10006     *     others:
10007     *<pre>
10008     *             uta            utb
10009     *
10010     *         2450123.7           0.0       (JD method)
10011     *         2451545.0       -1421.3       (J2000 method)
10012     *         2400000.5       50123.2       (MJD method)
10013     *         2450123.5           0.2       (date &amp; time method)
10014     *</pre>
10015     *     The JD method is the most natural and convenient to use in cases
10016     *     where the loss of several decimal digits of resolution is
10017     *     acceptable.  The J2000 and MJD methods are good compromises
10018     *     between resolution and convenience.  For UT, the date &amp; time
10019     *     method is best matched to the algorithm that is used by the Earth
10020     *     Rotation Angle function, called internally:  maximum precision is
10021     *     delivered when the uta argument is for 0hrs UT1 on the day in
10022     *     question and the utb argument lies in the range 0 to 1, or vice
10023     *     versa.
10024     *
10025     * <li> The result is compatible with the IAU 2000 resolutions, except
10026     *     that accuracy has been compromised for the sake of speed and
10027     *     convenience in two respects:
10028     *
10029     *     . UT is used instead of TDB (or TT) to compute the precession
10030     *       component of GMST and the equation of the equinoxes.  This
10031     *       results in errors of order 0.1 mas at present.
10032     *
10033     *     . The IAU 2000B abridged nutation model (McCarthy &amp; Luzum, 2003)
10034     *       is used, introducing errors of up to 1 mas.
10035     *
10036     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
10037     *     used only in conjunction with other IAU 2000 compatible
10038     *     components such as precession-nutation.
10039     *
10040     * <li> The result is returned in the range 0 to 2pi.
10041     *
10042     * <li> The algorithm is from Capitaine et al. (2003) and IERS
10043     *     Conventions 2003.
10044     *</ol>
10045     *<p>Called:<ul>
10046     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
10047     *     <li>{@link #jauEe00b} equation of the equinoxes, IAU 2000B
10048     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10049     * </ul>
10050     *<p>References:
10051     *
10052     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
10053     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
10054     *     Astrophysics, 406, 1135-1149 (2003)
10055     *
10056     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
10057     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
10058     *     Dynamical Astronomy, 85, 37-49 (2003)
10059     *
10060     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
10061     *     IERS Technical Note No. 32, BKG (2004)
10062     *
10063     *@version 2008 May 16
10064     *
10065     *  @since Release 20101201
10066     *
10067     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10068     */
10069     public static double jauGst00b(double uta, double utb)
10070     {
10071        double gmst00, ee00b, gst;
10072 
10073 
10074        gmst00 = jauGmst00(uta, utb, uta, utb);
10075        ee00b = jauEe00b(uta, utb);
10076        gst = jauAnp(gmst00 + ee00b);
10077 
10078        return gst;
10079 
10080         }
10081     
10082 
10083     /**
10084     *  Greenwich apparent sidereal time, IAU 2006, given the NPB matrix.
10085     *
10086     *<p>This function is derived from the International Astronomical Union's
10087     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10088     *
10089     *<p>Status:  support function.
10090     *
10091     *<!-- Given: -->
10092     *     @param uta double         UT1 as a 2-part Julian Date (Notes 1,2)
10093     *     @param utb double         UT1 as a 2-part Julian Date (Notes 1,2) 
10094     *     @param tta double         TT as a 2-part Julian Date (Notes 1,2)
10095     *     @param ttb double         TT as a 2-part Julian Date (Notes 1,2) 
10096     *     @param rnpb      double[3][3]   nutation x precession x bias matrix
10097     *
10098     * <!-- Returned (function value): -->
10099     *  @return double        Greenwich apparent sidereal time (radians)
10100     *
10101     * <p>Notes:
10102     * <ol>
10103     *
10104     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10105     *     Julian Dates, apportioned in any convenient way between the
10106     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10107     *     any of these ways, among others:
10108     *<pre>
10109     *            uta              utb
10110     *
10111     *         2450123.7           0.0       (JD method)
10112     *         2451545.0       -1421.3       (J2000 method)
10113     *         2400000.5       50123.2       (MJD method)
10114     *         2450123.5           0.2       (date &amp; time method)
10115     *</pre>
10116     *     The JD method is the most natural and convenient to use in
10117     *     cases where the loss of several decimal digits of resolution
10118     *     is acceptable (in the case of UT;  the TT is not at all critical
10119     *     in this respect).  The J2000 and MJD methods are good compromises
10120     *     between resolution and convenience.  For UT, the date &amp; time
10121     *     method is best matched to the algorithm that is used by the Earth
10122     *     rotation angle function, called internally:  maximum precision is
10123     *     delivered when the uta argument is for 0hrs UT1 on the day in
10124     *     question and the utb argument lies in the range 0 to 1, or vice
10125     *     versa.
10126     *
10127     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10128     *     and TT to predict the effects of precession-nutation.  If UT1 is
10129     *     used for both purposes, errors of order 100 microarcseconds
10130     *     result.
10131     *
10132     * <li> Although the function uses the IAU 2006 series for s+XY/2, it is
10133     *     otherwise independent of the precession-nutation model and can in
10134     *     practice be used with any equinox-based NPB matrix.
10135     *
10136     * <li> The result is returned in the range 0 to 2pi.
10137     *</ol>
10138     *<p>Called:<ul>
10139     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
10140     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
10141     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10142     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
10143     *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
10144     * </ul>
10145     *<p>Reference:
10146     *
10147     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10148     *
10149     *@version 2008 May 24
10150     *
10151     *  @since Release 20101201
10152     *
10153     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10154     */
10155     public static double jauGst06(double uta, double utb, double tta, double ttb,
10156                     double rnpb[][])
10157     {
10158        double s, era, eors, gst;
10159 
10160 
10161     /* Extract CIP coordinates. */
10162        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
10163 
10164     /* The CIO locator, s. */
10165        s = jauS06(tta, ttb, cip.x, cip.y);
10166 
10167     /* Greenwich apparent sidereal time. */
10168        era = jauEra00(uta, utb);
10169        eors = jauEors(rnpb, s);
10170        gst = jauAnp(era - eors);
10171 
10172        return gst;
10173 
10174         }
10175     
10176 
10177     /**
10178     *  Greenwich apparent sidereal time (consistent with IAU 2000 and 2006
10179     *  resolutions).
10180     *
10181     *<p>This function is derived from the International Astronomical Union's
10182     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10183     *
10184     *<p>Status:  canonical model.
10185     *
10186     *<!-- Given: -->
10187     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10188     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10189     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
10190     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
10191     *
10192     * <!-- Returned (function value): -->
10193     *  @return double    Greenwich apparent sidereal time (radians)
10194     *
10195     * <p>Notes:
10196     * <ol>
10197     *
10198     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10199     *     Julian Dates, apportioned in any convenient way between the
10200     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10201     *     any of these ways, among others:
10202     *<pre>
10203     *            uta             utb
10204     *
10205     *         2450123.7           0.0       (JD method)
10206     *         2451545.0       -1421.3       (J2000 method)
10207     *         2400000.5       50123.2       (MJD method)
10208     *         2450123.5           0.2       (date &amp; time method)
10209     *</pre>
10210     *     The JD method is the most natural and convenient to use in
10211     *     cases where the loss of several decimal digits of resolution
10212     *     is acceptable (in the case of UT;  the TT is not at all critical
10213     *     in this respect).  The J2000 and MJD methods are good compromises
10214     *     between resolution and convenience.  For UT, the date &amp; time
10215     *     method is best matched to the algorithm that is used by the Earth
10216     *     rotation angle function, called internally:  maximum precision is
10217     *     delivered when the uta argument is for 0hrs UT1 on the day in
10218     *     question and the utb argument lies in the range 0 to 1, or vice
10219     *     versa.
10220     *
10221     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10222     *     and TT to predict the effects of precession-nutation.  If UT1 is
10223     *     used for both purposes, errors of order 100 microarcseconds
10224     *     result.
10225     *
10226     * <li> This GAST is compatible with the IAU 2000/2006 resolutions and
10227     *     must be used only in conjunction with IAU 2006 precession and
10228     *     IAU 2000A nutation.
10229     *
10230     * <li> The result is returned in the range 0 to 2pi.
10231     *</ol>
10232     *<p>Called:<ul>
10233     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
10234     *     <li>{@link #jauGst06} Greenwich apparent ST, IAU 2006, given NPB matrix
10235     * </ul>
10236     *<p>Reference:
10237     *
10238     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10239     *
10240     *@version 2008 May 16
10241     *
10242     *  @since Release 20101201
10243     *
10244     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10245     */
10246     public static double jauGst06a(double uta, double utb, double tta, double ttb)
10247     {
10248        double rnpb[][], gst;
10249 
10250 
10251     /* Classical nutation x precession x bias matrix, IAU 2000A. */
10252        rnpb = jauPnm06a(tta, ttb);
10253 
10254     /* Greenwich apparent sidereal time. */
10255        gst = jauGst06(uta, utb, tta, ttb, rnpb);
10256 
10257        return gst;
10258 
10259         }
10260     
10261 
10262     /**
10263     *  Greenwich apparent sidereal time (consistent with IAU 1982/94
10264     *  resolutions).
10265     *
10266     *<p>This function is derived from the International Astronomical Union's
10267     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10268     *
10269     *<p>Status:  support function.
10270     *
10271     *<!-- Given: -->
10272     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10273     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10274     *
10275     * <!-- Returned (function value): -->
10276     *  @return double    Greenwich apparent sidereal time (radians)
10277     *
10278     * <p>Notes:
10279     * <ol>
10280     *
10281     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
10282     *     convenient way between the argument pair.  For example,
10283     *     JD=2450123.7 could be expressed in any of these ways, among
10284     *     others:
10285     *<pre>
10286     *             uta            utb
10287     *
10288     *         2450123.7           0.0       (JD method)
10289     *         2451545.0       -1421.3       (J2000 method)
10290     *         2400000.5       50123.2       (MJD method)
10291     *         2450123.5           0.2       (date &amp; time method)
10292     *</pre>
10293     *     The JD method is the most natural and convenient to use in cases
10294     *     where the loss of several decimal digits of resolution is
10295     *     acceptable.  The J2000 and MJD methods are good compromises
10296     *     between resolution and convenience.  For UT, the date &amp; time
10297     *     method is best matched to the algorithm that is used by the Earth
10298     *     Rotation Angle function, called internally:  maximum precision is
10299     *     delivered when the uta argument is for 0hrs UT1 on the day in
10300     *     question and the utb argument lies in the range 0 to 1, or vice
10301     *     versa.
10302     *
10303     * <li> The result is compatible with the IAU 1982 and 1994 resolutions,
10304     *     except that accuracy has been compromised for the sake of
10305     *     convenience in that UT is used instead of TDB (or TT) to compute
10306     *     the equation of the equinoxes.
10307     *
10308     * <li> This GAST must be used only in conjunction with contemporaneous
10309     *     IAU standards such as 1976 precession, 1980 obliquity and 1982
10310     *     nutation.  It is not compatible with the IAU 2000 resolutions.
10311     *
10312     * <li> The result is returned in the range 0 to 2pi.
10313     *</ol>
10314     *<p>Called:<ul>
10315     *     <li>{@link #jauGmst82} Greenwich mean sidereal time, IAU 1982
10316     *     <li>{@link #jauEqeq94} equation of the equinoxes, IAU 1994
10317     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10318     * </ul>
10319     *<p>References:
10320     *
10321     *     <p>Explanatory Supplement to the Astronomical Almanac,
10322     *     P. Kenneth Seidelmann (ed), University Science Books (1992)
10323     *
10324     *     IAU Resolution C7, Recommendation 3 (1994)
10325     *
10326     *@version 2008 May 16
10327     *
10328     *  @since Release 20101201
10329     *
10330     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10331     */
10332     public static double jauGst94(double uta, double utb)
10333     {
10334        double gmst82, eqeq94, gst;
10335 
10336 
10337        gmst82 = jauGmst82(uta, utb);
10338        eqeq94 = jauEqeq94(uta, utb);
10339        gst = jauAnp(gmst82  + eqeq94);
10340 
10341        return gst;
10342 
10343         }
10344     
10345 
10346     /**
10347     *  Transform Hipparcos star data into the FK5 (J2000.0) system.
10348     *
10349     *<p>This function is derived from the International Astronomical Union's
10350     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10351     *
10352     *<p>Status:  support function.
10353     *
10354     *  Given (all Hipparcos, epoch J2000.0):
10355     *    @param rh      double    RA (radians)
10356     *    @param dh      double    Dec (radians)
10357     *    @param drh     double    proper motion in RA (dRA/dt, rad/Jyear)
10358     *    @param ddh     double    proper motion in Dec (dDec/dt, rad/Jyear)
10359     *    @param pxh     double    parallax (arcsec)
10360     *    @param rvh     double    radial velocity (km/s, positive = receding)
10361     *
10362     *  @return cc CatalogCoords all FK5, equinox J2000.0, epoch J2000.0:
10363     *
10364     * <p>Notes:
10365     * <ol>
10366     *
10367     * <li> This function transforms Hipparcos star positions and proper
10368     *     motions into FK5 J2000.0.
10369     *
10370     * <li> The proper motions in RA are dRA/dt rather than
10371     *     cos(Dec)*dRA/dt, and are per year rather than per century.
10372     *
10373     * <li> The FK5 to Hipparcos transformation is modeled as a pure
10374     *     rotation and spin;  zonal errors in the FK5 catalog are not
10375     *     taken into account.
10376     *
10377     * <li> See also jauFk52h, jauFk5hz, jauHfk5z.
10378     *</ol>
10379     *<p>Called:<ul>
10380     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
10381     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10382     *     <li>{@link #jauRv2m} r-vector to r-matrix
10383     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10384     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10385     *     <li>{@link #jauPxp} vector product of two p-vectors
10386     *     <li>{@link #jauPmp} p-vector minus p-vector
10387     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
10388     * </ul>
10389     *<p>Reference:
10390     *
10391     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
10392     *
10393     *@version 2009 December 17
10394     *
10395     *  @since Release 20101201
10396     *
10397     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10398     */
10399     public static CatalogCoords jauH2fk5(double rh, double dh,
10400                   double drh, double ddh, double pxh, double rvh)
10401     {
10402        int i;
10403        double pvh[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pv5[][] = new double[2][3];
10404 
10405 
10406     /* Hipparcos barycentric position/velocity pv-vector (normalized). */
10407        jauStarpv(rh, dh, drh, ddh, pxh, rvh, pvh);
10408 
10409     /* FK5 to Hipparcos orientation matrix and spin vector. */
10410        jauFk5hip(r5h, s5h);
10411 
10412     /* Make spin units per day instead of per year. */
10413        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
10414 
10415     /* Orient the spin into the Hipparcos system. */
10416        sh = jauRxp(r5h, s5h);
10417 
10418     /* De-orient the Hipparcos position into the FK5 system. */
10419        pv5[0] = jauTrxp(r5h, pvh[0]);
10420 
10421     /* Apply spin to the position giving an extra space motion component. */
10422        wxp = jauPxp(pvh[0],sh);
10423 
10424     /* Subtract this component from the Hipparcos space motion. */
10425        vv = jauPmp(pvh[1], wxp);
10426 
10427     /* De-orient the Hipparcos space motion into the FK5 system. */
10428        pv5[1] = jauTrxp(r5h, vv);
10429 
10430     /* FK5 pv-vector to spherical., r5, d5, dr5, dd5, px5, rv5 */
10431        CatalogCoords cat = null;
10432        try {
10433            cat = jauPvstar(pv5);
10434        } catch (JSOFAInternalError e) {
10435            // original code just ignored this possibility
10436            e.printStackTrace();
10437        }
10438 
10439        return cat;
10440 
10441         }
10442     
10443 
10444     /**
10445     *  Transform a Hipparcos star position into FK5 J2000.0, assuming
10446     *  zero Hipparcos proper motion.
10447     *
10448     *<p>This function is derived from the International Astronomical Union's
10449     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10450     *
10451     *<p>Status:  support function.
10452     *
10453     *<!-- Given: -->
10454     *     @param rh             double     Hipparcos RA (radians)
10455     *     @param dh             double     Hipparcos Dec (radians)
10456     *     @param date1 double     TDB date (Note 1)
10457     *     @param date2 double     TDB date (Note 1) 
10458     *
10459     * FIXME original did not return the parallax and radial velocity of the CatalogCoords type.
10460     *  @return cc CatalogCoords (all FK5, equinox J2000.0, date date1+date2)
10461     *        RA (radians),  Dec (radians), FK5 RA proper motion (rad/year, Note 4), Dec proper motion (rad/year, Note 4)
10462     *
10463     * <p>Notes:
10464     * <ol>
10465     *
10466     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10467     *     convenient way between the two arguments.  For example,
10468     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10469     *     among others:
10470     *<pre>
10471     *            date1          date2
10472     *
10473     *         2450123.7           0.0       (JD method)
10474     *         2451545.0       -1421.3       (J2000 method)
10475     *         2400000.5       50123.2       (MJD method)
10476     *         2450123.5           0.2       (date &amp; time method)
10477     *</pre>
10478     *     The JD method is the most natural and convenient to use in
10479     *     cases where the loss of several decimal digits of resolution
10480     *     is acceptable.  The J2000 method is best matched to the way
10481     *     the argument is handled internally and will deliver the
10482     *     optimum resolution.  The MJD method and the date &amp; time methods
10483     *     are both good compromises between resolution and convenience.
10484     *
10485     * <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
10486     *
10487     * <li> The FK5 to Hipparcos transformation is modeled as a pure rotation
10488     *     and spin;  zonal errors in the FK5 catalogue are not taken into
10489     *     account.
10490     *
10491     * <li> It was the intention that Hipparcos should be a close
10492     *     approximation to an inertial frame, so that distant objects have
10493     *     zero proper motion;  such objects have (in general) non-zero
10494     *     proper motion in FK5, and this function returns those fictitious
10495     *     proper motions.
10496     *
10497     * <li> The position returned by this function is in the FK5 J2000.0
10498     *     reference system but at date date1+date2.
10499     *
10500     * <li> See also jauFk52h, jauH2fk5, jauFk5zhz.
10501     *</ol>
10502     *<p>Called:<ul>
10503     *     <li>{@link #jauS2c} spherical coordinates to unit vector
10504     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10505     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10506     *     <li>{@link #jauSxp} multiply p-vector by scalar
10507     *     <li>{@link #jauRxr} product of two r-matrices
10508     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10509     *     <li>{@link #jauPxp} vector product of two p-vectors
10510     *     <li>{@link #jauPv2s} pv-vector to spherical
10511     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10512     * </ul>
10513     *<p>Reference:
10514     *
10515     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
10516     *
10517     *@version 2009 December 17
10518     *
10519     *  @since Release 20101201
10520     *
10521     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10522     *
10523     */
10524     public static CatalogCoords jauHfk5z(double rh, double dh, double date1, double date2)
10525     {
10526        double t, ph[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], vst[] = new double[3],
10527        rst[][] = new double[3][3], r5ht[][] = new double[3][3], pv5e[][] = new double[2][3], vv[] = new double[3];
10528 
10529 
10530     /* Time interval from fundamental epoch J2000.0 to given date (JY). */
10531        t = ((date1 - DJ00) + date2) / DJY;
10532 
10533     /* Hipparcos barycentric position vector (normalized). */
10534        ph = jauS2c(rh,dh);
10535 
10536     /* FK5 to Hipparcos orientation matrix and spin vector. */
10537        jauFk5hip(r5h, s5h);
10538 
10539     /* Rotate the spin into the Hipparcos system. */
10540        sh = jauRxp(r5h, s5h);
10541 
10542     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
10543        vst = jauSxp(t,s5h);
10544 
10545     /* Express the accumulated spin as a rotation matrix. */
10546        rst = jauRv2m(vst);
10547 
10548     /* Rotation matrix:  accumulated spin, then FK5 to Hipparcos. */
10549        r5ht = jauRxr(r5h, rst);
10550 
10551     /* De-orient &amp; de-spin the Hipparcos position into FK5 J2000.0. */
10552        pv5e[0] = jauTrxp(r5ht, ph);
10553 
10554     /* Apply spin to the position giving a space motion. */
10555        vv = jauPxp(sh,ph);
10556 
10557     /* De-orient &amp; de-spin the Hipparcos space motion into FK5 J2000.0. */
10558        pv5e[1] = jauTrxp(r5ht, vv);
10559 
10560     /* FK5 position/velocity pv-vector to spherical. */
10561        SphericalPositionVelocity pvs = jauPv2s(pv5e);
10562        double r5 = jauAnp(pvs.pos.theta);
10563 
10564        return new CatalogCoords(r5, pvs.pos.phi, pvs.vel.theta, pvs.vel.phi, 0.0, 0.0);
10565 
10566         }
10567     
10568 
10569     /**
10570     *  Initialize an r-matrix to the identity matrix.
10571     *
10572     *<p>This function is derived from the International Astronomical Union's
10573     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10574     *
10575     *<p>Status:  vector/matrix support function.
10576     *
10577     *<!-- Returned: -->
10578     *     @param r        double[3][3]      <u>returned</u> r-matrix
10579     *
10580     *<p>Called:<ul>
10581     *     <li>{@link #jauZr} zero r-matrix
10582     * </ul>
10583     *@version 2008 May 11
10584     *
10585     *  @since Release 20101201
10586     *
10587     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10588     *  TODO - this would be better returning a new array in java....
10589     */
10590     public static void jauIr(double r[][])
10591     {
10592         jauZr(r);
10593         r[0][0] = 1.0;
10594         r[1][1] = 1.0;
10595         r[2][2] = 1.0;
10596 
10597         return;
10598 
10599     }
10600 
10601     /**
10602      * return a new r-matrix as the identity matrix.
10603      * This is a convenience method that is an 
10604      * overload of the official SOFA API {@link #jauIr(double[][])} that does not require 
10605      * the vector to be passed in.
10606      * @return r        double[3][3]  
10607      */
10608     public static double[][] jauIr()
10609     {
10610         double [][] r = new double[3][3];
10611         jauZr(r);
10612         return r ;
10613 
10614     }
10615 
10616 
10617     /**
10618     *  Julian Date to Gregorian year, month, day, and fraction of a day.
10619     *
10620     *<p>This function is derived from the International Astronomical Union's
10621     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10622     *
10623     *<p>Status:  support function.
10624     *
10625     *<!-- Given: -->
10626     *     @param dj1 double    Julian Date (Notes 1, 2)
10627     *     @param dj2 double    Julian Date (Notes 1, 2) 
10628     *
10629     *  Returned (arguments):
10630     *     iy        int      year
10631     *     im        int      month
10632     *     id        int      day
10633     *     fd        double   fraction of day
10634     *
10635     * <!-- Returned (function value): -->
10636     *  @return Calendar the date represented in Java. 
10637     *
10638     *@throws JSOFAIllegalParameter unacceptable date (Note 3)
10639     * <p>Notes:
10640     * <ol>
10641     *
10642     * <li> The earliest valid date is -68569.5 (-4900 March 1).  The
10643     *     largest value accepted is 10^9.
10644     *
10645     * <li> The Julian Date is apportioned in any convenient way between
10646     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10647     *     be expressed in any of these ways, among others:
10648     *<pre>
10649     *            dj1             dj2
10650     *
10651     *         2450123.7           0.0       (JD method)
10652     *         2451545.0       -1421.3       (J2000 method)
10653     *         2400000.5       50123.2       (MJD method)
10654     *         2450123.5           0.2       (date &amp; time method)
10655     *</pre>
10656     *     Separating integer and fraction uses the "compensated summation"
10657     *     algorithm of Kahan-Neumaier to preserve as much precision as
10658     *     possible irrespective of the jd1+jd2 apportionment.
10659     *     
10660     * <li> In early eras the conversion is from the "proleptic Gregorian
10661     *     calendar";  no account is taken of the date(s) of adoption of
10662     *     the Gregorian calendar, nor is the AD/BC numbering convention
10663     *     observed.
10664     *</ol>
10665     *<p>Reference:
10666     *
10667     *     <p>Explanatory Supplement to the Astronomical Almanac,
10668     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10669     *     Section 12.92 (p604).
10670     *     <p> Klein, A., A Generalized Kahan-Babuska-Summation-Algorithm.
10671     *         Computing 76, 279-293 (2006), Section 3.
10672     *
10673     *   @version 2020 Nov 13
10674     *
10675     *  @since Release 20101201
10676     *
10677     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10678     */
10679     public static Calendar jauJd2cal(double dj1, double dj2) throws JSOFAIllegalParameter
10680     {
10681         /* Minimum and maximum allowed JD */
10682         final double djmin = -68569.5;
10683         final double djmax = 1e9;
10684 
10685         long jd, i , l, n,  k;
10686         double dj, f1, f2, d, s, cs, v[]=new double[2], x, t, f;
10687 
10688 
10689         /* Verify date is acceptable. */
10690         dj = dj1 + dj2;
10691         if (dj < djmin || dj > djmax) throw new JSOFAIllegalParameter("input julian date out of range", -1);
10692 
10693         /* Separate day and fraction (where -0.5 <= fraction < 0.5). */
10694         d = dnint(dj1);
10695         f1 = dj1 - d;
10696         jd = (long) d;
10697         d = dnint(dj2);
10698         f2 = dj2 - d;
10699         jd += (long) d;
10700 
10701         /* Compute f1+f2+0.5 using compensated summation (Klein 2006). */
10702         s = 0.5;
10703         cs = 0.0;
10704         v[0] = f1;
10705         v[1] = f2;
10706         for ( int i1 = 0; i1 < 2; i1++ ) {
10707             x = v[i1];
10708             t = s + x;
10709             cs += abs(s) >= abs(x) ? (s-t) + x : (x-t) + s;
10710             s = t;
10711             if ( s >= 1.0 ) {
10712                 jd++;
10713                 s -= 1.0;
10714             }
10715         }
10716         f = s + cs;
10717         cs = f - s;
10718 
10719         /* Deal with negative f. */
10720         if ( f < 0.0 ) {
10721 
10722             /* Compensated summation: assume that |s| <= 1.0. */
10723             f = s + 1.0;
10724             cs += (1.0-f) + s;
10725             s  = f;
10726             f = s + cs;
10727             cs = f - s;
10728             jd--;
10729         }
10730 
10731         /* Deal with f that is 1.0 or more (when rounded to double). */
10732         if ( (f-1.0) >= -DBL_EPSILON/4.0 ) {
10733 
10734             /* Compensated summation: assume that |s| <= 1.0. */
10735             t = s - 1.0;
10736             cs += (s-t) - 1.0;
10737             s = t;
10738             f = s + cs;
10739             if ( -DBL_EPSILON/2.0 < f ) {
10740                 jd++;
10741                 f = gmax(f, 0.0);
10742             }
10743         }
10744 
10745         /* Express day in Gregorian calendar. */
10746        l = jd + 68569L;
10747        n = (4L * l) / 146097L;
10748        l -= (146097L * n + 3L) / 4L;
10749        i = (4000L * (l + 1L)) / 1461001L;
10750        l -= (1461L * i) / 4L - 31L;
10751        k = (80L * l) / 2447L;
10752        int id = (int) (l - (2447L * k) / 80L);
10753        l = k / 11L;
10754        int im = (int) (k + 2L - 12L * l);
10755        int iy = (int) (100L * (n - 49L) + i + l);
10756       
10757 
10758        return new Calendar(iy, im, id, f);
10759 
10760         }
10761      
10762     /**
10763      *  larger (most +ve) of two numbers (generic).
10764      * @param A
10765      * @param B
10766      * @return
10767      */
10768     private static double gmax(double A, double B) {
10769           return (((A)>(B))?(A):(B)) ;      
10770     }
10771 
10772     /**
10773     *  Julian Date to Gregorian Calendar, expressed in a form convenient
10774     *  for formatting messages:  rounded to a specified precision.
10775     *
10776     *<p>This function is derived from the International Astronomical Union's
10777     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10778     *
10779     *<p>Status:  support function.
10780     *
10781     *<!-- Given: -->
10782     *     @param ndp        int       number of decimal places of days in fraction
10783     *     @param dj1 double    dj1+dj2 = Julian Date (Note 1)
10784     *     @param dj2 double    dj1+dj2 = Julian Date (Note 1) 
10785     *
10786     *<!-- Returned: -->
10787     *     @param iymdf      int[4]     <u>returned</u> year, month, day, fraction in Gregorian calendar
10788     *
10789     *
10790     * <!-- Returned (function value): -->
10791     *  @return int      status:
10792     *                          -1 = date out of range
10793     *                           0 = OK
10794     *                          +1 = NDP not 0-9 (interpreted as 0)
10795     *
10796     * <p>Notes:
10797     * <ol>
10798     *
10799     * <li> The Julian Date is apportioned in any convenient way between
10800     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10801     *     be expressed in any of these ways, among others:
10802     *<pre>
10803     *             dj1            dj2
10804     *
10805     *         2450123.7           0.0       (JD method)
10806     *         2451545.0       -1421.3       (J2000 method)
10807     *         2400000.5       50123.2       (MJD method)
10808     *         2450123.5           0.2       (date &amp; time method)
10809     *</pre>
10810     * <li> In early eras the conversion is from the "Proleptic Gregorian
10811     *     Calendar";  no account is taken of the date(s) of adoption of
10812     *     the Gregorian Calendar, nor is the AD/BC numbering convention
10813     *     observed.
10814     *
10815     * <li> Refer to the function jauJd2cal.
10816     *
10817     * <li> the number of decimal places (npd) should be 4 or less if internal overflows are to be
10818     *     avoided on machines which use 16-bit integers.
10819     *</ol>
10820     *<p>Called:<ul>
10821     *     <li>{@link #jauJd2cal} JD to Gregorian calendar
10822     * </ul>
10823     *<p>Reference:
10824     *
10825     *     <p>Explanatory Supplement to the Astronomical Almanac,
10826     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10827     *     Section 12.92 (p604).
10828     *
10829     * @version 2020 Nov 13
10830     *
10831     *  @since Release 20101201
10832     *
10833     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10834     */
10835     public static int jauJdcalf(int ndp, double dj1, double dj2, int iymdf[])
10836     {
10837         int j;
10838         double denom, d1, d2, f1, f2, d, djd, f, rf;
10839 
10840 
10841         /* Denominator of fraction (e.g. 100 for 2 decimal places). */
10842         if ((ndp >= 0) && (ndp <= 9)) {
10843             j = 0;
10844             denom = pow(10.0, ndp);
10845         } else {
10846             j = 1;
10847             denom = 1.0;
10848         }
10849 
10850         /* Copy the date, big then small. */
10851         if (abs(dj1) >= abs(dj2)) {
10852             d1 = dj1;
10853             d2 = dj2;
10854         } else {
10855             d1 = dj2;
10856             d2 = dj1;
10857         }
10858 
10859         /* Realign to midnight (without rounding error). */
10860         d1 -= 0.5;
10861 
10862         /* Separate day and fraction (as precisely as possible). */
10863         d = dnint(d1);
10864         f1 = d1 - d;
10865         djd = d;
10866         d = dnint(d2);
10867         f2 = d2 - d;
10868         djd += d;
10869         d = dnint(f1 + f2);
10870         f = (f1 - d) + f2;
10871         if (f < 0.0) {
10872             f += 1.0;
10873             d -= 1.0;
10874         }
10875         djd += d;
10876 
10877         /* Round the total fraction to the specified number of places. */
10878         rf = dnint(f*denom) / denom;
10879 
10880         /* Re-align to noon. */
10881         djd += 0.5;
10882 
10883         /* Convert to Gregorian Calendar. */
10884         try {
10885             Calendar cal = jauJd2cal(djd, rf);
10886             iymdf[0] = cal.iy;
10887             iymdf[1] = cal.im;
10888             iymdf[2] = cal.id;
10889             iymdf[3] = (int) dnint(cal.fd * denom);
10890         } catch (JSOFAIllegalParameter e) {
10891             j = -1;
10892         }
10893 
10894         /* Return the status. */
10895         return j;
10896 
10897     }
10898     
10899 
10900     /**
10901     *  Form the matrix of nutation for a given date, IAU 2000A model.
10902     *
10903     *<p>This function is derived from the International Astronomical Union's
10904     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10905     *
10906     *<p>Status:  support function.
10907     *
10908     *<!-- Given: -->
10909     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10910     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10911     *
10912     *<!-- Returned: -->
10913     *     @return rmatn         double[3][3]      <u>returned</u> nutation matrix
10914     *
10915     * <p>Notes:
10916     * <ol>
10917     *
10918     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10919     *     convenient way between the two arguments.  For example,
10920     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10921     *     among others:
10922     *<pre>
10923     *            date1          date2
10924     *
10925     *         2450123.7           0.0       (JD method)
10926     *         2451545.0       -1421.3       (J2000 method)
10927     *         2400000.5       50123.2       (MJD method)
10928     *         2450123.5           0.2       (date &amp; time method)
10929     *</pre>
10930     *     The JD method is the most natural and convenient to use in
10931     *     cases where the loss of several decimal digits of resolution
10932     *     is acceptable.  The J2000 method is best matched to the way
10933     *     the argument is handled internally and will deliver the
10934     *     optimum resolution.  The MJD method and the date &amp; time methods
10935     *     are both good compromises between resolution and convenience.
10936     *
10937     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10938     *     the p-vector V(true) is with respect to the true equatorial triad
10939     *     of date and the p-vector V(mean) is with respect to the mean
10940     *     equatorial triad of date.
10941     *
10942     * <li> A faster, but slightly less accurate, result (about 1 mas), can be
10943     *     obtained by using instead the jauNum00b function.
10944     *</ol>
10945     *<p>Called:<ul>
10946     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
10947     * </ul>
10948     *<p>Reference:
10949     *
10950     *     <p>Explanatory Supplement to the Astronomical Almanac,
10951     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10952     *     Section 3.222-3 (p114).
10953     *
10954     *@version 2008 May 12
10955     *
10956     *  @since Release 20101201
10957     *
10958     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10959     */
10960     public static double[][] jauNum00a(double date1, double date2)
10961     {
10962 
10963     /* Obtain the required matrix (discarding other results). */
10964        PrecessionNutation pn = jauPn00a(date1, date2);
10965 
10966        return pn.rn ;
10967 
10968         }
10969     
10970 
10971     /**
10972     *  Form the matrix of nutation for a given date, IAU 2000B model.
10973     *
10974     *<p>This function is derived from the International Astronomical Union's
10975     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10976     *
10977     *<p>Status:  support function.
10978     *
10979     *<!-- Given: -->
10980     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10981     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10982     *
10983     *<!-- Returned: -->
10984     *     @return rmatn         double[3][3]     <u>returned</u> nutation matrix
10985     *
10986     * <p>Notes:
10987     * <ol>
10988     *
10989     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10990     *     convenient way between the two arguments.  For example,
10991     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10992     *     among others:
10993     *<pre>
10994     *            date1          date2
10995     *
10996     *         2450123.7           0.0       (JD method)
10997     *         2451545.0       -1421.3       (J2000 method)
10998     *         2400000.5       50123.2       (MJD method)
10999     *         2450123.5           0.2       (date &amp; time method)
11000     *</pre>
11001     *     The JD method is the most natural and convenient to use in
11002     *     cases where the loss of several decimal digits of resolution
11003     *     is acceptable.  The J2000 method is best matched to the way
11004     *     the argument is handled internally and will deliver the
11005     *     optimum resolution.  The MJD method and the date &amp; time methods
11006     *     are both good compromises between resolution and convenience.
11007     *
11008     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
11009     *     the p-vector V(true) is with respect to the true equatorial triad
11010     *     of date and the p-vector V(mean) is with respect to the mean
11011     *     equatorial triad of date.
11012     *
11013     * <li> The present function is faster, but slightly less accurate (about
11014     *     1 mas), than the jauNum00a function.
11015     *</ol>
11016     *<p>Called:<ul>
11017     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
11018     * </ul>
11019     *<p>Reference:
11020     *
11021     *     <p>Explanatory Supplement to the Astronomical Almanac,
11022     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11023     *     Section 3.222-3 (p114).
11024     *
11025     *@version 2008 May 12
11026     *
11027     *  @since Release 20101201
11028     *
11029     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11030     */
11031     public static double[][] jauNum00b(double date1, double date2)
11032     {
11033 
11034     /* Obtain the required matrix (discarding other results). */
11035        PrecessionNutation pn = jauPn00b(date1, date2);
11036  
11037        return pn.rn;
11038 
11039     }
11040     
11041 
11042     /**
11043     *  Form the matrix of nutation for a given date, IAU 2006/2000A model.
11044     *
11045     *<p>This function is derived from the International Astronomical Union's
11046     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11047     *
11048     *<p>Status:  support function.
11049     *
11050     *<!-- Given: -->
11051     *     @param date1 double TT as a 2-part Julian Date (Note 1)
11052     *     @param date2 double TT as a 2-part Julian Date (Note 1)
11053     *
11054     *<!-- Returned: -->
11055     *     @return rmatn          double[3][3]      <u>returned</u> nutation matrix
11056     *
11057     * <p>Notes:
11058     * <ol>
11059     *
11060     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
11061     *     convenient way between the two arguments.  For example,
11062     *     JD(TT)=2450123.7 could be expressed in any of these ways,
11063     *     among others:
11064     *<pre>
11065     *            date1          date2
11066     *
11067     *         2450123.7           0.0       (JD method)
11068     *         2451545.0       -1421.3       (J2000 method)
11069     *         2400000.5       50123.2       (MJD method)
11070     *         2450123.5           0.2       (date &amp; time method)
11071     *</pre>
11072     *     The JD method is the most natural and convenient to use in
11073     *     cases where the loss of several decimal digits of resolution
11074     *     is acceptable.  The J2000 method is best matched to the way
11075     *     the argument is handled internally and will deliver the
11076     *     optimum resolution.  The MJD method and the date &amp; time methods
11077     *     are both good compromises between resolution and convenience.
11078     *
11079     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
11080     *     the p-vector V(true) is with respect to the true equatorial triad
11081     *     of date and the p-vector V(mean) is with respect to the mean
11082     *     equatorial triad of date.
11083     *</ol>
11084     *<p>Called:<ul>
11085     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
11086     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
11087     *     <li>{@link #jauNumat} form nutation matrix
11088     * </ul>
11089     *<p>Reference:
11090     *
11091     *     <p>Explanatory Supplement to the Astronomical Almanac,
11092     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11093     *     Section 3.222-3 (p114).
11094     *
11095     *@version 2008 May 12
11096     *
11097     *  @since Release 20101201
11098     *
11099     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11100     */
11101     public static double[][] jauNum06a(double date1, double date2)
11102     {
11103        double eps, rmatn[][];
11104 
11105 
11106     /* Mean obliquity. */
11107        eps = jauObl06(date1, date2);
11108 
11109     /* Nutation components. */
11110        NutationTerms nut = jauNut06a(date1, date2);
11111 
11112     /* Nutation matrix. */
11113        rmatn = jauNumat(eps, nut.dpsi, nut.deps);
11114 
11115        return rmatn;
11116 
11117         }
11118     
11119 
11120     /**
11121     *  Form the matrix of nutation.
11122     *
11123     *<p>This function is derived from the International Astronomical Union's
11124     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11125     *
11126     *<p>Status:  support function.
11127     *
11128     *<!-- Given: -->
11129     *     @param epsa         double          mean obliquity of date (Note 1)
11130     *     @param dpsi double          nutation (Note 2)
11131     *     @param deps double          nutation (Note 2) 
11132     *
11133     *<!-- Returned: -->
11134     *     @return rmatn        double[3][3]     <u>returned</u> nutation matrix (Note 3)
11135     *
11136     * <p>Notes:
11137     * <ol>
11138     *
11139     *
11140     * <li> The supplied mean obliquity epsa, must be consistent with the
11141     *     precession-nutation models from which dpsi and deps were obtained.
11142     *
11143     * <li> The caller is responsible for providing the nutation components;
11144     *     they are in longitude and obliquity, in radians and are with
11145     *     respect to the equinox and ecliptic of date.
11146     *
11147     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
11148     *     where the p-vector V(true) is with respect to the true
11149     *     equatorial triad of date and the p-vector V(mean) is with
11150     *     respect to the mean equatorial triad of date.
11151     *</ol>
11152     *<p>Called:<ul>
11153     *     <li>{@link #jauIr} initialize r-matrix to identity
11154     *     <li>{@link #jauRx} rotate around X-axis
11155     *     <li>{@link #jauRz} rotate around Z-axis
11156     * </ul>
11157     *<p>Reference:
11158     *
11159     *     <p>Explanatory Supplement to the Astronomical Almanac,
11160     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11161     *     Section 3.222-3 (p114).
11162     *
11163     *@version 2008 May 11
11164     *
11165     *  @since Release 20101201
11166     *
11167     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11168     */
11169     public static double[][] jauNumat(double epsa, double dpsi, double deps)
11170     {
11171         double rmatn[][] = new double[3][3];
11172     /* Build the rotation matrix. */
11173        jauIr(rmatn);
11174        jauRx(epsa, rmatn);
11175        jauRz(-dpsi, rmatn);
11176        jauRx(-(epsa + deps), rmatn);
11177 
11178        return rmatn;
11179 
11180         }
11181     /**
11182      * Nutation Terms.
11183      *  .
11184      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
11185      * @version $Revision$ $date$
11186      */
11187     public static class NutationTerms {
11188         /**  nutation component in longitude  */
11189         public double dpsi;
11190         /**  nutation component in obliquity */
11191         public double deps;
11192         public NutationTerms(double dpsi, double deps) {
11193             this.dpsi = dpsi;
11194             this.deps = deps;
11195         }
11196     }
11197     private static final class NutationModel {
11198           int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
11199           double sp,spt,cp;     /* longitude sin, t*sin, cos coefficients */
11200           double ce,cet,se;     /* obliquity cos, t*cos, sin coefficients */
11201           public NutationModel(int nl,int nlp,int nf,int nd, int nom,
11202           double sp,double spt,double cp,     
11203           double ce,double cet,double se ) {
11204            this.nl = nl;
11205            this.nlp = nlp;
11206            this.nf = nf;
11207            this.nd = nd;
11208            this.nom = nom;
11209            this.sp = sp;
11210            this.spt = spt;
11211            this.cp = cp;
11212            this.ce = ce;
11213            this.cet = cet;
11214            this.se = se;
11215         }
11216        }
11217         private final static class PlanetaryNutModel {
11218          final int nl,               /* coefficients of l, F, D and Omega */
11219               nf,
11220               nd,
11221               nom,
11222               nme,              /* coefficients of planetary longitudes */
11223               nve,
11224               nea,
11225               nma,
11226               nju,
11227               nsa,
11228               nur,
11229               nne,
11230               npa;              /* coefficient of general precession */
11231           final int sp,cp;            /* longitude sin, cos coefficients */
11232           final int se,ce;            /* obliquity sin, cos coefficients */
11233           public PlanetaryNutModel(          int nl,               
11234                   int nf,
11235                   int nd,
11236                   int nom,
11237                   int nme,     
11238                   int nve,
11239                   int nea,
11240                   int nma,
11241                   int nju,
11242                   int nsa,
11243                   int nur,
11244                   int nne,
11245                   int npa,              
11246               int sp,int cp,           
11247               int se,int ce           
11248 ) {
11249               this.nl = nl;               /* coefficients of l, F, D and Omega */
11250               this.nf = nf;
11251               this.nd = nd;
11252               this.nom = nom;
11253               this.nme = nme;              /* coefficients of planetary longitudes */
11254               this.nve = nve;
11255               this.nea = nea;
11256               this.nma = nma;
11257               this.nju = nju;
11258               this.nsa = nsa;
11259               this.nur = nur;
11260               this.nne = nne;
11261               this.npa = npa;              /* coefficient of general precession */
11262            this.sp = sp; this.cp = cp;            /* longitude sin, cos coefficients */
11263            this.se = se; this.ce = ce;            /* obliquity sin, cos coefficients */
11264       
11265         }
11266        }
11267     /**
11268     *  Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation
11269     *  with free core nutation omitted).
11270     *
11271     *<p>This function is derived from the International Astronomical Union's
11272     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11273     *
11274     *<p>Status:  canonical model.
11275     *
11276     *<!-- Given: -->
11277     *     @param date1 double TT as a 2-part Julian Date (Note 1)
11278     *     @param date2 double TT as a 2-part Julian Date (Note 1)
11279     *
11280     *<!-- Returned: -->
11281     *     @return    <u>returned</u> nutation, luni-solar + planetary (Note 2)
11282     *
11283     * <p>Notes:
11284     * <ol>
11285     *
11286     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
11287     *     convenient way between the two arguments.  For example,
11288     *     JD(TT)=2450123.7 could be expressed in any of these ways,
11289     *     among others:
11290     *<pre>
11291     *            date1          date2
11292     *
11293     *         2450123.7           0.0       (JD method)
11294     *         2451545.0       -1421.3       (J2000 method)
11295     *         2400000.5       50123.2       (MJD method)
11296     *         2450123.5           0.2       (date &amp; time method)
11297     *</pre>
11298     *     The JD method is the most natural and convenient to use in
11299     *     cases where the loss of several decimal digits of resolution
11300     *     is acceptable.  The J2000 method is best matched to the way
11301     *     the argument is handled internally and will deliver the
11302     *     optimum resolution.  The MJD method and the date &amp; time methods
11303     *     are both good compromises between resolution and convenience.
11304     *
11305     * <li> The nutation components in longitude and obliquity are in radians
11306     *     and with respect to the equinox and ecliptic of date.  The
11307     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
11308     *     value of 84381.448 arcsec.
11309     *
11310     *     Both the luni-solar and planetary nutations are included.  The
11311     *     latter are due to direct planetary nutations and the
11312     *     perturbations of the lunar and terrestrial orbits.
11313     *
11314     * <li> The function computes the MHB2000 nutation series with the
11315     *     associated corrections for planetary nutations.  It is an
11316     *     implementation of the nutation part of the IAU 2000A precession-
11317     *     nutation model, formally adopted by the IAU General Assembly in
11318     *     2000, namely MHB2000 (Mathews et al. 2002), but with the free
11319     *     core nutation (FCN - see Note 4) omitted.
11320     *
11321     * <li> The full MHB2000 model also contains contributions to the
11322     *     nutations in longitude and obliquity due to the free-excitation
11323     *     of the free-core-nutation during the period 1979-2000.  These FCN
11324     *     terms, which are time-dependent and unpredictable, are NOT
11325     *     included in the present function and, if required, must be
11326     *     independently computed.  With the FCN corrections included, the
11327     *     present function delivers a pole which is at current epochs
11328     *     accurate to a few hundred microarcseconds.  The omission of FCN
11329     *     introduces further errors of about that size.
11330     *
11331     * <li> The present function provides classical nutation.  The MHB2000
11332     *     algorithm, from which it is adapted, deals also with (i) the
11333     *     offsets between the GCRS and mean poles and (ii) the adjustments
11334     *     in longitude and obliquity due to the changed precession rates.
11335     *     These additional functions, namely frame bias and precession
11336     *     adjustments, are supported by the JSOFA functions jauBi00  and
11337     *     jauPr00.
11338     *
11339     * <li> The MHB2000 algorithm also provides "total" nutations, comprising
11340     *     the arithmetic sum of the frame bias, precession adjustments,
11341     *     luni-solar nutation and planetary nutation.  These total
11342     *     nutations can be used in combination with an existing IAU 1976
11343     *     precession implementation, such as jauPmat76,  to deliver GCRS-
11344     *     to-true predictions of sub-mas accuracy at current dates.
11345     *     However, there are three shortcomings in the MHB2000 model that
11346     *     must be taken into account if more accurate or definitive results
11347     *     are required (see Wallace 2002):
11348     *
11349     *       (i) The MHB2000 total nutations are simply arithmetic sums,
11350     *           yet in reality the various components are successive Euler
11351     *           rotations.  This slight lack of rigor leads to cross terms
11352     *           that exceed 1 mas after a century.  The rigorous procedure
11353     *           is to form the GCRS-to-true rotation matrix by applying the
11354     *           bias, precession and nutation in that order.
11355     *
11356     *      (ii) Although the precession adjustments are stated to be with
11357     *           respect to Lieske et al. (1977), the MHB2000 model does
11358     *           not specify which set of Euler angles are to be used and
11359     *           how the adjustments are to be applied.  The most literal
11360     *           and straightforward procedure is to adopt the 4-rotation
11361     *           epsilon_0, psi_A, omega_A, xi_A option, and to add DPSIPR
11362     *           to psi_A and DEPSPR to both omega_A and eps_A.
11363     *
11364     *     (iii) The MHB2000 model predates the determination by Chapront
11365     *           et al. (2002) of a 14.6 mas displacement between the
11366     *           J2000.0 mean equinox and the origin of the ICRS frame.  It
11367     *           should, however, be noted that neglecting this displacement
11368     *           when calculating star coordinates does not lead to a
11369     *           14.6 mas change in right ascension, only a small second-
11370     *           order distortion in the pattern of the precession-nutation
11371     *           effect.
11372     *
11373     *     For these reasons, the JSOFA functions do not generate the "total
11374     *     nutations" directly, though they can of course easily be
11375     *     generated by calling jauBi00, jauPr00 and the present function
11376     *     and adding the results.
11377     *
11378     * <li> The MHB2000 model contains 41 instances where the same frequency
11379     *     appears multiple times, of which 38 are duplicates and three are
11380     *     triplicates.  To keep the present code close to the original MHB
11381     *     algorithm, this small inefficiency has not been corrected.
11382     *</ol>
11383     *<p>Called:<ul>
11384     *     <li>{@link #jauFal03} mean anomaly of the Moon
11385     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
11386     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
11387     *     <li>{@link #jauFame03} mean longitude of Mercury
11388     *     <li>{@link #jauFave03} mean longitude of Venus
11389     *     <li>{@link #jauFae03} mean longitude of Earth
11390     *     <li>{@link #jauFama03} mean longitude of Mars
11391     *     <li>{@link #jauFaju03} mean longitude of Jupiter
11392     *     <li>{@link #jauFasa03} mean longitude of Saturn
11393     *     <li>{@link #jauFaur03} mean longitude of Uranus
11394     *     <li>{@link #jauFapa03} general accumulated precession in longitude
11395     * </ul>
11396     *<p>References:
11397     *
11398     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
11399     *     Astron.Astrophys. 387, 700
11400     *
11401     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
11402     *     Astron.Astrophys. 58, 1-16
11403     *
11404     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
11405     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
11406     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
11407     *
11408     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
11409     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
11410     *
11411     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
11412     *     Astron.Astrophys.Supp.Ser. 135, 111
11413     *
11414     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
11415     *     Resolutions", in IERS Workshop 5.1 (2002)
11416     *
11417     *@version 2009 December 17
11418     *
11419     *  @since Release 20101201
11420     *
11421     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11422     */
11423     public static NutationTerms jauNut00a(double date1, double date2 )
11424     {
11425        int i;
11426        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
11427               al, af, ad, aom, alme, alve, alea, alma,
11428               alju, alsa, alur, alne, apa, dpsils, depsls,
11429               dpsipl, depspl;
11430 
11431     /* Units of 0.1 microarcsecond to radians */
11432        final double U2R = DAS2R / 1e7;
11433 
11434     /* ------------------------- */
11435     /* Luni-Solar nutation model */
11436     /* ------------------------- */
11437 
11438     /* The units for the sine and cosine coefficients are */
11439     /* 0.1 microarcsecond and the same per Julian century */
11440 
11441        
11442        NutationModel xls[] = {
11443 
11444        /* 1- 10 */
11445           new NutationModel( 0, 0, 0, 0, 1,
11446              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
11447           new NutationModel( 0, 0, 2,-2, 2,
11448                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
11449           new NutationModel( 0, 0, 2, 0, 2,-2276413.0,-234.0,2796.0,978459.0,-485.0, 1374.0),
11450           new NutationModel( 0, 0, 0, 0, 2,2074554.0, 207.0, -698.0,-897492.0,470.0, -291.0),
11451           new NutationModel( 0, 1, 0, 0, 0,1475877.0,-3633.0,11817.0,73871.0,-184.0,-1924.0),
11452           new NutationModel( 0, 1, 2,-2, 2,-516821.0,1226.0, -524.0,224386.0,-677.0, -174.0),
11453           new NutationModel( 1, 0, 0, 0, 0, 711159.0,  73.0, -872.0,  -6750.0,  0.0,  358.0),
11454           new NutationModel( 0, 0, 2, 0, 1,-387298.0,-367.0,  380.0, 200728.0, 18.0,  318.0),
11455           new NutationModel( 1, 0, 2, 0, 2,-301461.0, -36.0,  816.0, 129025.0,-63.0,  367.0),
11456           new NutationModel( 0,-1, 2,-2, 2, 215829.0,-494.0,  111.0, -95929.0,299.0,  132.0),
11457 
11458        /* 11-20 */
11459           new NutationModel( 0, 0, 2,-2, 1, 128227.0, 137.0,  181.0, -68982.0, -9.0,   39.0),
11460           new NutationModel(-1, 0, 2, 0, 2, 123457.0,  11.0,   19.0, -53311.0, 32.0,   -4.0),
11461           new NutationModel(-1, 0, 0, 2, 0, 156994.0,  10.0, -168.0,  -1235.0,  0.0,   82.0),
11462           new NutationModel( 1, 0, 0, 0, 1,  63110.0,  63.0,   27.0, -33228.0,  0.0,   -9.0),
11463           new NutationModel(-1, 0, 0, 0, 1, -57976.0, -63.0, -189.0,  31429.0,  0.0,  -75.0),
11464           new NutationModel(-1, 0, 2, 2, 2, -59641.0, -11.0,  149.0,  25543.0,-11.0,   66.0),
11465           new NutationModel( 1, 0, 2, 0, 1, -51613.0, -42.0,  129.0,  26366.0,  0.0,   78.0),
11466           new NutationModel(-2, 0, 2, 0, 1,  45893.0,  50.0,   31.0, -24236.0,-10.0,   20.0),
11467           new NutationModel( 0, 0, 0, 2, 0,  63384.0,  11.0, -150.0,  -1220.0,  0.0,   29.0),
11468           new NutationModel( 0, 0, 2, 2, 2, -38571.0,  -1.0,  158.0,  16452.0,-11.0,   68.0),
11469 
11470        /* 21-30 */
11471           new NutationModel( 0,-2, 2,-2, 2,  32481.0,   0.0,    0.0, -13870.0,  0.0,    0.0),
11472           new NutationModel(-2, 0, 0, 2, 0, -47722.0,   0.0,  -18.0,    477.0,  0.0,  -25.0),
11473           new NutationModel( 2, 0, 2, 0, 2, -31046.0,  -1.0,  131.0,  13238.0,-11.0,   59.0),
11474           new NutationModel( 1, 0, 2,-2, 2,  28593.0,   0.0,   -1.0, -12338.0, 10.0,   -3.0),
11475           new NutationModel(-1, 0, 2, 0, 1,  20441.0,  21.0,   10.0, -10758.0,  0.0,   -3.0),
11476           new NutationModel( 2, 0, 0, 0, 0,  29243.0,   0.0,  -74.0,   -609.0,  0.0,   13.0),
11477           new NutationModel( 0, 0, 2, 0, 0,  25887.0,   0.0,  -66.0,   -550.0,  0.0,   11.0),
11478           new NutationModel( 0, 1, 0, 0, 1, -14053.0, -25.0,   79.0,   8551.0, -2.0,  -45.0),
11479           new NutationModel(-1, 0, 0, 2, 1,  15164.0,  10.0,   11.0,  -8001.0,  0.0,   -1.0),
11480           new NutationModel( 0, 2, 2,-2, 2, -15794.0,  72.0,  -16.0,   6850.0,-42.0,   -5.0),
11481 
11482        /* 31-40 */
11483           new NutationModel( 0, 0,-2, 2, 0,  21783.0,   0.0,   13.0,   -167.0,  0.0,   13.0),
11484           new NutationModel( 1, 0, 0,-2, 1, -12873.0, -10.0,  -37.0,   6953.0,  0.0,  -14.0),
11485           new NutationModel( 0,-1, 0, 0, 1, -12654.0,  11.0,   63.0,   6415.0,  0.0,   26.0),
11486           new NutationModel(-1, 0, 2, 2, 1, -10204.0,   0.0,   25.0,   5222.0,  0.0,   15.0),
11487           new NutationModel( 0, 2, 0, 0, 0,  16707.0, -85.0,  -10.0,    168.0, -1.0,   10.0),
11488           new NutationModel( 1, 0, 2, 2, 2,  -7691.0,   0.0,   44.0,   3268.0,  0.0,   19.0),
11489           new NutationModel(-2, 0, 2, 0, 0, -11024.0,   0.0,  -14.0,    104.0,  0.0,    2.0),
11490           new NutationModel( 0, 1, 2, 0, 2,   7566.0, -21.0,  -11.0,  -3250.0,  0.0,   -5.0),
11491           new NutationModel( 0, 0, 2, 2, 1,  -6637.0, -11.0,   25.0,   3353.0,  0.0,   14.0),
11492           new NutationModel( 0,-1, 2, 0, 2,  -7141.0,  21.0,    8.0,   3070.0,  0.0,    4.0),
11493 
11494        /* 41-50 */
11495           new NutationModel( 0, 0, 0, 2, 1,  -6302.0, -11.0,    2.0,   3272.0,  0.0,    4.0),
11496           new NutationModel( 1, 0, 2,-2, 1,   5800.0,  10.0,    2.0,  -3045.0,  0.0,   -1.0),
11497           new NutationModel( 2, 0, 2,-2, 2,   6443.0,   0.0,   -7.0,  -2768.0,  0.0,   -4.0),
11498           new NutationModel(-2, 0, 0, 2, 1,  -5774.0, -11.0,  -15.0,   3041.0,  0.0,   -5.0),
11499           new NutationModel( 2, 0, 2, 0, 1,  -5350.0,   0.0,   21.0,   2695.0,  0.0,   12.0),
11500           new NutationModel( 0,-1, 2,-2, 1,  -4752.0, -11.0,   -3.0,   2719.0,  0.0,   -3.0),
11501           new NutationModel( 0, 0, 0,-2, 1,  -4940.0, -11.0,  -21.0,   2720.0,  0.0,   -9.0),
11502           new NutationModel(-1,-1, 0, 2, 0,   7350.0,   0.0,   -8.0,    -51.0,  0.0,    4.0),
11503           new NutationModel( 2, 0, 0,-2, 1,   4065.0,   0.0,    6.0,  -2206.0,  0.0,    1.0),
11504           new NutationModel( 1, 0, 0, 2, 0,   6579.0,   0.0,  -24.0,   -199.0,  0.0,    2.0),
11505 
11506        /* 51-60 */
11507           new NutationModel( 0, 1, 2,-2, 1,   3579.0,   0.0,    5.0,  -1900.0,  0.0,    1.0),
11508           new NutationModel( 1,-1, 0, 0, 0,   4725.0,   0.0,   -6.0,    -41.0,  0.0,    3.0),
11509           new NutationModel(-2, 0, 2, 0, 2,  -3075.0,   0.0,   -2.0,   1313.0,  0.0,   -1.0),
11510           new NutationModel( 3, 0, 2, 0, 2,  -2904.0,   0.0,   15.0,   1233.0,  0.0,    7.0),
11511           new NutationModel( 0,-1, 0, 2, 0,   4348.0,   0.0,  -10.0,    -81.0,  0.0,    2.0),
11512           new NutationModel( 1,-1, 2, 0, 2,  -2878.0,   0.0,    8.0,   1232.0,  0.0,    4.0),
11513           new NutationModel( 0, 0, 0, 1, 0,  -4230.0,   0.0,    5.0,    -20.0,  0.0,   -2.0),
11514           new NutationModel(-1,-1, 2, 2, 2,  -2819.0,   0.0,    7.0,   1207.0,  0.0,    3.0),
11515           new NutationModel(-1, 0, 2, 0, 0,  -4056.0,   0.0,    5.0,     40.0,  0.0,   -2.0),
11516           new NutationModel( 0,-1, 2, 2, 2,  -2647.0,   0.0,   11.0,   1129.0,  0.0,    5.0),
11517 
11518        /* 61-70 */
11519           new NutationModel(-2, 0, 0, 0, 1,  -2294.0,   0.0,  -10.0,   1266.0,  0.0,   -4.0),
11520           new NutationModel( 1, 1, 2, 0, 2,   2481.0,   0.0,   -7.0,  -1062.0,  0.0,   -3.0),
11521           new NutationModel( 2, 0, 0, 0, 1,   2179.0,   0.0,   -2.0,  -1129.0,  0.0,   -2.0),
11522           new NutationModel(-1, 1, 0, 1, 0,   3276.0,   0.0,    1.0,     -9.0,  0.0,    0.0),
11523           new NutationModel( 1, 1, 0, 0, 0,  -3389.0,   0.0,    5.0,     35.0,  0.0,   -2.0),
11524           new NutationModel( 1, 0, 2, 0, 0,   3339.0,   0.0,  -13.0,   -107.0,  0.0,    1.0),
11525           new NutationModel(-1, 0, 2,-2, 1,  -1987.0,   0.0,   -6.0,   1073.0,  0.0,   -2.0),
11526           new NutationModel( 1, 0, 0, 0, 2,  -1981.0,   0.0,    0.0,    854.0,  0.0,    0.0),
11527           new NutationModel(-1, 0, 0, 1, 0,   4026.0,   0.0, -353.0,   -553.0,  0.0, -139.0),
11528           new NutationModel( 0, 0, 2, 1, 2,   1660.0,   0.0,   -5.0,   -710.0,  0.0,   -2.0),
11529 
11530        /* 71-80 */
11531           new NutationModel(-1, 0, 2, 4, 2,  -1521.0,   0.0,    9.0,    647.0,  0.0,    4.0),
11532           new NutationModel(-1, 1, 0, 1, 1,   1314.0,   0.0,    0.0,   -700.0,  0.0,    0.0),
11533           new NutationModel( 0,-2, 2,-2, 1,  -1283.0,   0.0,    0.0,    672.0,  0.0,    0.0),
11534           new NutationModel( 1, 0, 2, 2, 1,  -1331.0,   0.0,    8.0,    663.0,  0.0,    4.0),
11535           new NutationModel(-2, 0, 2, 2, 2,   1383.0,   0.0,   -2.0,   -594.0,  0.0,   -2.0),
11536           new NutationModel(-1, 0, 0, 0, 2,   1405.0,   0.0,    4.0,   -610.0,  0.0,    2.0),
11537           new NutationModel( 1, 1, 2,-2, 2,   1290.0,   0.0,    0.0,   -556.0,  0.0,    0.0),
11538           new NutationModel(-2, 0, 2, 4, 2,  -1214.0,   0.0,    5.0,    518.0,  0.0,    2.0),
11539           new NutationModel(-1, 0, 4, 0, 2,   1146.0,   0.0,   -3.0,   -490.0,  0.0,   -1.0),
11540           new NutationModel( 2, 0, 2,-2, 1,   1019.0,   0.0,   -1.0,   -527.0,  0.0,   -1.0),
11541 
11542        /* 81-90 */
11543           new NutationModel( 2, 0, 2, 2, 2,  -1100.0,   0.0,    9.0,    465.0,  0.0,    4.0),
11544           new NutationModel( 1, 0, 0, 2, 1,   -970.0,   0.0,    2.0,    496.0,  0.0,    1.0),
11545           new NutationModel( 3, 0, 0, 0, 0,   1575.0,   0.0,   -6.0,    -50.0,  0.0,    0.0),
11546           new NutationModel( 3, 0, 2,-2, 2,    934.0,   0.0,   -3.0,   -399.0,  0.0,   -1.0),
11547           new NutationModel( 0, 0, 4,-2, 2,    922.0,   0.0,   -1.0,   -395.0,  0.0,   -1.0),
11548           new NutationModel( 0, 1, 2, 0, 1,    815.0,   0.0,   -1.0,   -422.0,  0.0,   -1.0),
11549           new NutationModel( 0, 0,-2, 2, 1,    834.0,   0.0,    2.0,   -440.0,  0.0,    1.0),
11550           new NutationModel( 0, 0, 2,-2, 3,   1248.0,   0.0,    0.0,   -170.0,  0.0,    1.0),
11551           new NutationModel(-1, 0, 0, 4, 0,   1338.0,   0.0,   -5.0,    -39.0,  0.0,    0.0),
11552           new NutationModel( 2, 0,-2, 0, 1,    716.0,   0.0,   -2.0,   -389.0,  0.0,   -1.0),
11553 
11554        /* 91-100 */
11555           new NutationModel(-2, 0, 0, 4, 0,   1282.0,   0.0,   -3.0,    -23.0,  0.0,    1.0),
11556           new NutationModel(-1,-1, 0, 2, 1,    742.0,   0.0,    1.0,   -391.0,  0.0,    0.0),
11557           new NutationModel(-1, 0, 0, 1, 1,   1020.0,   0.0,  -25.0,   -495.0,  0.0,  -10.0),
11558           new NutationModel( 0, 1, 0, 0, 2,    715.0,   0.0,   -4.0,   -326.0,  0.0,    2.0),
11559           new NutationModel( 0, 0,-2, 0, 1,   -666.0,   0.0,   -3.0,    369.0,  0.0,   -1.0),
11560           new NutationModel( 0,-1, 2, 0, 1,   -667.0,   0.0,    1.0,    346.0,  0.0,    1.0),
11561           new NutationModel( 0, 0, 2,-1, 2,   -704.0,   0.0,    0.0,    304.0,  0.0,    0.0),
11562           new NutationModel( 0, 0, 2, 4, 2,   -694.0,   0.0,    5.0,    294.0,  0.0,    2.0),
11563           new NutationModel(-2,-1, 0, 2, 0,  -1014.0,   0.0,   -1.0,      4.0,  0.0,   -1.0),
11564           new NutationModel( 1, 1, 0,-2, 1,   -585.0,   0.0,   -2.0,    316.0,  0.0,   -1.0),
11565 
11566        /* 101-110 */
11567           new NutationModel(-1, 1, 0, 2, 0,   -949.0,   0.0,    1.0,      8.0,  0.0,   -1.0),
11568           new NutationModel(-1, 1, 0, 1, 2,   -595.0,   0.0,    0.0,    258.0,  0.0,    0.0),
11569           new NutationModel( 1,-1, 0, 0, 1,    528.0,   0.0,    0.0,   -279.0,  0.0,    0.0),
11570           new NutationModel( 1,-1, 2, 2, 2,   -590.0,   0.0,    4.0,    252.0,  0.0,    2.0),
11571           new NutationModel(-1, 1, 2, 2, 2,    570.0,   0.0,   -2.0,   -244.0,  0.0,   -1.0),
11572           new NutationModel( 3, 0, 2, 0, 1,   -502.0,   0.0,    3.0,    250.0,  0.0,    2.0),
11573           new NutationModel( 0, 1,-2, 2, 0,   -875.0,   0.0,    1.0,     29.0,  0.0,    0.0),
11574           new NutationModel(-1, 0, 0,-2, 1,   -492.0,   0.0,   -3.0,    275.0,  0.0,   -1.0),
11575           new NutationModel( 0, 1, 2, 2, 2,    535.0,   0.0,   -2.0,   -228.0,  0.0,   -1.0),
11576           new NutationModel(-1,-1, 2, 2, 1,   -467.0,   0.0,    1.0,    240.0,  0.0,    1.0),
11577 
11578        /* 111-120 */
11579           new NutationModel( 0,-1, 0, 0, 2,    591.0,   0.0,    0.0,   -253.0,  0.0,    0.0),
11580           new NutationModel( 1, 0, 2,-4, 1,   -453.0,   0.0,   -1.0,    244.0,  0.0,   -1.0),
11581           new NutationModel(-1, 0,-2, 2, 0,    766.0,   0.0,    1.0,      9.0,  0.0,    0.0),
11582           new NutationModel( 0,-1, 2, 2, 1,   -446.0,   0.0,    2.0,    225.0,  0.0,    1.0),
11583           new NutationModel( 2,-1, 2, 0, 2,   -488.0,   0.0,    2.0,    207.0,  0.0,    1.0),
11584           new NutationModel( 0, 0, 0, 2, 2,   -468.0,   0.0,    0.0,    201.0,  0.0,    0.0),
11585           new NutationModel( 1,-1, 2, 0, 1,   -421.0,   0.0,    1.0,    216.0,  0.0,    1.0),
11586           new NutationModel(-1, 1, 2, 0, 2,    463.0,   0.0,    0.0,   -200.0,  0.0,    0.0),
11587           new NutationModel( 0, 1, 0, 2, 0,   -673.0,   0.0,    2.0,     14.0,  0.0,    0.0),
11588           new NutationModel( 0,-1,-2, 2, 0,    658.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11589 
11590        /* 121-130 */
11591           new NutationModel( 0, 3, 2,-2, 2,   -438.0,   0.0,    0.0,    188.0,  0.0,    0.0),
11592           new NutationModel( 0, 0, 0, 1, 1,   -390.0,   0.0,    0.0,    205.0,  0.0,    0.0),
11593           new NutationModel(-1, 0, 2, 2, 0,    639.0, -11.0,   -2.0,    -19.0,  0.0,    0.0),
11594           new NutationModel( 2, 1, 2, 0, 2,    412.0,   0.0,   -2.0,   -176.0,  0.0,   -1.0),
11595           new NutationModel( 1, 1, 0, 0, 1,   -361.0,   0.0,    0.0,    189.0,  0.0,    0.0),
11596           new NutationModel( 1, 1, 2, 0, 1,    360.0,   0.0,   -1.0,   -185.0,  0.0,   -1.0),
11597           new NutationModel( 2, 0, 0, 2, 0,    588.0,   0.0,   -3.0,    -24.0,  0.0,    0.0),
11598           new NutationModel( 1, 0,-2, 2, 0,   -578.0,   0.0,    1.0,      5.0,  0.0,    0.0),
11599           new NutationModel(-1, 0, 0, 2, 2,   -396.0,   0.0,    0.0,    171.0,  0.0,    0.0),
11600           new NutationModel( 0, 1, 0, 1, 0,    565.0,   0.0,   -1.0,     -6.0,  0.0,    0.0),
11601 
11602        /* 131-140 */
11603           new NutationModel( 0, 1, 0,-2, 1,   -335.0,   0.0,   -1.0,    184.0,  0.0,   -1.0),
11604           new NutationModel(-1, 0, 2,-2, 2,    357.0,   0.0,    1.0,   -154.0,  0.0,    0.0),
11605           new NutationModel( 0, 0, 0,-1, 1,    321.0,   0.0,    1.0,   -174.0,  0.0,    0.0),
11606           new NutationModel(-1, 1, 0, 0, 1,   -301.0,   0.0,   -1.0,    162.0,  0.0,    0.0),
11607           new NutationModel( 1, 0, 2,-1, 2,   -334.0,   0.0,    0.0,    144.0,  0.0,    0.0),
11608           new NutationModel( 1,-1, 0, 2, 0,    493.0,   0.0,   -2.0,    -15.0,  0.0,    0.0),
11609           new NutationModel( 0, 0, 0, 4, 0,    494.0,   0.0,   -2.0,    -19.0,  0.0,    0.0),
11610           new NutationModel( 1, 0, 2, 1, 2,    337.0,   0.0,   -1.0,   -143.0,  0.0,   -1.0),
11611           new NutationModel( 0, 0, 2, 1, 1,    280.0,   0.0,   -1.0,   -144.0,  0.0,    0.0),
11612           new NutationModel( 1, 0, 0,-2, 2,    309.0,   0.0,    1.0,   -134.0,  0.0,    0.0),
11613 
11614        /* 141-150 */
11615           new NutationModel(-1, 0, 2, 4, 1,   -263.0,   0.0,    2.0,    131.0,  0.0,    1.0),
11616           new NutationModel( 1, 0,-2, 0, 1,    253.0,   0.0,    1.0,   -138.0,  0.0,    0.0),
11617           new NutationModel( 1, 1, 2,-2, 1,    245.0,   0.0,    0.0,   -128.0,  0.0,    0.0),
11618           new NutationModel( 0, 0, 2, 2, 0,    416.0,   0.0,   -2.0,    -17.0,  0.0,    0.0),
11619           new NutationModel(-1, 0, 2,-1, 1,   -229.0,   0.0,    0.0,    128.0,  0.0,    0.0),
11620           new NutationModel(-2, 0, 2, 2, 1,    231.0,   0.0,    0.0,   -120.0,  0.0,    0.0),
11621           new NutationModel( 4, 0, 2, 0, 2,   -259.0,   0.0,    2.0,    109.0,  0.0,    1.0),
11622           new NutationModel( 2,-1, 0, 0, 0,    375.0,   0.0,   -1.0,     -8.0,  0.0,    0.0),
11623           new NutationModel( 2, 1, 2,-2, 2,    252.0,   0.0,    0.0,   -108.0,  0.0,    0.0),
11624           new NutationModel( 0, 1, 2, 1, 2,   -245.0,   0.0,    1.0,    104.0,  0.0,    0.0),
11625 
11626        /* 151-160 */
11627           new NutationModel( 1, 0, 4,-2, 2,    243.0,   0.0,   -1.0,   -104.0,  0.0,    0.0),
11628           new NutationModel(-1,-1, 0, 0, 1,    208.0,   0.0,    1.0,   -112.0,  0.0,    0.0),
11629           new NutationModel( 0, 1, 0, 2, 1,    199.0,   0.0,    0.0,   -102.0,  0.0,    0.0),
11630           new NutationModel(-2, 0, 2, 4, 1,   -208.0,   0.0,    1.0,    105.0,  0.0,    0.0),
11631           new NutationModel( 2, 0, 2, 0, 0,    335.0,   0.0,   -2.0,    -14.0,  0.0,    0.0),
11632           new NutationModel( 1, 0, 0, 1, 0,   -325.0,   0.0,    1.0,      7.0,  0.0,    0.0),
11633           new NutationModel(-1, 0, 0, 4, 1,   -187.0,   0.0,    0.0,     96.0,  0.0,    0.0),
11634           new NutationModel(-1, 0, 4, 0, 1,    197.0,   0.0,   -1.0,   -100.0,  0.0,    0.0),
11635           new NutationModel( 2, 0, 2, 2, 1,   -192.0,   0.0,    2.0,     94.0,  0.0,    1.0),
11636           new NutationModel( 0, 0, 2,-3, 2,   -188.0,   0.0,    0.0,     83.0,  0.0,    0.0),
11637 
11638        /* 161-170 */
11639           new NutationModel(-1,-2, 0, 2, 0,    276.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11640           new NutationModel( 2, 1, 0, 0, 0,   -286.0,   0.0,    1.0,      6.0,  0.0,    0.0),
11641           new NutationModel( 0, 0, 4, 0, 2,    186.0,   0.0,   -1.0,    -79.0,  0.0,    0.0),
11642           new NutationModel( 0, 0, 0, 0, 3,   -219.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11643           new NutationModel( 0, 3, 0, 0, 0,    276.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11644           new NutationModel( 0, 0, 2,-4, 1,   -153.0,   0.0,   -1.0,     84.0,  0.0,    0.0),
11645           new NutationModel( 0,-1, 0, 2, 1,   -156.0,   0.0,    0.0,     81.0,  0.0,    0.0),
11646           new NutationModel( 0, 0, 0, 4, 1,   -154.0,   0.0,    1.0,     78.0,  0.0,    0.0),
11647           new NutationModel(-1,-1, 2, 4, 2,   -174.0,   0.0,    1.0,     75.0,  0.0,    0.0),
11648           new NutationModel( 1, 0, 2, 4, 2,   -163.0,   0.0,    2.0,     69.0,  0.0,    1.0),
11649 
11650        /* 171-180 */
11651           new NutationModel(-2, 2, 0, 2, 0,   -228.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11652           new NutationModel(-2,-1, 2, 0, 1,     91.0,   0.0,   -4.0,    -54.0,  0.0,   -2.0),
11653           new NutationModel(-2, 0, 0, 2, 2,    175.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11654           new NutationModel(-1,-1, 2, 0, 2,   -159.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11655           new NutationModel( 0, 0, 4,-2, 1,    141.0,   0.0,    0.0,    -72.0,  0.0,    0.0),
11656           new NutationModel( 3, 0, 2,-2, 1,    147.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11657           new NutationModel(-2,-1, 0, 2, 1,   -132.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11658           new NutationModel( 1, 0, 0,-1, 1,    159.0,   0.0,  -28.0,    -54.0,  0.0,   11.0),
11659           new NutationModel( 0,-2, 0, 2, 0,    213.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11660           new NutationModel(-2, 0, 0, 4, 1,    123.0,   0.0,    0.0,    -64.0,  0.0,    0.0),
11661 
11662        /* 181-190 */
11663           new NutationModel(-3, 0, 0, 0, 1,   -118.0,   0.0,   -1.0,     66.0,  0.0,    0.0),
11664           new NutationModel( 1, 1, 2, 2, 2,    144.0,   0.0,   -1.0,    -61.0,  0.0,    0.0),
11665           new NutationModel( 0, 0, 2, 4, 1,   -121.0,   0.0,    1.0,     60.0,  0.0,    0.0),
11666           new NutationModel( 3, 0, 2, 2, 2,   -134.0,   0.0,    1.0,     56.0,  0.0,    1.0),
11667           new NutationModel(-1, 1, 2,-2, 1,   -105.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11668           new NutationModel( 2, 0, 0,-4, 1,   -102.0,   0.0,    0.0,     56.0,  0.0,    0.0),
11669           new NutationModel( 0, 0, 0,-2, 2,    120.0,   0.0,    0.0,    -52.0,  0.0,    0.0),
11670           new NutationModel( 2, 0, 2,-4, 1,    101.0,   0.0,    0.0,    -54.0,  0.0,    0.0),
11671           new NutationModel(-1, 1, 0, 2, 1,   -113.0,   0.0,    0.0,     59.0,  0.0,    0.0),
11672           new NutationModel( 0, 0, 2,-1, 1,   -106.0,   0.0,    0.0,     61.0,  0.0,    0.0),
11673 
11674        /* 191-200 */
11675           new NutationModel( 0,-2, 2, 2, 2,   -129.0,   0.0,    1.0,     55.0,  0.0,    0.0),
11676           new NutationModel( 2, 0, 0, 2, 1,   -114.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11677           new NutationModel( 4, 0, 2,-2, 2,    113.0,   0.0,   -1.0,    -49.0,  0.0,    0.0),
11678           new NutationModel( 2, 0, 0,-2, 2,   -102.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11679           new NutationModel( 0, 2, 0, 0, 1,    -94.0,   0.0,    0.0,     51.0,  0.0,    0.0),
11680           new NutationModel( 1, 0, 0,-4, 1,   -100.0,   0.0,   -1.0,     56.0,  0.0,    0.0),
11681           new NutationModel( 0, 2, 2,-2, 1,     87.0,   0.0,    0.0,    -47.0,  0.0,    0.0),
11682           new NutationModel(-3, 0, 0, 4, 0,    161.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11683           new NutationModel(-1, 1, 2, 0, 1,     96.0,   0.0,    0.0,    -50.0,  0.0,    0.0),
11684           new NutationModel(-1,-1, 0, 4, 0,    151.0,   0.0,   -1.0,     -5.0,  0.0,    0.0),
11685 
11686        /* 201-210 */
11687           new NutationModel(-1,-2, 2, 2, 2,   -104.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11688           new NutationModel(-2,-1, 2, 4, 2,   -110.0,   0.0,    0.0,     48.0,  0.0,    0.0),
11689           new NutationModel( 1,-1, 2, 2, 1,   -100.0,   0.0,    1.0,     50.0,  0.0,    0.0),
11690           new NutationModel(-2, 1, 0, 2, 0,     92.0,   0.0,   -5.0,     12.0,  0.0,   -2.0),
11691           new NutationModel(-2, 1, 2, 0, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11692           new NutationModel( 2, 1, 0,-2, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11693           new NutationModel(-3, 0, 2, 0, 1,    -78.0,   0.0,    0.0,     41.0,  0.0,    0.0),
11694           new NutationModel(-2, 0, 2,-2, 1,    -77.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11695           new NutationModel(-1, 1, 0, 2, 2,      2.0,   0.0,    0.0,     54.0,  0.0,    0.0),
11696           new NutationModel( 0,-1, 2,-1, 2,     94.0,   0.0,    0.0,    -40.0,  0.0,    0.0),
11697 
11698        /* 211-220 */
11699           new NutationModel(-1, 0, 4,-2, 2,    -93.0,   0.0,    0.0,     40.0,  0.0,    0.0),
11700           new NutationModel( 0,-2, 2, 0, 2,    -83.0,   0.0,   10.0,     40.0,  0.0,   -2.0),
11701           new NutationModel(-1, 0, 2, 1, 2,     83.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11702           new NutationModel( 2, 0, 0, 0, 2,    -91.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11703           new NutationModel( 0, 0, 2, 0, 3,    128.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11704           new NutationModel(-2, 0, 4, 0, 2,    -79.0,   0.0,    0.0,     34.0,  0.0,    0.0),
11705           new NutationModel(-1, 0,-2, 0, 1,    -83.0,   0.0,    0.0,     47.0,  0.0,    0.0),
11706           new NutationModel(-1, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -44.0,  0.0,    0.0),
11707           new NutationModel( 3, 0, 0, 0, 1,     83.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11708           new NutationModel(-1, 0, 2, 3, 2,     91.0,   0.0,    0.0,    -39.0,  0.0,    0.0),
11709 
11710        /* 221-230 */
11711           new NutationModel( 2,-1, 2, 0, 1,    -77.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11712           new NutationModel( 0, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11713           new NutationModel( 0,-1, 2, 4, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11714           new NutationModel( 2,-1, 2, 2, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11715           new NutationModel( 0, 2,-2, 2, 0,    -94.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11716           new NutationModel(-1,-1, 2,-1, 1,     68.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11717           new NutationModel( 0,-2, 0, 0, 1,    -61.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11718           new NutationModel( 1, 0, 2,-4, 2,     71.0,   0.0,    0.0,    -31.0,  0.0,    0.0),
11719           new NutationModel( 1,-1, 0,-2, 1,     62.0,   0.0,    0.0,    -34.0,  0.0,    0.0),
11720           new NutationModel(-1,-1, 2, 0, 1,    -63.0,   0.0,    0.0,     33.0,  0.0,    0.0),
11721 
11722        /* 231-240 */
11723           new NutationModel( 1,-1, 2,-2, 2,    -73.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11724           new NutationModel(-2,-1, 0, 4, 0,    115.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11725           new NutationModel(-1, 0, 0, 3, 0,   -103.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11726           new NutationModel(-2,-1, 2, 2, 2,     63.0,   0.0,    0.0,    -28.0,  0.0,    0.0),
11727           new NutationModel( 0, 2, 2, 0, 2,     74.0,   0.0,    0.0,    -32.0,  0.0,    0.0),
11728           new NutationModel( 1, 1, 0, 2, 0,   -103.0,   0.0,   -3.0,      3.0,  0.0,   -1.0),
11729           new NutationModel( 2, 0, 2,-1, 2,    -69.0,   0.0,    0.0,     30.0,  0.0,    0.0),
11730           new NutationModel( 1, 0, 2, 1, 1,     57.0,   0.0,    0.0,    -29.0,  0.0,    0.0),
11731           new NutationModel( 4, 0, 0, 0, 0,     94.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11732           new NutationModel( 2, 1, 2, 0, 1,     64.0,   0.0,    0.0,    -33.0,  0.0,    0.0),
11733 
11734        /* 241-250 */
11735           new NutationModel( 3,-1, 2, 0, 2,    -63.0,   0.0,    0.0,     26.0,  0.0,    0.0),
11736           new NutationModel(-2, 2, 0, 2, 1,    -38.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11737           new NutationModel( 1, 0, 2,-3, 1,    -43.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11738           new NutationModel( 1, 1, 2,-4, 1,    -45.0,   0.0,    0.0,     23.0,  0.0,    0.0),
11739           new NutationModel(-1,-1, 2,-2, 1,     47.0,   0.0,    0.0,    -24.0,  0.0,    0.0),
11740           new NutationModel( 0,-1, 0,-1, 1,    -48.0,   0.0,    0.0,     25.0,  0.0,    0.0),
11741           new NutationModel( 0,-1, 0,-2, 1,     45.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11742           new NutationModel(-2, 0, 0, 0, 2,     56.0,   0.0,    0.0,    -25.0,  0.0,    0.0),
11743           new NutationModel(-2, 0,-2, 2, 0,     88.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11744           new NutationModel(-1, 0,-2, 4, 0,    -75.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11745 
11746        /* 251-260 */
11747           new NutationModel( 1,-2, 0, 0, 0,     85.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11748           new NutationModel( 0, 1, 0, 1, 1,     49.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11749           new NutationModel(-1, 2, 0, 2, 0,    -74.0,   0.0,   -3.0,     -1.0,  0.0,   -1.0),
11750           new NutationModel( 1,-1, 2,-2, 1,    -39.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11751           new NutationModel( 1, 2, 2,-2, 2,     45.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11752           new NutationModel( 2,-1, 2,-2, 2,     51.0,   0.0,    0.0,    -22.0,  0.0,    0.0),
11753           new NutationModel( 1, 0, 2,-1, 1,    -40.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11754           new NutationModel( 2, 1, 2,-2, 1,     41.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11755           new NutationModel(-2, 0, 0,-2, 1,    -42.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11756           new NutationModel( 1,-2, 2, 0, 2,    -51.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11757 
11758        /* 261-270 */
11759           new NutationModel( 0, 1, 2, 1, 1,    -42.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11760           new NutationModel( 1, 0, 4,-2, 1,     39.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11761           new NutationModel(-2, 0, 4, 2, 2,     46.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11762           new NutationModel( 1, 1, 2, 1, 2,    -53.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11763           new NutationModel( 1, 0, 0, 4, 0,     82.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11764           new NutationModel( 1, 0, 2, 2, 0,     81.0,   0.0,   -1.0,     -4.0,  0.0,    0.0),
11765           new NutationModel( 2, 0, 2, 1, 2,     47.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11766           new NutationModel( 3, 1, 2, 0, 2,     53.0,   0.0,    0.0,    -23.0,  0.0,    0.0),
11767           new NutationModel( 4, 0, 2, 0, 1,    -45.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11768           new NutationModel(-2,-1, 2, 0, 0,    -44.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11769 
11770        /* 271-280 */
11771           new NutationModel( 0, 1,-2, 2, 1,    -33.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11772           new NutationModel( 1, 0,-2, 1, 0,    -61.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11773           new NutationModel( 0,-1,-2, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11774           new NutationModel( 2,-1, 0,-2, 1,    -38.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11775           new NutationModel(-1, 0, 2,-1, 2,    -33.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11776           new NutationModel( 1, 0, 2,-3, 2,    -60.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11777           new NutationModel( 0, 1, 2,-2, 3,     48.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11778           new NutationModel( 0, 0, 2,-3, 1,     27.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11779           new NutationModel(-1, 0,-2, 2, 1,     38.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11780           new NutationModel( 0, 0, 2,-4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11781 
11782        /* 281-290 */
11783           new NutationModel(-2, 1, 0, 0, 1,    -29.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11784           new NutationModel(-1, 0, 0,-1, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11785           new NutationModel( 2, 0, 2,-4, 2,    -32.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11786           new NutationModel( 0, 0, 4,-4, 4,     45.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11787           new NutationModel( 0, 0, 4,-4, 2,    -44.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11788           new NutationModel(-1,-2, 0, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11789           new NutationModel(-2, 0, 0, 3, 0,    -51.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11790           new NutationModel( 1, 0,-2, 2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11791           new NutationModel(-3, 0, 2, 2, 2,     44.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11792           new NutationModel(-3, 0, 2, 2, 1,     26.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11793 
11794        /* 291-300 */
11795           new NutationModel(-2, 0, 2, 2, 0,    -60.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11796           new NutationModel( 2,-1, 0, 0, 1,     35.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11797           new NutationModel(-2, 1, 2, 2, 2,    -27.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11798           new NutationModel( 1, 1, 0, 1, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11799           new NutationModel( 0, 1, 4,-2, 2,     36.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11800           new NutationModel(-1, 1, 0,-2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11801           new NutationModel( 0, 0, 0,-4, 1,    -35.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11802           new NutationModel( 1,-1, 0, 2, 1,    -37.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11803           new NutationModel( 1, 1, 0, 2, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11804           new NutationModel(-1, 2, 2, 2, 2,     35.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11805 
11806        /* 301-310 */
11807           new NutationModel( 3, 1, 2,-2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11808           new NutationModel( 0,-1, 0, 4, 0,     65.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11809           new NutationModel( 2,-1, 0, 2, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11810           new NutationModel( 0, 0, 4, 0, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11811           new NutationModel( 2, 0, 4,-2, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11812           new NutationModel(-1,-1, 2, 4, 1,    -30.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11813           new NutationModel( 1, 0, 0, 4, 1,    -32.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11814           new NutationModel( 1,-2, 2, 2, 2,    -31.0,   0.0,    0.0,     13.0,  0.0,    0.0),
11815           new NutationModel( 0, 0, 2, 3, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11816           new NutationModel(-1, 1, 2, 4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11817 
11818        /* 311-320 */
11819           new NutationModel( 3, 0, 0, 2, 0,     49.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11820           new NutationModel(-1, 0, 4, 2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11821           new NutationModel( 1, 1, 2, 2, 1,     23.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11822           new NutationModel(-2, 0, 2, 6, 2,    -43.0,   0.0,    0.0,     18.0,  0.0,    0.0),
11823           new NutationModel( 2, 1, 2, 2, 2,     26.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11824           new NutationModel(-1, 0, 2, 6, 2,    -32.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11825           new NutationModel( 1, 0, 2, 4, 1,    -29.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11826           new NutationModel( 2, 0, 2, 4, 2,    -27.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11827           new NutationModel( 1, 1,-2, 1, 0,     30.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11828           new NutationModel(-3, 1, 2, 1, 2,    -11.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11829 
11830        /* 321-330 */
11831           new NutationModel( 2, 0,-2, 0, 2,    -21.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11832           new NutationModel(-1, 0, 0, 1, 2,    -34.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11833           new NutationModel(-4, 0, 2, 2, 1,    -10.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11834           new NutationModel(-1,-1, 0, 1, 0,    -36.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11835           new NutationModel( 0, 0,-2, 2, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11836           new NutationModel( 1, 0, 0,-1, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11837           new NutationModel( 0,-1, 2,-2, 3,    -21.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11838           new NutationModel(-2, 1, 2, 0, 0,    -29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11839           new NutationModel( 0, 0, 2,-2, 4,    -15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11840           new NutationModel(-2,-2, 0, 2, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11841 
11842        /* 331-340 */
11843           new NutationModel(-2, 0,-2, 4, 0,     28.0,   0.0,    0.0,      0.0,  0.0,   -2.0),
11844           new NutationModel( 0,-2,-2, 2, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11845           new NutationModel( 1, 2, 0,-2, 1,    -22.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11846           new NutationModel( 3, 0, 0,-4, 1,    -14.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11847           new NutationModel(-1, 1, 2,-2, 2,     24.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11848           new NutationModel( 1,-1, 2,-4, 1,     11.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11849           new NutationModel( 1, 1, 0,-2, 2,     14.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11850           new NutationModel(-3, 0, 2, 0, 0,     24.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11851           new NutationModel(-3, 0, 2, 0, 2,     18.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11852           new NutationModel(-2, 0, 0, 1, 0,    -38.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11853 
11854        /* 341-350 */
11855           new NutationModel( 0, 0,-2, 1, 0,    -31.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11856           new NutationModel(-3, 0, 0, 2, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11857           new NutationModel(-1,-1,-2, 2, 0,     29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11858           new NutationModel( 0, 1, 2,-4, 1,    -18.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11859           new NutationModel( 2, 1, 0,-4, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11860           new NutationModel( 0, 2, 0,-2, 1,    -17.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11861           new NutationModel( 1, 0, 0,-3, 1,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11862           new NutationModel(-2, 0, 2,-2, 2,     16.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11863           new NutationModel(-2,-1, 0, 0, 1,     22.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11864           new NutationModel(-4, 0, 0, 2, 0,     20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11865 
11866        /* 351-360 */
11867           new NutationModel( 1, 1, 0,-4, 1,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11868           new NutationModel(-1, 0, 2,-4, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11869           new NutationModel( 0, 0, 4,-4, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11870           new NutationModel( 0, 3, 2,-2, 2,      0.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11871           new NutationModel(-3,-1, 0, 4, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11872           new NutationModel(-3, 0, 0, 4, 1,     19.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11873           new NutationModel( 1,-1,-2, 2, 0,    -34.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11874           new NutationModel(-1,-1, 0, 2, 2,    -20.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11875           new NutationModel( 1,-2, 0, 0, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11876           new NutationModel( 1,-1, 0, 0, 2,    -18.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11877 
11878        /* 361-370 */
11879           new NutationModel( 0, 0, 0, 1, 2,     13.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11880           new NutationModel(-1,-1, 2, 0, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11881           new NutationModel( 1,-2, 2,-2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11882           new NutationModel( 0,-1, 2,-1, 1,     15.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11883           new NutationModel(-1, 0, 2, 0, 3,    -11.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11884           new NutationModel( 1, 1, 0, 0, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11885           new NutationModel(-1, 1, 2, 0, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11886           new NutationModel( 1, 2, 0, 0, 0,    -35.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11887           new NutationModel(-1, 2, 2, 0, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11888           new NutationModel(-1, 0, 4,-2, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11889 
11890        /* 371-380 */
11891           new NutationModel( 3, 0, 2,-4, 2,    -26.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11892           new NutationModel( 1, 2, 2,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11893           new NutationModel( 1, 0, 4,-4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11894           new NutationModel(-2,-1, 0, 4, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11895           new NutationModel( 0,-1, 0, 2, 2,    -21.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11896           new NutationModel(-2, 1, 0, 4, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11897           new NutationModel(-2,-1, 2, 2, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11898           new NutationModel( 2, 0,-2, 2, 0,    -29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11899           new NutationModel( 1, 0, 0, 1, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11900           new NutationModel( 0, 1, 0, 2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11901 
11902        /* 381-390 */
11903           new NutationModel( 1,-1, 2,-1, 2,     22.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11904           new NutationModel(-2, 0, 4, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11905           new NutationModel( 2, 1, 0, 0, 1,    -20.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11906           new NutationModel( 0, 1, 2, 0, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11907           new NutationModel( 0,-1, 4,-2, 2,    -17.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11908           new NutationModel( 0, 0, 4,-2, 4,     15.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11909           new NutationModel( 0, 2, 2, 0, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11910           new NutationModel(-3, 0, 0, 6, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11911           new NutationModel(-1,-1, 0, 4, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11912           new NutationModel( 1,-2, 0, 2, 0,     25.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11913 
11914        /* 391-400 */
11915           new NutationModel(-1, 0, 0, 4, 2,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11916           new NutationModel(-1,-2, 2, 2, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11917           new NutationModel(-1, 0, 0,-2, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11918           new NutationModel( 1, 0,-2,-2, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11919           new NutationModel( 0, 0,-2,-2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11920           new NutationModel(-2, 0,-2, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11921           new NutationModel( 0, 0, 0, 3, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11922           new NutationModel( 0, 0, 0, 3, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11923           new NutationModel(-1, 1, 0, 4, 0,    -22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11924           new NutationModel(-1,-1, 2, 2, 0,     28.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11925 
11926        /* 401-410 */
11927           new NutationModel(-2, 0, 2, 3, 2,     15.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11928           new NutationModel( 1, 0, 0, 2, 2,     23.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11929           new NutationModel( 0,-1, 2, 1, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11930           new NutationModel( 3,-1, 0, 0, 0,     29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11931           new NutationModel( 2, 0, 0, 1, 0,    -25.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11932           new NutationModel( 1,-1, 2, 0, 0,     22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11933           new NutationModel( 0, 0, 2, 1, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11934           new NutationModel( 1, 0, 2, 0, 3,     15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11935           new NutationModel( 3, 1, 0, 0, 0,    -23.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11936           new NutationModel( 3,-1, 2,-2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11937 
11938        /* 411-420 */
11939           new NutationModel( 2, 0, 2,-1, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11940           new NutationModel( 1, 1, 2, 0, 0,    -19.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11941           new NutationModel( 0, 0, 4,-1, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11942           new NutationModel( 1, 2, 2, 0, 2,     21.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11943           new NutationModel(-2, 0, 0, 6, 0,     23.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11944           new NutationModel( 0,-1, 0, 4, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11945           new NutationModel(-2,-1, 2, 4, 1,    -19.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11946           new NutationModel( 0,-2, 2, 2, 1,    -22.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11947           new NutationModel( 0,-1, 2, 2, 0,     27.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11948           new NutationModel(-1, 0, 2, 3, 1,     16.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11949 
11950        /* 421-430 */
11951           new NutationModel(-2, 1, 2, 4, 2,     19.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11952           new NutationModel( 2, 0, 0, 2, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11953           new NutationModel( 2,-2, 2, 0, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11954           new NutationModel(-1, 1, 2, 3, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11955           new NutationModel( 3, 0, 2,-1, 2,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11956           new NutationModel( 4, 0, 2,-2, 1,     18.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11957           new NutationModel(-1, 0, 0, 6, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11958           new NutationModel(-1,-2, 2, 4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11959           new NutationModel(-3, 0, 2, 6, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11960           new NutationModel(-1, 0, 2, 4, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11961 
11962        /* 431-440 */
11963           new NutationModel( 3, 0, 0, 2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11964           new NutationModel( 3,-1, 2, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11965           new NutationModel( 3, 0, 2, 0, 0,     30.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11966           new NutationModel( 1, 0, 4, 0, 2,     24.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11967           new NutationModel( 5, 0, 2,-2, 2,     10.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11968           new NutationModel( 0,-1, 2, 4, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11969           new NutationModel( 2,-1, 2, 2, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11970           new NutationModel( 0, 1, 2, 4, 2,     17.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11971           new NutationModel( 1,-1, 2, 4, 2,    -24.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11972           new NutationModel( 3,-1, 2, 2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11973 
11974        /* 441-450 */
11975           new NutationModel( 3, 0, 2, 2, 1,    -24.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11976           new NutationModel( 5, 0, 2, 0, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11977           new NutationModel( 0, 0, 2, 6, 2,    -13.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11978           new NutationModel( 4, 0, 2, 2, 2,    -15.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11979           new NutationModel( 0,-1, 1,-1, 1,      0.0,   0.0,-1988.0,      0.0,  0.0,-1679.0),
11980           new NutationModel(-1, 0, 1, 0, 3,      0.0,   0.0,  -63.0,      0.0,  0.0,  -27.0),
11981           new NutationModel( 0,-2, 2,-2, 3,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11982           new NutationModel( 1, 0,-1, 0, 1,      0.0,   0.0,    5.0,      0.0,  0.0,    4.0),
11983           new NutationModel( 2,-2, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11984           new NutationModel(-1, 0, 1, 0, 2,      0.0,   0.0,  364.0,      0.0,  0.0,  176.0),
11985 
11986        /* 451-460 */
11987           new NutationModel(-1, 0, 1, 0, 1,      0.0,   0.0,-1044.0,      0.0,  0.0, -891.0),
11988           new NutationModel(-1,-1, 2,-1, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11989           new NutationModel(-2, 2, 0, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11990           new NutationModel(-1, 0, 1, 0, 0,      0.0,   0.0,  330.0,      0.0,  0.0,    0.0),
11991           new NutationModel(-4, 1, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11992           new NutationModel(-3, 0, 2, 1, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11993           new NutationModel(-2,-1, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11994           new NutationModel( 1, 0,-2, 1, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11995           new NutationModel( 2,-1,-2, 0, 1,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11996           new NutationModel(-4, 0, 2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11997 
11998        /* 461-470 */
11999           new NutationModel(-3, 1, 0, 3, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12000           new NutationModel(-1, 0,-1, 2, 0,      0.0,   0.0,    5.0,      0.0,  0.0,    0.0),
12001           new NutationModel( 0,-2, 0, 0, 2,      0.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12002           new NutationModel( 0,-2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12003           new NutationModel(-3, 0, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12004           new NutationModel(-2,-1, 0, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12005           new NutationModel(-1, 0,-2, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12006           new NutationModel(-4, 0, 0, 4, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12007           new NutationModel( 2, 1,-2, 0, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12008           new NutationModel( 2,-1, 0,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12009 
12010        /* 471-480 */
12011           new NutationModel( 0, 0, 1,-1, 0,     -5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12012           new NutationModel(-1, 2, 0, 1, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12013           new NutationModel(-2, 1, 2, 0, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12014           new NutationModel( 1, 1, 0,-1, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12015           new NutationModel( 1, 0, 1,-2, 1,      0.0,   0.0,  -12.0,      0.0,  0.0,  -10.0),
12016           new NutationModel( 0, 2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12017           new NutationModel( 1,-1, 2,-3, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12018           new NutationModel(-1, 1, 2,-1, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12019           new NutationModel(-2, 0, 4,-2, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12020           new NutationModel(-2, 0, 4,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12021 
12022        /* 481-490 */
12023           new NutationModel(-2,-2, 0, 2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12024           new NutationModel(-2, 0,-2, 4, 0,      0.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12025           new NutationModel( 1, 2, 2,-4, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12026           new NutationModel( 1, 1, 2,-4, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12027           new NutationModel(-1, 2, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12028           new NutationModel( 2, 0, 0,-3, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12029           new NutationModel(-1, 2, 0, 0, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12030           new NutationModel( 0, 0, 0,-2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12031           new NutationModel(-1,-1, 2,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12032           new NutationModel(-1, 1, 0, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12033 
12034        /* 491-500 */
12035           new NutationModel( 0, 0, 0,-1, 2,     -8.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12036           new NutationModel(-2, 1, 0, 1, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12037           new NutationModel( 1,-2, 0,-2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12038           new NutationModel( 1, 0,-2, 0, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12039           new NutationModel(-3, 1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12040           new NutationModel(-1, 1,-2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12041           new NutationModel(-1,-1, 0, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12042           new NutationModel(-3, 0, 0, 2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12043           new NutationModel(-3,-1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12044           new NutationModel( 2, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12045 
12046        /* 501-510 */
12047           new NutationModel( 0, 1, 2,-4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12048           new NutationModel( 2, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12049           new NutationModel(-2, 1, 2,-2, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12050           new NutationModel( 0,-1, 2,-4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12051           new NutationModel( 0, 1, 0,-2, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12052           new NutationModel(-1, 0, 0,-2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12053           new NutationModel( 2, 0,-2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12054           new NutationModel(-4, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12055           new NutationModel(-1,-1, 0,-1, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12056           new NutationModel( 0, 0,-2, 0, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12057 
12058        /* 511-520 */
12059           new NutationModel(-3, 0, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12060           new NutationModel(-1, 0,-2, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12061           new NutationModel(-2, 0,-2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12062           new NutationModel( 0, 0,-4, 2, 0,      8.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12063           new NutationModel(-2,-1,-2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12064           new NutationModel( 1, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12065           new NutationModel(-1, 0, 2,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12066           new NutationModel( 1, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12067           new NutationModel( 2, 1, 2,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12068           new NutationModel( 2, 1, 2,-4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12069 
12070        /* 521-530 */
12071           new NutationModel( 0, 1, 4,-4, 4,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12072           new NutationModel( 0, 1, 4,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12073           new NutationModel(-1,-1,-2, 4, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12074           new NutationModel(-1,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12075           new NutationModel(-1, 0,-2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12076           new NutationModel(-2,-1, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12077           new NutationModel( 0, 0,-2, 3, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12078           new NutationModel(-2, 0, 0, 3, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12079           new NutationModel( 0,-1, 0, 1, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12080           new NutationModel(-3, 0, 2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12081 
12082        /* 531-540 */
12083           new NutationModel( 1, 1,-2, 2, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12084           new NutationModel(-1, 1, 0, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12085           new NutationModel( 1,-2, 2,-2, 1,     10.0,   0.0,   13.0,      6.0,  0.0,   -5.0),
12086           new NutationModel( 0, 0, 1, 0, 2,      0.0,   0.0,   30.0,      0.0,  0.0,   14.0),
12087           new NutationModel( 0, 0, 1, 0, 1,      0.0,   0.0, -162.0,      0.0,  0.0, -138.0),
12088           new NutationModel( 0, 0, 1, 0, 0,      0.0,   0.0,   75.0,      0.0,  0.0,    0.0),
12089           new NutationModel(-1, 2, 0, 2, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12090           new NutationModel( 0, 0, 2, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12091           new NutationModel(-2, 0, 2, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12092           new NutationModel( 2, 0, 0,-1, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12093 
12094        /* 541-550 */
12095           new NutationModel( 3, 0, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12096           new NutationModel( 1, 0, 2,-2, 3,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12097           new NutationModel( 1, 2, 0, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12098           new NutationModel( 2, 0, 2,-3, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12099           new NutationModel(-1, 1, 4,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12100           new NutationModel(-2,-2, 0, 4, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12101           new NutationModel( 0,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12102           new NutationModel( 0, 0,-2, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12103           new NutationModel(-1,-1, 0, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12104           new NutationModel(-2, 0, 0, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12105 
12106        /* 551-560 */
12107           new NutationModel(-1, 0, 0, 3, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12108           new NutationModel( 2,-2, 0, 0, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12109           new NutationModel( 1,-1, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12110           new NutationModel(-1, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12111           new NutationModel( 0,-2, 2, 0, 1,     -6.0,   0.0,   -3.0,      3.0,  0.0,    1.0),
12112           new NutationModel(-1, 0, 1, 2, 1,      0.0,   0.0,   -3.0,      0.0,  0.0,   -2.0),
12113           new NutationModel(-1, 1, 0, 3, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12114           new NutationModel(-1,-1, 2, 1, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12115           new NutationModel( 0,-1, 2, 0, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12116           new NutationModel(-2, 1, 2, 2, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12117 
12118        /* 561-570 */
12119           new NutationModel( 2,-2, 2,-2, 2,     -1.0,   0.0,    3.0,      3.0,  0.0,   -1.0),
12120           new NutationModel( 1, 1, 0, 1, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12121           new NutationModel( 1, 0, 1, 0, 1,      0.0,   0.0,  -13.0,      0.0,  0.0,  -11.0),
12122           new NutationModel( 1, 0, 1, 0, 0,      3.0,   0.0,    6.0,      0.0,  0.0,    0.0),
12123           new NutationModel( 0, 2, 0, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12124           new NutationModel( 2,-1, 2,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12125           new NutationModel( 0,-1, 4,-2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12126           new NutationModel( 0, 0, 4,-2, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12127           new NutationModel( 0, 1, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12128           new NutationModel( 4, 0, 2,-4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12129 
12130        /* 571-580 */
12131           new NutationModel( 2, 2, 2,-2, 2,      8.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12132           new NutationModel( 2, 0, 4,-4, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12133           new NutationModel(-1,-2, 0, 4, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12134           new NutationModel(-1,-3, 2, 2, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12135           new NutationModel(-3, 0, 2, 4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12136           new NutationModel(-3, 0, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12137           new NutationModel(-1,-1, 0,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12138           new NutationModel(-3, 0, 0, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12139           new NutationModel(-3, 0,-2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12140           new NutationModel( 0, 1, 0,-4, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12141 
12142        /* 581-590 */
12143           new NutationModel(-2, 1, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12144           new NutationModel(-4, 0, 0, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12145           new NutationModel(-1, 0, 0,-4, 1,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12146           new NutationModel(-3, 0, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12147           new NutationModel( 0, 0, 0, 3, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12148           new NutationModel(-1, 1, 0, 4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12149           new NutationModel( 1,-2, 2, 0, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12150           new NutationModel( 0, 1, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12151           new NutationModel(-1, 0, 2, 2, 3,      6.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12152           new NutationModel( 0, 0, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12153 
12154        /* 591-600 */
12155           new NutationModel(-2, 0, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12156           new NutationModel(-1, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12157           new NutationModel( 3, 0, 0, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12158           new NutationModel( 2, 1, 0, 1, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12159           new NutationModel( 2,-1, 2,-1, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12160           new NutationModel( 0, 0, 2, 0, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12161           new NutationModel( 0, 0, 3, 0, 3,      0.0,   0.0,  -26.0,      0.0,  0.0,  -11.0),
12162           new NutationModel( 0, 0, 3, 0, 2,      0.0,   0.0,  -10.0,      0.0,  0.0,   -5.0),
12163           new NutationModel(-1, 2, 2, 2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12164           new NutationModel(-1, 0, 4, 0, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12165 
12166        /* 601-610 */
12167           new NutationModel( 1, 2, 2, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12168           new NutationModel( 3, 1, 2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12169           new NutationModel( 1, 1, 4,-2, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12170           new NutationModel(-2,-1, 0, 6, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12171           new NutationModel( 0,-2, 0, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12172           new NutationModel(-2, 0, 0, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12173           new NutationModel(-2,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12174           new NutationModel( 0,-3, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12175           new NutationModel( 0, 0, 0, 4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12176           new NutationModel(-1,-1, 2, 3, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12177 
12178        /* 611-620 */
12179           new NutationModel(-2, 0, 2, 4, 0,     13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12180           new NutationModel( 2,-1, 0, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12181           new NutationModel( 1, 0, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12182           new NutationModel( 0, 1, 0, 4, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12183           new NutationModel( 0, 1, 0, 4, 0,    -11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12184           new NutationModel( 1,-1, 2, 1, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12185           new NutationModel( 0, 0, 2, 2, 3,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12186           new NutationModel( 1, 0, 2, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12187           new NutationModel(-1, 0, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12188           new NutationModel(-2, 0, 4, 2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12189 
12190        /* 621-630 */
12191           new NutationModel( 2, 1, 0, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12192           new NutationModel( 2, 1, 0, 2, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12193           new NutationModel( 2,-1, 2, 0, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12194           new NutationModel( 1, 0, 2, 1, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12195           new NutationModel( 0, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12196           new NutationModel( 2, 0, 2, 0, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12197           new NutationModel( 3, 0, 2, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12198           new NutationModel( 1, 0, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12199           new NutationModel( 1, 0, 3, 0, 3,      0.0,   0.0,   -5.0,      0.0,  0.0,   -2.0),
12200           new NutationModel( 1, 1, 2, 1, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12201 
12202        /* 631-640 */
12203           new NutationModel( 0, 2, 2, 2, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12204           new NutationModel( 2, 1, 2, 0, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12205           new NutationModel( 2, 0, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12206           new NutationModel( 4, 1, 2,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12207           new NutationModel(-1,-1, 0, 6, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12208           new NutationModel(-3,-1, 2, 6, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12209           new NutationModel(-1, 0, 0, 6, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12210           new NutationModel(-3, 0, 2, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12211           new NutationModel( 1,-1, 0, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12212           new NutationModel( 1,-1, 0, 4, 0,     12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12213 
12214        /* 641-650 */
12215           new NutationModel(-2, 0, 2, 5, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12216           new NutationModel( 1,-2, 2, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12217           new NutationModel( 3,-1, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12218           new NutationModel( 1,-1, 2, 2, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12219           new NutationModel( 0, 0, 2, 3, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12220           new NutationModel(-1, 1, 2, 4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12221           new NutationModel( 0, 1, 2, 3, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12222           new NutationModel(-1, 0, 4, 2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12223           new NutationModel( 2, 0, 2, 1, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12224           new NutationModel( 5, 0, 0, 0, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12225 
12226        /* 651-660 */
12227           new NutationModel( 2, 1, 2, 1, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12228           new NutationModel( 1, 0, 4, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12229           new NutationModel( 3, 1, 2, 0, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12230           new NutationModel( 3, 0, 4,-2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12231           new NutationModel(-2,-1, 2, 6, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12232           new NutationModel( 0, 0, 0, 6, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12233           new NutationModel( 0,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12234           new NutationModel(-2, 0, 2, 6, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12235           new NutationModel( 2, 0, 0, 4, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12236           new NutationModel( 2, 0, 0, 4, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12237 
12238        /* 661-670 */
12239           new NutationModel( 2,-2, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12240           new NutationModel( 0, 0, 2, 4, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12241           new NutationModel( 1, 0, 2, 3, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12242           new NutationModel( 4, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12243           new NutationModel( 2, 0, 2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12244           new NutationModel( 0, 0, 4, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12245           new NutationModel( 4,-1, 2, 0, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12246           new NutationModel( 3, 0, 2, 1, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12247           new NutationModel( 2, 1, 2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12248           new NutationModel( 4, 1, 2, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12249 
12250        /* 671-678 */
12251           new NutationModel(-1,-1, 2, 6, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12252           new NutationModel(-1, 0, 2, 6, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12253           new NutationModel( 1,-1, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12254           new NutationModel( 1, 1, 2, 4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12255           new NutationModel( 3, 1, 2, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12256           new NutationModel( 5, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12257           new NutationModel( 2,-1, 2, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12258           new NutationModel( 2, 0, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0)
12259        };
12260 
12261     /* Number of terms in the luni-solar nutation model */
12262        final int NLS = xls.length;
12263 
12264     /* ------------------------
12265     /* Planetary nutation model */
12266     /* ------------------------ */
12267 
12268     /* The units for the sine and cosine coefficients are */
12269     /* 0.1 microarcsecond                                 */
12270 
12271        
12272        PlanetaryNutModel xpl[] = {
12273 
12274        /* 1-10 */
12275           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 0, 1440,   0,    0,   0),
12276           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 16,-4,-5, 0, 0, 2,   56,-117,  -42, -40),
12277           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 2,  125, -43,    0, -54),
12278           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0,-1, 2, 2,    0,   5,    0,   0),
12279           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-1,-5, 0, 0, 2,    3,  -7,   -3,   0),
12280           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 1,    3,   0,    0,  -2),
12281           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  3, -8, 3, 0, 0, 0, 0, -114,   0,    0,  61),
12282           new PlanetaryNutModel(-1, 0, 0, 0, 0, 10, -3,  0, 0, 0, 0, 0, 0, -219,  89,    0,   0),
12283           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 6,-3, 0, 2,   -3,   0,    0,   0),
12284           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0, -462,1604,    0,   0),
12285 
12286        /* 11-20 */
12287           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -5,  8,-3, 0, 0, 0, 0,   99,   0,    0, -53),
12288           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-3, 0, 0, 0, 1,   -3,   0,    0,   2),
12289           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 1, 5, 0, 0, 2,    0,   6,    2,   0),
12290           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  4, 0, 0, 0, 0, 2,    3,   0,    0,   0),
12291           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 2,  -12,   0,    0,   0),
12292           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 1,   14,-218,  117,   8),
12293           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2,-5, 0, 0, 0,   31,-481, -257, -17),
12294           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 0, -491, 128,    0,   0),
12295           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 5, 0, 0, 0,-3084,5123, 2735,1647),
12296           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 1,-1444,2409,-1286,-771),
12297 
12298        /* 21-30 */
12299           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 2,   11, -24,  -11,  -9),
12300           new PlanetaryNutModel( 2,-1,-1, 0, 0,  0,  3, -7, 0, 0, 0, 0, 0,   26,  -9,    0,   0),
12301           new PlanetaryNutModel( 1, 0,-2, 0, 0, 19,-21,  3, 0, 0, 0, 0, 0,  103, -60,    0,   0),
12302           new PlanetaryNutModel( 0, 1,-1, 1, 0,  2, -4,  0,-3, 0, 0, 0, 0,    0, -13,   -7,   0),
12303           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -26, -29,  -16,  14),
12304           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-4,10, 0, 0, 0,    9, -27,  -14,  -5),
12305           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0, 0,-5, 0, 0, 0,   12,   0,    0,  -6),
12306           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -7,  4, 0, 0, 0, 0, 0,   -7,   0,    0,   0),
12307           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1,-1, 0, 0, 0,    0,  24,    0,   0),
12308           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,  284,   0,    0,-151),
12309 
12310        /* 31-40 */
12311           new PlanetaryNutModel(-1, 0, 0, 0, 0, 18,-16,  0, 0, 0, 0, 0, 0,  226, 101,    0,   0),
12312           new PlanetaryNutModel(-2, 1, 1, 2, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -8,   -2,   0),
12313           new PlanetaryNutModel(-1, 1,-1, 1, 0, 18,-17,  0, 0, 0, 0, 0, 0,    0,  -6,   -3,   0),
12314           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12315           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 2,  -41, 175,   76,  17),
12316           new PlanetaryNutModel( 0, 2,-2, 2, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,  15,    6,   0),
12317           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 1,  425, 212, -133, 269),
12318           new PlanetaryNutModel( 0, 1,-1, 1, 0, -8, 12,  0, 0, 0, 0, 0, 0, 1200, 598,  319,-641),
12319           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 0,  235, 334,    0,   0),
12320           new PlanetaryNutModel( 0, 1,-1, 1, 0,  8,-14,  0, 0, 0, 0, 0, 0,   11, -12,   -7,  -6),
12321 
12322        /* 41-50 */
12323           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 1,    5,  -6,    3,   3),
12324           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-4, 5, 0, 0, 0,   -5,   0,    0,   3),
12325           new PlanetaryNutModel(-2, 0, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12326           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 1, 0, 0, 0,   15,   0,    0,   0),
12327           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 2, 0, 0, 0, 0,   13,   0,    0,  -7),
12328           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-4, 3, 0, 0, 0,   -6,  -9,    0,   0),
12329           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,  266, -78,    0,   0),
12330           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  2, 0, 0, 0, 0, 0, -460,-435, -232, 246),
12331           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -2,  2, 0, 0, 0, 0, 0,    0,  15,    7,   0),
12332           new PlanetaryNutModel(-1, 1, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12333 
12334        /* 51-60 */
12335           new PlanetaryNutModel(-1, 0, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0, 131,    0,   0),
12336           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2,-2, 0, 0, 0,    4,   0,    0,   0),
12337           new PlanetaryNutModel(-2, 2, 0, 2, 0,  0, -5,  9, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12338           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0,-1, 0, 0,    0,   4,    2,   0),
12339           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 1, 0, 0,    0,   3,    0,   0),
12340           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 2, 0,  -17, -19,  -10,   9),
12341           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 1,   -9, -11,    6,  -5),
12342           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 2,   -6,   0,    0,   3),
12343           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -16,   8,    0,   0),
12344           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 2, 0, 0, 0,    0,   3,    0,   0),
12345 
12346        /* 61-70 */
12347           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 2, 0, 0, 0,   11,  24,   11,  -5),
12348           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -9, 17, 0, 0, 0, 0, 0,   -3,  -4,   -2,   1),
12349           new PlanetaryNutModel( 0, 0, 0, 2, 0, -3,  5,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12350           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 2, 0, 0, 0,    0,  -8,   -4,   0),
12351           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1,-2, 0, 0, 0,    0,   3,    0,   0),
12352           new PlanetaryNutModel( 1, 0,-2, 0, 0, 17,-16,  0,-2, 0, 0, 0, 0,    0,   5,    0,   0),
12353           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1,-3, 0, 0, 0,    0,   3,    2,   0),
12354           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  5, -6, 0, 0, 0, 0, 0,   -6,   4,    2,   3),
12355           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  9,-13, 0, 0, 0, 0, 0,   -3,  -5,    0,   0),
12356           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 1, 0, 0, 0,   -5,   0,    0,   2),
12357 
12358        /* 71-80 */
12359           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0, 1, 0, 0, 0,    4,  24,   13,  -2),
12360           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 1, 0, 0, 0,  -42,  20,    0,   0),
12361           new PlanetaryNutModel( 0,-2, 2, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,  -10, 233,    0,   0),
12362           new PlanetaryNutModel( 0,-1, 1, 1, 0,  5, -7,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12363           new PlanetaryNutModel(-2, 0, 2, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   78, -18,    0,   0),
12364           new PlanetaryNutModel( 2, 1,-3, 1, 0, -6,  7,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12365           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  0,  0, 1, 0, 0, 0, 0,    0,  -3,   -1,   0),
12366           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  1,  0, 1, 0, 0, 0, 0,    0,  -4,   -2,   1),
12367           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 2, 0, 0,    0,  -8,   -4,  -1),
12368           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 1,    0,  -5,    3,   0),
12369 
12370        /* 81-90 */
12371           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 2,   -7,   0,    0,   3),
12372           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 2,  -14,   8,    3,   6),
12373           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 1,    0,   8,   -4,   0),
12374           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -9, 15, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12375           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   45, -22,    0,   0),
12376           new PlanetaryNutModel( 1,-1,-1, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12377           new PlanetaryNutModel( 2, 0,-2, 0, 0,  2, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12378           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-5, 5, 0, 0, 0,    0,   3,    0,   0),
12379           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -6,  8, 0, 0, 0, 0, 0,    3,   5,    3,  -2),
12380           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   89, -16,   -9, -48),
12381 
12382        /* 91-100 */
12383           new PlanetaryNutModel(-2, 1, 1, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,    0,   3,    0,   0),
12384           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-3, 0, 0, 0, 0,   -3,   7,    4,   2),
12385           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0, -349, -62,    0,   0),
12386           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  6, -8, 0, 0, 0, 0, 0,  -15,  22,    0,   0),
12387           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-1,-5, 0, 0, 0,   -3,   0,    0,   0),
12388           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,  -53,   0,    0,   0),
12389           new PlanetaryNutModel(-1, 1, 1, 1, 0,-20, 20,  0, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12390           new PlanetaryNutModel( 1, 0,-2, 0, 0, 20,-21,  0, 0, 0, 0, 0, 0,    0,  -8,    0,   0),
12391           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  8,-15, 0, 0, 0, 0, 0,   15,  -7,   -4,  -8),
12392           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,-10, 15, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12393 
12394        /* 101-110 */
12395           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,  -21, -78,    0,   0),
12396           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 1, 0, 0, 0, 0,   20, -70,  -37, -11),
12397           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,   6,    3,   0),
12398           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 4, 0, 0, 0,    5,   3,    2,  -2),
12399           new PlanetaryNutModel( 2, 0,-2, 1, 0, -6,  8,  0, 0, 0, 0, 0, 0,  -17,  -4,   -2,   9),
12400           new PlanetaryNutModel( 0,-2, 2, 1, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   6,    3,   0),
12401           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0,-1, 0, 0, 1,   32,  15,   -8,  17),
12402           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-1, 0, 0, 0,  174,  84,   45, -93),
12403           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 0,   11,  56,    0,   0),
12404           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 1, 0, 0, 0,  -66, -12,   -6,  35),
12405 
12406        /* 111-120 */
12407           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 1,   47,   8,    4, -25),
12408           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 2,    0,   8,    4,   0),
12409           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -9, 13, 0, 0, 0, 0, 0,   10, -22,  -12,  -5),
12410           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  7,-13, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12411           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,  -24,  12,    0,   0),
12412           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  9,-17, 0, 0, 0, 0, 0,    5,  -6,    0,   0),
12413           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -9, 17, 0, 0, 0, 0, 2,    3,   0,    0,  -2),
12414           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    4,   3,    1,  -2),
12415           new PlanetaryNutModel( 1, 0,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  29,   15,   0),
12416           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -1,  2, 0, 0, 0, 0, 0,   -5,  -4,   -2,   2),
12417 
12418        /* 121-130 */
12419           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  0,  2, 0, 0, 0, 0, 0,    8,  -3,   -1,  -5),
12420           new PlanetaryNutModel( 0,-2, 2, 0, 1,  0, -2,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12421           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 2, 0, 0, 0, 0,   10,   0,    0,   0),
12422           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 1, 0, 0, 0,    3,   0,    0,  -2),
12423           new PlanetaryNutModel(-2, 0, 2, 1, 0,  3, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   3),
12424           new PlanetaryNutModel( 0, 0, 0, 1, 0,  8,-13,  0, 0, 0, 0, 0, 0,   46,  66,   35, -25),
12425           new PlanetaryNutModel( 0,-1, 1, 0, 0,  8,-12,  0, 0, 0, 0, 0, 0,  -14,   7,    0,   0),
12426           new PlanetaryNutModel( 0, 2,-2, 1, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12427           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12428           new PlanetaryNutModel(-1, 0, 0, 1, 0, 18,-16,  0, 0, 0, 0, 0, 0,  -68, -34,  -18,  36),
12429 
12430        /* 131-140 */
12431           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 1, 0, 0, 0,    0,  14,    7,   0),
12432           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -7,  4, 0, 0, 0, 0, 0,   10,  -6,   -3,  -5),
12433           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0, -3,  7, 0, 0, 0, 0, 0,   -5,  -4,   -2,   3),
12434           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-2, 5, 0, 0, 0,   -3,   5,    2,   1),
12435           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-2, 5, 0, 0, 0,   76,  17,    9, -41),
12436           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,   84, 298,  159, -45),
12437           new PlanetaryNutModel( 1, 0, 0, 1, 0,-10,  3,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12438           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12439           new PlanetaryNutModel(-1, 0, 0, 1, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12440           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,  -82, 292,  156,  44),
12441 
12442        /* 141-150 */
12443           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 2,-5, 0, 0, 0,  -73,  17,    9,  39),
12444           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,   -9, -16,    0,   0),
12445           new PlanetaryNutModel( 2,-1,-1, 1, 0,  0,  3, -7, 0, 0, 0, 0, 0,    3,   0,   -1,  -2),
12446           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-5, 0, 0, 0,   -3,   0,    0,   0),
12447           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  7, -4, 0, 0, 0, 0, 0,   -9,  -5,   -3,   5),
12448           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0, -439,   0,    0,   0),
12449           new PlanetaryNutModel( 1, 0, 0, 1, 0,-18, 16,  0, 0, 0, 0, 0, 0,   57, -28,  -15, -30),
12450           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -6,   -3,   0),
12451           new PlanetaryNutModel( 0, 1,-1, 2, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12452           new PlanetaryNutModel( 0, 0, 0, 1, 0, -8, 13,  0, 0, 0, 0, 0, 0,  -40,  57,   30,  21),
12453 
12454        /* 151-160 */
12455           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 1,   23,   7,    3, -13),
12456           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  0, -2, 0, 0, 0, 0, 0,  273,  80,   43,-146),
12457           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 0, -449, 430,    0,   0),
12458           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,   -8, -47,  -25,   4),
12459           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  2, 0, 0, 0, 0, 1,    6,  47,   25,  -3),
12460           new PlanetaryNutModel(-1, 0, 1, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  23,   13,   0),
12461           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  3, -4, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12462           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-2, 0, 0, 0,    3,  -4,   -2,  -2),
12463           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 2, 0, 0, 0,  -48,-110,  -59,  26),
12464           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 1,   51, 114,   61, -27),
12465 
12466        /* 161-170 */
12467           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 2, -133,   0,    0,  57),
12468           new PlanetaryNutModel( 0, 1,-1, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12469           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  5,  0, 0, 0, 0, 0, 0,  -21,  -6,   -3,  11),
12470           new PlanetaryNutModel( 0, 1,-1, 2, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  -3,   -1,   0),
12471           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  4, 0, 0, 0, 0, 0,  -11, -21,  -11,   6),
12472           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,  -18,-436, -233,   9),
12473           new PlanetaryNutModel( 0,-1, 1, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   35,  -7,    0,   0),
12474           new PlanetaryNutModel( 0, 0, 0, 1, 0,  5, -8,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12475           new PlanetaryNutModel(-2, 0, 2, 1, 0,  6, -8,  0, 0, 0, 0, 0, 0,   11,  -3,   -1,  -6),
12476           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -8, 15, 0, 0, 0, 0, 0,   -5,  -3,   -1,   3),
12477 
12478        /* 171-180 */
12479           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 0, 0, 0, 0,  -53,  -9,   -5,  28),
12480           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  6, -8, 0, 0, 0, 0, 0,    0,   3,    2,   1),
12481           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    4,   0,    0,  -2),
12482           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3,-5, 0, 0, 0,    0,  -4,    0,   0),
12483           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 0, 0, 0, 0,  -50, 194,  103,  27),
12484           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-1, 0, 0, 0, 1,  -13,  52,   28,   7),
12485           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 0,  -91, 248,    0,   0),
12486           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    6,  49,   26,  -3),
12487           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   -6, -47,  -25,   3),
12488           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    0,   5,    3,   0),
12489 
12490        /* 181-190 */
12491           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 2,   52,  23,   10, -23),
12492           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0,-1, 0, 0, 0,   -3,   0,    0,   1),
12493           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0,-1, 0, 0, 0,    0,   5,    3,   0),
12494           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,   -4,   0,    0,   0),
12495           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 13, 0, 0, 0, 0, 2,   -4,   8,    3,   2),
12496           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7,-13, 0, 0, 0, 0, 0,   10,   0,    0,   0),
12497           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -5,  6, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12498           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -8, 11, 0, 0, 0, 0, 0,    0,   8,    4,   0),
12499           new PlanetaryNutModel( 0, 2,-2, 1,-1,  0,  2,  0, 0, 0, 0, 0, 0,    0,   8,    4,   1),
12500           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12501 
12502        /* 191-200 */
12503           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-2, 0, 0, 0,   -4,   0,    0,   0),
12504           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 3, 0, 0, 0,   -8,   4,    2,   4),
12505           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 1,    8,  -4,   -2,  -4),
12506           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 2,    0,  15,    7,   0),
12507           new PlanetaryNutModel(-2, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0, -138,   0,    0,   0),
12508           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12509           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12510           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   54,   0,    0, -29),
12511           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,  10,    4,   0),
12512           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0,  0, -2, 0, 0, 0, 0, 0,   -7,   0,    0,   3),
12513 
12514        /* 201-210 */
12515           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1, -2, 0, 0, 0, 0, 0,  -37,  35,   19,  20),
12516           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12517           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -4,   9,    0,   0),
12518           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 2, 0, 0, 0,    8,   0,    0,  -4),
12519           new PlanetaryNutModel( 0, 1,-1, 1, 0,  3, -6,  0, 0, 0, 0, 0, 0,   -9, -14,   -8,   5),
12520           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 1,   -3,  -9,   -5,   3),
12521           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 0, -145,  47,    0,   0),
12522           new PlanetaryNutModel( 0, 1,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,  -10,  40,   21,   5),
12523           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 1,   11, -49,  -26,  -7),
12524           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,-2150,   0,    0, 932),
12525 
12526        /* 211-220 */
12527           new PlanetaryNutModel( 0, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,  -12,   0,    0,   5),
12528           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,   85,   0,    0, -37),
12529           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12530           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1, -4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12531           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 0,  -86, 153,    0,   0),
12532           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -6,   9,    5,   3),
12533           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    9, -13,   -7,  -5),
12534           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -8,  12,    6,   4),
12535           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 2,  -51,   0,    0,  22),
12536           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,  -11,-268, -116,   5),
12537 
12538        /* 221-230 */
12539           new PlanetaryNutModel( 0, 2,-2, 2, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,  12,    5,   0),
12540           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,    0,   7,    3,   0),
12541           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   31,   6,    3, -17),
12542           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  7,  0, 0, 0, 0, 0, 0,  140,  27,   14, -75),
12543           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   57,  11,    6, -30),
12544           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -8,  0, 0, 0, 0, 0, 0,  -14, -39,    0,   0),
12545           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-1, 0, 0, 0, 0,    0,  -6,   -2,   0),
12546           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-1, 0, 0, 0, 0,    4,  15,    8,  -2),
12547           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    0,   4,    0,   0),
12548           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 1, 0, 0, 0, 0,   -3,   0,    0,   1),
12549 
12550        /* 231-240 */
12551           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 11, 0, 0, 0, 0, 2,    0,  11,    5,   0),
12552           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,-11, 0, 0, 0, 0, 0,    9,   6,    0,   0),
12553           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  4,  0, 0, 0, 0, 0, 2,   -4,  10,    4,   2),
12554           new PlanetaryNutModel( 0, 0, 0, 0, 1,  0, -4,  0, 0, 0, 0, 0, 0,    5,   3,    0,   0),
12555           new PlanetaryNutModel( 2, 0,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,   16,   0,    0,  -9),
12556           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   -3,   0,    0,   0),
12557           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -7,  9, 0, 0, 0, 0, 0,    0,   3,    2,  -1),
12558           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4,-5, 0, 0, 2,    7,   0,    0,  -3),
12559           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 0,  -25,  22,    0,   0),
12560           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,   42, 223,  119, -22),
12561 
12562        /* 241-250 */
12563           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -27,-143,  -77,  14),
12564           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,    9,  49,   26,  -5),
12565           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 2,-1166,   0,    0, 505),
12566           new PlanetaryNutModel( 0, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -5,   0,    0,   2),
12567           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 5, 0, 0, 2,   -6,   0,    0,   3),
12568           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -8,   0,    1,   4),
12569           new PlanetaryNutModel( 0,-1, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12570           new PlanetaryNutModel( 0, 2,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,  117,   0,    0, -63),
12571           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -4, 0, 0, 0, 0, 0,   -4,   8,    4,   2),
12572           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12573 
12574        /* 251-260 */
12575           new PlanetaryNutModel( 0, 1,-1, 2, 0, -5,  7,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   2),
12576           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -6, 0, 0, 0, 0, 0,    0,  31,    0,   0),
12577           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -5,   0,    1,   3),
12578           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -4,  6, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12579           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12580           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 2,  -24, -13,   -6,  10),
12581           new PlanetaryNutModel( 0,-1, 1, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12582           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0, -32,  -17,   0),
12583           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 2,    8,  12,    5,  -3),
12584           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12585 
12586        /* 261-270 */
12587           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -9, 0, 0, 0, 0, 0,    7,  13,    0,   0),
12588           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0,   -3,  16,    0,   0),
12589           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   50,   0,    0, -27),
12590           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -5,   -3,   0),
12591           new PlanetaryNutModel( 0,-2, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12592           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 1,    0,   5,    3,   1),
12593           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 2,   24,   5,    2, -11),
12594           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 2,    5, -11,   -5,  -2),
12595           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 1,   30,  -3,   -2, -16),
12596           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   18,   0,    0,  -9),
12597 
12598        /* 271-280 */
12599           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 0,    8, 614,    0,   0),
12600           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 1,    3,  -3,   -1,  -2),
12601           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    6,  17,    9,  -3),
12602           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 3, 0, 0, 0, 0,   -3,  -9,   -5,   2),
12603           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    0,   6,    3,  -1),
12604           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 2, -127,  21,    9,  55),
12605           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 0, 0, 0, 0, 0,    3,   5,    0,   0),
12606           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8, 0, 0, 0, 0, 2,   -6, -10,   -4,   3),
12607           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    5,   0,    0,   0),
12608           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 2,   16,   9,    4,  -7),
12609 
12610        /* 281-290 */
12611           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12612           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -7, 0, 0, 0, 0, 0,    0,  22,    0,   0),
12613           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12614           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,    7,   0,    0,  -4),
12615           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 10, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12616           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12617           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4, 0, 0, 0, 2,   -9,   3,    1,   4),
12618           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 2,   17,   0,    0,  -7),
12619           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 1,    0,  -3,   -2,  -1),
12620           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -5, 0, 0, 0, 0, 0,  -20,  34,    0,   0),
12621 
12622        /* 291-300 */
12623           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 1,  -10,   0,    1,   5),
12624           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -3,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12625           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 0,   22, -87,    0,   0),
12626           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12627           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 2,   -3,  -6,   -2,   1),
12628           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 2,  -16,  -3,   -1,   7),
12629           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12630           new PlanetaryNutModel( 0,-2, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12631           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -3, 0, 0, 0, 0, 0,  -68,  39,    0,   0),
12632           new PlanetaryNutModel( 0, 2,-2, 1, 0, -4,  4,  0, 0, 0, 0, 0, 0,   27,   0,    0, -14),
12633 
12634        /* 301-310 */
12635           new PlanetaryNutModel( 0,-1, 1, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12636           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -1, 0, 0, 0, 0, 0,  -25,   0,    0,   0),
12637           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 1,  -12,  -3,   -2,   6),
12638           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  6,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12639           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 2,    3,  66,   29,  -1),
12640           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 2,  490,   0,    0,-213),
12641           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,  -22,  93,   49,  12),
12642           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  5,  0, 0, 0, 0, 0, 0,   -7,  28,   15,   4),
12643           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,   -3,  13,    7,   2),
12644           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -6,  0, 0, 0, 0, 0, 0,  -46,  14,    0,   0),
12645 
12646        /* 311-320 */
12647           new PlanetaryNutModel(-2, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12648           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  1, 0, 0, 0, 0, 0,    2,   1,    0,   0),
12649           new PlanetaryNutModel( 0,-1, 1, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12650           new PlanetaryNutModel( 0, 0, 0, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,  -28,   0,    0,  15),
12651           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12652           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -3, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12653           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  3, 0, 0, 0, 0, 2,  -11,   0,    0,   5),
12654           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 12, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12655           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12656           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 1,   25, 106,   57, -13),
12657 
12658        /* 321-330 */
12659           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  0,  0, 0, 0, 0, 0, 0,    5,  21,   11,  -3),
12660           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0, 1485,   0,    0,   0),
12661           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 1,   -7, -32,  -17,   4),
12662           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -2,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12663           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  5, 0, 0, 0, 0, 2,   -6,  -3,   -2,   3),
12664           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 4, 0, 0, 0, 2,   30,  -6,   -2, -13),
12665           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-4, 0, 0, 0, 0,   -4,   4,    0,   0),
12666           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  1,  0, 0, 0, 0, 0, 0,  -19,   0,    0,  10),
12667           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 2,    0,   4,    2,  -1),
12668           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12669 
12670        /* 331-340 */
12671           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -3,  0, 3, 0, 0, 0, 0,    4,   0,    0,  -2),
12672           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  7, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12673           new PlanetaryNutModel(-2, 0, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12674           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  8, 0, 0, 0, 0, 2,    5,   3,    1,  -2),
12675           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 0, 0, 0, 0, 0,    0,  11,    0,   0),
12676           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 2,  118,   0,    0, -52),
12677           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 1,    0,  -5,   -3,   0),
12678           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,  -28,  36,    0,   0),
12679           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -4,  0, 0, 0, 0, 0, 0,    5,  -5,    0,   0),
12680           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 1,   14, -59,  -31,  -8),
12681 
12682        /* 341-350 */
12683           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   9,    5,   1),
12684           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 2, -458,   0,    0, 198),
12685           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 2,    0, -45,  -20,   0),
12686           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 1,    9,   0,    0,  -5),
12687           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -9,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12688           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -4,   -2,  -1),
12689           new PlanetaryNutModel( 0, 2,-2, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   11,   0,    0,  -6),
12690           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  6, 0, 0, 0, 0, 2,    6,   0,    0,  -2),
12691           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -6, 0, 0, 0, 0, 0,  -16,  23,    0,   0),
12692           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,   -2,   0),
12693 
12694        /* 351-360 */
12695           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 2, 0, 0, 0, 2,   -5,   0,    0,   2),
12696           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0, -166, 269,    0,   0),
12697           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   15,   0,    0,  -8),
12698           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  9,  0, 0, 0, 0, 0, 2,   10,   0,    0,  -4),
12699           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -78,  45,    0,   0),
12700           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12701           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 1,    7,   0,    0,  -4),
12702           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,   -5, 328,    0,   0),
12703           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12704           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -2),
12705 
12706        /* 361-370 */
12707           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,   3,    1,   0),
12708           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-3, 0, 0, 0,   -3,   0,    0,   0),
12709           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-5, 0, 0, 0,   -3,   0,    0,   0),
12710           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 1,    0,  -4,   -2,   0),
12711           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,-1223, -26,    0,   0),
12712           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 1,    0,   7,    3,   0),
12713           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 5, 0, 0, 0,    3,   0,    0,   0),
12714           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12715           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -6,  20,    0,   0),
12716           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0, -368,   0,    0,   0),
12717 
12718        /* 371-380 */
12719           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,  -75,   0,    0,   0),
12720           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   11,   0,    0,  -6),
12721           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12722           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 14,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12723           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,  -13, -30,    0,   0),
12724           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 0,   21,   3,    0,   0),
12725           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 2,   -3,   0,    0,   1),
12726           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12727           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    8, -27,    0,   0),
12728           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -8, 3, 0, 0, 0, 0,  -19, -11,    0,   0),
12729 
12730        /* 381-390 */
12731           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  8,-3, 0, 0, 0, 2,   -4,   0,    0,   2),
12732           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 5, 0, 0, 2,    0,   5,    2,   0),
12733           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   2),
12734           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   0),
12735           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-2, 0, 0, 0,   -1,   0,    0,   0),
12736           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 1, 0, 0, 2,  -14,   0,    0,   6),
12737           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12738           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 2,  -74,   0,    0,  32),
12739           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 2, 0, 0, 2,    0,  -3,   -1,   0),
12740           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  5,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12741 
12742        /* 391-400 */
12743           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,    8,  11,    0,   0),
12744           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 1,    0,   3,    2,   0),
12745           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 2, -262,   0,    0, 114),
12746           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12747           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 1,   -7,   0,    0,   4),
12748           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 2,    0, -27,  -12,   0),
12749           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  4, 0, 0, 0, 0, 2,  -19,  -8,   -4,   8),
12750           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 2,  202,   0,    0, -87),
12751           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 1,   -8,  35,   19,   5),
12752           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,   4,    2,   0),
12753 
12754        /* 401-410 */
12755           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   16,  -5,    0,   0),
12756           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    5,   0,    0,  -3),
12757           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,  -3,    0,   0),
12758           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  3,  0, 0, 0, 0, 0, 2,    1,   0,    0,   0),
12759           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2, 0, 0, 0, 2,  -35, -48,  -21,  15),
12760           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  6, 0, 0, 0, 0, 2,   -3,  -5,   -2,   1),
12761           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12762           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6,  9, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12763           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -9, 0, 0, 0, 0, 0,    0,  -5,    0,   0),
12764           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  2,  0, 0, 0, 0, 0, 1,   12,  55,   29,  -6),
12765 
12766        /* 411-420 */
12767           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12768           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0, -598,   0,    0,   0),
12769           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 1,   -3, -13,   -7,   1),
12770           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 3, 0, 0, 0, 2,   -5,  -7,   -3,   2),
12771           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  7, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12772           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -7, 0, 0, 0, 0, 0,    5,  -7,    0,   0),
12773           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12774           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -5, 0, 0, 0, 0, 0,   16,  -6,    0,   0),
12775           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -3,  0, 0, 0, 0, 0, 0,    8,  -3,    0,   0),
12776           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 1,    8, -31,  -16,  -4),
12777 
12778        /* 421-430 */
12779           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12780           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 2,  113,   0,    0, -49),
12781           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 2,    0, -24,  -10,   0),
12782           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12783           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -3, 0, 0, 0, 0, 0,   27,   0,    0,   0),
12784           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  8,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12785           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12786           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 1,    5,   0,    0,  -2),
12787           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12788           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  1, 0, 0, 0, 0, 2,  -13,   0,    0,   6),
12789 
12790        /* 431-440 */
12791           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12792           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  3, 0, 0, 0, 0, 2,  -18, -10,   -4,   8),
12793           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,   -4, -28,    0,   0),
12794           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 2,   -5,   6,    3,   2),
12795           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 13,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12796           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  5, 0, 0, 0, 0, 2,   -5,  -9,   -4,   2),
12797           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 4, 0, 0, 0, 2,   17,   0,    0,  -7),
12798           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-4, 0, 0, 0, 0,   11,   4,    0,   0),
12799           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  7, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12800           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   83,  15,    0,   0),
12801 
12802        /* 441-450 */
12803           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12804           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 2,    0,-114,  -49,   0),
12805           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 2,  117,   0,    0, -51),
12806           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 1,   -5,  19,   10,   2),
12807           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12808           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
12809           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  9, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12810           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12811           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12812           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  393,   3,    0,   0),
12813 
12814        /* 451-460 */
12815           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 1,   -4,  21,   11,   2),
12816           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 2,   -6,   0,   -1,   3),
12817           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5, 10,  0, 0, 0, 0, 0, 2,   -3,   8,    4,   1),
12818           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,    8,   0,    0,   0),
12819           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 2,   18, -29,  -13,  -8),
12820           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  3,  0, 0, 0, 0, 0, 1,    8,  34,   18,  -4),
12821           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   89,   0,    0,   0),
12822           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 1,    3,  12,    6,  -1),
12823           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 2,   54, -15,   -7, -24),
12824           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-3, 0, 0, 0,    0,   3,    0,   0),
12825 
12826        /* 461-470 */
12827           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 13, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12828           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 0,    0,  35,    0,   0),
12829           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 2, -154, -30,  -13,  67),
12830           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   15,   0,    0,   0),
12831           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 1,    0,   4,    2,   0),
12832           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12833           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 2,   80, -71,  -31, -35),
12834           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-1, 0, 0, 2,    0, -20,   -9,   0),
12835           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 15, 0, 0, 0, 0, 2,   11,   5,    2,  -5),
12836           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 15,  0, 0, 0, 0, 0, 2,   61, -96,  -42, -27),
12837 
12838        /* 471-480 */
12839           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  9, -4, 0, 0, 0, 0, 2,   14,   9,    4,  -6),
12840           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2,-5, 0, 0, 2,  -11,  -6,   -3,   5),
12841           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-1,-5, 0, 0, 2,    0,  -3,   -1,   0),
12842           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 3, 0, 0, 0, 2,  123,-415, -180, -53),
12843           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,    0,   0,    0, -35),
12844           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12845           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    7, -32,  -17,  -4),
12846           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -9,   -5,   0),
12847           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    0,  -4,    2,   0),
12848           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 2,  -89,   0,    0,  38),
12849 
12850        /* 481-490 */
12851           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 16,-4,-5, 0, 0, 2,    0, -86,  -19,  -6),
12852           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2,    0,   0,  -19,   6),
12853           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2, -123,-416, -180,  53),
12854           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 1, 5, 0, 0, 2,    0,  -3,   -1,   0),
12855           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 5, 0, 0, 2,   12,  -6,   -3,  -5),
12856           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  4, 0, 0, 0, 0, 2,  -13,   9,    4,   6),
12857           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,    0, -15,   -7,   0),
12858           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12859           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,  -62, -97,  -42,  27),
12860           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, 11,  0, 0, 0, 0, 0, 2,  -11,   5,    2,   5),
12861 
12862        /* 491-500 */
12863           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 1, 0, 0, 2,    0, -19,   -8,   0),
12864           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 2, 0, 0, 0, 2,   -3,   0,    0,   1),
12865           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   4,    2,   0),
12866           new PlanetaryNutModel( 0, 1,-1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12867           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   4,    2,   0),
12868           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  2, 0, 0, 0, 0, 2,  -85, -70,  -31,  37),
12869           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 1, 0, 0, 0, 2,  163, -12,   -5, -72),
12870           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  7,  0, 0, 0, 0, 0, 2,  -63, -16,   -7,  28),
12871           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  4, 0, 0, 0, 0, 2,  -21, -32,  -14,   9),
12872           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12873 
12874        /* 501-510 */
12875           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12876           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   8,    0,   0),
12877           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 2,    3,  10,    4,  -1),
12878           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2, 0, 0, 0, 2,    3,   0,    0,  -1),
12879           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  6, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12880           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -9, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12881           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 0,    6,  19,    0,   0),
12882           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 2,    5,-173,  -75,  -2),
12883           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -7, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12884           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -5, 0, 0, 0, 0, 2,    7, -12,   -5,  -3),
12885 
12886        /* 511-520 */
12887           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 1,   -3,   0,    0,   2),
12888           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 2,    3,  -4,   -2,  -1),
12889           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 2,   74,   0,    0, -32),
12890           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 1,   -3,  12,    6,   2),
12891           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -3, 0, 0, 0, 0, 2,   26, -14,   -6, -11),
12892           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -1, 0, 0, 0, 0, 2,   19,   0,    0,  -8),
12893           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  4,  0, 0, 0, 0, 0, 1,    6,  24,   13,  -3),
12894           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   83,   0,    0,   0),
12895           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 1,    0, -10,   -5,   0),
12896           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 2,   11,  -3,   -1,  -5),
12897 
12898        /* 521-530 */
12899           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  1, 0, 0, 0, 0, 2,    3,   0,    1,  -1),
12900           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  0, 5, 0, 0, 0, 2,    3,   0,    0,  -1),
12901           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12902           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 1,    5, -23,  -12,  -3),
12903           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 2, -339,   0,    0, 147),
12904           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 12,  0, 0, 0, 0, 0, 2,    0, -10,   -5,   0),
12905           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-4, 0, 0, 0, 0,    5,   0,    0,   0),
12906           new PlanetaryNutModel( 0, 2,-2, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12907           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12908           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 0,   18,  -3,    0,   0),
12909 
12910        /* 531-540 */
12911           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 2,    9, -11,   -5,  -4),
12912           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  6,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12913           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  7,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12914           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -7,  0, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12915           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -6, 0, 0, 0, 0, 2,    6,  -9,   -4,  -2),
12916           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 0,   -4, -12,    0,   0),
12917           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 2,   67, -91,  -39, -29),
12918           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -4, 0, 0, 0, 0, 2,   30, -18,   -8, -13),
12919           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 0,    0,   0,    0,   0),
12920           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 2,    0,-114,  -50,   0),
12921 
12922        /* 541-550 */
12923           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,    0,   0,    0,  23),
12924           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,  517,  16,    7,-224),
12925           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-2, 0, 0, 2,    0,  -7,   -3,   0),
12926           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -2, 0, 0, 0, 0, 2,  143,  -3,   -1, -62),
12927           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-1, 0, 0, 2,   29,   0,    0, -13),
12928           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -4,   0,    0,   2),
12929           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 16,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   3),
12930           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 2,-5, 0, 0, 2,    5,  12,    5,  -2),
12931           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 3, 0, 0, 0, 2,  -25,   0,    0,  11),
12932           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 16,-4,-5, 0, 0, 2,   -3,   0,    0,   1),
12933 
12934        /* 551-560 */
12935           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12936           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  8,-3, 0, 0, 0, 2,  -22,  12,    5,  10),
12937           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,   50,   0,    0, -22),
12938           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12939           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12940           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  2, 0, 0, 0, 0, 2,   -4,   4,    2,   2),
12941           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 1, 0, 0, 0, 2,   -5, -11,   -5,   2),
12942           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  8,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12943           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  5,  0, 0, 0, 0, 0, 1,    4,  17,    9,  -2),
12944           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 0,   59,   0,    0,   0),
12945 
12946        /* 561-570 */
12947           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 1,    0,  -4,   -2,   0),
12948           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12949           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12950           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 1,    4, -15,   -8,  -2),
12951           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 2,  370,  -8,    0,-160),
12952           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   0,   -3,   0),
12953           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12954           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -5, 0, 0, 0, 0, 2,   -6,   3,    1,   3),
12955           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -8,  0, 0, 0, 0, 0, 0,    0,   6,    0,   0),
12956           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -3, 0, 0, 0, 0, 2,  -10,   0,    0,   4),
12957 
12958        /* 571-580 */
12959           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -3,  0, 0, 0, 0, 0, 2,    0,   9,    4,   0),
12960           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  2,  0, 0, 0, 0, 0, 2,    4,  17,    7,  -2),
12961           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 2,   34,   0,    0, -15),
12962           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12963           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-4, 0, 0, 0, 2,   -5,   0,    0,   2),
12964           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-3, 0, 0, 0, 2,  -37,  -7,   -3,  16),
12965           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  6,  0, 0, 0, 0, 0, 1,    3,  13,    7,  -2),
12966           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 0,   40,   0,    0,   0),
12967           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12968           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-2, 0, 0, 0, 2, -184,  -3,   -1,  80),
12969 
12970        /* 581-590 */
12971           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -4, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12972           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12973           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 1,    0, -10,   -6,  -1),
12974           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 2,   31,  -6,    0, -13),
12975           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-1, 0, 0, 0, 2,   -3, -32,  -14,   1),
12976           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0,-2, 0, 0, 2,   -7,   0,    0,   3),
12977           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -2, 0, 0, 0, 0, 2,    0,  -8,   -4,   0),
12978           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0, 0, 0, 0, 0,    3,  -4,    0,   0),
12979           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -9,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12980           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -4,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12981 
12982        /* 591-600 */
12983           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 2,   19, -23,  -10,   2),
12984           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   0,    0, -10),
12985           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   3,    2,   0),
12986           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  7,  0, 0, 0, 0, 0, 1,    0,   9,    5,  -1),
12987           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -7,  0, 0, 0, 0, 0, 0,   28,   0,    0,   0),
12988           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 1,    0,  -7,   -4,   0),
12989           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 2,    8,  -4,    0,  -4),
12990           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   0,   -2,   0),
12991           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12992           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-4, 0, 0, 0, 2,   -3,   0,    0,   1),
12993 
12994        /* 601-610 */
12995           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-3, 0, 0, 0, 2,   -9,   0,    1,   4),
12996           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-2, 0, 0, 0, 2,    3,  12,    5,  -1),
12997           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3,  0,  0, 0, 0, 0, 0, 2,   17,  -3,   -1,   0),
12998           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8,  8,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12999           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -8,  0, 0, 0, 0, 0, 0,   19,   0,    0,   0),
13000           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 1,    0,  -5,   -3,   0),
13001           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 2,   14,  -3,    0,  -1),
13002           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,   -1,   0),
13003           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,    0,  -5),
13004           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
13005 
13006        /* 611-620 */
13007           new PlanetaryNutModel( 0, 0, 0, 0, 0,  9, -9,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
13008           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -4,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
13009           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    2,   9,    4,   3),
13010           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    0,   0,    0,  -4),
13011           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    8,   0,    0,   0),
13012           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   4,    2,   0),
13013           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    6,   0,    0,  -3),
13014           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
13015           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   3,    1,   0),
13016           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    5,   0,    0,  -2),
13017 
13018        /* 621-630 */
13019           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
13020           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
13021           new PlanetaryNutModel( 1, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
13022           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    7,   0,    0,   0),
13023           new PlanetaryNutModel( 1, 0,-2, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
13024           new PlanetaryNutModel(-1, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
13025           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    6,   0,    0,   0),
13026           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
13027           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
13028           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    5,   0,    0,   0),
13029 
13030        /* 631-640 */
13031           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -3,   0,    0,   0),
13032           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
13033           new PlanetaryNutModel(-1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
13034           new PlanetaryNutModel(-1, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
13035           new PlanetaryNutModel( 1,-1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
13036           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   13,   0,    0,   0),
13037           new PlanetaryNutModel(-2, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   21,  11,    0,   0),
13038           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
13039           new PlanetaryNutModel(-1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,  -5,   -2,   0),
13040           new PlanetaryNutModel( 1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
13041 
13042        /* 641-650 */
13043           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
13044           new PlanetaryNutModel(-1, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
13045           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   20,  10,    0,   0),
13046           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  -34,   0,    0,   0),
13047           new PlanetaryNutModel(-1, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,  -19,   0,    0,   0),
13048           new PlanetaryNutModel( 1, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,    3,   0,    0,  -2),
13049           new PlanetaryNutModel( 1, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
13050           new PlanetaryNutModel( 1, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -6,   0,    0,   3),
13051           new PlanetaryNutModel( 1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
13052           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    3,   0,    0,   0),
13053 
13054        /* 651-660 */
13055           new PlanetaryNutModel( 0, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
13056           new PlanetaryNutModel( 0, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
13057           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  2,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
13058           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    6,   0,    0,  -3),
13059           new PlanetaryNutModel( 0, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   3),
13060           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
13061           new PlanetaryNutModel( 0, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
13062           new PlanetaryNutModel( 0, 1, 1, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -3,   -2,   0),
13063           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  126, -63,  -27, -55),
13064           new PlanetaryNutModel(-1, 2, 0, 2, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    1,   2),
13065 
13066        /* 661-670 */
13067           new PlanetaryNutModel( 0, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,   -3,  28,   15,   2),
13068           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    5,   0,    1,  -2),
13069           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   9,    4,   1),
13070           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   9,    4,  -1),
13071           new PlanetaryNutModel(-1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0, -126, -63,  -27,  55),
13072           new PlanetaryNutModel( 2, 2,-2, 2, 0,  0, -2,  0, 3, 0, 0, 0, 0,    3,   0,    0,  -1),
13073           new PlanetaryNutModel( 1, 2, 0, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   21, -11,   -6, -11),
13074           new PlanetaryNutModel( 0, 1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
13075           new PlanetaryNutModel(-1, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -21, -11,   -6,  11),
13076           new PlanetaryNutModel(-2, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   1),
13077 
13078        /* 671-680 */
13079           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
13080           new PlanetaryNutModel( 0, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    8,   0,    0,  -4),
13081           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -6,   0,    0,   3),
13082           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
13083           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    3,   0,    0,  -1),
13084           new PlanetaryNutModel( 1, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
13085           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -5,   0,    0,   2),
13086           new PlanetaryNutModel( 2, 2, 0, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   24, -12,   -5, -11),
13087           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   3,    1,   0),
13088           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   3,    1,   0),
13089 
13090        /* 681-687 */
13091           new PlanetaryNutModel( 1, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
13092           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -24, -12,   -5,  10),
13093           new PlanetaryNutModel( 2, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    4,   0,   -1,  -2),
13094           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   13,   0,    0,  -6),
13095           new PlanetaryNutModel(-1, 2, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    7,   0,    0,  -3),
13096           new PlanetaryNutModel( 1, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
13097           new PlanetaryNutModel( 0, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,    3,   0,    0,  -1)
13098        };
13099 
13100     /* Number of terms in the planetary nutation model */
13101        final int NPL = xpl.length;
13102 
13103     /*--------------------------------------------------------------------*/
13104 
13105     /* Interval between fundamental date J2000.0 and given date (JC). */
13106        t = ((date1 - DJ00) + date2) / DJC;
13107 
13108     /* ------------------- */
13109     /* LUNI-SOLAR NUTATION */
13110     /* ------------------- */
13111 
13112     /* Fundamental (Delaunay) arguments */
13113 
13114     /* Mean anomaly of the Moon (IERS 2003). */
13115        el = jauFal03(t);
13116 
13117     /* Mean anomaly of the Sun (MHB2000). */
13118        elp = fmod(1287104.79305  +
13119                 t * (129596581.0481  +
13120                 t * (-0.5532  +
13121                 t * (0.000136  +
13122                 t * (-0.00001149)))), TURNAS) * DAS2R;
13123 
13124     /* Mean longitude of the Moon minus that of the ascending node */
13125     /* (IERS 2003. */
13126        f = jauFaf03(t);
13127 
13128     /* Mean elongation of the Moon from the Sun (MHB2000). */
13129        d = fmod(1072260.70369  +
13130               t * (1602961601.2090  +
13131               t * (-6.3706  +
13132               t * (0.006593  +
13133               t * (-0.00003169)))), TURNAS) * DAS2R;
13134 
13135     /* Mean longitude of the ascending node of the Moon (IERS 2003). */
13136        om = jauFaom03(t);
13137 
13138     /* Initialize the nutation values. */
13139        dp = 0.0;
13140        de = 0.0;
13141 
13142     /* Summation of luni-solar nutation series (in reverse order). */
13143        for (i = NLS-1; i >= 0; i--) {
13144 
13145        /* Argument and functions. */
13146           arg = fmod((double)xls[i].nl  * el +
13147                      (double)xls[i].nlp * elp +
13148                      (double)xls[i].nf  * f +
13149                      (double)xls[i].nd  * d +
13150                      (double)xls[i].nom * om, D2PI);
13151           sarg = sin(arg);
13152           carg = cos(arg);
13153 
13154        /* Term. */
13155           dp += (xls[i].sp + xls[i].spt * t) * sarg + xls[i].cp * carg;
13156           de += (xls[i].ce + xls[i].cet * t) * carg + xls[i].se * sarg;
13157        }
13158 
13159     /* Convert from 0.1 microarcsec units to radians. */
13160        dpsils = dp * U2R;
13161        depsls = de * U2R;
13162 
13163     /* ------------------ */
13164     /* PLANETARY NUTATION */
13165     /* ------------------ */
13166 
13167     /* n.b.  The MHB2000 code computes the luni-solar and planetary nutation */
13168     /* in different functions, using slightly different Delaunay */
13169     /* arguments in the two cases.  This behaviour is faithfully */
13170     /* reproduced here.  Use of the IERS 2003 expressions for both */
13171     /* cases leads to negligible changes, well below */
13172     /* 0.1 microarcsecond. */
13173 
13174     /* Mean anomaly of the Moon (MHB2000). */
13175        al = fmod(2.35555598 + 8328.6914269554 * t, D2PI);
13176 
13177     /* Mean longitude of the Moon minus that of the ascending node */
13178     /*(MHB2000). */
13179        af = fmod(1.627905234 + 8433.466158131 * t, D2PI);
13180 
13181     /* Mean elongation of the Moon from the Sun (MHB2000). */
13182        ad = fmod(5.198466741 + 7771.3771468121 * t, D2PI);
13183 
13184     /* Mean longitude of the ascending node of the Moon (MHB2000). */
13185        aom = fmod(2.18243920 - 33.757045 * t, D2PI);
13186 
13187     /* General accumulated precession in longitude (IERS 2003). */
13188        apa = jauFapa03(t);
13189 
13190     /* Planetary longitudes, Mercury through Uranus (IERS 2003). */
13191        alme = jauFame03(t);
13192        alve = jauFave03(t);
13193        alea = jauFae03(t);
13194        alma = jauFama03(t);
13195        alju = jauFaju03(t);
13196        alsa = jauFasa03(t);
13197        alur = jauFaur03(t);
13198 
13199     /* Neptune longitude (MHB2000). */
13200        alne = fmod(5.321159000 + 3.8127774000 * t, D2PI);
13201 
13202     /* Initialize the nutation values. */
13203        dp = 0.0;
13204        de = 0.0;
13205 
13206     /* Summation of planetary nutation series (in reverse order). */
13207        for (i = NPL-1; i >= 0; i--) {
13208 
13209        /* Argument and functions. */
13210           arg = fmod((double)xpl[i].nl  * al   +
13211                      (double)xpl[i].nf  * af   +
13212                      (double)xpl[i].nd  * ad   +
13213                      (double)xpl[i].nom * aom  +
13214                      (double)xpl[i].nme * alme +
13215                      (double)xpl[i].nve * alve +
13216                      (double)xpl[i].nea * alea +
13217                      (double)xpl[i].nma * alma +
13218                      (double)xpl[i].nju * alju +
13219                      (double)xpl[i].nsa * alsa +
13220                      (double)xpl[i].nur * alur +
13221                      (double)xpl[i].nne * alne +
13222                      (double)xpl[i].npa * apa, D2PI);
13223           sarg = sin(arg);
13224           carg = cos(arg);
13225 
13226        /* Term. */
13227           dp += (double)xpl[i].sp * sarg + (double)xpl[i].cp * carg;
13228           de += (double)xpl[i].se * sarg + (double)xpl[i].ce * carg;
13229 
13230        }
13231 
13232     /* Convert from 0.1 microarcsec units to radians. */
13233        dpsipl = dp * U2R;
13234        depspl = de * U2R;
13235 
13236     /* ------- */
13237     /* RESULTS */
13238     /* ------- */
13239 
13240     /* Add luni-solar and planetary components. */
13241        return new NutationTerms( dpsils + dpsipl,
13242                                depsls + depspl);
13243        }
13244     
13245      private final static class LSNutationModel 
13246         {
13247           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13248           final double ps,pst,pc;     /* longitude sin, t*sin, cos coefficients */
13249           final double ec,ect,es;     /* obliquity cos, t*cos, sin coefficients */
13250           
13251           public LSNutationModel( int nl,int nlp,int nf,int nd,int nom,
13252           double ps, double pst, double pc,    
13253           double ec, double ect, double es    ) {
13254                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13255                this.ps = ps;this.pst = pst;this.pc = pc;    
13256                this.ec = ec;this.ect = ect; this.es= es;    
13257         }
13258 
13259        }
13260 
13261     /**
13262     *  Nutation, IAU 2000B model.
13263     *
13264     *<p>This function is derived from the International Astronomical Union's
13265     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13266     *
13267     *<p>Status:  canonical model.
13268     *
13269     *<!-- Given: -->
13270     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13271     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13272     *
13273     *<!-- Returned: -->
13274     *     @return  nutation, luni-solar + planetary (Note 2)
13275     *
13276     * <p>Notes:
13277     * <ol>
13278     *
13279     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13280     *     convenient way between the two arguments.  For example,
13281     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13282     *     among others:
13283     *<pre>
13284     *            date1          date2
13285     *
13286     *         2450123.7           0.0       (JD method)
13287     *         2451545.0       -1421.3       (J2000 method)
13288     *         2400000.5       50123.2       (MJD method)
13289     *         2450123.5           0.2       (date &amp; time method)
13290     *</pre>
13291     *     The JD method is the most natural and convenient to use in
13292     *     cases where the loss of several decimal digits of resolution
13293     *     is acceptable.  The J2000 method is best matched to the way
13294     *     the argument is handled internally and will deliver the
13295     *     optimum resolution.  The MJD method and the date &amp; time methods
13296     *     are both good compromises between resolution and convenience.
13297     *
13298     * <li> The nutation components in longitude and obliquity are in radians
13299     *     and with respect to the equinox and ecliptic of date.  The
13300     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
13301     *     value of 84381.448 arcsec.  (The errors that result from using
13302     *     this function with the IAU 2006 value of 84381.406 arcsec can be
13303     *     neglected.)
13304     *
13305     *     The nutation model consists only of luni-solar terms, but
13306     *     includes also a fixed offset which compensates for certain long-
13307     *     period planetary terms (Note 7).
13308     *
13309     * <li> This function is an implementation of the IAU 2000B abridged
13310     *     nutation model formally adopted by the IAU General Assembly in
13311     *     2000.  The function computes the MHB_2000_SHORT luni-solar
13312     *     nutation series (Luzum 2001), but without the associated
13313     *     corrections for the precession rate adjustments and the offset
13314     *     between the GCRS and J2000.0 mean poles.
13315     *
13316     * <li> The full IAU 2000A (MHB2000) nutation model contains nearly 1400
13317     *     terms.  The IAU 2000B model (McCarthy &amp; Luzum 2003) contains only
13318     *     77 terms, plus additional simplifications, yet still delivers
13319     *     results of 1 mas accuracy at present epochs.  This combination of
13320     *     accuracy and size makes the IAU 2000B abridged nutation model
13321     *     suitable for most practical applications.
13322     *
13323     *     The function delivers a pole accurate to 1 mas from 1900 to 2100
13324     *     (usually better than 1 mas, very occasionally just outside
13325     *     1 mas).  The full IAU 2000A model, which is implemented in the
13326     *     function jauNut00a (q.v.), delivers considerably greater accuracy
13327     *     at current dates;  however, to realize this improved accuracy,
13328     *     corrections for the essentially unpredictable free-core-nutation
13329     *     (FCN) must also be included.
13330     *
13331     * <li> The present function provides classical nutation.  The
13332     *     MHB_2000_SHORT algorithm, from which it is adapted, deals also
13333     *     with (i) the offsets between the GCRS and mean poles and (ii) the
13334     *     adjustments in longitude and obliquity due to the changed
13335     *     precession rates.  These additional functions, namely frame bias
13336     *     and precession adjustments, are supported by the JSOFA functions
13337     *     jauBi00  and jauPr00.
13338     *
13339     * <li> The MHB_2000_SHORT algorithm also provides "total" nutations,
13340     *     comprising the arithmetic sum of the frame bias, precession
13341     *     adjustments, and nutation (luni-solar + planetary).  These total
13342     *     nutations can be used in combination with an existing IAU 1976
13343     *     precession implementation, such as jauPmat76,  to deliver GCRS-
13344     *     to-true predictions of mas accuracy at current epochs.  However,
13345     *     for symmetry with the jauNut00a  function (q.v. for the reasons),
13346     *     the JSOFA functions do not generate the "total nutations"
13347     *     directly.  Should they be required, they could of course easily
13348     *     be generated by calling jauBi00, jauPr00 and the present function
13349     *     and adding the results.
13350     *
13351     * <li> The IAU 2000B model includes "planetary bias" terms that are
13352     *     fixed in size but compensate for long-period nutations.  The
13353     *     amplitudes quoted in McCarthy &amp; Luzum (2003), namely
13354     *     Dpsi = -1.5835 mas and Depsilon = +1.6339 mas, are optimized for
13355     *     the "total nutations" method described in Note 6.  The Luzum
13356     *     (2001) values used in this JSOFA implementation, namely -0.135 mas
13357     *     and +0.388 mas, are optimized for the "rigorous" method, where
13358     *     frame bias, precession and nutation are applied separately and in
13359     *     that order.  During the interval 1995-2050, the JSOFA
13360     *     implementation delivers a maximum error of 1.001 mas (not
13361     *     including FCN).
13362     *</ol>
13363     *<p>References:
13364     *
13365     *     <p>Lieske, J.H., Lederle, T., Fricke, W., Morando, B., "Expressions
13366     *     for the precession quantities based upon the IAU /1976/ system of
13367     *     astronomical constants", Astron.Astrophys. 58, 1-2, 1-16. (1977)
13368     *
13369     *     <p>Luzum, B., private communication, 2001 (Fortran code
13370     *     MHB_2000_SHORT)
13371     *
13372     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
13373     *     precession-nutation of the celestial pole", Cel.Mech.Dyn.Astron.
13374     *     85, 37-49 (2003)
13375     *
13376     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13377     *     Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994)
13378     *
13379     *@version 2009 December 17
13380     *
13381     *  @since Release 20101201
13382     *
13383     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13384     */
13385     public static NutationTerms jauNut00b(double date1, double date2)
13386     {
13387        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
13388               dpsils, depsls, dpsipl, depspl;
13389        int i;
13390 
13391     /* Units of 0.1 microarcsecond to radians */
13392        final double U2R = DAS2R / 1e7;
13393 
13394     /* ---------------------------------------- */
13395     /* Fixed offsets in lieu of planetary terms */
13396     /* ---------------------------------------- */
13397 
13398        final double DPPLAN = -0.135 * DMAS2R;
13399        final double DEPLAN =  0.388 * DMAS2R;
13400 
13401     /* --------------------------------------------------- */
13402     /* Luni-solar nutation: argument and term coefficients */
13403     /* --------------------------------------------------- */
13404 
13405     /* The units for the sine and cosine coefficients are */
13406     /* 0.1 microarcsec and the same per Julian century    */
13407 
13408         LSNutationModel x[] = {
13409 
13410        /* 1-10 */
13411           new LSNutationModel( 0, 0, 0, 0,1,
13412              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
13413           new LSNutationModel( 0, 0, 2,-2,2,
13414                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
13415           new LSNutationModel( 0, 0, 2, 0,2,-2276413.0,-234.0, 2796.0, 978459.0,-485.0,1374.0),
13416           new LSNutationModel( 0, 0, 0, 0,2,2074554.0,  207.0, -698.0,-897492.0, 470.0,-291.0),
13417           new LSNutationModel( 0, 1, 0, 0,0,1475877.0,-3633.0,11817.0, 73871.0,-184.0,-1924.0),
13418           new LSNutationModel( 0, 1, 2,-2,2,-516821.0, 1226.0, -524.0, 224386.0,-677.0,-174.0),
13419           new LSNutationModel( 1, 0, 0, 0,0, 711159.0,   73.0, -872.0,  -6750.0,   0.0, 358.0),
13420           new LSNutationModel( 0, 0, 2, 0,1,-387298.0, -367.0,  380.0, 200728.0,  18.0, 318.0),
13421           new LSNutationModel( 1, 0, 2, 0,2,-301461.0,  -36.0,  816.0, 129025.0, -63.0, 367.0),
13422           new LSNutationModel( 0,-1, 2,-2,2, 215829.0, -494.0,  111.0, -95929.0, 299.0, 132.0),
13423 
13424        /* 11-20 */
13425           new LSNutationModel( 0, 0, 2,-2,1, 128227.0,  137.0,  181.0, -68982.0,  -9.0,  39.0),
13426           new LSNutationModel(-1, 0, 2, 0,2, 123457.0,   11.0,   19.0, -53311.0,  32.0,  -4.0),
13427           new LSNutationModel(-1, 0, 0, 2,0, 156994.0,   10.0, -168.0,  -1235.0,   0.0,  82.0),
13428           new LSNutationModel( 1, 0, 0, 0,1,  63110.0,   63.0,   27.0, -33228.0,   0.0,  -9.0),
13429           new LSNutationModel(-1, 0, 0, 0,1, -57976.0,  -63.0, -189.0,  31429.0,   0.0, -75.0),
13430           new LSNutationModel(-1, 0, 2, 2,2, -59641.0,  -11.0,  149.0,  25543.0, -11.0,  66.0),
13431           new LSNutationModel( 1, 0, 2, 0,1, -51613.0,  -42.0,  129.0,  26366.0,   0.0,  78.0),
13432           new LSNutationModel(-2, 0, 2, 0,1,  45893.0,   50.0,   31.0, -24236.0, -10.0,  20.0),
13433           new LSNutationModel( 0, 0, 0, 2,0,  63384.0,   11.0, -150.0,  -1220.0,   0.0,  29.0),
13434           new LSNutationModel( 0, 0, 2, 2,2, -38571.0,   -1.0,  158.0,  16452.0, -11.0,  68.0),
13435 
13436        /* 21-30 */
13437           new LSNutationModel( 0,-2, 2,-2,2,  32481.0,    0.0,    0.0, -13870.0,   0.0,   0.0),
13438           new LSNutationModel(-2, 0, 0, 2,0, -47722.0,    0.0,  -18.0,    477.0,   0.0, -25.0),
13439           new LSNutationModel( 2, 0, 2, 0,2, -31046.0,   -1.0,  131.0,  13238.0, -11.0,  59.0),
13440           new LSNutationModel( 1, 0, 2,-2,2,  28593.0,    0.0,   -1.0, -12338.0,  10.0,  -3.0),
13441           new LSNutationModel(-1, 0, 2, 0,1,  20441.0,   21.0,   10.0, -10758.0,   0.0,  -3.0),
13442           new LSNutationModel( 2, 0, 0, 0,0,  29243.0,    0.0,  -74.0,   -609.0,   0.0,  13.0),
13443           new LSNutationModel( 0, 0, 2, 0,0,  25887.0,    0.0,  -66.0,   -550.0,   0.0,  11.0),
13444           new LSNutationModel( 0, 1, 0, 0,1, -14053.0,  -25.0,   79.0,   8551.0,  -2.0, -45.0),
13445           new LSNutationModel(-1, 0, 0, 2,1,  15164.0,   10.0,   11.0,  -8001.0,   0.0,  -1.0),
13446           new LSNutationModel( 0, 2, 2,-2,2, -15794.0,   72.0,  -16.0,   6850.0, -42.0,  -5.0),
13447 
13448        /* 31-40 */
13449           new LSNutationModel( 0, 0,-2, 2,0,  21783.0,    0.0,   13.0,   -167.0,   0.0,  13.0),
13450           new LSNutationModel( 1, 0, 0,-2,1, -12873.0,  -10.0,  -37.0,   6953.0,   0.0, -14.0),
13451           new LSNutationModel( 0,-1, 0, 0,1, -12654.0,   11.0,   63.0,   6415.0,   0.0,  26.0),
13452           new LSNutationModel(-1, 0, 2, 2,1, -10204.0,    0.0,   25.0,   5222.0,   0.0,  15.0),
13453           new LSNutationModel( 0, 2, 0, 0,0,  16707.0,  -85.0,  -10.0,    168.0,  -1.0,  10.0),
13454           new LSNutationModel( 1, 0, 2, 2,2,  -7691.0,    0.0,   44.0,   3268.0,   0.0,  19.0),
13455           new LSNutationModel(-2, 0, 2, 0,0, -11024.0,    0.0,  -14.0,    104.0,   0.0,   2.0),
13456           new LSNutationModel( 0, 1, 2, 0,2,   7566.0,  -21.0,  -11.0,  -3250.0,   0.0,  -5.0),
13457           new LSNutationModel( 0, 0, 2, 2,1,  -6637.0,  -11.0,   25.0,   3353.0,   0.0,  14.0),
13458           new LSNutationModel( 0,-1, 2, 0,2,  -7141.0,   21.0,    8.0,   3070.0,   0.0,   4.0),
13459 
13460        /* 41-50 */
13461           new LSNutationModel( 0, 0, 0, 2,1,  -6302.0,  -11.0,    2.0,   3272.0,   0.0,   4.0),
13462           new LSNutationModel( 1, 0, 2,-2,1,   5800.0,   10.0,    2.0,  -3045.0,   0.0,  -1.0),
13463           new LSNutationModel( 2, 0, 2,-2,2,   6443.0,    0.0,   -7.0,  -2768.0,   0.0,  -4.0),
13464           new LSNutationModel(-2, 0, 0, 2,1,  -5774.0,  -11.0,  -15.0,   3041.0,   0.0,  -5.0),
13465           new LSNutationModel( 2, 0, 2, 0,1,  -5350.0,    0.0,   21.0,   2695.0,   0.0,  12.0),
13466           new LSNutationModel( 0,-1, 2,-2,1,  -4752.0,  -11.0,   -3.0,   2719.0,   0.0,  -3.0),
13467           new LSNutationModel( 0, 0, 0,-2,1,  -4940.0,  -11.0,  -21.0,   2720.0,   0.0,  -9.0),
13468           new LSNutationModel(-1,-1, 0, 2,0,   7350.0,    0.0,   -8.0,    -51.0,   0.0,   4.0),
13469           new LSNutationModel( 2, 0, 0,-2,1,   4065.0,    0.0,    6.0,  -2206.0,   0.0,   1.0),
13470           new LSNutationModel( 1, 0, 0, 2,0,   6579.0,    0.0,  -24.0,   -199.0,   0.0,   2.0),
13471 
13472        /* 51-60 */
13473           new LSNutationModel( 0, 1, 2,-2,1,   3579.0,    0.0,    5.0,  -1900.0,   0.0,   1.0),
13474           new LSNutationModel( 1,-1, 0, 0,0,   4725.0,    0.0,   -6.0,    -41.0,   0.0,   3.0),
13475           new LSNutationModel(-2, 0, 2, 0,2,  -3075.0,    0.0,   -2.0,   1313.0,   0.0,  -1.0),
13476           new LSNutationModel( 3, 0, 2, 0,2,  -2904.0,    0.0,   15.0,   1233.0,   0.0,   7.0),
13477           new LSNutationModel( 0,-1, 0, 2,0,   4348.0,    0.0,  -10.0,    -81.0,   0.0,   2.0),
13478           new LSNutationModel( 1,-1, 2, 0,2,  -2878.0,    0.0,    8.0,   1232.0,   0.0,   4.0),
13479           new LSNutationModel( 0, 0, 0, 1,0,  -4230.0,    0.0,    5.0,    -20.0,   0.0,  -2.0),
13480           new LSNutationModel(-1,-1, 2, 2,2,  -2819.0,    0.0,    7.0,   1207.0,   0.0,   3.0),
13481           new LSNutationModel(-1, 0, 2, 0,0,  -4056.0,    0.0,    5.0,     40.0,   0.0,  -2.0),
13482           new LSNutationModel( 0,-1, 2, 2,2,  -2647.0,    0.0,   11.0,   1129.0,   0.0,   5.0),
13483 
13484        /* 61-70 */
13485           new LSNutationModel(-2, 0, 0, 0,1,  -2294.0,    0.0,  -10.0,   1266.0,   0.0,  -4.0),
13486           new LSNutationModel( 1, 1, 2, 0,2,   2481.0,    0.0,   -7.0,  -1062.0,   0.0,  -3.0),
13487           new LSNutationModel( 2, 0, 0, 0,1,   2179.0,    0.0,   -2.0,  -1129.0,   0.0,  -2.0),
13488           new LSNutationModel(-1, 1, 0, 1,0,   3276.0,    0.0,    1.0,     -9.0,   0.0,   0.0),
13489           new LSNutationModel( 1, 1, 0, 0,0,  -3389.0,    0.0,    5.0,     35.0,   0.0,  -2.0),
13490           new LSNutationModel( 1, 0, 2, 0,0,   3339.0,    0.0,  -13.0,   -107.0,   0.0,   1.0),
13491           new LSNutationModel(-1, 0, 2,-2,1,  -1987.0,    0.0,   -6.0,   1073.0,   0.0,  -2.0),
13492           new LSNutationModel( 1, 0, 0, 0,2,  -1981.0,    0.0,    0.0,    854.0,   0.0,   0.0),
13493           new LSNutationModel(-1, 0, 0, 1,0,   4026.0,    0.0, -353.0,   -553.0,   0.0,-139.0),
13494           new LSNutationModel( 0, 0, 2, 1,2,   1660.0,    0.0,   -5.0,   -710.0,   0.0,  -2.0),
13495 
13496        /* 71-77 */
13497           new LSNutationModel(-1, 0, 2, 4,2,  -1521.0,    0.0,    9.0,    647.0,   0.0,   4.0),
13498           new LSNutationModel(-1, 1, 0, 1,1,   1314.0,    0.0,    0.0,   -700.0,   0.0,   0.0),
13499           new LSNutationModel( 0,-2, 2,-2,1,  -1283.0,    0.0,    0.0,    672.0,   0.0,   0.0),
13500           new LSNutationModel( 1, 0, 2, 2,1,  -1331.0,    0.0,    8.0,    663.0,   0.0,   4.0),
13501           new LSNutationModel(-2, 0, 2, 2,2,   1383.0,    0.0,   -2.0,   -594.0,   0.0,  -2.0),
13502           new LSNutationModel(-1, 0, 0, 0,2,   1405.0,    0.0,    4.0,   -610.0,   0.0,   2.0),
13503           new LSNutationModel( 1, 1, 2,-2,2,   1290.0,    0.0,    0.0,   -556.0,   0.0,   0.0)
13504        };
13505 
13506     /* Number of terms in the series */
13507        final int NLS = x.length;
13508 
13509     /*--------------------------------------------------------------------*/
13510 
13511     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13512        t = ((date1 - DJ00) + date2) / DJC;
13513 
13514     /* --------------------*/
13515     /* LUNI-SOLAR NUTATION */
13516     /* --------------------*/
13517 
13518     /* Fundamental (Delaunay) arguments from Simon et al. (1994) */
13519 
13520     /* Mean anomaly of the Moon. */
13521        el = fmod(485868.249036 + (1717915923.2178) * t, TURNAS) * DAS2R;
13522 
13523     /* Mean anomaly of the Sun. */
13524        elp = fmod(1287104.79305 + (129596581.0481) * t, TURNAS) * DAS2R;
13525 
13526     /* Mean argument of the latitude of the Moon. */
13527        f = fmod(335779.526232 + (1739527262.8478) * t, TURNAS) * DAS2R;
13528 
13529     /* Mean elongation of the Moon from the Sun. */
13530        d = fmod(1072260.70369 + (1602961601.2090) * t, TURNAS) * DAS2R;
13531 
13532     /* Mean longitude of the ascending node of the Moon. */
13533        om = fmod(450160.398036 + (-6962890.5431) * t, TURNAS) * DAS2R;
13534 
13535     /* Initialize the nutation values. */
13536        dp = 0.0;
13537        de = 0.0;
13538 
13539     /* Summation of luni-solar nutation series (smallest terms first). */
13540        for (i = NLS-1; i >= 0; i--) {
13541 
13542        /* Argument and functions. */
13543           arg = fmod( (double)x[i].nl  * el  +
13544                       (double)x[i].nlp * elp +
13545                       (double)x[i].nf  * f   +
13546                       (double)x[i].nd  * d   +
13547                       (double)x[i].nom * om, D2PI  );
13548           sarg = sin(arg);
13549           carg = cos(arg);
13550 
13551        /* Term. */
13552           dp += (x[i].ps + x[i].pst * t) * sarg + x[i].pc * carg;
13553           de += (x[i].ec + x[i].ect * t) * carg + x[i].es * sarg;
13554        }
13555 
13556     /* Convert from 0.1 microarcsec units to radians. */
13557        dpsils = dp * U2R;
13558        depsls = de * U2R;
13559 
13560     /* ------------------------------*/
13561     /* IN LIEU OF PLANETARY NUTATION */
13562     /* ------------------------------*/
13563 
13564     /* Fixed offset to correct for missing terms in truncated series. */
13565        dpsipl = DPPLAN;
13566        depspl = DEPLAN;
13567 
13568     /* --------*/
13569     /* RESULTS */
13570     /* --------*/
13571 
13572     /* Add luni-solar and planetary components. */
13573        return new NutationTerms(   dpsils + dpsipl,
13574                                 depsls + depspl);
13575 
13576     }
13577     
13578 
13579     /**
13580     *  IAU 2000A nutation with adjustments to match the IAU 2006
13581     *  precession.
13582     *
13583     *<!-- Given: -->
13584     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13585     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13586     *
13587     *<!-- Returned: -->
13588     *     @return  nutation, luni-solar + planetary (Note 2)
13589     *
13590     *<p>Status:  canonical model.
13591     *
13592     * <p>Notes:
13593     * <ol>
13594     *
13595     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13596     *     convenient way between the two arguments.  For example,
13597     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13598     *     among others:
13599     *<pre>
13600     *            date1          date2
13601     *
13602     *         2450123.7           0.0       (JD method)
13603     *         2451545.0       -1421.3       (J2000 method)
13604     *         2400000.5       50123.2       (MJD method)
13605     *         2450123.5           0.2       (date &amp; time method)
13606     *</pre>
13607     *     The JD method is the most natural and convenient to use in
13608     *     cases where the loss of several decimal digits of resolution
13609     *     is acceptable.  The J2000 method is best matched to the way
13610     *     the argument is handled internally and will deliver the
13611     *     optimum resolution.  The MJD method and the date &amp; time methods
13612     *     are both good compromises between resolution and convenience.
13613     *
13614     * <li> The nutation components in longitude and obliquity are in radians
13615     *     and with respect to the mean equinox and ecliptic of date,
13616     *     IAU 2006 precession model (Hilton et al. 2006, Capitaine et al.
13617     *     2005).
13618     *
13619     * <li> The function first computes the IAU 2000A nutation, then applies
13620     *     adjustments for (i) the consequences of the change in obliquity
13621     *     from the IAU 1980 ecliptic to the IAU 2006 ecliptic and (ii) the
13622     *     secular variation in the Earth's dynamical flattening.
13623     *
13624     * <li> The present function provides classical nutation, complementing
13625     *     the IAU 2000 frame bias and IAU 2006 precession.  It delivers a
13626     *     pole which is at current epochs accurate to a few tens of
13627     *     microarcseconds, apart from the free core nutation.
13628     *</ol>
13629     *<p>Called:<ul>
13630     *     <li>{@link #jauNut00a} nutation, IAU 2000A
13631     * </ul>
13632     *<p>References:
13633     *
13634     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
13635     *     Astron.Astrophys. 387, 700
13636     *
13637     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
13638     *     Astron.Astrophys. 58, 1-16
13639     *
13640     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
13641     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
13642     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
13643     *
13644     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13645     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
13646     *
13647     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
13648     *     Astron.Astrophys.Supp.Ser. 135, 111
13649     *
13650     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
13651     *     Resolutions", in IERS Workshop 5.1 (2002)
13652     *
13653     *@version 2008 May 24
13654     *
13655     *  @since Release 20101201
13656     *
13657     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13658     */
13659     public static NutationTerms jauNut06a(double date1, double date2)
13660     {
13661        double t, fj2;
13662 
13663 
13664     /* Interval between fundamental date J2000.0 and given date (JC). */
13665        t = ((date1 - DJ00) + date2) / DJC;
13666 
13667     /* Factor correcting for secular variation of J2. */
13668        fj2 = -2.7774e-6 * t;
13669 
13670     /* Obtain IAU 2000A nutation. */
13671        NutationTerms nt = jauNut00a(date1, date2);
13672        
13673     /* Apply P03 adjustments (Wallace &amp; Capitaine, 2006, Eqs.5). */
13674        return new NutationTerms( nt.dpsi + nt.dpsi * (0.4697e-6 + fj2),
13675                                  nt.deps + nt.deps * fj2);
13676 
13677      }
13678     
13679      private final static class NutationModel2 {
13680           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13681           final double sp,spt;        /* longitude sine, 1 and t coefficients */
13682           final double ce,cet;        /* obliquity cosine, 1 and t coefficients */
13683           
13684           public NutationModel2(int nl,int nlp,int nf,int nd,int nom,
13685           double sp,double spt,       
13686           double ce,double cet       ) {
13687                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13688                this.sp = sp;this.spt = spt;      
13689                this.ce = ce;this.cet = cet;     
13690         }
13691        }
13692    /**
13693     *  Nutation, IAU 1980 model.
13694     *
13695     *<p>This function is derived from the International Astronomical Union's
13696     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13697     *
13698     *<p>Status:  canonical model.
13699     *
13700     *<!-- Given: -->
13701     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13702     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13703     *
13704     *<!-- Returned: -->
13705     *     @return dpsi           double      <u>returned</u> nutation in longitude (radians)
13706     *             deps           double      <u>returned</u> nutation in obliquity (radians)
13707     *
13708     * <p>Notes:
13709     * <ol>
13710     *
13711     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13712     *     convenient way between the two arguments.  For example,
13713     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13714     *     among others:
13715     *<pre>
13716     *            date1          date2
13717     *
13718     *         2450123.7           0.0       (JD method)
13719     *         2451545.0       -1421.3       (J2000 method)
13720     *         2400000.5       50123.2       (MJD method)
13721     *         2450123.5           0.2       (date &amp; time method)
13722     *</pre>
13723     *     The JD method is the most natural and convenient to use in
13724     *     cases where the loss of several decimal digits of resolution
13725     *     is acceptable.  The J2000 method is best matched to the way
13726     *     the argument is handled internally and will deliver the
13727     *     optimum resolution.  The MJD method and the date &amp; time methods
13728     *     are both good compromises between resolution and convenience.
13729     *
13730     * <li> The nutation components are with respect to the ecliptic of
13731     *     date.
13732     *</ol>
13733     *<p>Called:<ul>
13734     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
13735     * </ul>
13736     *<p>Reference:
13737     *
13738     *     <p>Explanatory Supplement to the Astronomical Almanac,
13739     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
13740     *     Section 3.222 (p111).
13741     *
13742     *@version 2008 September 30
13743     *
13744     *  @since Release 20101201
13745     *
13746     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13747     */
13748     public static NutationTerms jauNut80(double date1, double date2)
13749     {
13750        double t, el, elp, f, d, om, dp, de, arg, s, c;
13751        int j;
13752 
13753     /* Units of 0.1 milliarcsecond to radians */
13754        final double U2R = DAS2R / 1e4;
13755 
13756     /* ------------------------------------------------ */
13757     /* Table of multiples of arguments and coefficients */
13758     /* ------------------------------------------------ */
13759 
13760     /* The units for the sine and cosine coefficients are 0.1 mas and */
13761     /* the same per Julian century */
13762 
13763        NutationModel2 x[] = {
13764 
13765        /* 1-10 */
13766           new NutationModel2(  0,  0,  0,  0,  1, -171996.0, -174.2,  92025.0,    8.9 ),
13767           new NutationModel2(  0,  0,  0,  0,  2,    2062.0,    0.2,   -895.0,    0.5 ),
13768           new NutationModel2( -2,  0,  2,  0,  1,      46.0,    0.0,    -24.0,    0.0 ),
13769           new NutationModel2(  2,  0, -2,  0,  0,      11.0,    0.0,      0.0,    0.0 ),
13770           new NutationModel2( -2,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13771           new NutationModel2(  1, -1,  0, -1,  0,      -3.0,    0.0,      0.0,    0.0 ),
13772           new NutationModel2(  0, -2,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13773           new NutationModel2(  2,  0, -2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13774           new NutationModel2(  0,  0,  2, -2,  2,  -13187.0,   -1.6,   5736.0,   -3.1 ),
13775           new NutationModel2(  0,  1,  0,  0,  0,    1426.0,   -3.4,     54.0,   -0.1 ),
13776 
13777        /* 11-20 */
13778           new NutationModel2(  0,  1,  2, -2,  2,    -517.0,    1.2,    224.0,   -0.6 ),
13779           new NutationModel2(  0, -1,  2, -2,  2,     217.0,   -0.5,    -95.0,    0.3 ),
13780           new NutationModel2(  0,  0,  2, -2,  1,     129.0,    0.1,    -70.0,    0.0 ),
13781           new NutationModel2(  2,  0,  0, -2,  0,      48.0,    0.0,      1.0,    0.0 ),
13782           new NutationModel2(  0,  0,  2, -2,  0,     -22.0,    0.0,      0.0,    0.0 ),
13783           new NutationModel2(  0,  2,  0,  0,  0,      17.0,   -0.1,      0.0,    0.0 ),
13784           new NutationModel2(  0,  1,  0,  0,  1,     -15.0,    0.0,      9.0,    0.0 ),
13785           new NutationModel2(  0,  2,  2, -2,  2,     -16.0,    0.1,      7.0,    0.0 ),
13786           new NutationModel2(  0, -1,  0,  0,  1,     -12.0,    0.0,      6.0,    0.0 ),
13787           new NutationModel2( -2,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13788 
13789        /* 21-30 */
13790           new NutationModel2(  0, -1,  2, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13791           new NutationModel2(  2,  0,  0, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13792           new NutationModel2(  0,  1,  2, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13793           new NutationModel2(  1,  0,  0, -1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13794           new NutationModel2(  2,  1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13795           new NutationModel2(  0,  0, -2,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13796           new NutationModel2(  0,  1, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13797           new NutationModel2(  0,  1,  0,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13798           new NutationModel2( -1,  0,  0,  1,  1,       1.0,    0.0,      0.0,    0.0 ),
13799           new NutationModel2(  0,  1,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13800 
13801        /* 31-40 */
13802           new NutationModel2(  0,  0,  2,  0,  2,   -2274.0,   -0.2,    977.0,   -0.5 ),
13803           new NutationModel2(  1,  0,  0,  0,  0,     712.0,    0.1,     -7.0,    0.0 ),
13804           new NutationModel2(  0,  0,  2,  0,  1,    -386.0,   -0.4,    200.0,    0.0 ),
13805           new NutationModel2(  1,  0,  2,  0,  2,    -301.0,    0.0,    129.0,   -0.1 ),
13806           new NutationModel2(  1,  0,  0, -2,  0,    -158.0,    0.0,     -1.0,    0.0 ),
13807           new NutationModel2( -1,  0,  2,  0,  2,     123.0,    0.0,    -53.0,    0.0 ),
13808           new NutationModel2(  0,  0,  0,  2,  0,      63.0,    0.0,     -2.0,    0.0 ),
13809           new NutationModel2(  1,  0,  0,  0,  1,      63.0,    0.1,    -33.0,    0.0 ),
13810           new NutationModel2( -1,  0,  0,  0,  1,     -58.0,   -0.1,     32.0,    0.0 ),
13811           new NutationModel2( -1,  0,  2,  2,  2,     -59.0,    0.0,     26.0,    0.0 ),
13812 
13813        /* 41-50 */
13814           new NutationModel2(  1,  0,  2,  0,  1,     -51.0,    0.0,     27.0,    0.0 ),
13815           new NutationModel2(  0,  0,  2,  2,  2,     -38.0,    0.0,     16.0,    0.0 ),
13816           new NutationModel2(  2,  0,  0,  0,  0,      29.0,    0.0,     -1.0,    0.0 ),
13817           new NutationModel2(  1,  0,  2, -2,  2,      29.0,    0.0,    -12.0,    0.0 ),
13818           new NutationModel2(  2,  0,  2,  0,  2,     -31.0,    0.0,     13.0,    0.0 ),
13819           new NutationModel2(  0,  0,  2,  0,  0,      26.0,    0.0,     -1.0,    0.0 ),
13820           new NutationModel2( -1,  0,  2,  0,  1,      21.0,    0.0,    -10.0,    0.0 ),
13821           new NutationModel2( -1,  0,  0,  2,  1,      16.0,    0.0,     -8.0,    0.0 ),
13822           new NutationModel2(  1,  0,  0, -2,  1,     -13.0,    0.0,      7.0,    0.0 ),
13823           new NutationModel2( -1,  0,  2,  2,  1,     -10.0,    0.0,      5.0,    0.0 ),
13824 
13825        /* 51-60 */
13826           new NutationModel2(  1,  1,  0, -2,  0,      -7.0,    0.0,      0.0,    0.0 ),
13827           new NutationModel2(  0,  1,  2,  0,  2,       7.0,    0.0,     -3.0,    0.0 ),
13828           new NutationModel2(  0, -1,  2,  0,  2,      -7.0,    0.0,      3.0,    0.0 ),
13829           new NutationModel2(  1,  0,  2,  2,  2,      -8.0,    0.0,      3.0,    0.0 ),
13830           new NutationModel2(  1,  0,  0,  2,  0,       6.0,    0.0,      0.0,    0.0 ),
13831           new NutationModel2(  2,  0,  2, -2,  2,       6.0,    0.0,     -3.0,    0.0 ),
13832           new NutationModel2(  0,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13833           new NutationModel2(  0,  0,  2,  2,  1,      -7.0,    0.0,      3.0,    0.0 ),
13834           new NutationModel2(  1,  0,  2, -2,  1,       6.0,    0.0,     -3.0,    0.0 ),
13835           new NutationModel2(  0,  0,  0, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13836 
13837        /* 61-70 */
13838           new NutationModel2(  1, -1,  0,  0,  0,       5.0,    0.0,      0.0,    0.0 ),
13839           new NutationModel2(  2,  0,  2,  0,  1,      -5.0,    0.0,      3.0,    0.0 ),
13840           new NutationModel2(  0,  1,  0, -2,  0,      -4.0,    0.0,      0.0,    0.0 ),
13841           new NutationModel2(  1,  0, -2,  0,  0,       4.0,    0.0,      0.0,    0.0 ),
13842           new NutationModel2(  0,  0,  0,  1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13843           new NutationModel2(  1,  1,  0,  0,  0,      -3.0,    0.0,      0.0,    0.0 ),
13844           new NutationModel2(  1,  0,  2,  0,  0,       3.0,    0.0,      0.0,    0.0 ),
13845           new NutationModel2(  1, -1,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13846           new NutationModel2( -1, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13847           new NutationModel2( -2,  0,  0,  0,  1,      -2.0,    0.0,      1.0,    0.0 ),
13848 
13849        /* 71-80 */
13850           new NutationModel2(  3,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13851           new NutationModel2(  0, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13852           new NutationModel2(  1,  1,  2,  0,  2,       2.0,    0.0,     -1.0,    0.0 ),
13853           new NutationModel2( -1,  0,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13854           new NutationModel2(  2,  0,  0,  0,  1,       2.0,    0.0,     -1.0,    0.0 ),
13855           new NutationModel2(  1,  0,  0,  0,  2,      -2.0,    0.0,      1.0,    0.0 ),
13856           new NutationModel2(  3,  0,  0,  0,  0,       2.0,    0.0,      0.0,    0.0 ),
13857           new NutationModel2(  0,  0,  2,  1,  2,       2.0,    0.0,     -1.0,    0.0 ),
13858           new NutationModel2( -1,  0,  0,  0,  2,       1.0,    0.0,     -1.0,    0.0 ),
13859           new NutationModel2(  1,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13860 
13861        /* 81-90 */
13862           new NutationModel2( -2,  0,  2,  2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13863           new NutationModel2( -1,  0,  2,  4,  2,      -2.0,    0.0,      1.0,    0.0 ),
13864           new NutationModel2(  2,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13865           new NutationModel2(  1,  1,  2, -2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13866           new NutationModel2(  1,  0,  2,  2,  1,      -1.0,    0.0,      1.0,    0.0 ),
13867           new NutationModel2( -2,  0,  2,  4,  2,      -1.0,    0.0,      1.0,    0.0 ),
13868           new NutationModel2( -1,  0,  4,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13869           new NutationModel2(  1, -1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13870           new NutationModel2(  2,  0,  2, -2,  1,       1.0,    0.0,     -1.0,    0.0 ),
13871           new NutationModel2(  2,  0,  2,  2,  2,      -1.0,    0.0,      0.0,    0.0 ),
13872 
13873        /* 91-100 */
13874           new NutationModel2(  1,  0,  0,  2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13875           new NutationModel2(  0,  0,  4, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13876           new NutationModel2(  3,  0,  2, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13877           new NutationModel2(  1,  0,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13878           new NutationModel2(  0,  1,  2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13879           new NutationModel2( -1, -1,  0,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13880           new NutationModel2(  0,  0, -2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13881           new NutationModel2(  0,  0,  2, -1,  2,      -1.0,    0.0,      0.0,    0.0 ),
13882           new NutationModel2(  0,  1,  0,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13883           new NutationModel2(  1,  0, -2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13884 
13885        /* 101-106 */
13886           new NutationModel2(  0, -1,  2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13887           new NutationModel2(  1,  1,  0, -2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13888           new NutationModel2(  1,  0, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13889           new NutationModel2(  2,  0,  0,  2,  0,       1.0,    0.0,      0.0,    0.0 ),
13890           new NutationModel2(  0,  0,  2,  4,  2,      -1.0,    0.0,      0.0,    0.0 ),
13891           new NutationModel2(  0,  1,  0,  1,  0,       1.0,    0.0,      0.0,    0.0 )
13892        };
13893 
13894     /* Number of terms in the series */
13895        final int NT = x.length;
13896 
13897     /*--------------------------------------------------------------------*/
13898 
13899     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13900        t = ((date1 - DJ00) + date2) / DJC;
13901 
13902     /* --------------------- */
13903     /* Fundamental arguments */
13904     /* --------------------- */
13905 
13906     /* Mean longitude of Moon minus mean longitude of Moon's perigee. */
13907        el = jauAnpm(
13908             (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t)
13909             * DAS2R + fmod(1325.0 * t, 1.0) * D2PI);
13910 
13911     /* Mean longitude of Sun minus mean longitude of Sun's perigee. */
13912        elp = jauAnpm(
13913              (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t)
13914              * DAS2R + fmod(99.0 * t, 1.0) * D2PI);
13915 
13916     /* Mean longitude of Moon minus mean longitude of Moon's node. */
13917        f = jauAnpm(
13918            (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t)
13919            * DAS2R + fmod(1342.0 * t, 1.0) * D2PI);
13920 
13921     /* Mean elongation of Moon from Sun. */
13922        d = jauAnpm(
13923            (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t)
13924            * DAS2R + fmod(1236.0 * t, 1.0) * D2PI);
13925 
13926     /* Longitude of the mean ascending node of the lunar orbit on the */
13927     /* ecliptic, measured from the mean equinox of date. */
13928        om = jauAnpm(
13929             (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t)
13930             * DAS2R + fmod(-5.0 * t, 1.0) * D2PI);
13931 
13932     /* --------------- */
13933     /* Nutation series */
13934     /* --------------- */
13935 
13936     /* Initialize nutation components. */
13937        dp = 0.0;
13938        de = 0.0;
13939 
13940     /* Sum the nutation terms, ending with the biggest. */
13941        for (j = NT-1; j >= 0; j--) {
13942 
13943        /* Form argument for current term. */
13944           arg = (double)x[j].nl  * el
13945               + (double)x[j].nlp * elp
13946               + (double)x[j].nf  * f
13947               + (double)x[j].nd  * d
13948               + (double)x[j].nom * om;
13949 
13950        /* Accumulate current nutation term. */
13951           s = x[j].sp + x[j].spt * t;
13952           c = x[j].ce + x[j].cet * t;
13953           if (s != 0.0) dp += s * sin(arg);
13954           if (c != 0.0) de += c * cos(arg);
13955        }
13956 
13957     /* Convert results from 0.1 mas units to radians. */
13958        return new NutationTerms( dp * U2R,
13959                                  de * U2R);
13960 
13961         }
13962     
13963 
13964     /**
13965     *  Form the matrix of nutation for a given date, IAU 1980 model.
13966     *
13967     *<p>This function is derived from the International Astronomical Union's
13968     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13969     *
13970     *<p>Status:  support function.
13971     *
13972     *<!-- Given: -->
13973     *     @param date1 double           TDB date (Note 1)
13974     *     @param date2 double           TDB date (Note 1) 
13975     *
13976     *<!-- Returned: -->
13977     *     @return           double[3][3]       nutation matrix
13978     *
13979     * <p>Notes:
13980     * <ol>
13981     *
13982     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13983     *     convenient way between the two arguments.  For example,
13984     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13985     *     among others:
13986     *<pre>
13987     *            date1          date2
13988     *
13989     *         2450123.7           0.0       (JD method)
13990     *         2451545.0       -1421.3       (J2000 method)
13991     *         2400000.5       50123.2       (MJD method)
13992     *         2450123.5           0.2       (date &amp; time method)
13993     *</pre>
13994     *     The JD method is the most natural and convenient to use in
13995     *     cases where the loss of several decimal digits of resolution
13996     *     is acceptable.  The J2000 method is best matched to the way
13997     *     the argument is handled internally and will deliver the
13998     *     optimum resolution.  The MJD method and the date &amp; time methods
13999     *     are both good compromises between resolution and convenience.
14000     *
14001     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
14002     *     where the p-vector V(true) is with respect to the true
14003     *     equatorial triad of date and the p-vector V(mean) is with
14004     *     respect to the mean equatorial triad of date.
14005     *</ol>
14006     *<p>Called:<ul>
14007     *     <li>{@link #jauNut80} nutation, IAU 1980
14008     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
14009     *     <li>{@link #jauNumat} form nutation matrix
14010     * </ul>
14011     *@version 2008 May 12
14012     *
14013     *  @since Release 20101201
14014     *
14015     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14016     */
14017     public static double[][] jauNutm80(double date1, double date2)
14018     {
14019         double rmatn[][];
14020     /* Nutation components and mean obliquity. */
14021        NutationTerms nt = jauNut80(date1, date2);
14022        double epsa = jauObl80(date1, date2);
14023 
14024     /* Build the rotation matrix. */
14025        rmatn = jauNumat(epsa, nt.dpsi, nt.deps);
14026 
14027        return rmatn;
14028 
14029         }
14030     
14031 
14032     /**
14033     *  Mean obliquity of the ecliptic, IAU 2006 precession model.
14034     *
14035     *<p>This function is derived from the International Astronomical Union's
14036     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14037     *
14038     *<p>Status:  canonical model.
14039     *
14040     *<!-- Given: -->
14041     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14042     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14043     *
14044     * <!-- Returned (function value): -->
14045     *  @return double   obliquity of the ecliptic (radians, Note 2)
14046     *
14047     * <p>Notes:
14048     * <ol>
14049     *
14050     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14051     *     convenient way between the two arguments.  For example,
14052     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14053     *     among others:
14054     *<pre>
14055     *            date1          date2
14056     *
14057     *         2450123.7           0.0       (JD method)
14058     *         2451545.0       -1421.3       (J2000 method)
14059     *         2400000.5       50123.2       (MJD method)
14060     *         2450123.5           0.2       (date &amp; time method)
14061     *</pre>
14062     *     The JD method is the most natural and convenient to use in
14063     *     cases where the loss of several decimal digits of resolution
14064     *     is acceptable.  The J2000 method is best matched to the way
14065     *     the argument is handled internally and will deliver the
14066     *     optimum resolution.  The MJD method and the date &amp; time methods
14067     *     are both good compromises between resolution and convenience.
14068     *
14069     * <li> The result is the angle between the ecliptic and mean equator of
14070     *     date date1+date2.
14071     *</ol>
14072     *<p>Reference:
14073     *
14074     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14075     *
14076     *@version 2009 March 16
14077     *
14078     *  @since Release 20101201
14079     *
14080     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14081     */
14082     public static double jauObl06(double date1, double date2)
14083     {
14084        double t, eps0;
14085 
14086 
14087     /* Interval between fundamental date J2000.0 and given date (JC). */
14088        t = ((date1 - DJ00) + date2) / DJC;
14089 
14090     /* Mean obliquity. */
14091        eps0 = (84381.406     +
14092               (-46.836769    +
14093               ( -0.0001831   +
14094               (  0.00200340  +
14095               ( -0.000000576 +
14096               ( -0.0000000434) * t) * t) * t) * t) * t) * DAS2R;
14097 
14098        return eps0;
14099 
14100         }
14101     
14102 
14103     /**
14104     *  Mean obliquity of the ecliptic, IAU 1980 model.
14105     *
14106     *<p>This function is derived from the International Astronomical Union's
14107     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14108     *
14109     *<p>Status:  canonical model.
14110     *
14111     *<!-- Given: -->
14112     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14113     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14114     *
14115     * <!-- Returned (function value): -->
14116     *  @return double    obliquity of the ecliptic (radians, Note 2)
14117     *
14118     * <p>Notes:
14119     * <ol>
14120     *
14121     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14122     *     convenient way between the two arguments.  For example,
14123     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14124     *     among others:
14125     *<pre>
14126     *            date1          date2
14127     *
14128     *         2450123.7           0.0       (JD method)
14129     *         2451545.0       -1421.3       (J2000 method)
14130     *         2400000.5       50123.2       (MJD method)
14131     *         2450123.5           0.2       (date &amp; time method)
14132     *</pre>
14133     *     The JD method is the most natural and convenient to use in
14134     *     cases where the loss of several decimal digits of resolution
14135     *     is acceptable.  The J2000 method is best matched to the way
14136     *     the argument is handled internally and will deliver the
14137     *     optimum resolution.  The MJD method and the date &amp; time methods
14138     *     are both good compromises between resolution and convenience.
14139     *
14140     * <li> The result is the angle between the ecliptic and mean equator of
14141     *     date date1+date2.
14142     *</ol>
14143     *<p>Reference:
14144     *
14145     *     <p>Explanatory Supplement to the Astronomical Almanac,
14146     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
14147     *     Expression 3.222-1 (p114).
14148     *
14149     *@version 2009 March 16
14150     *
14151     *  @since Release 20101201
14152     *
14153     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14154     */
14155     public static double jauObl80(double date1, double date2)
14156     {
14157        double t, eps0;
14158 
14159 
14160     /* Interval between fundamental epoch J2000.0 and given date (JC). */
14161        t = ((date1 - DJ00) + date2) / DJC;
14162 
14163     /* Mean obliquity of date. */
14164        eps0 = DAS2R * (84381.448  +
14165                       (-46.8150   +
14166                       (-0.00059   +
14167                       ( 0.001813) * t) * t) * t);
14168 
14169        return eps0;
14170 
14171         }
14172     
14173     
14174     /**
14175      * equinox based precession angles.
14176      *  .
14177      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14178      * @version $Revision$ $date$
14179      */
14180     public static class PrecessionAngles {
14181         /** epsilon_0   obliquity at J2000.0. */
14182         public double eps0; 
14183         /** psi_A       luni-solar precession. */
14184         public double psia;
14185         /** omega_A     inclination of equator wrt J2000.0 ecliptic. */
14186         public  double oma;
14187         /** P_A         ecliptic pole x, J2000.0 ecliptic triad. */
14188         public  double bpa;
14189         /** Q_A         ecliptic pole -y, J2000.0 ecliptic triad. */
14190         public double bqa;
14191         /** pi_A        angle between moving and J2000.0 ecliptics. */
14192         public  double pia;
14193         /** Pi_A        longitude of ascending node of the ecliptic. */
14194         public  double bpia;
14195         /** epsilon_A   obliquity of the ecliptic. */
14196         public double epsa;
14197         /** chi_A       planetary precession. */
14198         public  double chia;
14199         /** z_A         equatorial precession: -3rd 323 Euler angle. */
14200         public  double za;
14201         /** zeta_A      equatorial precession: -1st 323 Euler angle. */
14202         public  double zetaa;
14203         /** theta_A     equatorial precession: 2nd 323 Euler angle. */
14204         public double thetaa;
14205         /** p_A         general precession. */
14206         public  double pa;
14207         /** gamma_J2000 J2000.0 RA difference of ecliptic poles. */
14208         public  double gam;
14209         /** phi_J2000   J2000.0 codeclination of ecliptic pole. */
14210         public  double phi;
14211         /** psi_J2000   longitude difference of equator poles, J2000.0. */
14212         public  double psi;
14213 
14214         public PrecessionAngles ( double eps0, double psia, double oma, double bpa,
14215                  double bqa, double pia, double bpia,
14216                  double epsa, double chia, double za, double zetaa,
14217                  double thetaa, double pa,
14218                  double gam, double phi, double psi){
14219             
14220             this.eps0 = eps0;
14221             this.psia = psia;
14222             this.oma = oma;
14223             this.bpa = bpa;
14224             this.bqa = bqa;
14225             this.pia = pia;
14226             this.bpia = bpia;
14227             this.epsa = epsa;
14228             this.chia = chia;
14229             this.za = za;
14230             this.zetaa = zetaa;
14231             this.thetaa = thetaa;
14232             this.pa = pa;
14233             this.gam = gam;
14234             this.phi = phi;
14235             this.psi = psi;
14236         }
14237     }
14238     /**
14239     *  Precession angles, IAU 2006, equinox based.
14240     *
14241     *<p>This function is derived from the International Astronomical Union's
14242     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14243     *
14244     *<p>Status:  canonical models.
14245     *
14246     *<!-- Given: -->
14247     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14248     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14249     *
14250     *  @return (see Note 2):
14251     *     eps0          double   epsilon_0
14252     *     psia          double   psi_A
14253     *     oma           double   omega_A
14254     *     bpa           double   P_A
14255     *     bqa           double   Q_A
14256     *     pia           double   pi_A
14257     *     bpia          double   Pi_A
14258     *     epsa          double   obliquity epsilon_A
14259     *     chia          double   chi_A
14260     *     za            double   z_A
14261     *     zetaa         double   zeta_A
14262     *     thetaa        double   theta_A
14263     *     pa            double   p_A
14264     *     gam           double   F-W angle gamma_J2000
14265     *     phi           double   F-W angle phi_J2000
14266     *     psi           double   F-W angle psi_J2000
14267     *
14268     * <p>Notes:
14269     * <ol>
14270     *
14271     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14272     *     convenient way between the two arguments.  For example,
14273     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14274     *     among others:
14275     *<pre>
14276     *            date1          date2
14277     *
14278     *         2450123.7           0.0       (JD method)
14279     *         2451545.0       -1421.3       (J2000 method)
14280     *         2400000.5       50123.2       (MJD method)
14281     *         2450123.5           0.2       (date &amp; time method)
14282     *</pre>
14283     *     The JD method is the most natural and convenient to use in
14284     *     cases where the loss of several decimal digits of resolution
14285     *     is acceptable.  The J2000 method is best matched to the way
14286     *     the argument is handled internally and will deliver the
14287     *     optimum resolution.  The MJD method and the date &amp; time methods
14288     *     are both good compromises between resolution and convenience.
14289     *
14290     * <li> This function returns the set of equinox based angles for the
14291     *     Capitaine et al. "P03" precession theory, adopted by the IAU in
14292     *     2006.  The angles are set out in Table 1 of Hilton et al. (2006):
14293     *
14294     *     eps0   epsilon_0   obliquity at J2000.0
14295     *     psia   psi_A       luni-solar precession
14296     *     oma    omega_A     inclination of equator wrt J2000.0 ecliptic
14297     *     bpa    P_A         ecliptic pole x, J2000.0 ecliptic triad
14298     *     bqa    Q_A         ecliptic pole -y, J2000.0 ecliptic triad
14299     *     pia    pi_A        angle between moving and J2000.0 ecliptics
14300     *     bpia   Pi_A        longitude of ascending node of the ecliptic
14301     *     epsa   epsilon_A   obliquity of the ecliptic
14302     *     chia   chi_A       planetary precession
14303     *     za     z_A         equatorial precession: -3rd 323 Euler angle
14304     *     zetaa  zeta_A      equatorial precession: -1st 323 Euler angle
14305     *     thetaa theta_A     equatorial precession: 2nd 323 Euler angle
14306     *     pa     p_A         general precession (see note below)
14307     *     gam    gamma_J2000 J2000.0 RA difference of ecliptic poles
14308     *     phi    phi_J2000   J2000.0 codeclination of ecliptic pole
14309     *     psi    psi_J2000   longitude difference of equator poles, J2000.0
14310     *
14311     *     The returned values are all radians.
14312     *     
14313     *  <li>Note that the t^5 coefficient in the series for p_A from
14314     *   Capitaine et al. (2003) is incorrectly signed in Hilton et al. (2006).
14315     *
14316     * <li> Hilton et al. (2006) Table 1 also contains angles that depend on
14317     *     models distinct from the P03 precession theory itself, namely the
14318     *     IAU 2000A frame bias and nutation.  The quoted polynomials are
14319     *     used in other JSOFA functions:
14320     *
14321     *     . jauXy06  contains the polynomial parts of the X and Y series.
14322     *
14323     *     . jauS06  contains the polynomial part of the s+XY/2 series.
14324     *
14325     *     . jauPfw06  implements the series for the Fukushima-Williams
14326     *       angles that are with respect to the GCRS pole (i.e. the variants
14327     *       that include frame bias).
14328     *
14329     * <li> The IAU resolution stipulated that the choice of parameterization
14330     *     was left to the user, and so an IAU compliant precession
14331     *     implementation can be constructed using various combinations of
14332     *     the angles returned by the present function.
14333     *
14334     * <li> The parameterization used by JSOFA is the Fukushima-Williams angles
14335     *     referred directly to the GCRS pole.  These are the final four
14336     *     arguments returned by the present function, but are more
14337     *     efficiently calculated by calling the function jauPfw06.   JSOFA
14338     *     also supports the direct computation of the CIP GCRS X,Y by
14339     *     series, available by calling jauXy06.
14340     *
14341     * <li> The agreement between the different parameterizations is at the
14342     *     1 microarcsecond level in the present era.
14343     *
14344     * <li> When constructing a precession formulation that refers to the GCRS
14345     *     pole rather than the dynamical pole, it may (depending on the
14346     *     choice of angles) be necessary to introduce the frame bias
14347     *     explicitly.
14348     *
14349     * <li> It is permissible to re-use the same variable in the returned
14350     *     arguments.  The quantities are stored in the stated order.
14351     *</ol>
14352     *<p>References:<ol>
14353     *   <li> Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003, Astron.Astrophys., 412, 567
14354     *   <li> Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14355     *</ol>
14356     *<p>Called:<ul>
14357     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14358     * </ul>
14359     *@version 2020 Nov 13
14360     *
14361     *  @since Release 20101201
14362     *
14363     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14364     */
14365     public static PrecessionAngles jauP06e(double date1, double date2)
14366     {
14367        double t;
14368        double eps0,  psia,  oma,  bpa,
14369         bqa,  pia,  bpia,
14370         epsa,  chia,  za,  zetaa,
14371         thetaa,  pa,
14372         gam,  phi,  psi;
14373 
14374     /* Interval between fundamental date J2000.0 and given date (JC). */
14375        t = ((date1 - DJ00) + date2) / DJC;
14376 
14377     /* Obliquity at J2000.0. */
14378 
14379        eps0 = 84381.406 * DAS2R;
14380 
14381     /* Luni-solar precession. */
14382 
14383        psia = ( 5038.481507     +
14384                (   -1.0790069    +
14385                (   -0.00114045   +
14386                (    0.000132851  +
14387                (   -0.0000000951 )
14388                * t) * t) * t) * t) * t * DAS2R;
14389 
14390     /* Inclination of mean equator with respect to the J2000.0 ecliptic. */
14391 
14392        oma = eps0 + ( -0.025754     +
14393                       (  0.0512623    +
14394                       ( -0.00772503   +
14395                       ( -0.000000467  +
14396                       (  0.0000003337 )
14397                       * t) * t) * t) * t) * t * DAS2R;
14398 
14399     /* Ecliptic pole x, J2000.0 ecliptic triad. */
14400 
14401        bpa = (  4.199094     +
14402               (  0.1939873    +
14403               ( -0.00022466   +
14404               ( -0.000000912  +
14405               (  0.0000000120 )
14406               * t) * t) * t) * t) * t * DAS2R;
14407 
14408     /* Ecliptic pole -y, J2000.0 ecliptic triad. */
14409 
14410        bqa = ( -46.811015     +
14411               (   0.0510283    +
14412               (   0.00052413   +
14413               (  -0.000000646  +
14414               (  -0.0000000172 )
14415               * t) * t) * t) * t) * t * DAS2R;
14416 
14417     /* Angle between moving and J2000.0 ecliptics. */
14418 
14419        pia = ( 46.998973     +
14420               ( -0.0334926    +
14421               ( -0.00012559   +
14422               (  0.000000113  +
14423               ( -0.0000000022 )
14424               * t) * t) * t) * t) * t * DAS2R;
14425 
14426     /* Longitude of ascending node of the moving ecliptic. */
14427 
14428        bpia = ( 629546.7936      +
14429                (   -867.95758     +
14430                (      0.157992    +
14431                (     -0.0005371   +
14432                (     -0.00004797  +
14433                (      0.000000072 )
14434                * t) * t) * t) * t) * t) * DAS2R;
14435 
14436     /* Mean obliquity of the ecliptic. */
14437 
14438        epsa = jauObl06(date1, date2);
14439 
14440     /* Planetary precession. */
14441 
14442        chia = ( 10.556403     +
14443                ( -2.3814292    +
14444                ( -0.00121197   +
14445                (  0.000170663  +
14446                ( -0.0000000560 )
14447                * t) * t) * t) * t) * t * DAS2R;
14448 
14449     /* Equatorial precession: minus the third of the 323 Euler angles. */
14450 
14451        za = (   -2.650545     +
14452              ( 2306.077181     +
14453              (    1.0927348    +
14454              (    0.01826837   +
14455              (   -0.000028596  +
14456              (   -0.0000002904 )
14457              * t) * t) * t) * t) * t) * DAS2R;
14458 
14459     /* Equatorial precession: minus the first of the 323 Euler angles. */
14460 
14461        zetaa = (    2.650545     +
14462                 ( 2306.083227     +
14463                 (    0.2988499    +
14464                 (    0.01801828   +
14465                 (   -0.000005971  +
14466                 (   -0.0000003173 )
14467                 * t) * t) * t) * t) * t) * DAS2R;
14468 
14469     /* Equatorial precession: second of the 323 Euler angles. */
14470 
14471        thetaa = ( 2004.191903     +
14472                  (   -0.4294934    +
14473                  (   -0.04182264   +
14474                  (   -0.000007089  +
14475                  (   -0.0000001274 )
14476                  * t) * t) * t) * t) * t * DAS2R;
14477 
14478     /* General precession. */
14479 
14480        pa = ( 5028.796195     +
14481              (    1.1054348    +
14482              (    0.00007964   +
14483              (   -0.000023857  +
14484              (   -0.0000000383 )
14485              * t) * t) * t) * t) * t * DAS2R;
14486 
14487     /* Fukushima-Williams angles for precession. */
14488 
14489        gam = ( 10.556403     +
14490               (  0.4932044    +
14491               ( -0.00031238   +
14492               ( -0.000002788  +
14493               (  0.0000000260 )
14494               * t) * t) * t) * t) * t * DAS2R;
14495 
14496        phi = eps0 + ( -46.811015     +
14497                       (   0.0511269    +
14498                       (   0.00053289   +
14499                       (  -0.000000440  +
14500                       (  -0.0000000176 )
14501                       * t) * t) * t) * t) * t * DAS2R;
14502 
14503        psi = ( 5038.481507     +
14504               (    1.5584176    +
14505               (   -0.00018522   +
14506               (   -0.000026452  +
14507               (   -0.0000000148 )
14508               * t) * t) * t) * t) * t * DAS2R;
14509 
14510        return new PrecessionAngles(eps0, psia, oma, bpa, bqa, pia, bpia, epsa, chia, za, zetaa, thetaa, pa, gam, phi, psi);
14511 
14512         }
14513     
14514 
14515     /**
14516     *  Extend a p-vector to a pv-vector by appending a zero velocity.
14517     *
14518     *<p>This function is derived from the International Astronomical Union's
14519     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14520     *
14521     *<p>Status:  vector/matrix support function.
14522     *
14523     *<!-- Given: -->
14524     *     @param p         double[3]        p-vector
14525     *
14526     *<!-- Returned: -->
14527     *     @return pv        double[2][3]      <u>returned</u> pv-vector
14528     *
14529     *<p>Called:<ul>
14530     *     <li>{@link #jauCp} copy p-vector
14531     *     <li>{@link #jauZp} zero p-vector
14532     * </ul>
14533     *@version 2008 May 11
14534     *
14535     *  @since Release 20101201
14536     *
14537     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14538     */
14539     public static double[][] jauP2pv(double p[] )
14540     {
14541         double pv[][] = new double[3][3];
14542         jauCp(p, pv[0]);
14543         jauZp(pv[1]);
14544 
14545         return pv;
14546 
14547         }
14548     
14549     /**
14550      * A position expressed in spherical polar coordinates.
14551      *  .
14552      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14553      * @version $Revision$ $date$
14554      */
14555     public static class SphericalPosition {
14556         /** longitude angle (radians) */
14557         public double theta;
14558         /** latitude angle (radians) */
14559         public double phi;
14560         /** radial distance */
14561         public double r;
14562         public SphericalPosition(double theta, double phi, double r) {
14563            this.theta = theta;
14564            this.phi = phi;
14565            this.r = r;
14566         }
14567     }
14568     
14569     /**
14570     *  P-vector to spherical polar coordinates.
14571     *
14572     *<p>This function is derived from the International Astronomical Union's
14573     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14574     *
14575     *<p>Status:  vector/matrix support function.
14576     *
14577     *<!-- Given: -->
14578     *     @param p         double[3]     p-vector
14579     *
14580     *<!-- Returned: -->
14581     *     @return theta     double         <u>returned</u> longitude angle (radians)
14582     *             phi       double         <u>returned</u> latitude angle (radians)
14583     *             r         double         <u>returned</u> radial distance
14584     *
14585     * <p>Notes:
14586     * <ol>
14587     *
14588     * <li> If P is null, zero theta, phi and r are returned.
14589     *
14590     * <li> At either pole, zero theta is returned.
14591     *</ol>
14592     *<p>Called:<ul>
14593     *     <li>{@link #jauC2s} p-vector to spherical
14594     *     <li>{@link #jauPm} modulus of p-vector
14595     * </ul>
14596     *@version 2008 May 22
14597     *
14598     *  @since Release 20101201
14599     *
14600     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14601     */
14602     public static SphericalPosition jauP2s(double p[])
14603     {
14604        SphericalCoordinate sc = jauC2s(p);
14605        double r = jauPm(p);
14606 
14607        return new SphericalPosition(sc.alpha, sc.delta, r);
14608 
14609         }
14610     
14611 
14612     /**
14613     *  Position-angle from two p-vectors.
14614     *
14615     *<p>This function is derived from the International Astronomical Union's
14616     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14617     *
14618     *<p>Status:  vector/matrix support function.
14619     *
14620     *<!-- Given: -->
14621     *     @param a       double[3]   direction of reference point
14622     *     @param b       double[3]   direction of point whose PA is required
14623     *
14624     * <!-- Returned (function value): -->
14625     *  @return double     position angle of b with respect to a (radians)
14626     *
14627     * <p>Notes:
14628     * <ol>
14629     *
14630     * <li> The result is the position angle, in radians, of direction b with
14631     *     respect to direction a.  It is in the range -pi to +pi.  The
14632     *     sense is such that if b is a small distance "north" of a the
14633     *     position angle is approximately zero, and if b is a small
14634     *     distance "east" of a the position angle is approximately +pi/2.
14635     *
14636     * <li> The vectors a and b need not be of unit length.
14637     *
14638     * <li> Zero is returned if the two directions are the same or if either
14639     *     vector is null.
14640     *
14641     * <li> If vector a is at a pole, the result is ill-defined.
14642     *</ol>
14643     *<p>Called:<ul>
14644     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
14645     *     <li>{@link #jauPm} modulus of p-vector
14646     *     <li>{@link #jauPxp} vector product of two p-vectors
14647     *     <li>{@link #jauPmp} p-vector minus p-vector
14648     *     <li>{@link #jauPdp} scalar product of two p-vectors
14649     * </ul>
14650     *@version 2008 May 25
14651     *
14652     *  @since Release 20101201
14653     *
14654     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14655     */
14656     public static double jauPap(double a[] , double b[] )
14657     {
14658        double am, au[] = new double[3], bm, st, ct, xa, ya, za, eta[] = new double[3], xi[] = new double[3], a2b[] = new double[3], pa;
14659 
14660 
14661     /* Modulus and direction of the a vector. */
14662        NormalizedVector nv = jauPn(a );
14663        am = nv.r; au = nv.u;
14664     /* Modulus of the b vector. */
14665        bm = jauPm(b);
14666 
14667     /* Deal with the case of a null vector. */
14668        if ((am == 0.0) || (bm == 0.0)) {
14669           st = 0.0;
14670           ct = 1.0;
14671        } else {
14672 
14673        /* The "north" axis tangential from a (arbitrary length). */
14674           xa = a[0];
14675           ya = a[1];
14676           za = a[2];
14677           eta[0] = -xa * za;
14678           eta[1] = -ya * za;
14679           eta[2] =  xa*xa + ya*ya;
14680 
14681        /* The "east" axis tangential from a (same length). */
14682           xi = jauPxp(eta,au);
14683 
14684        /* The vector from a to b. */
14685           a2b = jauPmp(b, a);
14686 
14687        /* Resolve into components along the north and east axes. */
14688           st = jauPdp(a2b, xi);
14689           ct = jauPdp(a2b, eta);
14690 
14691        /* Deal with degenerate cases. */
14692           if ((st == 0.0) && (ct == 0.0)) ct = 1.0;
14693        }
14694 
14695     /* Position angle. */
14696        pa = atan2(st, ct);
14697 
14698        return pa;
14699 
14700         }
14701     
14702 
14703     /**
14704     *  Position-angle from spherical coordinates.
14705     *
14706     *<p>This function is derived from the International Astronomical Union's
14707     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14708     *
14709     *<p>Status:  vector/matrix support function.
14710     *
14711     *<!-- Given: -->
14712     *     @param al      double      longitude of point A (e.g. RA) in radians
14713     *     @param ap      double      latitude of point A (e.g. Dec) in radians
14714     *     @param bl      double      longitude of point B
14715     *     @param bp      double      latitude of point B
14716     *
14717     * <!-- Returned (function value): -->
14718     *  @return double     position angle of B with respect to A
14719     *
14720     * <p>Notes:
14721     * <ol>
14722     *
14723     * <li> The result is the bearing (position angle), in radians, of point
14724     *     B with respect to point A.  It is in the range -pi to +pi.  The
14725     *     sense is such that if B is a small distance "east" of point A,
14726     *     the bearing is approximately +pi/2.
14727     *
14728     * <li> Zero is returned if the two points are coincident.
14729     *</ol>
14730     *@version 2008 May 22
14731     *
14732     *  @since Release 20101201
14733     *
14734     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14735     */
14736     public static double jauPas(double al, double ap, double bl, double bp)
14737     {
14738        double dl, x, y, pa;
14739 
14740 
14741        dl = bl - al;
14742        y = sin(dl) * cos(bp);
14743        x = sin(bp) * cos(ap) - cos(bp) * sin(ap) * cos(dl);
14744        pa = ((x != 0.0) || (y != 0.0)) ? atan2(y, x) : 0.0;
14745 
14746        return pa;
14747 
14748         }
14749     
14750 
14751     /**
14752     *  This function forms three Euler angles which implement general
14753     *  precession from epoch J2000.0, using the IAU 2006 model.  Frame
14754     *  bias (the offset between ICRS and mean J2000.0) is included.
14755     *
14756     *<p>This function is derived from the International Astronomical Union's
14757     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14758     *
14759     *<p>Status:  support function.
14760     *
14761     *<!-- Given: -->
14762     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14763     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14764     *
14765     *<!-- Returned: -->
14766     *     @return bzeta          1st rotation: radians cw around z,
14767     *                            3rd rotation: radians cw around z,
14768     *                            2nd rotation: radians ccw around y.
14769     *
14770     * <p>Notes:
14771     * <ol>
14772     *
14773     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14774     *     convenient way between the two arguments.  For example,
14775     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14776     *     among others:
14777     *<pre>
14778     *            date1          date2
14779     *
14780     *         2450123.7           0.0       (JD method)
14781     *         2451545.0       -1421.3       (J2000 method)
14782     *         2400000.5       50123.2       (MJD method)
14783     *         2450123.5           0.2       (date &amp; time method)
14784     *</pre>
14785     *     The JD method is the most natural and convenient to use in
14786     *     cases where the loss of several decimal digits of resolution
14787     *     is acceptable.  The J2000 method is best matched to the way
14788     *     the argument is handled internally and will deliver the
14789     *     optimum resolution.  The MJD method and the date &amp; time methods
14790     *     are both good compromises between resolution and convenience.
14791     *
14792     * <li> The traditional accumulated precession angles zeta_A, z_A,
14793     *     theta_A cannot be obtained in the usual way, namely through
14794     *     polynomial expressions, because of the frame bias.  The latter
14795     *     means that two of the angles undergo rapid changes near this
14796     *     date.  They are instead the results of decomposing the
14797     *     precession-bias matrix obtained by using the Fukushima-Williams
14798     *     method, which does not suffer from the problem.  The
14799     *     decomposition returns values which can be used in the
14800     *     conventional formulation and which include frame bias.
14801     *
14802     * <li> The three angles are returned in the conventional order, which
14803     *     is not the same as the order of the corresponding Euler
14804     *     rotations.  The precession-bias matrix is
14805     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
14806     *
14807     * <li> Should zeta_A, z_A, theta_A angles be required that do not
14808     *     contain frame bias, they are available by calling the JSOFA
14809     *     function jauP06e.
14810     *</ol>
14811     *<p>Called:<ul>
14812     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
14813     *     <li>{@link #jauRz} rotate around Z-axis
14814     * </ul>
14815     *@version 2008 May 26
14816     *
14817     *  @since Release 20101201
14818     *
14819     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14820     */
14821     public static EulerAngles jauPb06(double date1, double date2)
14822     {
14823         double r[][] = new double[3][3], y, x;
14824 
14825 
14826         /* Precession matrix via Fukushima-Williams angles. */
14827         r = jauPmat06(date1, date2);
14828 
14829         /* Solve for z, choosing the +/- pi alternative. */
14830         y = r[1][2];
14831         x = -r[0][2];
14832         if ( x < 0.0 ) {
14833             y = -y;
14834             x = -x;
14835         }
14836         double bz = ( x != 0.0 || y != 0.0 ) ? - atan2(y,x) : 0.0;
14837 
14838         /* Derotate it out of the matrix. */
14839         jauRz ( bz, r );
14840 
14841         /* Solve for the remaining two angles. */
14842         y = r[0][2];
14843         x = r[2][2];
14844         double btheta = ( x != 0.0 || y != 0.0 ) ? - atan2(y,x) : 0.0;
14845 
14846         y = -r[1][0];
14847         x = r[1][1];
14848         double bzeta = ( x != 0.0 || y != 0.0 ) ? - atan2(y,x) : 0.0;
14849 
14850         return new EulerAngles(bzeta, bz, btheta);
14851 
14852     }
14853 
14854 
14855     /**
14856     *  p-vector inner (=scalar=dot) product.
14857     *
14858     *<p>This function is derived from the International Astronomical Union's
14859     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14860     *
14861     *<p>Status:  vector/matrix support function.
14862     *
14863     *<!-- Given: -->
14864     *     @param a       double[3]      first p-vector
14865     *     @param b       double[3]      second p-vector
14866     *
14867     * <!-- Returned (function value): -->
14868     *  @return double        a . b
14869     *
14870     *@version 2008 May 22
14871     *
14872     *  @since Release 20101201
14873     *
14874     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14875     */
14876     public static double jauPdp(double a[] , double b[] )
14877     {
14878        double w;
14879 
14880 
14881        w  = a[0] * b[0]
14882           + a[1] * b[1]
14883           + a[2] * b[2];
14884 
14885        return w;
14886 
14887         }
14888     
14889 
14890     /**
14891      * Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14892      * 
14893      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
14894      * 
14895      * @since AIDA Stage 1
14896      */
14897     public static class FWPrecessionAngles{
14898         /** F-W angle gamma_bar (radians) */
14899         public double gamb;
14900         /** F-W angle phi_bar (radians) */
14901         public double phib;
14902         /** F-W angle psi_bar (radians) */
14903         public double psib;
14904         /** F-W angle epsilon_A (radians) */
14905         public double epsa;
14906         public FWPrecessionAngles(double gamb, double phib, double psib, double epsa) {
14907             this.gamb = gamb;
14908             this.phib = phib;
14909             this.psib = psib;
14910             this.epsa = epsa;
14911         }
14912     }
14913     /**
14914     *  Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14915     *
14916     *<p>This function is derived from the International Astronomical Union's
14917     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14918     *
14919     *<p>Status:  canonical model.
14920     *
14921     *<!-- Given: -->
14922     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14923     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14924     *
14925     *<!-- Returned: -->
14926     *     @return gamb          double     <u>returned</u> F-W angle gamma_bar (radians)
14927     *             phib          double     <u>returned</u> F-W angle phi_bar (radians)
14928     *             psib          double     <u>returned</u> F-W angle psi_bar (radians)
14929     *             epsa          double     <u>returned</u> F-W angle epsilon_A (radians)
14930     *
14931     * <p>Notes:
14932     * <ol>
14933     *
14934     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14935     *     convenient way between the two arguments.  For example,
14936     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14937     *     among others:
14938     *<pre>
14939     *            date1          date2
14940     *
14941     *         2450123.7           0.0       (JD method)
14942     *         2451545.0       -1421.3       (J2000 method)
14943     *         2400000.5       50123.2       (MJD method)
14944     *         2450123.5           0.2       (date &amp; time method)
14945     *</pre>
14946     *     The JD method is the most natural and convenient to use in
14947     *     cases where the loss of several decimal digits of resolution
14948     *     is acceptable.  The J2000 method is best matched to the way
14949     *     the argument is handled internally and will deliver the
14950     *     optimum resolution.  The MJD method and the date &amp; time methods
14951     *     are both good compromises between resolution and convenience.
14952     *
14953     * <li> Naming the following points:
14954     *
14955     *           e = J2000.0 ecliptic pole,
14956     *           p = GCRS pole,
14957     *           E = mean ecliptic pole of date,
14958     *     and   P = mean pole of date,
14959     *
14960     *     the four Fukushima-Williams angles are as follows:
14961     *
14962     *        gamb = gamma_bar = epE
14963     *        phib = phi_bar = pE
14964     *        psib = psi_bar = pEP
14965     *        epsa = epsilon_A = EP
14966     *
14967     * <li> The matrix representing the combined effects of frame bias and
14968     *     precession is:
14969     *
14970     *        PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb)
14971     *
14972     * <li> The matrix representing the combined effects of frame bias,
14973     *     precession and nutation is simply:
14974     *
14975     *        NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb)
14976     *
14977     *     where dP and dE are the nutation components with respect to the
14978     *     ecliptic of date.
14979     *</ol>
14980     *<p>Reference:
14981     *
14982     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14983     *
14984     *<p>Called:<ul>
14985     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14986     * </ul>
14987     *@version 2009 December 17
14988     *
14989     *  @since Release 20101201
14990     *
14991     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14992     */
14993     public static FWPrecessionAngles jauPfw06(double date1, double date2 )
14994     {
14995        double t;
14996 
14997 
14998     /* Interval between fundamental date J2000.0 and given date (JC). */
14999        t = ((date1 - DJ00) + date2) / DJC;
15000 
15001     /* P03 bias+precession angles. */
15002        double gamb = (    -0.052928     +
15003                (    10.556378     +
15004                (     0.4932044    +
15005                (    -0.00031238   +
15006                (    -0.000002788  +
15007                (     0.0000000260 )
15008                * t) * t) * t) * t) * t) * DAS2R;
15009        double phib = ( 84381.412819     +
15010                (   -46.811016     +
15011                (     0.0511268    +
15012                (     0.00053289   +
15013                (    -0.000000440  +
15014                (    -0.0000000176 )
15015                * t) * t) * t) * t) * t) * DAS2R;
15016        double psib = (    -0.041775     +
15017                (  5038.481484     +
15018                (     1.5584175    +
15019                (    -0.00018522   +
15020                (    -0.000026452  +
15021                (    -0.0000000148 )
15022                * t) * t) * t) * t) * t) * DAS2R;
15023        double epsa =  jauObl06(date1, date2);
15024 
15025        return new FWPrecessionAngles(gamb, phib, psib, epsa);
15026 
15027         }
15028     
15029 
15030     /**
15031     *
15032     *  Approximate heliocentric position and velocity of a nominated major
15033     *  planet:  Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or
15034     *  Neptune (but not the Earth itself).
15035     *  
15036     *  n.b. Not IAU-endorsed and without canonical status.
15037     *  
15038     *<p>This function is derived from the International Astronomical Union's
15039     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15040     *
15041     *<p>Status:  support function.
15042     *
15043     *<!-- Given: -->
15044     *     @param date1   double        TDB date part A (Note 1)
15045     *     @param date2   double        TDB date part B (Note 1)
15046     *     @param np      int           planet (1=Mercury, 2=Venus, 3=EMB, 4=Mars,
15047     *                                  5=Jupiter,  6=Saturn,  7=Uranus, 8=Neptune)
15048     *
15049     *  Returned (argument):
15050     *     @return  pv     double[2][3] (returned) planet p,v (heliocentric, J2000.0, au,au/d)
15051     *
15052     *
15053     * <p>Notes:
15054     * <ol>
15055     *
15056     * <li> The date date1+date2 is in the TDB time scale (in practice TT can
15057     *     be used) and is a Julian Date, apportioned in any convenient way
15058     *     between the two arguments.  For example, JD(TDB)=2450123.7 could
15059     *     be expressed in any of these ways, among others:
15060     *<pre>
15061     *            date1          date2
15062     *
15063     *         2450123.7           0.0       (JD method)
15064     *         2451545.0       -1421.3       (J2000 method)
15065     *         2400000.5       50123.2       (MJD method)
15066     *         2450123.5           0.2       (date &amp; time method)
15067     *</pre>
15068     *     The JD method is the most natural and convenient to use in cases
15069     *     where the loss of several decimal digits of resolution is
15070     *     acceptable.  The J2000 method is best matched to the way the
15071     *     argument is handled internally and will deliver the optimum
15072     *     resolution.  The MJD method and the date &amp; time methods are both
15073     *     good compromises between resolution and convenience.  The limited
15074     *     accuracy of the present algorithm is such that any of the methods
15075     *     is satisfactory.
15076     *
15077     * <li> If an np value outside the range 1-8 is supplied, an exception is thrown.
15078     *
15079     * <li> For np=3 the result is for the Earth-Moon Barycenter.  To obtain
15080     *     the heliocentric position and velocity of the Earth, use instead
15081     *     the JSOFA function jauEpv00.
15082     *
15083     * <li> On successful return, the array pv contains the following:
15084     *<pre>
15085     *        pv[0][0]   x      }
15086     *        pv[0][1]   y      } heliocentric position, au
15087     *        pv[0][2]   z      }
15088     *
15089     *        pv[1][0]   xdot   }
15090     *        pv[1][1]   ydot   } heliocentric velocity, au/d
15091     *        pv[1][2]   zdot   }
15092     *</pre>
15093     *     The reference frame is equatorial and is with respect to the
15094     *     mean equator and equinox of epoch J2000.0.
15095     *
15096     * <li> The algorithm is due to J.L. Simon, P. Bretagnon, J. Chapront,
15097     *     M. Chapront-Touze, G. Francou and J. Laskar (Bureau des
15098     *     Longitudes, Paris, France).  From comparisons with JPL
15099     *     ephemeris DE102, they quote the following maximum errors
15100     *     over the interval 1800-2050:
15101     *<pre>
15102     *                     L (arcsec)    B (arcsec)      R (km)
15103     *
15104     *        Mercury          4             1             300
15105     *        Venus            5             1             800
15106     *        EMB              6             1            1000
15107     *        Mars            17             1            7700
15108     *        Jupiter         71             5           76000
15109     *        Saturn          81            13          267000
15110     *        Uranus          86             7          712000
15111     *        Neptune         11             1          253000
15112     *</pre>
15113     *     Over the interval 1000-3000, they report that the accuracy is no
15114     *     worse than 1.5 times that over 1800-2050.  Outside 1000-3000 the
15115     *     accuracy declines.
15116     *
15117     *     Comparisons of the present function with the JPL DE200 ephemeris
15118     *     give the following RMS errors over the interval 1960-2025:
15119     *<pre>
15120     *                      position (km)     velocity (m/s)
15121     *
15122     *        Mercury            334               0.437
15123     *        Venus             1060               0.855
15124     *        EMB               2010               0.815
15125     *        Mars              7690               1.98
15126     *        Jupiter          71700               7.70
15127     *        Saturn          199000              19.4
15128     *        Uranus          564000              16.4
15129     *        Neptune         158000              14.4
15130     *</pre>
15131     *     Comparisons against DE200 over the interval 1800-2100 gave the
15132     *     following maximum absolute differences.  (The results using
15133     *     DE406 were essentially the same.)
15134     *<pre>
15135     *                   L (arcsec)   B (arcsec)     R (km)   Rdot (m/s)
15136     *
15137     *        Mercury        7            1            500       0.7
15138     *        Venus          7            1           1100       0.9
15139     *        EMB            9            1           1300       1.0
15140     *        Mars          26            1           9000       2.5
15141     *        Jupiter       78            6          82000       8.2
15142     *        Saturn        87           14         263000      24.6
15143     *        Uranus        86            7         661000      27.4
15144     *        Neptune       11            2         248000      21.4
15145     *</pre>
15146     * <li> The present JSOFA re-implementation of the original Simon et al.
15147     *     Fortran code differs from the original in the following respects:
15148     *<ul>
15149     *       <li>  C instead of Fortran.
15150     *
15151     *       <li>  The date is supplied in two parts.
15152     *
15153     *       <li>  The result is returned only in equatorial Cartesian form;
15154     *          the ecliptic longitude, latitude and radius vector are not
15155     *          returned.
15156     *
15157     *       <li>  The result is in the J2000.0 equatorial frame, not ecliptic.
15158     *
15159     *       <li>  More is done in-line: there are fewer calls to subroutines.
15160     *
15161     *       <li>  Different error/warning status values are used.
15162     *
15163     *       <li>  A different Kepler's-equation-solver is used (avoiding
15164     *          use of double precision complex).
15165     *
15166     *       <li>  Polynomials in t are nested to minimize rounding errors.
15167     *
15168     *       <li>  Explicit double constants are used to avoid mixed-mode
15169     *          expressions.
15170     *</ul>
15171     *     None of the above changes affects the result significantly.
15172     *
15173     * <li> The returned status indicates the most serious condition
15174     *     encountered during execution of the function.  Illegal np is
15175     *     considered the most serious, overriding failure to converge,
15176     *     which in turn takes precedence over the remote date warning.
15177     *</ol>
15178     *<p>Called:<ul>
15179     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
15180     * </ul>
15181     *<p>Reference:  Simon, J.L, Bretagnon, P., Chapront, J.,
15182     *              Chapront-Touze, M., Francou, G., and Laskar, J.,
15183     *              Astron. Astrophys. 282, 663 (1994).
15184     *
15185     *@version 2009 December 17
15186     * @throws JSOFAIllegalParameter for a bad np (planet number)
15187     *
15188     *  @since Release 20101201
15189     *
15190     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15191     */
15192     public static double[][] jauPlan94(double date1, double date2, int np) throws JSOFAIllegalParameter
15193     {
15194        double pv[][] = new double[2][3];
15195     /* Gaussian constant */
15196        final double GK = 0.017202098950;
15197 
15198     /* Sin and cos of J2000.0 mean obliquity (IAU 1976) */
15199        final double SINEPS = 0.3977771559319137;
15200        final double COSEPS = 0.9174820620691818;
15201 
15202     /* Maximum number of iterations allowed to solve Kepler's equation */
15203        final int KMAX = 10;
15204 
15205        int jstat, i, k;
15206        double t, da, dl, de, dp, di, dom, dmu, arga, argl, am,
15207               ae, dae, ae2, at, r, v, si2, xq, xp, tl, xsw,
15208               xcw, xm2, xf, ci2, xms, xmc, xpxq2, x, y, z;
15209 
15210     /* Planetary inverse masses */
15211        final double amas[] = { 6023600.0,       /* Mercury */
15212                                        408523.5,       /* Venus   */
15213                                        328900.5,       /* EMB     */
15214                                       3098710.0,       /* Mars    */
15215                                          1047.355,     /* Jupiter */
15216                                          3498.5,       /* Saturn  */
15217                                         22869.0,       /* Uranus  */
15218                                         19314.0 };     /* Neptune */
15219 
15220     /*
15221     * Tables giving the mean Keplerian elements, limited to t^2 terms:
15222     *
15223     *   a       semi-major axis (au)
15224     *   dlm     mean longitude (degree and arcsecond)
15225     *   e       eccentricity
15226     *   pi      longitude of the perihelion (degree and arcsecond)
15227     *   dinc    inclination (degree and arcsecond)
15228     *   omega   longitude of the ascending node (degree and arcsecond)
15229     */
15230 
15231        final double a[][] = {
15232            {  0.3870983098,           0.0,     0.0 },  /* Mercury */
15233            {  0.7233298200,           0.0,     0.0 },  /* Venus   */
15234            {  1.0000010178,           0.0,     0.0 },  /* EMB     */
15235            {  1.5236793419,         3e-10,     0.0 },  /* Mars    */
15236            {  5.2026032092,     19132e-10, -39e-10 },  /* Jupiter */
15237            {  9.5549091915, -0.0000213896, 444e-10 },  /* Saturn  */
15238            { 19.2184460618,     -3716e-10, 979e-10 },  /* Uranus  */
15239            { 30.1103868694,    -16635e-10, 686e-10 }   /* Neptune */
15240        };
15241 
15242        final double dlm[][] = {
15243            { 252.25090552, 5381016286.88982,  -1.92789 },
15244            { 181.97980085, 2106641364.33548,   0.59381 },
15245            { 100.46645683, 1295977422.83429,  -2.04411 },
15246            { 355.43299958,  689050774.93988,   0.94264 },
15247            {  34.35151874,  109256603.77991, -30.60378 },
15248            {  50.07744430,   43996098.55732,  75.61614 },
15249            { 314.05500511,   15424811.93933,  -1.75083 },
15250            { 304.34866548,    7865503.20744,   0.21103 }
15251        };
15252 
15253        final double e[][] = {
15254            { 0.2056317526,  0.0002040653,    -28349e-10 },
15255            { 0.0067719164, -0.0004776521,     98127e-10 },
15256            { 0.0167086342, -0.0004203654, -0.0000126734 },
15257            { 0.0934006477,  0.0009048438,    -80641e-10 },
15258            { 0.0484979255,  0.0016322542, -0.0000471366 },
15259            { 0.0555481426, -0.0034664062, -0.0000643639 },
15260            { 0.0463812221, -0.0002729293,  0.0000078913 },
15261            { 0.0094557470,  0.0000603263,           0.0 }
15262        };
15263 
15264        final double pi[][] = {
15265            {  77.45611904,  5719.11590,   -4.83016 },
15266            { 131.56370300,   175.48640, -498.48184 },
15267            { 102.93734808, 11612.35290,   53.27577 },
15268            { 336.06023395, 15980.45908,  -62.32800 },
15269            {  14.33120687,  7758.75163,  259.95938 },
15270            {  93.05723748, 20395.49439,  190.25952 },
15271            { 173.00529106,  3215.56238,  -34.09288 },
15272            {  48.12027554,  1050.71912,   27.39717 }
15273        };
15274 
15275        final double dinc[][] = {
15276            { 7.00498625, -214.25629,   0.28977 },
15277            { 3.39466189,  -30.84437, -11.67836 },
15278            {        0.0,  469.97289,  -3.35053 },
15279            { 1.84972648, -293.31722,  -8.11830 },
15280            { 1.30326698,  -71.55890,  11.95297 },
15281            { 2.48887878,   91.85195, -17.66225 },
15282            { 0.77319689,  -60.72723,   1.25759 },
15283            { 1.76995259,    8.12333,   0.08135 }
15284        };
15285 
15286        final double omega[][] = {
15287            {  48.33089304,  -4515.21727,  -31.79892 },
15288            {  76.67992019, -10008.48154,  -51.32614 },
15289            { 174.87317577,  -8679.27034,   15.34191 },
15290            {  49.55809321, -10620.90088, -230.57416 },
15291            { 100.46440702,   6362.03561,  326.52178 },
15292            { 113.66550252,  -9240.19942,  -66.23743 },
15293            {  74.00595701,   2669.15033,  145.93964 },
15294            { 131.78405702,   -221.94322,   -0.78728 }
15295        };
15296 
15297     /* Tables for trigonometric terms to be added to the mean elements of */
15298     /* the semi-major axes */
15299 
15300        final double kp[][] = {
15301         {   69613, 75645, 88306, 59899, 15746, 71087, 142173,  3086,    0 },
15302         {   21863, 32794, 26934, 10931, 26250, 43725,  53867, 28939,    0 },
15303         {   16002, 21863, 32004, 10931, 14529, 16368,  15318, 32794,    0 },
15304         {    6345,  7818, 15636,  7077,  8184, 14163,   1107,  4872,    0 },
15305         {    1760,  1454,  1167,   880,   287,  2640,     19,  2047, 1454 },
15306         {     574,     0,   880,   287,    19,  1760,   1167,   306,  574 },
15307         {     204,     0,   177,  1265,     4,   385,    200,   208,  204 },
15308         {       0,   102,   106,     4,    98,  1367,    487,   204,    0 }
15309        };
15310 
15311        final double ca[][] = {
15312         {       4,    -13,    11,   -9,    -9,   -3,     -1,     4,     0 },
15313         {    -156,     59,   -42,    6,    19,  -20,    -10,   -12,     0 },
15314         {      64,   -152,    62,   -8,    32,  -41,     19,   -11,     0 },
15315         {     124,    621,  -145,  208,    54,  -57,     30,    15,     0 },
15316         {  -23437,  -2634,  6601, 6259, -1507,-1821,   2620, -2115, -1489 },
15317         {   62911,-119919, 79336,17814,-24241,12068,   8306, -4893,  8902 },
15318         {  389061,-262125,-44088, 8387,-22976,-2093,   -615, -9720,  6633 },
15319         { -412235,-157046,-31430,37817, -9740,  -13,  -7449,  9644,     0 }
15320        };
15321 
15322        final double sa[][] = {
15323         {     -29,    -1,     9,     6,    -6,     5,     4,     0,     0 },
15324         {     -48,  -125,   -26,   -37,    18,   -13,   -20,    -2,     0 },
15325         {    -150,   -46,    68,    54,    14,    24,   -28,    22,     0 },
15326         {    -621,   532,  -694,   -20,   192,   -94,    71,   -73,     0 },
15327         {  -14614,-19828, -5869,  1881, -4372, -2255,   782,   930,   913 },
15328         {  139737,     0, 24667, 51123, -5102,  7429, -4095, -1976, -9566 },
15329         { -138081,     0, 37205,-49039,-41901,-33872,-27037,-12474, 18797 },
15330         {       0, 28492,133236, 69654, 52322,-49577,-26430, -3593,     0 }
15331        };
15332 
15333     /* Tables giving the trigonometric terms to be added to the mean */
15334     /* elements of the mean longitudes */
15335 
15336        final double kq[][] = {
15337         {   3086,15746,69613,59899,75645,88306, 12661,  2658,    0,     0 },
15338         {  21863,32794,10931,   73, 4387,26934,  1473,  2157,    0,     0 },
15339         {     10,16002,21863,10931, 1473,32004,  4387,    73,    0,     0 },
15340         {     10, 6345, 7818, 1107,15636, 7077,  8184,   532,   10,     0 },
15341         {     19, 1760, 1454,  287, 1167,  880,   574,  2640,   19,  1454 },
15342         {     19,  574,  287,  306, 1760,   12,    31,    38,   19,   574 },
15343         {      4,  204,  177,    8,   31,  200,  1265,   102,    4,   204 },
15344         {      4,  102,  106,    8,   98, 1367,   487,   204,    4,   102 }
15345        };
15346 
15347        final double cl[][] = {
15348         {      21,   -95, -157,   41,   -5,   42,  23,  30,      0,     0 },
15349         {    -160,  -313, -235,   60,  -74,  -76, -27,  34,      0,     0 },
15350         {    -325,  -322,  -79,  232,  -52,   97,  55, -41,      0,     0 },
15351         {    2268,  -979,  802,  602, -668,  -33, 345, 201,    -55,     0 },
15352         {    7610, -4997,-7689,-5841,-2617, 1115,-748,-607,   6074,   354 },
15353         {  -18549, 30125,20012, -730,  824,   23,1289,-352, -14767, -2062 },
15354         { -135245,-14594, 4197,-4030,-5630,-2898,2540,-306,   2939,  1986 },
15355         {   89948,  2103, 8963, 2695, 3682, 1648, 866,-154,  -1963,  -283 }
15356        };
15357 
15358        final double sl[][] = {
15359         {   -342,   136,  -23,   62,   66,  -52, -33,    17,     0,     0 },
15360         {    524,  -149,  -35,  117,  151,  122, -71,   -62,     0,     0 },
15361         {   -105,  -137,  258,   35, -116,  -88,-112,   -80,     0,     0 },
15362         {    854,  -205, -936, -240,  140, -341, -97,  -232,   536,     0 },
15363         { -56980,  8016, 1012, 1448,-3024,-3710, 318,   503,  3767,   577 },
15364         { 138606,-13478,-4964, 1441,-1319,-1482, 427,  1236, -9167, -1918 },
15365         {  71234,-41116, 5334,-4935,-1848,   66, 434, -1748,  3780,  -701 },
15366         { -47645, 11647, 2166, 3194,  679,    0,-244,  -419, -2531,    48 }
15367        };
15368 
15369     /*--------------------------------------------------------------------*/
15370 
15371     /* Validate the planet number. */
15372        if ((np < 1) || (np > 8)) {
15373           throw new JSOFAIllegalParameter("planet number out of range", -1);
15374 
15375        } else {
15376 
15377        /* Decrement the planet number to start at zero. */
15378           np--;
15379 
15380        /* Time: Julian millennia since J2000.0. */
15381           t = ((date1 - DJ00) + date2) / DJM;
15382 
15383        /* OK status unless remote date. */
15384           jstat = abs(t) <= 1.0 ? 0 : 1;
15385        // do not signal as error..   if(jstat != 0) throw new JSOFAIllegalParameter("Date too remote", jstat);
15386 
15387        /* Compute the mean elements. */
15388           da = a[np][0] +
15389               (a[np][1] +
15390                a[np][2] * t) * t;
15391           dl = (3600.0 * dlm[np][0] +
15392                         (dlm[np][1] +
15393                          dlm[np][2] * t) * t) * DAS2R;
15394           de = e[np][0] +
15395              ( e[np][1] +
15396                e[np][2] * t) * t;
15397           dp = jauAnpm((3600.0 * pi[np][0] +
15398                                 (pi[np][1] +
15399                                  pi[np][2] * t) * t) * DAS2R);
15400           di = (3600.0 * dinc[np][0] +
15401                         (dinc[np][1] +
15402                          dinc[np][2] * t) * t) * DAS2R;
15403           dom = jauAnpm((3600.0 * omega[np][0] +
15404                                  (omega[np][1] +
15405                                   omega[np][2] * t) * t) * DAS2R);
15406 
15407        /* Apply the trigonometric terms. */
15408           dmu = 0.35953620 * t;
15409           for (k = 0; k < 8; k++) {
15410              arga = kp[np][k] * dmu;
15411              argl = kq[np][k] * dmu;
15412              da += (ca[np][k] * cos(arga) +
15413                     sa[np][k] * sin(arga)) * 1e-7;
15414              dl += (cl[np][k] * cos(argl) +
15415                     sl[np][k] * sin(argl)) * 1e-7;
15416           }
15417           arga = kp[np][8] * dmu;
15418           da += t * (ca[np][8] * cos(arga) +
15419                      sa[np][8] * sin(arga)) * 1e-7;
15420           for (k = 8; k < 10; k++) {
15421              argl = kq[np][k] * dmu;
15422              dl += t * (cl[np][k] * cos(argl) +
15423                         sl[np][k] * sin(argl)) * 1e-7;
15424           }
15425           dl = fmod(dl, D2PI);
15426 
15427        /* Iterative soln. of Kepler's equation to get eccentric anomaly. */
15428           am = dl - dp;
15429           ae = am + de * sin(am);
15430           k = 0;
15431           dae = 1.0;
15432           while (k < KMAX && abs(dae) > 1e-12) {
15433              dae = (am - ae + de * sin(ae)) / (1.0 - de * cos(ae));
15434              ae += dae;
15435              k++;
15436              if (k == KMAX-1) jstat = 2;
15437           }
15438 
15439        /* True anomaly. */
15440           ae2 = ae / 2.0;
15441           at = 2.0 * atan2(sqrt((1.0 + de) / (1.0 - de)) * sin(ae2),
15442                                                            cos(ae2));
15443 
15444        /* Distance (au) and speed (radians per day). */
15445           r = da * (1.0 - de * cos(ae));
15446           v = GK * sqrt((1.0 + 1.0 / amas[np]) / (da * da * da));
15447 
15448           si2 = sin(di / 2.0);
15449           xq = si2 * cos(dom);
15450           xp = si2 * sin(dom);
15451           tl = at + dp;
15452           xsw = sin(tl);
15453           xcw = cos(tl);
15454           xm2 = 2.0 * (xp * xcw - xq * xsw);
15455           xf = da / sqrt(1  -  de * de);
15456           ci2 = cos(di / 2.0);
15457           xms = (de * sin(dp) + xsw) * xf;
15458           xmc = (de * cos(dp) + xcw) * xf;
15459           xpxq2 = 2 * xp * xq;
15460 
15461        /* Position (J2000.0 ecliptic x,y,z in au). */
15462           x = r * (xcw - xm2 * xp);
15463           y = r * (xsw + xm2 * xq);
15464           z = r * (-xm2 * ci2);
15465 
15466        /* Rotate to equatorial. */
15467           pv[0][0] = x;
15468           pv[0][1] = y * COSEPS - z * SINEPS;
15469           pv[0][2] = y * SINEPS + z * COSEPS;
15470 
15471        /* Velocity (J2000.0 ecliptic xdot,ydot,zdot in au/d). */
15472           x = v * (( -1.0 + 2.0 * xp * xp) * xms + xpxq2 * xmc);
15473           y = v * ((  1.0 - 2.0 * xq * xq) * xmc - xpxq2 * xms);
15474           z = v * (2.0 * ci2 * (xp * xms + xq * xmc));
15475 
15476        /* Rotate to equatorial. */
15477           pv[1][0] = x;
15478           pv[1][1] = y * COSEPS - z * SINEPS;
15479           pv[1][2] = y * SINEPS + z * COSEPS;
15480 
15481        }
15482 
15483     /* Return the value. */
15484        return pv;
15485 
15486         }
15487     
15488 
15489     /**
15490     *  Modulus of p-vector.
15491     *
15492     *<p>This function is derived from the International Astronomical Union's
15493     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15494     *
15495     *<p>Status:  vector/matrix support function.
15496     *
15497     *<!-- Given: -->
15498     *     @param p       double[3]      p-vector
15499     *
15500     * <!-- Returned (function value): -->
15501     *  @return double        modulus
15502     *
15503     *@version 2008 May 22
15504     *
15505     *  @since Release 20101201
15506     *
15507     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15508     */
15509     public static double jauPm(double p[] )
15510     {
15511        double w;
15512 
15513 
15514        w  = sqrt( p[0] * p[0]
15515                 + p[1] * p[1]
15516                 + p[2] * p[2] );
15517 
15518        return w;
15519 
15520         }
15521     
15522 
15523     /**
15524     *  Precession matrix (including frame bias) from GCRS to a specified
15525     *  date, IAU 2000 model.
15526     *
15527     *<p>This function is derived from the International Astronomical Union's
15528     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15529     *
15530     *<p>Status:  support function.
15531     *
15532     *<!-- Given: -->
15533     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15534     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15535     *
15536     *<!-- Returned: -->
15537     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15538     *
15539     * <p>Notes:
15540     * <ol>
15541     *
15542     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15543     *     convenient way between the two arguments.  For example,
15544     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15545     *     among others:
15546     *<pre>
15547     *            date1          date2
15548     *
15549     *         2450123.7           0.0       (JD method)
15550     *         2451545.0       -1421.3       (J2000 method)
15551     *         2400000.5       50123.2       (MJD method)
15552     *         2450123.5           0.2       (date &amp; time method)
15553     *</pre>
15554     *     The JD method is the most natural and convenient to use in
15555     *     cases where the loss of several decimal digits of resolution
15556     *     is acceptable.  The J2000 method is best matched to the way
15557     *     the argument is handled internally and will deliver the
15558     *     optimum resolution.  The MJD method and the date &amp; time methods
15559     *     are both good compromises between resolution and convenience.
15560     *
15561     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15562     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15563     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15564     *     respect to the mean equatorial triad of the given date.
15565     *</ol>
15566     *<p>Called:<ul>
15567     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15568     * </ul>
15569     *<p>Reference:
15570     *
15571     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
15572     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
15573     *     (2000)
15574     *
15575     *@version 2009 December 21
15576     *
15577     *  @since Release 20101201
15578     *
15579     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15580     */
15581     public static double[][] jauPmat00(double date1, double date2)
15582     {
15583        double rb[][] = new double[3][3], rp[][] = new double[3][3],
15584            rbp[][] = new double[3][3];
15585     /* Obtain the required matrix (discarding others). */
15586        jauBp00(date1, date2, rb, rp, rbp);
15587 
15588        return rbp;
15589 
15590         }
15591     
15592 
15593     /**
15594     *  Precession matrix (including frame bias) from GCRS to a specified
15595     *  date, IAU 2006 model.
15596     *
15597     *<p>This function is derived from the International Astronomical Union's
15598     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15599     *
15600     *<p>Status:  support function.
15601     *
15602     *<!-- Given: -->
15603     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15604     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15605     *
15606     *<!-- Returned: -->
15607     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15608     *
15609     * <p>Notes:
15610     * <ol>
15611     *
15612     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15613     *     convenient way between the two arguments.  For example,
15614     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15615     *     among others:
15616     *<pre>
15617     *            date1          date2
15618     *
15619     *         2450123.7           0.0       (JD method)
15620     *         2451545.0       -1421.3       (J2000 method)
15621     *         2400000.5       50123.2       (MJD method)
15622     *         2450123.5           0.2       (date &amp; time method)
15623     *</pre>
15624     *     The JD method is the most natural and convenient to use in
15625     *     cases where the loss of several decimal digits of resolution
15626     *     is acceptable.  The J2000 method is best matched to the way
15627     *     the argument is handled internally and will deliver the
15628     *     optimum resolution.  The MJD method and the date &amp; time methods
15629     *     are both good compromises between resolution and convenience.
15630     *
15631     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15632     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15633     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15634     *     respect to the mean equatorial triad of the given date.
15635     *</ol>
15636     *<p>Called:<ul>
15637     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
15638     *     <li>{@link #jauFw2m} F-W angles to r-matrix
15639     * </ul>
15640     *<p>References:
15641     *
15642     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
15643     *
15644     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
15645     *    
15646     *    <p>IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc. 24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.(2000)
15647     *
15648     *@version 2009 December 21
15649     *
15650     *  @since Release 20101201
15651     *
15652     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15653     */
15654     public static double[][] jauPmat06(double date1, double date2)
15655     {
15656 
15657     /* Bias-precession Fukushima-Williams angles. */
15658        FWPrecessionAngles fw = jauPfw06(date1, date2);
15659 
15660     /* Form the matrix. */
15661        double[][] rbp = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
15662 
15663        return rbp;
15664 
15665         }
15666     
15667 
15668     /**
15669     *  Precession matrix from J2000.0 to a specified date, IAU 1976 model.
15670     *
15671     *<p>This function is derived from the International Astronomical Union's
15672     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15673     *
15674     *<p>Status:  support function.
15675     *
15676     *<!-- Given: -->
15677     *     @param date1 double        ending date, TT (Note 1)
15678     *     @param date2 double        ending date, TT (Note 1) 
15679     *
15680     *<!-- Returned: -->
15681     *     @return rmatp        double[3][3]   <u>returned</u> precession matrix, J2000.0 -&gt; date1+date2
15682     *
15683     * <p>Notes:
15684     * <ol>
15685     *
15686     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15687     *     convenient way between the two arguments.  For example,
15688     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15689     *     among others:
15690     *<pre>
15691     *            date1          date2
15692     *
15693     *         2450123.7           0.0       (JD method)
15694     *         2451545.0       -1421.3       (J2000 method)
15695     *         2400000.5       50123.2       (MJD method)
15696     *         2450123.5           0.2       (date &amp; time method)
15697     *</pre>
15698     *     The JD method is the most natural and convenient to use in
15699     *     cases where the loss of several decimal digits of resolution
15700     *     is acceptable.  The J2000 method is best matched to the way
15701     *     the argument is handled internally and will deliver the
15702     *     optimum resolution.  The MJD method and the date &amp; time methods
15703     *     are both good compromises between resolution and convenience.
15704     *
15705     * <li> The matrix operates in the sense V(date) = RMATP * V(J2000),
15706     *     where the p-vector V(J2000) is with respect to the mean
15707     *     equatorial triad of epoch J2000.0 and the p-vector V(date)
15708     *     is with respect to the mean equatorial triad of the given
15709     *     date.
15710     *
15711     * <li> Though the matrix method itself is rigorous, the precession
15712     *     angles are expressed through canonical polynomials which are
15713     *     valid only for a limited time span.  In addition, the IAU 1976
15714     *     precession rate is known to be imperfect.  The absolute accuracy
15715     *     of the present formulation is better than 0.1 arcsec from
15716     *     1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD,
15717     *     and remains below 3 arcsec for the whole of the period
15718     *     500BC to 3000AD.  The errors exceed 10 arcsec outside the
15719     *     range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to
15720     *     5600AD and exceed 1000 arcsec outside 6800BC to 8200AD.
15721     *</ol>
15722     *<p>Called:<ul>
15723     *     <li>{@link #jauPrec76} accumulated precession angles, IAU 1976
15724     *     <li>{@link #jauIr} initialize r-matrix to identity
15725     *     <li>{@link #jauRz} rotate around Z-axis
15726     *     <li>{@link #jauRy} rotate around Y-axis
15727     *     <li>{@link #jauCr} copy r-matrix
15728     * </ul>
15729     *<p>References:
15730     *
15731     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
15732     *      equations (6) &amp; (7), p283.
15733     *
15734     *     Kaplan,G.H., 1981. USNO circular no. 163, pA2.
15735     *
15736     *@version 2009 December 18
15737     *
15738     *  @since Release 20101201
15739     *
15740     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15741     */
15742     public static double[][] jauPmat76(double date1, double date2)
15743     {
15744        double wmat[][] = new double[3][3];
15745        double rmatp[][] = new double[3][3];
15746 
15747     /* Precession Euler angles, J2000.0 to specified date. */
15748        EulerAngles euler = jauPrec76(DJ00, 0.0, date1, date2);
15749 
15750     /* Form the rotation matrix. */
15751        jauIr(  wmat);
15752        jauRz( -euler.zeta, wmat);
15753        jauRy(  euler.theta, wmat);
15754        jauRz( -euler.z, wmat);
15755        jauCr(wmat, rmatp);
15756 
15757        return rmatp;
15758 
15759         }
15760     
15761 
15762     /**
15763     *  P-vector subtraction.
15764     *
15765     *<p>This function is derived from the International Astronomical Union's
15766     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15767     *
15768     *<p>Status:  vector/matrix support function.
15769     *
15770     *<!-- Given: -->
15771     *     @param a         double[3]       first p-vector
15772     *     @param b         double[3]       second p-vector
15773     *
15774     *<!-- Returned: -->
15775     *     @return amb       double[3]        <u>returned</u> a - b
15776     *
15777     *  Note:
15778     *     It is permissible to re-use the same array for any of the
15779     *     arguments.
15780     *
15781     *@version 2008 November 18
15782     *
15783     *  @since Release 20101201
15784     *
15785     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15786     */
15787     public static double[]  jauPmp(double a[] , double b[]  )
15788     {
15789        double amb[] = new double[3];
15790        amb[0] = a[0] - b[0];
15791        amb[1] = a[1] - b[1];
15792        amb[2] = a[2] - b[2];
15793 
15794        return amb;
15795 
15796         }
15797     
15798     /**
15799      * A normalized vector with r being the modulus and u[3] being the unit vector.
15800      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
15801      * 
15802      * @since AIDA Stage 1
15803      */
15804     public static class NormalizedVector {
15805         public double r;
15806         public double u[];
15807         public NormalizedVector(double r, double u[] ) {
15808             this.r = r;
15809             this.u = u;
15810         }
15811     }
15812     /**
15813     *  Convert a p-vector into modulus and unit vector.
15814     *
15815     *<p>This function is derived from the International Astronomical Union's
15816     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15817     *
15818     *<p>Status:  vector/matrix support function.
15819     *
15820     *<!-- Given: -->
15821     *     @param p         double[3]       p-vector
15822     *
15823     *<!-- Returned: -->
15824     *     @return r         double           <u>returned</u> modulus
15825     *             u         double[3]        <u>returned</u> unit vector
15826     *
15827     * <p>Notes:
15828     * <ol>
15829     *
15830     * <li> If p is null, the result is null.  Otherwise the result is a unit
15831     *     vector.
15832     *
15833     * <li> It is permissible to re-use the same array for any of the
15834     *     arguments.
15835     *</ol>
15836     *<p>Called:<ul>
15837     *     <li>{@link #jauPm} modulus of p-vector
15838     *     <li>{@link #jauZp} zero p-vector
15839     *     <li>{@link #jauSxp} multiply p-vector by scalar
15840     * </ul>
15841     *@version 2008 November 18
15842     *
15843     *  @since Release 20101201
15844     *
15845     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15846     */
15847     public static NormalizedVector jauPn(double p[])
15848     {
15849        double w;
15850 
15851     /* Obtain the modulus and test for zero. */
15852        w = jauPm(p);
15853        NormalizedVector nv = new NormalizedVector(w, new double[3]);
15854        if (w == 0.0) {
15855 
15856        /* Null vector. */
15857           jauZp(nv.u);
15858 
15859        } else {
15860 
15861        /* Unit vector. */
15862            nv.u = jauSxp(1.0/w, p);
15863        }
15864 
15865 
15866        return nv;
15867 
15868         }
15869     
15870 
15871     /**
15872     *  Precession-nutation, IAU 2000 model:  a multi-purpose function,
15873     *  supporting classical (equinox-based) use directly and CIO-based
15874     *  use indirectly.
15875     *
15876     *<p>This function is derived from the International Astronomical Union's
15877     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15878     *
15879     *<p>Status:  support function.
15880     *
15881     *<!-- Given: -->
15882     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15883     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15884     *     @param dpsi double           nutation (Note 2)
15885     *     @param deps double           nutation (Note 2) 
15886     *
15887     *<!-- Returned: -->
15888     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3),
15889     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4),
15890     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5),
15891     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6),
15892     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7),
15893     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8)
15894     *
15895     * <p>Notes:
15896     * <ol>
15897     *
15898     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15899     *     convenient way between the two arguments.  For example,
15900     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15901     *     among others:
15902     *<pre>
15903     *            date1          date2
15904     *
15905     *         2450123.7           0.0       (JD method)
15906     *         2451545.0       -1421.3       (J2000 method)
15907     *         2400000.5       50123.2       (MJD method)
15908     *         2450123.5           0.2       (date &amp; time method)
15909     *</pre>
15910     *     The JD method is the most natural and convenient to use in
15911     *     cases where the loss of several decimal digits of resolution
15912     *     is acceptable.  The J2000 method is best matched to the way
15913     *     the argument is handled internally and will deliver the
15914     *     optimum resolution.  The MJD method and the date &amp; time methods
15915     *     are both good compromises between resolution and convenience.
15916     *
15917     * <li> The caller is responsible for providing the nutation components;
15918     *     they are in longitude and obliquity, in radians and are with
15919     *     respect to the equinox and ecliptic of date.  For high-accuracy
15920     *     applications, free core nutation should be included as well as
15921     *     any other relevant corrections to the position of the CIP.
15922     *
15923     * <li> The returned mean obliquity is consistent with the IAU 2000
15924     *     precession-nutation models.
15925     *
15926     * <li> The matrix rb transforms vectors from GCRS to J2000.0 mean
15927     *     equator and equinox by applying frame bias.
15928     *
15929     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
15930     *     equinox to mean equator and equinox of date by applying
15931     *     precession.
15932     *
15933     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
15934     *     equinox of date by applying frame bias then precession.  It is
15935     *     the product rp x rb.
15936     *
15937     * <li> The matrix rn transforms vectors from mean equator and equinox of
15938     *     date to true equator and equinox of date by applying the nutation
15939     *     (luni-solar + planetary).
15940     *
15941     * <li> The matrix rbpn transforms vectors from GCRS to true equator and
15942     *     equinox of date.  It is the product rn x rbp, applying frame
15943     *     bias, precession and nutation in that order.
15944     *
15945     * <li> It is permissible to re-use the same array in the returned
15946     *     arguments.  The arrays are filled in the stated order.
15947     *</ol>
15948     *<p>Called:<ul>
15949     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
15950     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
15951     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15952     *     <li>{@link #jauCr} copy r-matrix
15953     *     <li>{@link #jauNumat} form nutation matrix
15954     *     <li>{@link #jauRxr} product of two r-matrices
15955     * </ul>
15956     *<p>Reference:
15957     *
15958     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
15959     *     "Expressions for the Celestial Intermediate Pole and Celestial
15960     *     Ephemeris Origin consistent with the IAU 2000A precession-
15961     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
15962     *
15963     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
15964     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
15965     *
15966     *@version 2010 January 18
15967     *
15968     *  @since Release 20101201
15969     *
15970     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15971     */
15972     public static PrecessionNutation  jauPn00(double date1, double date2, double dpsi, double deps)
15973     {
15974        double  rbpw[][] = new double[3][3], rnw[][] = new double[3][3];
15975        double[][] rb = new double[3][3];
15976        double[][] rp = new double[3][3];
15977        double[][] rbp = new double[3][3];
15978        double[][] rn = new double[3][3];
15979        double[][] rbpn = new double[3][3];
15980 
15981 
15982     /* IAU 2000 precession-rate adjustments. */
15983        PrecessionDeltaTerms nut = jauPr00(date1, date2);
15984 
15985     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
15986        double epsa = jauObl80(date1, date2) + nut.depspr;
15987 
15988     /* Frame bias and precession matrices and their product. */
15989        jauBp00(date1, date2, rb, rp, rbpw);
15990        jauCr(rbpw, rbp);
15991 
15992     /* Nutation matrix. */
15993        rnw = jauNumat(epsa, dpsi, deps);
15994        jauCr(rnw, rn);
15995 
15996     /* Bias-precession-nutation matrix (classical). */
15997        rbpn = jauRxr(rnw, rbpw);
15998 
15999        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
16000 
16001         }
16002     
16003 
16004     /**
16005      * Precession-nutation model. 
16006      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16007      * 
16008      * @since AIDA Stage 1
16009      */
16010     public static class PrecessionNutation {
16011         public NutationTerms nut;
16012         /** mean obliquity */
16013         public  double epsa;
16014         /** frame bias matrix */
16015         public double rb[][];
16016         /** precession matrix  */
16017         public  double rp[][];
16018         /** bias-precession matrix */
16019         public  double rbp[][];
16020         /** nutation matrix  */
16021         public double rn[][];
16022         /** GCRS-to-true matrix */
16023         public double rbpn[][];
16024         public PrecessionNutation(double dpsi, double deps, double epsa,
16025                   double rb[][], double rp[][], double rbp[][],
16026                   double rn[][], double rbpn[][]){
16027             this.nut = new NutationTerms(dpsi, deps);
16028             this.epsa = epsa;
16029             this.rb = rb; 
16030             this.rp = rp;
16031             this.rbp = rbp;
16032             this.rn = rn;
16033             this.rbpn = rbpn;
16034         }
16035         
16036     }
16037     /**
16038     *  Precession-nutation, IAU 2000A model:  a multi-purpose function,
16039     *  supporting classical (equinox-based) use directly and CIO-based
16040     *  use indirectly.
16041     *
16042     *<p>This function is derived from the International Astronomical Union's
16043     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16044     *
16045     *<p>Status:  support function.
16046     *
16047     *<!-- Given: -->
16048     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16049     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16050     *
16051     *<!-- Returned: -->
16052     *     @return dpsi double            <u>returned</u> nutation (Note 2)
16053     *             deps double            <u>returned</u> nutation (Note 2) 
16054     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
16055     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16056     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16057     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16058     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16059     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16060     *
16061     * <p>Notes:
16062     * <ol>
16063     *
16064     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16065     *      convenient way between the two arguments.  For example,
16066     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16067     *      among others:
16068     *<pre>
16069     *             date1          date2
16070     *
16071     *          2450123.7           0.0       (JD method)
16072     *          2451545.0       -1421.3       (J2000 method)
16073     *          2400000.5       50123.2       (MJD method)
16074     *          2450123.5           0.2       (date &amp; time method)
16075     *</pre>
16076     *      The JD method is the most natural and convenient to use in
16077     *      cases where the loss of several decimal digits of resolution
16078     *      is acceptable.  The J2000 method is best matched to the way
16079     *      the argument is handled internally and will deliver the
16080     *      optimum resolution.  The MJD method and the date &amp; time methods
16081     *      are both good compromises between resolution and convenience.
16082     *
16083     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
16084     *      longitude and obliquity are in radians and with respect to the
16085     *      equinox and ecliptic of date.  Free core nutation is omitted;
16086     *      for the utmost accuracy, use the jauPn00  function, where the
16087     *      nutation components are caller-specified.  For faster but
16088     *      slightly less accurate results, use the jauPn00b function.
16089     *
16090     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
16091     *
16092     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16093     *      equator and equinox by applying frame bias.
16094     *
16095     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16096     *      equinox to mean equator and equinox of date by applying
16097     *      precession.
16098     *
16099     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16100     *      equinox of date by applying frame bias then precession.  It is
16101     *      the product rp x rb.
16102     *
16103     * <li>  The matrix rn transforms vectors from mean equator and equinox
16104     *      of date to true equator and equinox of date by applying the
16105     *      nutation (luni-solar + planetary).
16106     *
16107     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16108     *      equinox of date.  It is the product rn x rbp, applying frame
16109     *      bias, precession and nutation in that order.
16110     *
16111     * <li>  The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate
16112     *      Pole are elements (3,1-3) of the GCRS-to-true matrix,
16113     *       i.e. rbpn[2][0-2].
16114     *
16115     *  <li> It is permissible to re-use the same array in the returned
16116     *      arguments.  The arrays are filled in the order given.
16117     *</ol>
16118     *<p>Called:<ul>
16119     *     <li>{@link #jauNut00a} nutation, IAU 2000A
16120     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16121     * </ul>
16122     *<p>Reference:
16123     *
16124     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16125     *     "Expressions for the Celestial Intermediate Pole and Celestial
16126     *     Ephemeris Origin consistent with the IAU 2000A precession-
16127     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
16128     *
16129     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16130     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16131     *
16132     *@version 2010 January 18
16133     *
16134     *  @since Release 20101201
16135     *
16136     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16137     */
16138     public static PrecessionNutation jauPn00a(double date1, double date2)
16139     {
16140     /* Nutation. */
16141        NutationTerms nut = jauNut00a(date1, date2);
16142 
16143     /* Remaining results. */
16144        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16145 
16146  
16147         }
16148     
16149 
16150     /**
16151     *  Precession-nutation, IAU 2000B model:  a multi-purpose function,
16152     *  supporting classical (equinox-based) use directly and CIO-based
16153     *  use indirectly.
16154     *
16155     *<p>This function is derived from the International Astronomical Union's
16156     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16157     *
16158     *<p>Status:  support function.
16159     *
16160     *<!-- Given: -->
16161     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16162     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16163     *
16164     *<!-- Returned: -->
16165     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16166     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
16167     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16168     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16169     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16170     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16171     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16172     *
16173     * <p>Notes:
16174     * <ol>
16175     *
16176     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16177     *      convenient way between the two arguments.  For example,
16178     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16179     *      among others:
16180     *<pre>
16181     *             date1          date2
16182     *
16183     *          2450123.7           0.0       (JD method)
16184     *          2451545.0       -1421.3       (J2000 method)
16185     *          2400000.5       50123.2       (MJD method)
16186     *          2450123.5           0.2       (date &amp; time method)
16187     *</pre>
16188     *      The JD method is the most natural and convenient to use in
16189     *      cases where the loss of several decimal digits of resolution
16190     *      is acceptable.  The J2000 method is best matched to the way
16191     *      the argument is handled internally and will deliver the
16192     *      optimum resolution.  The MJD method and the date &amp; time methods
16193     *      are both good compromises between resolution and convenience.
16194     *
16195     * <li>  The nutation components (luni-solar + planetary, IAU 2000B) in
16196     *      longitude and obliquity are in radians and with respect to the
16197     *      equinox and ecliptic of date.  For more accurate results, but
16198     *      at the cost of increased computation, use the jauPn00a function.
16199     *      For the utmost accuracy, use the jauPn00  function, where the
16200     *      nutation components are caller-specified.
16201     *
16202     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
16203     *
16204     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16205     *      equator and equinox by applying frame bias.
16206     *
16207     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16208     *      equinox to mean equator and equinox of date by applying
16209     *      precession.
16210     *
16211     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16212     *      equinox of date by applying frame bias then precession.  It is
16213     *      the product rp x rb.
16214     *
16215     * <li>  The matrix rn transforms vectors from mean equator and equinox
16216     *      of date to true equator and equinox of date by applying the
16217     *      nutation (luni-solar + planetary).
16218     *
16219     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16220     *      equinox of date.  It is the product rn x rbp, applying frame
16221     *      bias, precession and nutation in that order.
16222     *
16223     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16224     *      Pole are elements (3,1-3) of the matrix rbpn.
16225     *
16226     * <li> It is permissible to re-use the same array in the returned
16227     *      arguments.  The arrays are filled in the stated order.
16228     *</ol>
16229     *<p>Called:<ul>
16230     *     <li>{@link #jauNut00b} nutation, IAU 2000B
16231     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16232     * </ul>
16233     *<p>Reference:
16234     *
16235     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16236     *     "Expressions for the Celestial Intermediate Pole and Celestial
16237     *     Ephemeris Origin consistent with the IAU 2000A precession-
16238     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003).
16239     *
16240     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16241     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16242     *
16243     *@version 2010 January 18
16244     *
16245     *  @since Release 20101201
16246     *
16247     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16248     */
16249     public static PrecessionNutation jauPn00b(double date1, double date2)
16250     {
16251     /* Nutation. */
16252        NutationTerms nut = jauNut00b(date1, date2);
16253 
16254     /* Remaining results. */
16255        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16256 
16257 
16258         }
16259     
16260 
16261     /**
16262     *  Precession-nutation, IAU 2006 model:  a multi-purpose function,
16263     *  supporting classical (equinox-based) use directly and CIO-based use
16264     *  indirectly.
16265     *
16266     *<p>This function is derived from the International Astronomical Union's
16267     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16268     *
16269     *<p>Status:  support function.
16270     *
16271     *<!-- Given: -->
16272     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16273     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16274     *     @param dpsi double           nutation (Note 2)
16275     *     @param deps double           nutation (Note 2) 
16276     *
16277     *<!-- Returned: -->
16278     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3)
16279     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16280     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16281     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16282     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16283     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8,9)
16284     *
16285     * <p>Notes:
16286     * <ol>
16287     *
16288     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16289     *      convenient way between the two arguments.  For example,
16290     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16291     *      among others:
16292     *<pre>
16293     *             date1          date2
16294     *
16295     *          2450123.7           0.0       (JD method)
16296     *          2451545.0       -1421.3       (J2000 method)
16297     *          2400000.5       50123.2       (MJD method)
16298     *          2450123.5           0.2       (date &amp; time method)
16299     *</pre>
16300     *      The JD method is the most natural and convenient to use in
16301     *      cases where the loss of several decimal digits of resolution
16302     *      is acceptable.  The J2000 method is best matched to the way
16303     *      the argument is handled internally and will deliver the
16304     *      optimum resolution.  The MJD method and the date &amp; time methods
16305     *      are both good compromises between resolution and convenience.
16306     *
16307     * <li>  The caller is responsible for providing the nutation components;
16308     *      they are in longitude and obliquity, in radians and are with
16309     *      respect to the equinox and ecliptic of date.  For high-accuracy
16310     *      applications, free core nutation should be included as well as
16311     *      any other relevant corrections to the position of the CIP.
16312     *
16313     * <li>  The returned mean obliquity is consistent with the IAU 2006
16314     *      precession.
16315     *
16316     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16317     *      equator and equinox by applying frame bias.
16318     *
16319     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16320     *      equinox to mean equator and equinox of date by applying
16321     *      precession.
16322     *
16323     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16324     *      equinox of date by applying frame bias then precession.  It is
16325     *      the product rp x rb.
16326     *
16327     * <li>  The matrix rn transforms vectors from mean equator and equinox
16328     *      of date to true equator and equinox of date by applying the
16329     *      nutation (luni-solar + planetary).
16330     *
16331     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16332     *      equinox of date.  It is the product rn x rbp, applying frame
16333     *      bias, precession and nutation in that order.
16334     *
16335     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16336     *      Pole are elements (3,1-3) of the matrix rbpn.
16337     *
16338     *  <li> It is permissible to re-use the same array in the returned
16339     *      arguments.  The arrays are filled in the stated order.
16340     *</ol>
16341     *<p>Called:<ul>
16342     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16343     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16344     *     <li>{@link #jauCr} copy r-matrix
16345     *     <li>{@link #jauTr} transpose r-matrix
16346     *     <li>{@link #jauRxr} product of two r-matrices
16347     * </ul>
16348     *<p>References:
16349     *
16350     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16351     *
16352     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
16353     *
16354     *@version 2009 December 17
16355     *
16356     *  @since Release 20101201
16357     *
16358     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16359     */
16360     public static PrecessionNutation jauPn06(double date1, double date2, double dpsi, double deps)
16361     {
16362 
16363         double rb[][] = new double[3][3], rbp[][] = new double[3][3], rbpn[][] = new double[3][3];
16364     /* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */
16365        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
16366 
16367     /* B matrix. */
16368        double[][] r1 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
16369        jauCr(r1, rb);
16370 
16371     /* Bias-precession Fukushima-Williams angles of date. */
16372        fw = jauPfw06(date1, date2);
16373 
16374     /* Bias-precession matrix. */
16375        double[][] r2 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
16376        jauCr(r2, rbp);
16377 
16378     /* Solve for precession matrix. */
16379        double[][] rt = jauTr(r1);
16380        double[][] rp = jauRxr(r2, rt);
16381 
16382     /* Equinox-based bias-precession-nutation matrix. */
16383        r1 = jauFw2m(fw.gamb, fw.phib, fw.psib + dpsi, fw.epsa + deps);
16384        jauCr(r1, rbpn);
16385 
16386     /* Solve for nutation matrix. */
16387        rt = jauTr(r2);
16388        double[][] rn = jauRxr(r1, rt);
16389 
16390     /* Obliquity, mean of date. */
16391        double epsa = fw.epsa;
16392 
16393        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
16394 
16395         }
16396     
16397 
16398     /**
16399     *  Precession-nutation, IAU 2006/2000A models:  a multi-purpose function,
16400     *  supporting classical (equinox-based) use directly and CIO-based use
16401     *  indirectly.
16402     *
16403     *<p>This function is derived from the International Astronomical Union's
16404     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16405     *
16406     *<p>Status:  support function.
16407     *
16408     *<!-- Given: -->
16409     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16410     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16411     *
16412     *<!-- Returned: -->
16413     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16414     *            epsa          double            <u>returned</u> mean obliquity (Note 3)
16415     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16416     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16417     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16418     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16419     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16420     *
16421     * <p>Notes:
16422     * <ol>
16423     *
16424     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16425     *      convenient way between the two arguments.  For example,
16426     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16427     *      among others:
16428     *<pre>
16429     *             date1          date2
16430     *
16431     *          2450123.7           0.0       (JD method)
16432     *          2451545.0       -1421.3       (J2000 method)
16433     *          2400000.5       50123.2       (MJD method)
16434     *          2450123.5           0.2       (date &amp; time method)
16435     *</pre>
16436     *      The JD method is the most natural and convenient to use in
16437     *      cases where the loss of several decimal digits of resolution
16438     *      is acceptable.  The J2000 method is best matched to the way
16439     *      the argument is handled internally and will deliver the
16440     *      optimum resolution.  The MJD method and the date &amp; time methods
16441     *      are both good compromises between resolution and convenience.
16442     *
16443     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
16444     *      longitude and obliquity are in radians and with respect to the
16445     *      equinox and ecliptic of date.  Free core nutation is omitted;
16446     *      for the utmost accuracy, use the jauPn06 function, where the
16447     *      nutation components are caller-specified.
16448     *
16449     * <li>  The mean obliquity is consistent with the IAU 2006 precession.
16450     *
16451     * <li>  The matrix rb transforms vectors from GCRS to mean J2000.0 by
16452     *      applying frame bias.
16453     *
16454     * <li>  The matrix rp transforms vectors from mean J2000.0 to mean of
16455     *      date by applying precession.
16456     *
16457     * <li>  The matrix rbp transforms vectors from GCRS to mean of date by
16458     *      applying frame bias then precession.  It is the product rp x rb.
16459     *
16460     * <li>  The matrix rn transforms vectors from mean of date to true of
16461     *      date by applying the nutation (luni-solar + planetary).
16462     *
16463     * <li>  The matrix rbpn transforms vectors from GCRS to true of date
16464     *      (CIP/equinox).  It is the product rn x rbp, applying frame bias,
16465     *      precession and nutation in that order.
16466     *
16467     * <li>  The X,Y,Z coordinates of the IAU 2006/2000A Celestial
16468     *      Intermediate Pole are elements (1,1-3) of the matrix rbpn.
16469     *
16470     *  <li> It is permissible to re-use the same array in the returned
16471     *      arguments.  The arrays are filled in the stated order.
16472     *</ol>
16473     *<p>Called:<ul>
16474     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16475     *     <li>{@link #jauPn06} bias/precession/nutation results, IAU 2006
16476     * </ul>
16477     *<p>Reference:
16478     *
16479     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16480     *
16481     *@version 2009 December 18
16482     *
16483     *  @since Release 20101201
16484     *
16485     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16486     */
16487     public static PrecessionNutation jauPn06a(double date1, double date2)
16488     {
16489     /* Nutation. */
16490        NutationTerms nut = jauNut06a(date1, date2);
16491 
16492     /* Remaining results. */
16493        return jauPn06(date1, date2, nut.dpsi, nut.deps);
16494 
16495         }
16496     
16497 
16498     /**
16499     *  Form the matrix of precession-nutation for a given date (including
16500     *  frame bias), equinox-based, IAU 2000A model.
16501     *
16502     *<p>This function is derived from the International Astronomical Union's
16503     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16504     *
16505     *<p>Status:  support function.
16506     *
16507     *<!-- Given: -->
16508     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16509     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16510     *
16511     *<!-- Returned: -->
16512     *     @return rbpn          double[3][3]      <u>returned</u> bias-precession-nutation matrix (Note 2)
16513     *
16514     * <p>Notes:
16515     * <ol>
16516     *
16517     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16518     *     convenient way between the two arguments.  For example,
16519     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16520     *     among others:
16521     *<pre>
16522     *            date1          date2
16523     *
16524     *         2450123.7           0.0       (JD method)
16525     *         2451545.0       -1421.3       (J2000 method)
16526     *         2400000.5       50123.2       (MJD method)
16527     *         2450123.5           0.2       (date &amp; time method)
16528     *</pre>
16529     *     The JD method is the most natural and convenient to use in
16530     *     cases where the loss of several decimal digits of resolution
16531     *     is acceptable.  The J2000 method is best matched to the way
16532     *     the argument is handled internally and will deliver the
16533     *     optimum resolution.  The MJD method and the date &amp; time methods
16534     *     are both good compromises between resolution and convenience.
16535     *
16536     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16537     *     the p-vector V(date) is with respect to the true equatorial triad
16538     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16539     *     the Geocentric Celestial Reference System (IAU, 2000).
16540     *
16541     * <li> A faster, but slightly less accurate, result (about 1 mas), can be
16542     *     obtained by using instead the jauPnm00b function.
16543     *</ol>
16544     *<p>Called:<ul>
16545     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
16546     * </ul>
16547     *<p>Reference:
16548     *
16549     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16550     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16551     *     (2000)
16552     *
16553     *@version 2009 December 21
16554     *
16555     *  @since Release 20101201
16556     *
16557     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16558     */
16559     public static double[][] jauPnm00a(double date1, double date2)
16560     {
16561 
16562     /* Obtain the required matrix (discarding other results). */
16563         PrecessionNutation pn = jauPn00a(date1, date2);
16564         return pn.rbpn;
16565 
16566     }
16567 
16568 
16569     /**
16570     *  Form the matrix of precession-nutation for a given date (including
16571     *  frame bias), equinox-based, IAU 2000B model.
16572     *
16573     *<p>This function is derived from the International Astronomical Union's
16574     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16575     *
16576     *<p>Status:  support function.
16577     *
16578     *<!-- Given: -->
16579     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16580     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16581     *
16582     *<!-- Returned: -->
16583     *     @return rbpn         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16584     *
16585     * <p>Notes:
16586     * <ol>
16587     *
16588     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16589     *     convenient way between the two arguments.  For example,
16590     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16591     *     among others:
16592     *<pre>
16593     *            date1          date2
16594     *
16595     *         2450123.7           0.0       (JD method)
16596     *         2451545.0       -1421.3       (J2000 method)
16597     *         2400000.5       50123.2       (MJD method)
16598     *         2450123.5           0.2       (date &amp; time method)
16599     *</pre>
16600     *     The JD method is the most natural and convenient to use in
16601     *     cases where the loss of several decimal digits of resolution
16602     *     is acceptable.  The J2000 method is best matched to the way
16603     *     the argument is handled internally and will deliver the
16604     *     optimum resolution.  The MJD method and the date &amp; time methods
16605     *     are both good compromises between resolution and convenience.
16606     *
16607     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16608     *     the p-vector V(date) is with respect to the true equatorial triad
16609     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16610     *     the Geocentric Celestial Reference System (IAU, 2000).
16611     *
16612     * <li> The present function is faster, but slightly less accurate (about
16613     *     1 mas), than the jauPnm00a function.
16614     *</ol>
16615     *<p>Called:<ul>
16616     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
16617     * </ul>
16618     *<p>Reference:
16619     *
16620     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16621     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16622     *     (2000)
16623     *
16624     *@version 2009 December 21
16625     *
16626     *  @since Release 20101201
16627     *
16628     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16629     */
16630     public static double[][] jauPnm00b(double date1, double date2)
16631     {
16632 
16633     /* Obtain the required matrix (discarding other results). */
16634        PrecessionNutation pn = jauPn00b(date1, date2);
16635 
16636        return pn.rbpn;
16637 
16638         }
16639     
16640 
16641     /**
16642     *  Form the matrix of precession-nutation for a given date (including
16643     *  frame bias), equinox based, IAU 2006 precession and IAU 2000A nutation models.
16644     *
16645     *<p>This function is derived from the International Astronomical Union's
16646     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16647     *
16648     *<p>Status:  support function.
16649     *
16650     *<!-- Given: -->
16651     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16652     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16653     *
16654     *<!-- Returned: -->
16655     *     @return rbpn         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16656     *
16657     * <p>Notes:
16658     * <ol>
16659     *
16660     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16661     *     convenient way between the two arguments.  For example,
16662     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16663     *     among others:
16664     *<pre>
16665     *            date1          date2
16666     *
16667     *         2450123.7           0.0       (JD method)
16668     *         2451545.0       -1421.3       (J2000 method)
16669     *         2400000.5       50123.2       (MJD method)
16670     *         2450123.5           0.2       (date &amp; time method)
16671     *</pre>
16672     *     The JD method is the most natural and convenient to use in
16673     *     cases where the loss of several decimal digits of resolution
16674     *     is acceptable.  The J2000 method is best matched to the way
16675     *     the argument is handled internally and will deliver the
16676     *     optimum resolution.  The MJD method and the date &amp; time methods
16677     *     are both good compromises between resolution and convenience.
16678     *
16679     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16680     *     the p-vector V(date) is with respect to the true equatorial triad
16681     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16682     *     the Geocentric Celestial Reference System (IAU, 2000).
16683     *</ol>
16684     *<p>Called:<ul>
16685     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16686     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16687     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16688     * </ul>
16689     *<p>Reference:
16690     *
16691     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855.
16692     *
16693     *@version 2009 December 21
16694     *
16695     *  @since Release 20101201
16696     *
16697     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16698     */
16699     public static double[][] jauPnm06a(double date1, double date2)
16700     {
16701 
16702     /* Fukushima-Williams angles for frame bias and precession. */
16703        FWPrecessionAngles fw = jauPfw06(date1, date2);
16704 
16705     /* Nutation components. */
16706        NutationTerms nut = jauNut06a(date1, date2);
16707 
16708     /* Equinox based nutation x precession x bias matrix. */
16709        double[][] rbpn = jauFw2m(fw.gamb, fw.phib, fw.psib + nut.dpsi, fw.epsa + nut.deps);
16710 
16711        return rbpn;
16712 
16713         }
16714     
16715 
16716     /**
16717     *  Form the matrix of precession/nutation for a given date, IAU 1976
16718     *  precession model, IAU 1980 nutation model.
16719     *
16720     *<p>This function is derived from the International Astronomical Union's
16721     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16722     *
16723     *<p>Status:  support function.
16724     *
16725     *<!-- Given: -->
16726     *     @param date1 double          TDB date (Note 1)
16727     *     @param date2 double          TDB date (Note 1) 
16728     *
16729     *<!-- Returned: -->
16730     *     @return rmatpn          double[3][3]     <u>returned</u> combined precession/nutation matrix
16731     *
16732     * <p>Notes:
16733     * <ol>
16734     *
16735     * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
16736     *     convenient way between the two arguments.  For example,
16737     *     JD(TDB)=2450123.7 could be expressed in any of these ways,
16738     *     among others:
16739     *<pre>
16740     *            date1          date2
16741     *
16742     *         2450123.7           0.0       (JD method)
16743     *         2451545.0       -1421.3       (J2000 method)
16744     *         2400000.5       50123.2       (MJD method)
16745     *         2450123.5           0.2       (date &amp; time method)
16746     *</pre>
16747     *     The JD method is the most natural and convenient to use in
16748     *     cases where the loss of several decimal digits of resolution
16749     *     is acceptable.  The J2000 method is best matched to the way
16750     *     the argument is handled internally and will deliver the
16751     *     optimum resolution.  The MJD method and the date &amp; time methods
16752     *     are both good compromises between resolution and convenience.
16753     *
16754     * <li> The matrix operates in the sense V(date) = rmatpn * V(J2000),
16755     *     where the p-vector V(date) is with respect to the true equatorial
16756     *     triad of date date1+date2 and the p-vector V(J2000) is with
16757     *     respect to the mean equatorial triad of epoch J2000.0.
16758     *</ol>
16759     *<p>Called:<ul>
16760     *     <li>{@link #jauPmat76} precession matrix, IAU 1976
16761     *     <li>{@link #jauNutm80} nutation matrix, IAU 1980
16762     *     <li>{@link #jauRxr} product of two r-matrices
16763     * </ul>
16764     *<p>Reference:
16765     *
16766     *     <p>Explanatory Supplement to the Astronomical Almanac,
16767     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
16768     *     Section 3.3 (p145).
16769     *
16770     *@version 2010 January 23
16771     *
16772     *  @since Release 20101201
16773     *
16774     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16775     */
16776     public static double[][] jauPnm80(double date1, double date2)
16777     {
16778        double rmatp[][] = new double[3][3], rmatn[][] = new double[3][3];
16779 
16780 
16781     /* Precession matrix, J2000.0 to date. */
16782        rmatp = jauPmat76(date1, date2 );
16783 
16784     /* Nutation matrix. */
16785        rmatn = jauNutm80(date1, date2);
16786 
16787     /* Combine the matrices:  PN = N x P. */
16788        double[][] rmatpn = jauRxr(rmatn, rmatp);
16789 
16790        return rmatpn;
16791 
16792         }
16793     
16794 
16795     /**
16796     *  Form the matrix of polar motion for a given date, IAU 2000.
16797     *
16798     *<p>This function is derived from the International Astronomical Union's
16799     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16800     *
16801     *<p>Status:  support function.
16802     *
16803     *<!-- Given: -->
16804     *     @param xp double     coordinates of the pole (radians, Note 1)
16805     *     @param yp double     coordinates of the pole (radians, Note 1) 
16806     *     @param sp        double     the TIO locator s' (radians, Note 2)
16807     *
16808     *<!-- Returned: -->
16809     *     @return     double[3][3]     <u>returned</u> polar-motion matrix (Note 3)
16810     *
16811     * <p>Notes:
16812     * <ol>
16813     *
16814     * <li> The arguments xp and yp are the coordinates (in radians) of the
16815     *     Celestial Intermediate Pole with respect to the International
16816     *     Terrestrial Reference System (see IERS Conventions 2003),
16817     *     measured along the meridians 0 and 90 deg west respectively.
16818     *
16819     * <li> The argument sp is the TIO locator s', in radians, which
16820     *     positions the Terrestrial Intermediate Origin on the equator.  It
16821     *     is obtained from polar motion observations by numerical
16822     *     integration, and so is in essence unpredictable.  However, it is
16823     *     dominated by a secular drift of about 47 microarcseconds per
16824     *     century, and so can be taken into account by using s' = -47*t,
16825     *     where t is centuries since J2000.0.  The function jauSp00
16826     *     implements this approximation.
16827     *
16828     * <li> The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning
16829     *     that it is the final rotation when computing the pointing
16830     *     direction to a celestial source.
16831     *</ol>
16832     *<p>Called:<ul>
16833     *     <li>{@link #jauIr} initialize r-matrix to identity
16834     *     <li>{@link #jauRz} rotate around Z-axis
16835     *     <li>{@link #jauRy} rotate around Y-axis
16836     *     <li>{@link #jauRx} rotate around X-axis
16837     * </ul>
16838     *<p>Reference:
16839     *
16840     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
16841     *     IERS Technical Note No. 32, BKG (2004)
16842     *
16843     *@version 2009 December 17
16844     *
16845     *  @since Release 20101201
16846     *
16847     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16848     */
16849     public static double[][] jauPom00(double xp, double yp, double sp)
16850     {
16851 
16852     /* Construct the matrix. */
16853        double rpom[][] = new double[3][3];
16854        jauIr(rpom);
16855        jauRz(sp, rpom);
16856        jauRy(-xp, rpom);
16857        jauRx(-yp, rpom);
16858 
16859        return rpom;
16860 
16861         }
16862     
16863 
16864     /**
16865     *  P-vector addition.
16866     *
16867     *<p>This function is derived from the International Astronomical Union's
16868     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16869     *
16870     *<p>Status:  vector/matrix support function.
16871     *
16872     *<!-- Given: -->
16873     *     @param a         double[3]       first p-vector
16874     *     @param b         double[3]       second p-vector
16875     *
16876     *<!-- Returned: -->
16877     *     @return apb       double[3]        <u>returned</u> a + b
16878     *
16879     *  Note:
16880     *     It is permissible to re-use the same array for any of the
16881     *     arguments.
16882     *
16883     *@version 2008 November 18
16884     *
16885     *  @since Release 20101201
16886     *
16887     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16888     */
16889     public static double[] jauPpp(double a[] , double b[] )
16890     {
16891        double apb[] = new double[3]; 
16892        apb[0] = a[0] + b[0];
16893        apb[1] = a[1] + b[1];
16894        apb[2] = a[2] + b[2];
16895 
16896        return apb;
16897 
16898      }
16899     
16900 
16901     /**
16902     *  P-vector plus scaled p-vector.
16903     *
16904     *<p>This function is derived from the International Astronomical Union's
16905     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16906     *
16907     *<p>Status:  vector/matrix support function.
16908     *
16909     *<!-- Given: -->
16910     *     @param a       double[3]      first p-vector
16911     *     @param s       double         scalar (multiplier for b)
16912     *     @param b       double[3]      second p-vector
16913     *
16914     *<!-- Returned: -->
16915     *     @return apsb    double[3]       <u>returned</u> a + s*b
16916     *
16917     *  Note:
16918     *     It is permissible for any of a, b and apsb to be the same array.
16919     *
16920     *<p>Called:<ul>
16921     *     <li>{@link #jauSxp} multiply p-vector by scalar
16922     *     <li>{@link #jauPpp} p-vector plus p-vector
16923     * </ul>
16924     *@version 2008 November 18
16925     *
16926     *  @since Release 20101201
16927     *
16928     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16929     */
16930     static double[] jauPpsp(double a[] , double s, double b[]  )
16931     {
16932        double sb[] = new double[3], apsb[];
16933 
16934 
16935     /* s*b. */
16936        sb = jauSxp(s,b);
16937 
16938     /* a + s*b. */
16939        apsb = jauPpp(a, sb);
16940 
16941        return apsb;
16942 
16943         }
16944     
16945     /**
16946      * Precession correction terms.
16947      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16948      * 
16949      * @since AIDA Stage 1
16950      */
16951     public static class PrecessionDeltaTerms {
16952         /**  precession correction in longitude  */
16953         public double dpsipr;
16954         /**  precession correction in obliquity */
16955         public double depspr;
16956         public PrecessionDeltaTerms(double dpsipr, double depspr) {
16957             this.dpsipr = dpsipr;
16958             this.depspr = depspr;
16959         }
16960     }
16961 
16962     /**
16963     *  Precession-rate part of the IAU 2000 precession-nutation models
16964     *  (part of MHB2000).
16965     *
16966     *<p>This function is derived from the International Astronomical Union's
16967     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16968     *
16969     *<p>Status:  canonical model.
16970     *
16971     *<!-- Given: -->
16972     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16973     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16974     *
16975     *<!-- Returned: -->
16976     *     @param dpsipr double    <u>returned</u> precession corrections (Notes 2,3)
16977     *     @param depspr double    <u>returned</u> precession corrections (Notes 2,3) 
16978     *
16979     * <p>Notes:
16980     * <ol>
16981     *
16982     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16983     *     convenient way between the two arguments.  For example,
16984     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16985     *     among others:
16986     *<pre>
16987     *            date1          date2
16988     *
16989     *         2450123.7           0.0       (JD method)
16990     *         2451545.0       -1421.3       (J2000 method)
16991     *         2400000.5       50123.2       (MJD method)
16992     *         2450123.5           0.2       (date &amp; time method)
16993     *</pre>
16994     *     The JD method is the most natural and convenient to use in
16995     *     cases where the loss of several decimal digits of resolution
16996     *     is acceptable.  The J2000 method is best matched to the way
16997     *     the argument is handled internally and will deliver the
16998     *     optimum resolution.  The MJD method and the date &amp; time methods
16999     *     are both good compromises between resolution and convenience.
17000     *
17001     * <li> The precession adjustments are expressed as "nutation
17002     *     components", corrections in longitude and obliquity with respect
17003     *     to the J2000.0 equinox and ecliptic.
17004     *
17005     * <li> Although the precession adjustments are stated to be with respect
17006     *     to Lieske et al. (1977), the MHB2000 model does not specify which
17007     *     set of Euler angles are to be used and how the adjustments are to
17008     *     be applied.  The most literal and straightforward procedure is to
17009     *     adopt the 4-rotation epsilon_0, psi_A, omega_A, xi_A option, and
17010     *     to add dpsipr to psi_A and depspr to both omega_A and eps_A.
17011     *
17012     * <li> This is an implementation of one aspect of the IAU 2000A nutation
17013     *     model, formally adopted by the IAU General Assembly in 2000,
17014     *     namely MHB2000 (Mathews et al. 2002).
17015     *
17016     *<p>References:
17017     *
17018     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B., "Expressions
17019     *     for the precession quantities based upon the IAU (1976) System of
17020     *     Astronomical Constants", Astron.Astrophys., 58, 1-16 (1977)
17021     *
17022     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
17023     *     and precession   New nutation series for nonrigid Earth and
17024     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
17025     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
17026     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
17027     *
17028     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
17029     *     Resolutions", in IERS Workshop 5.1 (2002).
17030     *
17031     *@version 2009 December 17
17032     *
17033     *  @since Release 20101201
17034     *
17035     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17036     */
17037     static PrecessionDeltaTerms jauPr00(double date1, double date2)
17038     {
17039        double t;
17040 
17041     /* Precession and obliquity corrections (radians per century) */
17042        final double PRECOR = -0.29965 * DAS2R,
17043                            OBLCOR = -0.02524 * DAS2R;
17044 
17045 
17046     /* Interval between fundamental epoch J2000.0 and given date (JC). */
17047        t = ((date1 - DJ00) + date2) / DJC;
17048 
17049     /* Precession rate contributions with respect to IAU 1976/80. */
17050        double dpsipr = PRECOR * t;
17051        double depspr = OBLCOR * t;
17052 
17053        return new PrecessionDeltaTerms(dpsipr, depspr);
17054 
17055         }
17056     
17057     /**
17058      * Euler Angles.
17059      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17060      * 
17061      * @since AIDA Stage 1
17062      */
17063     public static class EulerAngles {
17064         /** 1st rotation: radians cw around z */
17065         public double zeta;
17066         /** 3rd rotation: radians cw around z */
17067         public double z;
17068         /** 2nd rotation: radians ccw around y */
17069         public double theta;
17070         public EulerAngles(double zeta, double z, double theta){
17071             this.zeta = zeta;
17072             this.z = z;
17073             this.theta = theta;
17074         }
17075     }
17076                    
17077     /**
17078     *  IAU 1976 precession model.
17079     *
17080     *  This function forms the three Euler angles which implement general
17081     *  precession between two epochs, using the IAU 1976 model (as for
17082     *  the FK5 catalog).
17083     *
17084     *<p>This function is derived from the International Astronomical Union's
17085     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17086     *
17087     *<p>Status:  canonical model.
17088     *
17089     *<!-- Given: -->
17090     *     @param ep01 double     TDB starting epoch (Note 1)
17091     *     @param ep02 double     TDB starting epoch (Note 1) 
17092     *     @param ep11 double     TDB ending epoch (Note 1)
17093     *     @param ep12 double     TDB ending epoch (Note 1) 
17094     *
17095     *<!-- Returned: -->
17096     *     @param zeta         double      <u>returned</u> 1st rotation: radians cw around z
17097     *     @param z            double      <u>returned</u> 3rd rotation: radians cw around z
17098     *     @param theta        double      <u>returned</u> 2nd rotation: radians ccw around y
17099     *
17100     * <p>Notes:
17101     * <ol>
17102     *
17103     * <li> The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
17104     *     in any convenient way between the arguments epn1 and epn2.  For
17105     *     example, JD(TDB)=2450123.7 could be expressed in any of these
17106     *     ways, among others:
17107     *
17108     *             epn1          epn2
17109     *
17110     *         2450123.7           0.0       (JD method)
17111     *         2451545.0       -1421.3       (J2000 method)
17112     *         2400000.5       50123.2       (MJD method)
17113     *         2450123.5           0.2       (date &amp; time method)
17114     *</pre>
17115     *     The JD method is the most natural and convenient to use in cases
17116     *     where the loss of several decimal digits of resolution is
17117     *     acceptable.  The J2000 method is best matched to the way the
17118     *     argument is handled internally and will deliver the optimum
17119     *     optimum resolution.  The MJD method and the date &amp; time methods
17120     *     are both good compromises between resolution and convenience.
17121     *     The two epochs may be expressed using different methods, but at
17122     *     the risk of losing some resolution.
17123     *
17124     * <li> The accumulated precession angles zeta, z, theta are expressed
17125     *     through canonical polynomials which are valid only for a limited
17126     *     time span.  In addition, the IAU 1976 precession rate is known to
17127     *     be imperfect.  The absolute accuracy of the present formulation
17128     *     is better than 0.1 arcsec from 1960AD to 2040AD, better than
17129     *     1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for
17130     *     the whole of the period 500BC to 3000AD.  The errors exceed
17131     *     10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec
17132     *     outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to
17133     *     8200AD.
17134     *
17135     * <li> The three angles are returned in the conventional order, which
17136     *     is not the same as the order of the corresponding Euler
17137     *     rotations.  The precession matrix is
17138     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
17139     *
17140     *<p>Reference:
17141     *
17142     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations
17143     *     (6) &amp; (7), p283.
17144     *
17145     *@version 2009 December 17
17146     *
17147     *  @since Release 20101201
17148     *
17149     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17150     */
17151     static EulerAngles jauPrec76(double ep01, double ep02, double ep11, double ep12)
17152     {
17153        double t0, t, tas2r, w;
17154 
17155 
17156     /* Interval between fundamental epoch J2000.0 and start epoch (JC). */
17157        t0 = ((ep01 - DJ00) + ep02) / DJC;
17158 
17159     /* Interval over which precession required (JC). */
17160        t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
17161 
17162     /* Euler angles. */
17163        tas2r = t * DAS2R;
17164        w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0;
17165 
17166        double zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r;
17167 
17168        double z = (w + ((1.09468 + 0.000066 * t0) + 0.018203 * t) * t) * tas2r;
17169 
17170        double theta = ((2004.3109 + (-0.85330 - 0.000217 * t0) * t0)
17171               + ((-0.42665 - 0.000217 * t0) - 0.041833 * t) * t) * tas2r;
17172 
17173        return new EulerAngles(zeta, z, theta);
17174 
17175         }
17176     
17177 
17178     /**
17179     *  Discard velocity component of a pv-vector.
17180     *
17181     *<p>This function is derived from the International Astronomical Union's
17182     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17183     *
17184     *<p>Status:  vector/matrix support function.
17185     *
17186     *<!-- Given: -->
17187     *     @param pv       double[2][3]      pv-vector
17188     *
17189     *<!-- Returned: -->
17190     *     @return p        double[3]          <u>returned</u> p-vector
17191     *
17192     *<p>Called:<ul>
17193     *     <li>{@link #jauCp} copy p-vector
17194     * </ul>
17195     *@version 2008 May 11
17196     *
17197     *  @since Release 20101201
17198     *
17199     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17200     */
17201     public static double[] jauPv2p(double pv[][] )
17202     {
17203        double p[] = new double[3];
17204        jauCp(pv[0], p);
17205 
17206        return p;
17207 
17208         }
17209     
17210 
17211     /**
17212      * A position and velocity expressed in spherical polar coordinates.
17213      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17214      * 
17215      * @since AIDA Stage 1
17216      */
17217     public static class SphericalPositionVelocity {
17218         public SphericalPosition pos;
17219         public SphericalPosition vel;
17220         public SphericalPositionVelocity( double theta, double phi, double r,
17221                 double td, double pd, double rd) {
17222             pos = new SphericalPosition(theta, phi, r);
17223             vel = new SphericalPosition(td,pd,rd);
17224         }
17225     }
17226     /**
17227     *  Convert position/velocity from Cartesian to spherical coordinates.
17228     *
17229     *<p>This function is derived from the International Astronomical Union's
17230     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17231     *
17232     *<p>Status:  vector/matrix support function.
17233     *
17234     *<!-- Given: -->
17235     *     @param pv        double[2][3]   pv-vector
17236     *
17237     *<!-- Returned: -->
17238     *     @return theta     double          <u>returned</u> longitude angle (radians)
17239     *             phi       double          <u>returned</u> latitude angle (radians)
17240     *             r         double          <u>returned</u> radial distance
17241     *             td        double          <u>returned</u> rate of change of theta
17242     *             pd        double          <u>returned</u> rate of change of phi
17243     *             rd        double          <u>returned</u> rate of change of r
17244     *
17245     * <p>Notes:
17246     * <ol>
17247     *
17248     * <li> If the position part of pv is null, theta, phi, td and pd
17249     *     are indeterminate.  This is handled by extrapolating the
17250     *     position through unit time by using the velocity part of
17251     *     pv.  This moves the origin without changing the direction
17252     *     of the velocity component.  If the position and velocity
17253     *     components of pv are both null, zeroes are returned for all
17254     *     six results.
17255     *
17256     * <li> If the position is a pole, theta, td and pd are indeterminate.
17257     *     In such cases zeroes are returned for all three.
17258     *</ol>
17259     *@version 2008 October 28
17260     *
17261     *  @since Release 20101201
17262     *
17263     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17264     */
17265     public static SphericalPositionVelocity jauPv2s(double pv[][])
17266     {
17267        double x, y, z, xd, yd, zd, rxy2, rxy, r2, rtrue, rw, xyp;
17268        double theta, phi, r, td, pd, rd;
17269 
17270     /* Components of position/velocity vector. */
17271        x  = pv[0][0];
17272        y  = pv[0][1];
17273        z  = pv[0][2];
17274        xd = pv[1][0];
17275        yd = pv[1][1];
17276        zd = pv[1][2];
17277 
17278     /* Component of r in XY plane squared. */
17279        rxy2 = x*x + y*y;
17280 
17281     /* Modulus squared. */
17282        r2 = rxy2 + z*z;
17283 
17284     /* Modulus. */
17285        rtrue = sqrt(r2);
17286 
17287     /* If null vector, move the origin along the direction of movement. */
17288        rw = rtrue;
17289        if (rtrue == 0.0) {
17290            x = xd;
17291            y = yd;
17292            z = zd;
17293            rxy2 = x*x + y*y;
17294            r2 = rxy2 + z*z;
17295            rw = sqrt(r2);
17296        }
17297 
17298     /* Position and velocity in spherical coordinates. */
17299        rxy = sqrt(rxy2);
17300        xyp = x*xd + y*yd;
17301        if (rxy2 != 0.0) {
17302            theta = atan2(y, x);
17303            phi = atan2(z, rxy);
17304            td = (x*yd - y*xd) / rxy2;
17305            pd = (zd*rxy2 - z*xyp) / (r2*rxy);
17306        } else {
17307            theta = 0.0;
17308            phi = (z != 0.0) ? atan2(z, rxy) : 0.0;
17309            td = 0.0;
17310            pd = 0.0;
17311        }
17312        r = rtrue;
17313        rd = (rw != 0.0) ? (xyp + z*zd) / rw : 0.0;
17314 
17315        return new SphericalPositionVelocity(theta, phi, r, td, pd, rd);
17316 
17317         }
17318     
17319 
17320     /**
17321     *  Inner (=scalar=dot) product of two pv-vectors.
17322     *
17323     *<p>This function is derived from the International Astronomical Union's
17324     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17325     *
17326     *<p>Status:  vector/matrix support function.
17327     *
17328     *<!-- Given: -->
17329     *     @param a         double[2][3]       first pv-vector
17330     *     @param b         double[2][3]       second pv-vector
17331     *
17332     *<!-- Returned: -->
17333     *     @return adb       double[2]           <u>returned</u> a . b (see note)
17334     *
17335     *  Note:
17336     *
17337     *     If the position and velocity components of the two pv-vectors are
17338     *     ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of
17339     *     numbers ( ap . bp , ap . bv + av . bp ).  The two numbers are the
17340     *     dot-product of the two p-vectors and its derivative.
17341     *
17342     *<p>Called:<ul>
17343     *     <li>{@link #jauPdp} scalar product of two p-vectors
17344     * </ul>
17345     *@version 2008 May 22
17346     *
17347     *  @since Release 20101201
17348     *
17349     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17350     */
17351     public static double[] jauPvdpv(double a[][], double b[][] )
17352     {
17353        double adbd, addb, adb[] = new double[2];
17354 
17355 
17356     /* a . b = constant part of result. */
17357        adb[0] = jauPdp(a[0], b[0]);
17358 
17359     /* a . bdot */
17360        adbd = jauPdp(a[0], b[1]);
17361 
17362     /* adot . b */
17363        addb = jauPdp(a[1], b[0]);
17364 
17365     /* Velocity part of result. */
17366        adb[1] = adbd + addb;
17367 
17368        return adb;
17369 
17370         }
17371     
17372 
17373     /**
17374      * Modulus of pv-vector.
17375      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17376      * 
17377      * @since AIDA Stage 1
17378      */
17379     public static class PVModulus{
17380         public double r;
17381         public double s;
17382         public PVModulus( double r, double s){
17383             this.r = r;
17384             this.s = s;
17385         }
17386     }
17387     /**
17388     *  Modulus of pv-vector.
17389     *
17390     *<p>This function is derived from the International Astronomical Union's
17391     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17392     *
17393     *<p>Status:  vector/matrix support function.
17394     *
17395     *<!-- Given: -->
17396     *     @param pv      double[2][3]    pv-vector
17397     *
17398     *<!-- Returned: -->
17399     *     @return           modulus of position component,
17400     *                      modulus of velocity component
17401     *
17402     *<p>Called:<ul>
17403     *     <li>{@link #jauPm} modulus of p-vector
17404     * </ul>
17405     *@version 2008 May 22
17406     *
17407     *  @since Release 20101201
17408     *
17409     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17410     */
17411     public static PVModulus jauPvm(double pv[][])
17412     {
17413     /* Distance. */
17414        double r = jauPm(pv[0]);
17415 
17416     /* Speed. */
17417        double s = jauPm(pv[1]);
17418 
17419        return new PVModulus(r, s);
17420 
17421         }
17422     
17423 
17424     /**
17425     *  Subtract one pv-vector from another.
17426     *
17427     *<p>This function is derived from the International Astronomical Union's
17428     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17429     *
17430     *<p>Status:  vector/matrix support function.
17431     *
17432     *<!-- Given: -->
17433     *     @param a        double[2][3]       first pv-vector
17434     *     @param b        double[2][3]       second pv-vector
17435     *
17436     *<!-- Returned: -->
17437     *     @return      double[2][3]        <u>returned</u> a - b
17438     *
17439     *  Note:
17440     *     It is permissible to re-use the same array for any of the
17441     *     arguments.
17442     *
17443     *<p>Called:<ul>
17444     *     <li>{@link #jauPmp} p-vector minus p-vector
17445     * </ul>
17446     *@version 2008 November 18
17447     *
17448     *  @since Release 20101201
17449     *
17450     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17451     */
17452     public static double[][] jauPvmpv(double a[][], double b[][])
17453     {
17454        double amb[][] = new double[2][3];
17455        amb[0] = jauPmp(a[0], b[0]);
17456        amb[1] = jauPmp(a[1], b[1]);
17457 
17458        return amb;
17459 
17460         }
17461     
17462 
17463     /**
17464     *  Add one pv-vector to another.
17465     *
17466     *<p>This function is derived from the International Astronomical Union's
17467     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17468     *
17469     *<p>Status:  vector/matrix support function.
17470     *
17471     *<!-- Given: -->
17472     *     @param a         double[2][3]       first pv-vector
17473     *     @param b         double[2][3]       second pv-vector
17474     *
17475     *<!-- Returned: -->
17476     *     @return apb       double[2][3]        <u>returned</u> a + b
17477     *
17478     *  Note:
17479     *     It is permissible to re-use the same array for any of the
17480     *     arguments.
17481     *
17482     *<p>Called:<ul>
17483     *     <li>{@link #jauPpp} p-vector plus p-vector
17484     * </ul>
17485     *@version 2008 November 18
17486     *
17487     *  @since Release 20101201
17488     *
17489     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17490     */
17491     public static double[][] jauPvppv(double a[][], double b[][])
17492     {
17493        double apb[][] = new double[2][3];
17494        apb[0] = jauPpp(a[0], b[0]);
17495        apb[1] = jauPpp(a[1], b[1]);
17496 
17497        return apb;
17498 
17499         }
17500     
17501 
17502     /**
17503      * Typical catalogue coordinates. i.e. Position, proper motion, parallax and radial velocity.
17504      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17505      * 
17506      * @since AIDA Stage 1
17507      */
17508     public static class CatalogCoords {
17509         /** position (radians) */
17510         public SphericalCoordinate pos;
17511         /** proper motion (radians/year)*/
17512         public SphericalCoordinate pm;
17513         /** parallax (arcsec) */
17514         public double px;
17515         /** radial velocity (km/s, positive = receding) */
17516         public double rv;
17517         
17518         public CatalogCoords(double ra, double dec,
17519                 double pmr, double pmd, double px, double rv) {
17520             this.pos = new SphericalCoordinate(ra, dec);
17521             this.pm = new SphericalCoordinate(pmr, pmd);
17522             this.px = px;
17523             this.rv = rv;
17524         }
17525     }
17526     /**
17527     *  Convert star position+velocity vector to catalog coordinates.
17528     *
17529     *<p>This function is derived from the International Astronomical Union's
17530     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17531     *
17532     *<p>Status:  support function.
17533     *
17534     *  Given (Note 1):
17535     *    @param pv     double[2][3]   pv-vector (au, au/day)
17536     *
17537      *
17538     * <!-- Returned (function value): -->
17539     *  @return catalogue value
17540     *  
17541     * 
17542     * @throws    JSOFAInternalError  superluminal speed (Note 5), or null position vector
17543     *
17544     * <p>Notes:
17545     * <ol>
17546     *
17547     * <li> The specified pv-vector is the coordinate direction (and its rate
17548     *     of change) for the date at which the light leaving the star
17549     *     reached the solar-system barycenter.
17550     *
17551     * <li> The star data returned by this function are "observables" for an
17552     *     imaginary observer at the solar-system barycenter.  Proper motion
17553     *     and radial velocity are, strictly, in terms of barycentric
17554     *     coordinate time, TCB.  For most practical applications, it is
17555     *     permissible to neglect the distinction between TCB and ordinary
17556     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
17557     *     limited by the intrinsic accuracy of the proper-motion and
17558     *     radial-velocity data;  moreover, the supplied pv-vector is likely
17559     *     to be merely an intermediate result (for example generated by the
17560     *     function jauStarpv), so that a change of time unit will cancel
17561     *     out overall.
17562     *
17563     *     In accordance with normal star-catalog conventions, the object's
17564     *     right ascension and declination are freed from the effects of
17565     *     secular aberration.  The frame, which is aligned to the catalog
17566     *     equator and equinox, is Lorentzian and centered on the SSB.
17567     *
17568     *     Summarizing, the specified pv-vector is for most stars almost
17569     *     identical to the result of applying the standard geometrical
17570     *     "space motion" transformation to the catalog data.  The
17571     *     differences, which are the subject of the Stumpff paper cited
17572     *     below, are:
17573     *
17574     *     (i) In stars with significant radial velocity and proper motion,
17575     *     the constantly changing light-time distorts the apparent proper
17576     *     motion.  Note that this is a classical, not a relativistic,
17577     *     effect.
17578     *
17579     *     (ii) The transformation complies with special relativity.
17580     *
17581     * <li> Care is needed with units.  The star coordinates are in radians
17582     *     and the proper motions in radians per Julian year, but the
17583     *     parallax is in arcseconds; the radial velocity is in km/s, but
17584     *     the pv-vector result is in au and au/day.
17585     *
17586     * <li> The proper motions are the rate of change of the right ascension
17587     *     and declination at the catalog epoch and are in radians per Julian
17588     *     year.  The RA proper motion is in terms of coordinate angle, not
17589     *     true angle, and will thus be numerically larger at high
17590     *     declinations.
17591     *
17592     * <li> Straight-line motion at constant speed in the inertial frame is
17593     *     assumed.  If the speed is greater than or equal to the speed of
17594     *     light, the function aborts with an error status.
17595     *
17596     * <li> The inverse transformation is performed by the function jauStarpv.
17597     *</ol>
17598     *<p>Called:<ul>
17599     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
17600     *     <li>{@link #jauPdp} scalar product of two p-vectors
17601     *     <li>{@link #jauSxp} multiply p-vector by scalar
17602     *     <li>{@link #jauPmp} p-vector minus p-vector
17603     *     <li>{@link #jauPm} modulus of p-vector
17604     *     <li>{@link #jauPpp} p-vector plus p-vector
17605     *     <li>{@link #jauPv2s} pv-vector to spherical
17606     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
17607     * </ul>
17608     *<p>Reference:
17609     *
17610     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
17611     *
17612     *@version 2017 May 30
17613     *
17614     *  @since Release 20101201
17615     *
17616     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17617     */
17618     public static CatalogCoords jauPvstar(double pv[][]) throws JSOFAInternalError
17619     {
17620        double x[] = new double[3], vr, ur[] = new double[3], vt, ut[] = new double[3], bett, betr, d, w, del,
17621               usr[] = new double[3], ust[] = new double[3];
17622 
17623 
17624     /* Isolate the radial component of the velocity (au/day, inertial). */
17625        NormalizedVector nv = jauPn(pv[0]);
17626        x = nv.u;
17627        vr = jauPdp(x, pv[1]);
17628        ur = jauSxp(vr,x);
17629 
17630     /* Isolate the transverse component of the velocity (au/day, inertial). */
17631        ut = jauPmp(pv[1], ur);
17632        vt = jauPm(ut);
17633 
17634     /* Special-relativity dimensionless parameters. */
17635        bett = vt / DC;
17636        betr = vr / DC;
17637 
17638     /* The inertial-to-observed correction terms. */
17639        d = 1.0 + betr;
17640        w = betr*betr + bett*bett;
17641        if (d == 0.0 || w > 1) throw new JSOFAInternalError("Superluminal speed", -1);
17642        del = -w / (sqrt(1.0 -w) + 1.0);
17643 
17644     /* Apply relativistic correction factor to radial velocity component. */
17645        w = (betr != 0) ? (betr - del) / (betr * d) : 1.0;
17646        usr = jauSxp(w,ur);
17647 
17648     /* Apply relativistic correction factor to tangential velocity */
17649     /* component.                                                  */
17650        ust = jauSxp(1.0/d, ut);
17651 
17652     /* Combine the two to obtain the observed velocity vector (au/day). */
17653        pv[1] = jauPpp(usr, ust);
17654 
17655     /* Cartesian to spherical. */
17656        SphericalPositionVelocity pvs = jauPv2s(pv);
17657        if (pvs.pos.r == 0.0) throw new JSOFAInternalError("null position vector", -2);
17658 
17659     /* Return RA in range 0 to 2pi. */
17660        double ra = jauAnp(pvs.pos.theta);
17661 
17662     /* Return proper motions in radians per year. */
17663        double pmr = pvs.vel.theta * DJY;
17664        double pmd = pvs.vel.phi * DJY;
17665 
17666     /* Return parallax in arcsec. */
17667        double px = DR2AS / pvs.pos.r;
17668 
17669     /* Return radial velocity in km/s. */
17670        double rv = 1e-3 * pvs.vel.r * DAU / DAYSEC;
17671 
17672     /* OK status. */
17673        return new CatalogCoords(ra, pvs.pos.phi, pmr, pmd, px, rv);
17674 
17675         }
17676     
17677 
17678     /**
17679     *  Update a pv-vector.
17680     *
17681     *<p>This function is derived from the International Astronomical Union's
17682     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17683     *
17684     *<p>Status:  vector/matrix support function.
17685     *
17686     *<!-- Given: -->
17687     *     @param dt        double            time interval
17688     *     @param pv        double[2][3]      pv-vector
17689     *
17690     *<!-- Returned: -->
17691     *     @return upv       double[2][3]       <u>returned</u> p updated, v unchanged
17692     *
17693     * <p>Notes:
17694     * <ol>
17695     *
17696     * <li> "Update" means "refer the position component of the vector
17697     *     to a new date dt time units from the existing date".
17698     *
17699     * <li> The time units of dt must match those of the velocity.
17700     *
17701     * <li> It is permissible for pv and upv to be the same array.
17702     *</ol>
17703     *<p>Called:<ul>
17704     *     <li>{@link #jauPpsp} p-vector plus scaled p-vector
17705     *     <li>{@link #jauCp} copy p-vector
17706     * </ul>
17707     *@version 2008 November 17
17708     *
17709     *  @since Release 20101201
17710     *
17711     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17712     */
17713     public static double[][] jauPvu(double dt, double pv[][] )
17714     {
17715        double upv[][] = new double[2][3];
17716        upv[0] = jauPpsp(pv[0], dt, pv[1]);
17717        jauCp(pv[1], upv[1]);
17718 
17719        return upv;
17720 
17721         }
17722     
17723 
17724     /**
17725     *  Update a pv-vector, discarding the velocity component.
17726     *
17727     *<p>This function is derived from the International Astronomical Union's
17728     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17729     *
17730     *<p>Status:  vector/matrix support function.
17731     *
17732     *<!-- Given: -->
17733     *     @param dt        double             time interval
17734     *     @param pv        double[2][3]       pv-vector
17735     *
17736     *<!-- Returned: -->
17737     *     @return p         double[3]           <u>returned</u> p-vector
17738     *
17739     * <p>Notes:
17740     * <ol>
17741     *
17742     * <li> "Update" means "refer the position component of the vector to a
17743     *     new date dt time units from the existing date".
17744     *
17745     * <li> The time units of dt must match those of the velocity.
17746     *</ol>
17747     *@version 2008 May 11
17748     *
17749     *  @since Release 20101201
17750     *
17751     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17752     */
17753     public static double[] jauPvup(double dt, double pv[][] )
17754     {
17755         double p[] = new double[3];
17756        p[0] = pv[0][0] + dt * pv[1][0];
17757        p[1] = pv[0][1] + dt * pv[1][1];
17758        p[2] = pv[0][2] + dt * pv[1][2];
17759 
17760        return p;
17761 
17762         }
17763     
17764 
17765     /**
17766     *  Outer (=vector=cross) product of two pv-vectors.
17767     *
17768     *<p>This function is derived from the International Astronomical Union's
17769     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17770     *
17771     *<p>Status:  vector/matrix support function.
17772     *
17773     *<!-- Given: -->
17774     *     @param a         double[2][3]       first pv-vector
17775     *     @param b         double[2][3]       second pv-vector
17776     *
17777     *<!-- Returned: -->
17778     *     @return axb       double[2][3]        <u>returned</u> a x b
17779     *
17780     * <p>Notes:
17781     * <ol>
17782     *
17783     * <li> If the position and velocity components of the two pv-vectors are
17784     *     ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of
17785     *     vectors ( ap x bp, ap x bv + av x bp ).  The two vectors are the
17786     *     cross-product of the two p-vectors and its derivative.
17787     *
17788     * <li> It is permissible to re-use the same array for any of the
17789     *     arguments.
17790     *</ol>
17791     *<p>Called:<ul>
17792     *     <li>{@link #jauCpv} copy pv-vector
17793     *     <li>{@link #jauPxp} vector product of two p-vectors
17794     *     <li>{@link #jauPpp} p-vector plus p-vector
17795     * </ul>
17796     *@version 2008 November 18
17797     *
17798     *  @since Release 20101201
17799     *
17800     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17801     */
17802     public static double[][] jauPvxpv(double a[][], double b[][] )
17803     {
17804        double wa[][] = new double[2][3], wb[][] = new double[2][3], axbd[] = new double[3], adxb[] = new double[3];
17805 
17806        double axb[][] = new double[2][3];
17807     /* Make copies of the inputs. */
17808        jauCpv(a, wa);
17809        jauCpv(b, wb);
17810 
17811     /* a x b = position part of result. */
17812        axb[0] = jauPxp(wa[0], wb[0]);
17813 
17814     /* a x bdot + adot x b = velocity part of result. */
17815        axbd = jauPxp(wa[0],wb[1]);
17816        adxb = jauPxp(wa[1],wb[0]);
17817        axb[1] = jauPpp(axbd, adxb);
17818 
17819        return axb;
17820 
17821         }
17822     
17823 
17824     /**
17825     *  p-vector outer (=vector=cross) product.
17826     *
17827     *<p>This function is derived from the International Astronomical Union's
17828     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17829     *
17830     *<p>Status:  vector/matrix support function.
17831     *
17832     *<!-- Given: -->
17833     *     @param a         double[3]       first p-vector
17834     *     @param b         double[3]       second p-vector
17835     *
17836     *<!-- Returned: -->
17837     *     @return axb       double[3]        <u>returned</u> a x b
17838     *
17839     *  Note:
17840     *     It is permissible to re-use the same array for any of the
17841     *     arguments.
17842     *
17843     *@version 2008 November 18
17844     *
17845     *  @since Release 20101201
17846     *
17847     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17848     */
17849     public static double[] jauPxp(double a[] , double b[]  )
17850     {
17851        double xa, ya, za, xb, yb, zb;
17852        double axb[] = new double[3];
17853 
17854        xa = a[0];
17855        ya = a[1];
17856        za = a[2];
17857        xb = b[0];
17858        yb = b[1];
17859        zb = b[2];
17860        axb[0] = ya*zb - za*yb;
17861        axb[1] = za*xb - xa*zb;
17862        axb[2] = xa*yb - ya*xb;
17863 
17864        return axb;
17865 
17866         }
17867     
17868 
17869     /**
17870     *  Express an r-matrix as an r-vector.
17871     *
17872     *<p>This function is derived from the International Astronomical Union's
17873     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17874     *
17875     *<p>Status:  vector/matrix support function.
17876     *
17877     *<!-- Given: -->
17878     *     @param r         double[3][3]     rotation matrix
17879     *
17880     *<!-- Returned: -->
17881     *     @return w         double[3]         <u>returned</u> rotation vector (Note 1)
17882     *
17883     * <p>Notes:
17884     * <ol>
17885     *
17886     * <li> A rotation matrix describes a rotation through some angle about
17887     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17888     *     returned by this function has the same direction as the Euler axis,
17889     *     and its magnitude is the angle in radians.  (The magnitude and
17890     *     direction can be separated by means of the function jauPn.)
17891     *
17892     * <li> If r is null, so is the result.  If r is not a rotation matrix
17893     *     the result is undefined;  r must be proper (i.e. have a positive
17894     *     determinant) and real orthogonal (inverse = transpose).
17895     *
17896     * <li> The reference frame rotates clockwise as seen looking along
17897     *     the rotation vector from the origin.
17898     *</ol>
17899     *@version 2008 May 12
17900     *
17901     *  @since Release 20101201
17902     *
17903     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17904     */
17905     public static double[] jauRm2v(double r[][] )
17906     {
17907        double x, y, z, s2, c2, phi, f;
17908        double w[] = new double[3];
17909 
17910        x = r[1][2] - r[2][1];
17911        y = r[2][0] - r[0][2];
17912        z = r[0][1] - r[1][0];
17913        s2 = sqrt(x*x + y*y + z*z);
17914        if (s2 > 0) {
17915           c2 = r[0][0] + r[1][1] + r[2][2] - 1;
17916           phi = atan2(s2, c2);
17917           f =  phi / s2;
17918           w[0] = x * f;
17919           w[1] = y * f;
17920           w[2] = z * f;
17921        } else {
17922           w[0] = 0.0;
17923           w[1] = 0.0;
17924           w[2] = 0.0;
17925        }
17926 
17927        return w;
17928 
17929         }
17930     
17931 
17932     /**
17933     *  Form the r-matrix corresponding to a given r-vector.
17934     *
17935     *<p>This function is derived from the International Astronomical Union's
17936     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17937     *
17938     *<p>Status:  vector/matrix support function.
17939     *
17940     *<!-- Given: -->
17941     *     @param w         double[3]       rotation vector (Note 1)
17942     *
17943     *<!-- Returned: -->
17944     *     @return r         double[3][3]      <u>returned</u> rotation matrix
17945     *
17946     * <p>Notes:
17947     * <ol>
17948     *
17949     * <li> A rotation matrix describes a rotation through some angle about
17950     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17951     *     supplied to This function has the same direction as the Euler
17952     *     axis, and its magnitude is the angle in radians.
17953     *
17954     * <li> If w is null, the identity matrix is returned.
17955     *
17956     * <li> The reference frame rotates clockwise as seen looking along the
17957     *     rotation vector from the origin.
17958     *</ol>
17959     *@version 2008 May 11
17960     *
17961     *  @since Release 20101201
17962     *
17963     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17964     */
17965     public static double[][] jauRv2m(double w[])
17966     {
17967        double x, y, z, phi, s, c, f;
17968        double r[][] = new double[3][3];
17969 
17970 
17971     /* Euler angle (magnitude of rotation vector) and functions. */
17972        x = w[0];
17973        y = w[1];
17974        z = w[2];
17975        phi = sqrt(x*x + y*y + z*z);
17976        s = sin(phi);
17977        c = cos(phi);
17978        f = 1.0 - c;
17979 
17980     /* Euler axis (direction of rotation vector), perhaps null. */
17981        if (phi > 0.0) {
17982            x /= phi;
17983            y /= phi;
17984            z /= phi;
17985        }
17986 
17987     /* Form the rotation matrix. */
17988        r[0][0] = x*x*f + c;
17989        r[0][1] = x*y*f + z*s;
17990        r[0][2] = x*z*f - y*s;
17991        r[1][0] = y*x*f - z*s;
17992        r[1][1] = y*y*f + c;
17993        r[1][2] = y*z*f + x*s;
17994        r[2][0] = z*x*f + y*s;
17995        r[2][1] = z*y*f - x*s;
17996        r[2][2] = z*z*f + c;
17997 
17998        return r;
17999 
18000         }
18001     
18002 
18003     /**
18004     *  Rotate an r-matrix about the x-axis.
18005     *
18006     *<p>This function is derived from the International Astronomical Union's
18007     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18008     *
18009     *<p>Status:  vector/matrix support function.
18010     *
18011     *<!-- Given: -->
18012     *     @param phi     double           angle (radians)
18013     *
18014     *  Given and returned:
18015     *      @param r      double[3][3]    r-matrix <u>given and returned</u>
18016     *
18017     *  Sign convention:  The matrix can be used to rotate the reference
18018     *  frame of a vector.  Calling this function with positive phi
18019     *  incorporates in the matrix an additional rotation, about the x-axis,
18020     *  anticlockwise as seen looking towards the origin from positive x.
18021     *
18022     *<p>Called:<ul>
18023     *     <li>{@link #jauIr} initialize r-matrix to identity
18024     *     <li>{@link #jauRxr} product of two r-matrices
18025     *     <li>{@link #jauCr} copy r-matrix
18026     * </ul>
18027     *@version 2008 May 22
18028     *
18029     *  @since Release 20101201
18030     *
18031     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18032     */
18033     public static void jauRx(double phi, double r[][])
18034     {
18035        double s, c, a[][] = new double[3][3], w[][];
18036 
18037 
18038     /* Matrix representing new rotation. */
18039        s = sin(phi);
18040        c = cos(phi);
18041        jauIr(a);
18042        a[1][1] =  c;
18043        a[2][1] = -s;
18044        a[1][2] =  s;
18045        a[2][2] =  c;
18046 
18047     /* Rotate. */
18048        w = jauRxr(a, r);
18049 
18050     /* Return result. */
18051        jauCr(w, r);
18052 
18053        return;
18054 
18055         }
18056     
18057 
18058     /**
18059     *  Multiply a p-vector by an r-matrix.
18060     *
18061     *<p>This function is derived from the International Astronomical Union's
18062     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18063     *
18064     *<p>Status:  vector/matrix support function.
18065     *
18066     *<!-- Given: -->
18067     *     @param r         double[3][3]     r-matrix
18068     *     @param p         double[3]        p-vector
18069     *
18070     *<!-- Returned: -->
18071     *     @return rp        double[3]         <u>returned</u> r * p
18072     *
18073     *  Note:
18074     *  <ol>
18075     *    <li> The algorithm is for the simple case where the r-matrix r is not
18076     *     a function of time.  The case where r is a function of time leads
18077     *    to an additional velocity component equal to the product of the
18078     *    derivative of r and the position vector.
18079     *
18080     *    <li> It is permissible for p and rp to be the same array.
18081     *  </ol>
18082     *
18083     *<p>Called:<ul>
18084     *     <li>{@link #jauCp} copy p-vector
18085     * </ul>
18086     *@version 2008 October 28
18087     *
18088     *  @since Release 20101201
18089     *
18090     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18091     */
18092     public static double[] jauRxp(double r[][], double p[])
18093     {
18094        double w, wrp[] = new double[3] ;
18095        int i, j;
18096 
18097 
18098     /* Matrix r * vector p. */
18099        for (j = 0; j < 3; j++) {
18100            w = 0.0;
18101            for (i = 0; i < 3; i++) {
18102                w += r[j][i] * p[i];
18103            }
18104            wrp[j] = w;
18105        }
18106 
18107 
18108        return wrp;
18109 
18110         }
18111     
18112 
18113     /**
18114     *  Multiply a pv-vector by an r-matrix.
18115     *
18116     *<p>This function is derived from the International Astronomical Union's
18117     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18118     *
18119     *<p>Status:  vector/matrix support function.
18120     *
18121     *<!-- Given: -->
18122     *     @param r         double[3][3]     r-matrix
18123     *     @param pv        double[2][3]     pv-vector
18124     *
18125     *<!-- Returned: -->
18126     *     @return rpv       double[2][3]      <u>returned</u> r * pv
18127     *
18128     *  Note:
18129     *     It is permissible for pv and rpv to be the same array.
18130     *
18131     *<p>Called:<ul>
18132     *     <li>{@link #jauRxp} product of r-matrix and p-vector
18133     * </ul>
18134     *@version 2008 October 28
18135     *
18136     *  @since Release 20101201
18137     *
18138     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18139     */
18140     public static double[][] jauRxpv(double r[][], double pv[][])
18141     {
18142        double rpv[][] = new double[2][0];
18143        rpv[0] = jauRxp(r, pv[0]);
18144        rpv[1] = jauRxp(r, pv[1]);
18145 
18146        return rpv;
18147 
18148         }
18149     
18150 
18151     /**
18152     *  Multiply two r-matrices.
18153     *
18154     *<p>This function is derived from the International Astronomical Union's
18155     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18156     *
18157     *<p>Status:  vector/matrix support function.
18158     *
18159     *<!-- Given: -->
18160     *     @param a         double[3][3]     first r-matrix
18161     *     @param b         double[3][3]     second r-matrix
18162     *
18163     *<!-- Returned: -->
18164     *     @return atb       double[3][3]      <u>returned</u> a * b
18165     *
18166     *  Note:
18167     *     It is permissible to re-use the same array for any of the
18168     *     arguments.
18169     *
18170     *<p>Called:<ul>
18171     *     <li>{@link #jauCr} copy r-matrix
18172     * </ul>
18173     *@version 2008 November 18
18174     *
18175     *  @since Release 20101201
18176     *
18177     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18178     */
18179     public static double[][] jauRxr(double a[][], double b[][])
18180     {
18181        int i, j, k;
18182        double w, wm[][] = new double[3][3];
18183 
18184 
18185        for (i = 0; i < 3; i++) {
18186           for (j = 0; j < 3; j++) {
18187              w = 0.0;
18188              for (k = 0; k < 3; k++) {
18189                 w +=  a[i][k] * b[k][j];
18190              }
18191              wm[i][j] = w;
18192           }
18193        }
18194 
18195        return wm;
18196 
18197      }
18198     
18199 
18200     /**
18201     *  Rotate an r-matrix about the y-axis.
18202     *
18203     *<p>This function is derived from the International Astronomical Union's
18204     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18205     *
18206     *<p>Status:  vector/matrix support function.
18207     *
18208     *<!-- Given: -->
18209     *     @param theta   double           angle (radians)
18210     *
18211     *  Given and returned:
18212     *     @param r      double[3][3]   <u>given &amp; returned</u> r-matrix
18213     *
18214     *  Sign convention:  The matrix can be used to rotate the reference
18215     *  frame of a vector.  Calling This function with positive theta
18216     *  incorporates in the matrix an additional rotation, about the y-axis,
18217     *  anticlockwise as seen looking towards the origin from positive y.
18218     *
18219     *<p>Called:<ul>
18220     *     <li>{@link #jauIr} initialize r-matrix to identity
18221     *     <li>{@link #jauRxr} product of two r-matrices
18222     *     <li>{@link #jauCr} copy r-matrix
18223     * </ul>
18224     *@version 2008 May 22
18225     *
18226     *  @since Release 20101201
18227     *
18228     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18229     */
18230     public static void jauRy(double theta, double r[][])
18231     {
18232        double s, c, a[][] = new double[3][3], w[][];
18233 
18234 
18235     /* Matrix representing new rotation. */
18236        s = sin(theta);
18237        c = cos(theta);
18238        jauIr(a);
18239        a[0][0] =  c;
18240        a[2][0] =  s;
18241        a[0][2] = -s;
18242        a[2][2] =  c;
18243 
18244     /* Rotate. */
18245        w = jauRxr(a, r);
18246 
18247     /* Return result. */
18248        jauCr(w, r);
18249 
18250        return;
18251 
18252         }
18253     
18254 
18255     /**
18256     *  Rotate an r-matrix about the z-axis.
18257     *
18258     *<p>This function is derived from the International Astronomical Union's
18259     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18260     *
18261     *<p>Status:  vector/matrix support function.
18262     *
18263     *<!-- Given: -->
18264     *     @param psi     double           angle (radians)
18265     *
18266     *  Given and returned:
18267     *     @param r      double[3][3]    <u>given &amp; retuned</u>r-matrix, rotated
18268     *
18269     *  Sign convention:  The matrix can be used to rotate the reference
18270     *  frame of a vector.  Calling This function with positive psi
18271     *  incorporates in the matrix an additional rotation, about the z-axis,
18272     *  anticlockwise as seen looking towards the origin from positive z.
18273     *
18274     *<p>Called:<ul>
18275     *     <li>{@link #jauIr} initialize r-matrix to identity
18276     *     <li>{@link #jauRxr} product of two r-matrices
18277     *     <li>{@link #jauCr} copy r-matrix
18278     * </ul>
18279     *@version 2008 May 22
18280     *
18281     *  @since Release 20101201
18282     *
18283     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18284     */
18285     public static void jauRz(double psi, double r[][])
18286     {
18287        double s, c, a[][] = new double[3][3], w[][];
18288 
18289 
18290     /* Matrix representing new rotation. */
18291        s = sin(psi);
18292        c = cos(psi);
18293        jauIr(a);
18294        a[0][0] =  c;
18295        a[1][0] = -s;
18296        a[0][1] =  s;
18297        a[1][1] =  c;
18298 
18299     /* Rotate. */
18300        w = jauRxr(a, r);
18301 
18302     /* Return result. */
18303        jauCr(w, r);
18304 
18305        return;
18306 
18307         }
18308     
18309 
18310     /**
18311     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18312     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18313     *  coordinates.  Compatible with IAU 2000A precession-nutation.
18314     *
18315     *<p>This function is derived from the International Astronomical Union's
18316     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18317     *
18318     *<p>Status:  canonical model.
18319     *
18320     *<!-- Given: -->
18321     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18322     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18323     *     @param x double     CIP coordinates (Note 3)
18324     *     @param y double     CIP coordinates (Note 3) 
18325     *
18326     * <!-- Returned (function value): -->
18327     *  @return double    the CIO locator s in radians (Note 2)
18328     *
18329     * <p>Notes:
18330     * <ol>
18331     *
18332     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18333     *     convenient way between the two arguments.  For example,
18334     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18335     *     among others:
18336     *<pre>
18337     *            date1          date2
18338     *
18339     *         2450123.7           0.0       (JD method)
18340     *         2451545.0       -1421.3       (J2000 method)
18341     *         2400000.5       50123.2       (MJD method)
18342     *         2450123.5           0.2       (date &amp; time method)
18343     *</pre>
18344     *     The JD method is the most natural and convenient to use in
18345     *     cases where the loss of several decimal digits of resolution
18346     *     is acceptable.  The J2000 method is best matched to the way
18347     *     the argument is handled internally and will deliver the
18348     *     optimum resolution.  The MJD method and the date &amp; time methods
18349     *     are both good compromises between resolution and convenience.
18350     *
18351     * <li> The CIO locator s is the difference between the right ascensions
18352     *     of the same point in two systems:  the two systems are the GCRS
18353     *     and the CIP,CIO, and the point is the ascending node of the
18354     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18355     *     throughout 1900-2100.
18356     *
18357     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18358     *     are the x and y components of the CIP unit vector;  this series
18359     *     is more compact than a direct series for s would be.  This
18360     *     function requires X,Y to be supplied by the caller, who is
18361     *     responsible for providing values that are consistent with the
18362     *     supplied date.
18363     *
18364     * <li> The model is consistent with the IAU 2000A precession-nutation.
18365     *</ol>
18366     *<p>Called:<ul>
18367     *     <li>{@link #jauFal03} mean anomaly of the Moon
18368     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18369     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18370     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18371     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18372     *     <li>{@link #jauFave03} mean longitude of Venus
18373     *     <li>{@link #jauFae03} mean longitude of Earth
18374     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18375     * </ul>
18376     *<p>References:
18377     *
18378     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18379     *     "Expressions for the Celestial Intermediate Pole and Celestial
18380     *     Ephemeris Origin consistent with the IAU 2000A precession-
18381     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18382     *
18383     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18384     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18385     *
18386     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18387     *     IERS Technical Note No. 32, BKG (2004)
18388     *
18389     *@version 2010 January 18
18390     *
18391     *  @since Release 20101201
18392     *
18393     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18394     */
18395     public static double jauS00(double date1, double date2, double x, double y)
18396     {
18397     /* Time since J2000.0, in Julian centuries */
18398        double t;
18399 
18400     /* Miscellaneous */
18401        int i, j;
18402        double a, w0, w1, w2, w3, w4, w5;
18403 
18404     /* Fundamental arguments */
18405        double fa[] = new double[8];
18406 
18407     /* Returned value */
18408        double s;
18409 
18410     /* --------------------- */
18411     /* The series for s+XY/2 */
18412     /* --------------------- */
18413 
18414     /* Polynomial coefficients */
18415        final double sp[] = {
18416 
18417        /* 1-6 */
18418               94.00e-6,
18419             3808.35e-6,
18420             -119.94e-6,
18421           -72574.09e-6,
18422               27.70e-6,
18423               15.61e-6
18424        };
18425 
18426     /* Terms of order t^0 */
18427        final TERM s0[] = {
18428 
18429        /* 1-10 */
18430           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18431           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18432           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18433           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18434           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18435           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18436           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18437           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18438           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18439           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18440 
18441        /* 11-20 */
18442           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18443           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18444           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18445           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18446           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18447           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18448           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18449           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18450           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18451           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18452 
18453        /* 21-30 */
18454           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18455           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18456           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18457           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18458           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18459           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18460           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18461           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18462           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18463           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18464 
18465        /* 31-33 */
18466           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18467           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18468           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18469        };
18470 
18471     /* Terms of order t^1 */
18472        final TERM s1[] ={
18473 
18474        /* 1-3 */
18475           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18476           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.71e-6,  -0.03e-6 ),
18477           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18478        };
18479 
18480     /* Terms of order t^2 */
18481        final TERM s2[] ={
18482 
18483        /* 1-10 */
18484           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.53e-6,  -0.17e-6 ),
18485           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18486           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18487           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18488           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18489           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18490           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18491           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18492           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18493           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18494 
18495        /* 11-20 */
18496           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18497           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18498           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18499           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18500           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18501           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18502           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
18503           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
18504           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
18505           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
18506 
18507        /* 21-25 */
18508           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
18509           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
18510           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18511           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
18512           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18513        };
18514 
18515     /* Terms of order t^3 */
18516        final TERM s3[] ={
18517 
18518        /* 1-4 */
18519           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.51e-6 ),
18520           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.39e-6 ),
18521           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.24e-6 ),
18522           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.22e-6 )
18523        };
18524 
18525     /* Terms of order t^4 */
18526        final TERM s4[] ={
18527 
18528        /* 1-1 */
18529           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
18530        };
18531 
18532     /* Number of terms in the series */
18533        final int NS0 = s0.length;
18534        final int NS1 = s1.length;
18535        final int NS2 = s2.length;
18536        final int NS3 = s3.length;
18537        final int NS4 = s4.length;
18538 
18539     /*--------------------------------------------------------------------*/
18540 
18541     /* Interval between fundamental epoch J2000.0 and current date (JC). */
18542        t = ((date1 - DJ00) + date2) / DJC;
18543 
18544     /* Fundamental Arguments (from IERS Conventions 2003) */
18545 
18546     /* Mean anomaly of the Moon. */
18547        fa[0] = jauFal03(t);
18548 
18549     /* Mean anomaly of the Sun. */
18550        fa[1] = jauFalp03(t);
18551 
18552     /* Mean longitude of the Moon minus that of the ascending node. */
18553        fa[2] = jauFaf03(t);
18554 
18555     /* Mean elongation of the Moon from the Sun. */
18556        fa[3] = jauFad03(t);
18557 
18558     /* Mean longitude of the ascending node of the Moon. */
18559        fa[4] = jauFaom03(t);
18560 
18561     /* Mean longitude of Venus. */
18562        fa[5] = jauFave03(t);
18563 
18564     /* Mean longitude of Earth. */
18565        fa[6] = jauFae03(t);
18566 
18567     /* General precession in longitude. */
18568        fa[7] = jauFapa03(t);
18569 
18570     /* Evaluate s. */
18571        w0 = sp[0];
18572        w1 = sp[1];
18573        w2 = sp[2];
18574        w3 = sp[3];
18575        w4 = sp[4];
18576        w5 = sp[5];
18577 
18578        for (i = NS0-1; i >= 0; i--) {
18579        a = 0.0;
18580        for (j = 0; j < 8; j++) {
18581            a += (double)s0[i].nfa[j] * fa[j];
18582        }
18583        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
18584        }
18585 
18586        for (i = NS1-1; i >= 0; i--) {
18587        a = 0.0;
18588        for (j = 0; j < 8; j++) {
18589            a += (double)s1[i].nfa[j] * fa[j];
18590        }
18591        w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
18592        }
18593 
18594        for (i = NS2-1; i >= 0; i--) {
18595        a = 0.0;
18596        for (j = 0; j < 8; j++) {
18597            a += (double)s2[i].nfa[j] * fa[j];
18598        }
18599        w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
18600        }
18601 
18602        for (i = NS3-1; i >= 0; i--) {
18603        a = 0.0;
18604        for (j = 0; j < 8; j++) {
18605            a += (double)s3[i].nfa[j] * fa[j];
18606        }
18607        w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
18608        }
18609 
18610        for (i = NS4-1; i >= 0; i--) {
18611        a = 0.0;
18612        for (j = 0; j < 8; j++) {
18613            a += (double)s4[i].nfa[j] * fa[j];
18614        }
18615        w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
18616        }
18617 
18618        s = (w0 +
18619            (w1 +
18620            (w2 +
18621            (w3 +
18622            (w4 +
18623             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
18624 
18625        return s;
18626 
18627         }
18628     
18629 
18630     /**
18631     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18632     *  the equator of the Celestial Intermediate Pole, using the IAU 2000A
18633     *  precession-nutation model.
18634     *
18635     *<p>This function is derived from the International Astronomical Union's
18636     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18637     *
18638     *<p>Status:  support function.
18639     *
18640     *<!-- Given: -->
18641     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18642     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18643     *
18644     * <!-- Returned (function value): -->
18645     *  @return double    the CIO locator s in radians (Note 2)
18646     *
18647     * <p>Notes:
18648     * <ol>
18649     *
18650     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18651     *     convenient way between the two arguments.  For example,
18652     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18653     *     among others:
18654     *<pre>
18655     *            date1          date2
18656     *
18657     *         2450123.7           0.0       (JD method)
18658     *         2451545.0       -1421.3       (J2000 method)
18659     *         2400000.5       50123.2       (MJD method)
18660     *         2450123.5           0.2       (date &amp; time method)
18661     *</pre>
18662     *     The JD method is the most natural and convenient to use in
18663     *     cases where the loss of several decimal digits of resolution
18664     *     is acceptable.  The J2000 method is best matched to the way
18665     *     the argument is handled internally and will deliver the
18666     *     optimum resolution.  The MJD method and the date &amp; time methods
18667     *     are both good compromises between resolution and convenience.
18668     *
18669     * <li> The CIO locator s is the difference between the right ascensions
18670     *     of the same point in two systems.  The two systems are the GCRS
18671     *     and the CIP,CIO, and the point is the ascending node of the
18672     *     CIP equator.  The CIO locator s remains a small fraction of
18673     *     1 arcsecond throughout 1900-2100.
18674     *
18675     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18676     *     are the x and y components of the CIP unit vector;  this series
18677     *     is more compact than a direct series for s would be.  The present
18678     *     function uses the full IAU 2000A nutation model when predicting
18679     *     the CIP position.  Faster results, with no significant loss of
18680     *     accuracy, can be obtained via the function jauS00b, which uses
18681     *     instead the IAU 2000B truncated model.
18682     *</ol>
18683     *<p>Called:<ul>
18684     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
18685     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18686     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18687     * </ul>
18688     *<p>References:
18689     *
18690     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18691     *     "Expressions for the Celestial Intermediate Pole and Celestial
18692     *     Ephemeris Origin consistent with the IAU 2000A precession-
18693     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18694     *
18695     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18696     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18697     *
18698     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18699     *     IERS Technical Note No. 32, BKG (2004)
18700     *
18701     *@version 2010 January 18
18702     *
18703     *  @since Release 20101201
18704     *
18705     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18706     */
18707     public static double jauS00a(double date1, double date2)
18708     {
18709        double s;
18710 
18711 
18712     /* Bias-precession-nutation-matrix, IAU 2000A. */
18713        double rbpn[][] = jauPnm00a(date1, date2);
18714 
18715     /* Extract the CIP coordinates. */
18716        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18717 
18718     /* Compute the CIO locator s, given the CIP coordinates. */
18719        s = jauS00(date1, date2, cip.x, cip.y);
18720 
18721        return s;
18722 
18723         }
18724     
18725 
18726     /**
18727     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18728     *  the equator of the Celestial Intermediate Pole, using the IAU 2000B
18729     *  precession-nutation model.
18730     *
18731     *<p>This function is derived from the International Astronomical Union's
18732     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18733     *
18734     *<p>Status:  support function.
18735     *
18736     *<!-- Given: -->
18737     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18738     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18739     *
18740     * <!-- Returned (function value): -->
18741     *  @return double    the CIO locator s in radians (Note 2)
18742     *
18743     * <p>Notes:
18744     * <ol>
18745     *
18746     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18747     *     convenient way between the two arguments.  For example,
18748     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18749     *     among others:
18750     *<pre>
18751     *            date1          date2
18752     *
18753     *         2450123.7           0.0       (JD method)
18754     *         2451545.0       -1421.3       (J2000 method)
18755     *         2400000.5       50123.2       (MJD method)
18756     *         2450123.5           0.2       (date &amp; time method)
18757     *</pre>
18758     *     The JD method is the most natural and convenient to use in
18759     *     cases where the loss of several decimal digits of resolution
18760     *     is acceptable.  The J2000 method is best matched to the way
18761     *     the argument is handled internally and will deliver the
18762     *     optimum resolution.  The MJD method and the date &amp; time methods
18763     *     are both good compromises between resolution and convenience.
18764     *
18765     * <li> The CIO locator s is the difference between the right ascensions
18766     *     of the same point in two systems.  The two systems are the GCRS
18767     *     and the CIP,CIO, and the point is the ascending node of the
18768     *     CIP equator.  The CIO locator s remains a small fraction of
18769     *     1 arcsecond throughout 1900-2100.
18770     *
18771     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18772     *     are the x and y components of the CIP unit vector;  this series
18773     *     is more compact than a direct series for s would be.  The present
18774     *     function uses the IAU 2000B truncated nutation model when
18775     *     predicting the CIP position.  The function jauS00a uses instead
18776     *     the full IAU 2000A model, but with no significant increase in
18777     *     accuracy and at some cost in speed.
18778     *</ol>
18779     *<p>Called:<ul>
18780     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
18781     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18782     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18783     * </ul>
18784     *<p>References:
18785     *
18786     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18787     *     "Expressions for the Celestial Intermediate Pole and Celestial
18788     *     Ephemeris Origin consistent with the IAU 2000A precession-
18789     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18790     *
18791     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18792     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18793     *
18794     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18795     *     IERS Technical Note No. 32, BKG (2004)
18796     *
18797     *@version 2010 January 18
18798     *
18799     *  @since Release 20101201
18800     *
18801     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18802     */
18803     public static double jauS00b(double date1, double date2)
18804     {
18805        double rbpn[][] = new double[3][3], s;
18806 
18807 
18808     /* Bias-precession-nutation-matrix, IAU 2000B. */
18809        rbpn = jauPnm00b(date1, date2);
18810 
18811     /* Extract the CIP coordinates. */
18812        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18813 
18814     /* Compute the CIO locator s, given the CIP coordinates. */
18815        s = jauS00(date1, date2, cip.x, cip.y);
18816 
18817        return s;
18818 
18819         }
18820     
18821 
18822     /**
18823     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18824     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18825     *  coordinates.  Compatible with IAU 2006/2000A precession-nutation.
18826     *
18827     *<p>This function is derived from the International Astronomical Union's
18828     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18829     *
18830     *<p>Status:  canonical model.
18831     *
18832     *<!-- Given: -->
18833     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18834     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18835     *     @param x double     CIP coordinates (Note 3)
18836     *     @param y double     CIP coordinates (Note 3) 
18837     *
18838     * <!-- Returned (function value): -->
18839     *  @return double    the CIO locator s in radians (Note 2)
18840     *
18841     * <p>Notes:
18842     * <ol>
18843     *
18844     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18845     *     convenient way between the two arguments.  For example,
18846     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18847     *     among others:
18848     *<pre>
18849     *            date1          date2
18850     *
18851     *         2450123.7           0.0       (JD method)
18852     *         2451545.0       -1421.3       (J2000 method)
18853     *         2400000.5       50123.2       (MJD method)
18854     *         2450123.5           0.2       (date &amp; time method)
18855     *</pre>
18856     *     The JD method is the most natural and convenient to use in
18857     *     cases where the loss of several decimal digits of resolution
18858     *     is acceptable.  The J2000 method is best matched to the way
18859     *     the argument is handled internally and will deliver the
18860     *     optimum resolution.  The MJD method and the date &amp; time methods
18861     *     are both good compromises between resolution and convenience.
18862     *
18863     * <li> The CIO locator s is the difference between the right ascensions
18864     *     of the same point in two systems:  the two systems are the GCRS
18865     *     and the CIP,CIO, and the point is the ascending node of the
18866     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18867     *     throughout 1900-2100.
18868     *
18869     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18870     *     are the x and y components of the CIP unit vector;  this series
18871     *     is more compact than a direct series for s would be.  This
18872     *     function requires X,Y to be supplied by the caller, who is
18873     *     responsible for providing values that are consistent with the
18874     *     supplied date.
18875     *
18876     * <li> The model is consistent with the "P03" precession (Capitaine et
18877     *     al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the
18878     *     IAU 2000A nutation (with P03 adjustments).
18879     *</ol>
18880     *<p>Called:<ul>
18881     *     <li>{@link #jauFal03} mean anomaly of the Moon
18882     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18883     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18884     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18885     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18886     *     <li>{@link #jauFave03} mean longitude of Venus
18887     *     <li>{@link #jauFae03} mean longitude of Earth
18888     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18889     * </ul>
18890     *<p>References:
18891     *
18892     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003, Astron.
18893     *     Astrophys. 432, 355
18894     *
18895     *     <p>McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003),
18896     *     IERS Technical Note No. 32, BKG
18897     *
18898     *@version 2009 December 17
18899     *
18900     *  @since Release 20101201
18901     *
18902     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18903     */
18904     public static double jauS06(double date1, double date2, double x, double y)
18905     {
18906     /* Time since J2000.0, in Julian centuries */
18907        double t;
18908 
18909     /* Miscellaneous */
18910        int i, j;
18911        double a, w0, w1, w2, w3, w4, w5;
18912 
18913     /* Fundamental arguments */
18914        double fa[] = new double[8];
18915 
18916     /* Returned value */
18917        double s;
18918 
18919     /* --------------------- */
18920     /* The series for s+XY/2 */
18921     /* --------------------- */
18922 
18923     /* Polynomial coefficients */
18924        final double sp[] = {
18925 
18926        /* 1-6 */
18927               94.00e-6,
18928             3808.65e-6,
18929             -122.68e-6,
18930           -72574.11e-6,
18931               27.98e-6,
18932               15.62e-6
18933        };
18934 
18935     /* Terms of order t^0 */
18936        final TERM s0[] = {
18937 
18938        /* 1-10 */
18939           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18940           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18941           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18942           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18943           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18944           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18945           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18946           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18947           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18948           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18949 
18950        /* 11-20 */
18951           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18952           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18953           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18954           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18955           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18956           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18957           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18958           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18959           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18960           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18961 
18962        /* 21-30 */
18963           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18964           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18965           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18966           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18967           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18968           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18969           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18970           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18971           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18972           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18973 
18974        /* 31-33 */
18975           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18976           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18977           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18978        };
18979 
18980     /* Terms of order t^1 */
18981        final TERM s1[] = {
18982 
18983        /* 1 - 3 */
18984           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18985           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.73e-6,  -0.03e-6 ),
18986           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18987        };
18988 
18989     /* Terms of order t^2 */
18990        final TERM s2[] = {
18991 
18992        /* 1-10 */
18993           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.52e-6,  -0.17e-6 ),
18994           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18995           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18996           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18997           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18998           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18999           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
19000           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
19001           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
19002           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
19003 
19004        /* 11-20 */
19005           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
19006           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
19007           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
19008           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
19009           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
19010           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
19011           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
19012           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
19013           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
19014           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
19015 
19016        /* 21-25 */
19017           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
19018           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
19019           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
19020           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
19021           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
19022        };
19023 
19024     /* Terms of order t^3 */
19025        final TERM s3[] = {
19026 
19027        /* 1-4 */
19028           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.42e-6 ),
19029           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.46e-6 ),
19030           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.25e-6 ),
19031           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.23e-6 )
19032        };
19033 
19034     /* Terms of order t^4 */
19035        final TERM s4[] = {
19036 
19037        /* 1-1 */
19038           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
19039        };
19040 
19041     /* Number of terms in the series */
19042        final int NS0 = s0.length;
19043        final int NS1 = s1.length;
19044        final int NS2 = s2.length;
19045        final int NS3 = s3.length;
19046        final int NS4 = s4.length;
19047 
19048     /*--------------------------------------------------------------------*/
19049 
19050     /* Interval between fundamental epoch J2000.0 and current date (JC). */
19051        t = ((date1 - DJ00) + date2) / DJC;
19052 
19053     /* Fundamental Arguments (from IERS Conventions 2003) */
19054 
19055     /* Mean anomaly of the Moon. */
19056        fa[0] = jauFal03(t);
19057 
19058     /* Mean anomaly of the Sun. */
19059        fa[1] = jauFalp03(t);
19060 
19061     /* Mean longitude of the Moon minus that of the ascending node. */
19062        fa[2] = jauFaf03(t);
19063 
19064     /* Mean elongation of the Moon from the Sun. */
19065        fa[3] = jauFad03(t);
19066 
19067     /* Mean longitude of the ascending node of the Moon. */
19068        fa[4] = jauFaom03(t);
19069 
19070     /* Mean longitude of Venus. */
19071        fa[5] = jauFave03(t);
19072 
19073     /* Mean longitude of Earth. */
19074        fa[6] = jauFae03(t);
19075 
19076     /* General precession in longitude. */
19077        fa[7] = jauFapa03(t);
19078 
19079     /* Evaluate s. */
19080        w0 = sp[0];
19081        w1 = sp[1];
19082        w2 = sp[2];
19083        w3 = sp[3];
19084        w4 = sp[4];
19085        w5 = sp[5];
19086 
19087        for (i = NS0-1; i >= 0; i--) {
19088        a = 0.0;
19089        for (j = 0; j < 8; j++) {
19090           a += (double)s0[i].nfa[j] * fa[j];
19091        }
19092        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
19093        }
19094 
19095        for (i = NS1-1; i >= 0; i--) {
19096           a = 0.0;
19097           for (j = 0; j < 8; j++) {
19098              a += (double)s1[i].nfa[j] * fa[j];
19099           }
19100           w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
19101        }
19102 
19103        for (i = NS2-1; i >= 0; i--) {
19104           a = 0.0;
19105           for (j = 0; j < 8; j++) {
19106              a += (double)s2[i].nfa[j] * fa[j];
19107           }
19108           w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
19109        }
19110 
19111        for (i = NS3-1; i >= 0; i--) {
19112           a = 0.0;
19113           for (j = 0; j < 8; j++) {
19114              a += (double)s3[i].nfa[j] * fa[j];
19115           }
19116           w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
19117        }
19118 
19119        for (i = NS4-1; i >= 0; i--) {
19120           a = 0.0;
19121           for (j = 0; j < 8; j++) {
19122              a += (double)s4[i].nfa[j] * fa[j];
19123           }
19124           w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
19125        }
19126 
19127        s = (w0 +
19128            (w1 +
19129            (w2 +
19130            (w3 +
19131            (w4 +
19132             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
19133 
19134        return s;
19135 
19136         }
19137     
19138 
19139     /**
19140     *  The CIO locator s, positioning the Celestial Intermediate Origin on
19141     *  the equator of the Celestial Intermediate Pole, using the IAU 2006
19142     *  precession and IAU 2000A nutation models.
19143     *
19144     *<p>This function is derived from the International Astronomical Union's
19145     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19146     *
19147     *<p>Status:  support function.
19148     *
19149     *<!-- Given: -->
19150     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19151     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19152     *
19153     * <!-- Returned (function value): -->
19154     *  @return double    the CIO locator s in radians (Note 2)
19155     *
19156     * <p>Notes:
19157     * <ol>
19158     *
19159     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19160     *     convenient way between the two arguments.  For example,
19161     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19162     *     among others:
19163     *<pre>
19164     *            date1          date2
19165     *
19166     *         2450123.7           0.0       (JD method)
19167     *         2451545.0       -1421.3       (J2000 method)
19168     *         2400000.5       50123.2       (MJD method)
19169     *         2450123.5           0.2       (date &amp; time method)
19170     *</pre>
19171     *     The JD method is the most natural and convenient to use in
19172     *     cases where the loss of several decimal digits of resolution
19173     *     is acceptable.  The J2000 method is best matched to the way
19174     *     the argument is handled internally and will deliver the
19175     *     optimum resolution.  The MJD method and the date &amp; time methods
19176     *     are both good compromises between resolution and convenience.
19177     *
19178     * <li> The CIO locator s is the difference between the right ascensions
19179     *     of the same point in two systems.  The two systems are the GCRS
19180     *     and the CIP,CIO, and the point is the ascending node of the
19181     *     CIP equator.  The CIO locator s remains a small fraction of
19182     *     1 arcsecond throughout 1900-2100.
19183     *
19184     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
19185     *     are the x and y components of the CIP unit vector;  this series is
19186     *     more compact than a direct series for s would be.  The present
19187     *     function uses the full IAU 2000A nutation model when predicting
19188     *     the CIP position.
19189     *</ol>
19190     *<p>Called:<ul>
19191     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
19192     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
19193     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
19194     * </ul>
19195     *<p>References:
19196     *
19197     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
19198     *     "Expressions for the Celestial Intermediate Pole and Celestial
19199     *     Ephemeris Origin consistent with the IAU 2000A precession-
19200     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
19201     *
19202     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
19203     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
19204     *
19205     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
19206     *
19207     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
19208     *     IERS Technical Note No. 32, BKG
19209     *
19210     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
19211     *
19212     *@version 2010 January 18
19213     *
19214     *  @since Release 20101201
19215     *
19216     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19217     */
19218     public static double jauS06a(double date1, double date2)
19219     {
19220        double rnpb[][] = new double[3][3], s;
19221 
19222 
19223     /* Bias-precession-nutation-matrix, IAU 20006/2000A. */
19224        rnpb = jauPnm06a(date1, date2);
19225 
19226     /* Extract the CIP coordinates. */
19227        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
19228 
19229     /* Compute the CIO locator s, given the CIP coordinates. */
19230        s = jauS06(date1, date2, cip.x, cip.y);
19231 
19232        return s;
19233 
19234         }
19235     
19236 
19237     /**
19238     *  Convert spherical coordinates to Cartesian.
19239     *
19240     *<p>This function is derived from the International Astronomical Union's
19241     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19242     *
19243     *<p>Status:  vector/matrix support function.
19244     *
19245     *<!-- Given: -->
19246     *     @param theta     double        longitude angle (radians)
19247     *     @param phi       double        latitude angle (radians)
19248     *
19249     *<!-- Returned: -->
19250     *     @return c         double[3]      <u>returned</u> direction cosines
19251     *
19252     *@version 2008 October 28
19253     *
19254     *  @since Release 20101201
19255     *
19256     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19257     */
19258     public static double[] jauS2c(double theta, double phi )
19259     {
19260        double cp, c[] = new double[3];
19261 
19262 
19263        cp = cos(phi);
19264        c[0] = cos(theta) * cp;
19265        c[1] = sin(theta) * cp;
19266        c[2] = sin(phi);
19267 
19268        return c;
19269 
19270         }
19271     
19272 
19273     /**
19274     *  Convert spherical polar coordinates to p-vector.
19275     *
19276     *<p>This function is derived from the International Astronomical Union's
19277     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19278     *
19279     *<p>Status:  vector/matrix support function.
19280     *
19281     *<!-- Given: -->
19282     *     @param theta    double        longitude angle (radians)
19283     *     @param phi      double        latitude angle (radians)
19284     *     @param r        double        radial distance
19285     *
19286     *<!-- Returned: -->
19287     *     @return p        double[3]      <u>returned</u> Cartesian coordinates
19288     *
19289     *<p>Called:<ul>
19290     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19291     *     <li>{@link #jauSxp} multiply p-vector by scalar
19292     * </ul>
19293     *@version 2008 May 11
19294     *
19295     *  @since Release 20101201
19296     *
19297     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19298     */
19299     public static double[] jauS2p(double theta, double phi, double r )
19300     {
19301        double p[];
19302        double u[] = new double[3];
19303 
19304 
19305        u = jauS2c(theta,phi);
19306        p = jauSxp(r,u);
19307 
19308        return p;
19309 
19310         }
19311     
19312 
19313     /**
19314     *  Convert position/velocity from spherical to Cartesian coordinates.
19315     *
19316     *<p>This function is derived from the International Astronomical Union's
19317     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19318     *
19319     *<p>Status:  vector/matrix support function.
19320     *
19321     *<!-- Given: -->
19322     *     @param theta     double           longitude angle (radians)
19323     *     @param phi       double           latitude angle (radians)
19324     *     @param r         double           radial distance
19325     *     @param td        double           rate of change of theta
19326     *     @param pd        double           rate of change of phi
19327     *     @param rd        double           rate of change of r
19328     *
19329     *<!-- Returned: -->
19330     *     @return pv        double[2][3]      <u>returned</u> pv-vector
19331     *
19332     *@version 2008 May 25
19333     *
19334     *  @since Release 20101201
19335     *
19336     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19337     */
19338     public static double[][] jauS2pv(double theta, double phi, double r,
19339                  double td, double pd, double rd)
19340     {
19341        double pv[][] = new double[2][3];
19342        double st, ct, sp, cp, rcp, x, y, rpd, w;
19343 
19344 
19345        st = sin(theta);
19346        ct = cos(theta);
19347        sp = sin(phi);
19348        cp = cos(phi);
19349        rcp = r * cp;
19350        x = rcp * ct;
19351        y = rcp * st;
19352        rpd = r * pd;
19353        w = rpd*sp - cp*rd;
19354 
19355        pv[0][0] = x;
19356        pv[0][1] = y;
19357        pv[0][2] = r * sp;
19358        pv[1][0] = -y*td - w*ct;
19359        pv[1][1] =  x*td - w*st;
19360        pv[1][2] = rpd*cp + sp*rd;
19361 
19362        return pv;
19363 
19364         }
19365     
19366 
19367     /**
19368     *  Multiply a pv-vector by two scalars.
19369     *
19370     *<p>This function is derived from the International Astronomical Union's
19371     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19372     *
19373     *<p>Status:  vector/matrix support function.
19374     *
19375     *<!-- Given: -->
19376     *     @param s1      double          scalar to multiply position component by
19377     *     @param s2      double          scalar to multiply velocity component by
19378     *     @param pv      double[2][3]    pv-vector
19379     *
19380     *<!-- Returned: -->
19381     *     @return spv     double[2][3]     <u>returned</u> pv-vector: p scaled by s1, v scaled by s2
19382     *
19383     *  Note:
19384     *     It is permissible for pv and spv to be the same array.
19385     *
19386     *<p>Called:<ul>
19387     *     <li>{@link #jauSxp} multiply p-vector by scalar
19388     * </ul>
19389     *@version 2008 October 28
19390     *
19391     *  @since Release 20101201
19392     *
19393     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19394     */
19395     public static double[][] jauS2xpv(double s1, double s2, double pv[][])
19396     {
19397         double spv[][] = new double[2][3];
19398         spv[0] = jauSxp(s1, pv[0]);
19399         spv[1] =jauSxp(s2, pv[1]);
19400 
19401        return spv;
19402 
19403         }
19404     
19405 
19406     /**
19407     *  Angular separation between two p-vectors.
19408     *
19409     *<p>This function is derived from the International Astronomical Union's
19410     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19411     *
19412     *<p>Status:  vector/matrix support function.
19413     *
19414     *<!-- Given: -->
19415     *     @param a       double[3]     first p-vector (not necessarily unit length)
19416     *     @param b       double[3]     second p-vector (not necessarily unit length)
19417     *
19418     * <!-- Returned (function value): -->
19419     *  @return double       angular separation (radians, always positive)
19420     *
19421     * <p>Notes:
19422     * <ol>
19423     *
19424     * <li> If either vector is null, a zero result is returned.
19425     *
19426     * <li> The angular separation is most simply formulated in terms of
19427     *     scalar product.  However, this gives poor accuracy for angles
19428     *     near zero and pi.  The present algorithm uses both cross product
19429     *     and dot product, to deliver full accuracy whatever the size of
19430     *     the angle.
19431     *</ol>
19432     *<p>Called:<ul>
19433     *     <li>{@link #jauPxp} vector product of two p-vectors
19434     *     <li>{@link #jauPm} modulus of p-vector
19435     *     <li>{@link #jauPdp} scalar product of two p-vectors
19436     * </ul>
19437     *@version 2008 May 22
19438     *
19439     *  @since Release 20101201
19440     *
19441     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19442     */
19443     public static double jauSepp(double a[] , double b[] )
19444     {
19445        double axb[] = new double[3], ss, cs, s;
19446 
19447 
19448     /* Sine of angle between the vectors, multiplied by the two moduli. */
19449        axb = jauPxp(a,b);
19450        ss = jauPm(axb);
19451 
19452     /* Cosine of the angle, multiplied by the two moduli. */
19453        cs = jauPdp(a, b);
19454 
19455     /* The angle. */
19456        s = ((ss != 0.0) || (cs != 0.0)) ? atan2(ss, cs) : 0.0;
19457 
19458        return s;
19459 
19460         }
19461     
19462 
19463     /**
19464     *  Angular separation between two sets of spherical coordinates.
19465     *
19466     *<p>This function is derived from the International Astronomical Union's
19467     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19468     *
19469     *<p>Status:  vector/matrix support function.
19470     *
19471     *<!-- Given: -->
19472     *     @param al      double        first longitude (radians)
19473     *     @param ap      double        first latitude (radians)
19474     *     @param bl      double        second longitude (radians)
19475     *     @param bp      double        second latitude (radians)
19476     *
19477     * <!-- Returned (function value): -->
19478     *  @return double       angular separation (radians)
19479     *
19480     *<p>Called:<ul>
19481     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19482     *     <li>{@link #jauSepp} angular separation between two p-vectors
19483     * </ul>
19484     *@version 2008 May 16
19485     *
19486     *  @since Release 20101201
19487     *
19488     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19489     */
19490     public static double jauSeps(double al, double ap, double bl, double bp)
19491     {
19492        double ac[] = new double[3], bc[] = new double[3], s;
19493 
19494 
19495     /* Spherical to Cartesian. */
19496        ac = jauS2c(al,ap);
19497        bc = jauS2c(bl,bp);
19498 
19499     /* Angle between the vectors. */
19500        s = jauSepp(ac, bc);
19501 
19502        return s;
19503 
19504         }
19505     
19506 
19507     /**
19508     *  The TIO locator s', positioning the Terrestrial Intermediate Origin
19509     *  on the equator of the Celestial Intermediate Pole.
19510     *
19511     *<p>This function is derived from the International Astronomical Union's
19512     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19513     *
19514     *<p>Status:  canonical model.
19515     *
19516     *<!-- Given: -->
19517     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19518     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19519     *
19520     * <!-- Returned (function value): -->
19521     *  @return double    the TIO locator s' in radians (Note 2)
19522     *
19523     * <p>Notes:
19524     * <ol>
19525     *
19526     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19527     *     convenient way between the two arguments.  For example,
19528     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19529     *     among others:
19530     *<pre>
19531     *            date1          date2
19532     *
19533     *         2450123.7           0.0       (JD method)
19534     *         2451545.0       -1421.3       (J2000 method)
19535     *         2400000.5       50123.2       (MJD method)
19536     *         2450123.5           0.2       (date &amp; time method)
19537     *</pre>
19538     *     The JD method is the most natural and convenient to use in
19539     *     cases where the loss of several decimal digits of resolution
19540     *     is acceptable.  The J2000 method is best matched to the way
19541     *     the argument is handled internally and will deliver the
19542     *     optimum resolution.  The MJD method and the date &amp; time methods
19543     *     are both good compromises between resolution and convenience.
19544     *
19545     * <li> The TIO locator s' is obtained from polar motion observations by
19546     *     numerical integration, and so is in essence unpredictable.
19547     *     However, it is dominated by a secular drift of about
19548     *     47 microarcseconds per century, which is the approximation
19549     *     evaluated by the present function.
19550     *</ol>
19551     *<p>Reference:
19552     *
19553     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
19554     *     IERS Technical Note No. 32, BKG (2004)
19555     *
19556     *@version 2008 May 24
19557     *
19558     *  @since Release 20101201
19559     *
19560     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19561     */
19562     public static double jauSp00(double date1, double date2)
19563     {
19564        double t, sp;
19565 
19566 
19567     /* Interval between fundamental epoch J2000.0 and current date (JC). */
19568        t = ((date1 - DJ00) + date2) / DJC;
19569 
19570     /* Approximate s'. */
19571        sp = -47e-6 * t * DAS2R;
19572 
19573        return sp;
19574 
19575         }
19576     
19577 
19578     /**
19579     *  Star proper motion:  update star catalog data for space motion.
19580     *
19581     *<p>This function is derived from the International Astronomical Union's
19582     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19583     *
19584     *<p>Status:  support function.
19585     *
19586     *<!-- Given: -->
19587     *     @param ra1     double      right ascension (radians), before
19588     *     @param dec1    double      declination (radians), before
19589     *     @param pmr1    double      RA proper motion (radians/year), before
19590     *     @param pmd1    double      Dec proper motion (radians/year), before
19591     *     @param px1     double      parallax (arcseconds), before
19592     *     @param rv1     double      radial velocity (km/s, +ve = receding), before
19593     *     @param ep1a    double      "before" epoch, part A (Note 1)
19594     *     @param ep1b    double      "before" epoch, part B (Note 1)
19595     *     @param ep2a    double      "after" epoch, part A (Note 1)
19596     *     @param ep2b    double      "after" epoch, part B (Note 1)
19597     *
19598     *<!-- Returned: -->
19599     *     @return ra2     double       <u>returned</u> right ascension (radians), after
19600     *             dec2    double       <u>returned</u> declination (radians), after
19601     *             pmr2    double       <u>returned</u> RA proper motion (radians/year), after
19602     *             pmd2    double       <u>returned</u> Dec proper motion (radians/year), after
19603     *             px2     double       <u>returned</u> parallax (arcseconds), after
19604     *             rv2     double       <u>returned</u> radial velocity (km/s, +ve = receding), after
19605     *
19606     * <!-- Returned (function value): -->
19607     *  @return int        status:
19608     *                          -1 = system error (should not occur)
19609     *                           0 = no warnings or errors
19610     *                           1 = distance overridden (Note 6)
19611     *                           2 = excessive velocity (Note 7)
19612     *                           4 = solution didn't converge (Note 8)
19613     *                        else = binary logical OR of the above warnings
19614     *FIXME need to return the status as well.
19615     * <p>Notes:
19616     * <ol>
19617     *
19618     * <li> The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are
19619     *     Julian Dates, apportioned in any convenient way between the two
19620     *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
19621     *     expressed in any of these ways, among others:
19622     *<pre>
19623     *             epna          epnb
19624     *
19625     *         2450123.7           0.0       (JD method)
19626     *         2451545.0       -1421.3       (J2000 method)
19627     *         2400000.5       50123.2       (MJD method)
19628     *         2450123.5           0.2       (date &amp; time method)
19629     *</pre>
19630     *     The JD method is the most natural and convenient to use in
19631     *     cases where the loss of several decimal digits of resolution
19632     *     is acceptable.  The J2000 method is best matched to the way
19633     *     the argument is handled internally and will deliver the
19634     *     optimum resolution.  The MJD method and the date &amp; time methods
19635     *     are both good compromises between resolution and convenience.
19636     *
19637     * <li> In accordance with normal star-catalog conventions, the object's
19638     *     right ascension and declination are freed from the effects of
19639     *     secular aberration.  The frame, which is aligned to the catalog
19640     *     equator and equinox, is Lorentzian and centered on the SSB.
19641     *
19642     *     The proper motions are the rate of change of the right ascension
19643     *     and declination at the catalog epoch and are in radians per TDB
19644     *     Julian year.
19645     *
19646     *     The parallax and radial velocity are in the same frame.
19647     *
19648     * <li> Care is needed with units.  The star coordinates are in radians
19649     *     and the proper motions in radians per Julian year, but the
19650     *     parallax is in arcseconds.
19651     *
19652     * <li> The RA proper motion is in terms of coordinate angle, not true
19653     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19654     *     motions, the RA proper motion will need to be divided by cos(Dec)
19655     *     before use.
19656     *
19657     * <li> Straight-line motion at constant speed, in the inertial frame,
19658     *     is assumed.
19659     *
19660     * <li> An extremely small (or zero or negative) parallax is interpreted
19661     *     to mean that the object is on the "celestial sphere", the radius
19662     *     of which is an arbitrary (large) value (see the jauStarpv
19663     *     function for the value used).  When the distance is overridden in
19664     *     this way, the status, initially zero, has 1 added to it.
19665     *
19666     * <li> If the space velocity is a significant fraction of c (see the
19667     *     constant VMAX in the function jauStarpv),  it is arbitrarily set
19668     *     to zero.  When this action occurs, 2 is added to the status.
19669     *
19670     * <li> The relativistic adjustment carried out in the jauStarpv function
19671     *     involves an iterative calculation.  If the process fails to
19672     *     converge within a set number of iterations, 4 is added to the
19673     *     status.
19674     *</ol>
19675     *<p>Called:<ul>
19676     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
19677     *     <li>{@link #jauPvu} update a pv-vector
19678     *     <li>{@link #jauPdp} scalar product of two p-vectors
19679     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
19680     * </ul>
19681     *@version 2008 May 16
19682     *
19683     *  @since Release 20101201
19684     *
19685     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19686     */
19687     public static CatalogCoords jauStarpm(double ra1, double dec1,
19688                   double pmr1, double pmd1, double px1, double rv1,
19689                   double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
19690     {
19691        double pv1[][] = new double[2][3], tl1, dt, pv[][] = new double[2][3], r2, rdv, v2, c2mv2, tl2,
19692               pv2[][] = new double[2][3];
19693        jauStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
19694 
19695     /* Light time when observed (days). */
19696        tl1 = jauPm(pv1[0]) / DC;
19697 
19698     /* Time interval, "before" to "after" (days). */
19699        dt = (ep2a - ep1a) + (ep2b - ep1b);
19700 
19701     /* Move star along track from the "before" observed position to the */
19702     /* "after" geometric position. */
19703        pv = jauPvu(dt + tl1, pv1);
19704 
19705     /* From this geometric position, deduce the observed light time (days) */
19706     /* at the "after" epoch (with theoretically unneccessary error check). */
19707        r2 = jauPdp(pv[0], pv[0]);
19708        rdv = jauPdp(pv[0], pv[1]);
19709        v2 = jauPdp(pv[1], pv[1]);
19710        c2mv2 = DC*DC - v2;
19711        if (c2mv2 <=  0) throw new JSOFAInternalError("internal error", -1);
19712        tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
19713 
19714     /* Move the position along track from the observed place at the */
19715     /* "before" epoch to the observed place at the "after" epoch. */
19716        pv2 =jauPvu(dt + (tl1 - tl2), pv1 );
19717 
19718     /* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */
19719        CatalogCoords cat = jauPvstar(pv2);
19720 
19721        return cat;
19722 
19723         }
19724     
19725 
19726     /**
19727     *  Convert star catalog coordinates to position+velocity vector.
19728     *
19729     *<p>This function is derived from the International Astronomical Union's
19730     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19731     *
19732     *<p>Status:  support function.
19733     *
19734     *  Given (Note 1):
19735     *   @param  ra     double        right ascension (radians)
19736     *   @param  dec    double        declination (radians)
19737     *   @param  pmr    double        RA proper motion (radians/year)
19738     *   @param  pmd    double        Dec proper motion (radians/year)
19739     *   @param  px     double        parallax (arcseconds)
19740     *   @param  rv     double        radial velocity (km/s, positive = receding)
19741     *
19742     *  Returned (Note 2):
19743     *   @param  pv     double[2][3]  pv-vector (au, au/day)
19744     *
19745     * <!-- Returned (function value): -->
19746     *  @return int           status:
19747     *                              0 = no warnings
19748     *                              1 = distance overridden (Note 6)
19749     *                              2 = excessive speed (Note 7)
19750     *                              4 = solution didn't converge (Note 8)
19751     *                           else = binary logical OR of the above
19752     *
19753     * <p>Notes:
19754     * <ol>
19755     *
19756     * <li> The star data accepted by this function are "observables" for an
19757     *     imaginary observer at the solar-system barycenter.  Proper motion
19758     *     and radial velocity are, strictly, in terms of barycentric
19759     *     coordinate time, TCB.  For most practical applications, it is
19760     *     permissible to neglect the distinction between TCB and ordinary
19761     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
19762     *     limited by the intrinsic accuracy of the proper-motion and
19763     *     radial-velocity data;  moreover, the pv-vector is likely to be
19764     *     merely an intermediate result, so that a change of time unit
19765     *     would cancel out overall.
19766     *
19767     *     In accordance with normal star-catalog conventions, the object's
19768     *     right ascension and declination are freed from the effects of
19769     *     secular aberration.  The frame, which is aligned to the catalog
19770     *     equator and equinox, is Lorentzian and centered on the SSB.
19771     *
19772     * <li> The resulting position and velocity pv-vector is with respect to
19773     *     the same frame and, like the catalog coordinates, is freed from
19774     *     the effects of secular aberration.  Should the "coordinate
19775     *     direction", where the object was located at the catalog epoch, be
19776     *     required, it may be obtained by calculating the magnitude of the
19777     *     position vector pv[0][0-2] dividing by the speed of light in
19778     *     au/day to give the light-time, and then multiplying the space
19779     *     velocity pv[1][0-2] by this light-time and adding the result to
19780     *     pv[0][0-2].
19781     *
19782     *     Summarizing, the pv-vector returned is for most stars almost
19783     *     identical to the result of applying the standard geometrical
19784     *     "space motion" transformation.  The differences, which are the
19785     *     subject of the Stumpff paper referenced below, are:
19786     *
19787     *     (i) In stars with significant radial velocity and proper motion,
19788     *     the constantly changing light-time distorts the apparent proper
19789     *     motion.  Note that this is a classical, not a relativistic,
19790     *     effect.
19791     *
19792     *     (ii) The transformation complies with special relativity.
19793     *
19794     * <li> Care is needed with units.  The star coordinates are in radians
19795     *     and the proper motions in radians per Julian year, but the
19796     *     parallax is in arcseconds; the radial velocity is in km/s, but
19797     *     the pv-vector result is in au and au/day.
19798     *
19799     * <li> The RA proper motion is in terms of coordinate angle, not true
19800     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19801     *     motions, the RA proper motion will need to be divided by cos(Dec)
19802     *     before use.
19803     *
19804     * <li> Straight-line motion at constant speed, in the inertial frame,
19805     *     is assumed.
19806     *
19807     * <li> An extremely small (or zero or negative) parallax is interpreted
19808     *     to mean that the object is on the "celestial sphere", the radius
19809     *     of which is an arbitrary (large) value (see the constant PXMIN).
19810     *     When the distance is overridden in this way, the status,
19811     *     initially zero, has 1 added to it.
19812     *
19813     * <li> If the space velocity is a significant fraction of c (see the
19814     *     constant VMAX), it is arbitrarily set to zero.  When this action
19815     *     occurs, 2 is added to the status.
19816     *
19817     * <li> The relativistic adjustment involves an iterative calculation.
19818     *     If the process fails to converge within a set number (IMAX) of
19819     *     iterations, 4 is added to the status.
19820     *
19821     * <li> The inverse transformation is performed by the function
19822     *     jauPvstar.
19823     *</ol>
19824     *<p>Called:<ul>
19825     *     <li>{@link #jauS2pv} spherical coordinates to pv-vector
19826     *     <li>{@link #jauPm} modulus of p-vector
19827     *     <li>{@link #jauZp} zero p-vector
19828     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
19829     *     <li>{@link #jauPdp} scalar product of two p-vectors
19830     *     <li>{@link #jauSxp} multiply p-vector by scalar
19831     *     <li>{@link #jauPmp} p-vector minus p-vector
19832     *     <li>{@link #jauPpp} p-vector plus p-vector
19833     * </ul>
19834     *<p>Reference:
19835     *
19836     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
19837     *
19838     *@version 2009 July 6
19839     *
19840     *  @since Release 20101201
19841     *
19842     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19843     */
19844     public static int jauStarpv(double ra, double dec,
19845                   double pmr, double pmd, double px, double rv,
19846                   double pv[][])
19847     {
19848     /* Smallest allowed parallax */
19849        final double PXMIN = 1e-7;
19850 
19851     /* Largest allowed speed (fraction of c) */
19852        final double VMAX = 0.5;
19853 
19854     /* Maximum number of iterations for relativistic solution */
19855        final int IMAX = 100;
19856 
19857        int i, iwarn;
19858        double w, r, rd, rad, decd, v, x[] = new double[3], usr[] = new double[3], ust[] = new double[3],
19859               vsr, vst, betst, betsr, bett, betr,
19860               dd, ddel, ur[] = new double[3], ut[] = new double[3],
19861               d = 0.0, del = 0.0,       /* to prevent */
19862               odd = 0.0, oddel = 0.0,   /* compiler   */
19863               od = 0.0, odel = 0.0;     /* warnings   */
19864 
19865 
19866     /* Distance (au). */
19867        if (px >= PXMIN) {
19868           w = px;
19869           iwarn = 0;
19870        } else {
19871           w = PXMIN;
19872           iwarn = 1;
19873        }
19874        r = DR2AS / w;
19875 
19876     /* Radial velocity (au/day). */
19877        rd = DAYSEC * rv * 1e3 / DAU;
19878 
19879     /* Proper motion (radian/day). */
19880        rad = pmr / DJY;
19881        decd = pmd / DJY;
19882 
19883     /* To pv-vector (au,au/day). */
19884        double[][] pvt = jauS2pv(ra, dec, r, rad, decd, rd);
19885        jauCpv(pvt,pv);
19886 
19887     /* If excessive velocity, arbitrarily set it to zero. */
19888        v = jauPm(pv[1]);
19889        if (v / DC > VMAX) {
19890           jauZp(pv[1]);
19891           iwarn += 2;
19892        }
19893 
19894     /* Isolate the radial component of the velocity (au/day). */
19895        NormalizedVector nv = jauPn(pv[0]);
19896        w = nv.r;
19897        x = nv.u;
19898        vsr = jauPdp(x, pv[1]);
19899        usr = jauSxp(vsr,x);
19900 
19901     /* Isolate the transverse component of the velocity (au/day). */
19902        ust = jauPmp(pv[1], usr);
19903        vst = jauPm(ust);
19904 
19905     /* Special-relativity dimensionless parameters. */
19906        betsr = vsr / DC;
19907        betst = vst / DC;
19908 
19909     /* Determine the inertial-to-observed relativistic correction terms. */
19910        bett = betst;
19911        betr = betsr;
19912        for (i = 0; i < IMAX; i++) {
19913           d = 1.0 + betr;
19914           del = sqrt(1.0 - betr*betr - bett*bett) - 1.0;
19915           betr = d * betsr + del;
19916           bett = d * betst;
19917           if (i > 0) {
19918              dd = abs(d - od);
19919              ddel = abs(del - odel);
19920              if ((i > 1) && (dd >= odd) && (ddel >= oddel)) break;
19921              odd = dd;
19922              oddel = ddel;
19923           }
19924           od = d;
19925           odel = del;
19926        }
19927        if (i >= IMAX) iwarn += 4;
19928 
19929     /* Replace observed radial velocity with inertial value. */
19930        w = (betsr != 0.0) ? d + del / betsr : 1.0;
19931        ur = jauSxp(w,usr);
19932 
19933     /* Replace observed tangential velocity with inertial value. */
19934        ut = jauSxp(d,ust);
19935 
19936     /* Combine the two to obtain the inertial space velocity. */
19937        pv[1] = jauPpp(ur, ut);
19938        
19939     /* Return the status. */
19940        return iwarn;
19941 
19942         }
19943     
19944 
19945     /**
19946     *  Multiply a p-vector by a scalar.
19947     *
19948     *<p>This function is derived from the International Astronomical Union's
19949     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19950     *
19951     *<p>Status:  vector/matrix support function.
19952     *
19953     *<!-- Given: -->
19954     *     @param s       double         scalar
19955     *     @param p       double[3]      p-vector
19956     *
19957     *<!-- Returned: -->
19958     *     @return sp      double[3]       <u>returned</u> s * p
19959     *
19960     * 
19961     *
19962     *@version 2008 October 28
19963     *
19964     *  @since Release 20101201
19965     *
19966     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19967     */
19968     public static  double[] jauSxp(double s, double p[])
19969     {
19970        double sp[] = new double[3];
19971        sp[0] = s * p[0];
19972        sp[1] = s * p[1];
19973        sp[2] = s * p[2];
19974 
19975        return sp;
19976 
19977         }
19978     
19979 
19980     /**
19981     *  Multiply a pv-vector by a scalar.
19982     *
19983     *<p>This function is derived from the International Astronomical Union's
19984     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19985     *
19986     *<p>Status:  vector/matrix support function.
19987     *
19988     *<!-- Given: -->
19989     *     @param s        double           scalar
19990     *     @param pv       double[2][3]     pv-vector
19991     *
19992     *<!-- Returned: -->
19993     *     @return spv      double[2][3]      <u>returned</u> s * pv
19994     *
19995     *  Note:
19996     *     It is permissible for pv and psv to be the same array
19997     *
19998     *<p>Called:<ul>
19999     *     <li>{@link #jauS2xpv} multiply pv-vector by two scalars
20000     * </ul>
20001     *@version 2008 October 28
20002     *
20003     *  @since Release 20101201
20004     *
20005     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20006     */
20007     public static double[][] jauSxpv(double s, double pv[][])
20008     {
20009         double spv[][];
20010         spv = jauS2xpv(s, s, pv);
20011 
20012        return spv;
20013 
20014         }
20015 
20016     /**
20017      *
20018      *  Time scale transformation:  International Atomic Time, TAI, to
20019      *  Terrestrial Time, TT.
20020      *
20021      * <p>This function is derived from the International Astronomical Union's
20022      *  SOFA (Standards of Fundamental Astronomy) software collection.
20023      *
20024      *<p>Status:  canonical.
20025      *
20026      *<!-- Given: -->
20027      *  @param tai1 double    TAI as a 2-part Julian Date
20028      *  @param tai2 double    TAI as a 2-part Julian Date 
20029      *
20030      *<!-- Returned:-->
20031      *     @return JulianDate   TT as a 2-part Julian Date
20032      *
20033      *
20034      *  Note:
20035      *
20036      *     tai1+tai2 is Julian Date, apportioned in any convenient way
20037      *     between the two arguments, for example where tai1 is the Julian
20038      *     Day Number and tai2 is the fraction of a day.  The returned
20039      *     tt1,tt2 follow suit.
20040      *
20041      *<p>References:
20042      *
20043      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20044      *     IERS Technical Note No. 32, BKG (2004)
20045      *
20046      *     Explanatory Supplement to the Astronomical Almanac,
20047      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20048      *
20049      *@version 2010 May 16
20050      *
20051      *@since SOFA release 2010-12-01
20052      *
20053      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20054      */
20055     public static JulianDate jauTaitt(double tai1, double tai2)
20056     {
20057 
20058         double tt1, tt2;
20059         /* TT minus TAI (days). */
20060         final double dtat = TTMTAI / DAYSEC;
20061 
20062         /* Result, safeguarding precision. */
20063         
20064         if ( abs(tai1) > abs(tai2) ) {
20065             tt1 = tai1;
20066             tt2 = tai2 + dtat;
20067         } else {
20068             tt1 = tai1 + dtat;
20069             tt2 = tai2;
20070         }
20071 
20072 
20073         return new JulianDate(tt1, tt2);
20074     };   
20075 
20076     /**
20077      *
20078      *  Time scale transformation:  International Atomic Time, TAI, to
20079      *  Universal Time, UT1.
20080      *
20081      * <p>This function is derived from the International Astronomical Union's
20082      *  SOFA (Standards of Fundamental Astronomy) software collection.
20083      *
20084      *<p>Status:  canonical.
20085      *
20086      *<!-- Given: -->
20087      *  @param tai1 double    TAI as a 2-part Julian Date
20088      *  @param tai2 double    TAI as a 2-part Julian Date 
20089      *  @param   dta        double    UT1-TAI in seconds
20090      *
20091      *<!-- Returned:-->
20092      *  @return      UT1 as a 2-part Julian Date
20093      *
20094      *
20095      *<p>Notes:
20096      *  <ol>
20097      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
20098      *     between the two arguments, for example where tai1 is the Julian
20099      *     Day Number and tai2 is the fraction of a day.  The returned
20100      *     UT11,UT12 follow suit.
20101      *
20102      *  <li>  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
20103      *     available from IERS tabulations.
20104      *  </ol>
20105      *  Reference:
20106      *
20107      *     Explanatory Supplement to the Astronomical Almanac,
20108      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20109      *
20110      *@version 2010 May 16
20111      *
20112      *@since SOFA release 2010-12-01
20113      *
20114      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20115      *
20116      */
20117     public static JulianDate jauTaiut1(double tai1, double tai2, double dta)
20118 
20119     {
20120         double dtad,ut11, ut12;
20121 
20122 
20123         /* Result, safeguarding precision. */
20124         dtad = dta / DAYSEC;
20125         if ( abs(tai1) > abs(tai2) ) {
20126             ut11 = tai1;
20127             ut12 = tai2 + dtad;
20128         } else {
20129             ut11 = tai1 + dtad;
20130             ut12 = tai2;
20131         }
20132 
20133         return new JulianDate(ut11, ut12);
20134     };   
20135 
20136     /**
20137      *
20138      *  Time scale transformation:  International Atomic Time, TAI, to
20139      *  Coordinated Universal Time, UTC.
20140      *
20141      * <p>This function is derived from the International Astronomical Union's
20142      *  SOFA (Standards of Fundamental Astronomy) software collection.
20143      *
20144      *<p>Status:  canonical.
20145      *
20146      *<!-- Given: -->
20147      *  @param tai1 TAI as a 2-part Julian Date (Note 1)
20148      *  @param tai2 TAI as a 2-part Julian Date (Note 1) 
20149      *
20150      *<!-- Returned:-->
20151      *  @return   UTC as a 2-part quasi Julian Date (Notes 1-3)
20152      *
20153      *  Returned (function value):
20154      *                int      status: +1 = dubious year (Note 4)
20155      *                                  0 = OK
20156      *                                 -1 = unacceptable date
20157      *
20158      *<p>Notes:</p>
20159      * <ol>
20160      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
20161      *     between the two arguments, for example where tai1 is the Julian
20162      *     Day Number and tai2 is the fraction of a day.  The returned utc1
20163      *     and utc2 form an analogous pair, except that a special convention
20164      *     is used, to deal with the problem of leap seconds - see the next
20165      *     note.
20166      *
20167      *  <li> JD cannot unambiguously represent UTC during a leap second unless
20168      *     special measures are taken.  The convention in the present
20169      *     function is that the JD day represents UTC days whether the
20170      *     length is 86399, 86400 or 86401 SI seconds.
20171      *
20172      *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
20173      *     into calendar date and clock time, including UTC leap second
20174      *     handling.
20175      *
20176      *  <li> The warning status "dubious year" flags UTCs that predate the
20177      *     introduction of the time scale and that are too far in the future
20178      *     to be trusted.  See jauDat for further details.
20179      *  </ol>
20180      *  Called:
20181      *  <ul>
20182      *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
20183      *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
20184      *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
20185      *</ul>
20186      *<p>References:
20187      *
20188      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20189      *     IERS Technical Note No. 32, BKG (2004)
20190      *
20191      *     Explanatory Supplement to the Astronomical Almanac,
20192      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20193      *
20194      *@version 2010 May 16
20195      *
20196      *@since SOFA release 2010-12-01
20197      *
20198      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20199      * @throws JSOFAIllegalParameter 
20200      * @throws JSOFAInternalError an internal error has occured
20201      */
20202     public static JulianDate jauTaiutc(double tai1, double tai2) throws JSOFAIllegalParameter, JSOFAInternalError
20203     {
20204         boolean big1;
20205         int i;
20206         double a1, a2,dats1, ddats, dats2, datd = 0.0, as1, as2, da, d1, d2, fd;
20207         double utc1, utc2;
20208 
20209 
20210         /* Put the two parts of the TAI into big-first order. */
20211         big1 = ( abs(tai1) >= abs(tai2) );
20212         if ( big1 ) {
20213             a1 = tai1;
20214             a2 = tai2;
20215         } else {
20216             a1 = tai2;
20217             a2 = tai1;
20218         }
20219 
20220         /* See if the TAI can possibly be in a leap-second day. */
20221         d1 = a1;
20222         dats1 = 0.0;
20223         for ( i = -1; i <= 3; i++ ) {
20224             d2 = a2 + (double) i;
20225             Calendar dt;
20226             dt = jauJd2cal(d1, d2 );
20227             dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
20228 //FIXME            if ( js < 0 ) return -1;
20229             if ( i == -1 ) dats1 = dats2;
20230             ddats = dats2 - dats1;
20231             datd = dats1 / DAYSEC;
20232             if ( abs(ddats) >= 0.5 ) {
20233 
20234                 /* Yes.  Get TAI for the start of the UTC day that */
20235                 /* ends in a leap. */
20236                 JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
20237                 d1 = jd.djm0; d2 = jd.djm1;
20238                 as1 = d1;
20239                 as2 = d2 - 1.0 + datd;
20240 
20241                 /* Is the TAI after this point? */
20242                 da = a1 - as1;
20243                 da = da + ( a2 - as2 );
20244                 if ( da > 0 ) {
20245 
20246                     /* Yes:  fraction of the current UTC day that has elapsed. */
20247                     fd = da * DAYSEC / ( DAYSEC + ddats );
20248 
20249                     /* Ramp TAI-UTC to bring about SOFA's JD(UTC) convention. */
20250                     datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / DAYSEC;
20251                 }
20252 
20253                 /* Done. */
20254                 break;
20255             }
20256             dats1 = dats2;
20257         }
20258 
20259         /* Subtract the (possibly adjusted) TAI-UTC from TAI to give UTC. */
20260         a2 -= datd;
20261 
20262         /* Return the UTC result, preserving the TAI order. */
20263         if ( big1 ) {
20264             utc1 = a1;
20265             utc2 = a2;
20266         } else {
20267             utc1 = a2;
20268             utc2 = a1;
20269         }
20270 
20271         /* TODO Status */
20272         return new JulianDate(utc1, utc2);
20273 
20274     };
20275 
20276     /**
20277      *
20278      *  Time scale transformation:  Barycentric Coordinate Time, TCB, to
20279      *  Barycentric Dynamical Time, TDB.
20280      *
20281      * <p>This function is derived from the International Astronomical Union's
20282      *  SOFA (Standards of Fundamental Astronomy) software collection.
20283      *
20284      *<p>Status:  canonical.
20285      *
20286      *<!-- Given: -->
20287      *   @param tcb1 double    TCB as a 2-part Julian Date
20288      *   @param tcb2 double    TCB as a 2-part Julian Date 
20289      *
20290      *<!-- Returned:-->
20291      *   @return    TDB as a 2-part Julian Date
20292      *
20293      *
20294      *<p>Notes:
20295      *  <ol>
20296      * <li>  tcb1+tcb2 is Julian Date, apportioned in any convenient way
20297      *     between the two arguments, for example where tcb1 is the Julian
20298      *     Day Number and tcb2 is the fraction of a day.  The returned
20299      *     tdb1,tdb2 follow suit.
20300      *
20301      * <li>  The 2006 IAU General Assembly introduced a conventional linear
20302      *     transformation between TDB and TCB.  This transformation
20303      *     compensates for the drift between TCB and terrestrial time TT,
20304      *     and keeps TDB approximately centered on TT.  Because the
20305      *     relationship between TT and TCB depends on the adopted solar
20306      *     system ephemeris, the degree of alignment between TDB and TT over
20307      *     long intervals will vary according to which ephemeris is used.
20308      *     Former definitions of TDB attempted to avoid this problem by
20309      *     stipulating that TDB and TT should differ only by periodic
20310      *     effects.  This is a good description of the nature of the
20311      *     relationship but eluded precise mathematical formulation.  The
20312      *     conventional linear relationship adopted in 2006 sidestepped
20313      *     these difficulties whilst delivering a TDB that in practice was
20314      *     consistent with values before that date.
20315      *
20316      *  <li>  TDB is essentially the same as Teph, the time argument for the
20317      *     JPL solar system ephemerides.
20318      * </ol>
20319      *  Reference:
20320      *
20321      *     IAU 2006 Resolution B3
20322      *
20323      *@version 2010 May 16
20324      *
20325      *@since SOFA release 2010-12-01
20326      *
20327      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20328      */
20329     public static JulianDate jauTcbtdb(double tcb1, double tcb2)
20330     {
20331         double tdb1, tdb2;
20332         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20333         final double t77td = DJM0 + DJM77;
20334         final double t77tf = TTMTAI/DAYSEC;
20335 
20336         /* TDB (days) at TAI 1977 Jan 1.0 */
20337         final double tdb0 = TDB0/86400.0;
20338 
20339         double d;
20340 
20341 
20342         /* Result, safeguarding precision. */
20343         if ( abs(tcb1) > abs(tcb2) ) {
20344             d = tcb1 - t77td;
20345             tdb1 = tcb1;
20346             tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ELB;
20347         } else {
20348             d = tcb2 - t77td;
20349             tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ELB;
20350             tdb2 = tcb2;
20351         }
20352 
20353 
20354         return new JulianDate(tdb1, tdb2);
20355 
20356     };
20357 
20358     /**
20359      *  Time scale transformation:  Geocentric Coordinate Time, TCG, to
20360      *  Terrestrial Time, TT.
20361      *
20362      * <p>This function is derived from the International Astronomical Union's
20363      *  SOFA (Standards of Fundamental Astronomy) software collection.
20364      *
20365      *<p>Status:  canonical.
20366      *
20367      *<!-- Given: -->
20368      *  @param tcg1 double    TCG as a 2-part Julian Date
20369      *  @param tcg2 double    TCG as a 2-part Julian Date 
20370      *
20371      *<!-- Returned:-->
20372      *   @return    TT as a 2-part Julian Date
20373      *
20374      *
20375      *  Note:
20376      *
20377      *     tcg1+tcg2 is Julian Date, apportioned in any convenient way
20378      *     between the two arguments, for example where tcg1 is the Julian
20379      *     Day Number and tcg22 is the fraction of a day.  The returned
20380      *     tt1,tt2 follow suit.
20381      *
20382      *<p>References:
20383      *
20384      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),.
20385      *     IERS Technical Note No. 32, BKG (2004)
20386      *
20387      *     IAU 2000 Resolution B1.9
20388      *
20389      *@version 2010 May 14
20390      *
20391      *@since SOFA release 2010-12-01
20392      *
20393      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20394      */
20395     public static JulianDate jauTcgtt(double tcg1, double tcg2)
20396     {
20397         double tt1,tt2;
20398         /* 1977 Jan 1 00:00:32.184 TT, as MJD */
20399         final double t77t = DJM77 + TTMTAI/DAYSEC;
20400 
20401 
20402         /* Result, safeguarding precision. */
20403         if ( abs(tcg1) > abs(tcg2) ) {
20404             tt1 = tcg1;
20405             tt2 = tcg2 - ( ( tcg1 - DJM0 ) + ( tcg2 - t77t ) ) * ELG;
20406         } else {
20407             tt1 = tcg1 - ( ( tcg2 - DJM0 ) + ( tcg1 - t77t ) ) * ELG;
20408             tt2 = tcg2;
20409         }
20410 
20411         return new JulianDate(tt1, tt2);
20412     };
20413 
20414 
20415     /**
20416      *
20417      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20418      *  Barycentric Coordinate Time, TCB.
20419      *
20420      * <p>This function is derived from the International Astronomical Union's
20421      *  SOFA (Standards of Fundamental Astronomy) software collection.
20422      *
20423      *<p>Status:  canonical.
20424      *
20425      *<!-- Given: -->
20426      *   @param tdb1 TDB as a 2-part Julian Date
20427      *   @param tdb2 TDB as a 2-part Julian Date 
20428      *
20429      *<!-- Returned:-->
20430      *   @return    TCB as a 2-part Julian Date
20431      *
20432      *<p>Notes:
20433      * <ol>
20434      *  <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20435      *     between the two arguments, for example where tdb1 is the Julian
20436      *     Day Number and tdb2 is the fraction of a day.  The returned
20437      *     tcb1,tcb2 follow suit.
20438      *
20439      *  <li> The 2006 IAU General Assembly introduced a conventional linear
20440      *     transformation between TDB and TCB.  This transformation
20441      *     compensates for the drift between TCB and terrestrial time TT,
20442      *     and keeps TDB approximately centered on TT.  Because the
20443      *     relationship between TT and TCB depends on the adopted solar
20444      *     system ephemeris, the degree of alignment between TDB and TT over
20445      *     long intervals will vary according to which ephemeris is used.
20446      *     Former definitions of TDB attempted to avoid this problem by
20447      *     stipulating that TDB and TT should differ only by periodic
20448      *     effects.  This is a good description of the nature of the
20449      *     relationship but eluded precise mathematical formulation.  The
20450      *     conventional linear relationship adopted in 2006 sidestepped
20451      *     these difficulties whilst delivering a TDB that in practice was
20452      *     consistent with values before that date.
20453      *
20454      * <li>  TDB is essentially the same as Teph, the time argument for the
20455      *     JPL solar system ephemerides.
20456      *  </ol>
20457      *  Reference:
20458      *
20459      *     IAU 2006 Resolution B3
20460      *
20461      *@version 2010 September 10
20462      *
20463      *@since SOFA release 2010-12-01
20464      *
20465      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20466      */
20467     public static JulianDate jauTdbtcb(double tdb1, double tdb2 )
20468     {
20469         double tcb1, tcb2;
20470         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20471         final double t77td = DJM0 + DJM77;
20472         final double t77tf = TTMTAI/DAYSEC;
20473 
20474         /* TDB (days) at TAI 1977 Jan 1.0 */
20475         final double tdb0 = TDB0/DAYSEC;
20476 
20477         /* TDB to TCB rate */
20478         final double elbb = ELB/(1.0-ELB);
20479 
20480         double d, f;
20481 
20482 
20483         /* Result, preserving date format but safeguarding precision. */
20484         if ( abs(tdb1) > abs(tdb2) ) {
20485             d = t77td - tdb1;
20486             f  = tdb2 - tdb0;
20487             tcb1 = tdb1;
20488             tcb2 = f - ( d - ( f - t77tf ) ) * elbb;
20489         } else {
20490             d = t77td - tdb2;
20491             f  = tdb1 - tdb0;
20492             tcb1 = f - ( d - ( f - t77tf ) ) * elbb;
20493             tcb2 = tdb2;
20494         }
20495 
20496         return new JulianDate(tcb1, tcb2);
20497 
20498     };
20499 
20500 
20501     /**
20502      *
20503      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20504      *  Terrestrial Time, TT.
20505      *
20506      * <p>This function is derived from the International Astronomical Union's
20507      *  SOFA (Standards of Fundamental Astronomy) software collection.
20508      *
20509      *<p>Status:  canonical.
20510      *
20511      *<!-- Given: -->
20512      *    @param tdb1 double    TDB as a 2-part Julian Date
20513      *    @param tdb2 double    TDB as a 2-part Julian Date 
20514      *    @param dtr        double    TDB-TT in seconds
20515      *
20516      *<!-- Returned:-->
20517      *   @return   TT as a 2-part Julian Date
20518      *
20519      *
20520      *<p>Notes:
20521      * <ol>
20522      * <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20523      *     between the two arguments, for example where tdb1 is the Julian
20524      *     Day Number and tdb2 is the fraction of a day.  The returned
20525      *     tt1,tt2 follow suit.
20526      *
20527      *  <li>  The argument dtr represents the quasi-periodic component of the
20528      *     GR transformation between TT and TCB.  It is dependent upon the
20529      *     adopted solar-system ephemeris, and can be obtained by numerical
20530      *     integration, by interrogating a precomputed time ephemeris or by
20531      *     evaluating a model such as that implemented in the SOFA function
20532      *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
20533      *     amplitude.
20534      *
20535      *  <li>  TDB is essentially the same as Teph, the time argument for the
20536      *     JPL solar system ephemerides.
20537      *  </ol>
20538      *<p>References:
20539      *
20540      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20541      *     IERS Technical Note No. 32, BKG (2004)
20542      *
20543      *     IAU 2006 Resolution 3
20544      *
20545      *@version 2010 May 13
20546      *
20547      *@since SOFA release 2010-12-01
20548      *
20549      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20550      *
20551      */
20552     public static JulianDate jauTdbtt(double tdb1, double tdb2, double dtr  )
20553     {
20554         double tt1, tt2;
20555         double dtrd;
20556 
20557 
20558         /* Result, safeguarding precision. */
20559         dtrd = dtr / DAYSEC;
20560         if ( abs(tdb1) > abs(tdb2) ) {
20561             tt1 = tdb1;
20562             tt2 = tdb2 - dtrd;
20563         } else {
20564             tt1 = tdb1 - dtrd;
20565             tt2 = tdb2;
20566         }
20567 
20568         return new JulianDate(tt1, tt2);
20569 
20570     }
20571 
20572     /**
20573      *
20574      *  Convert hours, minutes, seconds to radians.
20575      *
20576      * <p>This function is derived from the International Astronomical Union's
20577      *  SOFA (Standards of Fundamental Astronomy) software collection.
20578      *
20579      *<p>Status:  support function.
20580      *
20581      *<!-- Given: -->
20582      *     @param s         char     sign:  '-' = negative, otherwise positive
20583      *     @param ihour     int     hours
20584      *     @param imin      int     minutes
20585      *     @param sec       double  seconds
20586      *
20587      *<!-- Returned:-->
20588      *     @return      double  angle in radians
20589      *@throws JSOFAIllegalParameter illegal parameter of some form
20590      *                                1 = ihour outside range 0-23
20591      *                                2 = imin outside range 0-59
20592      *                                3 = sec outside range 0-59.999...
20593      *
20594      *<p>Notes:
20595      *<ul>
20596      *  <li>  The result is computed even if any of the range checks fail.
20597      *
20598      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20599      *      the absolute value is used in the conversion.
20600      *</ul>
20601      *@version 2010 August 27
20602      *
20603      *@since SOFA release 2010-12-01
20604      *
20605      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20606      * 
20607      */
20608     public static double jauTf2a(char s, int ihour, int imin, double sec ) throws JSOFAIllegalParameter
20609     {
20610         double rad;
20611 
20612         /* Compute the interval. */
20613         rad  = ( s == '-' ? -1.0 : 1.0 ) *
20614                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20615                         ( (double) abs(imin) ) ) +
20616                         abs(sec) ) * DS2R;
20617 
20618         /*  Validate arguments and return status. */
20619         if ( ihour < 0 || ihour > 23 ) throw new JSOFAIllegalParameter("bad hour", 1);   
20620         if ( imin < 0 || imin > 59 )   throw new JSOFAIllegalParameter("bad minute", 2); 
20621         if ( sec < 0.0 || sec >= 60.0 )throw new JSOFAIllegalParameter("bad second", 3); 
20622         return rad;
20623 
20624     };
20625 
20626     /**
20627      *
20628      *  Convert hours, minutes, seconds to days.
20629      *
20630      * <p>This function is derived from the International Astronomical Union's
20631      *  SOFA (Standards of Fundamental Astronomy) software collection.
20632      *
20633      *<p>Status:  support function.
20634      *
20635      *<!-- Given: -->
20636      *     @param s         char     sign:  '-' = negative, otherwise positive
20637      *     @param ihour     int     hours
20638      *     @param imin      int     minutes
20639      *     @param sec       double  seconds
20640      *
20641      *<!-- Returned:-->
20642      *     @return      double  interval in days
20643      *
20644      *  Returned (function value):
20645      *               int     status:  0 = OK
20646      *                                1 = ihour outside range 0-23
20647      *                                2 = imin outside range 0-59
20648      *                                3 = sec outside range 0-59.999...
20649      *
20650      *<p>Notes:
20651      *<ol>
20652      *  <li>  The result is computed even if any of the range checks fail.
20653      *
20654      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20655      *      the absolute value is used in the conversion.
20656      *</ol>
20657      *@version 2010 August 27
20658      *
20659      *@since SOFA release 2010-12-01
20660      *
20661      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20662      * @throws JSOFAIllegalParameter whne the inputs outside range - hour outside range 0-23, imin outside range 0-59, sec outside range 0-59.999... 
20663      */
20664     public static double jauTf2d(char s, int ihour, int imin, double sec) throws JSOFAIllegalParameter
20665     {
20666         double days;
20667         /* Compute the interval. */
20668         days  = ( s == '-' ? -1.0 : 1.0 ) *
20669                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20670                         ( (double) abs(imin) ) ) +
20671                         abs(sec) ) / DAYSEC;
20672 
20673         /*  Validate arguments and return status. */
20674         if ( ihour < 0 || ihour > 23 )  throw new JSOFAIllegalParameter("bad hour", 1);
20675         if ( imin < 0 || imin > 59 )    throw new JSOFAIllegalParameter("bad minute", 2);
20676         if ( sec < 0.0 || sec >= 60.0 ) throw new JSOFAIllegalParameter("bad second", 3);
20677         return days;
20678 
20679     }
20680 
20681     /**
20682      *  Transpose an r-matrix.
20683      *
20684      *<p>This function is derived from the International Astronomical Union's
20685      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20686      *
20687      *<p>Status:  vector/matrix support function.
20688      *
20689      *<!-- Given: -->
20690      *     @param r         double[3][3]     r-matrix
20691      *
20692      *<!-- Returned: -->
20693      *     @return rt        double[3][3]      <u>returned</u> transpose
20694      *
20695      *  Note:
20696      *     It is permissible for r and rt to be the same array.
20697      *
20698      *<p>Called:<ul>
20699      *     <li>{@link #jauCr} copy r-matrix
20700      * </ul>
20701      *@version 2008 May 22
20702      *
20703      *  @since Release 20101201
20704      *
20705      *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20706      */
20707     public static double[][] jauTr(double r[][])
20708     {
20709         double wm[][]= new double[3][3];
20710         int i, j;
20711 
20712 
20713         for (i = 0; i < 3; i++) {
20714             for (j = 0; j < 3; j++) {
20715                 wm[i][j] = r[j][i];
20716             }
20717         }
20718 
20719 
20720         return wm;
20721 
20722     }
20723 
20724 
20725     /**
20726      *  Multiply a p-vector by the transpose of an r-matrix.
20727      *
20728      *<p>This function is derived from the International Astronomical Union's
20729      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20730      *
20731      *<p>Status:  vector/matrix support function.
20732      *
20733      *<!-- Given: -->
20734      *     @param r         double[3][3]    r-matrix
20735      *     @param p         double[3]       p-vector
20736      *
20737      *<!-- Returned: -->
20738      *     @return trp       double[3]        <u>returned</u> r * p
20739      *
20740      *  Note:
20741      *     It is permissible for p and trp to be the same array.
20742      *
20743      *<p>Called:<ul>
20744      *     <li>{@link #jauTr} transpose r-matrix
20745     *     <li>{@link #jauRxp} product of r-matrix and p-vector
20746     * </ul>
20747     *@version 2008 October 28
20748     *
20749     *  @since Release 20101201
20750     *
20751     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20752     */
20753     public static double[] jauTrxp(double r[][], double p[]  )
20754     {
20755        double tr[][];
20756        double trp[];
20757 
20758     /* Transpose of matrix r. */
20759        tr = jauTr(r);
20760 
20761     /* Matrix tr * vector p -> vector trp. */
20762        trp = jauRxp(tr, p);
20763 
20764        return trp;
20765 
20766         }
20767     
20768 
20769     /**
20770     *  Multiply a pv-vector by the transpose of an r-matrix.
20771     *
20772     *<p>This function is derived from the International Astronomical Union's
20773     *  SOFA (Standards Of Fundamental Astronomy) software collection.
20774     *
20775     *<p>Status:  vector/matrix support function.
20776     *
20777     *<!-- Given: -->
20778     *     @param r         double[3][3]     r-matrix
20779     *     @param pv        double[2][3]     pv-vector
20780     *
20781     *<!-- Returned: -->
20782     *     @return trpv      double[2][3]      <u>returned</u> r * pv
20783     *
20784     *  Note:
20785     *     It is permissible for pv and trpv to be the same array.
20786     *
20787     *<p>Called:<ul>
20788     *     <li>{@link #jauTr} transpose r-matrix
20789     *     <li>{@link #jauRxpv} product of r-matrix and pv-vector
20790     * </ul>
20791     *@version 2008 October 28
20792     *
20793     *  @since Release 20101201
20794     *
20795     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20796     */
20797     public static double[][] jauTrxpv(double r[][], double pv[][] )
20798     {
20799        double tr[][], trpv[][];
20800 
20801 
20802     /* Transpose of matrix r. */
20803        tr = jauTr(r);
20804 
20805     /* Matrix tr * vector pv -> vector trpv. */
20806        trpv = jauRxpv(tr, pv);
20807 
20808        return trpv;
20809 
20810         }
20811     
20812     /*
20813      * constant arrays set outside jauXy06 to avoid problems with 65535 byte limit on function size
20814      */
20815     static {
20816         /* need to define this function because it appears that javac lumps all of the statically defined initalizers into one function on 
20817          * compilation - so this will force a second function */
20818         init_mfals();
20819     }
20820     /** Fundamental-argument multipliers:  luni-solar terms */
20821     private static int mfals[][]; //IMPL would like to be final really
20822     
20823     private static void init_mfals(){
20824         
20825     mfals = new int[][]
20826     {
20827 
20828    /* 1-10 */
20829       {  0,   0,   0,   0,   1 },
20830       {  0,   0,   2,  -2,   2 },
20831       {  0,   0,   2,   0,   2 },
20832       {  0,   0,   0,   0,   2 },
20833       {  0,   1,   0,   0,   0 },
20834       {  0,   1,   2,  -2,   2 },
20835       {  1,   0,   0,   0,   0 },
20836       {  0,   0,   2,   0,   1 },
20837       {  1,   0,   2,   0,   2 },
20838       {  0,   1,  -2,   2,  -2 },
20839 
20840    /* 11-20 */
20841       {  0,   0,   2,  -2,   1 },
20842       {  1,   0,  -2,   0,  -2 },
20843       {  1,   0,   0,  -2,   0 },
20844       {  1,   0,   0,   0,   1 },
20845       {  1,   0,   0,   0,  -1 },
20846       {  1,   0,  -2,  -2,  -2 },
20847       {  1,   0,   2,   0,   1 },
20848       {  2,   0,  -2,   0,  -1 },
20849       {  0,   0,   0,   2,   0 },
20850       {  0,   0,   2,   2,   2 },
20851 
20852    /* 21-30 */
20853       {  2,   0,   0,  -2,   0 },
20854       {  0,   2,  -2,   2,  -2 },
20855       {  2,   0,   2,   0,   2 },
20856       {  1,   0,   2,  -2,   2 },
20857       {  1,   0,  -2,   0,  -1 },
20858       {  2,   0,   0,   0,   0 },
20859       {  0,   0,   2,   0,   0 },
20860       {  0,   1,   0,   0,   1 },
20861       {  1,   0,   0,  -2,  -1 },
20862       {  0,   2,   2,  -2,   2 },
20863 
20864    /* 31-40 */
20865       {  0,   0,   2,  -2,   0 },
20866       {  1,   0,   0,  -2,   1 },
20867       {  0,   1,   0,   0,  -1 },
20868       {  0,   2,   0,   0,   0 },
20869       {  1,   0,  -2,  -2,  -1 },
20870       {  1,   0,   2,   2,   2 },
20871       {  0,   1,   2,   0,   2 },
20872       {  2,   0,  -2,   0,   0 },
20873       {  0,   0,   2,   2,   1 },
20874       {  0,   1,  -2,   0,  -2 },
20875 
20876    /* 41-50 */
20877       {  0,   0,   0,   2,   1 },
20878       {  1,   0,   2,  -2,   1 },
20879       {  2,   0,   0,  -2,  -1 },
20880       {  2,   0,   2,  -2,   2 },
20881       {  2,   0,   2,   0,   1 },
20882       {  0,   0,   0,   2,  -1 },
20883       {  0,   1,  -2,   2,  -1 },
20884       {  1,   1,   0,  -2,   0 },
20885       {  2,   0,   0,  -2,   1 },
20886       {  1,   0,   0,   2,   0 },
20887 
20888    /* 51-60 */
20889       {  0,   1,   2,  -2,   1 },
20890       {  1,  -1,   0,   0,   0 },
20891       {  0,   1,  -1,   1,  -1 },
20892       {  2,   0,  -2,   0,  -2 },
20893       {  0,   1,   0,  -2,   0 },
20894       {  1,   0,   0,  -1,   0 },
20895       {  3,   0,   2,   0,   2 },
20896       {  0,   0,   0,   1,   0 },
20897       {  1,  -1,   2,   0,   2 },
20898       {  1,   1,  -2,  -2,  -2 },
20899 
20900    /* 61-70 */
20901       {  1,   0,  -2,   0,   0 },
20902       {  2,   0,   0,   0,  -1 },
20903       {  0,   1,  -2,  -2,  -2 },
20904       {  1,   1,   2,   0,   2 },
20905       {  2,   0,   0,   0,   1 },
20906       {  1,   1,   0,   0,   0 },
20907       {  1,   0,  -2,   2,  -1 },
20908       {  1,   0,   2,   0,   0 },
20909       {  1,  -1,   0,  -1,   0 },
20910       {  1,   0,   0,   0,   2 },
20911 
20912    /* 71-80 */
20913       {  1,   0,  -1,   0,  -1 },
20914       {  0,   0,   2,   1,   2 },
20915       {  1,   0,  -2,  -4,  -2 },
20916       {  1,  -1,   0,  -1,  -1 },
20917       {  1,   0,   2,   2,   1 },
20918       {  0,   2,  -2,   2,  -1 },
20919       {  1,   0,   0,   0,  -2 },
20920       {  2,   0,  -2,  -2,  -2 },
20921       {  1,   1,   2,  -2,   2 },
20922       {  2,   0,  -2,  -4,  -2 },
20923 
20924    /* 81-90 */
20925       {  1,   0,  -4,   0,  -2 },
20926       {  2,   0,   2,  -2,   1 },
20927       {  1,   0,   0,  -1,  -1 },
20928       {  2,   0,   2,   2,   2 },
20929       {  3,   0,   0,   0,   0 },
20930       {  1,   0,   0,   2,   1 },
20931       {  0,   0,   2,  -2,  -1 },
20932       {  3,   0,   2,  -2,   2 },
20933       {  0,   0,   4,  -2,   2 },
20934       {  1,   0,   0,  -4,   0 },
20935 
20936    /* 91-100 */
20937       {  0,   1,   2,   0,   1 },
20938       {  2,   0,   0,  -4,   0 },
20939       {  1,   1,   0,  -2,  -1 },
20940       {  2,   0,  -2,   0,   1 },
20941       {  0,   0,   2,   0,  -1 },
20942       {  0,   1,  -2,   0,  -1 },
20943       {  0,   1,   0,   0,   2 },
20944       {  0,   0,   2,  -1,   2 },
20945       {  0,   0,   2,   4,   2 },
20946       {  2,   1,   0,  -2,   0 },
20947 
20948    /* 101-110 */
20949       {  1,   1,   0,  -2,   1 },
20950       {  1,  -1,   0,  -2,   0 },
20951       {  1,  -1,   0,  -1,  -2 },
20952       {  1,  -1,   0,   0,   1 },
20953       {  0,   1,  -2,   2,   0 },
20954       {  0,   1,   0,   0,  -2 },
20955       {  1,  -1,   2,   2,   2 },
20956       {  1,   0,   0,   2,  -1 },
20957       {  1,  -1,  -2,  -2,  -2 },
20958       {  3,   0,   2,   0,   1 },
20959 
20960    /* 111-120 */
20961       {  0,   1,   2,   2,   2 },
20962       {  1,   0,   2,  -2,   0 },
20963       {  1,   1,  -2,  -2,  -1 },
20964       {  1,   0,   2,  -4,   1 },
20965       {  0,   1,  -2,  -2,  -1 },
20966       {  2,  -1,   2,   0,   2 },
20967       {  0,   0,   0,   2,   2 },
20968       {  1,  -1,   2,   0,   1 },
20969       {  1,  -1,  -2,   0,  -2 },
20970       {  0,   1,   0,   2,   0 },
20971 
20972    /* 121-130 */
20973       {  0,   1,   2,  -2,   0 },
20974       {  0,   0,   0,   1,   1 },
20975       {  1,   0,  -2,  -2,   0 },
20976       {  0,   3,   2,  -2,   2 },
20977       {  2,   1,   2,   0,   2 },
20978       {  1,   1,   0,   0,   1 },
20979       {  2,   0,   0,   2,   0 },
20980       {  1,   1,   2,   0,   1 },
20981       {  1,   0,   0,  -2,  -2 },
20982       {  1,   0,  -2,   2,   0 },
20983 
20984    /* 131-140 */
20985       {  1,   0,  -1,   0,  -2 },
20986       {  0,   1,   0,  -2,   1 },
20987       {  0,   1,   0,   1,   0 },
20988       {  0,   0,   0,   1,  -1 },
20989       {  1,   0,  -2,   2,  -2 },
20990       {  1,  -1,   0,   0,  -1 },
20991       {  0,   0,   0,   4,   0 },
20992       {  1,  -1,   0,   2,   0 },
20993       {  1,   0,   2,   1,   2 },
20994       {  1,   0,   2,  -1,   2 },
20995 
20996    /* 141-150 */
20997       {  0,   0,   2,   1,   1 },
20998       {  1,   0,   0,  -2,   2 },
20999       {  1,   0,  -2,   0,   1 },
21000       {  1,   0,  -2,  -4,  -1 },
21001       {  0,   0,   2,   2,   0 },
21002       {  1,   1,   2,  -2,   1 },
21003       {  1,   0,  -2,   1,  -1 },
21004       {  0,   0,   1,   0,   1 },
21005       {  2,   0,  -2,  -2,  -1 },
21006       {  4,   0,   2,   0,   2 },
21007 
21008    /* 151-160 */
21009       {  2,  -1,   0,   0,   0 },
21010       {  2,   1,   2,  -2,   2 },
21011       {  0,   1,   2,   1,   2 },
21012       {  1,   0,   4,  -2,   2 },
21013       {  1,   1,   0,   0,  -1 },
21014       {  2,   0,   2,   0,   0 },
21015       {  2,   0,  -2,  -4,  -1 },
21016       {  1,   0,  -1,   0,   0 },
21017       {  1,   0,   0,   1,   0 },
21018       {  0,   1,   0,   2,   1 },
21019 
21020    /* 161-170 */
21021       {  1,   0,  -4,   0,  -1 },
21022       {  1,   0,   0,  -4,  -1 },
21023       {  2,   0,   2,   2,   1 },
21024       {  2,   1,   0,   0,   0 },
21025       {  0,   0,   2,  -3,   2 },
21026       {  1,   2,   0,  -2,   0 },
21027       {  0,   3,   0,   0,   0 },
21028       {  0,   0,   4,   0,   2 },
21029       {  0,   0,   2,  -4,   1 },
21030       {  2,   0,   0,  -2,  -2 },
21031 
21032    /* 171-180 */
21033       {  1,   1,  -2,  -4,  -2 },
21034       {  0,   1,   0,  -2,  -1 },
21035       {  0,   0,   0,   4,   1 },
21036       {  3,   0,   2,  -2,   1 },
21037       {  1,   0,   2,   4,   2 },
21038       {  1,   1,  -2,   0,  -2 },
21039       {  0,   0,   4,  -2,   1 },
21040       {  2,  -2,   0,  -2,   0 },
21041       {  2,   1,   0,  -2,  -1 },
21042       {  0,   2,   0,  -2,   0 },
21043 
21044    /* 181-190 */
21045       {  1,   0,   0,  -1,   1 },
21046       {  1,   1,   2,   2,   2 },
21047       {  3,   0,   0,   0,  -1 },
21048       {  2,   0,   0,  -4,  -1 },
21049       {  3,   0,   2,   2,   2 },
21050       {  0,   0,   2,   4,   1 },
21051       {  0,   2,  -2,  -2,  -2 },
21052       {  1,  -1,   0,  -2,  -1 },
21053       {  0,   0,   2,  -1,   1 },
21054       {  2,   0,   0,   2,   1 },
21055 
21056    /* 191-200 */
21057       {  1,  -1,  -2,   2,  -1 },
21058       {  0,   0,   0,   2,  -2 },
21059       {  2,   0,   0,  -4,   1 },
21060       {  1,   0,   0,  -4,   1 },
21061       {  2,   0,   2,  -4,   1 },
21062       {  4,   0,   2,  -2,   2 },
21063       {  2,   1,  -2,   0,  -1 },
21064       {  2,   1,  -2,  -4,  -2 },
21065       {  3,   0,   0,  -4,   0 },
21066       {  1,  -1,   2,   2,   1 },
21067 
21068    /* 201-210 */
21069       {  1,  -1,  -2,   0,  -1 },
21070       {  0,   2,   0,   0,   1 },
21071       {  1,   2,  -2,  -2,  -2 },
21072       {  1,   1,   0,  -4,   0 },
21073       {  2,   0,   0,  -2,   2 },
21074       {  0,   2,   2,  -2,   1 },
21075       {  1,   0,   2,   0,  -1 },
21076       {  2,   1,   0,  -2,   1 },
21077       {  2,  -1,  -2,   0,  -1 },
21078       {  1,  -1,  -2,  -2,  -1 },
21079 
21080    /* 211-220 */
21081       {  0,   1,  -2,   1,  -2 },
21082       {  1,   0,  -4,   2,  -2 },
21083       {  0,   1,   2,   2,   1 },
21084       {  3,   0,   0,   0,   1 },
21085       {  2,  -1,   2,   2,   2 },
21086       {  0,   1,  -2,  -4,  -2 },
21087       {  1,   0,  -2,  -3,  -2 },
21088       {  2,   0,   0,   0,   2 },
21089       {  1,  -1,   0,  -2,  -2 },
21090       {  2,   0,  -2,   2,  -1 },
21091 
21092    /* 221-230 */
21093       {  0,   2,  -2,   0,  -2 },
21094       {  3,   0,  -2,   0,  -1 },
21095       {  2,  -1,   2,   0,   1 },
21096       {  1,   0,  -2,  -1,  -2 },
21097       {  0,   0,   2,   0,   3 },
21098       {  2,   0,  -4,   0,  -2 },
21099       {  2,   1,   0,  -4,   0 },
21100       {  1,   1,  -2,   1,  -1 },
21101       {  0,   2,   2,   0,   2 },
21102       {  1,  -1,   2,  -2,   2 },
21103 
21104    /* 231-240 */
21105       {  1,  -1,   0,  -2,   1 },
21106       {  2,   1,   2,   0,   1 },
21107       {  1,   0,   2,  -4,   2 },
21108       {  1,   1,  -2,   0,  -1 },
21109       {  1,   1,   0,   2,   0 },
21110       {  1,   0,   0,  -3,   0 },
21111       {  2,   0,   2,  -1,   2 },
21112       {  0,   2,   0,   0,  -1 },
21113       {  2,  -1,   0,  -2,   0 },
21114       {  4,   0,   0,   0,   0 },
21115 
21116    /* 241-250 */
21117       {  2,   1,  -2,  -2,  -2 },
21118       {  0,   2,  -2,   2,   0 },
21119       {  1,   0,   2,   1,   1 },
21120       {  1,   0,  -1,   0,  -3 },
21121       {  3,  -1,   2,   0,   2 },
21122       {  2,   0,   2,  -2,   0 },
21123       {  1,  -2,   0,   0,   0 },
21124       {  2,   0,   0,   0,  -2 },
21125       {  1,   0,   0,   4,   0 },
21126       {  0,   1,   0,   1,   1 },
21127 
21128    /* 251-260 */
21129       {  1,   0,   2,   2,   0 },
21130       {  0,   1,   0,   2,  -1 },
21131       {  0,   1,   0,   1,  -1 },
21132       {  0,   0,   2,  -2,   3 },
21133       {  3,   1,   2,   0,   2 },
21134       {  1,   1,   2,   1,   2 },
21135       {  1,   1,  -2,   2,  -1 },
21136       {  2,  -1,   2,  -2,   2 },
21137       {  1,  -2,   2,   0,   2 },
21138       {  1,   0,   2,  -4,   0 },
21139 
21140    /* 261-270 */
21141       {  0,   0,   1,   0,   0 },
21142       {  1,   0,   2,  -3,   1 },
21143       {  1,  -2,   0,  -2,   0 },
21144       {  2,   0,   0,   2,  -1 },
21145       {  1,   1,   2,  -4,   1 },
21146       {  4,   0,   2,   0,   1 },
21147       {  0,   1,   2,   1,   1 },
21148       {  1,   2,   2,  -2,   2 },
21149       {  2,   0,   2,   1,   2 },
21150       {  2,   1,   2,  -2,   1 },
21151 
21152    /* 271-280 */
21153       {  1,   0,   2,  -1,   1 },
21154       {  1,   0,   4,  -2,   1 },
21155       {  1,  -1,   2,  -2,   1 },
21156       {  0,   1,   0,  -4,   0 },
21157       {  3,   0,  -2,  -2,  -2 },
21158       {  0,   0,   4,  -4,   2 },
21159       {  2,   0,  -4,  -2,  -2 },
21160       {  2,  -2,   0,  -2,  -1 },
21161       {  1,   0,   2,  -2,  -1 },
21162       {  2,   0,  -2,  -6,  -2 },
21163 
21164    /* 281-290 */
21165       {  1,   0,  -2,   1,  -2 },
21166       {  1,   0,  -2,   2,   1 },
21167       {  1,  -1,   0,   2,  -1 },
21168       {  1,   0,  -2,   1,   0 },
21169       {  2,  -1,   0,  -2,   1 },
21170       {  1,  -1,   0,   2,   1 },
21171       {  2,   0,  -2,  -2,   0 },
21172       {  1,   0,   2,  -3,   2 },
21173       {  0,   0,   0,   4,  -1 },
21174       {  2,  -1,   0,   0,   1 },
21175 
21176    /* 291-300 */
21177       {  2,   0,   4,  -2,   2 },
21178       {  0,   0,   2,   3,   2 },
21179       {  0,   1,   4,  -2,   2 },
21180       {  0,   1,  -2,   2,   1 },
21181       {  1,   1,   0,   2,   1 },
21182       {  1,   0,   0,   4,   1 },
21183       {  0,   0,   4,   0,   1 },
21184       {  2,   0,   0,  -3,   0 },
21185       {  1,   0,   0,  -1,  -2 },
21186       {  1,  -2,  -2,  -2,  -2 },
21187 
21188    /* 301-310 */
21189       {  3,   0,   0,   2,   0 },
21190       {  2,   0,   2,  -4,   2 },
21191       {  1,   1,  -2,  -4,  -1 },
21192       {  1,   0,  -2,  -6,  -2 },
21193       {  2,  -1,   0,   0,  -1 },
21194       {  2,  -1,   0,   2,   0 },
21195       {  0,   1,   2,  -2,  -1 },
21196       {  1,   1,   0,   1,   0 },
21197       {  1,   2,   0,  -2,  -1 },
21198       {  1,   0,   0,   1,  -1 },
21199 
21200    /* 311-320 */
21201       {  0,   0,   1,   0,   2 },
21202       {  3,   1,   2,  -2,   2 },
21203       {  1,   0,  -4,  -2,  -2 },
21204       {  1,   0,   2,   4,   1 },
21205       {  1,  -2,   2,   2,   2 },
21206       {  1,  -1,  -2,  -4,  -2 },
21207       {  0,   0,   2,  -4,   2 },
21208       {  0,   0,   2,  -3,   1 },
21209       {  2,   1,  -2,   0,   0 },
21210       {  3,   0,  -2,  -2,  -1 },
21211 
21212    /* 321-330 */
21213       {  2,   0,   2,   4,   2 },
21214       {  0,   0,   0,   0,   3 },
21215       {  2,  -1,  -2,  -2,  -2 },
21216       {  2,   0,   0,  -1,   0 },
21217       {  3,   0,   2,  -4,   2 },
21218       {  2,   1,   2,   2,   2 },
21219       {  0,   0,   3,   0,   3 },
21220       {  1,   1,   2,   2,   1 },
21221       {  2,   1,   0,   0,  -1 },
21222       {  1,   2,   0,  -2,   1 },
21223 
21224    /* 331-340 */
21225       {  3,   0,   2,   2,   1 },
21226       {  1,  -1,  -2,   2,  -2 },
21227       {  1,   1,   0,  -1,   0 },
21228       {  1,   2,   0,   0,   0 },
21229       {  1,   0,   4,   0,   2 },
21230       {  1,  -1,   2,   4,   2 },
21231       {  2,   1,   0,   0,   1 },
21232       {  1,   0,   0,   2,   2 },
21233       {  1,  -1,  -2,   2,   0 },
21234       {  0,   2,  -2,  -2,  -1 },
21235 
21236    /* 341-350 */
21237       {  2,   0,  -2,   0,   2 },
21238       {  5,   0,   2,   0,   2 },
21239       {  3,   0,  -2,  -6,  -2 },
21240       {  1,  -1,   2,  -1,   2 },
21241       {  3,   0,   0,  -4,  -1 },
21242       {  1,   0,   0,   1,   1 },
21243       {  1,   0,  -4,   2,  -1 },
21244       {  0,   1,   2,  -4,   1 },
21245       {  1,   2,   2,   0,   2 },
21246       {  0,   1,   0,  -2,  -2 },
21247 
21248    /* 351-360 */
21249       {  0,   0,   2,  -1,   0 },
21250       {  1,   0,   1,   0,   1 },
21251       {  0,   2,   0,  -2,   1 },
21252       {  3,   0,   2,   0,   0 },
21253       {  1,   1,  -2,   1,   0 },
21254       {  2,   1,  -2,  -4,  -1 },
21255       {  3,  -1,   0,   0,   0 },
21256       {  2,  -1,  -2,   0,   0 },
21257       {  4,   0,   2,  -2,   1 },
21258       {  2,   0,  -2,   2,   0 },
21259 
21260    /* 361-370 */
21261       {  1,   1,   2,  -2,   0 },
21262       {  1,   0,  -2,   4,  -1 },
21263       {  1,   0,  -2,  -2,   1 },
21264       {  2,   0,   2,  -4,   0 },
21265       {  1,   1,   0,  -2,  -2 },
21266       {  1,   1,  -2,  -2,   0 },
21267       {  1,   0,   1,  -2,   1 },
21268       {  2,  -1,  -2,  -4,  -2 },
21269       {  3,   0,  -2,   0,  -2 },
21270       {  0,   1,  -2,  -2,   0 },
21271 
21272    /* 371-380 */
21273       {  3,   0,   0,  -2,  -1 },
21274       {  1,   0,  -2,  -3,  -1 },
21275       {  0,   1,   0,  -4,  -1 },
21276       {  1,  -2,   2,  -2,   1 },
21277       {  0,   1,  -2,   1,  -1 },
21278       {  1,  -1,   0,   0,   2 },
21279       {  2,   0,   0,   1,   0 },
21280       {  1,  -2,   0,   2,   0 },
21281       {  1,   2,  -2,  -2,  -1 },
21282       {  0,   0,   4,  -4,   1 },
21283 
21284    /* 381-390 */
21285       {  0,   1,   2,   4,   2 },
21286       {  0,   1,  -4,   2,  -2 },
21287       {  3,   0,  -2,   0,   0 },
21288       {  2,  -1,   2,   2,   1 },
21289       {  0,   1,  -2,  -4,  -1 },
21290       {  4,   0,   2,   2,   2 },
21291       {  2,   0,  -2,  -3,  -2 },
21292       {  2,   0,   0,  -6,   0 },
21293       {  1,   0,   2,   0,   3 },
21294       {  3,   1,   0,   0,   0 },
21295 
21296    /* 391-400 */
21297       {  3,   0,   0,  -4,   1 },
21298       {  1,  -1,   2,   0,   0 },
21299       {  1,  -1,   0,  -4,   0 },
21300       {  2,   0,  -2,   2,  -2 },
21301       {  1,   1,   0,  -2,   2 },
21302       {  4,   0,   0,  -2,   0 },
21303       {  2,   2,   0,  -2,   0 },
21304       {  0,   1,   2,   0,   0 },
21305       {  1,   1,   0,  -4,   1 },
21306       {  1,   0,   0,  -4,  -2 },
21307 
21308    /* 401-410 */
21309       {  0,   0,   0,   1,   2 },
21310       {  3,   0,   0,   2,   1 },
21311       {  1,   1,   0,  -4,  -1 },
21312       {  0,   0,   2,   2,  -1 },
21313       {  1,   1,   2,   0,   0 },
21314       {  1,  -1,   2,  -4,   1 },
21315       {  1,   1,   0,   0,   2 },
21316       {  0,   0,   2,   6,   2 },
21317       {  4,   0,  -2,  -2,  -1 },
21318       {  2,   1,   0,  -4,  -1 },
21319 
21320    /* 411-420 */
21321       {  0,   0,   0,   3,   1 },
21322       {  1,  -1,  -2,   0,   0 },
21323       {  0,   0,   2,   1,   0 },
21324       {  1,   0,   0,   2,  -2 },
21325       {  3,  -1,   2,   2,   2 },
21326       {  3,  -1,   2,  -2,   2 },
21327       {  1,   0,   0,  -1,   2 },
21328       {  1,  -2,   2,  -2,   2 },
21329       {  0,   1,   0,   2,   2 },
21330       {  0,   1,  -2,  -1,  -2 },
21331 
21332    /* 421-430 */
21333       {  1,   1,  -2,   0,   0 },
21334       {  0,   2,   2,  -2,   0 },
21335       {  3,  -1,  -2,  -1,  -2 },
21336       {  1,   0,   0,  -6,   0 },
21337       {  1,   0,  -2,  -4,   0 },
21338       {  2,   1,   0,  -4,   1 },
21339       {  2,   0,   2,   0,  -1 },
21340       {  2,   0,  -4,   0,  -1 },
21341       {  0,   0,   3,   0,   2 },
21342       {  2,   1,  -2,  -2,  -1 },
21343 
21344    /* 431-440 */
21345       {  1,  -2,   0,   0,   1 },
21346       {  2,  -1,   0,  -4,   0 },
21347       {  0,   0,   0,   3,   0 },
21348       {  5,   0,   2,  -2,   2 },
21349       {  1,   2,  -2,  -4,  -2 },
21350       {  1,   0,   4,  -4,   2 },
21351       {  0,   0,   4,  -1,   2 },
21352       {  3,   1,   0,  -4,   0 },
21353       {  3,   0,   0,  -6,   0 },
21354       {  2,   0,   0,   2,   2 },
21355 
21356    /* 441-450 */
21357       {  2,  -2,   2,   0,   2 },
21358       {  1,   0,   0,  -3,   1 },
21359       {  1,  -2,  -2,   0,  -2 },
21360       {  1,  -1,  -2,  -3,  -2 },
21361       {  0,   0,   2,  -2,  -2 },
21362       {  2,   0,  -2,  -4,   0 },
21363       {  1,   0,  -4,   0,   0 },
21364       {  0,   1,   0,  -1,   0 },
21365       {  4,   0,   0,   0,  -1 },
21366       {  3,   0,   2,  -1,   2 },
21367 
21368    /* 451-460 */
21369       {  3,  -1,   2,   0,   1 },
21370       {  2,   0,   2,  -1,   1 },
21371       {  1,   2,   2,  -2,   1 },
21372       {  1,   1,   0,   2,  -1 },
21373       {  0,   2,   2,   0,   1 },
21374       {  3,   1,   2,   0,   1 },
21375       {  1,   1,   2,   1,   1 },
21376       {  1,   1,   0,  -1,   1 },
21377       {  1,  -2,   0,  -2,  -1 },
21378       {  4,   0,   0,  -4,   0 },
21379 
21380    /* 461-470 */
21381       {  2,   1,   0,   2,   0 },
21382       {  1,  -1,   0,   4,   0 },
21383       {  0,   1,   0,  -2,   2 },
21384       {  0,   0,   2,   0,  -2 },
21385       {  1,   0,  -1,   0,   1 },
21386       {  3,   0,   2,  -2,   0 },
21387       {  2,   0,   2,   2,   0 },
21388       {  1,   2,   0,  -4,   0 },
21389       {  1,  -1,   0,  -3,   0 },
21390       {  0,   1,   0,   4,   0 },
21391 
21392    /* 471 - 480 */
21393       {  0,   1,  -2,   0,   0 },
21394       {  2,   2,   2,  -2,   2 },
21395       {  0,   0,   0,   1,  -2 },
21396       {  0,   2,  -2,   0,  -1 },
21397       {  4,   0,   2,  -4,   2 },
21398       {  2,   0,  -4,   2,  -2 },
21399       {  2,  -1,  -2,   0,  -2 },
21400       {  1,   1,   4,  -2,   2 },
21401       {  1,   1,   2,  -4,   2 },
21402       {  1,   0,   2,   3,   2 },
21403 
21404    /* 481-490 */
21405       {  1,   0,   0,   4,  -1 },
21406       {  0,   0,   0,   4,   2 },
21407       {  2,   0,   0,   4,   0 },
21408       {  1,   1,  -2,   2,   0 },
21409       {  2,   1,   2,   1,   2 },
21410       {  2,   1,   2,  -4,   1 },
21411       {  2,   0,   2,   1,   1 },
21412       {  2,   0,  -4,  -2,  -1 },
21413       {  2,   0,  -2,  -6,  -1 },
21414       {  2,  -1,   2,  -1,   2 },
21415 
21416    /* 491-500 */
21417       {  1,  -2,   2,   0,   1 },
21418       {  1,  -2,   0,  -2,   1 },
21419       {  1,  -1,   0,  -4,  -1 },
21420       {  0,   2,   2,   2,   2 },
21421       {  0,   2,  -2,  -4,  -2 },
21422       {  0,   1,   2,   3,   2 },
21423       {  0,   1,   0,  -4,   1 },
21424       {  3,   0,   0,  -2,   1 },
21425       {  2,   1,  -2,   0,   1 },
21426       {  2,   0,   4,  -2,   1 },
21427 
21428    /* 501-510 */
21429       {  2,   0,   0,  -3,  -1 },
21430       {  2,  -2,   0,  -2,   1 },
21431       {  2,  -1,   2,  -2,   1 },
21432       {  1,   0,   0,  -6,  -1 },
21433       {  1,  -2,   0,   0,  -1 },
21434       {  1,  -2,  -2,  -2,  -1 },
21435       {  0,   1,   4,  -2,   1 },
21436       {  0,   0,   2,   3,   1 },
21437       {  2,  -1,   0,  -1,   0 },
21438       {  1,   3,   0,  -2,   0 },
21439 
21440    /* 511-520 */
21441       {  0,   3,   0,  -2,   0 },
21442       {  2,  -2,   2,  -2,   2 },
21443       {  0,   0,   4,  -2,   0 },
21444       {  4,  -1,   2,   0,   2 },
21445       {  2,   2,  -2,  -4,  -2 },
21446       {  4,   1,   2,   0,   2 },
21447       {  4,  -1,  -2,  -2,  -2 },
21448       {  2,   1,   0,  -2,  -2 },
21449       {  2,   1,  -2,  -6,  -2 },
21450       {  2,   0,   0,  -1,   1 },
21451 
21452    /* 521-530 */
21453       {  2,  -1,  -2,   2,  -1 },
21454       {  1,   1,  -2,   2,  -2 },
21455       {  1,   1,  -2,  -3,  -2 },
21456       {  1,   0,   3,   0,   3 },
21457       {  1,   0,  -2,   1,   1 },
21458       {  1,   0,  -2,   0,   2 },
21459       {  1,  -1,   2,   1,   2 },
21460       {  1,  -1,   0,   0,  -2 },
21461       {  1,  -1,  -4,   2,  -2 },
21462       {  0,   3,  -2,  -2,  -2 },
21463 
21464    /* 531-540 */
21465       {  0,   1,   0,   4,   1 },
21466       {  0,   0,   4,   2,   2 },
21467       {  3,   0,  -2,  -2,   0 },
21468       {  2,  -2,   0,   0,   0 },
21469       {  1,   1,   2,  -4,   0 },
21470       {  1,   1,   0,  -3,   0 },
21471       {  1,   0,   2,  -3,   0 },
21472       {  1,  -1,   2,  -2,   0 },
21473       {  0,   2,   0,   2,   0 },
21474       {  0,   0,   2,   4,   0 },
21475 
21476    /* 541-550 */
21477       {  1,   0,   1,   0,   0 },
21478       {  3,   1,   2,  -2,   1 },
21479       {  3,   0,   4,  -2,   2 },
21480       {  3,   0,   2,   1,   2 },
21481       {  3,   0,   0,   2,  -1 },
21482       {  3,   0,   0,   0,   2 },
21483       {  3,   0,  -2,   2,  -1 },
21484       {  2,   0,   4,  -4,   2 },
21485       {  2,   0,   2,  -3,   2 },
21486       {  2,   0,   0,   4,   1 },
21487 
21488    /* 551-560 */
21489       {  2,   0,   0,  -3,   1 },
21490       {  2,   0,  -4,   2,  -1 },
21491       {  2,   0,  -2,  -2,   1 },
21492       {  2,  -2,   2,   2,   2 },
21493       {  2,  -2,   0,  -2,  -2 },
21494       {  2,  -1,   0,   2,   1 },
21495       {  2,  -1,   0,   2,  -1 },
21496       {  1,   1,   2,   4,   2 },
21497       {  1,   1,   0,   1,   1 },
21498       {  1,   1,   0,   1,  -1 },
21499 
21500    /* 561-570 */
21501       {  1,   1,  -2,  -6,  -2 },
21502       {  1,   0,   0,  -3,  -1 },
21503       {  1,   0,  -4,  -2,  -1 },
21504       {  1,   0,  -2,  -6,  -1 },
21505       {  1,  -2,   2,   2,   1 },
21506       {  1,  -2,  -2,   2,  -1 },
21507       {  1,  -1,  -2,  -4,  -1 },
21508       {  0,   2,   0,   0,   2 },
21509       {  0,   1,   2,  -4,   2 },
21510       {  0,   1,  -2,   4,  -1 },
21511 
21512    /* 571-580 */
21513       {  5,   0,   0,   0,   0 },
21514       {  3,   0,   0,  -3,   0 },
21515       {  2,   2,   0,  -4,   0 },
21516       {  1,  -1,   2,   2,   0 },
21517       {  0,   1,   0,   3,   0 },
21518       {  4,   0,  -2,   0,  -1 },
21519       {  3,   0,  -2,  -6,  -1 },
21520       {  3,   0,  -2,  -1,  -1 },
21521       {  2,   1,   2,   2,   1 },
21522       {  2,   1,   0,   2,   1 },
21523 
21524    /* 581-590 */
21525       {  2,   0,   2,   4,   1 },
21526       {  2,   0,   2,  -6,   1 },
21527       {  2,   0,   2,  -2,  -1 },
21528       {  2,   0,   0,  -6,  -1 },
21529       {  2,  -1,  -2,  -2,  -1 },
21530       {  1,   2,   2,   0,   1 },
21531       {  1,   2,   0,   0,   1 },
21532       {  1,   0,   4,   0,   1 },
21533       {  1,   0,   2,  -6,   1 },
21534       {  1,   0,   2,  -4,  -1 },
21535 
21536    /* 591-600 */
21537       {  1,   0,  -1,  -2,  -1 },
21538       {  1,  -1,   2,   4,   1 },
21539       {  1,  -1,   2,  -3,   1 },
21540       {  1,  -1,   0,   4,   1 },
21541       {  1,  -1,  -2,   1,  -1 },
21542       {  0,   1,   2,  -2,   3 },
21543       {  3,   0,   0,  -2,   0 },
21544       {  1,   0,   1,  -2,   0 },
21545       {  0,   2,   0,  -4,   0 },
21546       {  0,   0,   2,  -4,   0 },
21547 
21548    /* 601-610 */
21549       {  0,   0,   1,  -1,   0 },
21550       {  0,   0,   0,   6,   0 },
21551       {  0,   2,   0,   0,  -2 },
21552       {  0,   1,  -2,   2,  -3 },
21553       {  4,   0,   0,   2,   0 },
21554       {  3,   0,   0,  -1,   0 },
21555       {  3,  -1,   0,   2,   0 },
21556       {  2,   1,   0,   1,   0 },
21557       {  2,   1,   0,  -6,   0 },
21558       {  2,  -1,   2,   0,   0 },
21559 
21560    /* 611-620 */
21561       {  1,   0,   2,  -1,   0 },
21562       {  1,  -1,   0,   1,   0 },
21563       {  1,  -1,  -2,  -2,   0 },
21564       {  0,   1,   2,   2,   0 },
21565       {  0,   0,   2,  -3,   0 },
21566       {  2,   2,   0,  -2,  -1 },
21567       {  2,  -1,  -2,   0,   1 },
21568       {  1,   2,   2,  -4,   1 },
21569       {  0,   1,   4,  -4,   2 },
21570       {  0,   0,   0,   3,   2 },
21571 
21572    /* 621-630 */
21573       {  5,   0,   2,   0,   1 },
21574       {  4,   1,   2,  -2,   2 },
21575       {  4,   0,  -2,  -2,   0 },
21576       {  3,   1,   2,   2,   2 },
21577       {  3,   1,   0,  -2,   0 },
21578       {  3,   1,  -2,  -6,  -2 },
21579       {  3,   0,   0,   0,  -2 },
21580       {  3,   0,  -2,  -4,  -2 },
21581       {  3,  -1,   0,  -3,   0 },
21582       {  3,  -1,   0,  -2,   0 },
21583 
21584    /* 631-640 */
21585       {  2,   1,   2,   0,   0 },
21586       {  2,   1,   2,  -4,   2 },
21587       {  2,   1,   2,  -2,   0 },
21588       {  2,   1,   0,  -3,   0 },
21589       {  2,   1,  -2,   0,  -2 },
21590       {  2,   0,   0,  -4,   2 },
21591       {  2,   0,   0,  -4,  -2 },
21592       {  2,   0,  -2,  -5,  -2 },
21593       {  2,  -1,   2,   4,   2 },
21594       {  2,  -1,   0,  -2,   2 },
21595 
21596    /* 641-650 */
21597       {  1,   3,  -2,  -2,  -2 },
21598       {  1,   1,   0,   0,  -2 },
21599       {  1,   1,   0,  -6,   0 },
21600       {  1,   1,  -2,   1,  -2 },
21601       {  1,   1,  -2,  -1,  -2 },
21602       {  1,   0,   2,   1,   0 },
21603       {  1,   0,   0,   3,   0 },
21604       {  1,   0,   0,  -4,   2 },
21605       {  1,   0,  -2,   4,  -2 },
21606       {  1,  -2,   0,  -1,   0 },
21607 
21608    /* 651-NFLS */
21609       {  0,   1,  -4,   2,  -1 },
21610       {  1,   0,  -2,   0,  -3 },
21611       {  0,   0,   4,  -4,   4 }
21612    };
21613     }
21614 
21615 
21616     /* Fundamental-argument multipliers:  planetary terms */
21617       private static final int mfapl[][] = {
21618 
21619        /* 1-10 */
21620           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21621           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -1 },
21622           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -2 },
21623           {  0,  0,  1, -1,  1,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21624           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  2 },
21625           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21626           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21627           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  0 },
21628           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21629           {  0,  0,  0,  0,  1,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
21630 
21631        /* 11-20 */
21632           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -1 },
21633           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2, -5,  0,  0,  0 },
21634           {  0,  0,  2, -2,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21635           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -2 },
21636           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -1,  0,  0,  0,  2 },
21637           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  3,  0,  0,  0, -2 },
21638           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -2 },
21639           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  3,  0,  0,  0,  2 },
21640           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21641           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21642 
21643        /* 21-30 */
21644           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
21645           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  2 },
21646           {  0,  0,  0,  0,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21647           {  0,  0,  0,  0,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21648           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21649           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  2 },
21650           {  0,  0,  1, -1,  1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21651           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21652           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  1 },
21653           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21654 
21655        /* 31-40 */
21656           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
21657           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21658           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  2 },
21659           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -2 },
21660           {  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
21661           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  1 },
21662           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21663           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21664           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
21665           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21666 
21667        /* 41-50 */
21668           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
21669           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -2 },
21670           {  0,  0,  1, -1,  0,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21671           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -2,  0,  0,  0,  2 },
21672           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -2 },
21673           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21674           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  2 },
21675           {  1,  0,  0,  0,  0,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21676           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21677           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  1,  0,  0,  0,  2 },
21678 
21679        /* 51-60 */
21680           {  0,  0,  1, -1,  1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21681           {  1,  0,  0,  0,  0,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
21682           {  0,  0,  2, -2,  0,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21683           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  2 },
21684           {  1,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21685           {  0,  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  2 },
21686           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1 },
21687           {  1,  0, -2,  0, -2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21688           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21689           {  0,  0,  2, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21690 
21691        /* 61-70 */
21692           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  2 },
21693           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0, -2 },
21694           {  0,  0,  1, -1,  1,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21695           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -2 },
21696           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  2 },
21697           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  2 },
21698           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -1 },
21699           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -1 },
21700           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -2 },
21701           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21702 
21703        /* 71-80 */
21704           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -2 },
21705           {  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0,  2 },
21706           {  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0, -2 },
21707           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -2 },
21708           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -2 },
21709           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  2 },
21710           {  0,  0,  1, -1,  1,  0,  0, -5,  8, -3,  0,  0,  0,  0 },
21711           {  0,  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  2 },
21712           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  2 },
21713           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
21714 
21715        /* 81-90 */
21716           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21717           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -1 },
21718           {  2,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21719           {  0,  0,  0,  0,  1,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21720           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -2,  5,  0,  0,  0 },
21721           {  1,  0,  0, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21722           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  2 },
21723           {  1,  0,  0,  0, -1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21724           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21725           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21726 
21727        /* 91-100 */
21728           {  1,  0,  0, -2,  0,  0, 19,-21,  3,  0,  0,  0,  0,  0 },
21729           {  0,  0,  0,  0,  1,  0, -8, 13,  0,  0,  0,  0,  0,  0 },
21730           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
21731           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -2 },
21732           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  2 },
21733           {  1,  0,  0,  0,  1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21734           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -1 },
21735           {  0,  0,  0,  0,  0,  0,  0,  6,-16,  4,  5,  0,  0, -2 },
21736           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -2 },
21737           {  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0, -2 },
21738 
21739        /* 101-110 */
21740           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0, -1 },
21741           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  1 },
21742           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21743           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, -1 },
21744           {  0,  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0 },
21745           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
21746           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21747           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  0 },
21748           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0 },
21749           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2,  0,  0,  0,  2 },
21750 
21751        /* 111-120 */
21752           {  0,  0,  0,  0,  1,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21753           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  2 },
21754           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21755           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21756           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -1 },
21757           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  2 },
21758           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  0 },
21759           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21760           {  2,  0,  0, -2,  0,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21761           {  0,  0,  1, -1,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21762 
21763        /* 121-130 */
21764           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1 },
21765           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21766           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0, -1 },
21767           {  0,  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0 },
21768           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -2 },
21769           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1,  0,  0,  0 },
21770           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -2 },
21771           {  0,  0,  1, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21772           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -2 },
21773           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21774 
21775        /* 131-140 */
21776           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -1 },
21777           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  0 },
21778           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1 },
21779           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0, -1 },
21780           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21781           {  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  2 },
21782           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -3,  0,  0,  0,  2 },
21783           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  1 },
21784           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  1 },
21785           {  0,  0,  0,  0,  1,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21786 
21787        /* 141-150 */
21788           {  1,  0,  0, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21789           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -1 },
21790           {  0,  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  2 },
21791           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  2 },
21792           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -2 },
21793           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -1 },
21794           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21795           {  0,  0,  1, -1,  1,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
21796           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0,  0 },
21797           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -1,  0,  0,  0,  2 },
21798 
21799        /* 151-160 */
21800           {  1,  0,  0, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21801           {  0,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21802           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -4, 10,  0,  0,  0 },
21803           {  0,  0,  0,  0,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21804           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21805           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0,  0 },
21806           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  2 },
21807           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0, -2 },
21808           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -2 },
21809           {  0,  0,  2, -2,  1,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
21810 
21811        /* 161-170 */
21812           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -1,  0,  0,  2 },
21813           {  0,  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  2 },
21814           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  2,  0 },
21815           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0, -1 },
21816           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -1 },
21817           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
21818           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  1 },
21819           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21820           {  0,  0,  2, -2,  1,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
21821           {  2,  0,  2,  0,  2,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21822 
21823        /* 171-180 */
21824           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -2 },
21825           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21826           {  1,  0,  0, -1, -1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21827           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -2 },
21828           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  0 },
21829           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  1 },
21830           {  1,  0,  2,  0,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21831           {  1,  0, -2,  0, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
21832           {  0,  0,  0,  0,  1,  0,  0, -2,  4,  0,  0,  0,  0,  0 },
21833           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0 },
21834 
21835        /* 181-190 */
21836           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  2 },
21837           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  1 },
21838           {  0,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21839           {  0,  0,  0,  0,  0,  0,  0,  1, -8,  3,  0,  0,  0, -2 },
21840           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -2 },
21841           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  3,  0,  0,  0,  2 },
21842           {  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
21843           {  0,  0,  1, -1,  1,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
21844           {  0,  0,  1, -1,  0,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21845           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  1 },
21846 
21847        /* 191-200 */
21848           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  0 },
21849           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -2 },
21850           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21851           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0 },
21852           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2, -5,  0,  0,  0 },
21853           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -1 },
21854           {  0,  0,  1, -1,  1,  0,  0, -9, 15,  0,  0,  0,  0,  0 },
21855           {  0,  0,  0,  0,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21856           {  0,  0,  0,  0,  1,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
21857           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0 },
21858 
21859        /* 201-210 */
21860           {  0,  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0, -2 },
21861           {  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  2 },
21862           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -1,  0,  0,  2 },
21863           {  2,  0,  0, -2,  1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21864           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0, -1 },
21865           {  0,  0,  1, -1,  1,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
21866           {  0,  0,  1, -1,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21867           {  0,  0,  1, -1,  1,  0,  8,-14,  0,  0,  0,  0,  0,  0 },
21868           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0 },
21869           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21870 
21871        /* 211-220 */
21872           {  0,  0,  0,  0,  1,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21873           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0 },
21874           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0,  0 },
21875           {  2,  0,  0, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21876           {  0,  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  2 },
21877           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1,  0,  0,  2 },
21878           {  2,  0, -1, -1,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
21879           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -2 },
21880           {  0,  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0 },
21881           {  0,  0,  1, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21882 
21883        /* 221-230 */
21884           {  2,  0,  0, -2,  0,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
21885           {  2,  0,  0, -2,  0,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
21886           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -1,  0,  0,  0,  0 },
21887           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  1 },
21888           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  1 },
21889           {  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  0,  2 },
21890           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21891           {  0,  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0 },
21892           {  0,  0,  0,  0,  0,  0,  3, -9,  4,  0,  0,  0,  0, -2 },
21893           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -2 },
21894 
21895        /* 231-240 */
21896           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0, -2 },
21897           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  1 },
21898           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -2 },
21899           {  0,  0,  0,  0,  0,  0,  3, -5,  4,  0,  0,  0,  0,  2 },
21900           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21901           {  2,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21902           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -2 },
21903           {  0,  0,  1, -1,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21904           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  2 },
21905           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0, -1 },
21906 
21907        /* 241-250 */
21908           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21909           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  1 },
21910           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0 },
21911           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21912           {  0,  0,  1, -1,  1,  0,  2, -4,  0, -3,  0,  0,  0,  0 },
21913           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
21914           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  2 },
21915           {  0,  0,  2, -2,  2,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
21916           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  0 },
21917           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -2,  0,  0,  0 },
21918 
21919        /* 251-260 */
21920           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1,  0,  0,  2 },
21921           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -2 },
21922           {  0,  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  2 },
21923           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -1 },
21924           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -1 },
21925           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  0 },
21926           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21927           {  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  2 },
21928           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  5,  0,  0,  2 },
21929           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  1 },
21930 
21931        /* 261-270 */
21932           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  2 },
21933           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2, -5,  0,  0,  2 },
21934           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
21935           {  2,  0,  0, -2, -1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21936           {  1,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21937           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0,  0 },
21938           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  2, -5,  0,  0,  2 },
21939           {  0,  0,  0,  0,  1,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
21940           {  0,  0,  2, -2,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21941           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21942 
21943        /* 271-280 */
21944           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21945           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  0 },
21946           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  1 },
21947           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -2 },
21948           {  0,  0,  0,  0,  0,  0,  0, 11,  0,  0,  0,  0,  0,  2 },
21949           {  0,  0,  0,  0,  0,  0,  0,  6,-15,  0,  0,  0,  0, -2 },
21950           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  1,  0,  0,  0,  2 },
21951           {  1,  0,  0, -1,  0,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21952           {  0,  0,  0,  0,  1,  0, -3,  7, -4,  0,  0,  0,  0,  0 },
21953           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -2,  0,  0,  0,  2 },
21954 
21955        /* 281-290 */
21956           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  1 },
21957           {  0,  0,  2, -2,  2,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21958           {  0,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21959           {  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  0,  2 },
21960           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  0 },
21961           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  2 },
21962           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0, -2 },
21963           {  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0 },
21964           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0,  0 },
21965           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0, -2 },
21966 
21967        /* 291-300 */
21968           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0, -2 },
21969           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21970           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21971           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  1 },
21972           {  0,  0,  0,  0,  0,  0,  9,-12,  0,  0,  0,  0,  0, -2 },
21973           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  1 },
21974           {  0,  0,  1, -1,  0,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21975           {  0,  0,  1, -1,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21976           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0, -1 },
21977           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -1 },
21978 
21979        /* 301-310 */
21980           {  0,  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  2 },
21981           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0, -2 },
21982           {  0,  0,  1, -1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21983           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -1 },
21984           {  0,  0,  1, -1, -1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21985           {  0,  0,  0,  0,  0,  0,  0,  1, -5,  0,  0,  0,  0, -2 },
21986           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
21987           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  0 },
21988           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
21989           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  2 },
21990 
21991        /* 311-320 */
21992           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0, -1 },
21993           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  3,  0,  0,  0 },
21994           {  0,  0,  0,  0,  1,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21995           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  2 },
21996           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  1 },
21997           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21998           {  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0, -2 },
21999           {  0,  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  2 },
22000           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  2 },
22001           {  0,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22002 
22003        /* 321-330 */
22004           {  0,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22005           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -3,  0,  0,  0,  2 },
22006           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  0 },
22007           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
22008           {  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  0,  2 },
22009           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  2 },
22010           {  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0,  0, -2 },
22011           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  1 },
22012           {  0,  0,  2, -2,  1, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
22013           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  2,  0,  0 },
22014 
22015        /* 331-340 */
22016           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
22017           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22018           {  0,  0,  2, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22019           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0,  0 },
22020           {  0,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22021           {  0,  0,  2, -2,  1,  0,  0, -8, 11,  0,  0,  0,  0,  0 },
22022           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
22023           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  2,  0,  0,  0 },
22024           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  2 },
22025           {  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0,  0, -2 },
22026 
22027        /* 341-350 */
22028           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -1 },
22029           {  0,  0,  0,  0,  0,  0,  0,  5, -2,  0,  0,  0,  0,  2 },
22030           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2 },
22031           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0, -2 },
22032           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  0 },
22033           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  3,  0,  0,  0,  2 },
22034           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22035           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0, -1 },
22036           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -1 },
22037           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  1 },
22038 
22039        /* 351-360 */
22040           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -1 },
22041           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -1 },
22042           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  2 },
22043           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  2 },
22044           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0,  0 },
22045           {  2,  0,  0, -2, -1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
22046           {  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0, -2 },
22047           {  2,  0, -1, -1, -1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
22048           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0 },
22049           {  0,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22050 
22051        /* 361-370 */
22052           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  4, -3,  0,  0,  0 },
22053           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0,  0 },
22054           {  2,  0,  0, -2,  1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
22055           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0, -2 },
22056           {  0,  0,  0,  0,  0,  0,  0,  6, -5,  0,  0,  0,  0,  2 },
22057           {  1,  0, -2, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22058           {  0,  0,  1, -1,  2,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
22059           {  0,  0,  0,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22060           {  0,  0,  0,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22061           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  1 },
22062 
22063        /* 371-380 */
22064           {  0,  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  2 },
22065           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0, -2,  0,  0,  2 },
22066           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -2,  0,  0,  2 },
22067           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  1 },
22068           {  0,  0,  0,  0,  0,  0,  0,  1, -6,  0,  0,  0,  0, -2 },
22069           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  2 },
22070           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  2 },
22071           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
22072           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
22073           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  2 },
22074 
22075        /* 381-390 */
22076           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
22077           {  0,  0,  0,  0,  1,  0,  0, -8, 15,  0,  0,  0,  0,  0 },
22078           {  2,  0,  0, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22079           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22080           {  1,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22081           {  1,  0, -1,  1, -1,  0,-18, 17,  0,  0,  0,  0,  0,  0 },
22082           {  0,  0,  2,  0,  2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22083           {  0,  0,  2,  0,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22084           {  0,  0,  2, -2, -1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
22085           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22086 
22087        /* 391-400 */
22088           {  0,  0,  0,  0,  1,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22089           {  0,  0,  0,  0,  0,  0,  8,-16,  0,  0,  0,  0,  0, -2 },
22090           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  0,  0,  2 },
22091           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2 },
22092           {  0,  0,  0,  0,  2,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
22093           {  2,  0, -1, -1, -2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22094           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -1 },
22095           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  4,  0,  0,  0 },
22096           {  0,  0,  0,  0,  0,  0,  0,  2,  2,  0,  0,  0,  0,  2 },
22097           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  4, -5,  0,  0,  0 },
22098 
22099        /* 401-410 */
22100           {  2,  0,  0, -2, -1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22101           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
22102           {  1,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
22103           {  1,  0,  0, -1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22104           {  1,  0, -1, -1, -1,  0, 20,-20,  0,  0,  0,  0,  0,  0 },
22105           {  0,  0,  2, -2,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22106           {  0,  0,  1, -1,  1,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
22107           {  0,  0,  1, -1,  1,  0, -2,  1,  0,  0,  0,  0,  0,  0 },
22108           {  0,  0,  0,  0,  1,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
22109           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1,  0,  0,  0 },
22110 
22111        /* 411-420 */
22112           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -1 },
22113           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  1 },
22114           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -1 },
22115           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  1 },
22116           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0,  0 },
22117           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0 },
22118           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -2 },
22119           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22120           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
22121           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0 },
22122 
22123        /* 421-430 */
22124           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22125           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0, -2 },
22126           {  0,  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0, -2 },
22127           {  1,  0,  0, -2,  0,  0, 20,-21,  0,  0,  0,  0,  0,  0 },
22128           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0,  0 },
22129           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  0 },
22130           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0 },
22131           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22132           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0, -2 },
22133           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0,  0 },
22134 
22135        /* 431-440 */
22136           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  2 },
22137           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0,  2 },
22138           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0, -2 },
22139           {  0,  0,  0,  0,  0,  0,  0,  2, -7,  0,  0,  0,  0, -2 },
22140           {  1,  0,  0, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22141           {  1,  0, -2,  0, -2,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22142           {  0,  0,  0,  0,  1,  0,  0, -9, 17,  0,  0,  0,  0,  0 },
22143           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -2 },
22144           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22145           {  1,  0, -1,  1, -1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22146 
22147        /* 441-450 */
22148           {  0,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22149           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22150           {  0,  0,  1, -1,  2,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22151           {  0,  0,  0,  0,  1,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
22152           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -1 },
22153           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -2 },
22154           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0,  0 },
22155           {  0,  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0, -2 },
22156           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -4,  0,  0,  0,  2 },
22157           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -5,  0,  0,  0, -2 },
22158 
22159        /* 451-460 */
22160           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -5,  0,  0,  0, -2 },
22161           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  5,  0,  0,  2 },
22162           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0, -2 },
22163           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  1 },
22164           {  1,  0,  0, -2,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22165           {  0,  0,  0,  0,  0,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
22166           {  2,  0,  2,  0,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22167           {  0,  0,  1, -1, -1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22168           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
22169           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0, -2 },
22170 
22171        /* 461-470 */
22172           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22173           {  0,  0,  2, -2,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22174           {  0,  0,  2, -2,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22175           {  0,  0,  2, -2,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22176           {  0,  0,  2, -2,  1,  0,  0, -3,  0,  3,  0,  0,  0,  0 },
22177           {  0,  0,  2, -2,  1,  0, -5,  5,  0,  0,  0,  0,  0,  0 },
22178           {  0,  0,  1, -1,  1,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22179           {  0,  0,  1, -1,  1,  0,  0, -4,  6,  0,  0,  0,  0,  0 },
22180           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0, -1,  0,  0 },
22181           {  0,  0,  1, -1,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
22182 
22183        /* 471-480 */
22184           {  0,  0,  0,  0,  1,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
22185           {  0,  0,  0,  0,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22186           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -1 },
22187           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  1 },
22188           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -2 },
22189           {  0,  0,  0,  0,  0,  0,  3, -8,  0,  0,  0,  0,  0, -2 },
22190           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -1 },
22191           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -1 },
22192           {  0,  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  2 },
22193           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  2 },
22194 
22195        /* 481-490 */
22196           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  2 },
22197           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0, -2 },
22198           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  1 },
22199           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  1 },
22200           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1 },
22201           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0, -1 },
22202           {  2,  0,  0, -2, -1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
22203           {  2,  0, -1, -1,  1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
22204           {  0,  0,  2, -2,  1,  0,  0, -7,  9,  0,  0,  0,  0,  0 },
22205           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -1 },
22206 
22207        /* 491-500 */
22208           {  0,  0,  1, -1,  2,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
22209           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22210           {  1,  0,  0, -2,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22211           {  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  0,  0 },
22212           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0 },
22213           {  2,  0,  0, -2,  1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
22214           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
22215           {  1,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22216           {  1,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22217           {  1,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22218 
22219        /* 501-510 */
22220           {  1,  0,  0, -1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22221           {  1,  0, -1,  0, -1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22222           {  0,  0,  2, -2,  1,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22223           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  0,  0,  0,  0 },
22224           {  0,  0,  2, -2,  1,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
22225           {  0,  0,  2, -2,  0,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
22226           {  0,  0,  1,  1,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22227           {  0,  0,  1, -1,  1,  0,  0,  1, -4,  0,  0,  0,  0,  0 },
22228           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1, -3,  0,  0,  0 },
22229           {  0,  0,  0,  0,  1,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
22230 
22231        /* 511-520 */
22232           {  0,  0,  0,  0,  1,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22233           {  0,  0,  0,  0,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22234           {  0,  0,  0,  0,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22235           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0,  0 },
22236           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -1 },
22237           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  1 },
22238           {  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  0,  1 },
22239           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -1 },
22240           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  0 },
22241           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  1 },
22242 
22243        /* 521-530 */
22244           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -1 },
22245           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0, -2 },
22246           {  0,  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  2 },
22247           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  1 },
22248           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0, -1 },
22249           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0 },
22250           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -1 },
22251           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  1 },
22252           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0 },
22253           {  2,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22254 
22255        /* 531-540 */
22256           {  2,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22257           {  1,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22258           {  1,  0,  0,  0,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22259           {  1,  0,  0,  0,  0,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22260           {  1,  0,  0, -2,  0,  0, 17,-16,  0, -2,  0,  0,  0,  0 },
22261           {  1,  0,  0, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22262           {  0,  0,  2, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22263           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0 },
22264           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  0,  0 },
22265           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -4,  0,  0,  0,  0 },
22266 
22267        /* 541-550 */
22268           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2, -2 },
22269           {  0,  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  2 },
22270           {  2,  0,  0, -2,  0,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22271           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  2,  0,  0,  0 },
22272           {  1,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22273           {  1,  0,  0,  0,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22274           {  1,  0,  0,  0,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22275           {  1,  0,  0, -2,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22276           {  1,  0,  0, -2,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22277           {  1,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22278 
22279        /* 551-560 */
22280           {  1,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22281           {  0,  0,  2, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22282           {  0,  0,  1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22283           {  0,  0,  1, -1,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22284           {  0,  0,  1, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22285           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22286           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22287           {  0,  0,  1, -1,  0,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
22288           {  0,  0,  1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22289           {  0,  0,  0,  2,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22290 
22291        /* 561-570 */
22292           {  0,  0,  0,  0,  0,  0,  8, -9,  0,  0,  0,  0,  0,  0 },
22293           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22294           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  0 },
22295           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0 },
22296           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0 },
22297           {  2,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22298           {  1,  0,  0,  0,  1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22299           {  1,  0,  0,  0, -1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22300           {  0,  0,  2,  0,  2,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
22301           {  0,  0,  2,  0,  2,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22302 
22303        /* 571-580 */
22304           {  0,  0,  2,  0,  2,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
22305           {  0,  0,  2,  0,  2,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22306           {  0,  0,  0,  0,  2,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
22307           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22308           {  2,  0,  2, -2,  2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22309           {  2,  0,  1, -3,  1,  0, -6,  7,  0,  0,  0,  0,  0,  0 },
22310           {  2,  0,  0, -2,  0,  0,  2, -5,  0,  0,  0,  0,  0,  0 },
22311           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  5, -5,  0,  0,  0 },
22312           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  1,  5,  0,  0,  0 },
22313           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
22314 
22315        /* 581-590 */
22316           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
22317           {  2,  0,  0, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22318           {  2,  0, -2,  0, -2,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
22319           {  2,  0, -1, -1,  0,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
22320           {  1,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22321           {  1,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22322           {  1,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22323           {  1,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22324           {  1,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22325           {  1,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22326 
22327        /* 591-600 */
22328           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22329           {  1,  0,  0, -2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22330           {  1,  0, -2, -2, -2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22331           {  1,  0, -1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22332           {  1,  0, -1, -1,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
22333           {  0,  0,  2,  2,  2,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22334           {  0,  0,  2, -2,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22335           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  1,  0,  0,  0,  0 },
22336           {  0,  0,  2, -2,  1,  0,  0,-10, 15,  0,  0,  0,  0,  0 },
22337           {  0,  0,  2, -2,  0, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
22338 
22339        /* 601-610 */
22340           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
22341           {  0,  0,  1, -1,  2,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22342           {  0,  0,  1, -1,  1,  0, -4,  6,  0,  0,  0,  0,  0,  0 },
22343           {  0,  0,  1, -1,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22344           {  0,  0,  1, -1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22345           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22346           {  0,  0,  1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22347           {  0,  0,  1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
22348           {  0,  0,  1, -1, -1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22349           {  0,  0,  0,  2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22350 
22351        /* 611-620 */
22352           {  0,  0,  0,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22353           {  0,  0,  0,  0,  2,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22354           {  0,  0,  0,  0,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22355           {  0,  0,  0,  0,  0,  0,  9,-13,  0,  0,  0,  0,  0, -2 },
22356           {  0,  0,  0,  0,  0,  0,  8,-14,  0,  0,  0,  0,  0, -2 },
22357           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -1 },
22358           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0,  0 },
22359           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0,  0 },
22360           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0, -1 },
22361           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -2 },
22362 
22363        /* 621-630 */
22364           {  0,  0,  0,  0,  0,  0,  5, -6, -4,  0,  0,  0,  0, -2 },
22365           {  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  0,  2 },
22366           {  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0, -2 },
22367           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0,  0 },
22368           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  2,  0,  0,  0,  2 },
22369           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  0 },
22370           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  0 },
22371           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -2 },
22372           {  0,  0,  0,  0,  0,  0,  0,  7,-12,  0,  0,  0,  0, -2 },
22373           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0, -2 },
22374 
22375        /* 631-640 */
22376           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  1,  5,  0,  0,  2 },
22377           {  0,  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  2 },
22378           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0 },
22379           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -4,  0,  0,  0,  2 },
22380           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -1 },
22381           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  2 },
22382           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0, -2 },
22383           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0 },
22384           {  0,  0,  0,  0,  0,  0,  0,  5,-16,  4,  5,  0,  0, -2 },
22385           {  0,  0,  0,  0,  0,  0,  0,  5,-13,  0,  0,  0,  0, -2 },
22386 
22387        /* 641-650 */
22388           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -5,  0,  0,  0, -2 },
22389           {  0,  0,  0,  0,  0,  0,  0,  3, -9,  0,  0,  0,  0, -2 },
22390           {  0,  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0, -2 },
22391           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2,  0,  0,  0,  2 },
22392           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -3,  0,  0,  0 },
22393           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  1,  5,  0,  0, -2 },
22394           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1, -5,  0,  0,  0 },
22395           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2,  0,  0,  2 },
22396           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -3,  0,  0,  0 },
22397           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0 },
22398 
22399        /* 651-NFPL */
22400           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0 },
22401           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -6,  3,  0, -2 },
22402           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0 },
22403           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0 },
22404           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2 },
22405           {  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0 }
22406        };
22407 
22408       /**
22409        *
22410        *  Time scale transformation:  Terrestrial Time, TT, to International
22411        *  Atomic Time, TAI.
22412        *
22413        * <p>This function is derived from the International Astronomical Union's
22414        *  SOFA (Standards of Fundamental Astronomy) software collection.
22415        *
22416        *<p>Status:  canonical.
22417        *
22418        *<!-- Given: -->
22419        *    @param tt1    double    TT as a 2-part Julian Date
22420        *    @param tt2    double    TT as a 2-part Julian Date
22421        *
22422        *<!-- Returned:-->
22423        *     @return   TAI as a 2-part Julian Date
22424        *
22425        *  Returned (function value):
22426        *                int       status:  0 = OK
22427        *
22428        *  Note:
22429        *
22430        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22431        *     the two arguments, for example where tt1 is the Julian Day Number
22432        *     and tt2 is the fraction of a day.  The returned tai1,tai2 follow
22433        *     suit.
22434        *
22435        *<p>References:
22436        *
22437        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22438        *     IERS Technical Note No. 32, BKG (2004)
22439        *
22440        *     Explanatory Supplement to the Astronomical Almanac,
22441        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22442        *
22443        *@version 2010 May 13
22444        *
22445        *@since SOFA release 2010-12-01
22446        *
22447        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22448        */
22449       public static JulianDate jauTttai(double tt1, double tt2)
22450       {
22451           double tai1, tai2;
22452           /* TT minus TAI (days). */
22453           final double dtat = TTMTAI / 86400.0;
22454 
22455 
22456           /* Result, safeguarding precision. */
22457           if ( abs(tt1) > abs(tt2) ) {
22458               tai1 = tt1;
22459               tai2 = tt2 - dtat;
22460           } else {
22461               tai1 = tt1 - dtat;
22462               tai2 = tt2;
22463           }
22464 
22465           return new JulianDate(tai1, tai2);
22466 
22467       };
22468 
22469       /**
22470        *
22471        *  Time scale transformation:  Terrestrial Time, TT, to Geocentric
22472        *  Coordinate Time, TCG.
22473        *
22474        * <p>This function is derived from the International Astronomical Union's
22475        *  SOFA (Standards of Fundamental Astronomy) software collection.
22476        *
22477        *<p>Status:  canonical.
22478        *
22479        *<!-- Given: -->
22480        *     @param tt1 double    TT as a 2-part Julian Date
22481        *     @param tt2 double    TT as a 2-part Julian Date
22482        *
22483        *<!-- Returned:-->
22484        *     @return   TCG as a 2-part Julian Date
22485        *
22486        *  Returned (function value):
22487        *                int       status:  0 = OK
22488        *
22489        *  Note:
22490        *
22491        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22492        *     the two arguments, for example where tt1 is the Julian Day Number
22493        *     and tt2 is the fraction of a day.  The returned tcg1,tcg2 follow
22494        *     suit.
22495        *
22496        *<p>References:
22497        *
22498        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22499        *     IERS Technical Note No. 32, BKG (2004)
22500        *
22501        *     IAU 2000 Resolution B1.9
22502        *
22503        *@version 2010 May 13
22504        *
22505        *@since SOFA release 2010-12-01
22506        *
22507        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22508        */
22509       public static JulianDate jauTttcg(double tt1, double tt2)
22510 
22511       {
22512           double tcg1, tcg2;
22513 
22514           /* 1977 Jan 1 00:00:32.184 TT, as MJD */
22515           final double t77t = DJM77 + TTMTAI/DAYSEC;
22516 
22517           /* TT to TCG rate */
22518           final double elgg = ELG/(1.0-ELG);
22519 
22520 
22521           /* Result, safeguarding precision. */
22522           if ( abs(tt1) > abs(tt2) ) {
22523               tcg1 = tt1;
22524               tcg2 = tt2 + ( ( tt1 - DJM0 ) + ( tt2 - t77t ) ) * elgg;
22525           } else {
22526               tcg1 = tt1 + ( ( tt2 - DJM0 ) + ( tt1 - t77t ) ) * elgg;
22527               tcg2 = tt2;
22528           }
22529 
22530           return new JulianDate(tcg1, tcg2);
22531 
22532       };      
22533 
22534       /**
22535        *
22536        *  Time scale transformation:  Terrestrial Time, TT, to Barycentric
22537        *  Dynamical Time, TDB.
22538        *
22539        * <p>This function is derived from the International Astronomical Union's
22540        *  SOFA (Standards of Fundamental Astronomy) software collection.
22541        *
22542        *<p>Status:  canonical.
22543        *
22544        *<!-- Given: -->
22545        *     @param tt1    double    TT as a 2-part Julian Date
22546        *     @param tt2    double    TT as a 2-part Julian Date
22547        *     @param dtr        double    TDB-TT in seconds
22548        *
22549        *<!-- Returned:-->
22550        *     @return   TDB as a 2-part Julian Date
22551        *
22552        *  Returned (function value):
22553        *                int       status:  0 = OK
22554        *
22555        *<p>Notes:
22556        *
22557        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22558        *     the two arguments, for example where tt1 is the Julian Day Number
22559        *     and tt2 is the fraction of a day.  The returned tdb1,tdb2 follow
22560        *     suit.
22561        *
22562        *  2  The argument dtr represents the quasi-periodic component of the
22563        *     GR transformation between TT and TCB.  It is dependent upon the
22564        *     adopted solar-system ephemeris, and can be obtained by numerical
22565        *     integration, by interrogating a precomputed time ephemeris or by
22566        *     evaluating a model such as that implemented in the SOFA function
22567        *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
22568        *     amplitude.
22569        *
22570        *  3  TDB is essentially the same as Teph, the time argument for the JPL
22571        *     solar system ephemerides.
22572        *
22573        *<p>References:
22574        *
22575        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22576        *     IERS Technical Note No. 32, BKG (2004)
22577        *
22578        *     IAU 2006 Resolution 3
22579        *
22580        *@version 2010 May 13
22581        *
22582        *@since SOFA release 2010-12-01
22583        *
22584        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22585        */
22586       public static JulianDate jauTttdb(double tt1, double tt2, double dtr)
22587       {
22588 
22589           double tdb1, tdb2;
22590           double dtrd;
22591 
22592 
22593           /* Result, safeguarding precision. */
22594           dtrd = dtr / DAYSEC;
22595           if ( abs(tt1) > abs(tt2) ) {
22596               tdb1 = tt1;
22597               tdb2 = tt2 + dtrd;
22598           } else {
22599               tdb1 = tt1 + dtrd;
22600               tdb2 = tt2;
22601           }
22602 
22603           return new JulianDate(tdb1, tdb2);
22604 
22605       };
22606 
22607       /**
22608        *
22609        *  Time scale transformation:  Terrestrial Time, TT, to Universal Time,
22610        *  UT1.
22611        *
22612        * <p>This function is derived from the International Astronomical Union's
22613        *  SOFA (Standards of Fundamental Astronomy) software collection.
22614        *
22615        *<p>Status:  canonical.
22616        *
22617        *<!-- Given: -->
22618        *    @param tt1    double    TT as a 2-part Julian Date
22619        *    @param tt2    double    TT as a 2-part Julian Date
22620        *    @param dt         double    TT-UT1 in seconds
22621        *
22622        *<!-- Returned:-->
22623        *     @return   UT1 as a 2-part Julian Date
22624        *
22625        *  Returned (function value):
22626        *                int       status:  0 = OK
22627        *
22628        *<p>Notes:
22629        *
22630        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22631        *     the two arguments, for example where tt1 is the Julian Day Number
22632        *     and tt2 is the fraction of a day.  The returned ut11,ut12 follow
22633        *     suit.
22634        *
22635        *  2  The argument dt is classical Delta T.
22636        *
22637        *  Reference:
22638        *
22639        *     Explanatory Supplement to the Astronomical Almanac,
22640        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22641        *
22642        *@version 2010 May 16
22643        *
22644        *@since SOFA release 2010-12-01
22645        *
22646        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22647        */
22648       public static JulianDate jauTtut1(double tt1, double tt2, double dt)
22649 
22650       {
22651 
22652           double ut11, ut12;
22653           double dtd;
22654 
22655 
22656           /* Result, safeguarding precision. */
22657           dtd = dt / DAYSEC;
22658           if ( abs(tt1) > abs(tt2) ) {
22659               ut11 = tt1;
22660               ut12 = tt2 - dtd;
22661           } else {
22662               ut11 = tt1 - dtd;
22663               ut12 = tt2;
22664           }
22665 
22666           return new JulianDate(ut11, ut12);
22667       };
22668 
22669       /**
22670        *
22671        *  Time scale transformation:  Universal Time, UT1, to International
22672        *  Atomic Time, TAI.
22673        *
22674        * <p>This function is derived from the International Astronomical Union's
22675        *  SOFA (Standards of Fundamental Astronomy) software collection.
22676        *
22677        *<p>Status:  canonical.
22678        *
22679        *<!-- Given: -->
22680        *   @param  ut11  double    UT1 as a 2-part Julian Date
22681        *   @param  ut12  double    UT1 as a 2-part Julian Date
22682        *   @param  dta        double    UT1-TAI in seconds
22683        *
22684        *<!-- Returned:-->
22685        *    @return    TAI as a 2-part Julian Date
22686        *
22687        *  Returned (function value):
22688        *                int       status:  0 = OK
22689        *
22690        *<p>Notes:
22691        *
22692        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22693        *     between the two arguments, for example where ut11 is the Julian
22694        *     Day Number and ut12 is the fraction of a day.  The returned
22695        *     TAI1,TAI2 follow suit.
22696        *
22697        *  2  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
22698        *     available from IERS tabulations.
22699        *
22700        *  Reference:
22701        *
22702        *     Explanatory Supplement to the Astronomical Almanac,
22703        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22704        *
22705        *@version 2010 May 16
22706        *
22707        *@since SOFA release 2010-12-01
22708        *
22709        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22710        */
22711       public static JulianDate jauUt1tai(double ut11, double ut12, double dta )
22712 
22713       {
22714           double tai1, tai2;
22715           double dtad;
22716 
22717 
22718           /* Result, safeguarding precision. */
22719           dtad = dta / DAYSEC;
22720           if ( abs(ut11) > abs(ut12) ) {
22721               tai1 = ut11;
22722               tai2 = ut12 - dtad;
22723           } else {
22724               tai1 = ut11 - dtad;
22725               tai2 = ut12;
22726           }
22727           return new JulianDate(tai1, tai2);
22728 
22729       };
22730 
22731       /**
22732        *
22733        *  Time scale transformation:  Universal Time, UT1, to Terrestrial
22734        *  Time, TT.
22735        *
22736        * <p>This function is derived from the International Astronomical Union's
22737        *  SOFA (Standards of Fundamental Astronomy) software collection.
22738        *
22739        *<p>Status:  canonical.
22740        *
22741        *<!-- Given: -->
22742        *   @param  ut11  double    UT1 as a 2-part Julian Date
22743        *   @param  ut12  double    UT1 as a 2-part Julian Date
22744        *   @param  dt         double    TT-UT1 in seconds
22745        *
22746        *<!-- Returned:-->
22747        *     @return    TAI as a 2-part Julian Date
22748        *
22749        *  Returned (function value):
22750        *                int       status:  0 = OK
22751        *
22752        *<p>Notes:
22753        *
22754        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22755        *     between the two arguments, for example where ut11 is the Julian
22756        *     Day Number and ut12 is the fraction of a day.  The returned
22757        *     tt1,tt2 follow suit.
22758        *
22759        *  2  The argument dt is classical Delta T.
22760        *
22761        *  Reference:
22762        *
22763        *     Explanatory Supplement to the Astronomical Almanac,
22764        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22765        *
22766        *@version 2010 May 16
22767        *
22768        *@since SOFA release 2010-12-01
22769        *
22770        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22771        */
22772       public static JulianDate jauUt1tt(double ut11, double ut12, double dt)
22773       {
22774 
22775           double tt1, tt2;
22776           double dtd;
22777 
22778 
22779           /* Result, safeguarding precision. */
22780           dtd = dt / DAYSEC;
22781           if ( abs(ut11) > abs(ut12) ) {
22782               tt1 = ut11;
22783               tt2 = ut12 + dtd;
22784           } else {
22785               tt1 = ut11 + dtd;
22786               tt2 = ut12;
22787           }
22788 
22789           return new JulianDate(tt1, tt2);
22790 
22791       };
22792 
22793       /**
22794        *
22795        *  Time scale transformation:  Universal Time, UT1, to Coordinated
22796        *  Universal Time, UTC.
22797        *
22798        * <p>This function is derived from the International Astronomical Union's
22799        *  SOFA (Standards of Fundamental Astronomy) software collection.
22800        *
22801        *<p>Status:  canonical.
22802        *
22803        *<!-- Given: -->
22804        *  @param ut11 double   UT1 as a 2-part Julian Date (Note 1)
22805        *  @param ut12 double   UT1 as a 2-part Julian Date (Note 1) 
22806        *  @param   dut1       double   Delta UT1: UT1-UTC in seconds (Note 2)
22807        *
22808        *<!-- Returned:-->
22809        *     @return  JulianDate   UTC as a 2-part quasi Julian Date (Notes 3,4)
22810        *
22811        *  Returned (function value):
22812        *                int      status: +1 = dubious year (Note 5)
22813        *                                  0 = OK
22814        *                                 -1 = unacceptable date
22815        *
22816        *<p>Notes:
22817        *<ol>
22818        *  <li>  ut11+ut12 is Julian Date, apportioned in any convenient way
22819        *     between the two arguments, for example where ut11 is the Julian
22820        *     Day Number and ut12 is the fraction of a day.  The returned utc1
22821        *     and utc2 form an analogous pair, except that a special convention
22822        *     is used, to deal with the problem of leap seconds - see Note 3.
22823        *
22824        *  <li> Delta UT1 can be obtained from tabulations provided by the
22825        *     International Earth Rotation and Reference Systems Service.  The
22826        *     value changes abruptly by 1s at a leap second;  however, close to
22827        *     a leap second the algorithm used here is tolerant of the "wrong"
22828        *     choice of value being made.
22829        *
22830        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22831        *     special measures are taken.  The convention in the present
22832        *     function is that the returned quasi JD day UTC1+UTC2 represents
22833        *     UTC days whether the length is 86399, 86400 or 86401 SI seconds.
22834        *
22835        *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
22836        *     into calendar date and clock time, including UTC leap second
22837        *     handling.
22838        *
22839        *  <li> The warning status "dubious year" flags UTCs that predate the
22840        *     introduction of the time scale and that are too far in the future
22841        *     to be trusted.  See jauDat for further details.
22842        *</ol>
22843        *  Called:
22844        *  <ul>
22845        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22846        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22847        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22848        *</ul>
22849        *<p>References:
22850        *
22851        *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22852        *     IERS Technical Note No. 32, BKG (2004)
22853        *
22854        *     <p>Explanatory Supplement to the Astronomical Almanac,
22855        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22856        *
22857        *@version 2010 May 16
22858        *
22859        *@since SOFA release 2010-12-01
22860        *
22861        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22862        * @throws JSOFAIllegalParameter unacceptable date
22863        * @throws JSOFAInternalError an internal error has occured
22864        */
22865       public static JulianDate jauUt1utc(double ut11, double ut12, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
22866 
22867       {
22868 
22869           double utc1, utc2;
22870           boolean big1;
22871           int i;
22872           double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du;
22873 
22874 
22875           /* UT1-UTC in seconds. */
22876           duts = dut1;
22877 
22878           /* Put the two parts of the UT1 into big-first order. */
22879           big1 = ( abs(ut11) >= abs(ut12) );
22880           if ( big1 ) {
22881               u1 = ut11;
22882               u2 = ut12;
22883           } else {
22884               u1 = ut12;
22885               u2 = ut11;
22886           }
22887 
22888           /* See if the UT1 can possibly be in a leap-second day. */
22889           d1 = u1;
22890           dats1 = 0;
22891           for ( i = -1; i <= 3; i++ ) {
22892               d2 = u2 + (double) i;
22893               Calendar dt = jauJd2cal(d1, d2 );
22894               dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
22895               if ( i == - 1 ) dats1 = dats2;
22896               ddats = dats2 - dats1;
22897               if ( abs(ddats) >= 0.5 ) {
22898 
22899                   /* Yes, leap second nearby: ensure UT1-UTC is "before" value. */
22900                   if ( ddats * duts >= 0 ) duts -= ddats;
22901 
22902                   /* UT1 for the start of the UTC day that ends in a leap. */
22903                   JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
22904                   d1 = jd.djm0; d2 = jd.djm1;
22905                   us1 = d1;
22906                   us2 = d2 - 1.0 + duts/DAYSEC;
22907 
22908                   /* Is the UT1 after this point? */
22909                   du = u1 - us1;
22910                   du += u2 - us2;
22911                   if ( du > 0 ) {
22912 
22913                       /* Yes:  fraction of the current UTC day that has elapsed. */
22914                       fd = du * DAYSEC / ( DAYSEC + ddats );
22915 
22916                       /* Ramp UT1-UTC to bring about SOFA's JD(UTC) convention. */
22917                       duts += ddats * ( fd <= 1.0 ? fd : 1.0 );
22918                   }
22919 
22920                   /* Done. */
22921                   break;
22922               }
22923               dats1 = dats2;
22924           }
22925 
22926           /* Subtract the (possibly adjusted) UT1-UTC from UT1 to give UTC. */
22927           u2 -= duts / DAYSEC;
22928 
22929           /* Result, safeguarding precision. */
22930           if ( big1 ) {
22931               utc1 = u1;
22932               utc2 = u2;
22933           } else {
22934               utc1 = u2;
22935               utc2 = u1;
22936           }
22937 
22938           /* FIXME Status. */
22939           return new JulianDate(utc1, utc2);
22940 
22941       };
22942 
22943       /**
22944        *
22945        *  Time scale transformation:  Coordinated Universal Time, UTC, to
22946        *  International Atomic Time, TAI.
22947        *
22948        * <p>This function is derived from the International Astronomical Union's
22949        *  SOFA (Standards of Fundamental Astronomy) software collection.
22950        *
22951        *<p>Status:  canonical.
22952        *
22953        *<!-- Given: -->
22954        *     @param utc1 double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22955        *     @param utc2 double   UTC as a 2-part quasi Julian Date (Notes 1-4) 
22956        *
22957        *<!-- Returned:-->
22958        *     @return JulianDate     TAI as a 2-part Julian Date (Note 5)
22959        *
22960        *  Returned (function value):
22961        *                int      status: +1 = dubious year (Note 3)
22962        *                                  0 = OK
22963        *                                 -1 = unacceptable date
22964        *
22965        *<p>Notes:
22966        *<ol>
22967        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
22968        *     convenient way between the two arguments, for example where utc1
22969        *     is the Julian Day Number and utc2 is the fraction of a day.
22970        *
22971        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22972        *     special measures are taken.  The convention in the present
22973        *     function is that the JD day represents UTC days whether the
22974        *     length is 86399, 86400 or 86401 SI seconds.
22975        *
22976        *  <li> The warning status "dubious year" flags UTCs that predate the
22977        *     introduction of the time scale and that are too far in the future
22978        *     to be trusted.  See jauDat  for further details.
22979        *
22980        *  <li> The function jauDtf2d converts from calendar date and time of day
22981        *     into 2-part Julian Date, and in the case of UTC implements the
22982        *     leap-second-ambiguity convention described above.
22983        *
22984        *  <li> The returned TAI1,TAI2 are such that their sum is the TAI Julian
22985        *     Date.
22986        *</ol>
22987        *  Called:<ul>
22988        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22989        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22990        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22991        *</ul>
22992        *<p>References:
22993        *
22994        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22995        *     IERS Technical Note No. 32, BKG (2004)
22996        *
22997        *     Explanatory Supplement to the Astronomical Almanac,
22998        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22999        *
23000        *@version 2010 September 10
23001        *
23002        *@since SOFA release 2010-12-01
23003        *
23004        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
23005      * @throws JSOFAInternalError an internal error has occured
23006      * @throws JSOFAIllegalParameter unaccaptable date
23007        *
23008        */
23009       public static JulianDate jauUtctai(double utc1, double utc2) throws JSOFAIllegalParameter, JSOFAInternalError
23010 
23011       {
23012           double tai1, tai2;
23013           boolean big1;
23014           double u1, u2,  dats,  datst, ddat, a2, fd;
23015 
23016 
23017           /* Put the two parts of the UTC into big-first order. */
23018           big1 = ( abs(utc1) >= abs(utc2) );
23019           if ( big1 ) {
23020               u1 = utc1;
23021               u2 = utc2;
23022           } else {
23023               u1 = utc2;
23024               u2 = utc1;
23025           }
23026 
23027           /* Get TAI-UTC now. */
23028           Calendar dt = jauJd2cal(u1, u2 );
23029           dats = jauDat(dt.iy, dt.im, dt.id, dt.fd);
23030  //         if ( js < 0 ) return -1;
23031           fd = dt.fd;
23032           /* Get TAI-UTC tomorrow. */
23033           Calendar dtt = jauJd2cal(u1+1.5, u2-fd );
23034           datst = jauDat(dtt.iy, dtt.im, dtt.id, dtt.fd);
23035 //          if ( js < 0 ) return -1;
23036 
23037           /* If today ends in a leap second, scale the fraction into SI days. */
23038           ddat = datst - dats;
23039           if ( abs(ddat) > 0.5 ) fd += fd * ddat / DAYSEC;
23040 
23041           /* Today's calendar date to 2-part JD. */
23042           JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id ) ;
23043 
23044           /* Assemble the TAI result, preserving the UTC split and order. */
23045           a2 = jd.djm0 - u1;
23046           a2 += jd.djm1;
23047           a2 += fd + dats / DAYSEC;
23048           if ( big1 ) {
23049               tai1 = u1;
23050               tai2 = a2;
23051           } else {
23052               tai1 = a2;
23053               tai2 = u1;
23054           }
23055 
23056           /* FIXME Status. */
23057           return new JulianDate(tai1, tai2);
23058 
23059       };
23060 
23061       /**
23062        *
23063        *  Time scale transformation:  Coordinated Universal Time, UTC, to
23064        *  Universal Time, UT1.
23065        *
23066        * <p>This function is derived from the International Astronomical Union's
23067        *  SOFA (Standards of Fundamental Astronomy) software collection.
23068        *
23069        *<p>Status:  canonical.
23070        *
23071        *<!-- Given: -->
23072        *   @param  utc1  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
23073        *   @param  utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
23074        *   @param  dut1       double   Delta UT1 = UT1-UTC in seconds (Note 5)
23075        *
23076        *<!-- Returned:-->
23077        *     @return UT1 as a 2-part Julian Date (Note 6)
23078        *
23079        *  Returned (function value):
23080        *                int      status: +1 = dubious year (Note 7)
23081        *                                  0 = OK
23082        *                                 -1 = unacceptable date
23083        *
23084        *<p>Notes:
23085        *<ol>
23086        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
23087        *     convenient way between the two arguments, for example where utc1
23088        *     is the Julian Day Number and utc2 is the fraction of a day.
23089        *
23090        *  <li> JD cannot unambiguously represent UTC during a leap second unless
23091        *     special measures are taken.  The convention in the present
23092        *     function is that the JD day represents UTC days whether the
23093        *     length is 86399, 86400 or 86401 SI seconds.
23094        *
23095        *  <li> The warning status "dubious year" flags UTCs that predate the
23096        *     introduction of the time scale and that are too far in the future
23097        *     to be trusted.  See jauDat  for further details.
23098        *
23099        *  <li> The function jauDtf2d  converts from calendar date and time of
23100        *     day into 2-part Julian Date, and in the case of UTC implements
23101        *     the leap-second-ambiguity convention described above.
23102        *
23103        *  <li> Delta UT1 can be obtained from tabulations provided by the
23104        *     International Earth Rotation and Reference Systems Service.  It
23105        *     It is the caller's responsibility to supply a DUT argument
23106        *     containing the UT1-UTC value that matches the given UTC.
23107        *
23108        *  <li> The returned ut11,ut12 are such that their sum is the UT1 Julian
23109        *     Date.
23110        *
23111        *  <li> The warning status "dubious year" flags UTCs that predate the
23112        *     introduction of the time scale and that are too far in the future
23113        *     to be trusted.  See jauDat for further details.
23114        *</ol>
23115        *<p>References:
23116        *
23117        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
23118        *     IERS Technical Note No. 32, BKG (2004)
23119        *
23120        *     Explanatory Supplement to the Astronomical Almanac,
23121        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
23122        *
23123        *  Called:<ul>
23124        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
23125        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
23126        *     <li>{@link #jauUtctai}    UTC to TAI
23127        *     <li>{@link #jauTaiut1}    TAI to UT1
23128        *</ul>
23129        *@version 2010 May 16
23130        *
23131        *@since SOFA release 2010-12-01
23132        *
23133        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
23134      * @throws JSOFAInternalError an internal error has occured
23135      * @throws JSOFAIllegalParameter unaccepatble date
23136        */
23137       public static JulianDate jauUtcut1(double utc1, double utc2, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
23138       {
23139 
23140     
23141           double dta;
23142           /* Look up TAI-UTC. */
23143           Calendar dt = jauJd2cal(utc1, utc2) ;
23144           double dat = jauDat ( dt.iy, dt.im, dt.id, 0.0 );
23145      
23146 
23147           /* Form UT1-TAI. */
23148           dta = dut1 - dat;
23149 
23150           /* UTC to TAI to UT1. */
23151           JulianDate tai = jauUtctai(utc1, utc2);
23152           return jauTaiut1(tai.djm0, tai.djm1, dta) ;
23153 
23154       };
23155 
23156       
23157     public static CelestialIntermediatePole jauXy06(double date1, double date2)
23158     /**
23159     *  X,Y coordinates of celestial intermediate pole from series based
23160     *  on IAU 2006 precession and IAU 2000A nutation.
23161     *
23162     *<p>This function is derived from the International Astronomical Union's
23163     *  SOFA (Standards Of Fundamental Astronomy) software collection.
23164     *
23165     *<p>Status:  canonical model.
23166     *
23167     *<!-- Given: -->
23168     *     @param date1 double TT as a 2-part Julian Date (Note 1)
23169     *     @param date2 double TT as a 2-part Julian Date (Note 1)
23170     *
23171     *<!-- Returned: -->
23172     *     @return  CIP X,Y coordinates (Note 2)
23173     *
23174     * <p>Notes:
23175     * <ol>
23176     *
23177     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
23178     *     convenient way between the two arguments.  For example,
23179     *     JD(TT)=2450123.7 could be expressed in any of these ways,
23180     *     among others:
23181     *<pre>
23182     *            date1          date2
23183     *
23184     *         2450123.7           0.0       (JD method)
23185     *         2451545.0       -1421.3       (J2000 method)
23186     *         2400000.5       50123.2       (MJD method)
23187     *         2450123.5           0.2       (date &amp; time method)
23188     *</pre>
23189     *     The JD method is the most natural and convenient to use in
23190     *     cases where the loss of several decimal digits of resolution
23191     *     is acceptable.  The J2000 method is best matched to the way
23192     *     the argument is handled internally and will deliver the
23193     *     optimum resolution.  The MJD method and the date &amp; time methods
23194     *     are both good compromises between resolution and convenience.
23195     *
23196     * <li> The X,Y coordinates are those of the unit vector towards the
23197     *     celestial intermediate pole.  They represent the combined effects
23198     *     of frame bias, precession and nutation.
23199     *
23200     * <li> The fundamental arguments used are as adopted in IERS Conventions
23201     *     (2003) and are from Simon et al. (1994) and Souchay et al.
23202     *     (1999).
23203     *
23204     * <li> This is an alternative to the angles-based method, via the JSOFA
23205     *     function jauFw2xy and as used in jauXys06a for example.  The two
23206     *     methods agree at the 1 microarcsecond level (at present), a
23207     *     negligible amount compared with the intrinsic accuracy of the
23208     *     models.  However, it would be unwise to mix the two methods
23209     *     (angles-based and series-based) in a single application.
23210     *</ol>
23211     *<p>Called:<ul>
23212     *     <li>{@link #jauFal03} mean anomaly of the Moon
23213     *     <li>{@link #jauFalp03} mean anomaly of the Sun
23214     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
23215     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
23216     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
23217     *     <li>{@link #jauFame03} mean longitude of Mercury
23218     *     <li>{@link #jauFave03} mean longitude of Venus
23219     *     <li>{@link #jauFae03} mean longitude of Earth
23220     *     <li>{@link #jauFama03} mean longitude of Mars
23221     *     <li>{@link #jauFaju03} mean longitude of Jupiter
23222     *     <li>{@link #jauFasa03} mean longitude of Saturn
23223     *     <li>{@link #jauFaur03} mean longitude of Uranus
23224     *     <li>{@link #jauFane03} mean longitude of Neptune
23225     *     <li>{@link #jauFapa03} general accumulated precession in longitude
23226     * </ul>
23227     *<p>References:
23228     *
23229     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003,
23230     *     Astron.Astrophys., 412, 567
23231     *
23232     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
23233     *
23234     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
23235     *     IERS Technical Note No. 32, BKG
23236     *
23237     *     Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
23238     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 1994, 282, 663
23239     *
23240     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., 1999,
23241     *     Astron.Astrophys.Supp.Ser. 135, 111
23242     *
23243     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
23244     *
23245     *@version 2009 October 16
23246     *
23247     *  @since Release 20101201
23248     *
23249     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
23250     */
23251     {
23252 
23253     /* Maximum power of T in the polynomials for X and Y */
23254        final int MAXPT = (5);
23255 
23256     /* Polynomial coefficients (arcsec, X then Y). */
23257        final double xyp[][] = {
23258 
23259           {    -0.016617,
23260              2004.191898,
23261                -0.4297829,
23262                -0.19861834,
23263                 0.000007578,
23264                 0.0000059285
23265           },
23266           {    -0.006951,
23267                -0.025896,
23268               -22.4072747,
23269                 0.00190059,
23270                 0.001112526,
23271                 0.0000001358
23272           }
23273        };
23274 
23275     /* N.B mfals defined as class static (outside this method) to avoid problems with 65535 byte limit for methods */ 
23276     /* Number of frequencies:  luni-solar */
23277         final int NFLS = mfals.length;
23278 
23279     /* Number of frequencies:  planetary */
23280        final int NFPL =mfapl.length ;
23281 
23282     /* Pointers into amplitudes array, one pointer per frequency */
23283        final int nc[] = {
23284 
23285        /* 1-100 */
23286            1,    21,    37,    51,    65,    79,    91,   103,   115,   127,
23287          139,   151,   163,   172,   184,   196,   207,   219,   231,   240,
23288          252,   261,   273,   285,   297,   309,   318,   327,   339,   351,
23289          363,   372,   384,   396,   405,   415,   423,   435,   444,   452,
23290          460,   467,   474,   482,   490,   498,   506,   513,   521,   528,
23291          536,   543,   551,   559,   566,   574,   582,   590,   597,   605,
23292          613,   620,   628,   636,   644,   651,   658,   666,   674,   680,
23293          687,   695,   702,   710,   717,   725,   732,   739,   746,   753,
23294          760,   767,   774,   782,   790,   798,   805,   812,   819,   826,
23295          833,   840,   846,   853,   860,   867,   874,   881,   888,   895,
23296 
23297        /* 101-200 */
23298          901,   908,   914,   921,   928,   934,   941,   948,   955,   962,
23299          969,   976,   982,   989,   996,  1003,  1010,  1017,  1024,  1031,
23300         1037,  1043,  1050,  1057,  1064,  1071,  1078,  1084,  1091,  1098,
23301         1104,  1112,  1118,  1124,  1131,  1138,  1145,  1151,  1157,  1164,
23302         1171,  1178,  1185,  1192,  1199,  1205,  1212,  1218,  1226,  1232,
23303         1239,  1245,  1252,  1259,  1266,  1272,  1278,  1284,  1292,  1298,
23304         1304,  1310,  1316,  1323,  1329,  1335,  1341,  1347,  1353,  1359,
23305         1365,  1371,  1377,  1383,  1389,  1396,  1402,  1408,  1414,  1420,
23306         1426,  1434,  1440,  1446,  1452,  1459,  1465,  1471,  1477,  1482,
23307         1488,  1493,  1499,  1504,  1509,  1514,  1520,  1527,  1532,  1538,
23308 
23309        /* 201-300 */
23310         1543,  1548,  1553,  1558,  1564,  1569,  1574,  1579,  1584,  1589,
23311         1594,  1596,  1598,  1600,  1602,  1605,  1608,  1610,  1612,  1617,
23312         1619,  1623,  1625,  1627,  1629,  1632,  1634,  1640,  1642,  1644,
23313         1646,  1648,  1650,  1652,  1654,  1658,  1660,  1662,  1664,  1668,
23314         1670,  1672,  1673,  1675,  1679,  1681,  1683,  1684,  1686,  1688,
23315         1690,  1693,  1695,  1697,  1701,  1703,  1705,  1707,  1709,  1711,
23316         1712,  1715,  1717,  1721,  1723,  1725,  1727,  1729,  1731,  1733,
23317         1735,  1737,  1739,  1741,  1743,  1745,  1747,  1749,  1751,  1753,
23318         1755,  1757,  1759,  1761,  1762,  1764,  1766,  1768,  1769,  1771,
23319         1773,  1775,  1777,  1779,  1781,  1783,  1785,  1787,  1788,  1790,
23320 
23321        /* 301-400 */
23322         1792,  1794,  1796,  1798,  1800,  1802,  1804,  1806,  1807,  1809,
23323         1811,  1815,  1817,  1819,  1821,  1823,  1825,  1827,  1829,  1831,
23324         1833,  1835,  1837,  1839,  1840,  1842,  1844,  1848,  1850,  1852,
23325         1854,  1856,  1858,  1859,  1860,  1862,  1864,  1866,  1868,  1869,
23326         1871,  1873,  1875,  1877,  1879,  1881,  1883,  1885,  1887,  1889,
23327         1891,  1892,  1896,  1898,  1900,  1901,  1903,  1905,  1907,  1909,
23328         1910,  1911,  1913,  1915,  1919,  1921,  1923,  1927,  1929,  1931,
23329         1933,  1935,  1937,  1939,  1943,  1945,  1947,  1948,  1949,  1951,
23330         1953,  1955,  1957,  1958,  1960,  1962,  1964,  1966,  1968,  1970,
23331         1971,  1973,  1974,  1975,  1977,  1979,  1980,  1981,  1982,  1984,
23332 
23333        /* 401-500 */
23334         1986,  1988,  1990,  1992,  1994,  1995,  1997,  1999,  2001,  2003,
23335         2005,  2007,  2008,  2009,  2011,  2013,  2015,  2017,  2019,  2021,
23336         2023,  2024,  2025,  2027,  2029,  2031,  2033,  2035,  2037,  2041,
23337         2043,  2045,  2046,  2047,  2049,  2051,  2053,  2055,  2056,  2057,
23338         2059,  2061,  2063,  2065,  2067,  2069,  2070,  2071,  2072,  2074,
23339         2076,  2078,  2080,  2082,  2084,  2086,  2088,  2090,  2092,  2094,
23340         2095,  2096,  2097,  2099,  2101,  2105,  2106,  2107,  2108,  2109,
23341         2110,  2111,  2113,  2115,  2119,  2121,  2123,  2125,  2127,  2129,
23342         2131,  2133,  2135,  2136,  2137,  2139,  2141,  2143,  2145,  2147,
23343         2149,  2151,  2153,  2155,  2157,  2159,  2161,  2163,  2165,  2167,
23344 
23345        /* 501-600 */
23346         2169,  2171,  2173,  2175,  2177,  2179,  2181,  2183,  2185,  2186,
23347         2187,  2188,  2192,  2193,  2195,  2197,  2199,  2201,  2203,  2205,
23348         2207,  2209,  2211,  2213,  2217,  2219,  2221,  2223,  2225,  2227,
23349         2229,  2231,  2233,  2234,  2235,  2236,  2237,  2238,  2239,  2240,
23350         2241,  2244,  2246,  2248,  2250,  2252,  2254,  2256,  2258,  2260,
23351         2262,  2264,  2266,  2268,  2270,  2272,  2274,  2276,  2278,  2280,
23352         2282,  2284,  2286,  2288,  2290,  2292,  2294,  2296,  2298,  2300,
23353         2302,  2303,  2304,  2305,  2306,  2307,  2309,  2311,  2313,  2315,
23354         2317,  2319,  2321,  2323,  2325,  2327,  2329,  2331,  2333,  2335,
23355         2337,  2341,  2343,  2345,  2347,  2349,  2351,  2352,  2355,  2356,
23356 
23357        /* 601-700 */
23358         2357,  2358,  2359,  2361,  2363,  2364,  2365,  2366,  2367,  2368,
23359         2369,  2370,  2371,  2372,  2373,  2374,  2376,  2378,  2380,  2382,
23360         2384,  2385,  2386,  2387,  2388,  2389,  2390,  2391,  2392,  2393,
23361         2394,  2395,  2396,  2397,  2398,  2399,  2400,  2401,  2402,  2403,
23362         2404,  2405,  2406,  2407,  2408,  2409,  2410,  2411,  2412,  2413,
23363         2414,  2415,  2417,  2418,  2430,  2438,  2445,  2453,  2460,  2468,
23364         2474,  2480,  2488,  2496,  2504,  2512,  2520,  2527,  2535,  2543,
23365         2550,  2558,  2566,  2574,  2580,  2588,  2596,  2604,  2612,  2619,
23366         2627,  2634,  2642,  2648,  2656,  2664,  2671,  2679,  2685,  2693,
23367         2701,  2709,  2717,  2725,  2733,  2739,  2747,  2753,  2761,  2769,
23368 
23369        /* 701-800 */
23370         2777,  2785,  2793,  2801,  2809,  2817,  2825,  2833,  2841,  2848,
23371         2856,  2864,  2872,  2878,  2884,  2892,  2898,  2906,  2914,  2922,
23372         2930,  2938,  2944,  2952,  2958,  2966,  2974,  2982,  2988,  2996,
23373         3001,  3009,  3017,  3025,  3032,  3039,  3045,  3052,  3059,  3067,
23374         3069,  3076,  3083,  3090,  3098,  3105,  3109,  3111,  3113,  3120,
23375         3124,  3128,  3132,  3136,  3140,  3144,  3146,  3150,  3158,  3161,
23376         3165,  3166,  3168,  3172,  3176,  3180,  3182,  3185,  3189,  3193,
23377         3194,  3197,  3200,  3204,  3208,  3212,  3216,  3219,  3221,  3222,
23378         3226,  3230,  3234,  3238,  3242,  3243,  3247,  3251,  3254,  3258,
23379         3262,  3266,  3270,  3274,  3275,  3279,  3283,  3287,  3289,  3293,
23380 
23381        /* 801-900 */
23382         3296,  3300,  3303,  3307,  3311,  3315,  3319,  3321,  3324,  3327,
23383         3330,  3334,  3338,  3340,  3342,  3346,  3350,  3354,  3358,  3361,
23384         3365,  3369,  3373,  3377,  3381,  3385,  3389,  3393,  3394,  3398,
23385         3402,  3406,  3410,  3413,  3417,  3421,  3425,  3429,  3433,  3435,
23386         3439,  3443,  3446,  3450,  3453,  3457,  3458,  3461,  3464,  3468,
23387         3472,  3476,  3478,  3481,  3485,  3489,  3493,  3497,  3501,  3505,
23388         3507,  3511,  3514,  3517,  3521,  3524,  3525,  3527,  3529,  3533,
23389         3536,  3540,  3541,  3545,  3548,  3551,  3555,  3559,  3563,  3567,
23390         3569,  3570,  3574,  3576,  3578,  3582,  3586,  3590,  3593,  3596,
23391         3600,  3604,  3608,  3612,  3616,  3620,  3623,  3626,  3630,  3632,
23392 
23393        /* 901-1000 */
23394         3636,  3640,  3643,  3646,  3648,  3652,  3656,  3660,  3664,  3667,
23395         3669,  3671,  3675,  3679,  3683,  3687,  3689,  3693,  3694,  3695,
23396         3699,  3703,  3705,  3707,  3710,  3713,  3717,  3721,  3725,  3729,
23397         3733,  3736,  3740,  3744,  3748,  3752,  3754,  3757,  3759,  3763,
23398         3767,  3770,  3773,  3777,  3779,  3783,  3786,  3790,  3794,  3798,
23399         3801,  3805,  3809,  3813,  3817,  3821,  3825,  3827,  3831,  3835,
23400         3836,  3837,  3840,  3844,  3848,  3852,  3856,  3859,  3863,  3867,
23401         3869,  3871,  3875,  3879,  3883,  3887,  3890,  3894,  3898,  3901,
23402         3905,  3909,  3913,  3917,  3921,  3922,  3923,  3924,  3926,  3930,
23403         3932,  3936,  3938,  3940,  3944,  3948,  3952,  3956,  3959,  3963,
23404 
23405        /* 1001-1100 */
23406         3965,  3969,  3973,  3977,  3979,  3981,  3982,  3986,  3989,  3993,
23407         3997,  4001,  4004,  4006,  4009,  4012,  4016,  4020,  4024,  4026,
23408         4028,  4032,  4036,  4040,  4044,  4046,  4050,  4054,  4058,  4060,
23409         4062,  4063,  4064,  4068,  4071,  4075,  4077,  4081,  4083,  4087,
23410         4089,  4091,  4095,  4099,  4101,  4103,  4105,  4107,  4111,  4115,
23411         4119,  4123,  4127,  4129,  4131,  4135,  4139,  4141,  4143,  4145,
23412         4149,  4153,  4157,  4161,  4165,  4169,  4173,  4177,  4180,  4183,
23413         4187,  4191,  4195,  4198,  4201,  4205,  4209,  4212,  4213,  4216,
23414         4217,  4221,  4223,  4226,  4230,  4234,  4236,  4240,  4244,  4248,
23415         4252,  4256,  4258,  4262,  4264,  4266,  4268,  4270,  4272,  4276,
23416 
23417        /* 1101-1200 */
23418         4279,  4283,  4285,  4287,  4289,  4293,  4295,  4299,  4300,  4301,
23419         4305,  4309,  4313,  4317,  4319,  4323,  4325,  4329,  4331,  4333,
23420         4335,  4337,  4341,  4345,  4349,  4351,  4353,  4357,  4361,  4365,
23421         4367,  4369,  4373,  4377,  4381,  4383,  4387,  4389,  4391,  4395,
23422         4399,  4403,  4407,  4411,  4413,  4414,  4415,  4418,  4419,  4421,
23423         4423,  4427,  4429,  4431,  4433,  4435,  4437,  4439,  4443,  4446,
23424         4450,  4452,  4456,  4458,  4460,  4462,  4466,  4469,  4473,  4477,
23425         4481,  4483,  4487,  4489,  4491,  4493,  4497,  4499,  4501,  4504,
23426         4506,  4510,  4513,  4514,  4515,  4518,  4521,  4522,  4525,  4526,
23427         4527,  4530,  4533,  4534,  4537,  4541,  4542,  4543,  4544,  4545,
23428 
23429        /* 1201-1300 */
23430         4546,  4547,  4550,  4553,  4554,  4555,  4558,  4561,  4564,  4567,
23431         4568,  4571,  4574,  4575,  4578,  4581,  4582,  4585,  4586,  4588,
23432         4590,  4592,  4596,  4598,  4602,  4604,  4608,  4612,  4613,  4616,
23433         4619,  4622,  4623,  4624,  4625,  4626,  4629,  4632,  4633,  4636,
23434         4639,  4640,  4641,  4642,  4643,  4644,  4645,  4648,  4649,  4650,
23435         4651,  4652,  4653,  4656,  4657,  4660,  4661,  4664,  4667,  4670,
23436         4671,  4674,  4675,  4676,  4677,  4678,  4681,  4682,  4683,  4684,
23437         4687,  4688,  4689,  4692,  4693,  4696,  4697,  4700,  4701,  4702,
23438         4703,  4704,  4707,  4708,  4711,  4712,  4715,  4716,  4717,  4718,
23439         4719,  4720,  4721,  4722,  4723,  4726,  4729,  4730,  4733,  4736,
23440 
23441        /* 1301-(NFLS+NFPL) */
23442         4737,  4740,  4741,  4742,  4745,  4746,  4749,  4752,  4753
23443        };
23444 
23445     /* Amplitude coefficients (microarcsec);  indexed using the nc array. */
23446        final double a[] = {
23447 
23448        /* 1-105 */
23449              -6844318.44,     9205236.26,1328.67,1538.18,      205833.11,
23450                153041.79,       -3309.73, 853.32,2037.98,       -2301.27,
23451            81.46, 120.56, -20.39, -15.22,   1.73,  -1.61,  -0.10,   0.11,
23452            -0.02,  -0.02,     -523908.04,      573033.42,-544.75,-458.66,
23453                 12814.01,       11714.49, 198.97,-290.91, 155.74,-143.27,
23454            -2.75,  -1.03,  -1.27,  -1.16,   0.00,  -0.01,      -90552.22,
23455                 97846.69, 111.23, 137.41,2187.91,2024.68,  41.44, -51.26,
23456            26.92, -24.46,  -0.46,  -0.28,  -0.22,  -0.20,       82168.76,
23457                -89618.24, -27.64, -29.05,       -2004.36,       -1837.32,
23458           -36.07,  48.00, -24.43,  22.41,   0.47,   0.24,   0.20,   0.18,
23459                 58707.02,7387.02, 470.05,-192.40, 164.33,       -1312.21,
23460          -179.73, -28.93, -17.36,  -1.83,  -0.50,   3.57,   0.00,   0.13,
23461                -20557.78,       22438.42, -20.84, -17.40, 501.82, 459.68,
23462            59.20, -67.30,   6.08,  -5.61,  -1.36,  -1.19,       28288.28,
23463          -674.99, -34.69,  35.80, -15.07,-632.54, -11.19,   0.78,  -8.41,
23464             0.17,   0.01,   0.07,      -15406.85,       20069.50,  15.12,
23465 
23466        /* 106-219 */
23467            31.80, 448.76, 344.50,  -5.77,   1.41,   4.59,  -5.02,   0.17,
23468             0.24,      -11991.74,       12902.66,  32.46,  36.70, 288.49,
23469           268.14,   5.70,  -7.06,   3.57,  -3.23,  -0.06,  -0.04,
23470                 -8584.95,       -9592.72,   4.42, -13.20,-214.50, 192.06,
23471            23.87,  29.83,   2.54,   2.40,   0.60,  -0.48,5095.50,
23472                 -6918.22,   7.19,   3.92,-154.91,-113.94,   2.86,  -1.04,
23473            -1.52,   1.73,  -0.07,  -0.10,       -4910.93,       -5331.13,
23474             0.76,   0.40,-119.21, 109.81,   2.16,   3.20,   1.46,   1.33,
23475             0.04,  -0.02,       -6245.02,-123.48,  -6.68,  -8.20,  -2.76,
23476           139.64,   2.71,   0.15,   1.86,2511.85,       -3323.89,   1.07,
23477            -0.90, -74.33, -56.17,   1.16,  -0.01,  -0.75,   0.83,  -0.02,
23478            -0.04,2307.58,3143.98,  -7.52,   7.50,  70.31, -51.60,   1.46,
23479             0.16,  -0.69,  -0.79,   0.02,  -0.05,2372.58,2554.51,   5.93,
23480            -6.60,  57.12, -53.05,  -0.96,  -1.24,  -0.71,  -0.64,  -0.01,
23481                 -2053.16,2636.13,   5.13,   7.80,  58.94,  45.91,  -0.42,
23482            -0.12,   0.61,  -0.66,   0.02,   0.03,       -1825.49,
23483 
23484        /* 220-339 */
23485                 -2423.59,   1.23,  -2.00, -54.19,  40.82,  -1.07,  -1.02,
23486             0.54,   0.61,  -0.04,   0.04,2521.07,-122.28,  -5.97,   2.90,
23487            -2.73, -56.37,  -0.82,   0.13,  -0.75,       -1534.09,1645.01,
23488             6.29,   6.80,  36.78,  34.30,   0.92,  -1.25,   0.46,  -0.41,
23489            -0.02,  -0.01,1898.27,  47.70,  -0.72,   2.50,   1.07, -42.45,
23490            -0.94,   0.02,  -0.56,       -1292.02,       -1387.00,   0.00,
23491             0.00, -31.01,  28.89,   0.68,   0.00,   0.38,   0.35,  -0.01,
23492            -0.01,       -1234.96,1323.81,   5.21,   5.90,  29.60,  27.61,
23493             0.74,  -1.22,   0.37,  -0.33,  -0.02,  -0.01,1137.48,
23494                 -1233.89,  -0.04,  -0.30, -27.59, -25.43,  -0.61,   1.00,
23495            -0.34,   0.31,   0.01,   0.01,-813.13,       -1075.60,   0.40,
23496             0.30, -24.05,  18.18,  -0.40,  -0.01,   0.24,   0.27,  -0.01,
23497             0.01,1163.22, -60.90,  -2.94,   1.30,  -1.36, -26.01,  -0.58,
23498             0.07,  -0.35,1029.70, -55.55,  -2.63,   1.10,  -1.25, -23.02,
23499            -0.52,   0.06,  -0.31,-556.26, 852.85,   3.16,  -4.48,  19.06,
23500            12.44,  -0.81,  -0.27,   0.17,  -0.21,   0.00,   0.02,-603.52,
23501 
23502        /* 340-467 */
23503          -800.34,   0.44,   0.10, -17.90,  13.49,  -0.08,  -0.01,   0.18,
23504             0.20,  -0.01,   0.01,-628.24, 684.99,  -0.64,  -0.50,  15.32,
23505            14.05,   3.18,  -4.19,   0.19,  -0.17,  -0.09,  -0.07,-866.48,
23506           -16.26,   0.52,  -1.30,  -0.36,  19.37,   0.43,  -0.01,   0.26,
23507          -512.37, 695.54,  -1.47,  -1.40,  15.55,  11.46,  -0.16,   0.03,
23508             0.15,  -0.17,   0.01,   0.01, 506.65, 643.75,   2.54,  -2.62,
23509            14.40, -11.33,  -0.77,  -0.06,  -0.15,  -0.16,   0.00,   0.01,
23510           664.57,  16.81,  -0.40,   1.00,   0.38, -14.86,  -3.71,  -0.09,
23511            -0.20, 405.91, 522.11,   0.99,  -1.50,  11.67,  -9.08,  -0.25,
23512            -0.02,  -0.12,  -0.13,-305.78, 326.60,   1.75,   1.90,   7.30,
23513             6.84,   0.20,  -0.04, 300.99,-325.03,  -0.44,  -0.50,  -7.27,
23514            -6.73,  -1.01,   0.01,   0.00,   0.08,   0.00,   0.02, 438.51,
23515            10.47,  -0.56,  -0.20,   0.24,  -9.81,  -0.24,   0.01,  -0.13,
23516          -264.02, 335.24,   0.99,   1.40,   7.49,   5.90,  -0.27,  -0.02,
23517           284.09, 307.03,   0.32,  -0.40,   6.87,  -6.35,  -0.99,  -0.01,
23518          -250.54, 327.11,   0.08,   0.40,   7.31,   5.60,  -0.30, 230.72,
23519 
23520        /* 468-595 */
23521          -304.46,   0.08,  -0.10,  -6.81,  -5.16,   0.27, 229.78, 304.17,
23522            -0.60,   0.50,   6.80,  -5.14,   0.33,   0.01, 256.30,-276.81,
23523            -0.28,  -0.40,  -6.19,  -5.73,  -0.14,   0.01,-212.82, 269.45,
23524             0.84,   1.20,   6.02,   4.76,   0.14,  -0.02, 196.64, 272.05,
23525            -0.84,   0.90,   6.08,  -4.40,   0.35,   0.02, 188.95, 272.22,
23526            -0.12,   0.30,   6.09,  -4.22,   0.34,-292.37,  -5.10,  -0.32,
23527            -0.40,  -0.11,   6.54,   0.14,   0.01, 161.79,-220.67,   0.24,
23528             0.10,  -4.93,  -3.62,  -0.08, 261.54, -19.94,  -0.95,   0.20,
23529            -0.45,  -5.85,  -0.13,   0.02, 142.16,-190.79,   0.20,   0.10,
23530            -4.27,  -3.18,  -0.07, 187.95,  -4.11,  -0.24,   0.30,  -0.09,
23531            -4.20,  -0.09,   0.01,   0.00,   0.00, -79.08, 167.90,   0.04,
23532             0.00,   3.75,   1.77, 121.98, 131.04,  -0.08,   0.10,   2.93,
23533            -2.73,  -0.06,-172.95,  -8.11,  -0.40,  -0.20,  -0.18,   3.87,
23534             0.09,   0.01,-160.15, -55.30, -14.04,  13.90,  -1.23,   3.58,
23535             0.40,   0.31,-115.40, 123.20,   0.60,   0.70,   2.75,   2.58,
23536             0.08,  -0.01,-168.26,  -2.00,   0.20,  -0.20,  -0.04,   3.76,
23537 
23538        /* 596-723 */
23539             0.08,-114.49, 123.20,   0.32,   0.40,   2.75,   2.56,   0.07,
23540            -0.01, 112.14, 120.70,   0.28,  -0.30,   2.70,  -2.51,  -0.07,
23541            -0.01, 161.34,   4.03,   0.20,   0.20,   0.09,  -3.61,  -0.08,
23542            91.31, 126.64,  -0.40,   0.40,   2.83,  -2.04,  -0.04,   0.01,
23543           105.29, 112.90,   0.44,  -0.50,   2.52,  -2.35,  -0.07,  -0.01,
23544            98.69,-106.20,  -0.28,  -0.30,  -2.37,  -2.21,  -0.06,   0.01,
23545            86.74,-112.94,  -0.08,  -0.20,  -2.53,  -1.94,  -0.05,-134.81,
23546             3.51,   0.20,  -0.20,   0.08,   3.01,   0.07,  79.03, 107.31,
23547            -0.24,   0.20,   2.40,  -1.77,  -0.04,   0.01, 132.81, -10.77,
23548            -0.52,   0.10,  -0.24,  -2.97,  -0.07,   0.01,-130.31,  -0.90,
23549             0.04,   0.00,   0.00,   2.91, -78.56,  85.32,   0.00,   0.00,
23550             1.91,   1.76,   0.04,   0.00,   0.00, -41.53,  89.10,   0.02,
23551             0.00,   1.99,   0.93,  66.03, -71.00,  -0.20,  -0.20,  -1.59,
23552            -1.48,  -0.04,  60.50,  64.70,   0.36,  -0.40,   1.45,  -1.35,
23553            -0.04,  -0.01, -52.27, -70.01,   0.00,   0.00,  -1.57,   1.17,
23554             0.03, -52.95,  66.29,   0.32,   0.40,   1.48,   1.18,   0.04,
23555 
23556        /* 724-851 */
23557            -0.01,  51.02,  67.25,   0.00,   0.00,   1.50,  -1.14,  -0.03,
23558           -55.66, -60.92,   0.16,  -0.20,  -1.36,   1.24,   0.03, -54.81,
23559           -59.20,  -0.08,   0.20,  -1.32,   1.23,   0.03,  51.32, -55.60,
23560             0.00,   0.00,  -1.24,  -1.15,  -0.03,  48.29,  51.80,   0.20,
23561            -0.20,   1.16,  -1.08,  -0.03, -45.59, -49.00,  -0.12,   0.10,
23562            -1.10,   1.02,   0.03,  40.54, -52.69,  -0.04,  -0.10,  -1.18,
23563            -0.91,  -0.02, -40.58, -49.51,  -1.00,   1.00,  -1.11,   0.91,
23564             0.04,   0.02, -43.76,  46.50,   0.36,   0.40,   1.04,   0.98,
23565             0.03,  -0.01,  62.65,  -5.00,  -0.24,   0.00,  -0.11,  -1.40,
23566            -0.03,   0.01, -38.57,  49.59,   0.08,   0.10,   1.11,   0.86,
23567             0.02, -33.22, -44.04,   0.08,  -0.10,  -0.98,   0.74,   0.02,
23568            37.15, -39.90,  -0.12,  -0.10,  -0.89,  -0.83,  -0.02,  36.68,
23569           -39.50,  -0.04,  -0.10,  -0.88,  -0.82,  -0.02, -53.22,  -3.91,
23570            -0.20,   0.00,  -0.09,   1.19,   0.03,  32.43, -42.19,  -0.04,
23571            -0.10,  -0.94,  -0.73,  -0.02, -51.00,  -2.30,  -0.12,  -0.10,
23572             0.00,   1.14, -29.53, -39.11,   0.04,   0.00,  -0.87,   0.66,
23573 
23574        /* 852-979 */
23575             0.02,  28.50, -38.92,  -0.08,  -0.10,  -0.87,  -0.64,  -0.02,
23576            26.54,  36.95,  -0.12,   0.10,   0.83,  -0.59,  -0.01,  26.54,
23577            34.59,   0.04,  -0.10,   0.77,  -0.59,  -0.02,  28.35, -32.55,
23578            -0.16,   0.20,  -0.73,  -0.63,  -0.01, -28.00,  30.40,   0.00,
23579             0.00,   0.68,   0.63,   0.01, -27.61,  29.40,   0.20,   0.20,
23580             0.66,   0.62,   0.02,  40.33,   0.40,  -0.04,   0.10,   0.00,
23581            -0.90, -23.28,  31.61,  -0.08,  -0.10,   0.71,   0.52,   0.01,
23582            37.75,   0.80,   0.04,   0.10,   0.00,  -0.84,  23.66,  25.80,
23583             0.00,   0.00,   0.58,  -0.53,  -0.01,  21.01, -27.91,   0.00,
23584             0.00,  -0.62,  -0.47,  -0.01, -34.81,   2.89,   0.04,   0.00,
23585             0.00,   0.78, -23.49, -25.31,   0.00,   0.00,  -0.57,   0.53,
23586             0.01, -23.47,  25.20,   0.16,   0.20,   0.56,   0.52,   0.02,
23587            19.58,  27.50,  -0.12,   0.10,   0.62,  -0.44,  -0.01, -22.67,
23588           -24.40,  -0.08,   0.10,  -0.55,   0.51,   0.01, -19.97,  25.00,
23589             0.12,   0.20,   0.56,   0.45,   0.01,  21.28, -22.80,  -0.08,
23590            -0.10,  -0.51,  -0.48,  -0.01, -30.47,   0.91,   0.04,   0.00,
23591 
23592        /* 980-1107 */
23593             0.00,   0.68,  18.58,  24.00,   0.04,  -0.10,   0.54,  -0.42,
23594            -0.01, -18.02,  24.40,  -0.04,  -0.10,   0.55,   0.40,   0.01,
23595            17.74,  22.50,   0.08,  -0.10,   0.50,  -0.40,  -0.01, -19.41,
23596            20.70,   0.08,   0.10,   0.46,   0.43,   0.01, -18.64,  20.11,
23597             0.00,   0.00,   0.45,   0.42,   0.01, -16.75,  21.60,   0.04,
23598             0.10,   0.48,   0.37,   0.01, -18.42, -20.00,   0.00,   0.00,
23599            -0.45,   0.41,   0.01, -26.77,   1.41,   0.08,   0.00,   0.00,
23600             0.60, -26.17,  -0.19,   0.00,   0.00,   0.00,   0.59, -15.52,
23601            20.51,   0.00,   0.00,   0.46,   0.35,   0.01, -25.42,  -1.91,
23602            -0.08,   0.00,  -0.04,   0.57,   0.45, -17.42,  18.10,   0.00,
23603             0.00,   0.40,   0.39,   0.01,  16.39, -17.60,  -0.08,  -0.10,
23604            -0.39,  -0.37,  -0.01, -14.37,  18.91,   0.00,   0.00,   0.42,
23605             0.32,   0.01,  23.39,  -2.40,  -0.12,   0.00,   0.00,  -0.52,
23606            14.32, -18.50,  -0.04,  -0.10,  -0.41,  -0.32,  -0.01,  15.69,
23607            17.08,   0.00,   0.00,   0.38,  -0.35,  -0.01, -22.99,   0.50,
23608             0.04,   0.00,   0.00,   0.51,   0.00,   0.00,  14.47, -17.60,
23609 
23610        /* 1108-1235 */
23611            -0.01,   0.00,  -0.39,  -0.32, -13.33,  18.40,  -0.04,  -0.10,
23612             0.41,   0.30,  22.47,  -0.60,  -0.04,   0.00,   0.00,  -0.50,
23613           -12.78, -17.41,   0.04,   0.00,  -0.39,   0.29,   0.01, -14.10,
23614           -15.31,   0.04,   0.00,  -0.34,   0.32,   0.01,  11.98,  16.21,
23615            -0.04,   0.00,   0.36,  -0.27,  -0.01,  19.65,  -1.90,  -0.08,
23616             0.00,   0.00,  -0.44,  19.61,  -1.50,  -0.08,   0.00,   0.00,
23617            -0.44,  13.41, -14.30,  -0.04,  -0.10,  -0.32,  -0.30,  -0.01,
23618           -13.29,  14.40,   0.00,   0.00,   0.32,   0.30,   0.01,  11.14,
23619           -14.40,  -0.04,   0.00,  -0.32,  -0.25,  -0.01,  12.24, -13.38,
23620             0.04,   0.00,  -0.30,  -0.27,  -0.01,  10.07, -13.81,   0.04,
23621             0.00,  -0.31,  -0.23,  -0.01,  10.46,  13.10,   0.08,  -0.10,
23622             0.29,  -0.23,  -0.01,  16.55,  -1.71,  -0.08,   0.00,   0.00,
23623            -0.37,   9.75, -12.80,   0.00,   0.00,  -0.29,  -0.22,  -0.01,
23624             9.11,  12.80,   0.00,   0.00,   0.29,  -0.20,   0.00,   0.00,
23625            -6.44, -13.80,   0.00,   0.00,  -0.31,   0.14,  -9.19, -12.00,
23626             0.00,   0.00,  -0.27,   0.21, -10.30,  10.90,   0.08,   0.10,
23627 
23628        /* 1236-1363 */
23629             0.24,   0.23,   0.01,  14.92,  -0.80,  -0.04,   0.00,   0.00,
23630            -0.33,  10.02, -10.80,   0.00,   0.00,  -0.24,  -0.22,  -0.01,
23631            -9.75,  10.40,   0.04,   0.00,   0.23,   0.22,   0.01,   9.67,
23632           -10.40,  -0.04,   0.00,  -0.23,  -0.22,  -0.01,  -8.28, -11.20,
23633             0.04,   0.00,  -0.25,   0.19,  13.32,  -1.41,  -0.08,   0.00,
23634             0.00,  -0.30,   8.27,  10.50,   0.04,   0.00,   0.23,  -0.19,
23635             0.00,   0.00,  13.13,   0.00,   0.00,   0.00,   0.00,  -0.29,
23636           -12.93,   0.70,   0.04,   0.00,   0.00,   0.29,   7.91, -10.20,
23637             0.00,   0.00,  -0.23,  -0.18,  -7.84, -10.00,  -0.04,   0.00,
23638            -0.22,   0.18,   7.44,   9.60,   0.00,   0.00,   0.21,  -0.17,
23639            -7.64,   9.40,   0.08,   0.10,   0.21,   0.17,   0.01, -11.38,
23640             0.60,   0.04,   0.00,   0.00,   0.25,  -7.48,   8.30,   0.00,
23641             0.00,   0.19,   0.17, -10.98,  -0.20,   0.00,   0.00,   0.00,
23642             0.25,  10.98,   0.20,   0.00,   0.00,   0.00,  -0.25,   7.40,
23643            -7.90,  -0.04,   0.00,  -0.18,  -0.17,  -6.09,   8.40,  -0.04,
23644             0.00,   0.19,   0.14,  -6.94,  -7.49,   0.00,   0.00,  -0.17,
23645 
23646        /* 1364-1491 */
23647             0.16,   6.92,   7.50,   0.04,   0.00,   0.17,  -0.15,   6.20,
23648             8.09,   0.00,   0.00,   0.18,  -0.14,  -6.12,   7.80,   0.04,
23649             0.00,   0.17,   0.14,   5.85,  -7.50,   0.00,   0.00,  -0.17,
23650            -0.13,  -6.48,   6.90,   0.08,   0.10,   0.15,   0.14,   0.01,
23651             6.32,   6.90,   0.00,   0.00,   0.15,  -0.14,   5.61,  -7.20,
23652             0.00,   0.00,  -0.16,  -0.13,   9.07,   0.00,   0.00,   0.00,
23653             0.00,  -0.20,   5.25,   6.90,   0.00,   0.00,   0.15,  -0.12,
23654            -8.47,  -0.40,   0.00,   0.00,   0.00,   0.19,   6.32,  -5.39,
23655            -1.11,   1.10,  -0.12,  -0.14,   0.02,   0.02,   5.73,  -6.10,
23656            -0.04,   0.00,  -0.14,  -0.13,   4.70,   6.60,  -0.04,   0.00,
23657             0.15,  -0.11,  -4.90,  -6.40,   0.00,   0.00,  -0.14,   0.11,
23658            -5.33,   5.60,   0.04,   0.10,   0.13,   0.12,   0.01,  -4.81,
23659             6.00,   0.04,   0.00,   0.13,   0.11,   5.13,   5.50,   0.04,
23660             0.00,   0.12,  -0.11,   4.50,   5.90,   0.00,   0.00,   0.13,
23661            -0.10,  -4.22,   6.10,   0.00,   0.00,   0.14,  -4.53,   5.70,
23662             0.00,   0.00,   0.13,   0.10,   4.18,   5.70,   0.00,   0.00,
23663 
23664        /* 1492-1619 */
23665             0.13,  -4.75,  -5.19,   0.00,   0.00,  -0.12,   0.11,  -4.06,
23666             5.60,   0.00,   0.00,   0.13,  -3.98,   5.60,  -0.04,   0.00,
23667             0.13,   4.02,  -5.40,   0.00,   0.00,  -0.12,   4.49,  -4.90,
23668            -0.04,   0.00,  -0.11,  -0.10,  -3.62,  -5.40,  -0.16,   0.20,
23669            -0.12,   0.00,   0.01,   4.38,   4.80,   0.00,   0.00,   0.11,
23670            -6.40,  -0.10,   0.00,   0.00,   0.00,   0.14,  -3.98,   5.00,
23671             0.04,   0.00,   0.11,  -3.82,  -5.00,   0.00,   0.00,  -0.11,
23672            -3.71,   5.07,   0.00,   0.00,   0.11,   4.14,   4.40,   0.00,
23673             0.00,   0.10,  -6.01,  -0.50,  -0.04,   0.00,   0.00,   0.13,
23674            -4.04,   4.39,   0.00,   0.00,   0.10,   3.45,  -4.72,   0.00,
23675             0.00,  -0.11,   3.31,   4.71,   0.00,   0.00,   0.11,   3.26,
23676            -4.50,   0.00,   0.00,  -0.10,  -3.26,  -4.50,   0.00,   0.00,
23677            -0.10,  -3.34,  -4.40,   0.00,   0.00,  -0.10,  -3.74,  -4.00,
23678             3.70,   4.00,   3.34,  -4.30,   3.30,  -4.30,  -3.66,   3.90,
23679             0.04,   3.66,   3.90,   0.04,  -3.62,  -3.90,  -3.61,   3.90,
23680            -0.20,   5.30,   0.00,   0.00,   0.12,   3.06,   4.30,   3.30,
23681 
23682        /* 1620-1747 */
23683             4.00,   0.40,   0.20,   3.10,   4.10,  -3.06,   3.90,  -3.30,
23684            -3.60,  -3.30,   3.36,   0.01,   3.14,   3.40,  -4.57,  -0.20,
23685             0.00,   0.00,   0.00,   0.10,  -2.70,  -3.60,   2.94,  -3.20,
23686            -2.90,   3.20,   2.47,  -3.40,   2.55,  -3.30,   2.80,  -3.08,
23687             2.51,   3.30,  -4.10,   0.30,  -0.12,  -0.10,   4.10,   0.20,
23688            -2.74,   3.00,   2.46,   3.23,  -3.66,   1.20,  -0.20,   0.20,
23689             3.74,  -0.40,  -2.51,  -2.80,  -3.74,   2.27,  -2.90,   0.00,
23690             0.00,  -2.50,   2.70,  -2.51,   2.60,  -3.50,   0.20,   3.38,
23691            -2.22,  -2.50,   3.26,  -0.40,   1.95,  -2.60,   3.22,  -0.40,
23692            -0.04,  -1.79,  -2.60,   1.91,   2.50,   0.74,   3.05,  -0.04,
23693             0.08,   2.11,  -2.30,  -2.11,   2.20,  -1.87,  -2.40,   2.03,
23694            -2.20,  -2.03,   2.20,   2.98,   0.00,   0.00,   2.98,  -1.71,
23695             2.40,   2.94,  -0.10,  -0.12,   0.10,   1.67,   2.40,  -1.79,
23696             2.30,  -1.79,   2.20,  -1.67,   2.20,   1.79,  -2.00,   1.87,
23697            -1.90,   1.63,  -2.10,  -1.59,   2.10,   1.55,  -2.10,  -1.55,
23698             2.10,  -2.59,  -0.20,  -1.75,  -1.90,  -1.75,   1.90,  -1.83,
23699 
23700        /* 1748-1875 */
23701            -1.80,   1.51,   2.00,  -1.51,  -2.00,   1.71,   1.80,   1.31,
23702             2.10,  -1.43,   2.00,   1.43,   2.00,  -2.43,  -1.51,   1.90,
23703            -1.47,   1.90,   2.39,   0.20,  -2.39,   1.39,   1.90,   1.39,
23704            -1.80,   1.47,  -1.60,   1.47,  -1.60,   1.43,  -1.50,  -1.31,
23705             1.60,   1.27,  -1.60,  -1.27,   1.60,   1.27,  -1.60,   2.03,
23706             1.35,   1.50,  -1.39,  -1.40,   1.95,  -0.20,  -1.27,   1.49,
23707             1.19,   1.50,   1.27,   1.40,   1.15,   1.50,   1.87,  -0.10,
23708            -1.12,  -1.50,   1.87,  -1.11,  -1.50,  -1.11,  -1.50,   0.00,
23709             0.00,   1.19,   1.40,   1.27,  -1.30,  -1.27,  -1.30,  -1.15,
23710             1.40,  -1.23,   1.30,  -1.23,  -1.30,   1.22,  -1.29,   1.07,
23711            -1.40,   1.75,  -0.20,  -1.03,  -1.40,  -1.07,   1.20,  -1.03,
23712             1.15,   1.07,   1.10,   1.51,  -1.03,   1.10,   1.03,  -1.10,
23713             0.00,   0.00,  -1.03,  -1.10,   0.91,  -1.20,  -0.88,  -1.20,
23714            -0.88,   1.20,  -0.95,   1.10,  -0.95,  -1.10,   1.43,  -1.39,
23715             0.95,  -1.00,  -0.95,   1.00,  -0.80,   1.10,   0.91,  -1.00,
23716            -1.35,   0.88,   1.00,  -0.83,   1.00,  -0.91,   0.90,   0.91,
23717 
23718        /* 1876-2003 */
23719             0.90,   0.88,  -0.90,  -0.76,  -1.00,  -0.76,   1.00,   0.76,
23720             1.00,  -0.72,   1.00,   0.84,  -0.90,   0.84,   0.90,   1.23,
23721             0.00,   0.00,  -0.52,  -1.10,  -0.68,   1.00,   1.19,  -0.20,
23722             1.19,   0.76,   0.90,   1.15,  -0.10,   1.15,  -0.10,   0.72,
23723            -0.90,  -1.15,  -1.15,   0.68,   0.90,  -0.68,   0.90,  -1.11,
23724             0.00,   0.00,   0.20,   0.79,   0.80,  -1.11,  -0.10,   0.00,
23725             0.00,  -0.48,  -1.00,  -0.76,  -0.80,  -0.72,  -0.80,  -1.07,
23726            -0.10,   0.64,   0.80,  -0.64,  -0.80,   0.64,   0.80,   0.40,
23727             0.60,   0.52,  -0.50,  -0.60,  -0.80,  -0.71,   0.70,  -0.99,
23728             0.99,   0.56,   0.80,  -0.56,   0.80,   0.68,  -0.70,   0.68,
23729             0.70,  -0.95,  -0.64,   0.70,   0.64,   0.70,  -0.60,   0.70,
23730            -0.60,  -0.70,  -0.91,  -0.10,  -0.51,   0.76,  -0.91,  -0.56,
23731             0.70,   0.88,   0.88,  -0.63,  -0.60,   0.55,  -0.60,  -0.80,
23732             0.80,  -0.80,  -0.52,   0.60,   0.52,   0.60,   0.52,  -0.60,
23733            -0.48,   0.60,   0.48,   0.60,   0.48,   0.60,  -0.76,   0.44,
23734            -0.60,   0.52,  -0.50,  -0.52,   0.50,   0.40,   0.60,  -0.40,
23735 
23736        /* 2004-2131 */
23737            -0.60,   0.40,  -0.60,   0.72,  -0.72,  -0.51,  -0.50,  -0.48,
23738             0.50,   0.48,  -0.50,  -0.48,   0.50,  -0.48,   0.50,   0.48,
23739            -0.50,  -0.48,  -0.50,  -0.68,  -0.68,   0.44,   0.50,  -0.64,
23740            -0.10,  -0.64,  -0.10,  -0.40,   0.50,   0.40,   0.50,   0.40,
23741             0.50,   0.00,   0.00,  -0.40,  -0.50,  -0.36,  -0.50,   0.36,
23742            -0.50,   0.60,  -0.60,   0.40,  -0.40,   0.40,   0.40,  -0.40,
23743             0.40,  -0.40,   0.40,  -0.56,  -0.56,   0.36,  -0.40,  -0.36,
23744             0.40,   0.36,  -0.40,  -0.36,  -0.40,   0.36,   0.40,   0.36,
23745             0.40,  -0.52,   0.52,   0.52,   0.32,   0.40,  -0.32,   0.40,
23746            -0.32,   0.40,  -0.32,   0.40,   0.32,  -0.40,  -0.32,  -0.40,
23747             0.32,  -0.40,   0.28,  -0.40,  -0.28,   0.40,   0.28,  -0.40,
23748             0.28,   0.40,   0.48,  -0.48,   0.48,   0.36,  -0.30,  -0.36,
23749            -0.30,   0.00,   0.00,   0.20,   0.40,  -0.44,   0.44,  -0.44,
23750            -0.44,  -0.44,  -0.44,   0.32,  -0.30,   0.32,   0.30,   0.24,
23751             0.30,  -0.12,  -0.10,  -0.28,   0.30,   0.28,   0.30,   0.28,
23752             0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,
23753 
23754        /* 2132-2259 */
23755             0.30,  -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.24,
23756            -0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,   0.30,   0.24,
23757            -0.30,  -0.24,   0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,
23758            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,   0.20,
23759            -0.30,   0.20,  -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,
23760            -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,   0.30,  -0.20,
23761            -0.30,   0.20,  -0.30,   0.20,  -0.30,  -0.36,  -0.36,  -0.36,
23762            -0.04,   0.30,   0.12,  -0.10,  -0.32,  -0.24,   0.20,   0.24,
23763             0.20,   0.20,  -0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.20,
23764             0.20,   0.20,  -0.20,   0.20,   0.20,   0.20,   0.20,  -0.20,
23765            -0.20,   0.00,   0.00,  -0.20,  -0.20,  -0.20,   0.20,  -0.20,
23766             0.20,   0.20,  -0.20,  -0.20,  -0.20,   0.20,   0.20,   0.20,
23767             0.20,   0.20,  -0.20,   0.20,  -0.20,   0.28,   0.28,   0.28,
23768             0.28,   0.28,   0.28,  -0.28,   0.28,   0.12,   0.00,   0.24,
23769             0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,
23770            -0.16,   0.20,   0.16,   0.20,  -0.16,   0.20,  -0.16,   0.20,
23771 
23772        /* 2260-2387 */
23773            -0.16,   0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,  -0.20,
23774            -0.16,   0.20,  -0.16,  -0.20,  -0.16,   0.20,   0.16,   0.20,
23775             0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,   0.20,
23776             0.16,   0.20,  -0.16,  -0.20,   0.16,   0.20,  -0.16,   0.20,
23777             0.16,   0.20,  -0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,
23778            -0.16,  -0.20,   0.24,  -0.24,  -0.24,   0.24,   0.24,   0.12,
23779             0.20,   0.12,   0.20,  -0.12,  -0.20,   0.12,  -0.20,   0.12,
23780            -0.20,  -0.12,   0.20,  -0.12,   0.20,  -0.12,  -0.20,   0.12,
23781             0.20,   0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23782            -0.20,  -0.12,   0.20,   0.12,   0.20,   0.00,   0.00,  -0.12,
23783             0.20,  -0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23784             0.20,   0.00,  -0.21,  -0.20,   0.00,   0.00,   0.20,  -0.20,
23785            -0.20,  -0.20,   0.20,  -0.16,  -0.10,   0.00,   0.17,   0.16,
23786             0.16,   0.16,   0.16,  -0.16,   0.16,   0.16,  -0.16,   0.16,
23787            -0.16,   0.16,   0.12,   0.10,   0.12,  -0.10,  -0.12,   0.10,
23788            -0.12,   0.10,   0.12,  -0.10,  -0.12,   0.12,  -0.12,   0.12,
23789 
23790        /* 2388-2515 */
23791            -0.12,   0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,
23792            -0.12,   0.12,   0.12,   0.12,   0.12,  -0.12,  -0.12,   0.12,
23793             0.12,   0.12,  -0.12,   0.12,  -0.12,  -0.12,  -0.12,   0.12,
23794            -0.12,  -0.12,   0.12,   0.00,   0.11,   0.11,-122.67, 164.70,
23795           203.78, 273.50,   3.58,   2.74,   6.18,  -4.56,   0.00,  -0.04,
23796             0.00,  -0.07,  57.44, -77.10,  95.82, 128.60,  -1.77,  -1.28,
23797             2.85,  -2.14,  82.14,  89.50,   0.00,   0.00,   2.00,  -1.84,
23798            -0.04,  47.73, -64.10,  23.79,  31.90,  -1.45,  -1.07,   0.69,
23799            -0.53, -46.38,  50.50,   0.00,   0.00,   1.13,   1.04,   0.02,
23800           -18.38,   0.00,  63.80,   0.00,   0.00,   0.41,   0.00,  -1.43,
23801            59.07,   0.00,   0.00,   0.00,   0.00,  -1.32,  57.28,   0.00,
23802             0.00,   0.00,   0.00,  -1.28, -48.65,   0.00,  -1.15,   0.00,
23803             0.00,   1.09,   0.00,   0.03, -18.30,  24.60, -17.30, -23.20,
23804             0.56,   0.41,  -0.51,   0.39, -16.91,  26.90,   8.43,  13.30,
23805             0.60,   0.38,   0.31,  -0.19,   1.23,  -1.70, -19.13, -25.70,
23806            -0.03,  -0.03,  -0.58,   0.43,  -0.72,   0.90, -17.34, -23.30,
23807 
23808        /* 2516-2643 */
23809             0.03,   0.02,  -0.52,   0.39, -19.49, -21.30,   0.00,   0.00,
23810            -0.48,   0.44,   0.01,  20.57, -20.10,   0.64,   0.70,  -0.45,
23811            -0.46,   0.00,  -0.01,   4.89,   5.90, -16.55,  19.90,   0.14,
23812            -0.11,   0.44,   0.37,  18.22,  19.80,   0.00,   0.00,   0.44,
23813            -0.41,  -0.01,   4.89,  -5.30, -16.51, -18.00,  -0.11,  -0.11,
23814            -0.41,   0.37, -17.86,   0.00,  17.10,   0.00,   0.00,   0.40,
23815             0.00,  -0.38,   0.32,   0.00,  24.42,   0.00,   0.00,  -0.01,
23816             0.00,  -0.55, -23.79,   0.00,   0.00,   0.00,   0.00,   0.53,
23817            14.72, -16.00,  -0.32,   0.00,  -0.36,  -0.33,  -0.01,   0.01,
23818             3.34,  -4.50,  11.86,  15.90,  -0.11,  -0.07,   0.35,  -0.27,
23819            -3.26,   4.40,  11.62,  15.60,   0.09,   0.07,   0.35,  -0.26,
23820           -19.53,   0.00,   5.09,   0.00,   0.00,   0.44,   0.00,  -0.11,
23821           -13.48,  14.70,   0.00,   0.00,   0.33,   0.30,   0.01,  10.86,
23822           -14.60,   3.18,   4.30,  -0.33,  -0.24,   0.09,  -0.07, -11.30,
23823           -15.10,   0.00,   0.00,  -0.34,   0.25,   0.01,   2.03,  -2.70,
23824            10.82,  14.50,  -0.07,  -0.05,   0.32,  -0.24,  17.46,   0.00,
23825 
23826        /* 2644-2771 */
23827             0.00,   0.00,   0.00,  -0.39,  16.43,   0.00,   0.52,   0.00,
23828             0.00,  -0.37,   0.00,  -0.01,   9.35,   0.00,  13.29,   0.00,
23829             0.00,  -0.21,   0.00,  -0.30, -10.42,  11.40,   0.00,   0.00,
23830             0.25,   0.23,   0.01,   0.44,   0.50, -10.38,  11.30,   0.02,
23831            -0.01,   0.25,   0.23, -14.64,   0.00,   0.00,   0.00,   0.00,
23832             0.33,   0.56,   0.80,  -8.67,  11.70,   0.02,  -0.01,   0.26,
23833             0.19,  13.88,   0.00,  -2.47,   0.00,   0.00,  -0.31,   0.00,
23834             0.06,  -1.99,   2.70,   7.72,  10.30,   0.06,   0.04,   0.23,
23835            -0.17,  -0.20,   0.00,  13.05,   0.00,   0.00,   0.00,   0.00,
23836            -0.29,   6.92,  -9.30,   3.34,   4.50,  -0.21,  -0.15,   0.10,
23837            -0.07,  -6.60,   0.00,  10.70,   0.00,   0.00,   0.15,   0.00,
23838            -0.24,  -8.04,  -8.70,   0.00,   0.00,  -0.19,   0.18, -10.58,
23839             0.00,  -3.10,   0.00,   0.00,   0.24,   0.00,   0.07,  -7.32,
23840             8.00,  -0.12,  -0.10,   0.18,   0.16,   1.63,   1.70,   6.96,
23841            -7.60,   0.03,  -0.04,  -0.17,  -0.16,  -3.62,   0.00,   9.86,
23842             0.00,   0.00,   0.08,   0.00,  -0.22,   0.20,  -0.20,  -6.88,
23843 
23844        /* 2772-2899 */
23845            -7.50,   0.00,   0.00,  -0.17,   0.15,  -8.99,   0.00,   4.02,
23846             0.00,   0.00,   0.20,   0.00,  -0.09,  -1.07,   1.40,  -5.69,
23847            -7.70,   0.03,   0.02,  -0.17,   0.13,   6.48,  -7.20,  -0.48,
23848            -0.50,  -0.16,  -0.14,  -0.01,   0.01,   5.57,  -7.50,   1.07,
23849             1.40,  -0.17,  -0.12,   0.03,  -0.02,   8.71,   0.00,   3.54,
23850             0.00,   0.00,  -0.19,   0.00,  -0.08,   0.40,   0.00,   9.27,
23851             0.00,   0.00,  -0.01,   0.00,  -0.21,  -6.13,   6.70,  -1.19,
23852            -1.30,   0.15,   0.14,  -0.03,   0.03,   5.21,  -5.70,  -2.51,
23853            -2.60,  -0.13,  -0.12,  -0.06,   0.06,   5.69,  -6.20,  -0.12,
23854            -0.10,  -0.14,  -0.13,  -0.01,   2.03,  -2.70,   4.53,   6.10,
23855            -0.06,  -0.05,   0.14,  -0.10,   5.01,   5.50,  -2.51,   2.70,
23856             0.12,  -0.11,   0.06,   0.06,  -1.91,   2.60,  -4.38,  -5.90,
23857             0.06,   0.04,  -0.13,   0.10,   4.65,  -6.30,   0.00,   0.00,
23858            -0.14,  -0.10,  -5.29,   5.70,   0.00,   0.00,   0.13,   0.12,
23859            -2.23,  -4.00,  -4.65,   4.20,  -0.09,   0.05,   0.10,   0.10,
23860            -4.53,   6.10,   0.00,   0.00,   0.14,   0.10,   2.47,   2.70,
23861 
23862        /* 2900-3027 */
23863            -4.46,   4.90,   0.06,  -0.06,   0.11,   0.10,  -5.05,   5.50,
23864             0.84,   0.90,   0.12,   0.11,   0.02,  -0.02,   4.97,  -5.40,
23865            -1.71,   0.00,  -0.12,  -0.11,   0.00,   0.04,  -0.99,  -1.30,
23866             4.22,  -5.70,  -0.03,   0.02,  -0.13,  -0.09,   0.99,   1.40,
23867             4.22,  -5.60,   0.03,  -0.02,  -0.13,  -0.09,  -4.69,  -5.20,
23868             0.00,   0.00,  -0.12,   0.10,  -3.42,   0.00,   6.09,   0.00,
23869             0.00,   0.08,   0.00,  -0.14,  -4.65,  -5.10,   0.00,   0.00,
23870            -0.11,   0.10,   0.00,   0.00,  -4.53,  -5.00,   0.00,   0.00,
23871            -0.11,   0.10,  -2.43,  -2.70,  -3.82,   4.20,  -0.06,   0.05,
23872             0.10,   0.09,   0.00,   0.00,  -4.53,   4.90,   0.00,   0.00,
23873             0.11,   0.10,  -4.49,  -4.90,   0.00,   0.00,  -0.11,   0.10,
23874             2.67,  -2.90,  -3.62,  -3.90,  -0.06,  -0.06,  -0.09,   0.08,
23875             3.94,  -5.30,   0.00,   0.00,  -0.12,  -3.38,   3.70,  -2.78,
23876            -3.10,   0.08,   0.08,  -0.07,   0.06,   3.18,  -3.50,  -2.82,
23877            -3.10,  -0.08,  -0.07,  -0.07,   0.06,  -5.77,   0.00,   1.87,
23878             0.00,   0.00,   0.13,   0.00,  -0.04,   3.54,  -4.80,  -0.64,
23879 
23880        /* 3028-3155 */
23881            -0.90,  -0.11,   0.00,  -0.02,  -3.50,  -4.70,   0.68,  -0.90,
23882            -0.11,   0.00,  -0.02,   5.49,   0.00,   0.00,   0.00,   0.00,
23883            -0.12,   1.83,  -2.50,   2.63,   3.50,  -0.06,   0.00,   0.08,
23884             3.02,  -4.10,   0.68,   0.90,  -0.09,   0.00,   0.02,   0.00,
23885             0.00,   5.21,   0.00,   0.00,   0.00,   0.00,  -0.12,  -3.54,
23886             3.80,   2.70,   3.60,  -1.35,   1.80,   0.08,   0.00,   0.04,
23887            -2.90,   3.90,   0.68,   0.90,   0.09,   0.00,   0.02,   0.80,
23888            -1.10,  -2.78,  -3.70,  -0.02,   0.00,  -0.08,   4.10,   0.00,
23889            -2.39,   0.00,   0.00,  -0.09,   0.00,   0.05,  -1.59,   2.10,
23890             2.27,   3.00,   0.05,   0.00,   0.07,  -2.63,   3.50,  -0.48,
23891            -0.60,  -2.94,  -3.20,  -2.94,   3.20,   2.27,  -3.00,  -1.11,
23892            -1.50,  -0.07,   0.00,  -0.03,  -0.56,  -0.80,  -2.35,   3.10,
23893             0.00,  -0.60,  -3.42,   1.90,  -0.12,  -0.10,   2.63,  -2.90,
23894             2.51,   2.80,  -0.64,   0.70,  -0.48,  -0.60,   2.19,  -2.90,
23895             0.24,  -0.30,   2.15,   2.90,   2.15,  -2.90,   0.52,   0.70,
23896             2.07,  -2.80,  -3.10,   0.00,   1.79,   0.00,   0.00,   0.07,
23897 
23898        /* 3156-3283 */
23899             0.00,  -0.04,   0.88,   0.00,  -3.46,   2.11,   2.80,  -0.36,
23900             0.50,   3.54,  -0.20,  -3.50,  -1.39,   1.50,  -1.91,  -2.10,
23901            -1.47,   2.00,   1.39,   1.90,   2.07,  -2.30,   0.91,   1.00,
23902             1.99,  -2.70,   3.30,   0.00,   0.60,  -0.44,  -0.70,  -1.95,
23903             2.60,   2.15,  -2.40,  -0.60,  -0.70,   3.30,   0.84,   0.00,
23904            -3.10,  -3.10,   0.00,  -0.72,  -0.32,   0.40,  -1.87,  -2.50,
23905             1.87,  -2.50,   0.32,   0.40,  -0.24,   0.30,  -1.87,  -2.50,
23906            -0.24,  -0.30,   1.87,  -2.50,  -2.70,   0.00,   1.55,   2.03,
23907             2.20,  -2.98,  -1.99,  -2.20,   0.12,  -0.10,  -0.40,   0.50,
23908             1.59,   2.10,   0.00,   0.00,  -1.79,   2.00,  -1.03,   1.40,
23909            -1.15,  -1.60,   0.32,   0.50,   1.39,  -1.90,   2.35,  -1.27,
23910             1.70,   0.60,   0.80,  -0.32,  -0.40,   1.35,  -1.80,   0.44,
23911             0.00,   2.23,  -0.84,   0.90,  -1.27,  -1.40,  -1.47,   1.60,
23912            -0.28,  -0.30,  -0.28,   0.40,  -1.27,  -1.70,   0.28,  -0.40,
23913            -1.43,  -1.50,   0.00,   0.00,  -1.27,  -1.70,   2.11,  -0.32,
23914            -0.40,  -1.23,   1.60,   1.19,  -1.30,  -0.72,  -0.80,   0.72,
23915 
23916        /* 3284-3411 */
23917            -0.80,  -1.15,  -1.30,  -1.35,  -1.50,  -1.19,  -1.60,  -0.12,
23918             0.20,   1.79,   0.00,  -0.88,  -0.28,   0.40,   1.11,   1.50,
23919            -1.83,   0.00,   0.56,  -0.12,   0.10,  -1.27,  -1.40,   0.00,
23920             0.00,   1.15,   1.50,  -0.12,   0.20,   1.11,   1.50,   0.36,
23921            -0.50,  -1.07,  -1.40,  -1.11,   1.50,   1.67,   0.00,   0.80,
23922            -1.11,   0.00,   1.43,   1.23,  -1.30,  -0.24,  -1.19,  -1.30,
23923            -0.24,   0.20,  -0.44,  -0.90,  -0.95,   1.10,   1.07,  -1.40,
23924             1.15,  -1.30,   1.03,  -1.10,  -0.56,  -0.60,  -0.68,   0.90,
23925            -0.76,  -1.00,  -0.24,  -0.30,   0.95,  -1.30,   0.56,   0.70,
23926             0.84,  -1.10,  -0.56,   0.00,  -1.55,   0.91,  -1.30,   0.28,
23927             0.30,   0.16,  -0.20,   0.95,   1.30,   0.40,  -0.50,  -0.88,
23928            -1.20,   0.95,  -1.10,  -0.48,  -0.50,   0.00,   0.00,  -1.07,
23929             1.20,   0.44,  -0.50,   0.95,   1.10,   0.00,   0.00,   0.92,
23930            -1.30,   0.95,   1.00,  -0.52,   0.60,   1.59,   0.24,  -0.40,
23931             0.91,   1.20,   0.84,  -1.10,  -0.44,  -0.60,   0.84,   1.10,
23932            -0.44,   0.60,  -0.44,   0.60,  -0.84,  -1.10,  -0.80,   0.00,
23933 
23934        /* 3412-3539 */
23935             1.35,   0.76,   0.20,  -0.91,  -1.00,   0.20,  -0.30,  -0.91,
23936            -1.20,  -0.95,   1.00,  -0.48,  -0.50,   0.88,   1.00,   0.48,
23937            -0.50,  -0.95,  -1.10,   0.20,  -0.20,  -0.99,   1.10,  -0.84,
23938             1.10,  -0.24,  -0.30,   0.20,  -0.30,   0.84,   1.10,  -1.39,
23939             0.00,  -0.28,  -0.16,   0.20,   0.84,   1.10,   0.00,   0.00,
23940             1.39,   0.00,   0.00,  -0.95,   1.00,   1.35,  -0.99,   0.00,
23941             0.88,  -0.52,   0.00,  -1.19,   0.20,   0.20,   0.76,  -1.00,
23942             0.00,   0.00,   0.76,   1.00,   0.00,   0.00,   0.76,   1.00,
23943            -0.76,   1.00,   0.00,   0.00,   1.23,   0.76,   0.80,  -0.32,
23944             0.40,  -0.72,   0.80,  -0.40,  -0.40,   0.00,   0.00,  -0.80,
23945            -0.90,  -0.68,   0.90,  -0.16,  -0.20,  -0.16,  -0.20,   0.68,
23946            -0.90,  -0.36,   0.50,  -0.56,  -0.80,   0.72,  -0.90,   0.44,
23947            -0.60,  -0.48,  -0.70,  -0.16,   0.00,  -1.11,   0.32,   0.00,
23948            -1.07,   0.60,  -0.80,  -0.28,  -0.40,  -0.64,   0.00,   0.91,
23949             1.11,   0.64,  -0.90,   0.76,  -0.80,   0.00,   0.00,  -0.76,
23950            -0.80,   1.03,   0.00,  -0.36,  -0.64,  -0.70,   0.36,  -0.40,
23951 
23952        /* 3540-3667 */
23953             1.07,   0.36,  -0.50,  -0.52,  -0.70,   0.60,   0.00,   0.88,
23954             0.95,   0.00,   0.48,   0.16,  -0.20,   0.60,   0.80,   0.16,
23955            -0.20,  -0.60,  -0.80,   0.00,  -1.00,   0.12,   0.20,   0.16,
23956            -0.20,   0.68,   0.70,   0.59,  -0.80,  -0.99,  -0.56,  -0.60,
23957             0.36,  -0.40,  -0.68,  -0.70,  -0.68,  -0.70,  -0.36,  -0.50,
23958            -0.44,   0.60,   0.64,   0.70,  -0.12,   0.10,  -0.52,   0.60,
23959             0.36,   0.40,   0.00,   0.00,   0.95,  -0.84,   0.00,   0.44,
23960             0.56,   0.60,   0.32,  -0.30,   0.00,   0.00,   0.60,   0.70,
23961             0.00,   0.00,   0.60,   0.70,  -0.12,  -0.20,   0.52,  -0.70,
23962             0.00,   0.00,   0.56,   0.70,  -0.12,   0.10,  -0.52,  -0.70,
23963             0.00,   0.00,   0.88,  -0.76,   0.00,  -0.44,   0.00,   0.00,
23964            -0.52,  -0.70,   0.52,  -0.70,   0.36,  -0.40,  -0.44,  -0.50,
23965             0.00,   0.00,   0.60,   0.60,   0.84,   0.00,   0.12,  -0.24,
23966             0.00,   0.80,  -0.56,   0.60,  -0.32,  -0.30,   0.48,  -0.50,
23967             0.28,  -0.30,  -0.48,  -0.50,   0.12,   0.20,   0.48,  -0.60,
23968             0.48,   0.60,  -0.12,   0.20,   0.24,   0.00,   0.76,  -0.52,
23969 
23970        /* 3668-3795 */
23971            -0.60,  -0.52,   0.60,   0.48,  -0.50,  -0.24,  -0.30,   0.12,
23972            -0.10,   0.48,   0.60,   0.52,  -0.20,   0.36,   0.40,  -0.44,
23973             0.50,  -0.24,  -0.30,  -0.48,  -0.60,  -0.44,  -0.60,  -0.12,
23974             0.10,   0.76,   0.76,   0.20,  -0.20,   0.48,   0.50,   0.40,
23975            -0.50,  -0.24,  -0.30,   0.44,  -0.60,   0.44,  -0.60,   0.36,
23976             0.00,  -0.64,   0.72,   0.00,  -0.12,   0.00,  -0.10,  -0.40,
23977            -0.60,  -0.20,  -0.20,  -0.44,   0.50,  -0.44,   0.50,   0.20,
23978             0.20,  -0.44,  -0.50,   0.20,  -0.20,  -0.20,   0.20,  -0.44,
23979            -0.50,   0.64,   0.00,   0.32,  -0.36,   0.50,  -0.20,  -0.30,
23980             0.12,  -0.10,   0.48,   0.50,  -0.12,   0.30,  -0.36,  -0.50,
23981             0.00,   0.00,   0.48,   0.50,  -0.48,   0.50,   0.68,   0.00,
23982            -0.12,   0.56,  -0.40,   0.44,  -0.50,  -0.12,  -0.10,   0.24,
23983             0.30,  -0.40,   0.40,   0.64,   0.00,  -0.24,   0.64,   0.00,
23984            -0.20,   0.00,   0.00,   0.44,  -0.50,   0.44,   0.50,  -0.12,
23985             0.20,  -0.36,  -0.50,   0.12,   0.00,   0.64,  -0.40,   0.50,
23986             0.00,   0.10,   0.00,   0.00,  -0.40,   0.50,   0.00,   0.00,
23987 
23988        /* 3796-3923 */
23989            -0.40,  -0.50,   0.56,   0.00,   0.28,   0.00,   0.10,   0.36,
23990             0.50,   0.00,  -0.10,   0.36,  -0.50,   0.36,   0.50,   0.00,
23991            -0.10,   0.24,  -0.20,  -0.36,  -0.40,   0.16,   0.20,   0.40,
23992            -0.40,   0.00,   0.00,  -0.36,  -0.50,  -0.36,  -0.50,  -0.32,
23993            -0.50,  -0.12,   0.10,   0.20,   0.20,  -0.36,   0.40,  -0.60,
23994             0.60,   0.28,   0.00,   0.52,   0.12,  -0.10,   0.40,   0.40,
23995             0.00,  -0.50,   0.20,  -0.20,  -0.32,   0.40,   0.16,   0.20,
23996            -0.16,   0.20,   0.32,   0.40,   0.56,   0.00,  -0.12,   0.32,
23997            -0.40,  -0.16,  -0.20,   0.00,   0.00,   0.40,   0.40,  -0.40,
23998            -0.40,  -0.40,   0.40,  -0.36,   0.40,   0.12,   0.10,   0.00,
23999             0.10,   0.36,   0.40,   0.00,  -0.10,   0.36,   0.40,  -0.36,
24000             0.40,   0.00,   0.10,   0.32,   0.00,   0.44,   0.12,   0.20,
24001             0.28,  -0.40,   0.00,   0.00,   0.36,   0.40,   0.32,  -0.40,
24002            -0.16,   0.12,   0.10,   0.32,  -0.40,   0.20,   0.30,  -0.24,
24003             0.30,   0.00,   0.10,   0.32,   0.40,   0.00,  -0.10,  -0.32,
24004            -0.40,  -0.32,   0.40,   0.00,   0.10,  -0.52,  -0.52,   0.52,
24005 
24006        /* 3924-4051 */
24007             0.32,  -0.40,   0.00,   0.00,   0.32,   0.40,   0.32,  -0.40,
24008             0.00,   0.00,  -0.32,  -0.40,  -0.32,   0.40,   0.32,   0.40,
24009             0.00,   0.00,   0.32,   0.40,   0.00,   0.00,  -0.32,  -0.40,
24010             0.00,   0.00,   0.32,   0.40,   0.16,   0.20,   0.32,  -0.30,
24011            -0.16,   0.00,  -0.48,  -0.20,   0.20,  -0.28,  -0.30,   0.28,
24012            -0.40,   0.00,   0.00,   0.28,  -0.40,   0.00,   0.00,   0.28,
24013            -0.40,   0.00,   0.00,  -0.28,  -0.40,   0.28,   0.40,  -0.28,
24014            -0.40,  -0.48,  -0.20,   0.20,   0.24,   0.30,   0.44,   0.00,
24015             0.16,   0.24,   0.30,   0.16,  -0.20,   0.24,   0.30,  -0.12,
24016             0.20,   0.20,   0.30,  -0.16,   0.20,   0.00,   0.00,   0.44,
24017            -0.32,   0.30,   0.24,   0.00,  -0.36,   0.36,   0.00,   0.24,
24018             0.12,  -0.20,   0.20,   0.30,  -0.12,   0.00,  -0.28,   0.30,
24019            -0.24,   0.30,   0.12,   0.10,  -0.28,  -0.30,  -0.28,   0.30,
24020             0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,  -0.28,  -0.30,
24021             0.00,   0.00,   0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,
24022            -0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,
24023 
24024        /* 4052-4179 */
24025             0.28,   0.30,   0.00,   0.00,  -0.28,   0.30,   0.28,  -0.30,
24026            -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.00,  -0.10,
24027             0.16,   0.00,   0.36,  -0.20,   0.30,  -0.12,  -0.10,  -0.24,
24028            -0.30,   0.00,   0.00,  -0.24,   0.30,  -0.24,   0.30,   0.00,
24029             0.00,  -0.24,   0.30,  -0.24,   0.30,   0.24,  -0.30,   0.00,
24030             0.00,   0.24,  -0.30,   0.00,   0.00,   0.24,   0.30,   0.24,
24031            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,  -0.20,
24032             0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.32,   0.20,   0.00,
24033             0.10,   0.20,  -0.30,   0.20,  -0.20,   0.12,   0.20,  -0.16,
24034             0.20,   0.16,   0.20,   0.20,   0.30,   0.20,   0.30,   0.00,
24035             0.00,  -0.20,   0.30,   0.00,   0.00,   0.20,   0.30,  -0.20,
24036            -0.30,  -0.20,  -0.30,   0.20,  -0.30,   0.00,   0.00,   0.20,
24037             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
24038             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
24039            -0.30,   0.00,   0.00,  -0.20,  -0.30,   0.00,   0.00,  -0.20,
24040             0.30,   0.00,   0.00,  -0.20,   0.30,   0.00,   0.00,   0.36,
24041 
24042        /* 4180-4307 */
24043             0.00,   0.00,   0.36,   0.12,   0.10,  -0.24,   0.20,   0.12,
24044            -0.20,  -0.16,  -0.20,  -0.13,   0.10,   0.22,   0.21,   0.20,
24045             0.00,  -0.28,   0.32,   0.00,  -0.12,  -0.20,  -0.20,   0.12,
24046            -0.10,   0.12,   0.10,  -0.20,   0.20,   0.00,   0.00,  -0.32,
24047             0.32,   0.00,   0.00,   0.32,   0.32,   0.00,   0.00,  -0.24,
24048            -0.20,   0.24,   0.20,   0.20,   0.00,  -0.24,   0.00,   0.00,
24049            -0.24,  -0.20,   0.00,   0.00,   0.24,   0.20,  -0.24,  -0.20,
24050             0.00,   0.00,  -0.24,   0.20,   0.16,  -0.20,   0.12,   0.10,
24051             0.20,   0.20,   0.00,  -0.10,  -0.12,   0.10,  -0.16,  -0.20,
24052            -0.12,  -0.10,  -0.16,   0.20,   0.20,   0.20,   0.00,   0.00,
24053            -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,
24054             0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,  -0.20,   0.20,
24055             0.20,   0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,  -0.20,
24056             0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,   0.20,
24057             0.20,   0.20,   0.20,   0.12,  -0.20,  -0.12,  -0.10,   0.28,
24058            -0.28,   0.16,  -0.20,   0.00,  -0.10,   0.00,   0.10,  -0.16,
24059 
24060        /* 4308-4435 */
24061             0.20,   0.00,  -0.10,  -0.16,  -0.20,   0.00,  -0.10,   0.16,
24062            -0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,   0.20,  -0.16,
24063             0.20,   0.00,   0.00,   0.16,   0.20,   0.16,  -0.20,   0.16,
24064            -0.20,  -0.16,   0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,
24065             0.20,   0.00,   0.00,   0.16,   0.20,   0.00,   0.00,  -0.16,
24066            -0.20,   0.16,  -0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.16,
24067            -0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,   0.00,   0.16,
24068            -0.20,   0.16,   0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,
24069            -0.20,   0.00,   0.00,  -0.16,  -0.20,   0.00,   0.00,   0.16,
24070             0.20,   0.16,   0.20,   0.00,   0.00,   0.16,   0.20,   0.16,
24071            -0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,
24072             0.10,   0.12,  -0.20,   0.12,  -0.20,   0.00,  -0.10,   0.00,
24073            -0.10,   0.12,   0.20,   0.00,  -0.10,  -0.12,   0.20,  -0.15,
24074             0.20,  -0.24,   0.24,   0.00,   0.00,   0.24,   0.24,   0.12,
24075            -0.20,  -0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
24076            -0.20,   0.12,   0.20,   0.12,   0.20,   0.12,   0.20,   0.12,
24077 
24078        /* 4436-4563 */
24079            -0.20,  -0.12,   0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
24080             0.00,  -0.20,   0.00,   0.00,  -0.12,  -0.20,   0.12,  -0.20,
24081             0.00,   0.00,   0.12,   0.20,  -0.12,   0.20,  -0.12,   0.20,
24082             0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.20,   0.00,
24083             0.12,   0.00,   0.00,  -0.12,   0.20,   0.00,   0.00,  -0.12,
24084            -0.20,   0.00,   0.00,  -0.12,  -0.20,  -0.12,  -0.20,   0.00,
24085             0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,   0.20,  -0.12,
24086            -0.20,   0.00,   0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,
24087             0.20,   0.12,   0.00,   0.20,  -0.12,  -0.20,   0.00,   0.00,
24088             0.12,   0.20,  -0.16,   0.00,   0.16,  -0.20,   0.20,   0.00,
24089             0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,   0.00,   0.00,
24090             0.20,   0.20,  -0.20,   0.00,   0.00,  -0.20,   0.12,   0.00,
24091            -0.16,   0.20,   0.00,   0.00,   0.20,   0.12,  -0.10,   0.00,
24092             0.10,   0.16,  -0.16,  -0.16,  -0.16,  -0.16,  -0.16,   0.00,
24093             0.00,  -0.16,   0.00,   0.00,  -0.16,  -0.16,  -0.16,   0.00,
24094             0.00,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,   0.16,
24095 
24096        /* 4564-4691 */
24097             0.00,   0.00,   0.16,   0.16,   0.00,   0.00,  -0.16,   0.00,
24098             0.00,  -0.16,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,
24099            -0.16,  -0.16,   0.00,   0.00,  -0.16,  -0.16,   0.12,   0.10,
24100             0.12,  -0.10,   0.12,   0.10,   0.00,   0.00,   0.12,   0.10,
24101            -0.12,   0.10,   0.00,   0.00,   0.12,   0.10,   0.12,  -0.10,
24102             0.00,   0.00,  -0.12,  -0.10,   0.00,   0.00,   0.12,   0.10,
24103             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,  -0.12,   0.00,
24104             0.00,   0.12,   0.12,   0.12,   0.12,   0.12,   0.00,   0.00,
24105             0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,   0.12,
24106             0.00,   0.00,   0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,
24107            -0.12,   0.00,   0.00,   0.12,  -0.12,   0.12,   0.12,  -0.12,
24108            -0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24109             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,   0.12,   0.00,
24110             0.00,   0.12,  -0.12,   0.00,   0.00,  -0.12,   0.12,  -0.12,
24111            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.12,  -0.12,
24112             0.00,   0.00,  -0.12,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24113 
24114        /* 4692-NA */
24115            -0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,  -0.12,
24116            -0.12,  -0.12,  -0.12,   0.12,   0.00,   0.00,   0.12,  -0.12,
24117             0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,   0.12,  -0.12,
24118            -0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,  -0.12,   0.00,
24119             0.00,  -0.12,   0.00,   0.00,  -0.12,   0.12,   0.00,   0.00,
24120             0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24121            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,
24122             0.12,   0.00,   0.00,   0.12,   0.12,   0.08,   0.00,   0.04
24123        };
24124 
24125     /* Number of amplitude coefficients */
24126         final int NA = a.length;
24127 
24128     /* Amplitude usage: X or Y, sin or cos, power of T. */
24129         final int jaxy[] = {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};
24130         final int jasc[] = {0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0};
24131         final int japt[] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4};
24132 
24133     /* Miscellaneous */
24134        double t, w, pt[] = new double[MAXPT+1], fa[] = new double[14], xypr[] = new double[2], xypl[] = new double[2], xyls[] = new double[2], arg,
24135               sc[] = new double[2];
24136        int jpt, i, j, jxy, ialast, ifreq, m, ia, jsc;
24137 
24138     /*--------------------------------------------------------------------*/
24139 
24140     /* Interval between fundamental date J2000.0 and given date (JC). */
24141        t = ((date1 - DJ00) + date2) / DJC;
24142 
24143     /* Powers of T. */
24144        w = 1.0;
24145        for (jpt = 0; jpt <= MAXPT; jpt++) {
24146           pt[jpt] = w;
24147           w *= t;
24148        }
24149 
24150     /* Initialize totals in X and Y:  polynomial, luni-solar, planetary. */
24151        for (jxy = 0; jxy < 2; jxy++) {
24152           xypr[jxy] = 0.0;
24153           xyls[jxy] = 0.0;
24154           xypl[jxy] = 0.0;
24155        }
24156 
24157     /* --------------------------------- */
24158     /* Fundamental arguments (IERS 2003) */
24159     /* --------------------------------- */
24160 
24161     /* Mean anomaly of the Moon. */
24162        fa[0] = jauFal03(t);
24163 
24164     /* Mean anomaly of the Sun. */
24165        fa[1] = jauFalp03(t);
24166 
24167     /* Mean argument of the latitude of the Moon. */
24168        fa[2] = jauFaf03(t);
24169 
24170     /* Mean elongation of the Moon from the Sun. */
24171        fa[3] = jauFad03(t);
24172 
24173     /* Mean longitude of the ascending node of the Moon. */
24174        fa[4] = jauFaom03(t);
24175 
24176     /* Planetary longitudes, Mercury through Neptune. */
24177        fa[5] = jauFame03(t);
24178        fa[6] = jauFave03(t);
24179        fa[7] = jauFae03(t);
24180        fa[8] = jauFama03(t);
24181        fa[9] = jauFaju03(t);
24182        fa[10] = jauFasa03(t);
24183        fa[11] = jauFaur03(t);
24184        fa[12] = jauFane03(t);
24185 
24186     /* General accumulated precession in longitude. */
24187        fa[13] = jauFapa03(t);
24188 
24189     /* -------------------------------------- */
24190     /* Polynomial part of precession-nutation */
24191     /* -------------------------------------- */
24192 
24193        for (jxy = 0; jxy < 2; jxy++) {
24194           for (j = MAXPT; j >= 0; j--) {
24195              xypr[jxy] += xyp[jxy][j] * pt[j];
24196           }
24197        }
24198 
24199     /* ---------------------------------- */
24200     /* Nutation periodic terms, planetary */
24201     /* ---------------------------------- */
24202 
24203     /* Work backwards through the coefficients per frequency list. */
24204        ialast = NA;
24205        for (ifreq = NFPL-1; ifreq >= 0; ifreq--) {
24206 
24207        /* Obtain the argument functions. */
24208           arg = 0.0;
24209           for (i = 0; i < 14; i++) {
24210              m = mfapl[ifreq][i];
24211              if (m != 0) arg += (double)m * fa[i];
24212           }
24213           sc[0] = sin(arg);
24214           sc[1] = cos(arg);
24215 
24216        /* Work backwards through the amplitudes at this frequency. */
24217           ia = nc[ifreq+NFLS];
24218           for (i = ialast; i >= ia; i--) {
24219 
24220           /* Coefficient number (0 = 1st). */
24221              j = i-ia;
24222 
24223           /* X or Y. */
24224              jxy = jaxy[j];
24225 
24226           /* Sin or cos. */
24227              jsc = jasc[j];
24228 
24229           /* Power of T. */
24230              jpt = japt[j];
24231 
24232           /* Accumulate the component. */
24233              xypl[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24234           }
24235           ialast = ia-1;
24236        }
24237 
24238     /* ----------------------------------- */
24239     /* Nutation periodic terms, luni-solar */
24240     /* ----------------------------------- */
24241 
24242     /* Continue working backwards through the number of coefficients list. */
24243        for (ifreq = NFLS-1; ifreq >= 0; ifreq--) {
24244 
24245        /* Obtain the argument functions. */
24246           arg = 0.0;
24247           for (i = 0; i < 5; i++) {
24248              m = mfals[ifreq][i];
24249              if (m != 0) arg += (double)m * fa[i];
24250           }
24251           sc[0] = sin(arg);
24252           sc[1] = cos(arg);
24253 
24254        /* Work backwards through the amplitudes at this frequency. */
24255           ia = nc[ifreq];
24256           for (i = ialast; i >= ia; i--) {
24257 
24258           /* Coefficient number (0 = 1st). */
24259              j = i-ia;
24260 
24261           /* X or Y. */
24262              jxy = jaxy[j];
24263 
24264           /* Sin or cos. */
24265              jsc = jasc[j];
24266 
24267           /* Power of T. */
24268              jpt = japt[j];
24269 
24270           /* Accumulate the component. */
24271              xyls[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24272           }
24273           ialast = ia-1;
24274        }
24275 
24276     /* ------------------------------------ */
24277     /* Results:  CIP unit vector components */
24278     /* ------------------------------------ */
24279 
24280        double x = DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6);
24281        double y = DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6);
24282 
24283        return new CelestialIntermediatePole(x, y);
24284 
24285         }
24286     
24287 
24288     /**
24289     *  For a given TT date, compute the X,Y coordinates of the Celestial
24290     *  Intermediate Pole and the CIO locator s, using the IAU 2000A
24291     *  precession-nutation model.
24292     *
24293     *<p>This function is derived from the International Astronomical Union's
24294     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24295     *
24296     *<p>Status:  support function.
24297     *
24298     *<!-- Given: -->
24299     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24300     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24301     *
24302     *<!-- Returned: -->
24303     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24304     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24305     *             s double     <u>returned</u> the CIO locator s (Note 2)
24306     *
24307     * <p>Notes:
24308     * <ol>
24309     *
24310     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24311     *     convenient way between the two arguments.  For example,
24312     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24313     *     among others:
24314     *<pre>
24315     *            date1          date2
24316     *
24317     *         2450123.7           0.0       (JD method)
24318     *         2451545.0       -1421.3       (J2000 method)
24319     *         2400000.5       50123.2       (MJD method)
24320     *         2450123.5           0.2       (date &amp; time method)
24321     *</pre>
24322     *     The JD method is the most natural and convenient to use in
24323     *     cases where the loss of several decimal digits of resolution
24324     *     is acceptable.  The J2000 method is best matched to the way
24325     *     the argument is handled internally and will deliver the
24326     *     optimum resolution.  The MJD method and the date &amp; time methods
24327     *     are both good compromises between resolution and convenience.
24328     *
24329     * <li> The Celestial Intermediate Pole coordinates are the x,y
24330     *     components of the unit vector in the Geocentric Celestial
24331     *     Reference System.
24332     *
24333     * <li> The CIO locator s (in radians) positions the Celestial
24334     *     Intermediate Origin on the equator of the CIP.
24335     *
24336     * <li> A faster, but slightly less accurate, result (about 1 mas for
24337     *     X,Y), can be obtained by using instead the jauXys00b function.
24338     *</ol>
24339     *<p>Called:<ul>
24340     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
24341     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24342     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24343     * </ul>
24344     *<p>Reference:
24345     *
24346     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24347     *     IERS Technical Note No. 32, BKG (2004)
24348     *
24349     *@version 2008 May 12
24350     *
24351     *  @since Release 20101201
24352     *
24353     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24354     */
24355     public static ICRFrame jauXys00a(double date1, double date2)
24356     {
24357 
24358     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24359        double rbpn[][] = jauPnm00a(date1, date2);
24360 
24361     /* Extract X,Y. */
24362        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24363 
24364     /* Obtain s. */
24365        double s = jauS00(date1, date2, cip.x, cip.y);
24366 
24367        return new ICRFrame(cip, s);
24368 
24369         }
24370     
24371 
24372     /**
24373      *    The Celestial Intermediate Pole coordinates are the x,y
24374     *     components of the unit vector in the Geocentric Celestial
24375     *     Reference System.
24376     *
24377     *  The CIO locator s (in radians) positions the Celestial
24378     *     Intermediate Origin on the equator of the CIP.
24379  
24380      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
24381      * 
24382      * @since AIDA Stage 1
24383      */
24384     public static class ICRFrame {
24385         public CelestialIntermediatePole cip;
24386         public double s;
24387         public ICRFrame(CelestialIntermediatePole cip, double s) {
24388             this.cip = cip;
24389             this.s = s;
24390         }
24391     }
24392     /**
24393     *  For a given TT date, compute the X,Y coordinates of the Celestial
24394     *  Intermediate Pole and the CIO locator s, using the IAU 2000B
24395     *  precession-nutation model.
24396     *
24397     *<p>This function is derived from the International Astronomical Union's
24398     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24399     *
24400     *<p>Status:  support function.
24401     *
24402     *<!-- Given: -->
24403     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24404     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24405     *
24406     *<!-- Returned: -->
24407     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24408     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24409     *             s             double     <u>returned</u> the CIO locator s (Note 2)
24410     *
24411     * <p>Notes:
24412     * <ol>
24413     *
24414     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24415     *     convenient way between the two arguments.  For example,
24416     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24417     *     among others:
24418     *<pre>
24419     *            date1          date2
24420     *
24421     *         2450123.7           0.0       (JD method)
24422     *         2451545.0       -1421.3       (J2000 method)
24423     *         2400000.5       50123.2       (MJD method)
24424     *         2450123.5           0.2       (date &amp; time method)
24425     *</pre>
24426     *     The JD method is the most natural and convenient to use in
24427     *     cases where the loss of several decimal digits of resolution
24428     *     is acceptable.  The J2000 method is best matched to the way
24429     *     the argument is handled internally and will deliver the
24430     *     optimum resolution.  The MJD method and the date &amp; time methods
24431     *     are both good compromises between resolution and convenience.
24432     *
24433     * <li> The Celestial Intermediate Pole coordinates are the x,y
24434     *     components of the unit vector in the Geocentric Celestial
24435     *     Reference System.
24436     *
24437     * <li> The CIO locator s (in radians) positions the Celestial
24438     *     Intermediate Origin on the equator of the CIP.
24439     *
24440     * <li> The present function is faster, but slightly less accurate (about
24441     *     1 mas in X,Y), than the jauXys00a function.
24442     *</ol>
24443     *<p>Called:<ul>
24444     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
24445     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24446     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24447     * </ul>
24448     *<p>Reference:
24449     *
24450     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24451     *     IERS Technical Note No. 32, BKG (2004)
24452     *
24453     *@version 2008 May 12
24454     *
24455     *  @since Release 20101201
24456     *
24457     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24458     */
24459     public static ICRFrame jauXys00b(double date1, double date2)
24460     {
24461        double rbpn[][] = new double[3][3];
24462 
24463 
24464     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24465        rbpn = jauPnm00b(date1, date2);
24466 
24467     /* Extract X,Y. */
24468        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24469 
24470     /* Obtain s. */
24471        double s = jauS00(date1, date2, cip.x, cip.y);
24472 
24473        return new ICRFrame(cip, s);
24474 
24475         }
24476     
24477 
24478     /**
24479     *  For a given TT date, compute the X,Y coordinates of the Celestial
24480     *  Intermediate Pole and the CIO locator s, using the IAU 2006
24481     *  precession and IAU 2000A nutation models.
24482     *
24483     *<p>This function is derived from the International Astronomical Union's
24484     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24485     *
24486     *<p>Status:  support function.
24487     *
24488     *<!-- Given: -->
24489     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24490     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24491     *
24492     *<!-- Returned: -->
24493     *     @return x double    <u>returned</u> Celestial Intermediate Pole (Note 2)
24494     *             y double    <u>returned</u> Celestial Intermediate Pole (Note 2) 
24495     *             s             double    <u>returned</u> the CIO locator s (Note 2)
24496     *
24497     * <p>Notes:
24498     * <ol>
24499     *
24500     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24501     *     convenient way between the two arguments.  For example,
24502     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24503     *     among others:
24504     *<pre>
24505     *            date1          date2
24506     *
24507     *         2450123.7           0.0       (JD method)
24508     *         2451545.0       -1421.3       (J2000 method)
24509     *         2400000.5       50123.2       (MJD method)
24510     *         2450123.5           0.2       (date &amp; time method)
24511     *</pre>
24512     *     The JD method is the most natural and convenient to use in
24513     *     cases where the loss of several decimal digits of resolution
24514     *     is acceptable.  The J2000 method is best matched to the way
24515     *     the argument is handled internally and will deliver the
24516     *     optimum resolution.  The MJD method and the date &amp; time methods
24517     *     are both good compromises between resolution and convenience.
24518     *
24519     * <li> The Celestial Intermediate Pole coordinates are the x,y components
24520     *     of the unit vector in the Geocentric Celestial Reference System.
24521     *
24522     * <li> The CIO locator s (in radians) positions the Celestial
24523     *     Intermediate Origin on the equator of the CIP.
24524     *
24525     * <li> Series-based solutions for generating X and Y are also available:
24526     *     see Capitaine &amp; Wallace (2006) and jauXy06.
24527     *</ol>
24528     *<p>Called:<ul>
24529     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
24530     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24531     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
24532     * </ul>
24533     *<p>References:
24534     *
24535     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
24536     *
24537     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
24538     *
24539     *@version 2008 May 11
24540     *
24541     *  @since Release 20101201
24542     *
24543     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24544     */
24545     public static ICRFrame jauXys06a(double date1, double date2)
24546     {
24547        double rbpn[][] = new double[3][3];
24548 
24549 
24550     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24551        rbpn = jauPnm06a(date1, date2);
24552 
24553     /* Extract X,Y. */
24554        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24555 
24556     /* Obtain s. */
24557        double s = jauS06(date1, date2, cip.x, cip.y);
24558 
24559        return new ICRFrame(cip, s);
24560 
24561         }
24562     
24563 
24564     /**
24565     *  Zero a p-vector.
24566     *
24567     *<p>This function is derived from the International Astronomical Union's
24568     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24569     *
24570     *<p>Status:  vector/matrix support function.
24571     *
24572     *<!-- Returned: -->
24573     *     @param p         double[3]        <u>returned</u> p-vector
24574     *
24575     *@version 2008 May 11
24576     *
24577     *  @since Release 20101201
24578     *
24579     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24580     */
24581     public static void jauZp(double p[] )
24582     {
24583        p[0] = 0.0;
24584        p[1] = 0.0;
24585        p[2] = 0.0;
24586 
24587        return;
24588 
24589     }
24590     /**
24591      * Return Zero p-vector. This is a convenience method that is an 
24592      * overload of the official SOFA API {@link #jauZp(double[])} that does not require 
24593      * the vector to be passed in.
24594      * 
24595      * @return double[3] a zero vector.
24596      *
24597      */
24598     public static double[] jauZp()
24599     {
24600         double p[] = new double[3];
24601         jauZp(p);
24602         return p;
24603     }
24604 
24605     /**
24606     *  Zero a pv-vector.
24607     *
24608     *<p>This function is derived from the International Astronomical Union's
24609     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24610     *
24611     *<p>Status:  vector/matrix support function.
24612     *
24613     *<!-- Returned: -->
24614     *     @param pv        double[2][3]        <u>returned</u> pv-vector
24615     *
24616     *<p>Called:<ul>
24617     *     <li>{@link #jauZp} zero p-vector
24618     * </ul>
24619     *@version 2008 May 11
24620     *
24621     *  @since Release 20101201
24622     *
24623     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24624     */
24625     public static void jauZpv(double pv[][])
24626     {
24627        jauZp(pv[0]);
24628        jauZp(pv[1]);
24629 
24630        return;
24631 
24632         }
24633     
24634     /**
24635      *  A Zero pv-vector.
24636      *  
24637      * This is a convenience method that is an 
24638      * overload of the official SOFA API {@link #jauZpv(double[][])} that does not require 
24639      * the vector to be passed in.
24640      *  
24641      * @return pv    double[2][3]  pv-vector
24642      */
24643     public static double[][] jauZpv() {
24644         double pv[][] = new double[2][3];
24645         jauZpv(pv);
24646         return pv;
24647     }
24648 
24649     
24650 
24651     /**
24652     *  Initialize an r-matrix to the null matrix.
24653     *
24654     *<p>This function is derived from the International Astronomical Union's
24655     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24656     *
24657     *<p>Status:  vector/matrix support function.
24658     *
24659     *<!-- Returned: -->
24660     *     @param r         double[3][3]      <u>returned</u> r-matrix
24661     *
24662     *@version 2008 May 11
24663     *
24664     *  @since Release 20101201 
24665     *
24666     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24667     */
24668     public static void jauZr(double r[][])
24669     {
24670        int i, j;
24671 
24672 
24673        for (i = 0; i < 3; i++) {
24674           for (j = 0; j < 3; j++) {
24675              r[i][j] = 0.0;
24676           }
24677        }
24678 
24679        return;
24680 
24681      }
24682      /**
24683       * Initialize an r-matrix to the null matrix. 
24684       * 
24685       * This is a convenience method that is an 
24686      * overload of the official SOFA API {@link #jauZr(double[][])} that does not require 
24687      * the vector to be passed in.
24688      * @return null r matrix.
24689      */
24690     public static double[][] jauZr()
24691      {
24692          double r[][] = new double[2][3];
24693          jauZr(r);
24694          return r;
24695      }
24696    
24697 
24698     /**
24699      * returns the first argument modulo the second.
24700      * Utility function to retain C use of fmod.
24701      * @param d
24702      * @param d2
24703      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 27 Jan 2010
24704      * @return
24705      */
24706     private static double fmod(double d, double d2) {
24707         return d % d2;
24708     }
24709  //IMPL new 20131202 routines after here
24710 
24711     /**
24712      *  Star-independent astrometry parameters.
24713      * 
24714      *  (Vectors eb, eh, em and v are all with respect to BCRS axes.)
24715      *  
24716      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24717      *  @since 20131202
24718      */
24719     public static class  Astrom {
24720         
24721 /** PM time interval (SSB, Julian years) */
24722        public double pmt;       
24723 /** SSB to observer (vector, au) [3]*/
24724        public double eb[] = new double[3];      
24725 /** Sun to observer (unit vector)[3] */
24726        public double eh[] = new double[3];      
24727 /** distance from Sun to observer (au) */
24728        public double em;         
24729 /** barycentric observer velocity (vector, c)[3] */
24730        public double v[] = new double[3];       
24731 /** sqrt(1-|v|^2): reciprocal of Lorenz factor */
24732        public double bm1;        
24733 /** bias-precession-nutation matrix [3][3] */
24734        public double bpn[][] = new double[3][3];  
24735 /** adjusted longitude  (radians) */
24736        public double along;      
24737 /** geodetic latitude (radians) */
24738        public double phi;        
24739 /** polar motion xp wrt local meridian (radians) */
24740        public double xpl;        
24741 /** polar motion yp wrt local meridian (radians) */
24742        public double ypl;        
24743 /** sine of geodetic latitude */
24744        public double sphi;       
24745 /** cosine of geodetic latitude */
24746        public double cphi;       
24747 /** magnitude of diurnal aberration vector */
24748        public double diurab;     
24749 /** "local" Earth rotation angle (radians) */
24750        public double eral;       
24751 /** refraction constant A (radians) */
24752        public double refa;       
24753 /** refraction constant B (radians) */
24754        public double refb;       
24755        
24756        /**
24757         * 
24758         */
24759        public Astrom(){}
24760     } ;
24761 
24762     /**
24763      *  Body parameters for light deflection.
24764      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24765      *  @since 20131202
24766      */
24767     public static class Ldbody {
24768         /** mass of the body (solar masses) */
24769        public double bm;
24770        /** deflection limiter (radians^2/2) */
24771        public double dl; 
24772        /** barycentric PV of the body (au, au/day)[2][3] */
24773        public double pv[][] = new double [2][3];   
24774     } ;
24775 
24776 
24777     /**
24778      *  Apply aberration to transform natural direction into proper
24779      *  direction.
24780      *
24781      *<p>This function is derived from the International Astronomical Union's
24782      *  SOFA (Standards of Fundamental Astronomy) software collection.
24783      *
24784      *<p>Status:  support function.
24785      *
24786      *<!-- Given: -->
24787      *    @param pnat     double[3]    natural direction to the source (unit vector)
24788      *    @param v        double[3]    observer barycentric velocity in units of c
24789      *    @param s        double       distance between the Sun and the observer (au)
24790      *    @param bm1      double       sqrt(1-|v|^2): reciprocal of Lorenz factor
24791      *
24792      *<!-- Returned:-->
24793      *    @return ppr      double[3]     <b>Returned</b> proper direction to source (unit vector)
24794      *
24795      *<p>Notes:
24796      * <ol>
24797      *
24798      *  <li> The algorithm is based on Expr. (7.40) in the Explanatory
24799      *     Supplement (Urban &amp; Seidelmann 2013), but with the following
24800      *     changes:
24801      *
24802      *     <p>o  Rigorous rather than approximate normalization is applied.
24803      *
24804      *     <p>o  The gravitational potential term from Expr. (7) in
24805      *        Klioner (2003) is added, taking into account only the Sun's
24806      *        contribution.  This has a maximum effect of about
24807      *        0.4 microarcsecond.
24808      *
24809      *  <li> In almost all cases, the maximum accuracy will be limited by the
24810      *     supplied velocity.  For example, if the SOFA iauEpv00 function is
24811      *     used, errors of up to 5 microarcseconds could occur.
24812      *
24813      * </ol>
24814      *<p>References:
24815      * <ul>
24816      *
24817      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
24818      *     the Astronomical Almanac, 3rd ed., University Science Books
24819      *     (2013).
24820      *
24821      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
24822      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
24823      *
24824      * </ul>
24825      *  Called:
24826      * <ul>
24827      *     <li>{@link #jauPdp} scalar product of two p-vectors
24828      *
24829      * </ul>
24830      *@version  2013 October 9
24831      *
24832      *@since JSOFA release 20131202
24833      *
24834      *
24835      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24836      */
24837     public static  double[] jauAb(double pnat[], double v[], double s, double bm1
24838            )
24839     {
24840         int i;
24841         double pdv, w1, w2, r2, w, p[] = new double[3], r;
24842         double ppr[] = new double[3];
24843 
24844         pdv = jauPdp(pnat, v);
24845         w1 = 1.0 + pdv/(1.0 + bm1);
24846         w2 = SRS/s;
24847         r2 = 0.0;
24848         for (i = 0; i < 3; i++) {
24849             w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
24850             p[i] = w;
24851             r2 = r2 + w*w;
24852         }
24853         r = sqrt(r2);
24854         for (i = 0; i < 3; i++) {
24855             ppr[i] = p[i]/r;
24856         }
24857         return ppr;
24858         /* Finished. */
24859 
24860 
24861     }
24862 
24863     /**
24864      *  For a geocentric observer, prepare star-independent astrometry
24865      *  parameters for transformations between ICRS and GCRS coordinates.
24866      *  The Earth ephemeris is supplied by the caller.
24867      *
24868      *  The parameters produced by this function are required in the
24869      *  parallax, light deflection and aberration parts of the astrometric
24870      *  transformation chain.
24871      *
24872      *<p>This function is derived from the International Astronomical Union's
24873      *  SOFA (Standards of Fundamental Astronomy) software collection.
24874      *
24875      *<p>Status:  support function.
24876      *
24877      *<!-- Given: -->
24878      *     @param date1   double        TDB as a 2-part...
24879      *     @param date2   double        ...Julian Date (Note 1)
24880      *     @param ebpv    double[2][3]  Earth barycentric pos/vel (au, au/day)
24881      *     @param ehp     double[3]     Earth heliocentric position (au)
24882      *
24883      *<!-- Returned:-->
24884      *     @param astrom  jauASTROM     <b>Returned</b> star-independent astrometry parameters:
24885      *
24886      *<p>Notes:
24887      * <ol>
24888      *
24889      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24890      *     convenient way between the two arguments.  For example,
24891      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24892      *     others:
24893      *     <pre>
24894      *           date1          date2
24895      *
24896      *         2450123.7           0.0       (JD method)
24897      *         2451545.0       -1421.3       (J2000 method)
24898      *         2400000.5       50123.2       (MJD method)
24899      *         2450123.5           0.2       (date &amp; time method)
24900      *     </pre>
24901      *     <p>The JD method is the most natural and convenient to use in cases
24902      *     where the loss of several decimal digits of resolution is
24903      *     acceptable.  The J2000 method is best matched to the way the
24904      *     argument is handled internally and will deliver the optimum
24905      *     resolution.  The MJD method and the date &amp; time methods are both
24906      *     good compromises between resolution and convenience.  For most
24907      *     applications of this function the choice will not be at all
24908      *     critical.
24909      *
24910      *     <p>TT can be used instead of TDB without any significant impact on
24911      *     accuracy.
24912      *
24913      *  <li> All the vectors are with respect to BCRS axes.
24914      *
24915      *  <li> This is one of several functions that inserts into the astrom
24916      *     structure star-independent parameters needed for the chain of
24917      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
24918      *
24919      *     <p>The various functions support different classes of observer and
24920      *     portions of the transformation chain:
24921      *     <pre>{@code
24922      *          functions         observer        transformation
24923      *
24924      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
24925      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
24926      *       iauApco iauApco13    terrestrial     ICRS <-> observed
24927      *       iauApcs iauApcs13    space           ICRS <-> GCRS
24928      *       iauAper iauAper13    terrestrial     update Earth rotation
24929      *       iauApio iauApio13    terrestrial     CIRS <-> observed
24930      *     }</pre>
24931      *     
24932      *     <p>Those with names ending in "13" use contemporary SOFA models to
24933      *     compute the various ephemerides.  The others accept ephemerides
24934      *     supplied by the caller.
24935      *
24936      *     <p>The transformation from ICRS to GCRS covers space motion,
24937      *     parallax, light deflection, and aberration.  From GCRS to CIRS
24938      *     comprises frame bias and precession-nutation.  From CIRS to
24939      *     observed takes account of Earth rotation, polar motion, diurnal
24940      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
24941      *     transformation), and atmospheric refraction.
24942      *
24943      *  <li> The context structure astrom produced by this function is used by
24944      *     iauAtciq* and iauAticq*.
24945      *
24946      * </ol>
24947      *  Called:
24948      * <ul>
24949      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
24950      *
24951      * </ul>
24952      *@version  2013 October 9
24953      *
24954      *@since JSOFA release 20131202
24955      *
24956      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24957      */
24958     public static void jauApcg(double date1, double date2,
24959             double ebpv[][], double ehp[],
24960             Astrom astrom)
24961     {
24962         /* Geocentric observer */
24963         double pv[][] = { { 0.0, 0.0, 0.0 },
24964             { 0.0, 0.0, 0.0 } };
24965 
24966 
24967             /* Compute the star-independent astrometry parameters. */
24968             jauApcs(date1, date2, pv, ebpv, ehp, astrom);
24969 
24970             /* Finished. */
24971 
24972 
24973     }
24974 
24975     /**
24976      *  For a geocentric observer, prepare star-independent astrometry
24977      *  parameters for transformations between ICRS and GCRS coordinates.
24978      *  The caller supplies the date, and SOFA models are used to predict
24979      *  the Earth ephemeris.
24980      *
24981      *  The parameters produced by this function are required in the
24982      *  parallax, light deflection and aberration parts of the astrometric
24983      *  transformation chain.
24984      *
24985      *<p>This function is derived from the International Astronomical Union's
24986      *  SOFA (Standards of Fundamental Astronomy) software collection.
24987      *
24988      *<p>Status:  support function.
24989      *
24990      *<!-- Given: -->
24991      *     @param date1   double      TDB as a 2-part...
24992      *     @param date2   double      ...Julian Date (Note 1)
24993      *
24994      *<!-- Returned:-->
24995      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
24996      *
24997      *<p>Notes:
24998      * <ol>
24999      *
25000      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25001      *     convenient way between the two arguments.  For example,
25002      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25003      *     others:
25004      *     <pre>
25005      *            date1          date2
25006      *
25007      *         2450123.7           0.0       (JD method)
25008      *         2451545.0       -1421.3       (J2000 method)
25009      *         2400000.5       50123.2       (MJD method)
25010      *         2450123.5           0.2       (date &amp; time method)
25011      *     </pre>
25012      *     <p>The JD method is the most natural and convenient to use in cases
25013      *     where the loss of several decimal digits of resolution is
25014      *     acceptable.  The J2000 method is best matched to the way the
25015      *     argument is handled internally and will deliver the optimum
25016      *     resolution.  The MJD method and the date &amp; time methods are both
25017      *     good compromises between resolution and convenience.  For most
25018      *     applications of this function the choice will not be at all
25019      *     critical.
25020      *
25021      *     <p>TT can be used instead of TDB without any significant impact on
25022      *     accuracy.
25023      *
25024      *  <li> All the vectors are with respect to BCRS axes.
25025      *
25026      *  <li> In cases where the caller wishes to supply his own Earth
25027      *     ephemeris, the function iauApcg can be used instead of the present
25028      *     function.
25029      *
25030      *  <li> This is one of several functions that inserts into the astrom
25031      *     structure star-independent parameters needed for the chain of
25032      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
25033      *
25034      *     <p>The various functions support different classes of observer and
25035      *     portions of the transformation chain:
25036      *     <pre>
25037      *     {@code
25038      *          functions         observer        transformation
25039      *
25040      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25041      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25042      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25043      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25044      *       iauAper iauAper13    terrestrial     update Earth rotation
25045      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25046      *     }
25047      *     </pre>
25048      *     <p>Those with names ending in "13" use contemporary SOFA models to
25049      *     compute the various ephemerides.  The others accept ephemerides
25050      *     supplied by the caller.
25051      *
25052      *     <p>The transformation from ICRS to GCRS covers space motion,
25053      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25054      *     comprises frame bias and precession-nutation.  From CIRS to
25055      *     observed takes account of Earth rotation, polar motion, diurnal
25056      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25057      *     transformation), and atmospheric refraction.
25058      *
25059      *  <li> The context structure astrom produced by this function is used by
25060      *     iauAtciq* and iauAticq*.
25061      *
25062      * </ol>
25063      *  Called:
25064      * <ul>
25065      *     <li>{@link #jauEpv00} Earth position and velocity
25066      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
25067      *
25068      * </ul>
25069      *@version  2013 October 9
25070      *
25071      *@since JSOFA release 20131202
25072      *
25073      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25074      */
25075     public static void jauApcg13(double date1, double date2, Astrom astrom)
25076     {
25077         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
25078 
25079 
25080         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25081         jauEpv00(date1, date2, ehpv, ebpv);
25082 
25083         /* Compute the star-independent astrometry parameters. */
25084         jauApcg(date1, date2, ebpv, ehpv[0], astrom);
25085 
25086         /* Finished. */
25087 
25088 
25089     }
25090 
25091     /**
25092      *  For a terrestrial observer, prepare star-independent astrometry
25093      *  parameters for transformations between ICRS and geocentric CIRS
25094      *  coordinates.  The Earth ephemeris and CIP/CIO are supplied by the
25095      *  caller.
25096      *
25097      *  The parameters produced by this function are required in the
25098      *  parallax, light deflection, aberration, and bias-precession-nutation
25099      *  parts of the astrometric transformation chain.
25100      *
25101      *<p>This function is derived from the International Astronomical Union's
25102      *  SOFA (Standards of Fundamental Astronomy) software collection.
25103      *
25104      *<p>Status:  support function.
25105      *
25106      *<!-- Given: -->
25107      *     @param date1   double        TDB as a 2-part...
25108      *     @param date2   double        ...Julian Date (Note 1)
25109      *     @param ebpv    double[2][3]  Earth barycentric position/velocity (au, au/day)
25110      *     @param ehp     double[3]     Earth heliocentric position (au)
25111      *     @param x double        CIP X,Y (components of unit vector)
25112      *     @param y double        CIP X,Y (components of unit vector) 
25113      *     @param s       double        the CIO locator s (radians)
25114      *
25115      *<!-- Returned:-->
25116      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25117      *
25118      *<p>Notes:
25119      * <ol>
25120      *
25121      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25122      *     convenient way between the two arguments.  For example,
25123      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25124      *     others:
25125      *     <pre>
25126      *            date1          date2
25127      *
25128      *         2450123.7           0.0       (JD method)
25129      *         2451545.0       -1421.3       (J2000 method)
25130      *         2400000.5       50123.2       (MJD method)
25131      *         2450123.5           0.2       (date &amp; time method)
25132      *     </pre>
25133      *     <p>The JD method is the most natural and convenient to use in cases
25134      *     where the loss of several decimal digits of resolution is
25135      *     acceptable.  The J2000 method is best matched to the way the
25136      *     argument is handled internally and will deliver the optimum
25137      *     resolution.  The MJD method and the date &amp; time methods are both
25138      *     good compromises between resolution and convenience.  For most
25139      *     applications of this function the choice will not be at all
25140      *     critical.
25141      *
25142      *     <p>TT can be used instead of TDB without any significant impact on
25143      *     accuracy.
25144      *
25145      *  <li> All the vectors are with respect to BCRS axes.
25146      *
25147      *  <li> In cases where the caller does not wish to provide the Earth
25148      *     ephemeris and CIP/CIO, the function iauApci13 can be used instead
25149      *     of the present function.  This computes the required quantities
25150      *     using other SOFA functions.
25151      *
25152      *  <li> This is one of several functions that inserts into the astrom
25153      *     structure star-independent parameters needed for the chain of
25154      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25155      *
25156      *     <p>The various functions support different classes of observer and
25157      *     portions of the transformation chain:
25158      *     <pre>{@code
25159      *          functions         observer        transformation
25160      *
25161      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25162      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25163      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25164      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25165      *       iauAper iauAper13    terrestrial     update Earth rotation
25166      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25167      *     }</pre>
25168      *     <p>Those with names ending in "13" use contemporary SOFA models to
25169      *     compute the various ephemerides.  The others accept ephemerides
25170      *     supplied by the caller.
25171      *
25172      *     <p>The transformation from ICRS to GCRS covers space motion,
25173      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25174      *     comprises frame bias and precession-nutation.  From CIRS to
25175      *     observed takes account of Earth rotation, polar motion, diurnal
25176      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25177      *     transformation), and atmospheric refraction.
25178      *
25179      *  <li> The context structure astrom produced by this function is used by
25180      *     iauAtciq* and iauAticq*.
25181      *
25182      * </ol>
25183      *  Called:
25184      * <ul>
25185      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
25186      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25187      *
25188      * </ul>
25189      *@version  2013 September 25
25190      *
25191      *@since JSOFA release 20131202
25192      *
25193      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25194      */
25195     public static void jauApci(double date1, double date2,
25196             double ebpv[][], double ehp[],
25197             double x, double y, double s,
25198             Astrom astrom)
25199     {
25200 
25201         /* Star-independent astrometry parameters for geocenter. */
25202         jauApcg(date1, date2, ebpv, ehp, astrom);
25203 
25204         /* CIO based BPN matrix. */
25205         astrom.bpn = jauC2ixys(x, y, s);
25206 
25207         /* Finished. */
25208 
25209 
25210     }
25211 
25212     /**
25213      *  For a terrestrial observer, prepare star-independent astrometry
25214      *  parameters for transformations between ICRS and geocentric CIRS
25215      *  coordinates.  The caller supplies the date, and SOFA models are used
25216      *  to predict the Earth ephemeris and CIP/CIO.
25217      *
25218      *  The parameters produced by this function are required in the
25219      *  parallax, light deflection, aberration, and bias-precession-nutation
25220      *  parts of the astrometric transformation chain.
25221      *
25222      *<p>This function is derived from the International Astronomical Union's
25223      *  SOFA (Standards of Fundamental Astronomy) software collection.
25224      *
25225      *<p>Status:  support function.
25226      *
25227      *<!-- Given: -->
25228      *     @param date1   double       TDB as a 2-part...
25229      *     @param date2   double       ...Julian Date (Note 1)
25230      *     
25231      *<!-- Returned:-->
25232      *     @param astrom  jauASTROM    <b>Returned</b> star-independent astrometry parameters:
25233      *                    pmt     double         <b>Returned</b> PM time interval (SSB, Julian years)
25234      *                    eb      double[3]      <b>Returned</b> SSB to observer (vector, au)
25235      *                    eh      double[3]      <b>Returned</b> Sun to observer (unit vector)
25236      *                    em      double         <b>Returned</b> distance from Sun to observer (au)
25237      *                    v       double[3]      <b>Returned</b> barycentric observer velocity (vector, c)
25238      *                    bm1     double         <b>Returned</b> sqrt(1-|v|^2): reciprocal of Lorenz factor
25239      *                    bpn     double[3][3]   <b>Returned</b> bias-precession-nutation matrix
25240      *                    along   double         <b>Returned</b> unchanged
25241      *                    xpl     double         <b>Returned</b> unchanged
25242      *                    ypl     double         <b>Returned</b> unchanged
25243      *                    sphi    double         <b>Returned</b> unchanged
25244      *                    cphi    double         <b>Returned</b> unchanged
25245      *                    diurab  double         <b>Returned</b> unchanged
25246      *                    eral    double         <b>Returned</b> unchanged
25247      *                    refa    double         <b>Returned</b> unchanged
25248      *                    refb    double         <b>Returned</b> unchanged
25249      *     @return       double*       <b>Returned</b> equation of the origins (ERA-GST)
25250      *
25251      *<p>Notes:
25252      * <ol>
25253      *
25254      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25255      *     convenient way between the two arguments.  For example,
25256      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25257      *     others:
25258      *     <pre>
25259      *            date1          date2
25260      *
25261      *         2450123.7           0.0       (JD method)
25262      *         2451545.0       -1421.3       (J2000 method)
25263      *         2400000.5       50123.2       (MJD method)
25264      *         2450123.5           0.2       (date &amp; time method)
25265      *     </pre>
25266      *     <p>The JD method is the most natural and convenient to use in cases
25267      *     where the loss of several decimal digits of resolution is
25268      *     acceptable.  The J2000 method is best matched to the way the
25269      *     argument is handled internally and will deliver the optimum
25270      *     resolution.  The MJD method and the date &amp; time methods are both
25271      *     good compromises between resolution and convenience.  For most
25272      *     applications of this function the choice will not be at all
25273      *     critical.
25274      *
25275      *     <p>TT can be used instead of TDB without any significant impact on
25276      *     accuracy.
25277      *
25278      *  <li> All the vectors are with respect to BCRS axes.
25279      *
25280      *  <li> In cases where the caller wishes to supply his own Earth
25281      *     ephemeris and CIP/CIO, the function iauApci can be used instead
25282      *     of the present function.
25283      *
25284      *  <li> This is one of several functions that inserts into the astrom
25285      *     structure star-independent parameters needed for the chain of
25286      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25287      *
25288      *     <p>The various functions support different classes of observer and
25289      *     portions of the transformation chain:
25290      *     <pre>{@code
25291      *          functions         observer        transformation
25292      *
25293      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25294      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25295      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25296      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25297      *       iauAper iauAper13    terrestrial     update Earth rotation
25298      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25299      *     }</pre>
25300      *     <p>Those with names ending in "13" use contemporary SOFA models to
25301      *     compute the various ephemerides.  The others accept ephemerides
25302      *     supplied by the caller.
25303      *
25304      *     <p>The transformation from ICRS to GCRS covers space motion,
25305      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25306      *     comprises frame bias and precession-nutation.  From CIRS to
25307      *     observed takes account of Earth rotation, polar motion, diurnal
25308      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25309      *     transformation), and atmospheric refraction.
25310      *
25311      *  <li> The context structure astrom produced by this function is used by
25312      *     iauAtciq* and iauAticq*.
25313      *
25314      * </ol>
25315      *  Called:
25316      * <ul>
25317      *     <li>{@link #jauEpv00} Earth position and velocity
25318      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25319      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25320      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25321      *     <li>{@link #jauApci} astrometry parameters, ICRS-CIRS
25322      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25323      *
25324      * </ul>
25325      *@version  2013 October 9
25326      *
25327      *@since JSOFA release 20131202
25328      *
25329      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25330      */
25331     public static double jauApci13(double date1, double date2,
25332             Astrom astrom)
25333     {
25334         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3], r[][], s;
25335 
25336 
25337         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25338         jauEpv00(date1, date2, ehpv, ebpv);
25339 
25340         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25341         r = jauPnm06a(date1, date2);
25342 
25343         /* Extract CIP X,Y. */
25344         CelestialIntermediatePole cip = jauBpn2xy(r);
25345 
25346         /* Obtain CIO locator s. */
25347         s = jauS06(date1, date2, cip.x, cip.y);
25348 
25349         /* Compute the star-independent astrometry parameters. */
25350         jauApci(date1, date2, ebpv, ehpv[0], cip.x, cip.y, s, astrom);
25351 
25352         /* Equation of the origins. */
25353         return jauEors(r, s);
25354 
25355         /* Finished. */
25356 
25357 
25358     }
25359 
25360     /**
25361      *  For a terrestrial observer, prepare star-independent astrometry
25362      *  parameters for transformations between ICRS and observed
25363      *  coordinates.  The caller supplies the Earth ephemeris, the Earth
25364      *  rotation information and the refraction constants as well as the
25365      *  site coordinates.
25366      *
25367      *<p>This function is derived from the International Astronomical Union's
25368      *  SOFA (Standards of Fundamental Astronomy) software collection.
25369      *
25370      *<p>Status:  support function.
25371      *
25372      *<!-- Given: -->
25373      *     @param date1   double        TDB as a 2-part...
25374      *     @param date2   double        ...Julian Date (Note 1)
25375      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day, Note 2)
25376      *     @param ehp     double[3]     Earth heliocentric P (au, Note 2)
25377      *     @param x double        CIP X,Y (components of unit vector)
25378      *     @param y double        CIP X,Y (components of unit vector) 
25379      *     @param s       double        the CIO locator s (radians)
25380      *     @param theta   double        Earth rotation angle (radians)
25381      *     @param elong   double        longitude (radians, east +ve, Note 3)
25382      *     @param phi     double        latitude (geodetic, radians, Note 3)
25383      *     @param hm      double        height above ellipsoid (m, geodetic, Note 3)
25384      *     @param xp double        polar motion coordinates (radians, Note 4)
25385      *     @param yp double        polar motion coordinates (radians, Note 4) 
25386      *     @param sp      double        the TIO locator s' (radians, Note 4)
25387      *     @param refa    double        refraction constant A (radians, Note 5)
25388      *     @param refb    double        refraction constant B (radians, Note 5)
25389      *
25390      *<!-- Returned:-->
25391      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25392      *
25393      *<p>Notes:
25394      * <ol>
25395      *
25396      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25397      *     convenient way between the two arguments.  For example,
25398      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25399      *     others:
25400      *     <pre>
25401      *            date1          date2
25402      *
25403      *         2450123.7           0.0       (JD method)
25404      *         2451545.0       -1421.3       (J2000 method)
25405      *         2400000.5       50123.2       (MJD method)
25406      *         2450123.5           0.2       (date &amp; time method)
25407      *     </pre>
25408      *     <p>The JD method is the most natural and convenient to use in cases
25409      *     where the loss of several decimal digits of resolution is
25410      *     acceptable.  The J2000 method is best matched to the way the
25411      *     argument is handled internally and will deliver the optimum
25412      *     resolution.  The MJD method and the date &amp; time methods are both
25413      *     good compromises between resolution and convenience.  For most
25414      *     applications of this function the choice will not be at all
25415      *     critical.
25416      *
25417      *     <p>TT can be used instead of TDB without any significant impact on
25418      *     accuracy.
25419      *
25420      *  <li> The vectors eb, eh, and all the astrom vectors, are with respect
25421      *     to BCRS axes.
25422      *
25423      *  <li> The geographical coordinates are with respect to the WGS84
25424      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN
25425      *     CONVENTION:  the longitude required by the present function is
25426      *     right-handed, i.e. east-positive, in accordance with geographical
25427      *     convention.
25428      *     
25429      *     The adjusted longitude stored in the astrom array takes into
25430      *     account the TIO locator and polar motion.
25431 
25432      *
25433      *  <li> xp and yp are the coordinates (in radians) of the Celestial
25434      *     Intermediate Pole with respect to the International Terrestrial
25435      *     Reference System (see IERS Conventions), measured along the
25436      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
25437      *     s', in radians, which positions the Terrestrial Intermediate
25438      *     Origin on the equator.  For many applications, xp, yp and
25439      *     (especially) sp can be set to zero.
25440      *
25441      *     <p>Internally, the polar motion is stored in a form rotated onto the
25442      *     local meridian.
25443      *
25444      *  <li> The refraction constants refa and refb are for use in a
25445      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
25446      *     (i.e. refracted) zenith distance and dZ is the amount of
25447      *     refraction.
25448      *
25449      *  <li> It is advisable to take great care with units, as even unlikely
25450      *     values of the input parameters are accepted and processed in
25451      *     accordance with the models used.
25452      *
25453      *  <li> In cases where the caller does not wish to provide the Earth
25454      *     Ephemeris, the Earth rotation information and refraction
25455      *     constants, the function iauApco13 can be used instead of the
25456      *     present function.  This starts from UTC and weather readings etc.
25457      *     and computes suitable values using other SOFA functions.
25458      *
25459      *  <li> This is one of several functions that inserts into the astrom
25460      *     structure star-independent parameters needed for the chain of
25461      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25462      *
25463      *     <p>The various functions support different classes of observer and
25464      *     portions of the transformation chain:
25465      *     <pre>{@code
25466      *          functions         observer        transformation
25467      *
25468      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25469      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25470      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25471      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25472      *       iauAper iauAper13    terrestrial     update Earth rotation
25473      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25474      *     }</pre>
25475      *     <p>Those with names ending in "13" use contemporary SOFA models to
25476      *     compute the various ephemerides.  The others accept ephemerides
25477      *     supplied by the caller.
25478      *
25479      *     <p>The transformation from ICRS to GCRS covers space motion,
25480      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25481      *     comprises frame bias and precession-nutation.  From CIRS to
25482      *     observed takes account of Earth rotation, polar motion, diurnal
25483      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25484      *     transformation), and atmospheric refraction.
25485      *
25486      *  <li> The context structure astrom produced by this function is used by
25487      *     iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25488      *
25489      * </ol>
25490      *  Called:
25491      * <ul>
25492      *     <li>{@link #jauAper} astrometry parameters: update ERA
25493      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25494      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
25495      *     <li>{@link #jauTrxpv} product of transpose of r-matrix and pv-vector
25496      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
25497      *     <li>{@link #jauCr} copy r-matrix
25498      *
25499      * </ul>
25500      *@version  2013 October 9
25501      *
25502      *@since JSOFA release 20131202
25503      *
25504      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25505      * @throws JSOFAInternalError an internal error has occured
25506      * @throws JSOFAIllegalParameter unacceptable date
25507      */
25508     public static void jauApco(double date1, double date2,
25509             double ebpv[][], double ehp[],
25510             double x, double y, double s, double theta,
25511             double elong, double phi, double hm,
25512             double xp, double yp, double sp,
25513             double refa, double refb,
25514             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
25515     {
25516         double a, b, eral, c, r[][] = new double[3][3], pvc[][], pv[][];
25517 
25518 
25519         /* Form the rotation matrix, CIRS to apparent [HA,Dec]. */
25520         jauIr(r);
25521         jauRz(theta+sp, r);
25522         jauRy(-xp, r);
25523         jauRx(-yp, r);
25524         jauRz(elong, r);
25525 
25526         /* Solve for local Earth rotation angle. */
25527         a = r[0][0];
25528         b = r[0][1];
25529         eral = ( a != 0.0 || b != 0.0 ) ?  atan2(b, a) : 0.0;
25530         astrom.eral = eral;
25531 
25532         /* Solve for polar motion [X,Y] with respect to local meridian. */
25533         a = r[0][0];
25534         c = r[0][2];
25535         astrom.xpl = atan2(c, sqrt(a*a+b*b));
25536         a = r[1][2];
25537         b = r[2][2];
25538         astrom.ypl = ( a != 0.0 || b != 0.0 ) ? -atan2(a, b) : 0.0;
25539 
25540         /* Adjusted longitude. */
25541         astrom.along = jauAnpm(eral - theta);
25542 
25543         /* Functions of latitude. */
25544         astrom.sphi = sin(phi);
25545         astrom.cphi = cos(phi);
25546 
25547         /* Refraction constants. */
25548         astrom.refa = refa;
25549         astrom.refb = refb;
25550 
25551         /* Disable the (redundant) diurnal aberration step. */
25552         astrom.diurab = 0.0;
25553 
25554         /* CIO based BPN matrix. */
25555         r = jauC2ixys(x, y, s);
25556 
25557         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
25558         pvc = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
25559 
25560         /* Rotate into GCRS. */
25561         pv = jauTrxpv(r, pvc);
25562 
25563         /* ICRS <-> GCRS parameters. */
25564         jauApcs(date1, date2, pv, ebpv, ehp, astrom);
25565 
25566         /* Store the CIO based BPN matrix. */
25567         jauCr(r, astrom.bpn );
25568 
25569         /* Finished. */
25570 
25571 
25572     }
25573 
25574     /**
25575      *  For a terrestrial observer, prepare star-independent astrometry
25576      *  parameters for transformations between ICRS and observed
25577      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
25578      *  conditions and observing wavelength, and SOFA models are used to
25579      *  obtain the Earth ephemeris, CIP/CIO and refraction constants.
25580      *
25581      *  The parameters produced by this function are required in the
25582      *  parallax, light deflection, aberration, and bias-precession-nutation
25583      *  parts of the ICRS/CIRS transformations.
25584      *
25585      *<p>This function is derived from the International Astronomical Union's
25586      *  SOFA (Standards of Fundamental Astronomy) software collection.
25587      *
25588      *<p>Status:  support function.
25589      *
25590      *<!-- Given: -->
25591      *     @param utc1    double      UTC as a 2-part...
25592      *     @param utc2    double      ...quasi Julian Date (Notes 1,2)
25593      *     @param dut1    double      UT1-UTC (seconds, Note 3)
25594      *     @param elong   double      longitude (radians, east +ve, Note 4)
25595      *     @param phi     double      latitude (geodetic, radians, Note 4)
25596      *     @param hm      double      height above ellipsoid (m, geodetic, Notes 4,6)
25597      *     @param xp double      polar motion coordinates (radians, Note 5)
25598      *     @param yp double      polar motion coordinates (radians, Note 5) 
25599      *     @param phpa    double      pressure at the observer (hPa = mB, Note 6)
25600      *     @param tc      double      ambient temperature at the observer (deg C)
25601      *     @param rh      double      relative humidity at the observer (range 0-1)
25602      *     @param wl      double      wavelength (micrometers, Note 7)
25603      *
25604      *<!-- Returned:-->
25605      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
25606      *         
25607      *     
25608      *     @return       double      <b>Returned</b> equation of the origins (ERA-GST)
25609      *
25610      *  @throws JSOFAInternalError an internal error has occured
25611      *  @throws JSOFAIllegalParameter int         status:   <b>Returned</b> +1 = dubious year (Note 2)
25612      *                                 0  =   <b>Returned</b> OK
25613      *                                -1  =   <b>Returned</b> unacceptable date
25614      *
25615      *<p>Notes:
25616      * <ol>
25617      *
25618      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
25619      *      convenient way between the two arguments, for example where utc1
25620      *      is the Julian Day Number and utc2 is the fraction of a day.
25621      *
25622      *      <p>However, JD cannot unambiguously represent UTC during a leap
25623      *      second unless special measures are taken.  The convention in the
25624      *      present function is that the JD day represents UTC days whether
25625      *      the length is 86399, 86400 or 86401 SI seconds.
25626      *
25627      *      <p>Applications should use the function iauDtf2d to convert from
25628      *      calendar date and time of day into 2-part quasi Julian Date, as
25629      *      it implements the leap-second-ambiguity convention just
25630      *      described.
25631      *
25632      *  <li> The warning status "dubious year" flags UTCs that predate the
25633      *      introduction of the time scale or that are too far in the
25634      *      future to be trusted.  See iauDat for further details.
25635      *
25636      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
25637      *      one second at the end of each positive UTC leap second,
25638      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
25639      *      practice is under review, and in the future UT1-UTC may grow
25640      *      essentially without limit.
25641      *
25642      *  <li> The geographical coordinates are with respect to the WGS84
25643      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
25644      *      longitude required by the present function is east-positive
25645      *      (i.e. right-handed), in accordance with geographical convention.
25646      *
25647      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
25648      *      values are the coordinates (in radians) of the Celestial
25649      *      Intermediate Pole with respect to the International Terrestrial
25650      *      Reference System (see IERS Conventions 2003), measured along the
25651      *      meridians 0 and 90 deg west respectively.  For many
25652      *      applications, xp and yp can be set to zero.
25653      *
25654      *      <p>Internally, the polar motion is stored in a form rotated onto
25655      *      the local meridian.
25656      *
25657      *  <li> If hm, the height above the ellipsoid of the observing station
25658      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
25659      *      available, an adequate estimate of hm can be obtained from the
25660      *      expression
25661      *
25662      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
25663      *
25664      *      <p>where tsl is the approximate sea-level air temperature in K
25665      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
25666      *      52).  Similarly, if the pressure phpa is not known, it can be
25667      *      estimated from the height of the observing station, hm, as
25668      *      follows:
25669      *
25670      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
25671      *
25672      *      <p>Note, however, that the refraction is nearly proportional to
25673      *      the pressure and that an accurate phpa value is important for
25674      *      precise work.
25675      *
25676      *  <li> The argument wl specifies the observing wavelength in
25677      *      micrometers.  The transition from optical to radio is assumed to
25678      *      occur at 100 micrometers (about 3000 GHz).
25679      *
25680      *  <li> It is advisable to take great care with units, as even unlikely
25681      *      values of the input parameters are accepted and processed in
25682      *      accordance with the models used.
25683      *
25684      *  <li> In cases where the caller wishes to supply his own Earth
25685      *      ephemeris, Earth rotation information and refraction constants,
25686      *      the function iauApco can be used instead of the present function.
25687      *
25688      *  <li> This is one of several functions that inserts into the astrom
25689      *      structure star-independent parameters needed for the chain of
25690      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25691      *
25692      *      <p>The various functions support different classes of observer and
25693      *      portions of the transformation chain:
25694      *      <pre>{@code
25695      *          functions         observer        transformation
25696      *
25697      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25698      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25699      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25700      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25701      *       iauAper iauAper13    terrestrial     update Earth rotation
25702      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25703      *      }</pre>
25704      *      <p>Those with names ending in "13" use contemporary SOFA models to
25705      *      compute the various ephemerides.  The others accept ephemerides
25706      *      supplied by the caller.
25707      *
25708      *      <p>The transformation from ICRS to GCRS covers space motion,
25709      *      parallax, light deflection, and aberration.  From GCRS to CIRS
25710      *      comprises frame bias and precession-nutation.  From CIRS to
25711      *      observed takes account of Earth rotation, polar motion, diurnal
25712      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25713      *      transformation), and atmospheric refraction.
25714      *
25715      *  <li> The context structure astrom produced by this function is used
25716      *      by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25717      *
25718      * </ol>
25719      *  Called:
25720      * <ul>
25721      *     <li>{@link #jauUtctai} UTC to TAI
25722      *     <li>{@link #jauTaitt} TAI to TT
25723      *     <li>{@link #jauUtcut1} UTC to UT1
25724      *     <li>{@link #jauEpv00} Earth position and velocity
25725      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25726      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25727      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25728      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
25729      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
25730      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
25731      *     <li>{@link #jauApco} astrometry parameters, ICRS-observed
25732      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25733      *
25734      * </ul>
25735      *@version  2013 December 5
25736      *
25737      *@since JSOFA release 20131202
25738      *
25739      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25740      * @throws JSOFAInternalError an internal error has occured
25741      * @throws JSOFAIllegalParameter unacceptable date.
25742      */
25743     public static double jauApco13(double utc1, double utc2, double dut1,
25744             double elong, double phi, double hm, double xp, double yp,
25745             double phpa, double tc, double rh, double wl,
25746             Astrom astrom ) throws JSOFAIllegalParameter, JSOFAInternalError
25747     {
25748         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3],
25749         r[][], s, theta, sp;
25750         double eo;
25751 
25752 
25753         /* UTC to other time scales. */
25754         JulianDate tai = jauUtctai(utc1, utc2);
25755         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
25756         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
25757 
25758         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25759         jauEpv00(tt.djm0, tt.djm1, ehpv, ebpv);
25760 
25761         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25762         r = jauPnm06a(tt.djm0, tt.djm1);
25763 
25764         /* Extract CIP X,Y. */
25765         CelestialIntermediatePole cip = jauBpn2xy(r);
25766 
25767         /* Obtain CIO locator s. */
25768         s = jauS06(tt.djm0, tt.djm1, cip.x, cip.y);
25769 
25770         /* Earth rotation angle. */
25771         theta = jauEra00(ut1.djm0, ut1.djm1);
25772 
25773         /* TIO locator s'. */
25774         sp = jauSp00(tt.djm0, tt.djm1);
25775 
25776         /* Refraction constants A and B. */
25777         RefCos ref = jauRefco(phpa, tc, rh, wl);
25778 
25779         /* Compute the star-independent astrometry parameters. */
25780         jauApco(tt.djm0, tt.djm1, ebpv, ehpv[0], cip.x, cip.y, s, theta,
25781                 elong, phi, hm, xp, yp, sp, ref.a, ref.b, astrom);
25782 
25783         /* Equation of the origins. */
25784         eo = jauEors(r, s);
25785 
25786         return eo;
25787 
25788         /* Finished. */
25789 
25790 
25791     }
25792 
25793     /**
25794      *  For an observer whose geocentric position and velocity are known,
25795      *  prepare star-independent astrometry parameters for transformations
25796      *  between ICRS and GCRS.  The Earth ephemeris is supplied by the
25797      *  caller.
25798      *
25799      *  The parameters produced by this function are required in the space
25800      *  motion, parallax, light deflection and aberration parts of the
25801      *  astrometric transformation chain.
25802      *
25803      *<p>This function is derived from the International Astronomical Union's
25804      *  SOFA (Standards of Fundamental Astronomy) software collection.
25805      *
25806      *<p>Status:  support function.
25807      *
25808      *<!-- Given: -->
25809      *     @param date1   double        TDB as a 2-part...
25810      *     @param date2   double        ...Julian Date (Note 1)
25811      *     @param pv      double[2][3]  observer's geocentric pos/vel (m, m/s)
25812      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day)
25813      *     @param ehp     double[3]     Earth heliocentric P (au)
25814      *
25815      *<!-- Returned:-->
25816      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25817 
25818      *<p>Notes:
25819      * <ol>
25820      *
25821      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25822      *     convenient way between the two arguments.  For example,
25823      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25824      *     others:
25825      *     <pre>
25826      *         date1          date2
25827      *
25828      *         2450123.7           0.0       (JD method)
25829      *         2451545.0       -1421.3       (J2000 method)
25830      *         2400000.5       50123.2       (MJD method)
25831      *         2450123.5           0.2       (date &amp; time method)
25832      *     </pre>
25833      *     <p>The JD method is the most natural and convenient to use in cases
25834      *     where the loss of several decimal digits of resolution is
25835      *     acceptable.  The J2000 method is best matched to the way the
25836      *     argument is handled internally and will deliver the optimum
25837      *     resolution.  The MJD method and the date &amp; time methods are both
25838      *     good compromises between resolution and convenience.  For most
25839      *     applications of this function the choice will not be at all
25840      *     critical.
25841      *
25842      *     <p>TT can be used instead of TDB without any significant impact on
25843      *     accuracy.
25844      *
25845      *  <li> All the vectors are with respect to BCRS axes.
25846      *
25847      *  <li> Providing separate arguments for (i) the observer's geocentric
25848      *     position and velocity and (ii) the Earth ephemeris is done for
25849      *     convenience in the geocentric, terrestrial and Earth orbit cases.
25850      *     For deep space applications it maybe more convenient to specify
25851      *     zero geocentric position and velocity and to supply the
25852      *     observer's position and velocity information directly instead of
25853      *     with respect to the Earth.  However, note the different units:
25854      *     m and m/s for the geocentric vectors, au and au/day for the
25855      *     heliocentric and barycentric vectors.
25856      *
25857      *  <li> In cases where the caller does not wish to provide the Earth
25858      *     ephemeris, the function iauApcs13 can be used instead of the
25859      *     present function.  This computes the Earth ephemeris using the
25860      *     SOFA function iauEpv00.
25861      *
25862      *  <li> This is one of several functions that inserts into the astrom
25863      *     structure star-independent parameters needed for the chain of
25864      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25865      *
25866      *     <p>The various functions support different classes of observer and
25867      *     portions of the transformation chain:
25868      *
25869      *     <pre>{@code
25870      *          functions         observer        transformation
25871      *
25872      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25873      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25874      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25875      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25876      *       iauAper iauAper13    terrestrial     update Earth rotation
25877      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25878      *     }</pre>
25879      *     <p>Those with names ending in "13" use contemporary SOFA models to
25880      *     compute the various ephemerides.  The others accept ephemerides
25881      *     supplied by the caller.
25882      *
25883      *     <p>The transformation from ICRS to GCRS covers space motion,
25884      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25885      *     comprises frame bias and precession-nutation.  From CIRS to
25886      *     observed takes account of Earth rotation, polar motion, diurnal
25887      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25888      *     transformation), and atmospheric refraction.
25889      *
25890      *  <li> The context structure astrom produced by this function is used by
25891      *     iauAtciq* and iauAticq*.
25892      *
25893      * </ol>
25894      *  Called:
25895      * <ul>
25896      *     <li>{@link #jauCp} copy p-vector
25897      *     <li>{@link #jauPm} modulus of p-vector
25898      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
25899      *     <li>{@link #jauIr} initialize r-matrix to identity
25900      *
25901      * </ul>
25902      *@version  2013 October 9
25903      *
25904      *@since JSOFA release 20131202
25905      *
25906      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25907      */
25908     public static void jauApcs(double date1, double date2, double pv[][],
25909             double ebpv[][], double ehp[],
25910             Astrom astrom)
25911     {
25912         /* au/d to m/s */
25913         final double AUDMS = DAU/DAYSEC;
25914 
25915         /* Light time for 1 au (day) */
25916         final double CR = AULT/DAYSEC;
25917 
25918         int i;
25919         double dp, dv, pb[] = new double[3], vb[] = new double[3], ph[] = new double[3], v2, w;
25920 
25921 
25922         /* Time since reference epoch, years (for proper motion calculation). */
25923         astrom.pmt = ( (date1 - DJ00) + date2 ) / DJY;
25924 
25925         /* Adjust Earth ephemeris to observer. */
25926         for (i = 0; i < 3; i++) {
25927             dp = pv[0][i] / DAU;
25928             dv = pv[1][i] / AUDMS;
25929             pb[i] = ebpv[0][i] + dp;
25930             vb[i] = ebpv[1][i] + dv;
25931             ph[i] = ehp[i] + dp;
25932         }
25933 
25934         /* Barycentric position of observer (au). */
25935         jauCp(pb, astrom.eb);
25936 
25937         /* Heliocentric direction and distance (unit vector and au). */
25938         NormalizedVector nv = jauPn(ph);
25939         
25940         astrom.em = nv.r;
25941         astrom.eh = nv.u;
25942 
25943         /* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
25944         v2 = 0.0;
25945         for (i = 0; i < 3; i++) {
25946             w = vb[i] * CR;
25947             astrom.v[i] = w;
25948             v2 += w*w;
25949         }
25950         astrom.bm1 = sqrt(1.0 - v2);
25951 
25952         /* Reset the NPB matrix. */
25953         jauIr(astrom.bpn);
25954 
25955         /* Finished. */
25956 
25957 
25958     }
25959 
25960     /**
25961      *  For an observer whose geocentric position and velocity are known,
25962      *  prepare star-independent astrometry parameters for transformations
25963      *  between ICRS and GCRS.  The Earth ephemeris is from SOFA models.
25964      *
25965      *  The parameters produced by this function are required in the space
25966      *  motion, parallax, light deflection and aberration parts of the
25967      *  astrometric transformation chain.
25968      *
25969      *<p>This function is derived from the International Astronomical Union's
25970      *  SOFA (Standards of Fundamental Astronomy) software collection.
25971      *
25972      *<p>Status:  support function.
25973      *
25974      *<!-- Given: -->
25975      *     @param date1   double        TDB as a 2-part...
25976      *     @param date2   double        ...Julian Date (Note 1)
25977      *     @param pv      double[2][3]  observer's geocentric pos/vel (Note 3)
25978      *
25979      *<!-- Returned:-->
25980      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25981      *
25982      *<p>Notes:
25983      * <ol>
25984      *
25985      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25986      *     convenient way between the two arguments.  For example,
25987      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25988      *     others:
25989      *     <pre>
25990      *           date1          date2
25991      *
25992      *         2450123.7           0.0       (JD method)
25993      *         2451545.0       -1421.3       (J2000 method)
25994      *         2400000.5       50123.2       (MJD method)
25995      *         2450123.5           0.2       (date &amp; time method)
25996      *     </pre>
25997      *     <p>The JD method is the most natural and convenient to use in cases
25998      *     where the loss of several decimal digits of resolution is
25999      *     acceptable.  The J2000 method is best matched to the way the
26000      *     argument is handled internally and will deliver the optimum
26001      *     resolution.  The MJD method and the date &amp; time methods are both
26002      *     good compromises between resolution and convenience.  For most
26003      *     applications of this function the choice will not be at all
26004      *     critical.
26005      *
26006      *     <p>TT can be used instead of TDB without any significant impact on
26007      *     accuracy.
26008      *
26009      *  <li> All the vectors are with respect to BCRS axes.
26010      *
26011      *  <li> The observer's position and velocity pv are geocentric but with
26012      *     respect to BCRS axes, and in units of m and m/s.  No assumptions
26013      *     are made about proximity to the Earth, and the function can be
26014      *     used for deep space applications as well as Earth orbit and
26015      *     terrestrial.
26016      *
26017      *  <li> In cases where the caller wishes to supply his own Earth
26018      *     ephemeris, the function iauApcs can be used instead of the present
26019      *     function.
26020      *
26021      *  <li> This is one of several functions that inserts into the astrom
26022      *     structure star-independent parameters needed for the chain of
26023      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26024      *
26025      *     <p>The various functions support different classes of observer and
26026      *     portions of the transformation chain:
26027      *     <pre>{@code
26028      *          functions         observer        transformation
26029      *
26030      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26031      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26032      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26033      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26034      *       iauAper iauAper13    terrestrial     update Earth rotation
26035      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26036      *     }</pre>
26037      *     <p>Those with names ending in "13" use contemporary SOFA models to
26038      *     compute the various ephemerides.  The others accept ephemerides
26039      *     supplied by the caller.
26040      *
26041      *     <p>The transformation from ICRS to GCRS covers space motion,
26042      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26043      *     comprises frame bias and precession-nutation.  From CIRS to
26044      *     observed takes account of Earth rotation, polar motion, diurnal
26045      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26046      *     transformation), and atmospheric refraction.
26047      *
26048      *  <li> The context structure astrom produced by this function is used by
26049      *     iauAtciq* and iauAticq*.
26050      *
26051      * </ol>
26052      *  Called:
26053      * <ul>
26054      *     <li>{@link #jauEpv00} Earth position and velocity
26055      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
26056      *
26057      * </ul>
26058      *@version  2013 October 9
26059      *
26060      *@since JSOFA release 20131202
26061      *
26062      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26063      */
26064     public static void jauApcs13(double date1, double date2, double pv[][],
26065             Astrom astrom)
26066     {
26067         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
26068 
26069 
26070         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
26071         jauEpv00(date1, date2, ehpv, ebpv);
26072 
26073         /* Compute the star-independent astrometry parameters. */
26074         jauApcs(date1, date2, pv, ebpv, ehpv[0], astrom);
26075 
26076         /* Finished. */
26077 
26078 
26079     }
26080 
26081     /**
26082      *  In the star-independent astrometry parameters, update only the
26083      *  Earth rotation angle, supplied by the caller explicitly.
26084      *
26085      *<p>This function is derived from the International Astronomical Union's
26086      *  SOFA (Standards of Fundamental Astronomy) software collection.
26087      *
26088      *<p>Status:  support function.
26089      *
26090      *<!-- Given: -->
26091      *     @param theta    double       Earth rotation angle (radians, Note 2)
26092      *     @param astrom  Astrom    star-independent astrometry parameters:{@code
26093      *          pmt     double        not used
26094      *          eb      double[3]     not used
26095      *          eh      double[3]     not used
26096      *          em      double        not used
26097      *          v       double[3]     not used
26098      *          bm1     double        not used
26099      *          bpn     double[3][3]  not used
26100      *          along   double        longitude + s' (radians)
26101      *          xpl     double        not used
26102      *          ypl     double        not used
26103      *          sphi    double        not used
26104      *          cphi    double        not used
26105      *          diurab  double        not used
26106      *          eral    double        not used
26107      *          refa    double        not used
26108      *          refb    double        not used}
26109      *
26110      *<!-- Returned:-->
26111      *     astrom       <b>Returned</b> star-independent astrometry parameters:
26112     *
26113      *<p>Notes:
26114      * <ol>
26115      *
26116      *  <li> This function exists to enable sidereal-tracking applications to
26117      *     avoid wasteful recomputation of the bulk of the astrometry
26118      *     parameters:  only the Earth rotation is updated.
26119      *
26120      *  <li> For targets expressed as equinox based positions, such as
26121      *     classical geocentric apparent (RA,Dec), the supplied theta can be
26122      *     Greenwich apparent sidereal time rather than Earth rotation
26123      *     angle.
26124      *
26125      *  <li> The function iauAper13 can be used instead of the present
26126      *     function, and starts from UT1 rather than ERA itself.
26127      *
26128      *  <li> This is one of several functions that inserts into the astrom
26129      *     structure star-independent parameters needed for the chain of
26130      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26131      *
26132      *     <p>The various functions support different classes of observer and
26133      *     portions of the transformation chain:
26134      *     <pre>{@code
26135      *          functions         observer        transformation
26136      *
26137      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26138      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26139      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26140      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26141      *       iauAper iauAper13    terrestrial     update Earth rotation
26142      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26143      *     }</pre>
26144      *     <p>Those with names ending in "13" use contemporary SOFA models to
26145      *     compute the various ephemerides.  The others accept ephemerides
26146      *     supplied by the caller.
26147      *
26148      *     <p>The transformation from ICRS to GCRS covers space motion,
26149      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26150      *     comprises frame bias and precession-nutation.  From CIRS to
26151      *     observed takes account of Earth rotation, polar motion, diurnal
26152      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26153      *     transformation), and atmospheric refraction.
26154      *
26155      * </ol>
26156      *@version  2013 September 25
26157      *
26158      *@since JSOFA release 20131202
26159      *
26160      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26161      */
26162     public static void jauAper(double theta, Astrom astrom)
26163     {
26164         astrom.eral = theta + astrom.along;
26165 
26166         /* Finished. */
26167 
26168 
26169     }
26170 
26171     /**
26172      *  In the star-independent astrometry parameters, update only the
26173      *  Earth rotation angle.  The caller provides UT1, (n.b. not UTC).
26174      *
26175      *<p>This function is derived from the International Astronomical Union's
26176      *  SOFA (Standards of Fundamental Astronomy) software collection.
26177      *
26178      *<p>Status:  support function.
26179      *
26180      *<!-- Given: -->
26181      *     @param ut11     double       UT1 as a 2-part...
26182      *     @param ut12     double       ...Julian Date (Note 1)
26183      *     @param astrom      star-independent astrometry parameters:
26184      *                    pmt     double        not used
26185      *                    eb      double[3]     not used
26186      *                    eh      double[3]     not used
26187      *                    em      double        not used
26188      *                    v       double[3]     not used
26189      *                    bm1     double        not used
26190      *                    bpn     double[3][3]  not used
26191      *                    along   double        longitude + s' (radians)
26192      *                    xpl     double        not used
26193      *                    ypl     double        not used
26194      *                    sphi    double        not used
26195      *                    cphi    double        not used
26196      *                    diurab  double        not used
26197      *                    eral    double        not used
26198      *                    refa    double        not used
26199      *                    refb    double        not used
26200      *
26201      *<!-- Returned:-->
26202      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
26203      *
26204      *<p>Notes:
26205      * <ol>
26206      *
26207      *  <li> The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
26208      *     apportioned in any convenient way between the arguments ut11 and
26209      *     ut12.  For example, JD(UT1)=2450123.7 could be expressed in any
26210      *     of these ways, among others:
26211      *
26212      *            <p>ut11           ut12
26213      *
26214      *         2450123.7           0.0       (JD method)
26215      *         2451545.0       -1421.3       (J2000 method)
26216      *         2400000.5       50123.2       (MJD method)
26217      *         2450123.5           0.2       (date &amp; time method)
26218      *
26219      *     <p>The JD method is the most natural and convenient to use in cases
26220      *     where the loss of several decimal digits of resolution is
26221      *     acceptable.  The J2000 and MJD methods are good compromises
26222      *     between resolution and convenience.  The date &amp; time method is
26223      *     best matched to the algorithm used:  maximum precision is
26224      *     delivered when the ut11 argument is for 0hrs UT1 on the day in
26225      *     question and the ut12 argument lies in the range 0 to 1, or vice
26226      *     versa.
26227      *
26228      *  <li> If the caller wishes to provide the Earth rotation angle itself,
26229      *     the function iauAper can be used instead.  One use of this
26230      *     technique is to substitute Greenwich apparent sidereal time and
26231      *     thereby to support equinox based transformations directly.
26232      *
26233      *  <li> This is one of several functions that inserts into the astrom
26234      *     structure star-independent parameters needed for the chain of
26235      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26236      *
26237      *     <p>The various functions support different classes of observer and
26238      *     portions of the transformation chain:
26239      *     <pre>{@code
26240      *          functions         observer        transformation
26241      *
26242      *       <p>iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26243      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26244      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26245      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26246      *       iauAper iauAper13    terrestrial     update Earth rotation
26247      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26248      *     }</pre>
26249      *     <p>Those with names ending in "13" use contemporary SOFA models to
26250      *     compute the various ephemerides.  The others accept ephemerides
26251      *     supplied by the caller.
26252      *
26253      *     <p>The transformation from ICRS to GCRS covers space motion,
26254      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26255      *     comprises frame bias and precession-nutation.  From CIRS to
26256      *     observed takes account of Earth rotation, polar motion, diurnal
26257      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26258      *     transformation), and atmospheric refraction.
26259      *
26260      * </ol>
26261      *  Called:
26262      * <ul>
26263      *     <li>{@link #jauAper} astrometry parameters: update ERA
26264      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26265      *
26266      * </ul>
26267      *@version  2013 September 25
26268      *
26269      *@since JSOFA release 20131202
26270      *
26271      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26272      */
26273     public static void jauAper13(double ut11, double ut12, Astrom astrom)
26274     {
26275         jauAper(jauEra00(ut11,ut12), astrom);
26276 
26277         /* Finished. */
26278 
26279 
26280     }
26281 
26282     /**
26283      *  For a terrestrial observer, prepare star-independent astrometry
26284      *  parameters for transformations between CIRS and observed
26285      *  coordinates.  The caller supplies the Earth orientation information
26286      *  and the refraction constants as well as the site coordinates.
26287      *
26288      *<p>This function is derived from the International Astronomical Union's
26289      *  SOFA (Standards of Fundamental Astronomy) software collection.
26290      *
26291      *<p>Status:  support function.
26292      *
26293      *<!-- Given: -->
26294      *     @param sp      double       the TIO locator s' (radians, Note 1)
26295      *     @param theta   double       Earth rotation angle (radians)
26296      *     @param elong   double       longitude (radians, east +ve, Note 2)
26297      *     @param phi     double       geodetic latitude (radians, Note 2)
26298      *     @param hm      double       height above ellipsoid (m, geodetic Note 2)
26299      *     @param xp double       polar motion coordinates (radians, Note 3)
26300      *     @param yp double       polar motion coordinates (radians, Note 3) 
26301      *     @param refa    double       refraction constant A (radians, Note 4)
26302      *     @param refb    double       refraction constant B (radians, Note 4)
26303      *
26304      *<!-- Returned:-->
26305      *     @param astrom  {@link Astrom}    <b>Returned</b> star-independent astrometry parameters:
26306      *     
26307      *<p>Notes:
26308      * <ol>
26309      *
26310      *  <li> sp, the TIO locator s', is a tiny quantity needed only by the
26311      *     most precise applications.  It can either be set to zero or
26312      *     predicted using the SOFA function iauSp00.
26313      *
26314      *  <li> The geographical coordinates are with respect to the WGS84
26315      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26316      *     longitude required by the present function is east-positive
26317      *     (i.e. right-handed), in accordance with geographical convention.
26318      *
26319      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26320      *     values are the coordinates (in radians) of the Celestial
26321      *     Intermediate Pole with respect to the International Terrestrial
26322      *     Reference System (see IERS Conventions 2003), measured along the
26323      *     meridians 0 and 90 deg west respectively.  For many applications,
26324      *     xp and yp can be set to zero.
26325      *
26326      *     <p>Internally, the polar motion is stored in a form rotated onto the
26327      *     local meridian.
26328      *
26329      *  <li> The refraction constants refa and refb are for use in a
26330      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
26331      *     (i.e. refracted) zenith distance and dZ is the amount of
26332      *     refraction.
26333      *
26334      *  <li> It is advisable to take great care with units, as even unlikely
26335      *     values of the input parameters are accepted and processed in
26336      *     accordance with the models used.
26337      *
26338      *  <li> In cases where the caller does not wish to provide the Earth
26339      *     rotation information and refraction constants, the function
26340      *     iauApio13 can be used instead of the present function.  This
26341      *     starts from UTC and weather readings etc. and computes suitable
26342      *     values using other SOFA functions.
26343      *
26344      *  <li> This is one of several functions that inserts into the astrom
26345      *     structure star-independent parameters needed for the chain of
26346      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26347      *
26348      *     <p>The various functions support different classes of observer and
26349      *     portions of the transformation chain:
26350      *<pre>{@code
26351      *          functions         observer        transformation
26352      *
26353      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26354      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26355      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26356      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26357      *       iauAper iauAper13    terrestrial     update Earth rotation
26358      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26359      *}</pre>
26360      *     <p>Those with names ending in "13" use contemporary SOFA models to
26361      *     compute the various ephemerides.  The others accept ephemerides
26362      *     supplied by the caller.
26363      *
26364      *     <p>The transformation from ICRS to GCRS covers space motion,
26365      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26366      *     comprises frame bias and precession-nutation.  From CIRS to
26367      *     observed takes account of Earth rotation, polar motion, diurnal
26368      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26369      *     transformation), and atmospheric refraction.
26370      *
26371      *  <li> The context structure astrom produced by this function is used by
26372      *     iauAtioq and iauAtoiq.
26373      *
26374      * </ol>
26375      *  Called:
26376      * <ul>
26377      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
26378      *     <li>{@link #jauAper} astrometry parameters: update ERA
26379      *
26380      * </ul>
26381      *@version  2013 October 9
26382      *
26383      *@since JSOFA release 20131202
26384      *
26385      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26386      * @throws JSOFAInternalError an internal error has occured
26387      * @throws JSOFAIllegalParameter unacceptable date.
26388      */
26389     public static void jauApio(double sp, double theta,
26390             double elong, double phi, double hm, double xp, double yp,
26391             double refa, double refb,
26392             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26393     {
26394         double r[][]=new double[3][3], a, b, eral, c, pv[][];
26395 
26396 
26397         /* Form the rotation matrix, CIRS to apparent [HA,Dec]. */
26398         jauIr(r);
26399         jauRz(theta+sp, r);
26400         jauRy(-xp, r);
26401         jauRx(-yp, r);
26402         jauRz(elong, r);
26403 
26404         /* Solve for local Earth rotation angle. */
26405         a = r[0][0];
26406         b = r[0][1];
26407         eral = ( a != 0.0 || b != 0.0 ) ?  atan2(b, a) : 0.0;
26408         astrom.eral = eral;
26409 
26410         /* Solve for polar motion [X,Y] with respect to local meridian. */
26411         a = r[0][0];
26412         c = r[0][2];
26413         astrom.xpl = atan2(c, sqrt(a*a+b*b));
26414         a = r[1][2];
26415         b = r[2][2];
26416         astrom.ypl = ( a != 0.0 || b != 0.0 ) ? -atan2(a, b) : 0.0;
26417 
26418         /* Adjusted longitude. */
26419         astrom.along = jauAnpm(eral - theta);
26420 
26421         /* Functions of latitude. */
26422         astrom.sphi = sin(phi);
26423         astrom.cphi = cos(phi);
26424 
26425         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
26426         pv = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
26427 
26428         /* Magnitude of diurnal aberration vector. */
26429         astrom.diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
26430 
26431         /* Refraction constants. */
26432         astrom.refa = refa;
26433         astrom.refb = refb;
26434 
26435         /* Finished. */
26436 
26437 
26438     }
26439 
26440     /**
26441      *  For a terrestrial observer, prepare star-independent astrometry
26442      *  parameters for transformations between CIRS and observed
26443      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
26444      *  conditions and observing wavelength.
26445      *
26446      *<p>This function is derived from the International Astronomical Union's
26447      *  SOFA (Standards of Fundamental Astronomy) software collection.
26448      *
26449      *<p>Status:  support function.
26450      *
26451      *<!-- Given: -->
26452      *     @param utc1    double       UTC as a 2-part...
26453      *     @param utc2    double       ...quasi Julian Date (Notes 1,2)
26454      *     @param dut1    double       UT1-UTC (seconds)
26455      *     @param elong   double       longitude (radians, east +ve, Note 3)
26456      *     @param phi     double       geodetic latitude (radians, Note 3)
26457      *     @param hm      double       height above ellipsoid (m, geodetic Notes 4,6)
26458      *     @param xp double       polar motion coordinates (radians, Note 5)
26459      *     @param yp double       polar motion coordinates (radians, Note 5) 
26460      *     @param phpa    double       pressure at the observer (hPa = mB, Note 6)
26461      *     @param tc      double       ambient temperature at the observer (deg C)
26462      *     @param rh      double       relative humidity at the observer (range 0-1)
26463      *     @param wl      double       wavelength (micrometers, Note 7)
26464      *
26465      *<!-- Returned:-->
26466      *     @param astrom      <b>Returned</b> star-independent astrometry parameters:
26467      *     @throws JSOFAInternalError an internal error has occured
26468      *     @throws JSOFAIllegalParameter int          status:   <b>Returned</b> +1 = dubious year (Note 2)
26469      *                                  0  =   <b>Returned</b> OK
26470      *                                 -1  =   <b>Returned</b> unacceptable date
26471      *
26472      *<p>Notes:
26473      * <ol>
26474      *
26475      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
26476      *      convenient way between the two arguments, for example where utc1
26477      *      is the Julian Day Number and utc2 is the fraction of a day.
26478      *
26479      *      <p>However, JD cannot unambiguously represent UTC during a leap
26480      *      second unless special measures are taken.  The convention in the
26481      *      present function is that the JD day represents UTC days whether
26482      *      the length is 86399, 86400 or 86401 SI seconds.
26483      *
26484      *      <p>Applications should use the function iauDtf2d to convert from
26485      *      calendar date and time of day into 2-part quasi Julian Date, as
26486      *      it implements the leap-second-ambiguity convention just
26487      *      described.
26488      *
26489      *  <li> The warning status "dubious year" flags UTCs that predate the
26490      *      introduction of the time scale or that are too far in the future
26491      *      to be trusted.  See iauDat for further details.
26492      *
26493      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
26494      *      one second at the end of each positive UTC leap second,
26495      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
26496      *      practice is under review, and in the future UT1-UTC may grow
26497      *      essentially without limit.
26498      *
26499      *  <li> The geographical coordinates are with respect to the WGS84
26500      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26501      *      longitude required by the present function is east-positive
26502      *      (i.e. right-handed), in accordance with geographical convention.
26503      *
26504      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26505      *      values are the coordinates (in radians) of the Celestial
26506      *      Intermediate Pole with respect to the International Terrestrial
26507      *      Reference System (see IERS Conventions 2003), measured along the
26508      *      meridians 0 and 90 deg west respectively.  For many applications,
26509      *      xp and yp can be set to zero.
26510      *
26511      *      <p>Internally, the polar motion is stored in a form rotated onto
26512      *      the local meridian.
26513      *
26514      *  <li> If hm, the height above the ellipsoid of the observing station
26515      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
26516      *      available, an adequate estimate of hm can be obtained from the
26517      *      expression
26518      *
26519      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
26520      *
26521      *      <p>where tsl is the approximate sea-level air temperature in K
26522      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
26523      *      52).  Similarly, if the pressure phpa is not known, it can be
26524      *      estimated from the height of the observing station, hm, as
26525      *      follows:
26526      *
26527      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
26528      *
26529      *      <p>Note, however, that the refraction is nearly proportional to the
26530      *      pressure and that an accurate phpa value is important for
26531      *      precise work.
26532      *
26533      *  <li> The argument wl specifies the observing wavelength in
26534      *      micrometers.  The transition from optical to radio is assumed to
26535      *      occur at 100 micrometers (about 3000 GHz).
26536      *
26537      *  <li> It is advisable to take great care with units, as even unlikely
26538      *      values of the input parameters are accepted and processed in
26539      *      accordance with the models used.
26540      *
26541      *  <li> In cases where the caller wishes to supply his own Earth
26542      *      rotation information and refraction constants, the function
26543      *      iauApc can be used instead of the present function.
26544      *
26545      *  <li> This is one of several functions that inserts into the astrom
26546      *      structure star-independent parameters needed for the chain of
26547      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26548      *
26549      *      <p>The various functions support different classes of observer and
26550      *      portions of the transformation chain:
26551      *      <pre>{@code
26552      *          functions         observer        transformation
26553      *
26554      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26555      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26556      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26557      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26558      *       iauAper iauAper13    terrestrial     update Earth rotation
26559      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26560      *      }</pre>
26561      *      <p>Those with names ending in "13" use contemporary SOFA models to
26562      *      compute the various ephemerides.  The others accept ephemerides
26563      *      supplied by the caller.
26564      *
26565      *      <p>The transformation from ICRS to GCRS covers space motion,
26566      *      parallax, light deflection, and aberration.  From GCRS to CIRS
26567      *      comprises frame bias and precession-nutation.  From CIRS to
26568      *      observed takes account of Earth rotation, polar motion, diurnal
26569      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26570      *      transformation), and atmospheric refraction.
26571      *
26572      *  <li> The context structure astrom produced by this function is used
26573      *      by iauAtioq and iauAtoiq.
26574      *
26575      * </ol>
26576      *  Called:
26577      * <ul>
26578      *     <li>{@link #jauUtctai} UTC to TAI
26579      *     <li>{@link #jauTaitt} TAI to TT
26580      *     <li>{@link #jauUtcut1} UTC to UT1
26581      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
26582      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26583      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
26584      *     <li>{@link #jauApio} astrometry parameters, CIRS-observed
26585      *
26586      * </ul>
26587      *@version  2013 October 9
26588      *
26589      *@since JSOFA release 20131202
26590      *
26591      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26592      * @throws JSOFAInternalError an internal error has occured
26593      * @throws JSOFAIllegalParameter unacceptable date.
26594      */
26595     public static void jauApio13(double utc1, double utc2, double dut1,
26596             double elong, double phi, double hm, double xp, double yp,
26597             double phpa, double tc, double rh, double wl,
26598             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26599     {
26600         double sp, theta;
26601 
26602 
26603         /* UTC to other time scales. */
26604         JulianDate tai = jauUtctai(utc1, utc2);
26605         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
26606         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
26607 
26608         /* TIO locator s'. */
26609         sp = jauSp00(tt.djm0, tt.djm1);
26610 
26611         /* Earth rotation angle. */
26612         theta = jauEra00(ut1.djm0, ut1.djm1);
26613 
26614         /* Refraction constants A and B. */
26615         RefCos refco = jauRefco(phpa, tc, rh, wl);
26616 
26617         /* CIRS <-> observed astrometry parameters. */
26618         jauApio(sp, theta, elong, phi, hm, xp, yp, refco.a, refco.b, astrom);
26619 
26620        
26621         /* Finished. */
26622 
26623 
26624     }
26625 
26626     /**
26627      *  Transform ICRS star data, epoch J2000.0, to CIRS.
26628      *
26629      *<p>This function is derived from the International Astronomical Union's
26630      *  SOFA (Standards of Fundamental Astronomy) software collection.
26631      *
26632      *<p>Status:  support function.
26633      *
26634      *<!-- Given: -->
26635      *     @param rc      double    ICRS right ascension at J2000.0 (radians, Note 1)
26636      *     @param dc      double    ICRS declination at J2000.0 (radians, Note 1)
26637      *     @param pr      double    RA proper motion (radians/year; Note 2)
26638      *     @param pd      double    Dec proper motion (radians/year)
26639      *     @param px      double    parallax (arcsec)
26640      *     @param rv      double    radial velocity (km/s, +ve if receding)
26641      *     @param date1   double    TDB as a 2-part...
26642      *     @param date2   double    ...Julian Date (Note 3)
26643      *
26644      *<!-- Returned:-->
26645      *     @return    double*    <b>Returned</b> CIRS geocentric RA,Dec (radians)
26646      *        eo      double*    <b>Returned</b> equation of the origins (ERA-GST, Note 5)
26647      *
26648      *<p>Notes:
26649      * <ol>
26650      *
26651      *  <li> Star data for an epoch other than J2000.0 (for example from the
26652      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26653      *     preliminary call to iauPmsafe before use.
26654      *
26655      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26656      *
26657      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
26658      *     convenient way between the two arguments.  For example,
26659      *     JD(TDB)=2450123.8g could be expressed in any of these ways, among
26660      *     others:
26661      *
26662      *            date1          date2
26663      *
26664      *         2450123.8g           0.0       (JD method)
26665      *         2451545.0       -1421.3       (J2000 method)
26666      *         2400000.5       50123.2       (MJD method)
26667      *         2450123.5           0.2       (date &amp; time method)
26668      *
26669      *     <p>The JD method is the most natural and convenient to use in cases
26670      *     where the loss of several decimal digits of resolution is
26671      *     acceptable.  The J2000 method is best matched to the way the
26672      *     argument is handled internally and will deliver the optimum
26673      *     resolution.  The MJD method and the date &amp; time methods are both
26674      *     good compromises between resolution and convenience.  For most
26675      *     applications of this function the choice will not be at all
26676      *     critical.
26677      *
26678      *     <p>TT can be used instead of TDB without any significant impact on
26679      *     accuracy.
26680      *
26681      *  <li> The available accuracy is better than 1 milliarcsecond, limited
26682      *     mainly by the precession-nutation model that is used, namely
26683      *     IAU 2000A/2006.  Very close to solar system bodies, additional
26684      *     errors of up to several milliarcseconds can occur because of
26685      *     unmodeled light deflection;  however, the Sun's contribution is
26686      *     taken into account, to first order.  The accuracy limitations of
26687      *     the SOFA function iauEpv00 (used to compute Earth position and
26688      *     velocity) can contribute aberration errors of up to
26689      *     5 microarcseconds.  Light deflection at the Sun's limb is
26690      *     uncertain at the 0.4 mas level.
26691      *
26692      *  <li> Should the transformation to (equinox based) apparent place be
26693      *     required rather than (CIO based) intermediate place, subtract the
26694      *     equation of the origins from the returned right ascension:
26695      *     RA = RI - EO. (The iauAnp function can then be applied, as
26696      *     required, to keep the result in the conventional 0-2pi range.)
26697      *
26698      * </ol>
26699      *  Called:
26700      * <ul>
26701      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
26702      *     <li>{@link #jauAtciq} quick ICRS to CIRS
26703      *
26704      * </ul>
26705      *@version  2013 October 9
26706      *
26707      *@since JSOFA release 20131202
26708      *
26709      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26710      */
26711     public static SphericalCoordinateEO jauAtci13(double rc, double dc,
26712             double pr, double pd, double px, double rv,
26713             double date1, double date2)
26714     {
26715         /* Star-independent astrometry parameters */
26716         Astrom astrom = new Astrom();
26717 
26718 
26719         /* The transformation parameters. */
26720         double eo = jauApci13(date1, date2, astrom);
26721 
26722         /* ICRS (epoch J2000.0) to CIRS. */
26723         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
26724         
26725         return new SphericalCoordinateEO(co, eo);
26726         /* Finished. */
26727 
26728 
26729     }
26730 
26731     /**
26732      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26733      *  star-independent astrometry parameters.
26734      *
26735      *  Use of this function is appropriate when efficiency is important and
26736      *  where many star positions are to be transformed for one date.  The
26737      *  star-independent parameters can be obtained by calling one of the
26738      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26739      *
26740      *  If the parallax and proper motions are zero the iauAtciqz function
26741      *  can be used instead.
26742      *
26743      *<p>This function is derived from the International Astronomical Union's
26744      *  SOFA (Standards of Fundamental Astronomy) software collection.
26745      *
26746      *<p>Status:  support function.
26747      *
26748      *<!-- Given: -->
26749      *     @param rc double      ICRS RA,Dec at J2000.0 (radians)
26750      *     @param dc double      ICRS RA,Dec at J2000.0 (radians) 
26751      *     @param pr      double      RA proper motion (radians/year; Note 3)
26752      *     @param pd      double      Dec proper motion (radians/year)
26753      *     @param px      double      parallax (arcsec)
26754      *     @param rv      double      radial velocity (km/s, +ve if receding)
26755      *     @param astrom    star-independent astrometry parameters:
26756      *
26757      *<!-- Returned:-->
26758      *     @return     double      <b>Returned</b> CIRS RA,Dec (radians)
26759      *
26760      *<p>Notes:
26761      * <ol>
26762      *
26763      *  <li> All the vectors are with respect to BCRS axes.
26764      *
26765      *  <li> Star data for an epoch other than J2000.0 (for example from the
26766      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26767      *     preliminary call to iauPmsafe before use.
26768      *
26769      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26770      *
26771      * </ol>
26772      *  Called:
26773      * <ul>
26774      *     <li>{@link #jauPmpx} proper motion and parallax
26775      *     <li>{@link #jauLdsun} light deflection by the Sun
26776      *     <li>{@link #jauAb} stellar aberration
26777      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26778      *     <li>{@link #jauC2s} p-vector to spherical
26779      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26780      *
26781      * </ul>
26782      *@version  2013 October 9
26783      *
26784      *@since JSOFA release 20131202
26785      *
26786      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26787      */
26788     public static SphericalCoordinate jauAtciq(double rc, double dc,
26789             double pr, double pd, double px, double rv,
26790             Astrom astrom)
26791     {
26792         double pco[], pnat[], ppr[], pi[];
26793 
26794 
26795         /* Proper motion and parallax, giving BCRS coordinate direction. */
26796         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26797 
26798         /* Light deflection by the Sun, giving BCRS natural direction. */
26799         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26800 
26801         /* Aberration, giving GCRS proper direction. */
26802         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26803 
26804         /* Bias-precession-nutation, giving CIRS proper direction. */
26805         pi = jauRxp(astrom.bpn, ppr);
26806 
26807         /* CIRS RA,Dec. */
26808         SphericalCoordinate co = jauC2s(pi);
26809         co.alpha = jauAnp(co.alpha);
26810 
26811         return co;
26812         /* Finished. */
26813 
26814 
26815     }
26816 
26817     /**
26818      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26819      *  star-independent astrometry parameters plus a list of light-
26820      *  deflecting bodies.
26821      *
26822      *  Use of this function is appropriate when efficiency is important and
26823      *  where many star positions are to be transformed for one date.  The
26824      *  star-independent parameters can be obtained by calling one of the
26825      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26826      *
26827      *
26828      *  If the only light-deflecting body to be taken into account is the
26829      *  Sun, the iauAtciq function can be used instead.  If in addition the
26830      *  parallax and proper motions are zero, the iauAtciqz function can be
26831      *  used.
26832      *
26833      *<p>This function is derived from the International Astronomical Union's
26834      *  SOFA (Standards of Fundamental Astronomy) software collection.
26835      *
26836      *<p>Status:  support function.
26837      *
26838      *<!-- Given: -->
26839      *     @param rc double        ICRS RA,Dec at J2000.0 (radians)
26840      *     @param dc double        ICRS RA,Dec at J2000.0 (radians) 
26841      *     @param pr      double        RA proper motion (radians/year; Note 3)
26842      *     @param pd      double        Dec proper motion (radians/year)
26843      *     @param px      double        parallax (arcsec)
26844      *     @param rv      double        radial velocity (km/s, +ve if receding)
26845      *     @param astrom      star-independent astrometry parameters:
26846      *      @param n      int            number of bodies (Note 3)
26847      *      @param b      jauLDBODY[n]  data for each of the n bodies (Notes 3,4):
26848      *
26849      *<!-- Returned:-->
26850      *     @return ri,di    double      <b>Returned</b> CIRS RA,Dec (radians)
26851      *
26852      *<p>Notes:
26853      * <ol>
26854      *
26855      *  <li> Star data for an epoch other than J2000.0 (for example from the
26856      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26857      *     preliminary call to iauPmsafe before use.
26858      *
26859      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26860      *
26861      *  <li> The struct b contains n entries, one for each body to be
26862      *     considered.  If n = 0, no gravitational light deflection will be
26863      *     applied, not even for the Sun.
26864      *
26865      *  <li> The struct b should include an entry for the Sun as well as for
26866      *     any planet or other body to be taken into account.  The entries
26867      *     should be in the order in which the light passes the body.
26868      *
26869      *  <li> In the entry in the b struct for body i, the mass parameter
26870      *     b[i].bm can, as required, be adjusted in order to allow for such
26871      *     effects as quadrupole field.
26872      *
26873      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
26874      *     the angular separation (in radians) between star and body at
26875      *     which limiting is applied.  As phi shrinks below the chosen
26876      *     threshold, the deflection is artificially reduced, reaching zero
26877      *     for phi = 0.   Example values suitable for a terrestrial
26878      *     observer, together with masses, are as follows:
26879      *     <pre>
26880      *        body i     b[i].bm        b[i].dl
26881      *
26882      *        Sun        1.0            6e-6
26883      *        Jupiter    0.00095435     3e-9
26884      *        Saturn     0.00028574     3e-10
26885      *     </pre>
26886      *  <li> For efficiency, validation of the contents of the b array is
26887      *     omitted.  The supplied masses must be greater than zero, the
26888      *     position and velocity vectors must be right, and the deflection
26889      *     limiter greater than zero.
26890      *
26891      * </ol>
26892      *  Called:
26893      * <ul>
26894      *     <li>{@link #jauPmpx} proper motion and parallax
26895      *     <li>{@link #jauLdn} light deflection by n bodies
26896      *     <li>{@link #jauAb} stellar aberration
26897      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26898      *     <li>{@link #jauC2s} p-vector to spherical
26899      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26900      *
26901      * </ul>
26902      *@version  2013 October 9
26903      *
26904      *@since JSOFA release 20131202
26905      *
26906      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26907      */
26908     public static SphericalCoordinate jauAtciqn(double rc, double dc, double pr, double pd,
26909             double px, double rv, Astrom astrom,
26910             int n, Ldbody b[])
26911     {
26912         double pco[], pnat[], ppr[] = new double[3], pi[] = new double[3];
26913 
26914 
26915         /* Proper motion and parallax, giving BCRS coordinate direction. */
26916         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26917 
26918         /* Light deflection, giving BCRS natural direction. */
26919         pnat = jauLdn(n, b, astrom.eb, pco);
26920 
26921         /* Aberration, giving GCRS proper direction. */
26922         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26923 
26924         /* Bias-precession-nutation, giving CIRS proper direction. */
26925         pi = jauRxp(astrom.bpn, ppr);
26926 
26927         /* CIRS RA,Dec. */
26928         SphericalCoordinate co = jauC2s(pi);
26929         co.alpha = jauAnp(co.alpha);
26930 
26931         return co;
26932         /* Finished. */
26933 
26934 
26935     }
26936 
26937     /**
26938      *  Quick ICRS to CIRS transformation, given precomputed star-
26939      *  independent astrometry parameters, and assuming zero parallax and
26940      *  proper motion.
26941      *
26942      *  Use of this function is appropriate when efficiency is important and
26943      *  where many star positions are to be transformed for one date.  The
26944      *  star-independent parameters can be obtained by calling one of the
26945      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26946      *
26947      *  The corresponding function for the case of non-zero parallax and
26948      *  proper motion is iauAtciq.
26949      *
26950      *<p>This function is derived from the International Astronomical Union's
26951      *  SOFA (Standards of Fundamental Astronomy) software collection.
26952      *
26953      *<p>Status:  support function.
26954      *
26955      *<!-- Given: -->
26956      *     @param rc double      ICRS astrometric RA,Dec (radians)
26957      *     @param dc double      ICRS astrometric RA,Dec (radians) 
26958      *     @param astrom    star-independent astrometry parameters:
26959      *
26960      *<!-- Returned:-->
26961      *     @return ri,di   double       <b>Returned</b> CIRS RA,Dec (radians)
26962      *
26963      *  Note:
26964      *
26965      *     @return All  the   <b>Returned</b> vectors are with respect to BCRS axes.
26966      *
26967      *<p>References:
26968      * <ul>
26969      *
26970      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
26971      *     the Astronomical Almanac, 3rd ed., University Science Books
26972      *     (2013).
26973      *
26974      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
26975      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
26976      *
26977      * </ul>
26978      *  Called:
26979      * <ul>
26980      *     <li>{@link #jauS2c} spherical coordinates to unit vector
26981      *     <li>{@link #jauLdsun} light deflection due to Sun
26982      *     <li>{@link #jauAb} stellar aberration
26983      *     <li>{@link #jauRxp} product of r-matrix and p-vector
26984      *     <li>{@link #jauC2s} p-vector to spherical
26985      *     <li>{@link #jauAnp} normalize angle into range +/- pi
26986      *
26987      * </ul>
26988      *@version  2013 October 9
26989      *
26990      *@since JSOFA release 20131202
26991      *
26992      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26993      */
26994     public static SphericalCoordinate jauAtciqz(double rc, double dc, Astrom astrom)
26995     {
26996         double pco[], pnat[], ppr[] = new double[3], pi[];
26997 
26998 
26999         /* BCRS coordinate direction (unit vector). */
27000         pco = jauS2c(rc, dc);
27001 
27002         /* Light deflection by the Sun, giving BCRS natural direction. */
27003         pnat = jauLdsun(pco, astrom.eh, astrom.em);
27004 
27005         /* Aberration, giving GCRS proper direction. */
27006         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
27007 
27008         /* Bias-precession-nutation, giving CIRS proper direction. */
27009         pi = jauRxp(astrom.bpn, ppr);
27010 
27011         /* CIRS RA,Dec. */
27012         SphericalCoordinate co = jauC2s(pi);
27013         co.alpha = jauAnp(co.alpha);
27014 
27015         return co;
27016         /* Finished. */
27017 
27018 
27019     }
27020 
27021     /**
27022      *  ICRS RA,Dec to observed place.  The caller supplies UTC, site
27023      *  coordinates, ambient air conditions and observing wavelength.
27024      *
27025      *  SOFA models are used for the Earth ephemeris, bias-precession-
27026      *  nutation, Earth orientation and refraction.
27027      *
27028      *<p>This function is derived from the International Astronomical Union's
27029      *  SOFA (Standards of Fundamental Astronomy) software collection.
27030      *
27031      *<p>Status:  support function.
27032      *
27033      *<!-- Given: -->
27034      *     @param rc double    ICRS right ascension at J2000.0 (radians, Note 1)
27035      *     @param dc double    ICRS right ascension at J2000.0 (radians, Note 1) 
27036      *     @param pr      double    RA proper motion (radians/year; Note 2)
27037      *     @param pd      double    Dec proper motion (radians/year)
27038      *     @param px      double    parallax (arcsec)
27039      *     @param rv      double    radial velocity (km/s, +ve if receding)
27040      *     @param utc1    double    UTC as a 2-part...
27041      *     @param utc2    double    ...quasi Julian Date (Notes 3-4)
27042      *     @param dut1    double    UT1-UTC (seconds, Note 5)
27043      *     @param elong   double    longitude (radians, east +ve, Note 6)
27044      *     @param phi     double    latitude (geodetic, radians, Note 6)
27045      *     @param hm      double    height above ellipsoid (m, geodetic, Notes 6,8)
27046      *     @param xp double    polar motion coordinates (radians, Note 7)
27047      *     @param yp double    polar motion coordinates (radians, Note 7) 
27048      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
27049      *     @param tc      double    ambient temperature at the observer (deg C)
27050      *     @param rh      double    relative humidity at the observer (range 0-1)
27051      *     @param wl      double    wavelength (micrometers, Note 9)
27052      *
27053      *<!-- Returned:-->
27054      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
27055      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
27056      *             hob     double*    <b>Returned</b> observed hour angle (radians)
27057      *             dob     double*    <b>Returned</b> observed declination (radians)
27058      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
27059      *             eo      double*    <b>Returned</b> equation of the origins (ERA-GST)
27060      *
27061      *  @throws JSOFAInternalError an internal error has occured
27062      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 4)
27063      *                               0  =   <b>Returned</b> OK
27064      *                              -1  =   <b>Returned</b> unacceptable date
27065      *
27066      *<p>Notes:
27067      * <ol>
27068      *
27069      *  <li> Star data for an epoch other than J2000.0 (for example from the
27070      *      Hipparcos catalog, which has an epoch of J1991.25) will require
27071      *      a preliminary call to iauPmsafe before use.
27072      *
27073      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
27074      *
27075      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27076      *      convenient way between the two arguments, for example where utc1
27077      *      is the Julian Day Number and utc2 is the fraction of a day.
27078      *
27079      *      <p>However, JD cannot unambiguously represent UTC during a leap
27080      *      second unless special measures are taken.  The convention in the
27081      *      present function is that the JD day represents UTC days whether
27082      *      the length is 86399, 86400 or 86401 SI seconds.
27083      *
27084      *      <p>Applications should use the function iauDtf2d to convert from
27085      *      calendar date and time of day into 2-part quasi Julian Date, as
27086      *      it implements the leap-second-ambiguity convention just
27087      *      described.
27088      *
27089      *  <li> The warning status "dubious year" flags UTCs that predate the
27090      *      introduction of the time scale or that are too far in the
27091      *      future to be trusted.  See iauDat for further details.
27092      *
27093      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27094      *      one second at the end of each positive UTC leap second,
27095      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27096      *      practice is under review, and in the future UT1-UTC may grow
27097      *      essentially without limit.
27098      *
27099      *  <li> The geographical coordinates are with respect to the WGS84
27100      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27101      *      longitude required by the present function is east-positive
27102      *      (i.e. right-handed), in accordance with geographical convention.
27103      *
27104      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27105      *      values are the coordinates (in radians) of the Celestial
27106      *      Intermediate Pole with respect to the International Terrestrial
27107      *      Reference System (see IERS Conventions 2003), measured along the
27108      *      meridians 0 and 90 deg west respectively.  For many
27109      *      applications, xp and yp can be set to zero.
27110      *
27111      *  <li> If hm, the height above the ellipsoid of the observing station
27112      *      in meters, is not known but phpa, the pressure in hPa (=mB),
27113      *      is available, an adequate estimate of hm can be obtained from
27114      *      the expression
27115      *
27116      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27117      *
27118      *      <p>where tsl is the approximate sea-level air temperature in K
27119      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27120      *      52).  Similarly, if the pressure phpa is not known, it can be
27121      *      estimated from the height of the observing station, hm, as
27122      *      follows:
27123      *
27124      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27125      *
27126      *      <p>Note, however, that the refraction is nearly proportional to
27127      *      the pressure and that an accurate phpa value is important for
27128      *      precise work.
27129      *
27130      *  <li> The argument wl specifies the observing wavelength in
27131      *      micrometers.  The transition from optical to radio is assumed to
27132      *      occur at 100 micrometers (about 3000 GHz).
27133      *
27134      *  <li> The accuracy of the result is limited by the corrections for
27135      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27136      *      Providing the meteorological parameters are known accurately and
27137      *      there are no gross local effects, the predicted observed
27138      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27139      *      (radio) for a zenith distance of less than 70 degrees, better
27140      *      than 30 arcsec (optical or radio) at 85 degrees and better
27141      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27142      *
27143      *      <p>Without refraction, the complementary functions iauAtco13 and
27144      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
27145      *      all over the celestial sphere.  With refraction included,
27146      *      consistency falls off at high zenith distances, but is still
27147      *      better than 0.05 arcsec at 85 degrees.
27148      *
27149      *  <li> "Observed" Az,ZD means the position that would be seen by a
27150      *      perfect geodetically aligned theodolite.  (Zenith distance is
27151      *      used rather than altitude in order to reflect the fact that no
27152      *      allowance is made for depression of the horizon.)  This is
27153      *      related to the observed HA,Dec via the standard rotation, using
27154      *      the geodetic latitude (corrected for polar motion), while the
27155      *      observed HA and RA are related simply through the Earth rotation
27156      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27157      *      means the position that would be seen by a perfect equatorial
27158      *      with its polar axis aligned to the Earth's axis of rotation.
27159      *
27160      *  <li> It is advisable to take great care with units, as even unlikely
27161      *      values of the input parameters are accepted and processed in
27162      *      accordance with the models used.
27163      *
27164      * </ol>
27165      *  Called:
27166      * <ul>
27167      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed, 2013
27168      *     <li>{@link #jauAtciq} quick ICRS to CIRS
27169      *     <li>{@link #jauAtioq} quick ICRS to observed
27170      *
27171      * </ul>
27172      *@version  2013 October 9
27173      *
27174      *@since JSOFA release 20131202
27175      *
27176      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27177      * @throws JSOFAInternalError an internal error has occured
27178      * @throws JSOFAIllegalParameter unacceptable date.
27179      */
27180     public static ObservedPositionEO jauAtco13(double rc, double dc,
27181             double pr, double pd, double px, double rv,
27182             double utc1, double utc2, double dut1,
27183             double elong, double phi, double hm, double xp, double yp,
27184             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27185     {
27186         Astrom astrom = new Astrom();
27187 
27188 
27189         /* Star-independent astrometry parameters. */
27190         double eo = jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27191                 phpa, tc, rh, wl, astrom);
27192 
27193         /* Transform ICRS to CIRS. */
27194         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
27195 
27196         /* Transform CIRS to observed. */
27197         ObservedPosition obs = jauAtioq(co.alpha, co.delta, astrom);
27198 
27199       
27200         return new ObservedPositionEO(obs, eo);
27201         
27202         /* Finished. */
27203 
27204 
27205     }
27206 
27207     /**
27208      *  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
27209      *
27210      *<p>This function is derived from the International Astronomical Union's
27211      *  SOFA (Standards of Fundamental Astronomy) software collection.
27212      *
27213      *<p>Status:  support function.
27214      *
27215      *<!-- Given: -->
27216      *     @param ri double   CIRS geocentric RA,Dec (radians)
27217      *     @param di double   CIRS geocentric RA,Dec (radians) 
27218      *     @param date1   double   TDB as a 2-part...
27219      *     @param date2   double   ...Julian Date (Note 1)
27220      *
27221      *<!-- Returned:-->
27222      *     @return rc,dc   double    <b>Returned</b> ICRS astrometric RA,Dec (radians)
27223      *      eo      double    <b>Returned</b> equation of the origins (ERA-GST, Note 4)
27224      *
27225      *<p>Notes:
27226      * <ol>
27227      *
27228      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
27229      *     convenient way between the two arguments.  For example,
27230      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
27231      *     others:
27232      *
27233      *            date1          date2
27234      *
27235      *         2450123.7           0.0       (JD method)
27236      *         2451545.0       -1421.3       (J2000 method)
27237      *         2400000.5       50123.2       (MJD method)
27238      *         2450123.5           0.2       (date &amp; time method)
27239      *
27240      *     <p>The JD method is the most natural and convenient to use in cases
27241      *     where the loss of several decimal digits of resolution is
27242      *     acceptable.  The J2000 method is best matched to the way the
27243      *     argument is handled internally and will deliver the optimum
27244      *     resolution.  The MJD method and the date &amp; time methods are both
27245      *     good compromises between resolution and convenience.  For most
27246      *     applications of this function the choice will not be at all
27247      *     critical.
27248      *
27249      *     <p>TT can be used instead of TDB without any significant impact on
27250      *     accuracy.
27251      *
27252      *  <li> Iterative techniques are used for the aberration and light
27253      *     deflection corrections so that the functions iauAtic13 (or
27254      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27255      *     even at the edge of the Sun's disk the discrepancy is only about
27256      *     1 nanoarcsecond.
27257      *
27258      *  <li> The available accuracy is better than 1 milliarcsecond, limited
27259      *     mainly by the precession-nutation model that is used, namely
27260      *     IAU 2000A/2006.  Very close to solar system bodies, additional
27261      *     errors of up to several milliarcseconds can occur because of
27262      *     unmodeled light deflection;  however, the Sun's contribution is
27263      *     taken into account, to first order.  The accuracy limitations of
27264      *     the SOFA function iauEpv00 (used to compute Earth position and
27265      *     velocity) can contribute aberration errors of up to
27266      *     5 microarcseconds.  Light deflection at the Sun's limb is
27267      *     uncertain at the 0.4 mas level.
27268      *
27269      *  <li> Should the transformation to (equinox based) J2000.0 mean place
27270      *     be required rather than (CIO based) ICRS coordinates, subtract the
27271      *     equation of the origins from the returned right ascension:
27272      *     RA = RI - EO.  (The iauAnp function can then be applied, as
27273      *     required, to keep the result in the conventional 0-2pi range.)
27274      *
27275      * </ol>
27276      *  Called:
27277      * <ul>
27278      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
27279      *     <li>{@link #jauAticq} quick CIRS to ICRS astrometric
27280      *
27281      * </ul>
27282      *@version  2013 October 9
27283      *
27284      *@since JSOFA release 20131202
27285      *
27286      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27287      */
27288     public static SphericalCoordinateEO jauAtic13(double ri, double di, double date1, double date2)
27289     {
27290         /* Star-independent astrometry parameters */
27291         Astrom astrom = new Astrom();
27292 
27293 
27294         /* Star-independent astrometry parameters. */
27295         double eo = jauApci13(date1, date2, astrom);
27296 
27297         /* CIRS to ICRS astrometric. */
27298         SphericalCoordinate co = jauAticq(ri, di, astrom);
27299 
27300         return new SphericalCoordinateEO(co,eo);
27301         /* Finished. */
27302 
27303 
27304     }
27305 
27306     /**
27307      *  Quick CIRS RA,Dec to ICRS astrometric place, given the star-
27308      *  independent astrometry parameters.
27309      *
27310      *  Use of this function is appropriate when efficiency is important and
27311      *  where many star positions are all to be transformed for one date.
27312      *  The star-independent astrometry parameters can be obtained by
27313      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27314      *  or iauApcs[13].
27315      *
27316      *<p>This function is derived from the International Astronomical Union's
27317      *  SOFA (Standards of Fundamental Astronomy) software collection.
27318      *
27319      *<p>Status:  support function.
27320      *
27321      *<!-- Given: -->
27322      *     @param ri double      CIRS RA,Dec (radians)
27323      *     @param di double      CIRS RA,Dec (radians) 
27324      *     @param astrom    star-independent astrometry parameters:
27325      *
27326      *<!-- Returned:-->
27327      *     @return rc,dc   double       <b>Returned</b> ICRS astrometric RA,Dec (radians)
27328      *
27329      *<p>Notes:
27330      * <ol>
27331      *
27332      *  <li> Only the Sun is taken into account in the light deflection
27333      *     correction.
27334      *
27335      *  <li> Iterative techniques are used for the aberration and light
27336      *     deflection corrections so that the functions iauAtic13 (or
27337      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27338      *     even at the edge of the Sun's disk the discrepancy is only about
27339      *     1 nanoarcsecond.
27340      *
27341      * </ol>
27342      *  Called:
27343      * <ul>
27344      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27345      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27346      *     <li>{@link #jauZp} zero p-vector
27347      *     <li>{@link #jauAb} stellar aberration
27348      *     <li>{@link #jauLdsun} light deflection by the Sun
27349      *     <li>{@link #jauC2s} p-vector to spherical
27350      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27351      *
27352      * </ul>
27353      *@version  2013 October 9
27354      *
27355      *@since JSOFA release 20131202
27356      *
27357      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27358      */
27359     public static SphericalCoordinate  jauAticq(double ri, double di, Astrom astrom )
27360     {
27361         int j, i;
27362         double pi[] , ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], 
27363                 before[] = new double[3], r2, r,
27364                 after[];
27365 
27366 
27367         /* CIRS RA,Dec to Cartesian. */
27368         pi = jauS2c(ri, di);
27369 
27370         /* Bias-precession-nutation, giving GCRS proper direction. */
27371         ppr = jauTrxp(astrom.bpn, pi);
27372 
27373         /* Aberration, giving GCRS natural direction. */
27374         jauZp(d);
27375         for (j = 0; j < 2; j++) {
27376             r2 = 0.0;
27377             for (i = 0; i < 3; i++) {
27378                 w = ppr[i] - d[i];
27379                 before[i] = w;
27380                 r2 += w*w;
27381             }
27382             r = sqrt(r2);
27383             for (i = 0; i < 3; i++) {
27384                 before[i] /= r;
27385             }
27386             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27387             r2 = 0.0;
27388             for (i = 0; i < 3; i++) {
27389                 d[i] = after[i] - before[i];
27390                 w = ppr[i] - d[i];
27391                 pnat[i] = w;
27392                 r2 += w*w;
27393             }
27394             r = sqrt(r2);
27395             for (i = 0; i < 3; i++) {
27396                 pnat[i] /= r;
27397             }
27398         }
27399 
27400         /* Light deflection by the Sun, giving BCRS coordinate direction. */
27401         jauZp(d);
27402         for (j = 0; j < 5; j++) {
27403             r2 = 0.0;
27404             for (i = 0; i < 3; i++) {
27405                 w = pnat[i] - d[i];
27406                 before[i] = w;
27407                 r2 += w*w;
27408             }
27409             r = sqrt(r2);
27410             for (i = 0; i < 3; i++) {
27411                 before[i] /= r;
27412             }
27413             after = jauLdsun(before, astrom.eh, astrom.em);
27414             r2 = 0.0;
27415             for (i = 0; i < 3; i++) {
27416                 d[i] = after[i] - before[i];
27417                 w = pnat[i] - d[i];
27418                 pco[i] = w;
27419                 r2 += w*w;
27420             }
27421             r = sqrt(r2);
27422             for (i = 0; i < 3; i++) {
27423                 pco[i] /= r;
27424             }
27425         }
27426 
27427         /* ICRS astrometric RA,Dec. */
27428         SphericalCoordinate co = jauC2s(pco);
27429         co.alpha = jauAnp(co.alpha);
27430 
27431         return co;
27432         /* Finished. */
27433 
27434 
27435     }
27436 
27437     /**
27438      *  Quick CIRS to ICRS astrometric place transformation, given the star-
27439      *  independent astrometry parameters plus a list of light-deflecting
27440      *  bodies.
27441      *
27442      *  Use of this function is appropriate when efficiency is important and
27443      *  where many star positions are all to be transformed for one date.
27444      *  The star-independent astrometry parameters can be obtained by
27445      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27446      *  or iauApcs[13].
27447      *
27448      *  If the only light-deflecting body to be taken into account is the
27449      *  Sun, the iauAticq function can be used instead.
27450      *
27451      *<p>This function is derived from the International Astronomical Union's
27452      *  SOFA (Standards of Fundamental Astronomy) software collection.
27453      *
27454      *<p>Status:  support function.
27455      *
27456      *<!-- Given: -->
27457      *     @param ri double       CIRS RA,Dec (radians)
27458      *     @param di double       CIRS RA,Dec (radians) 
27459      *     @param astrom     star-independent astrometry parameters:
27460      *     @param n number of bodies.
27461      *     @param b[] data for each of the n bodies.
27462      *
27463      *<!-- Returned:-->
27464      *     @return        ICRS astrometric RA,Dec (radians)
27465      *
27466      *<p>Notes:
27467      * <ol>
27468      *
27469      *  <li> Iterative techniques are used for the aberration and light
27470      *     deflection corrections so that the functions iauAticqn and
27471      *     iauAtciqn are accurate inverses; even at the edge of the Sun's
27472      *     disk the discrepancy is only about 1 nanoarcsecond.
27473      *
27474      *  <li> If the only light-deflecting body to be taken into account is the
27475      *     Sun, the iauAticq function can be used instead.
27476      *
27477      *  <li> The struct b contains n entries, one for each body to be
27478      *     considered.  If n = 0, no gravitational light deflection will be
27479      *     applied, not even for the Sun.
27480      *
27481      *  <li> The struct b should include an entry for the Sun as well as for
27482      *     any planet or other body to be taken into account.  The entries
27483      *     should be in the order in which the light passes the body.
27484      *
27485      *  <li> In the entry in the b struct for body i, the mass parameter
27486      *     b[i].bm can, as required, be adjusted in order to allow for such
27487      *     effects as quadrupole field.
27488      *
27489      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
27490      *     the angular separation (in radians) between star and body at
27491      *     which limiting is applied.  As phi shrinks below the chosen
27492      *     threshold, the deflection is artificially reduced, reaching zero
27493      *     for phi = 0.   Example values suitable for a terrestrial
27494      *     observer, together with masses, are as follows:
27495      *
27496      *        <p>body i     b[i].bm        b[i].dl
27497      *
27498      *        <p>Sun        1.0            6e-6
27499      *        Jupiter    0.00095435     3e-9
27500      *        Saturn     0.00028574     3e-10
27501      *
27502      *  <li> For efficiency, validation of the contents of the b array is
27503      *     omitted.  The supplied masses must be greater than zero, the
27504      *     position and velocity vectors must be right, and the deflection
27505      *     limiter greater than zero.
27506      *
27507      * </ol>
27508      *  Called:
27509      * <ul>
27510      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27511      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27512      *     <li>{@link #jauZp} zero p-vector
27513      *     <li>{@link #jauAb} stellar aberration
27514      *     <li>{@link #jauLdn} light deflection by n bodies
27515      *     <li>{@link #jauC2s} p-vector to spherical
27516      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27517      *
27518      * </ul>
27519      *@version  2013 October 9
27520      *
27521      *@since JSOFA release 20131202
27522      *
27523      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27524      */
27525     public static SphericalCoordinate jauAticqn(double ri, double di, Astrom astrom,
27526             int n, Ldbody b[])
27527     {
27528         int j, i;
27529         double pi[], ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], before[] = new double[3], r2, r,
27530                 after[];
27531 
27532 
27533         /* CIRS RA,Dec to Cartesian. */
27534         pi = jauS2c(ri, di);
27535 
27536         /* Bias-precession-nutation, giving GCRS proper direction. */
27537         ppr = jauTrxp(astrom.bpn, pi);
27538 
27539         /* Aberration, giving GCRS natural direction. */
27540         jauZp(d);
27541         for (j = 0; j < 2; j++) {
27542             r2 = 0.0;
27543             for (i = 0; i < 3; i++) {
27544                 w = ppr[i] - d[i];
27545                 before[i] = w;
27546                 r2 += w*w;
27547             }
27548             r = sqrt(r2);
27549             for (i = 0; i < 3; i++) {
27550                 before[i] /= r;
27551             }
27552             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27553             r2 = 0.0;
27554             for (i = 0; i < 3; i++) {
27555                 d[i] = after[i] - before[i];
27556                 w = ppr[i] - d[i];
27557                 pnat[i] = w;
27558                 r2 += w*w;
27559             }
27560             r = sqrt(r2);
27561             for (i = 0; i < 3; i++) {
27562                 pnat[i] /= r;
27563             }
27564         }
27565 
27566         /* Light deflection, giving BCRS coordinate direction. */
27567         jauZp(d);
27568         for (j = 0; j < 5; j++) {
27569             r2 = 0.0;
27570             for (i = 0; i < 3; i++) {
27571                 w = pnat[i] - d[i];
27572                 before[i] = w;
27573                 r2 += w*w;
27574             }
27575             r = sqrt(r2);
27576             for (i = 0; i < 3; i++) {
27577                 before[i] /= r;
27578             }
27579             after = jauLdn(n, b, astrom.eb, before);
27580             r2 = 0.0;
27581             for (i = 0; i < 3; i++) {
27582                 d[i] = after[i] - before[i];
27583                 w = pnat[i] - d[i];
27584                 pco[i] = w;
27585                 r2 += w*w;
27586             }
27587             r = sqrt(r2);
27588             for (i = 0; i < 3; i++) {
27589                 pco[i] /= r;
27590             }
27591         }
27592 
27593         /* ICRS astrometric RA,Dec. */
27594         SphericalCoordinate co = jauC2s(pco);
27595         co.alpha = jauAnp(co.alpha);
27596 
27597         return co;
27598         /* Finished. */
27599 
27600 
27601     }
27602     
27603     /**
27604      * Observed Position.
27605      *  "Observed" Az,ZD means the position that would be seen by a
27606      *      perfect geodetically aligned theodolite.  (Zenith distance is
27607      *      used rather than altitude in order to reflect the fact that no
27608      *      allowance is made for depression of the horizon.)  This is
27609      *      related to the observed HA,Dec via the standard rotation, using
27610      *      the geodetic latitude (corrected for polar motion), while the
27611      *      observed HA and RA are related simply through the Earth rotation
27612      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27613      *      means the position that would be seen by a perfect equatorial
27614      *      with its polar axis aligned to the Earth's axis of rotation..
27615      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
27616      * @version $Revision$ $date$
27617      */
27618     public static class ObservedPosition{
27619         /**    observed azimuth (radians: N=0,E=90) */
27620         public double   aob;
27621 
27622         /**    observed zenith distance (radians)   */
27623         public double   zob;
27624 
27625         /**    observed Hour Angle (radians)        */
27626         public double   hob;
27627 
27628         /**    observed Declination (radians)       */
27629         public double   dob;
27630 
27631         /**    observed Right Ascension (radians)   */
27632         public double   rob;
27633         public ObservedPosition(double   aob,
27634                 double   zob,
27635                 double   hob,
27636                 double   dob,
27637                 double   rob
27638         ) {
27639             this.aob =  aob;
27640             this.zob =  zob;
27641             this.hob =  hob;
27642             this.dob =  dob;
27643             this.rob =  rob;  
27644         }
27645     }
27646     
27647     /**
27648      * Observed position with the equation of the origins.
27649      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Mar 2014
27650      * @version $Revision$ $date$
27651      */
27652     public static class ObservedPositionEO {
27653        /**
27654         * observed position.
27655         */
27656         public ObservedPosition op;
27657         /**
27658          * The equation of the origins.    The equation of the origins is the distance between the true
27659          *  equinox and the celestial intermediate origin and, equivalently,
27660          *  the difference between Earth rotation angle and Greenwich
27661          *  apparent sidereal time (ERA-GST).  It comprises the precession
27662          *  (since J2000.0) in right ascension plus the equation of the
27663          *  equinoxes (including the small correction terms).   
27664          */
27665         public double eo;
27666         /**
27667          * @param op the observed position.
27668          * @param eo the equation of the origins.
27669          */
27670         public ObservedPositionEO(ObservedPosition op, double eo) {
27671             this.op = op;
27672             this.eo = eo;
27673         }
27674         
27675     }
27676 
27677     
27678     
27679     
27680     /**
27681      *  CIRS RA,Dec to observed place.  The caller supplies UTC, site
27682      *  coordinates, ambient air conditions and observing wavelength.
27683      *
27684      *<p>This function is derived from the International Astronomical Union's
27685      *  SOFA (Standards of Fundamental Astronomy) software collection.
27686      *
27687      *<p>Status:  support function.
27688      *
27689      *<!-- Given: -->
27690      *     @param ri      double    CIRS right ascension (CIO-based, radians)
27691      *     @param di      double    CIRS declination (radians)
27692      *     @param utc1    double    UTC as a 2-part...
27693      *     @param utc2    double    ...quasi Julian Date (Notes 1,2)
27694      *     @param dut1    double    UT1-UTC (seconds, Note 3)
27695      *     @param elong   double    longitude (radians, east +ve, Note 4)
27696      *     @param phi     double    geodetic latitude (radians, Note 4)
27697      *     @param hm      double    height above ellipsoid (m, geodetic Notes 4,6)
27698      *     @param xp double    polar motion coordinates (radians, Note 5)
27699      *     @param yp double    polar motion coordinates (radians, Note 5) 
27700      *     @param phpa    double    pressure at the observer (hPa = mB, Note 6)
27701      *     @param tc      double    ambient temperature at the observer (deg C)
27702      *     @param rh      double    relative humidity at the observer (range 0-1)
27703      *     @param wl      double    wavelength (micrometers, Note 7)
27704      *
27705      *<!-- Returned:-->
27706      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
27707      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
27708      *             hob     double*    <b>Returned</b> observed hour angle (radians)
27709      *             dob     double*    <b>Returned</b> observed declination (radians)
27710      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
27711      *
27712      *  @throws JSOFAInternalError an internal error has occured
27713      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 2)
27714      *                              0  =   <b>Returned</b> OK
27715      *                              -1  =   <b>Returned</b> unacceptable date
27716      *
27717      *<p>Notes:
27718      * <ol>
27719      *
27720      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27721      *      convenient way between the two arguments, for example where utc1
27722      *      is the Julian Day Number and utc2 is the fraction of a day.
27723      *
27724      *      <p>However, JD cannot unambiguously represent UTC during a leap
27725      *      second unless special measures are taken.  The convention in the
27726      *      present function is that the JD day represents UTC days whether
27727      *      the length is 86399, 86400 or 86401 SI seconds.
27728      *
27729      *      <p>Applications should use the function iauDtf2d to convert from
27730      *      calendar date and time of day into 2-part quasi Julian Date, as
27731      *      it implements the leap-second-ambiguity convention just
27732      *      described.
27733      *
27734      *  <li> The warning status "dubious year" flags UTCs that predate the
27735      *      introduction of the time scale or that are too far in the
27736      *      future to be trusted.  See iauDat for further details.
27737      *
27738      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27739      *      one second at the end of each positive UTC leap second,
27740      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27741      *      practice is under review, and in the future UT1-UTC may grow
27742      *      essentially without limit.
27743      *
27744      *  <li> The geographical coordinates are with respect to the WGS84
27745      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27746      *      longitude required by the present function is east-positive
27747      *      (i.e. right-handed), in accordance with geographical convention.
27748      *
27749      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27750      *      values are the coordinates (in radians) of the Celestial
27751      *      Intermediate Pole with respect to the International Terrestrial
27752      *      Reference System (see IERS Conventions 2003), measured along the
27753      *      meridians 0 and 90 deg west respectively.  For many
27754      *      applications, xp and yp can be set to zero.
27755      *
27756      *  <li> If hm, the height above the ellipsoid of the observing station
27757      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
27758      *      available, an adequate estimate of hm can be obtained from the
27759      *      expression
27760      *
27761      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27762      *
27763      *      <p>where tsl is the approximate sea-level air temperature in K
27764      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27765      *      52).  Similarly, if the pressure phpa is not known, it can be
27766      *      estimated from the height of the observing station, hm, as
27767      *      follows:
27768      *
27769      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27770      *
27771      *      <p>Note, however, that the refraction is nearly proportional to
27772      *      the pressure and that an accurate phpa value is important for
27773      *      precise work.
27774      *
27775      *  <li> The argument wl specifies the observing wavelength in
27776      *      micrometers.  The transition from optical to radio is assumed to
27777      *      occur at 100 micrometers (about 3000 GHz).
27778      *
27779      *  <li> "Observed" Az,ZD means the position that would be seen by a
27780      *      perfect geodetically aligned theodolite.  (Zenith distance is
27781      *      used rather than altitude in order to reflect the fact that no
27782      *      allowance is made for depression of the horizon.)  This is
27783      *      related to the observed HA,Dec via the standard rotation, using
27784      *      the geodetic latitude (corrected for polar motion), while the
27785      *      observed HA and RA are related simply through the Earth rotation
27786      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27787      *      means the position that would be seen by a perfect equatorial
27788      *      with its polar axis aligned to the Earth's axis of rotation.
27789      *
27790      *  <li> The accuracy of the result is limited by the corrections for
27791      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27792      *      Providing the meteorological parameters are known accurately and
27793      *      there are no gross local effects, the predicted astrometric
27794      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27795      *      (radio) for a zenith distance of less than 70 degrees, better
27796      *      than 30 arcsec (optical or radio) at 85 degrees and better
27797      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27798      *
27799      *  <li> The complementary functions iauAtio13 and iauAtoi13 are self-
27800      *      consistent to better than 1 microarcsecond all over the
27801      *      celestial sphere.
27802      *
27803      *  <li> It is advisable to take great care with units, as even unlikely
27804      *      values of the input parameters are accepted and processed in
27805      *      accordance with the models used.
27806      *
27807      * </ol>
27808      *  Called:
27809      * <ul>
27810      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
27811      *     <li>{@link #jauAtioq} quick CIRS to observed
27812      *
27813      * </ul>
27814      *@version  2013 October 9
27815      *
27816      *@since JSOFA release 20131202
27817      *
27818      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27819      * @throws JSOFAInternalError an internal error has occured
27820      * @throws JSOFAIllegalParameter unacceptable date.
27821      */
27822     public static ObservedPosition jauAtio13(double ri, double di,
27823             double utc1, double utc2, double dut1,
27824             double elong, double phi, double hm, double xp, double yp,
27825             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27826     {
27827         Astrom astrom = new Astrom();
27828 
27829 
27830         /* Star-independent astrometry parameters for CIRS->observed. */
27831         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27832                 phpa, tc, rh, wl, astrom);
27833 
27834         /* Transform CIRS to observed. */
27835         return jauAtioq(ri, di, astrom);
27836 
27837         /* Finished. */
27838 
27839 
27840     }
27841 
27842     /**
27843      *  Quick CIRS to observed place transformation.
27844      *
27845      *  Use of this function is appropriate when efficiency is important and
27846      *  where many star positions are all to be transformed for one date.
27847      *  The star-independent astrometry parameters can be obtained by
27848      *  calling iauApio[13] or iauApco[13].
27849      *
27850      *<p>This function is derived from the International Astronomical Union's
27851      *  SOFA (Standards of Fundamental Astronomy) software collection.
27852      *
27853      *<p>Status:  support function.
27854      *
27855      *<!-- Given: -->
27856      *     @param ri      double      CIRS right ascension
27857      *     @param di      double      CIRS declination
27858      *     @param astrom    star-independent astrometry parameters:
27859      *
27860      *<!-- Returned:-->
27861      *     @return aob     double*      <b>Returned</b> observed azimuth (radians: N=0,E=90)
27862      *             zob     double*      <b>Returned</b> observed zenith distance (radians)
27863      *             hob     double*      <b>Returned</b> observed hour angle (radians)
27864      *             dob     double*      <b>Returned</b> observed declination (radians)
27865      *             rob     double*      <b>Returned</b> observed right ascension (CIO-based, radians)
27866      *
27867      *<p>Notes:
27868      * <ol>
27869      *
27870      *  <li> This function returns zenith distance rather than altitude in
27871      *     order to reflect the fact that no allowance is made for
27872      *     depression of the horizon.
27873      *
27874      *  <li> The accuracy of the result is limited by the corrections for
27875      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27876      *     Providing the meteorological parameters are known accurately and
27877      *     there are no gross local effects, the predicted observed
27878      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27879      *     (radio) for a zenith distance of less than 70 degrees, better
27880      *     than 30 arcsec (optical or radio) at 85 degrees and better
27881      *     than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27882      *
27883      *     <p>Without refraction, the complementary functions iauAtioq and
27884      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
27885      *     over the celestial sphere.  With refraction included, consistency
27886      *     falls off at high zenith distances, but is still better than
27887      *     0.05 arcsec at 85 degrees.
27888      *
27889      *  <li> It is advisable to take great care with units, as even unlikely
27890      *     values of the input parameters are accepted and processed in
27891      *     accordance with the models used.
27892      *
27893      *  <li> The CIRS RA,Dec is obtained from a star catalog mean place by
27894      *     allowing for space motion, parallax, the Sun's gravitational lens
27895      *     effect, annual aberration and precession-nutation.  For star
27896      *     positions in the ICRS, these effects can be applied by means of
27897      *     the iauAtci13 (etc.) functions.  Starting from classical "mean
27898      *     place" systems, additional transformations will be needed first.
27899      *
27900      *  <li> "Observed" Az,El means the position that would be seen by a
27901      *     perfect geodetically aligned theodolite.  This is obtained from
27902      *     the CIRS RA,Dec by allowing for Earth orientation and diurnal
27903      *     aberration, rotating from equator to horizon coordinates, and
27904      *     then adjusting for refraction.  The HA,Dec is obtained by
27905      *     rotating back into equatorial coordinates, and is the position
27906      *     that would be seen by a perfect equatorial with its polar axis
27907      *     aligned to the Earth's axis of rotation.  Finally, the RA is
27908      *     obtained by subtracting the HA from the local ERA.
27909      *
27910      *  <li> The star-independent CIRS-to-observed-place parameters in ASTROM
27911      *     may be computed with iauApio[13] or iauApco[13].  If nothing has
27912      *     changed significantly except the time, iauAper[13] may be used to
27913      *     perform the requisite adjustment to the astrom structure.
27914      *
27915      * </ol>
27916      *  Called:
27917      * <ul>
27918      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27919      *     <li>{@link #jauC2s} p-vector to spherical
27920      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
27921      *
27922      * </ul>
27923      *@version  2013 December 5
27924      *
27925      *@since JSOFA release 20131202
27926      *
27927      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27928      */
27929     public static ObservedPosition jauAtioq(double ri, double di, Astrom astrom)
27930     {
27931         /* Minimum cos(alt) and sin(alt) for refraction purposes */
27932         final double CELMIN = 1e-6;
27933         final double SELMIN = 0.05;
27934 
27935         double v[] = new double[3], x, y, z, sx, cx, sy, cy, xhd, yhd, zhd, f,
27936           xhdt, yhdt, zhdt, xaet, yaet, zaet, azobs, r, tz, w, del,
27937           cosdel, xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
27938 
27939         /*--------------------------------------------------------------------*/
27940 
27941         /* CIRS RA,Dec to Cartesian -HA,Dec. */
27942         v = jauS2c(ri-astrom.eral, di);
27943         x = v[0];
27944         y = v[1];
27945         z = v[2];
27946 
27947         /* Polar motion. */
27948         sx = sin(astrom.xpl);
27949         cx = cos(astrom.xpl);
27950         sy = sin(astrom.ypl);
27951         cy = cos(astrom.ypl);
27952         xhd = cx*x + sx*z;
27953         yhd = sx*sy*x + cy*y - cx*sy*z;
27954         zhd = -sx*cy*x + sy*y + cx*cy*z;
27955 
27956         /* Diurnal aberration. */
27957         f = ( 1.0 - astrom.diurab*yhd );
27958         xhdt = f * xhd;
27959         yhdt = f * ( yhd + astrom.diurab );
27960         zhdt = f * zhd;
27961 
27962         /* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
27963         xaet = astrom.sphi*xhdt - astrom.cphi*zhdt;
27964         yaet = yhdt;
27965         zaet = astrom.cphi*xhdt + astrom.sphi*zhdt;
27966 
27967         /* Azimuth (N=0,E=90). */
27968         azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
27969 
27970         /* ---------- */
27971         /* Refraction */
27972         /* ---------- */
27973 
27974         /* Cosine and sine of altitude, with precautions. */
27975         r = sqrt(xaet*xaet + yaet*yaet);
27976         r = r > CELMIN ? r : CELMIN;
27977         z = zaet > SELMIN ? zaet : SELMIN;
27978 
27979         /* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
27980         tz = r/z;
27981         w = astrom.refb*tz*tz;
27982         del = ( astrom.refa + w ) * tz /
27983                 ( 1.0 + ( astrom.refa + 3.0*w ) / ( z*z ) );
27984 
27985         /* Apply the change, giving observed vector. */
27986         cosdel = 1.0 - del*del/2.0;
27987         f = cosdel - del*z/r;
27988         xaeo = xaet*f;
27989         yaeo = yaet*f;
27990         zaeo = cosdel*zaet + del*r;
27991 
27992         /* Observed ZD. */
27993         zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
27994 
27995         /* Az/El vector to HA,Dec vector (both right-handed). */
27996         v[0] = astrom.sphi*xaeo + astrom.cphi*zaeo;
27997         v[1] = yaeo;
27998         v[2] = - astrom.cphi*xaeo + astrom.sphi*zaeo;
27999 
28000         /* To spherical -HA,Dec. */
28001         SphericalCoordinate co = jauC2s ( v);
28002         hmobs = co.alpha;
28003         dcobs = co.delta;
28004         /* Right ascension (with respect to CIO). */
28005         raobs = astrom.eral + hmobs;
28006 
28007         /* Return the results. */
28008         return new ObservedPosition(
28009         jauAnp(azobs),
28010         zdobs,
28011         -hmobs,
28012         dcobs,
28013         jauAnp(raobs));
28014 
28015         /* Finished. */
28016 
28017 
28018     }
28019 
28020     /**
28021      *  Observed place at a groundbased site to to ICRS astrometric RA,Dec.
28022      *  The caller supplies UTC, site coordinates, ambient air conditions
28023      *  and observing wavelength.
28024      *
28025      *<p>This function is derived from the International Astronomical Union's
28026      *  SOFA (Standards of Fundamental Astronomy) software collection.
28027      *
28028      *<p>Status:  support function.
28029      *
28030      *<!-- Given: -->
28031      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
28032      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
28033      *     @param ob2     double    observed ZD or Dec (radians)
28034      *     @param utc1    double    UTC as a 2-part...
28035      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
28036      *     @param dut1    double    UT1-UTC (seconds, Note 5)
28037      *     @param elong   double    longitude (radians, east +ve, Note 6)
28038      *     @param phi     double    geodetic latitude (radians, Note 6)
28039      *     @param hm      double    height above ellipsoid (m, geodetic Notes 6,8)
28040      *     @param xp double    polar motion coordinates (radians, Note 7)
28041      *     @param yp double    polar motion coordinates (radians, Note 7) 
28042      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
28043      *     @param tc      double    ambient temperature at the observer (deg C)
28044      *     @param rh      double    relative humidity at the observer (range 0-1)
28045      *     @param wl      double    wavelength (micrometers, Note 9)
28046      *
28047      *<!-- Returned:-->
28048      *     @return rc,dc   double     <b>Returned</b> ICRS astrometric RA,Dec (radians)
28049      *
28050      *  @throws JSOFAInternalError an internal error has occured
28051      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 4)
28052      *                               0  =   <b>Returned</b> OK
28053      *                              -1  =   <b>Returned</b> unacceptable date
28054      *
28055      *<p>Notes:
28056      * <ol>
28057      *
28058      *  <li> "Observed" Az,ZD means the position that would be seen by a
28059      *      perfect geodetically aligned theodolite.  (Zenith distance is
28060      *      used rather than altitude in order to reflect the fact that no
28061      *      allowance is made for depression of the horizon.)  This is
28062      *      related to the observed HA,Dec via the standard rotation, using
28063      *      the geodetic latitude (corrected for polar motion), while the
28064      *      observed HA and RA are related simply through the Earth rotation
28065      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
28066      *      means the position that would be seen by a perfect equatorial
28067      *      with its polar axis aligned to the Earth's axis of rotation.
28068      *
28069      *  <li> Only the first character of the type argument is significant.
28070      *      "R" or "r" indicates that ob1 and ob2 are the observed right
28071      *      ascension and declination;  "H" or "h" indicates that they are
28072      *      hour angle (west +ve) and declination;  anything else ("A" or
28073      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
28074      *      (north zero, east 90 deg) and zenith distance.
28075      *
28076      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
28077      *      convenient way between the two arguments, for example where utc1
28078      *      is the Julian Day Number and utc2 is the fraction of a day.
28079      *
28080      *      <p>However, JD cannot unambiguously represent UTC during a leap
28081      *      second unless special measures are taken.  The convention in the
28082      *      present function is that the JD day represents UTC days whether
28083      *      the length is 86399, 86400 or 86401 SI seconds.
28084      *
28085      *      <p>Applications should use the function iauDtf2d to convert from
28086      *      calendar date and time of day into 2-part quasi Julian Date, as
28087      *      it implements the leap-second-ambiguity convention just
28088      *      described.
28089      *
28090      *  <li> The warning status "dubious year" flags UTCs that predate the
28091      *      introduction of the time scale or that are too far in the
28092      *      future to be trusted.  See iauDat for further details.
28093      *
28094      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
28095      *      one second at the end of each positive UTC leap second,
28096      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
28097      *      practice is under review, and in the future UT1-UTC may grow
28098      *      essentially without limit.
28099      *
28100      *  <li> The geographical coordinates are with respect to the WGS84
28101      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
28102      *      longitude required by the present function is east-positive
28103      *      (i.e. right-handed), in accordance with geographical convention.
28104      *
28105      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
28106      *      values are the coordinates (in radians) of the Celestial
28107      *      Intermediate Pole with respect to the International Terrestrial
28108      *      Reference System (see IERS Conventions 2003), measured along the
28109      *      meridians 0 and 90 deg west respectively.  For many
28110      *      applications, xp and yp can be set to zero.
28111      *
28112      *  <li> If hm, the height above the ellipsoid of the observing station
28113      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
28114      *      available, an adequate estimate of hm can be obtained from the
28115      *      expression
28116      *
28117      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
28118      *
28119      *      <p>where tsl is the approximate sea-level air temperature in K
28120      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
28121      *      52).  Similarly, if the pressure phpa is not known, it can be
28122      *      estimated from the height of the observing station, hm, as
28123      *      follows:
28124      *
28125      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
28126      *
28127      *      <p>Note, however, that the refraction is nearly proportional to
28128      *      the pressure and that an accurate phpa value is important for
28129      *      precise work.
28130      *
28131      *  <li> The argument wl specifies the observing wavelength in
28132      *      micrometers.  The transition from optical to radio is assumed to
28133      *      occur at 100 micrometers (about 3000 GHz).
28134      *
28135      *  <li> The accuracy of the result is limited by the corrections for
28136      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28137      *      Providing the meteorological parameters are known accurately and
28138      *      there are no gross local effects, the predicted astrometric
28139      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28140      *      (radio) for a zenith distance of less than 70 degrees, better
28141      *      than 30 arcsec (optical or radio) at 85 degrees and better
28142      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28143      *
28144      *      <p>Without refraction, the complementary functions iauAtco13 and
28145      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
28146      *      all over the celestial sphere.  With refraction included,
28147      *      consistency falls off at high zenith distances, but is still
28148      *      better than 0.05 arcsec at 85 degrees.
28149      *
28150      *  <li> It is advisable to take great care with units, as even unlikely
28151      *      values of the input parameters are accepted and processed in
28152      *      accordance with the models used.
28153      *
28154      * </ol>
28155      *  Called:
28156      * <ul>
28157      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed
28158      *     <li>{@link #jauAtoiq} quick observed to CIRS
28159      *     <li>{@link #jauAticq} quick CIRS to ICRS
28160      *
28161      * </ul>
28162      *@version  2013 October 9
28163      *
28164      *@since JSOFA release 20131202
28165      *
28166      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28167      * @throws JSOFAInternalError an internal error has occured
28168      * @throws JSOFAIllegalParameter unacceptable date.
28169      */
28170     public static SphericalCoordinate jauAtoc13(String type, double ob1, double ob2,
28171             double utc1, double utc2, double dut1,
28172             double elong, double phi, double hm, double xp, double yp,
28173             double phpa, double tc, double rh, double wl
28174             ) throws JSOFAIllegalParameter, JSOFAInternalError
28175     {
28176         Astrom astrom = new Astrom();
28177         jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28178                 phpa, tc, rh, wl, astrom);
28179 
28180         /* Transform observed to CIRS. */
28181         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28182 
28183         /* Transform CIRS to ICRS. */
28184         SphericalCoordinate icrs = jauAticq(co.alpha, co.delta, astrom);
28185         return icrs;
28186        
28187 
28188         /* Finished. */
28189 
28190 
28191     }
28192 
28193     /**
28194      *  Observed place to CIRS.  The caller supplies UTC, site coordinates,
28195      *  ambient air conditions and observing wavelength.
28196      *
28197      *<p>This function is derived from the International Astronomical Union's
28198      *  SOFA (Standards of Fundamental Astronomy) software collection.
28199      *
28200      *<p>Status:  support function.
28201      *
28202      *<!-- Given: -->
28203      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
28204      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
28205      *     @param ob2     double    observed ZD or Dec (radians)
28206      *     @param utc1    double    UTC as a 2-part...
28207      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
28208      *     @param dut1    double    UT1-UTC (seconds, Note 5)
28209      *     @param elong   double    longitude (radians, east +ve, Note 6)
28210      *     @param phi     double    geodetic latitude (radians, Note 6)
28211      *     @param hm      double    height above the ellipsoid (meters, Notes 6,8)
28212      *     @param xp double    polar motion coordinates (radians, Note 7)
28213      *     @param yp double    polar motion coordinates (radians, Note 7) 
28214      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
28215      *     @param tc      double    ambient temperature at the observer (deg C)
28216      *     @param rh      double    relative humidity at the observer (range 0-1)
28217      *     @param wl      double    wavelength (micrometers, Note 9)
28218      *
28219      *<!-- Returned:-->
28220      *     @return ri      double*    <b>Returned</b> CIRS right ascension (CIO-based, radians)
28221      *             di      double*    <b>Returned</b> CIRS declination (radians)
28222      *
28223      *  @throws JSOFAInternalError an internal error has occured
28224      *  @throws JSOFAIllegalParameter int       status:   <b>Returned</b> +1 = dubious year (Note 2)
28225      *                               0  =   <b>Returned</b> OK
28226      *                              -1  =   <b>Returned</b> unacceptable date
28227      *
28228      *<p>Notes:
28229      * <ol>
28230      *
28231      *  <li> "Observed" Az,ZD means the position that would be seen by a
28232      *      perfect geodetically aligned theodolite.  (Zenith distance is
28233      *      used rather than altitude in order to reflect the fact that no
28234      *      allowance is made for depression of the horizon.)  This is
28235      *      related to the observed HA,Dec via the standard rotation, using
28236      *      the geodetic latitude (corrected for polar motion), while the
28237      *      observed HA and RA are related simply through the Earth rotation
28238      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
28239      *      means the position that would be seen by a perfect equatorial
28240      *      with its polar axis aligned to the Earth's axis of rotation.
28241      *
28242      *  <li> Only the first character of the type argument is significant.
28243      *      "R" or "r" indicates that ob1 and ob2 are the observed right
28244      *      ascension and declination;  "H" or "h" indicates that they are
28245      *      hour angle (west +ve) and declination;  anything else ("A" or
28246      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
28247      *      (north zero, east 90 deg) and zenith distance.
28248      *
28249      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
28250      *      convenient way between the two arguments, for example where utc1
28251      *      is the Julian Day Number and utc2 is the fraction of a day.
28252      *
28253      *      <p>However, JD cannot unambiguously represent UTC during a leap
28254      *      second unless special measures are taken.  The convention in the
28255      *      present function is that the JD day represents UTC days whether
28256      *      the length is 86399, 86400 or 86401 SI seconds.
28257      *
28258      *      <p>Applications should use the function iauDtf2d to convert from
28259      *      calendar date and time of day into 2-part quasi Julian Date, as
28260      *      it implements the leap-second-ambiguity convention just
28261      *      described.
28262      *
28263      *  <li> The warning status "dubious year" flags UTCs that predate the
28264      *      introduction of the time scale or that are too far in the
28265      *      future to be trusted.  See iauDat for further details.
28266      *
28267      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
28268      *      one second at the end of each positive UTC leap second,
28269      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
28270      *      practice is under review, and in the future UT1-UTC may grow
28271      *      essentially without limit.
28272      *
28273      *  <li> The geographical coordinates are with respect to the WGS84
28274      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
28275      *      longitude required by the present function is east-positive
28276      *      (i.e. right-handed), in accordance with geographical convention.
28277      *
28278      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
28279      *      values are the coordinates (in radians) of the Celestial
28280      *      Intermediate Pole with respect to the International Terrestrial
28281      *      Reference System (see IERS Conventions 2003), measured along the
28282      *      meridians 0 and 90 deg west respectively.  For many
28283      *      applications, xp and yp can be set to zero.
28284      *
28285      *  <li> If hm, the height above the ellipsoid of the observing station
28286      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
28287      *      available, an adequate estimate of hm can be obtained from the
28288      *      expression
28289      *
28290      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
28291      *
28292      *      <p>where tsl is the approximate sea-level air temperature in K
28293      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
28294      *      52).  Similarly, if the pressure phpa is not known, it can be
28295      *      estimated from the height of the observing station, hm, as
28296      *      follows:
28297      *
28298      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
28299      *
28300      *      <p>Note, however, that the refraction is nearly proportional to
28301      *      the pressure and that an accurate phpa value is important for
28302      *      precise work.
28303      *
28304      *  <li> The argument wl specifies the observing wavelength in
28305      *      micrometers.  The transition from optical to radio is assumed to
28306      *      occur at 100 micrometers (about 3000 GHz).
28307      *
28308      *  <li> The accuracy of the result is limited by the corrections for
28309      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28310      *      Providing the meteorological parameters are known accurately and
28311      *      there are no gross local effects, the predicted astrometric
28312      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28313      *      (radio) for a zenith distance of less than 70 degrees, better
28314      *      than 30 arcsec (optical or radio) at 85 degrees and better
28315      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28316      *
28317      *      <p>Without refraction, the complementary functions iauAtio13 and
28318      *      iauAtoi13 are self-consistent to better than 1 microarcsecond
28319      *      all over the celestial sphere.  With refraction included,
28320      *      consistency falls off at high zenith distances, but is still
28321      *      better than 0.05 arcsec at 85 degrees.
28322      *
28323      *  <li> It is advisable to take great care with units, as even unlikely
28324      *      values of the input parameters are accepted and processed in
28325      *      accordance with the models used.
28326      *
28327      * </ol>
28328      *  Called:
28329      * <ul>
28330      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
28331      *     <li>{@link #jauAtoiq} quick observed to CIRS
28332      *
28333      * </ul>
28334      *@version  2013 October 9
28335      *
28336      *@since JSOFA release 20131202
28337      *
28338      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28339      * @throws JSOFAInternalError an internal error has occured
28340      * @throws JSOFAIllegalParameter unacceptable date.
28341      */
28342     public static SphericalCoordinate jauAtoi13(String type, double ob1, double ob2,
28343             double utc1, double utc2, double dut1,
28344             double elong, double phi, double hm, double xp, double yp,
28345             double phpa, double tc, double rh, double wl
28346             ) throws JSOFAIllegalParameter, JSOFAInternalError
28347     {
28348         Astrom astrom = new Astrom();
28349 
28350 
28351         /* Star-independent astrometry parameters for CIRS->observed. */
28352         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28353                 phpa, tc, rh, wl, astrom);
28354 
28355         /* Transform observed to CIRS. */
28356         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28357         return co;
28358         
28359         /* Finished. */
28360 
28361 
28362     }
28363 
28364     /**
28365      *  Quick observed place to CIRS, given the star-independent astrometry
28366      *  parameters.
28367      * 
28368      *  Use of this function is appropriate when efficiency is important and
28369      *  where many star positions are all to be transformed for one date.
28370      *  The star-independent astrometry parameters can be obtained by
28371      *  calling iauApio[13] or iauApco[13].
28372      *
28373      *<p>Status:  support function.
28374      *
28375      *<!-- Given: -->
28376      *     @param type    char[]      type of coordinates: "R", "H" or "A" (Note 1)
28377      *     @param ob1     double      observed Az, HA or RA (radians; Az is N=0,E=90)
28378      *     @param ob2     double      observed ZD or Dec (radians)
28379      *     @param astrom    star-independent astrometry parameters:
28380      *
28381      *<!-- Returned:-->
28382      *     @return ri      double*      <b>Returned</b> CIRS right ascension (CIO-based, radians)
28383      *             di      double*      <b>Returned</b> CIRS declination (radians)
28384      *
28385      *<p>Notes:
28386      * <ol>
28387      *
28388      *  <li> "Observed" Az,El means the position that would be seen by a
28389      *     perfect geodetically aligned theodolite.  This is related to
28390      *     the observed HA,Dec via the standard rotation, using the geodetic
28391      *     latitude (corrected for polar motion), while the observed HA and
28392      *     RA are related simply through the Earth rotation angle and the
28393      *     site longitude.  "Observed" RA,Dec or HA,Dec thus means the
28394      *     position that would be seen by a perfect equatorial with its
28395      *     polar axis aligned to the Earth's axis of rotation.  By removing
28396      *     from the observed place the effects of atmospheric refraction and
28397      *     diurnal aberration, the CIRS RA,Dec is obtained.
28398      *
28399      *  <li> Only the first character of the type argument is significant.
28400      *     "R" or "r" indicates that ob1 and ob2 are the observed right
28401      *     ascension and declination;  "H" or "h" indicates that they are
28402      *     hour angle (west +ve) and declination;  anything else ("A" or
28403      *     "a" is recommended) indicates that ob1 and ob2 are azimuth (north
28404      *     zero, east 90 deg) and zenith distance.  (Zenith distance is used
28405      *     rather than altitude in order to reflect the fact that no
28406      *     allowance is made for depression of the horizon.)
28407      *
28408      *  <li> The accuracy of the result is limited by the corrections for
28409      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28410      *     Providing the meteorological parameters are known accurately and
28411      *     there are no gross local effects, the predicted intermediate
28412      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28413      *     (radio) for a zenith distance of less than 70 degrees, better
28414      *     than 30 arcsec (optical or radio) at 85 degrees and better than
28415      *     20 arcmin (optical) or 25 arcmin (radio) at the horizon.
28416      *
28417      *     <p>Without refraction, the complementary functions iauAtioq and
28418      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
28419      *     over the celestial sphere.  With refraction included, consistency
28420      *     falls off at high zenith distances, but is still better than
28421      *     0.05 arcsec at 85 degrees.
28422      *
28423      *  <li> It is advisable to take great care with units, as even unlikely
28424      *     values of the input parameters are accepted and processed in
28425      *     accordance with the models used.
28426      *
28427      * </ol>
28428      *  Called:
28429      * <ul>
28430      *     <li>{@link #jauS2c} spherical coordinates to unit vector
28431      *     <li>{@link #jauC2s} p-vector to spherical
28432      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
28433      *
28434      * </ul>
28435      *@version  2013 October 9
28436      *
28437      *@since JSOFA release 20131202
28438      *
28439      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28440      */
28441     public static SphericalCoordinate jauAtoiq(String type,
28442             double ob1, double ob2, Astrom astrom
28443             )
28444     {
28445         /** Minimum sin(alt) for refraction purposes */
28446         final double SELMIN = 0.05;
28447         char c;
28448         double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[] = new double[3],
28449         xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref,
28450         zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda,
28451         f, xhd, yhd, zhd, sx, cx, sy, cy, hma;
28452 
28453 
28454         /* Coordinate type. */
28455         c = type.charAt(0);
28456 
28457         /* Coordinates. */
28458         c1 = ob1;
28459         c2 = ob2;
28460 
28461         /* Sin, cos of latitude. */
28462         sphi = astrom.sphi;
28463         cphi = astrom.cphi;
28464 
28465         /* Standardize coordinate type. */
28466         if ( c == 'r' || c == 'R' ) {
28467             c = 'R';
28468         } else if ( c == 'h' || c == 'H' ) {
28469             c = 'H';
28470         } else {
28471             c = 'A';
28472         }
28473 
28474         /* If Az,ZD, convert to Cartesian (S=0,E=90). */
28475         if ( c == 'A' ) {
28476             ce = sin(c2);
28477             xaeo = - cos(c1) * ce;
28478             yaeo = sin(c1) * ce;
28479             zaeo = cos(c2);
28480 
28481         } else {
28482 
28483             /* If RA,Dec, convert to HA,Dec. */
28484             if ( c == 'R' ) c1 = astrom.eral - c1;
28485 
28486             /* To Cartesian -HA,Dec. */
28487             v = jauS2c ( -c1, c2 );
28488             xmhdo = v[0];
28489             ymhdo = v[1];
28490             zmhdo = v[2];
28491 
28492             /* To Cartesian Az,El (S=0,E=90). */
28493             xaeo = sphi*xmhdo - cphi*zmhdo;
28494             yaeo = ymhdo;
28495             zaeo = cphi*xmhdo + sphi*zmhdo;
28496         }
28497 
28498         /* Azimuth (S=0,E=90). */
28499         az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0;
28500 
28501         /* Sine of observed ZD, and observed ZD. */
28502         sz = sqrt ( xaeo*xaeo + yaeo*yaeo );
28503         zdo = atan2 ( sz, zaeo );
28504 
28505         /*
28506          * Refraction
28507          * ----------
28508          */
28509 
28510         /* Fast algorithm using two constant model. */
28511         refa = astrom.refa;
28512         refb = astrom.refb;
28513         tz = sz / ( zaeo > SELMIN ? zaeo : SELMIN );
28514         dref = ( refa + refb*tz*tz ) * tz;
28515         zdt = zdo + dref;
28516 
28517         /* To Cartesian Az,ZD. */
28518         ce = sin(zdt);
28519         xaet = cos(az) * ce;
28520         yaet = sin(az) * ce;
28521         zaet = cos(zdt);
28522 
28523         /* Cartesian Az,ZD to Cartesian -HA,Dec. */
28524         xmhda = sphi*xaet + cphi*zaet;
28525         ymhda = yaet;
28526         zmhda = - cphi*xaet + sphi*zaet;
28527 
28528         /* Diurnal aberration. */
28529         f = ( 1.0 + astrom.diurab*ymhda );
28530         xhd = f * xmhda;
28531         yhd = f * ( ymhda - astrom.diurab );
28532         zhd = f * zmhda;
28533 
28534         /* Polar motion. */
28535         sx = sin(astrom.xpl);
28536         cx = cos(astrom.xpl);
28537         sy = sin(astrom.ypl);
28538         cy = cos(astrom.ypl);
28539         v[0] = cx*xhd + sx*sy*yhd - sx*cy*zhd;
28540         v[1] = cy*yhd + sy*zhd;
28541         v[2] = sx*xhd - cx*sy*yhd + cx*cy*zhd;
28542 
28543         /* To spherical -HA,Dec. */
28544         SphericalCoordinate co = jauC2s(v);
28545 
28546         /* Right ascension. */
28547         co.alpha = jauAnp(astrom.eral + co.alpha);
28548 
28549         return co;
28550         /* Finished. */
28551 
28552 
28553     }
28554 
28555     /**
28556      *  Apply light deflection by a solar-system body, as part of
28557      *  transforming coordinate direction into natural direction.
28558      *
28559      *<p>This function is derived from the International Astronomical Union's
28560      *  SOFA (Standards of Fundamental Astronomy) software collection.
28561      *
28562      *<p>Status:  support function.
28563      *
28564      *<!-- Given: -->
28565      *     @param bm      double      mass of the gravitating body (solar masses)
28566      *     @param p       double[3]   direction from observer to source (unit vector)
28567      *     @param q       double[3]   direction from body to source (unit vector)
28568      *     @param e       double[3]   direction from body to observer (unit vector)
28569      *     @param em      double      distance from body to observer (au)
28570      *     @param dlim    double      deflection limiter (Note 4)
28571      *
28572      *<!-- Returned:-->
28573      *     @return p1      double[3]    <b>Returned</b> observer to deflected source (unit vector)
28574      *
28575      *<p>Notes:
28576      * <ol>
28577      *
28578      *  <li> The algorithm is based on Expr. (70) in Klioner (2003) and
28579      *     Expr. (7.63) in the Explanatory Supplement (Urban &amp; Seidelmann
28580      *     2013), with some rearrangement to minimize the effects of machine
28581      *     precision.
28582      *
28583      *  <li> The mass parameter bm can, as required, be adjusted in order to
28584      *     allow for such effects as quadrupole field.
28585      *
28586      *  <li> The barycentric position of the deflecting body should ideally
28587      *     correspond to the time of closest approach of the light ray to
28588      *     the body.
28589      *
28590      *  <li> The deflection limiter parameter dlim is phi^2/2, where phi is
28591      *     the angular separation (in radians) between source and body at
28592      *     which limiting is applied.  As phi shrinks below the chosen
28593      *     threshold, the deflection is artificially reduced, reaching zero
28594      *     for phi = 0.
28595      *
28596      *  <li> The returned vector p1 is not normalized, but the consequential
28597      *     departure from unit magnitude is always negligible.
28598      *
28599      *  <li> The arguments p and p1 can be the same array.
28600      *
28601      *  <li> To accumulate total light deflection taking into account the
28602      *     contributions from several bodies, call the present function for
28603      *     each body in succession, in decreasing order of distance from the
28604      *     observer.
28605      *
28606      *  <li> For efficiency, validation is omitted.  The supplied vectors must
28607      *     be of unit magnitude, and the deflection limiter non-zero and
28608      *     positive.
28609      *
28610      * </ol>
28611      *<p>References:
28612      * <ul>
28613      *
28614      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28615      *     the Astronomical Almanac, 3rd ed., University Science Books
28616      *     (2013).
28617      *
28618      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
28619      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
28620      *
28621      * </ul>
28622      *  Called:
28623      * <ul>
28624      *     <li>{@link #jauPdp} scalar product of two p-vectors
28625      *     <li>{@link #jauPxp} vector product of two p-vectors
28626      *
28627      * </ul>
28628      *@version  2013 October 9
28629      *
28630      *@since JSOFA release 20131202
28631      *
28632      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28633      */
28634     public static double[] jauLd(double bm, double p[], double q[], double e[],
28635             double em, double dlim)
28636     {
28637         int i;
28638         double qpe[] = new double[3], qdqpe, w, eq[], peq[] ;
28639 
28640         double p1[] = new double[3];
28641 
28642         /* q . (q + e). */
28643         for (i = 0; i < 3; i++) {
28644             qpe[i] = q[i] + e[i];
28645         }
28646         qdqpe = jauPdp(q, qpe);
28647 
28648         /* 2 x G x bm / ( em x c^2 x ( q . (q + e) ) ). */
28649         w = bm * SRS / em / max(qdqpe,dlim);
28650 
28651         /* p x (e x q). */
28652         eq = jauPxp(e, q);
28653         peq = jauPxp(p, eq);
28654 
28655         /* Apply the deflection. */
28656         for (i = 0; i < 3; i++) {
28657             p1[i] = p[i] + w*peq[i];
28658         }
28659 
28660         return p1;
28661         /* Finished. */
28662 
28663 
28664     }
28665 
28666     /*+
28667      *  - - - - - - -
28668      *   i a u L d n
28669      *  - - - - - - -
28670      *
28671      *  For a star, apply light deflection by multiple solar-system bodies,
28672      *  as part of transforming coordinate direction into natural direction.
28673      *
28674      *<p>This function is derived from the International Astronomical Union's
28675      *  SOFA (Standards of Fundamental Astronomy) software collection.
28676      *
28677      *<p>Status:  support function.
28678      *
28679      *<!-- Given: -->
28680      *     n    int           number of bodies (note 1)
28681      *     b    jauLDBODY[n]  data for each of the n bodies (Notes 1,2):
28682      *      bm   double         mass of the body (solar masses, Note 3)
28683      *      dl   double         deflection limiter (Note 4)
28684      *      pv   [2][3]         barycentric PV of the body (au, au/day)
28685      *     ob   double[3]     barycentric position of the observer (au)
28686      *     sc   double[3]     observer to star coord direction (unit vector)
28687      *
28688      *<!-- Returned:-->
28689      *     sn    double[3]      observer to deflected star (unit vector)
28690      *
28691      *  <li> The array b contains n entries, one for each body to be
28692      *     considered.  If n = 0, no gravitational light deflection will be
28693      *     applied, not even for the Sun.
28694      *
28695      *  <li> The array b should include an entry for the Sun as well as for
28696      *     any planet or other body to be taken into account.  The entries
28697      *     should be in the order in which the light passes the body.
28698      *
28699      *  <li> In the entry in the b array for body i, the mass parameter
28700      *     b[i].bm can, as required, be adjusted in order to allow for such
28701      *     effects as quadrupole field.
28702      *
28703      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
28704      *     the angular separation (in radians) between star and body at
28705      *     which limiting is applied.  As phi shrinks below the chosen
28706      *     threshold, the deflection is artificially reduced, reaching zero
28707      *     for phi = 0.   Example values suitable for a terrestrial
28708      *     observer, together with masses, are as follows:
28709      *
28710      *        body i     b[i].bm        b[i].dl
28711      *
28712      *        Sun        1.0            6e-6
28713      *        Jupiter    0.00095435     3e-9
28714      *        Saturn     0.00028574     3e-10
28715      *
28716      *  <li> For cases where the starlight passes the body before reaching the
28717      *     observer, the body is placed back along its barycentric track by
28718      *     the light time from that point to the observer.  For cases where
28719      *     the body is "behind" the observer no such shift is applied.  If
28720      *     a different treatment is preferred, the user has the option of
28721      *     instead using the iauLd function.  Similarly, iauLd can be used
28722      *     for cases where the source is nearby, not a star.
28723      *
28724      *  <li> The returned vector sn is not normalized, but the consequential
28725      *     departure from unit magnitude is always negligible.
28726      *
28727      *  <li> The arguments sc and sn can be the same array.
28728      *
28729      *  <li> For efficiency, validation is omitted.  The supplied masses must
28730      *     be greater than zero, the position and velocity vectors must be
28731      *     right, and the deflection limiter greater than zero.
28732      *
28733      *  Reference:
28734      *
28735      *     Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28736      *     the Astronomical Almanac, 3rd ed., University Science Books
28737      *     (2013), Section 7.2.4.
28738      *
28739      *  Called:
28740      *     iauCp        copy p-vector
28741      *     iauPdp       scalar product of two p-vectors
28742      *     iauPmp       p-vector minus p-vector
28743      *     iauPpsp      p-vector plus scaled p-vector
28744      *     iauPn        decompose p-vector into modulus and direction
28745      *     iauLd        light deflection by a solar-system body
28746      *
28747      *@version  2013 October 9
28748      *
28749      *@since JSOFA release 20131202
28750      *
28751      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28752      */
28753     public static double[] jauLdn(int n, Ldbody b[], double ob[], double sc[])
28754     {
28755         /* Light time for 1 au (days) */
28756         final double CR = AULT/DAYSEC;
28757 
28758         int i;
28759         double v[] , dt, ev[], sn[] = new double[3];
28760 
28761 
28762         /* Star direction prior to deflection. */
28763         jauCp(sc, sn);
28764 
28765         /* Body by body. */
28766         for ( i = 0; i < n; i++ ) {
28767 
28768             /* Body to observer vector at epoch of observation (au). */
28769             v = jauPmp( ob, b[i].pv[0]);
28770 
28771             /* Minus the time since the light passed the body (days). */
28772             dt = jauPdp(sn,v) * CR;
28773 
28774             /* Neutralize if the star is "behind" the observer. */
28775             dt = min(dt, 0.0);
28776 
28777             /* Backtrack the body to the time the light was passing the body. */
28778             ev = jauPpsp(v, -dt, b[i].pv[1]);
28779 
28780             /* Body to observer vector as magnitude and direction. */
28781             NormalizedVector nv = jauPn(ev);
28782             
28783             /* Apply light deflection for this body. */
28784             sn = jauLd( b[i].bm, sn, sn, nv.u, nv.r, b[i].dl );
28785 
28786             /* Next body. */
28787         }
28788         return sn;
28789 
28790         /* Finished. */
28791 
28792 
28793     }
28794 
28795     /**
28796      *   Deflection of starlight by the Sun.
28797      *
28798      *<p>This function is derived from the International Astronomical Union's
28799      *  SOFA (Standards of Fundamental Astronomy) software collection.
28800      *
28801      *<p>Status:  support function.
28802      *
28803      *<!-- Given: -->
28804      *     @param p       double[3]   direction from observer to star (unit vector)
28805      *     @param e       double[3]   direction from Sun to observer (unit vector)
28806      *     @param em      double      distance from Sun to observer (au)
28807      *
28808      *<!-- Returned:-->
28809      *     @return p1      double[3]    <b>Returned</b> observer to deflected start (unit vector)
28810      *
28811      *<p>Notes:
28812      * <ol>
28813      *
28814      *  <li> The source is presumed to be sufficiently distant that its
28815      *     directions seen from the Sun and the observer are essentially
28816      *     the same.
28817      *
28818      *  <li> The deflection is restrained when the angle between the star and
28819      *     the center of the Sun is less than a threshold value, falling to
28820      *     zero deflection for zero separation.  The chosen threshold value
28821      *     is within the solar limb for all solar-system applications, and
28822      *     is about 5 arcminutes for the case of a terrestrial observer.
28823      *
28824      *  <li> The arguments p and p1 can be the same array.
28825      *
28826      * </ol>
28827      *  Called:
28828      * <ul>
28829      *     <li>{@link #jauLd} light deflection by a solar-system body
28830      *
28831      * </ul>
28832      *@version  2016 July 29
28833      *
28834      *@since JSOFA release 20131202
28835      *
28836      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28837      */
28838     public static double[] jauLdsun(double p[], double e[], double em)
28839     {
28840         double em2, dlim;
28841 
28842 
28843         /* Deflection limiter (smaller for distant observers). */
28844         em2 = em*em;
28845         if ( em2 < 1.0 ) em2 = 1.0;
28846         dlim = 1e-6 / (em2 > 1.0 ? em2 : 1.0);
28847         
28848         /* Apply the deflection. */
28849         return jauLd(1.0, p, p, e, em, dlim);
28850 
28851     }
28852 
28853     /**
28854      *  Proper motion and parallax.
28855      *
28856      *<p>This function is derived from the International Astronomical Union's
28857      *  SOFA (Standards of Fundamental Astronomy) software collection.
28858      *
28859      *<p>Status:  support function.
28860      *
28861      *<!-- Given: -->
28862      *     @param rc double      ICRS RA,Dec at catalog epoch (radians)
28863      *     @param dc double      ICRS RA,Dec at catalog epoch (radians) 
28864      *     @param pr      double      RA proper motion (radians/year; Note 1)
28865      *     @param pd      double      Dec proper motion (radians/year)
28866      *     @param px      double      parallax (arcsec)
28867      *     @param rv      double      radial velocity (km/s, +ve if receding)
28868      *     @param pmt     double      proper motion time interval (SSB, Julian years)
28869      *     @param pob     double[3]   SSB to observer vector (au)
28870      *
28871      *<!-- Returned:-->
28872      *     @return pco     double[3]    <b>Returned</b> coordinate direction (BCRS unit vector)
28873      *
28874      *<p>Notes:
28875      * <ol>
28876      *
28877      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
28878      *
28879      *  <li> The proper motion time interval is for when the starlight
28880      *     reaches the solar system barycenter.
28881      *
28882      *  <li> To avoid the need for iteration, the Roemer effect (i.e. the
28883      *     small annual modulation of the proper motion coming from the
28884      *     changing light time) is applied approximately, using the
28885      *     direction of the star at the catalog epoch.
28886      *
28887      * </ol>
28888      *<p>References:
28889      * <ul>
28890      *
28891      * <li> 1984 Astronomical Almanac, pp B39-B41.
28892      *
28893      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28894      *     the Astronomical Almanac, 3rd ed., University Science Books
28895      *     (2013), Section 7.2.
28896      *
28897      * </ul>
28898      *  Called:
28899      * <ul>
28900      *     <li>{@link #jauPdp} scalar product of two p-vectors
28901      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
28902      *
28903      * </ul>
28904      *@version  2013 October 9
28905      *
28906      *@since JSOFA release 20131202
28907      *
28908      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28909      */
28910     public static double[] jauPmpx(double rc, double dc, double pr, double pd,
28911             double px, double rv, double pmt, double pob[]
28912             )
28913     {
28914         /* Km/s to au/year */
28915         final double VF = DAYSEC*DJM/DAU;
28916 
28917         /* Light time for 1 au, Julian years */
28918         final double AULTY = AULT/DAYSEC/DJY;
28919 
28920         int i;
28921         double sr, cr, sd, cd, x, y, z, p[] = new double[3], dt, pxr, w, pdz, pm[] = new double[3];
28922 
28923 
28924         /* Spherical coordinates to unit vector (and useful functions). */
28925         sr = sin(rc);
28926         cr = cos(rc);
28927         sd = sin(dc);
28928         cd = cos(dc);
28929         p[0] = x = cr*cd;
28930         p[1] = y = sr*cd;
28931         p[2] = z = sd;
28932 
28933         /* Proper motion time interval (y) including Roemer effect. */
28934         dt = pmt + jauPdp(p,pob)*AULTY;
28935 
28936         /* Space motion (radians per year). */
28937         pxr = px * DAS2R;
28938         w = VF * rv * pxr;
28939         pdz = pd * z;
28940         pm[0] = - pr*y - pdz*cr + w*x;
28941         pm[1] =   pr*x - pdz*sr + w*y;
28942         pm[2] =   pd*cd + w*z;
28943 
28944         /* Coordinate direction of star (unit vector, BCRS). */
28945         for (i = 0; i < 3; i++) {
28946             p[i] += dt*pm[i] - pxr*pob[i];
28947         }
28948         NormalizedVector pco = jauPn(p);
28949 
28950         return pco.u;
28951         /* Finished. */
28952 
28953 
28954     }
28955 
28956     /**
28957      *  Star proper motion:  update star catalog data for space motion, with
28958      *  special handling to handle the zero parallax case.
28959      *
28960      *<p>This function is derived from the International Astronomical Union's
28961      *  SOFA (Standards of Fundamental Astronomy) software collection.
28962      *
28963      *<p>Status:  support function.
28964      *
28965      *<!-- Given: -->
28966      *     @param ra1     double       right ascension (radians), before
28967      *     @param dec1    double       declination (radians), before
28968      *     @param pmr1    double       RA proper motion (radians/year), before
28969      *     @param pmd1    double       Dec proper motion (radians/year), before
28970      *     @param px1     double       parallax (arcseconds), before
28971      *     @param rv1     double       radial velocity (km/s, +ve = receding), before
28972      *     @param ep1a    double       "before" epoch, part A (Note 1)
28973      *     @param ep1b    double       "before" epoch, part B (Note 1)
28974      *     @param ep2a    double       "after" epoch, part A (Note 1)
28975      *     @param ep2b    double       "after" epoch, part B (Note 1)
28976      *
28977      *<!-- Returned:-->
28978      *     @return ra2     double        <b>Returned</b> right ascension (radians), after
28979      *             dec2    double        <b>Returned</b> declination (radians), after
28980      *             pmr2    double        <b>Returned</b> RA proper motion (radians/year), after
28981      *             pmd2    double        <b>Returned</b> Dec proper motion (radians/year), after
28982      *             px2     double        <b>Returned</b> parallax (arcseconds), after
28983      *             rv2     double        <b>Returned</b> radial velocity (km/s, +ve = receding), after
28984      *
28985      *  
28986      *  @throws JSOFAInternalError          int         status:
28987      *                         -1  =   <b>Returned</b> system error (should not occur)
28988      *                          0  =   <b>Returned</b> no warnings or errors
28989      *                          1  =   <b>Returned</b> distance overridden (Note 6)
28990      *                          2  =   <b>Returned</b> excessive velocity (Note 7)
28991      *                          4  =   <b>Returned</b> solution didn't converge (Note 8)
28992      *                        else  =   <b>Returned</b> binary logical OR of the above warnings
28993      *
28994      *<p>Notes:
28995      * <ol>
28996      *
28997      *  <li> The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are
28998      *     Julian Dates, apportioned in any convenient way between the two
28999      *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
29000      *     expressed in any of these ways, among others:
29001      *
29002      *            <p>epNa            epNb
29003      *
29004      *         2450123.7           0.0       (JD method)
29005      *         2451545.0       -1421.3       (J2000 method)
29006      *         2400000.5       50123.2       (MJD method)
29007      *         2450123.5           0.2       (date &amp; time method)
29008      *
29009      *     <p>The JD method is the most natural and convenient to use in cases
29010      *     where the loss of several decimal digits of resolution is
29011      *     acceptable.  The J2000 method is best matched to the way the
29012      *     argument is handled internally and will deliver the optimum
29013      *     resolution.  The MJD method and the date &amp; time methods are both
29014      *     good compromises between resolution and convenience.
29015      *
29016      *  <li> In accordance with normal star-catalog conventions, the object's
29017      *     right ascension and declination are freed from the effects of
29018      *     secular aberration.  The frame, which is aligned to the catalog
29019      *     equator and equinox, is Lorentzian and centered on the SSB.
29020      *
29021      *     <p>The proper motions are the rate of change of the right ascension
29022      *     and declination at the catalog epoch and are in radians per TDB
29023      *     Julian year.
29024      *
29025      *     <p>The parallax and radial velocity are in the same frame.
29026      *
29027      *  <li> Care is needed with units.  The star coordinates are in radians
29028      *     and the proper motions in radians per Julian year, but the
29029      *     parallax is in arcseconds.
29030      *
29031      *  <li> The RA proper motion is in terms of coordinate angle, not true
29032      *     angle.  If the catalog uses arcseconds for both RA and Dec proper
29033      *     motions, the RA proper motion will need to be divided by cos(Dec)
29034      *     before use.
29035      *
29036      *  <li> Straight-line motion at constant speed, in the inertial frame, is
29037      *     assumed.
29038      *
29039      *  <li> An extremely small (or zero or negative) parallax is overridden
29040      *     to ensure that the object is at a finite but very large distance,
29041      *     but not so large that the proper motion is equivalent to a large
29042      *     but safe speed (about 0.1c using the chosen constant).  A warning
29043      *     status of 1 is added to the status if this action has been taken.
29044      *
29045      *  <li> If the space velocity is a significant fraction of c (see the
29046      *     constant VMAX in the function iauStarpv), it is arbitrarily set
29047      *     to zero.  When this action occurs, 2 is added to the status.
29048      *
29049      *  <li> The relativistic adjustment carried out in the iauStarpv function
29050      *     involves an iterative calculation.  If the process fails to
29051      *     converge within a set number of iterations, 4 is added to the
29052      *     status.
29053      *
29054      * </ol>
29055      *  Called:
29056      * <ul>
29057      *     <li>{@link #jauSeps} angle between two points
29058      *     <li>{@link #jauStarpm} update star catalog data for space motion
29059      *
29060      * </ul>
29061      *@version  2013 October 9
29062      *
29063      *@since JSOFA release 20131202
29064      *
29065      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29066      * @throws JSOFAInternalError an internal error has occured
29067      */
29068     public static CatalogCoords jauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
29069             double px1, double rv1,
29070             double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
29071     {
29072 
29073         /* Minimum allowed parallax (arcsec) */
29074         final double PXMIN = 5e-7;
29075 
29076         /* Factor giving maximum allowed transverse speed of about 1% c */
29077         final double F = 326.0;
29078 
29079         double pm, px1a;
29080 
29081 
29082         /* Proper motion in one year (radians). */
29083         pm = jauSeps(ra1, dec1, ra1+pmr1, dec1+pmd1);
29084 
29085         
29086         px1a = px1;
29087         pm *= F;
29088         if (px1a < pm) {px1a = pm;}
29089         if (px1a < PXMIN) {px1a = PXMIN;}
29090 
29091         /* Carry out the transformation using the modified parallax. */
29092         return jauStarpm(ra1, dec1, pmr1, pmd1, px1a, rv1,
29093                 ep1a, ep1b, ep2a, ep2b);
29094 
29095          /* Finished. */
29096 
29097 
29098     }
29099 
29100     /**
29101      *  Position and velocity of a terrestrial observing station.
29102      *
29103      *<p>This function is derived from the International Astronomical Union's
29104      *  SOFA (Standards of Fundamental Astronomy) software collection.
29105      *
29106      *<p>Status:  support function.
29107      *
29108      *<!-- Given: -->
29109      *     @param elong    double        longitude (radians, east +ve, Note 1)
29110      *     @param phi      double        latitude (geodetic, radians, Note 1)
29111      *     @param hm       double        height above ref. ellipsoid (geodetic, m)
29112      *     @param xp double        coordinates of the pole (radians, Note 2)
29113      *     @param yp double        coordinates of the pole (radians, Note 2) 
29114      *     @param sp       double        the TIO locator s' (radians, Note 2)
29115      *     @param theta    double        Earth rotation angle (radians, Note 3)
29116      *
29117      *<!-- Returned:-->
29118      *     @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
29119      *
29120      *<p>Notes:
29121      * <ol>
29122      *
29123      *  <li> The terrestrial coordinates are with respect to the WGS84
29124      *     reference ellipsoid.
29125      *
29126      *  <li> xp and yp are the coordinates (in radians) of the Celestial
29127      *     Intermediate Pole with respect to the International Terrestrial
29128      *     Reference System (see IERS Conventions), measured along the
29129      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
29130      *     s', in radians, which positions the Terrestrial Intermediate
29131      *     Origin on the equator.  For many applications, xp, yp and
29132      *     (especially) sp can be set to zero.
29133      *
29134      *  <li> If theta is Greenwich apparent sidereal time instead of Earth
29135      *     rotation angle, the result is with respect to the true equator
29136      *     and equinox of date, i.e. with the x-axis at the equinox rather
29137      *     than the celestial intermediate origin.
29138      *
29139      *  <li> The velocity units are meters per UT1 second, not per SI second.
29140      *     This is unlikely to have any practical consequences in the modern
29141      *     era.
29142      *
29143      *  <li> No validation is performed on the arguments.  Error cases that
29144      *     could lead to arithmetic exceptions are trapped by the iauGd2gc
29145      *     function, and the result set to zeros.
29146      *
29147      * </ol>
29148      *<p>References:
29149      * <ul>
29150      *
29151      * <li> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
29152      *     IERS Technical Note No. 32, BKG (2004)
29153      *
29154      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
29155      *     the Astronomical Almanac, 3rd ed., University Science Books
29156      *     (2013), Section 7.4.3.3.
29157      *
29158      * </ul>
29159      *  Called:
29160      * <ul>
29161      *     <li>{@link #jauGd2gc} geodetic to geocentric transformation
29162      *     <li>{@link #jauPom00} polar motion matrix
29163      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
29164      *
29165      * </ul>
29166      *@version  2013 October 9
29167      *
29168      * @since JSOFA release 20131202
29169      *
29170      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29171      * @throws JSOFAInternalError an internal error has occured
29172      * @throws JSOFAIllegalParameter unacceptable date.
29173      */
29174     public static double [][] jauPvtob(double elong, double phi, double hm,
29175             double xp, double yp, double sp, double theta
29176             ) throws JSOFAIllegalParameter, JSOFAInternalError
29177     {
29178 
29179         double xyzm[];
29180 
29181         /* Geodetic to geocentric transformation (WGS84). */
29182         xyzm = jauGd2gc(1, elong, phi, hm);
29183 
29184         return jauPvtob(xyzm, xp, yp, sp, theta );
29185         /* Finished. */
29186 
29187 
29188     }
29189     
29190     /**
29191      * Alternative Position and velocity of a terrestrial observing station with observatory position already in cartesian.
29192      * @see JSOFA#jauPvtob(double, double, double, double, double, double, double) for more detail.
29193      * @param xyzm observatory geocentric position in metres.
29194      * @param xp double        coordinates of the pole (radians, Note 2)
29195      * @param yp double        coordinates of the pole (radians, Note 2) 
29196      * @param sp       double        the TIO locator s' (radians, Note 2)
29197      * @param theta    double        Earth rotation angle (radians, Note 3)
29198      * @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
29199      * @throws JSOFAIllegalParameter unacceptable date.
29200      * @throws JSOFAInternalError an internal error has occured
29201      */
29202     public static double [][] jauPvtob(double xyzm[],
29203             double xp, double yp, double sp, double theta
29204             ) throws JSOFAIllegalParameter, JSOFAInternalError
29205     {
29206         /* Earth rotation rate in radians per UT1 second */
29207         final double OM = 1.00273781191135448 * D2PI / DAYSEC;
29208 
29209         double rpm[][], xyz[], x, y, z, s, c;
29210         double pv[][] = new double[2][3];
29211 
29212       
29213         /* Polar motion and TIO position. */
29214         rpm = jauPom00(xp, yp, sp);
29215         xyz = jauTrxp(rpm, xyzm);
29216         x = xyz[0];
29217         y = xyz[1];
29218         z = xyz[2];
29219 
29220         /* Functions of ERA. */
29221         s = sin(theta);
29222         c = cos(theta);
29223 
29224         /* Position. */
29225         pv[0][0] = c*x - s*y;
29226         pv[0][1] = s*x + c*y;
29227         pv[0][2] = z;
29228 
29229         /* Velocity. */
29230         pv[1][0] = OM * ( -s*x - c*y );
29231         pv[1][1] = OM * (  c*x - s*y );
29232         pv[1][2] = 0.0;
29233 
29234         return pv;
29235         /* Finished. */
29236 
29237 
29238     }
29239 
29240     /**
29241      * constants A and B in the atmospheric refraction model
29242      *  dZ = A tan Z + B tan^3 Z.
29243      *  .
29244      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
29245      * @version $Revision$ $date$
29246      */
29247     public static class RefCos {
29248         /**    refraction coefficient A  */
29249         public double    a ;
29250 
29251         /**    refraction coefficient B  */
29252         public double    b ;
29253         public RefCos(double a, double b) {
29254           this.a = a;
29255           this.b = b;
29256        }
29257        
29258    }
29259 
29260     /**
29261      *  Determine the constants A and B in the atmospheric refraction model
29262      *  dZ = A tan Z + B tan^3 Z.
29263      *
29264      *  Z is the "observed" zenith distance (i.e. affected by refraction)
29265      *  and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
29266      *  zenith distance.
29267      *
29268      *<p>This function is derived from the International Astronomical Union's
29269      *  SOFA (Standards of Fundamental Astronomy) software collection.
29270      *
29271      *<p>Status:  support function.
29272      *
29273      *<!-- Given: -->
29274      *    @param phpa    double     pressure at the observer (hPa = millibar)
29275      *    @param tc      double     ambient temperature at the observer (deg C)
29276      *    @param rh      double     relative humidity at the observer (range 0-1)
29277      *    @param wl      double     wavelength (micrometers)
29278      *
29279      *<!-- Returned:-->
29280      *    @return      <b>Returned</b> tan Z coefficient (radians)
29281      *                 <b>Returned</b> tan^3 Z coefficient (radians)
29282      *
29283      *<p>Notes:
29284      * <ol>
29285      *
29286      *  <li> The model balances speed and accuracy to give good results in
29287      *     applications where performance at low altitudes is not paramount.
29288      *     Performance is maintained across a range of conditions, and
29289      *     applies to both optical/IR and radio.
29290      *
29291      *  <li> The model omits the effects of (i) height above sea level (apart
29292      *     from the reduced pressure itself), (ii) latitude (i.e. the
29293      *     flattening of the Earth), (iii) variations in tropospheric lapse
29294      *     rate and (iv) dispersive effects in the radio.
29295      *
29296      *     <p>The model was tested using the following range of conditions:
29297      *
29298      *       <p>lapse rates 0.0055, 0.0065, 0.0075 deg/meter
29299      *       latitudes 0, 25, 50, 75 degrees
29300      *       heights 0, 2500, 5000 meters ASL
29301      *       pressures mean for height -10% to +5% in steps of 5%
29302      *       temperatures -10 deg to +20 deg with respect to 280 deg at SL
29303      *       relative humidity 0, 0.5, 1
29304      *       wavelengths 0.4, 0.6, ... 2 micron, + radio
29305      *       zenith distances 15, 45, 75 degrees
29306      *
29307      *     <p>The accuracy with respect to raytracing through a model
29308      *     atmosphere was as follows:
29309      *
29310      *                            <p>worst         RMS
29311      *
29312      *       <p>optical/IR           62 mas       8 mas
29313      *       radio               319 mas      49 mas
29314      *
29315      *     <p>For this particular set of conditions:
29316      *
29317      *       <p>lapse rate 0.0065 K/meter
29318      *       latitude 50 degrees
29319      *       sea level
29320      *       pressure 1005 mb
29321      *       temperature 280.15 K
29322      *       humidity 80%
29323      *       wavelength 5740 Angstroms
29324      *
29325      *     <p>the results were as follows:
29326      *
29327      *       <p>ZD       raytrace     iauRefco   Saastamoinen
29328      *
29329      *       10         10.27        10.27        10.27
29330      *       20         21.19        21.20        21.19
29331      *       30         33.61        33.61        33.60
29332      *       40         48.82        48.83        48.81
29333      *       45         58.16        58.18        58.16
29334      *       50         69.28        69.30        69.27
29335      *       55         82.97        82.99        82.95
29336      *       60        100.51       100.54       100.50
29337      *       65        124.23       124.26       124.20
29338      *       70        158.63       158.68       158.61
29339      *       72        177.32       177.37       177.31
29340      *       74        200.35       200.38       200.32
29341      *       76        229.45       229.43       229.42
29342      *       78        267.44       267.29       267.41
29343      *       80        319.13       318.55       319.10
29344      *
29345      *      <p>deg        arcsec       arcsec       arcsec
29346      *
29347      *     <p>The values for Saastamoinen's formula (which includes terms
29348      *     up to tan^5) are taken from Hohenkerk and Sinclair (1985).
29349      *
29350      *  <li> A wl value in the range 0-100 selects the optical/IR case and is
29351      *     wavelength in micrometers.  Any value outside this range selects
29352      *     the radio case.
29353      *
29354      *  <li> Outlandish input parameters are silently limited to
29355      *     mathematically safe values.  Zero pressure is permissible, and
29356      *     causes zeroes to be returned.
29357      *
29358      *  <li> The algorithm draws on several sources, as follows:
29359      *
29360      *     <p>a) The formula for the saturation vapour pressure of water as
29361      *        a function of temperature and temperature is taken from
29362      *        Equations (A4.5-A4.7) of Gill (1982).
29363      *
29364      *     <p>b) The formula for the water vapour pressure, given the
29365      *        saturation pressure and the relative humidity, is from
29366      *        Crane (1976), Equation (2.5.5).
29367      *
29368      *     <p>c) The refractivity of air is a function of temperature,
29369      *        total pressure, water-vapour pressure and, in the case
29370      *        of optical/IR, wavelength.  The formulae for the two cases are
29371      *        developed from Hohenkerk &amp; Sinclair (1985) and Rueger (2002).
29372      *        The IAG (1999) optical refractivity for dry air is used.
29373      *
29374      *     <p>d) The formula for beta, the ratio of the scale height of the
29375      *        atmosphere to the geocentric distance of the observer, is
29376      *        an adaption of Equation (9) from Stone (1996).  The
29377      *        adaptations, arrived at empirically, consist of (i) a small
29378      *        adjustment to the coefficient and (ii) a humidity term for the
29379      *        radio case only.
29380      *
29381      *     <p>e) The formulae for the refraction constants as a function of
29382      *        n-1 and beta are from Green (1987), Equation (4.31).
29383      *
29384      * </ol>
29385      *<p>References:
29386      * <ul>
29387      *
29388      * <li> Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral
29389      *     Atmosphere", Methods of Experimental Physics: Astrophysics 12B,
29390      *     Academic Press, 1976.
29391      *
29392      * <li> Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press,
29393      *     1982.
29394      *
29395      * <li> Green, R.M., "Spherical Astronomy", Cambridge University Press,
29396      *     1987.
29397      *
29398      * <li> Hohenkerk, C.Y., &amp; Sinclair, A.T., NAO Technical Note No. 63,
29399      *     1985.
29400      *     
29401      * <li> IAG Resolutions adopted at the XXIIth General Assembly in
29402      *     Birmingham, 1999, Resolution 3.
29403      *
29404      * <li> Rueger, J.M., "Refractive Index Formulae for Electronic Distance
29405      *     Measurement with Radio and Millimetre Waves", in Unisurv Report
29406      *     S-68, School of Surveying and Spatial Information Systems,
29407      *     University of New South Wales, Sydney, Australia, 2002.
29408      *
29409      * <li> Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996.
29410      *
29411      * </ul>
29412      *@version  2013 October 9
29413      *
29414      *@since JSOFA release 20131202
29415      *
29416      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29417      */
29418     public static RefCos jauRefco(double phpa, double tc, double rh, double wl )
29419     {
29420         boolean optic;
29421         double p, t, r, w, ps, pw, tk, wlsq, gamma, beta;
29422 
29423 
29424         /* Decide whether optical/IR or radio case:  switch at 100 microns. */
29425         optic = ( wl <= 100.0 );
29426 
29427         /* Restrict parameters to safe values. */
29428         t = max ( tc, -150.0 );
29429         t = min ( t, 200.0 );
29430         p = max ( phpa, 0.0 );
29431         p = min ( p, 10000.0 );
29432         r = max ( rh, 0.0 );
29433         r = min ( r, 1.0 );
29434         w = max ( wl, 0.1 );
29435         w = min ( w, 1e6 );
29436 
29437         /* Water vapour pressure at the observer. */
29438         if ( p > 0.0 ) {
29439             ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) /
29440                     ( 1.0 + 0.00412*t ) ) *
29441                     ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t )  );
29442             pw = r * ps / ( 1.0 - (1.0-r)*ps/p );
29443         } else {
29444             pw = 0.0;
29445         }
29446 
29447         /* Refractive index minus 1 at the observer. */
29448         tk = t + 273.15;
29449         if ( optic ) {
29450             wlsq = w * w;
29451             gamma = ( ( 77.53484e-6 +
29452                     ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p
29453                     - 11.2684e-6*pw ) / tk;
29454         } else {
29455             gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk;
29456         }
29457 
29458         /* Formula for beta from Stone, with empirical adjustments. */
29459         beta = 4.4474e-6 * tk;
29460         if ( ! optic ) beta -= 0.0074 * pw * beta;
29461 
29462         /* Refraction constants from Green. */
29463         return new RefCos( gamma * ( 1.0 - beta ),
29464                - gamma * ( beta - gamma / 2.0 ));
29465 
29466         /* Finished. */
29467 
29468 
29469     }
29470  
29471     
29472     /**
29473     *  Transformation from Galactic Coordinates to ICRS.
29474     *
29475     *  This function is derived from the International Astronomical Union's
29476     *  SOFA (Standards of Fundamental Astronomy) software collection.
29477     *
29478     *  <p>Status:  support routine.
29479     *
29480     *  @param   dl     double      galactic longitude (radians)
29481     *  @param   db     double      galactic latitude (radians)
29482     *
29483     *  @return co ICRS right ascension, declination.
29484     *
29485     *  <p>Notes:<ol>
29486     *
29487     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29488     *     respect to the now obsolete reference system FK4 B1950.0.  When
29489     *     interpreting the system in a modern context, several factors have
29490     *     to be taken into account:<ul>
29491     *
29492     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29493     *
29494     *     <li> The distortion of the FK4 proper motion system by differential
29495     *       Galactic rotation.
29496     *
29497     *     <li> The use of the B1950.0 equinox rather than the now-standard
29498     *       J2000.0.
29499     *
29500     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29501     *  </ul>
29502     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29503     *     matrix that transforms directly between ICRS and Galactic
29504     *     coordinates with the above factors taken into account.  The
29505     *     matrix is derived from three angles, namely the ICRS coordinates
29506     *     of the Galactic pole and the longitude of the ascending node of
29507     *     the galactic equator on the ICRS equator.  They are given in
29508     *     degrees to five decimal places and for canonical purposes are
29509     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29510     *     elements are given to 10 decimal places (about 20 microarcsec).
29511     *     In the present SOFA function the matrix elements have been
29512     *     recomputed from the canonical three angles and are given to 30
29513     *     decimal places.
29514     *
29515     *  <li> The inverse transformation is performed by the function jauIcrs2g.
29516     *  </ol>
29517     *
29518     *  Reference:
29519     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29520     *     catalogues.  Astrometric and photometric star catalogues
29521     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29522     *     Publications Division, Noordwijk, Netherlands.
29523     *
29524     *  @version  2015 March 02
29525     * 
29526     *
29527     *  @since JSOFA release 20150209
29528     *
29529     */
29530     public static SphericalCoordinate jauG2icrs ( double dl, double db)
29531     {
29532        double v1[], v2[];
29533 
29534     /*
29535     *  L2,B2 system of galactic coordinates in the form presented in the
29536     *  Hipparcos Catalogue.  In degrees:
29537     *
29538     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29539     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29540     *  R =  32.93192    Galactic longitude of the ascending node of
29541     *                   the Galactic equator on the ICRS equator
29542     *
29543     *  ICRS to galactic rotation matrix, obtained by computing
29544     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29545     */
29546        double r[][]  = new double[][]{ { -0.054875560416215368492398900454,
29547                             -0.873437090234885048760383168409,
29548                             -0.483835015548713226831774175116 },
29549                           { +0.494109427875583673525222371358,
29550                             -0.444829629960011178146614061616,
29551                             +0.746982244497218890527388004556 },
29552                           { -0.867666149019004701181616534570,
29553                             -0.198076373431201528180486091412,
29554                             +0.455983776175066922272100478348 } };
29555 
29556 
29557     /* Spherical to Cartesian. */
29558        v1 = jauS2c(dl, db);
29559 
29560     /* Galactic to ICRS. */
29561        v2 = jauTrxp(r, v1);
29562 
29563     /* Cartesian to spherical. */
29564        SphericalCoordinate co = jauC2s(v2);
29565 
29566     /* Express in conventional ranges. */
29567        co.alpha = jauAnp(co.alpha);
29568        co.delta = jauAnpm(co.delta);
29569 
29570     /* Finished. */
29571       return co;
29572     }
29573  
29574     
29575     
29576     /**
29577     *  Transformation from ICRS to Galactic Coordinates.
29578     *
29579     *  This function is derived from the International Astronomical Union's
29580     *  SOFA (Standards of Fundamental Astronomy) software collection.
29581     *
29582     *  <p>Status:  support routine.
29583     *
29584     *     @param dr     double      ICRS right ascension (radians)
29585     *     @param dd     double      ICRS declination (radians)
29586     *
29587     *  @return co galactic longitude (radians), galactic latitude (radians)
29588     *
29589     *  <p>Notes:<ol>
29590     *
29591     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29592     *     respect to the now obsolete reference system FK4 B1950.0.  When
29593     *     interpreting the system in a modern context, several factors have
29594     *     to be taken into account:<ul>
29595     *
29596     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29597     *
29598     *     <li> The distortion of the FK4 proper motion system by differential
29599     *       Galactic rotation.
29600     *
29601     *     <li> The use of the B1950.0 equinox rather than the now-standard
29602     *       J2000.0.
29603     *
29604     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29605     *     </ul>
29606     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29607     *     matrix that transforms directly between ICRS and Galactic
29608     *     coordinates with the above factors taken into account.  The
29609     *     matrix is derived from three angles, namely the ICRS coordinates
29610     *     of the Galactic pole and the longitude of the ascending node of
29611     *     the galactic equator on the ICRS equator.  They are given in
29612     *     degrees to five decimal places and for canonical purposes are
29613     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29614     *     elements are given to 10 decimal places (about 20 microarcsec).
29615     *     In the present SOFA function the matrix elements have been
29616     *     recomputed from the canonical three angles and are given to 30
29617     *     decimal places.
29618     *
29619     *  <li> The inverse transformation is performed by the function iauG2icrs.
29620     *  </ol>
29621     *  Reference:
29622     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29623     *     catalogues.  Astrometric and photometric star catalogues
29624     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29625     *     Publications Division, Noordwijk, Netherlands.
29626     *
29627     *  @version   2015 January 20
29628     *
29629     *  @since JSOFA release 20150209
29630     *
29631     */
29632     public static SphericalCoordinate jauIcrs2g ( double dr, double dd )
29633     {
29634        double v1[], v2[];
29635 
29636     /*
29637     *  L2,B2 system of galactic coordinates in the form presented in the
29638     *  Hipparcos Catalogue.  In degrees:
29639     *
29640     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29641     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29642     *  R =  32.93192    longitude of the ascending node of the Galactic
29643     *                   plane on the ICRS equator
29644     *
29645     *  ICRS to galactic rotation matrix, obtained by computing
29646     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29647     */
29648        double r[][] = new double[][] { { -0.054875560416215368492398900454,
29649                             -0.873437090234885048760383168409,
29650                             -0.483835015548713226831774175116 },
29651                           { +0.494109427875583673525222371358,
29652                             -0.444829629960011178146614061616,
29653                             +0.746982244497218890527388004556 },
29654                           { -0.867666149019004701181616534570,
29655                             -0.198076373431201528180486091412,
29656                             +0.455983776175066922272100478348 } };
29657 
29658 
29659     /* Spherical to Cartesian. */
29660        v1 = jauS2c(dr, dd);
29661 
29662     /* ICRS to Galactic. */
29663        v2 = jauRxp(r, v1);
29664 
29665     /* Cartesian to spherical. */
29666        SphericalCoordinate co = jauC2s(v2);
29667 
29668     /* Express in conventional ranges. */
29669        co.alpha = jauAnp(co.alpha);
29670        co.delta = jauAnpm(co.delta);
29671        return co;
29672     }
29673 
29674 // 2016-05-03 additions below    
29675     
29676     /**
29677     *
29678     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29679     *  of date) to ICRS RA,Dec, using the IAU 2006 precession model.
29680     *
29681     * <p>This function is derived from the International Astronomical Union's
29682     *  SOFA (Standards of Fundamental Astronomy) software collection.
29683     *
29684     *  <p>Status:  support function.
29685     *
29686     *  <!-- Given: -->
29687     *     @param date1 double TT as a 2-part Julian date (Note 1)
29688     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29689     *     @param dl double ecliptic longitude and latitude (radians)
29690     *     @param db double ecliptic longitude and latitude (radians) 
29691     *
29692     * <!-- Returned: -->
29693     *     @return      double ICRS right ascension and declination (radians)
29694     *
29695     *<ol>
29696     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29697     *     convenient way between the two arguments.  For example,
29698     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29699     *     among others:
29700     *
29701     *            date1          date2
29702     *
29703     *         2450123.7           0.0       (JD method)
29704     *         2451545.0       -1421.3       (J2000 method)
29705     *         2400000.5       50123.2       (MJD method)
29706     *         2450123.5           0.2       (date &amp; time method)
29707     *
29708     *     The JD method is the most natural and convenient to use in
29709     *     cases where the loss of several decimal digits of resolution
29710     *     is acceptable.  The J2000 method is best matched to the way
29711     *     the argument is handled internally and will deliver the
29712     *     optimum resolution.  The MJD method and the date &amp; time methods
29713     *     are both good compromises between resolution and convenience.
29714     *
29715     *  <li> No assumptions are made about whether the coordinates represent
29716     *     starlight and embody astrometric effects such as parallax or
29717     *     aberration.
29718     *
29719     *  <li> The transformation is approximately that from ecliptic longitude
29720     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29721     *     right ascension and declination, with only frame bias (always
29722     *     less than 25 mas) to disturb this classical picture.
29723     *</ol>
29724     *  Called: <ul>
29725     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29726     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29727     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29728     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29729     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29730     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29731     *</ul>
29732     *
29733     *   @version  2016 February 9
29734     *
29735     *  @since JSOFA release 20160503
29736     *
29737     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29738     */
29739     public static SphericalCoordinate jauEceq06(double date1, double date2, double dl, double db)
29740     {
29741 
29742 
29743     /* Spherical to Cartesian. */
29744        double v1[] = jauS2c(dl, db);
29745 
29746     /* Rotation matrix, ICRS equatorial to ecliptic. */
29747        double rm[][] = jauEcm06(date1, date2);
29748 
29749     /* The transformation from ecliptic to ICRS. */
29750        double v2[] = jauTrxp(rm, v1);
29751 
29752     /* Cartesian to spherical. */
29753        SphericalCoordinate co = jauC2s(v2);
29754 
29755     /* Express in conventional ranges. */
29756        co.alpha = jauAnp(co.alpha);
29757        co.delta = jauAnpm(co.delta);
29758 
29759        return co;
29760     }
29761 
29762     /**
29763     *
29764     *  ICRS equatorial to ecliptic rotation matrix, IAU 2006.
29765     *
29766     * <p>This function is derived from the International Astronomical Union's
29767     *  SOFA (Standards of Fundamental Astronomy) software collection.
29768     *
29769     *  <p>Status:  support function.
29770     *
29771     *  <!-- Given: -->
29772     *    @param date1 double         TT as a 2-part Julian date (Note 1)
29773     *    @param date2 double         TT as a 2-part Julian date (Note 1) 
29774     *
29775     * <!-- Returned: -->
29776     *     @return          double[3][3]   ICRS to ecliptic rotation matrix
29777     *
29778     *  <p>Notes: <ol>
29779     *
29780     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29781     *     convenient way between the two arguments.  For example,
29782     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29783     *     among others:
29784     *
29785     *            date1          date2
29786     *
29787     *         2450123.7           0.0       (JD method)
29788     *         2451545.0       -1421.3       (J2000 method)
29789     *         2400000.5       50123.2       (MJD method)
29790     *         2450123.5           0.2       (date &amp; time method)
29791     *
29792     *     The JD method is the most natural and convenient to use in
29793     *     cases where the loss of several decimal digits of resolution
29794     *     is acceptable.  The J2000 method is best matched to the way
29795     *     the argument is handled internally and will deliver the
29796     *     optimum resolution.  The MJD method and the date &amp; time methods
29797     *     are both good compromises between resolution and convenience.
29798     *
29799     *  <li> The matrix is in the sense
29800     *
29801     *        E_ep = rm x P_ICRS,
29802     *
29803     *     where P_ICRS is a vector with respect to ICRS right ascension
29804     *     and declination axes and E_ep is the same vector with respect to
29805     *     the (inertial) ecliptic and equinox of date.
29806     *
29807     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
29808     *     magnitude, and not bound to any particular spatial origin, such
29809     *     as the Earth, Sun or SSB.  No assumptions are made about whether
29810     *     it represents starlight and embodies astrometric effects such as
29811     *     parallax or aberration.  The transformation is approximately that
29812     *     between mean J2000.0 right ascension and declination and ecliptic
29813     *     longitude and latitude, with only frame bias (always less than
29814     *     25 mas) to disturb this classical picture.
29815     *  </ol>
29816     *  Called: <ul>
29817     *     <li>{@link #jauObl06}     mean obliquity, IAU 2006
29818     *     <li>{@link #jauPmat06}    PB matrix, IAU 2006
29819     *     <li>{@link #jauIr}        initialize r-matrix to identity
29820     *     <li>{@link #jauRx}        rotate around X-axis
29821     *     <li>{@link #jauRxr}       product of two r-matrices
29822     *</ul>
29823     *
29824     *   @version  2015 December 11
29825     *
29826     *  @since JSOFA release 20160503
29827     *
29828     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29829     */
29830     public static double[][] jauEcm06(double date1, double date2)
29831     {
29832        double ob, e[][] = new double[3][3];
29833 
29834 
29835     /* Obliquity, IAU 2006. */
29836        ob = jauObl06(date1, date2);
29837 
29838     /* Precession-bias matrix, IAU 2006. */
29839        double bp[][] = jauPmat06(date1, date2);
29840 
29841     /* Equatorial of date to ecliptic matrix. */
29842        jauIr(e);
29843        jauRx(ob, e);
29844 
29845     /* ICRS to ecliptic coordinates rotation matrix, IAU 2006. */
29846        return jauRxr(e, bp);
29847 
29848     }
29849 
29850     /**
29851     *
29852     *  Transformation from ICRS equatorial coordinates to ecliptic
29853     *  coordinates (mean equinox and ecliptic of date) using IAU 2006
29854     *  precession model.
29855     *
29856     * <p>This function is derived from the International Astronomical Union's
29857     *  SOFA (Standards of Fundamental Astronomy) software collection.
29858     *
29859     *  <p>Status:  support function.
29860     *
29861     *  <!-- Given: -->
29862     *     @param date1 double TT as a 2-part Julian date (Note 1)
29863     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29864     *     @param dr double ICRS right ascension and declination (radians)
29865     *     @param dd double ICRS right ascension and declination (radians) 
29866     *
29867     * <!-- Returned: -->
29868     *     @return      double ecliptic longitude and latitude (radians)
29869     *<ol>
29870     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29871     *     convenient way between the two arguments.  For example,
29872     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29873     *     among others:
29874     *
29875     *            date1          date2
29876     *
29877     *         2450123.7           0.0       (JD method)
29878     *         2451545.0       -1421.3       (J2000 method)
29879     *         2400000.5       50123.2       (MJD method)
29880     *         2450123.5           0.2       (date &amp; time method)
29881     *
29882     *     The JD method is the most natural and convenient to use in
29883     *     cases where the loss of several decimal digits of resolution
29884     *     is acceptable.  The J2000 method is best matched to the way
29885     *     the argument is handled internally and will deliver the
29886     *     optimum resolution.  The MJD method and the date &amp; time methods
29887     *     are both good compromises between resolution and convenience.
29888     *
29889     *  <li> No assumptions are made about whether the coordinates represent
29890     *     starlight and embody astrometric effects such as parallax or
29891     *     aberration.
29892     *
29893     *  <li> The transformation is approximately that from mean J2000.0 right
29894     *     ascension and declination to ecliptic longitude and latitude
29895     *     (mean equinox and ecliptic of date), with only frame bias (always
29896     *     less than 25 mas) to disturb this classical picture.
29897     *</ol>
29898     *  Called:<ul>
29899     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29900     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29901     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
29902     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29903     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29904     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29905     *</ul>
29906     *   @version  2016 February 9
29907     *
29908     *  @since JSOFA release 20160503
29909     *
29910     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29911     */
29912     public static SphericalCoordinate jauEqec06(double date1, double date2, double dr, double dd)
29913     {
29914 
29915     /* Spherical to Cartesian. */
29916       double v1[] = jauS2c(dr, dd);
29917 
29918     /* Rotation matrix, ICRS equatorial to ecliptic. */
29919       double rm[][] = jauEcm06(date1, date2);
29920 
29921     /* The transformation from ICRS to ecliptic. */
29922        double v2[] = jauRxp(rm, v1);
29923 
29924     /* Cartesian to spherical. */
29925        SphericalCoordinate co = jauC2s(v2);
29926 
29927     /* Express in conventional ranges. */
29928        co.alpha = jauAnp(co.alpha);
29929        co.delta = jauAnpm(co.delta);
29930        return co;
29931 
29932     }
29933 
29934     /**
29935     *
29936     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29937     *  of date) to ICRS RA,Dec, using a long-term precession model.
29938     *
29939     * <p>This function is derived from the International Astronomical Union's
29940     *  SOFA (Standards of Fundamental Astronomy) software collection.
29941     *
29942     *  <p>Status:  support function.
29943     *
29944     *  <!-- Given: -->
29945     *    @param  epj     double     Julian epoch (TT)
29946     *    @param dl double     ecliptic longitude and latitude (radians)
29947     *    @param db double     ecliptic longitude and latitude (radians) 
29948     *
29949     * <!-- Returned: -->
29950     *     @return   double     ICRS right ascension and declination (radians)
29951     *<ol>
29952     *  <li> No assumptions are made about whether the coordinates represent
29953     *     starlight and embody astrometric effects such as parallax or
29954     *     aberration.
29955     *
29956     *  <li> The transformation is approximately that from ecliptic longitude
29957     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29958     *     right ascension and declination, with only frame bias (always
29959     *     less than 25 mas) to disturb this classical picture.
29960     *
29961     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29962     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29963     *     100 microarcseconds during the 20th and 21st centuries.  It is
29964     *     accurate to a few arcseconds throughout the historical period,
29965     *     worsening to a few tenths of a degree at the end of the
29966     *     +/- 200,000 year time span.
29967     *</ol>
29968     *  Called:<ul>
29969     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29970     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
29971     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29972     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29973     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29974     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29975     *</ul>
29976     *  References: <ul>
29977     *
29978     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29979     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29980     *    A22
29981     *
29982     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29983     *    expressions, valid for long time intervals (Corrigendum),
29984     *    Astron.Astrophys. 541, C1
29985     *</ul>
29986     *   @version  2016 February 9
29987     *
29988     *  @since JSOFA release 20160503
29989     *
29990     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29991     */
29992     public static SphericalCoordinate jauLteceq(double epj, double dl, double db)
29993     {
29994 
29995     /* Spherical to Cartesian. */
29996        double v1[] = jauS2c(dl, db);
29997 
29998     /* Rotation matrix, ICRS equatorial to ecliptic. */
29999        double rm[][] = jauLtecm(epj);
30000 
30001     /* The transformation from ecliptic to ICRS. */
30002        double v2[] = jauTrxp(rm, v1);
30003 
30004     /* Cartesian to spherical. */
30005        SphericalCoordinate co = jauC2s(v2);
30006 
30007     /* Express in conventional ranges. */
30008        co.alpha = jauAnp(co.alpha);
30009        co.delta = jauAnpm(co.delta);
30010        return co;
30011 
30012     }
30013 
30014     /**
30015     *
30016     *  ICRS equatorial to ecliptic rotation matrix, long-term.
30017     *
30018     * <p>This function is derived from the International Astronomical Union's
30019     *  SOFA (Standards of Fundamental Astronomy) software collection.
30020     *
30021     *  <p>Status:  support function.
30022     *
30023     *  <!-- Given: -->
30024     *     @param epj     double         Julian epoch (TT)
30025     *
30026     * <!-- Returned: -->
30027     *     @return      double[3][3]   ICRS to ecliptic rotation matrix
30028     *
30029     *  <p>Notes: <ol>
30030     *
30031     *  <li> The matrix is in the sense
30032     *
30033     *        E_ep = rm x P_ICRS,
30034     *
30035     *     where P_ICRS is a vector with respect to ICRS right ascension
30036     *     and declination axes and E_ep is the same vector with respect to
30037     *     the (inertial) ecliptic and equinox of epoch epj.
30038     *
30039     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
30040     *     magnitude, and not bound to any particular spatial origin, such
30041     *     as the Earth, Sun or SSB.  No assumptions are made about whether
30042     *     it represents starlight and embodies astrometric effects such as
30043     *     parallax or aberration.  The transformation is approximately that
30044     *     between mean J2000.0 right ascension and declination and ecliptic
30045     *     longitude and latitude, with only frame bias (always less than
30046     *     25 mas) to disturb this classical picture.
30047     *
30048     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30049     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30050     *     100 microarcseconds during the 20th and 21st centuries.  It is
30051     *     accurate to a few arcseconds throughout the historical period,
30052     *     worsening to a few tenths of a degree at the end of the
30053     *     +/- 200,000 year time span.
30054     *</ol>
30055     *  Called:<ul>
30056     *     <li>{@link #jauLtpequ}    equator pole, long term
30057     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
30058     *     <li>{@link #jauPxp}       vector product
30059     *     <li>{@link #jauPn}        normalize vector
30060     *</ul>
30061     *  References:<ul>
30062     *
30063     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30064     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30065     *    A22
30066     *
30067     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30068     *    expressions, valid for long time intervals (Corrigendum),
30069     *    Astron.Astrophys. 541, C1
30070     *</ul>
30071     *   @version  2015 December 6
30072     *
30073     *  @since JSOFA release 20160503
30074     *
30075     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30076     */
30077     public static double[][] jauLtecm(double epj)
30078     {
30079        double rm[][] = new double[3][3];
30080     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
30081        final double dx = -0.016617 * DAS2R,
30082                     de = -0.0068192 * DAS2R,
30083                     dr = -0.0146 * DAS2R;
30084 
30085 
30086     /* Equator pole. */
30087        double p[] = jauLtpequ(epj);
30088 
30089     /* Ecliptic pole (bottom row of equatorial to ecliptic matrix). */
30090        double z[] = jauLtpecl(epj);
30091 
30092     /* Equinox (top row of matrix). */
30093        double w[] = jauPxp(p, z);
30094        NormalizedVector nv = jauPn(w);
30095 
30096        double x[] = nv.u;
30097     /* Middle row of matrix. */
30098        double y[] = jauPxp(z, x);
30099 
30100     /* Combine with frame bias. */
30101        rm[0][0] =   x[0]    - x[1]*dr + x[2]*dx;
30102        rm[0][1] =   x[0]*dr + x[1]    + x[2]*de;
30103        rm[0][2] = - x[0]*dx - x[1]*de + x[2];
30104        rm[1][0] =   y[0]    - y[1]*dr + y[2]*dx;
30105        rm[1][1] =   y[0]*dr + y[1]    + y[2]*de;
30106        rm[1][2] = - y[0]*dx - y[1]*de + y[2];
30107        rm[2][0] =   z[0]    - z[1]*dr + z[2]*dx;
30108        rm[2][1] =   z[0]*dr + z[1]    + z[2]*de;
30109        rm[2][2] = - z[0]*dx - z[1]*de + z[2];
30110 
30111        return rm;
30112 
30113     }
30114 
30115     /**
30116     *
30117     *  Transformation from ICRS equatorial coordinates to ecliptic
30118     *  coordinates (mean equinox and ecliptic of date) using a long-term
30119     *  precession model.
30120     *
30121     * <p>This function is derived from the International Astronomical Union's
30122     *  SOFA (Standards of Fundamental Astronomy) software collection.
30123     *
30124     *  <p>Status:  support function.
30125     *
30126     *  <!-- Given: -->
30127     *     @param epj     double     Julian epoch (TT)
30128     *     @param dr   double     ICRS right ascension and declination (radians)
30129     *     @param dd   double     ICRS right ascension and declination (radians)
30130     *
30131     * <!-- Returned: -->
30132     *     @return     ecliptic longitude and latitude (radians)
30133     *<ol>
30134     *  <li> No assumptions are made about whether the coordinates represent
30135     *     starlight and embody astrometric effects such as parallax or
30136     *     aberration.
30137     *
30138     *  <li> The transformation is approximately that from mean J2000.0 right
30139     *     ascension and declination to ecliptic longitude and latitude
30140     *     (mean equinox and ecliptic of date), with only frame bias (always
30141     *     less than 25 mas) to disturb this classical picture.
30142     *
30143     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30144     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30145     *     100 microarcseconds during the 20th and 21st centuries.  It is
30146     *     accurate to a few arcseconds throughout the historical period,
30147     *     worsening to a few tenths of a degree at the end of the
30148     *     +/- 200,000 year time span.
30149     *</ol>
30150     *  Called:<ul>
30151     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
30152     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
30153     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
30154     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
30155     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
30156     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
30157     *</ul>
30158     *  References:
30159     *
30160     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30161     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30162     *    A22
30163     *
30164     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30165     *    expressions, valid for long time intervals (Corrigendum),
30166     *    Astron.Astrophys. 541, C1
30167     *
30168     *   @version  2016 February 9
30169     *
30170     *  @since JSOFA release 20160503
30171     *
30172     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30173     */
30174     public static SphericalCoordinate jauLteqec(double epj, double dr, double dd)
30175     {
30176 
30177     /* Spherical to Cartesian. */
30178        double v1[] = jauS2c(dr, dd);
30179 
30180     /* Rotation matrix, ICRS equatorial to ecliptic. */
30181        double rm[][] = jauLtecm(epj);
30182 
30183     /* The transformation from ICRS to ecliptic. */
30184        double v2[] = jauRxp(rm, v1);
30185 
30186     /* Cartesian to spherical. */
30187        SphericalCoordinate co = jauC2s(v2);
30188 
30189     /* Express in conventional ranges. */
30190       co.alpha = jauAnp(co.alpha);
30191       co.delta = jauAnpm(co.delta);
30192 
30193      return co;
30194     }
30195 
30196     /**
30197     *
30198     *  Long-term precession matrix.
30199     *
30200     * <p>This function is derived from the International Astronomical Union's
30201     *  SOFA (Standards of Fundamental Astronomy) software collection.
30202     *
30203     *  <p>Status:  support function.
30204     *
30205     *  <!-- Given: -->
30206     *     @param epj     double         Julian epoch (TT)
30207     *
30208     * <!-- Returned: -->
30209     *     @return      double[3][3]   precession matrix, J2000.0 to date
30210     *
30211     *  <p>Notes: <ol>
30212     *
30213     *  <li> The matrix is in the sense
30214     *
30215     *        P_date = rp x P_J2000,
30216     *
30217     *     where P_J2000 is a vector with respect to the J2000.0 mean
30218     *     equator and equinox and P_date is the same vector with respect to
30219     *     the equator and equinox of epoch epj.
30220     *
30221     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30222     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30223     *     100 microarcseconds during the 20th and 21st centuries.  It is
30224     *     accurate to a few arcseconds throughout the historical period,
30225     *     worsening to a few tenths of a degree at the end of the
30226     *     +/- 200,000 year time span.
30227     *</ol>
30228     *  Called:<ul>
30229     *     <li>{@link #jauLtpequ}    equator pole, long term
30230     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
30231     *     <li>{@link #jauPxp}       vector product
30232     *     <li>{@link #jauPn}        normalize vector
30233     *</ul>
30234     *  References:
30235     *
30236     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30237     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30238     *    A22
30239     *
30240     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30241     *    expressions, valid for long time intervals (Corrigendum),
30242     *    Astron.Astrophys. 541, C1
30243     *
30244     *   @version  2015 December 6
30245     *
30246     *  @since JSOFA release 20160503
30247     *
30248     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30249     */
30250     public static double[][] jauLtp(double epj )
30251     {
30252        double rp[][] = new double[3][3];
30253        int i;
30254        
30255 
30256 
30257     /* Equator pole (bottom row of matrix). */
30258        double peqr[] = jauLtpequ(epj);
30259 
30260     /* Ecliptic pole. */
30261        double pecl[] = jauLtpecl(epj);
30262 
30263     /* Equinox (top row of matrix). */
30264        double v[] = jauPxp(peqr, pecl);
30265        NormalizedVector nv = jauPn(v);
30266 
30267     /* Middle row of matrix. */
30268        v = jauPxp(peqr, nv.u);
30269 
30270     /* Assemble the matrix. */
30271        for ( i = 0; i < 3; i++ ) {
30272           rp[0][i] = nv.u[i];
30273           rp[1][i] = v[i];
30274           rp[2][i] = peqr[i];
30275        }
30276 
30277        return rp;
30278     }
30279 
30280 
30281     /**
30282     *
30283     *  Long-term precession matrix, including ICRS frame bias.
30284     *
30285     * <p>This function is derived from the International Astronomical Union's
30286     *  SOFA (Standards of Fundamental Astronomy) software collection.
30287     *
30288     *  <p>Status:  support function.
30289     *
30290     *  <!-- Given: -->
30291     *     @param epj     double         Julian epoch (TT)
30292     *
30293     * <!-- Returned: -->
30294     *     @return     double[3][3]   precession-bias matrix, J2000.0 to date
30295     *
30296     *  <p>Notes: <ol>
30297     *
30298     *  <li> The matrix is in the sense
30299     *
30300     *        P_date = rpb x P_ICRS,
30301     *
30302     *     where P_ICRS is a vector in the Geocentric Celestial Reference
30303     *     System, and P_date is the vector with respect to the Celestial
30304     *     Intermediate Reference System at that date but with nutation
30305     *     neglected.
30306     *
30307     *  <li> A first order frame bias formulation is used, of sub-
30308     *     microarcsecond accuracy compared with a full 3D rotation.
30309     *
30310     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30311     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30312     *     100 microarcseconds during the 20th and 21st centuries.  It is
30313     *     accurate to a few arcseconds throughout the historical period,
30314     *     worsening to a few tenths of a degree at the end of the
30315     *     +/- 200,000 year time span.
30316     *</ol>
30317     *  References:
30318     *
30319     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30320     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30321     *    A22
30322     *
30323     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30324     *    expressions, valid for long time intervals (Corrigendum),
30325     *    Astron.Astrophys. 541, C1
30326     *
30327     *   @version  2015 December 6
30328     *
30329     *  @since JSOFA release 20160503
30330     *
30331     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30332     */
30333     public static double[][] jauLtpb(double epj)
30334     {
30335         double rpb[][] = new double[3][3];
30336     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
30337        final double dx = -0.016617 * DAS2R,
30338                     de = -0.0068192 * DAS2R,
30339                     dr = -0.0146 * DAS2R;
30340 
30341        int i;
30342       
30343 
30344 
30345     /* Precession matrix. */
30346         double rp[][] = jauLtp(epj);
30347 
30348     /* Apply the bias. */
30349        for ( i = 0; i < 3; i++ ) {
30350           rpb[i][0] =  rp[i][0]    - rp[i][1]*dr + rp[i][2]*dx;
30351           rpb[i][1] =  rp[i][0]*dr + rp[i][1]    + rp[i][2]*de;
30352           rpb[i][2] = -rp[i][0]*dx - rp[i][1]*de + rp[i][2];
30353        }
30354 
30355       return rpb;
30356     }
30357 
30358     /**
30359     *
30360     *  Long-term precession of the ecliptic.
30361     *
30362     * <p>This function is derived from the International Astronomical Union's
30363     *  SOFA (Standards of Fundamental Astronomy) software collection.
30364     *
30365     *  <p>Status:  support function.
30366     *
30367     *  <!-- Given: -->
30368     *     @param epj     double         Julian epoch (TT)
30369     *
30370     * <!-- Returned: -->
30371     *     @return     double[3]      ecliptic pole unit vector
30372     *
30373     *  <p>Notes: <ol>
30374     *
30375     *  <li> The returned vector is with respect to the J2000.0 mean equator
30376     *     and equinox.
30377     *
30378     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30379     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30380     *     100 microarcseconds during the 20th and 21st centuries.  It is
30381     *     accurate to a few arcseconds throughout the historical period,
30382     *     worsening to a few tenths of a degree at the end of the
30383     *     +/- 200,000 year time span.
30384     *</ol>
30385     *  References:
30386     *
30387     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30388     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30389     *    A22
30390     *
30391     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30392     *    expressions, valid for long time intervals (Corrigendum),
30393     *    Astron.Astrophys. 541, C1
30394     *
30395     *   @version  2016 February 9
30396     *
30397     *  @since JSOFA release 20160503
30398     *
30399     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30400     */
30401     public static double[] jauLtpecl(double epj)
30402     {
30403         
30404        double vec[] = new double[3];
30405     /* Obliquity at J2000.0 (radians). */
30406        final double eps0 = 84381.406 * DAS2R;
30407 
30408     /* Polynomial coefficients */
30409         final int NPOL = 4 ;
30410         final double pqpol[][] = {
30411           { 5851.607687,
30412               -0.1189000,
30413               -0.00028913,
30414                0.000000101},
30415           {-1600.886300,
30416                1.1689818,
30417               -0.00000020,
30418               -0.000000437}
30419        };
30420 
30421     /* Periodic coefficients */
30422        final double pqper[][] = {
30423           { 708.15,-5486.751211,-684.661560,  667.666730,-5523.863691},
30424           {2309.00,  -17.127623,2446.283880,-2354.886252, -549.747450},
30425           {1620.00, -617.517403, 399.671049, -428.152441, -310.998056},
30426           { 492.20,  413.442940,-356.652376,  376.202861,  421.535876},
30427           {1183.00,   78.614193,-186.387003,  184.778874,  -36.776172},
30428           { 622.00, -180.732815,-316.800070,  335.321713, -145.278396},
30429           { 882.00,  -87.676083, 198.296701, -185.138669,  -34.744450},
30430           { 547.00,   46.140315, 101.135679, -120.972830,   22.885731}
30431        };
30432        final int NPER = pqper.length;
30433 
30434     /* Miscellaneous */
30435        int i;
30436        double t, p, q, w, a, s, c;
30437 
30438 
30439     /* Centuries since J2000. */
30440        t  = ( epj - 2000.0 ) / 100.0;
30441 
30442     /* Initialize P_A and Q_A accumulators. */
30443        p = 0.0;
30444        q = 0.0;
30445 
30446     /* Periodic terms. */
30447        w = D2PI*t;
30448        for ( i = 0; i < NPER; i++ ) {
30449           a = w/pqper[i][0];
30450           s = sin(a);
30451           c = cos(a);
30452           p += c*pqper[i][1] + s*pqper[i][3];
30453           q += c*pqper[i][2] + s*pqper[i][4];
30454        }
30455 
30456     /* Polynomial terms. */
30457        w = 1.0;
30458        for ( i = 0; i < NPOL; i++ ) {
30459           p += pqpol[0][i]*w;
30460           q += pqpol[1][i]*w;
30461           w *= t;
30462        }
30463 
30464     /* P_A and Q_A (radians). */
30465        p *= DAS2R;
30466        q *= DAS2R;
30467 
30468     /* Form the ecliptic pole vector. */
30469        w = 1.0 - p*p - q*q;
30470        w = w < 0.0 ? 0.0 : sqrt(w);
30471        s = sin(eps0);
30472        c = cos(eps0);
30473        vec[0] = p;
30474        vec[1] = - q*c - w*s;
30475        vec[2] = - q*s + w*c;
30476 
30477        return vec;
30478 
30479     }
30480 
30481     /**
30482     *
30483     *  Long-term precession of the equator.
30484     *
30485     * <p>This function is derived from the International Astronomical Union's
30486     *  SOFA (Standards of Fundamental Astronomy) software collection.
30487     *
30488     *  <p>Status:  support function.
30489     *
30490     *  <!-- Given: -->
30491     *     @param epj     double         Julian epoch (TT)
30492     *
30493     * <!-- Returned: -->
30494     *     @return     double[3]      equator pole unit vector
30495     *
30496     *  <p>Notes: <ol>
30497     *
30498     *  <li> The returned vector is with respect to the J2000.0 mean equator
30499     *     and equinox.
30500     *
30501     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30502     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30503     *     100 microarcseconds during the 20th and 21st centuries.  It is
30504     *     accurate to a few arcseconds throughout the historical period,
30505     *     worsening to a few tenths of a degree at the end of the
30506     *     +/- 200,000 year time span.
30507     *</ol>
30508     *  References:
30509     *
30510     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30511     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30512     *    A22
30513     *
30514     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30515     *    expressions, valid for long time intervals (Corrigendum),
30516     *    Astron.Astrophys. 541, C1
30517     *
30518     *   @version  2016 February 9
30519     *
30520     *  @since JSOFA release 20160503
30521     *
30522     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30523     */
30524     public static double[] jauLtpequ(double epj)
30525     {
30526         double veq[] = new double[3];
30527     /* Polynomial coefficients */
30528        final int NPOL = 4;
30529        final double xypol[][] = {
30530           {  5453.282155,
30531                 0.4252841,
30532                -0.00037173,
30533                -0.000000152},
30534           {-73750.930350,
30535                -0.7675452,
30536                -0.00018725,
30537                 0.000000231}
30538        };
30539 
30540     /* Periodic coefficients */
30541         final double xyper[][] = {
30542           { 256.75, -819.940624,75004.344875,81491.287984, 1558.515853},
30543           { 708.15,-8444.676815,  624.033993,  787.163481, 7774.939698},
30544           { 274.20, 2600.009459, 1251.136893, 1251.296102,-2219.534038},
30545           { 241.45, 2755.175630,-1102.212834,-1257.950837,-2523.969396},
30546           {2309.00, -167.659835,-2660.664980,-2966.799730,  247.850422},
30547           { 492.20,  871.855056,  699.291817,  639.744522, -846.485643},
30548           { 396.10,   44.769698,  153.167220,  131.600209,-1393.124055},
30549           { 288.90, -512.313065, -950.865637, -445.040117,  368.526116},
30550           { 231.10, -819.415595,  499.754645,  584.522874,  749.045012},
30551           {1610.00, -538.071099, -145.188210,  -89.756563,  444.704518},
30552           { 620.00, -189.793622,  558.116553,  524.429630,  235.934465},
30553           { 157.87, -402.922932,  -23.923029,  -13.549067,  374.049623},
30554           { 220.30,  179.516345, -165.405086, -210.157124, -171.330180},
30555           {1200.00,   -9.814756,    9.344131,  -44.919798,  -22.899655}
30556        };
30557        final int NPER = xyper.length;
30558 
30559     /* Miscellaneous */
30560        int i;
30561        double t, x, y, w, a, s, c;
30562 
30563 
30564     /* Centuries since J2000. */
30565        t  = ( epj - 2000.0 ) / 100.0;
30566 
30567     /* Initialize X and Y accumulators. */
30568        x = 0.0;
30569        y = 0.0;
30570 
30571     /* Periodic terms. */
30572        w = D2PI * t;
30573        for ( i = 0; i < NPER; i++ ) {
30574           a = w / xyper[i][0];
30575           s = sin(a);
30576           c = cos(a);
30577           x += c*xyper[i][1] + s*xyper[i][3];
30578           y += c*xyper[i][2] + s*xyper[i][4];
30579        }
30580 
30581     /* Polynomial terms. */
30582        w = 1.0;
30583        for ( i = 0; i < NPOL; i++ ) {
30584           x += xypol[0][i]*w;
30585           y += xypol[1][i]*w;
30586           w *= t;
30587        }
30588 
30589     /* X and Y (direction cosines). */
30590        x *= DAS2R;
30591        y *= DAS2R;
30592 
30593     /* Form the equator pole vector. */
30594        veq[0] = x;
30595        veq[1] = y;
30596        w = 1.0 - x*x - y*y;
30597        veq[2] = w < 0.0 ? 0.0 : sqrt(w);
30598 
30599        
30600        return veq;
30601 
30602     }
30603 
30604     /**
30605      * Position consisting of (ha, declination) pairs in radians. Where ha is hour angle and dec is declination .
30606      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
30607      * 
30608      * @since JSOFA release 20180130
30609      */
30610     public static class EquatorialCoordinate {
30611         public double ha;
30612         public double dec;
30613         public EquatorialCoordinate(double ha, double dec){
30614             this.ha = ha;
30615             this.dec = dec;
30616         }
30617     }
30618 
30619     /**
30620      *
30621      *  Horizon to equatorial coordinates:  transform azimuth and altitude
30622      *  to hour angle and declination.
30623      *
30624      * <!-- Given: -->
30625      *  @param  az       double       azimuth
30626      *  @param  el       double       altitude (informally, elevation)
30627      *  @param  phi      double       site latitude
30628      *
30629      * <!-- Returned: -->
30630      *  @return   ha       double       hour angle (local)
30631      *     dec      double       declination
30632      *
30633      * <p>Notes: <ol>
30634      *
30635      * <li>  All the arguments are angles in radians.
30636      *
30637      * <li>  The sign convention for azimuth is north zero, east +pi/2.
30638      *
30639      * <li>  HA is returned in the range +/-pi.  Declination is returned in
30640      *      the range +/-pi/2.
30641      *
30642      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30643      *      rotation axis and the adopted zenith.  In many applications it
30644      *      will be sufficient to use the published geodetic latitude of the
30645      *      site.  In very precise (sub-arcsecond) applications, phi can be
30646      *      corrected for polar motion.
30647      *
30648      * <li>  The azimuth az must be with respect to the rotational north pole,
30649      *      as opposed to the ITRS pole, and an azimuth with respect to north
30650      *      on a map of the Earth's surface will need to be adjusted for
30651      *      polar motion if sub-arcsecond accuracy is required.
30652      *
30653      * <li>  Should the user wish to work with respect to the astronomical
30654      *      zenith rather than the geodetic zenith, phi will need to be
30655      *      adjusted for deflection of the vertical (often tens of
30656      *      arcseconds), and the zero point of ha will also be affected.
30657      *
30658      * <li>  The transformation is the same as Ve = Ry(phi-pi/2)*Rz(pi)*Vh,
30659      *      where Ve and Vh are lefthanded unit vectors in the (ha,dec) and
30660      *      (az,el) systems respectively and Rz and Ry are rotations about
30661      *      first the z-axis and then the y-axis.  (n.b. Rz(pi) simply
30662      *      reverses the signs of the x and y components.)  For efficiency,
30663      *      the algorithm is written out rather than calling other utility
30664      *      functions.  For applications that require even greater
30665      *      efficiency, additional savings are possible if constant terms
30666      *      such as functions of latitude are computed once and for all.
30667      *
30668      * <li>  Again for efficiency, no range checking of arguments is carried
30669      *      out.
30670      *</ol>
30671      *  Last revision:   2017 September 12
30672      *
30673      * @since JSOFA release 20180130
30674      *
30675      */
30676 
30677     public static  EquatorialCoordinate jauAe2hd (double az, double el, double phi)
30678     {
30679         double sa, ca, se, ce, sp, cp, x, y, z, r;
30680 
30681 
30682         /* Useful trig functions. */
30683         sa = sin(az);
30684         ca = cos(az);
30685         se = sin(el);
30686         ce = cos(el);
30687         sp = sin(phi);
30688         cp = cos(phi);
30689 
30690         /* HA,Dec unit vector. */
30691         x = - ca*ce*sp + se*cp;
30692         y = - sa*ce;
30693         z = ca*ce*cp + se*sp;
30694 
30695         /* To spherical. */
30696         r = sqrt(x*x + y*y);
30697         return new EquatorialCoordinate( (r != 0.0) ? atan2(y,x) : 0.0,
30698                 atan2(z,r));
30699 
30700         /* Finished. */
30701     }
30702 
30703 
30704     /**
30705      * Position consisting of (az, el) pairs in radians. Where az is the azimuth and el is elevation .
30706      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30707      * 
30708      * @since JSOFA release 20180130
30709      */
30710     public static class HorizonCoordinate {
30711         public double az;
30712         public double el;
30713         public HorizonCoordinate(double az, double el){
30714             this.az = az;
30715             this.el = el;
30716         }
30717     }
30718 
30719 
30720     /**
30721      *
30722      *  Equatorial to horizon coordinates:  transform hour angle and
30723      *  declination to azimuth and altitude.
30724      *
30725      *  <p>This function is derived from the International Astronomical Union's
30726      *  SOFA (Standards of Fundamental Astronomy) software collection.
30727      *
30728      *  <p>Status:  support function.
30729      *
30730      * <!-- Given: -->
30731      *  @param   ha       double       hour angle (local)
30732      *  @param   dec      double       declination
30733      *  @param   phi      double       site latitude
30734      *
30735      * <!-- Returned: -->
30736      *  @return   az      double       azimuth
30737      *     el      double       altitude (informally, elevation)
30738      *
30739      * <p>Notes: <ol>
30740      *
30741      * <li>  All the arguments are angles in radians.
30742      *
30743      * <li>  Azimuth is returned in the range 0-2pi;  north is zero, and east
30744      *      is +pi/2.  Altitude is returned in the range +/- pi/2.
30745      *
30746      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30747      *      rotation axis and the adopted zenith.  In many applications it
30748      *      will be sufficient to use the published geodetic latitude of the
30749      *      site.  In very precise (sub-arcsecond) applications, phi can be
30750      *      corrected for polar motion.
30751      *
30752      * <li>  The returned azimuth az is with respect to the rotational north
30753      *      pole, as opposed to the ITRS pole, and for sub-arcsecond
30754      *      accuracy will need to be adjusted for polar motion if it is to
30755      *      be with respect to north on a map of the Earth's surface.
30756      *
30757      * <li>  Should the user wish to work with respect to the astronomical
30758      *      zenith rather than the geodetic zenith, phi will need to be
30759      *      adjusted for deflection of the vertical (often tens of
30760      *      arcseconds), and the zero point of the hour angle ha will also
30761      *      be affected.
30762      *
30763      * <li>  The transformation is the same as Vh = Rz(pi)*Ry(pi/2-phi)*Ve,
30764      *      where Vh and Ve are lefthanded unit vectors in the (az,el) and
30765      *      (ha,dec) systems respectively and Ry and Rz are rotations about
30766      *      first the y-axis and then the z-axis.  (n.b. Rz(pi) simply
30767      *      reverses the signs of the x and y components.)  For efficiency,
30768      *      the algorithm is written out rather than calling other utility
30769      *      functions.  For applications that require even greater
30770      *      efficiency, additional savings are possible if constant terms
30771      *      such as functions of latitude are computed once and for all.
30772      *
30773      * <li>  Again for efficiency, no range checking of arguments is carried
30774      *      out.
30775      *</ol>
30776      *  Last revision:   2017 September 12
30777      *
30778      * @since JSOFA release 20180130
30779      *
30780      */
30781     public static HorizonCoordinate jauHd2ae (double ha, double dec, double phi)
30782     {
30783         double sh, ch, sd, cd, sp, cp, x, y, z, r, a;
30784 
30785 
30786         /* Useful trig functions. */
30787         sh = sin(ha);
30788         ch = cos(ha);
30789         sd = sin(dec);
30790         cd = cos(dec);
30791         sp = sin(phi);
30792         cp = cos(phi);
30793 
30794         /* Az,Alt unit vector. */
30795         x = - ch*cd*sp + sd*cp;
30796         y = - sh*cd;
30797         z = ch*cd*cp + sd*sp;
30798 
30799         /* To spherical. */
30800         r = sqrt(x*x + y*y);
30801         a = (r != 0.0) ? atan2(y,x) : 0.0;
30802         return new HorizonCoordinate((a < 0.0) ? a+D2PI : a,
30803                 atan2(z,r));
30804 
30805         /* Finished. */
30806     }
30807 
30808 
30809     /**
30810      *
30811      *  Parallactic angle for a given hour angle and declination.
30812      *
30813      *  <p>This function is derived from the International Astronomical Union's
30814      *  SOFA (Standards of Fundamental Astronomy) software collection.
30815      *
30816      *  <p>Status:  support function.
30817      *
30818      * <!-- Given: -->
30819      *  @param  ha     double     hour angle
30820      *  @param  dec    double     declination
30821      *  @param  phi    double     site latitude
30822      *
30823      *  @return     double     parallactic angle
30824      *
30825      * <p>Notes: <ol>
30826      *
30827      * <li>  All the arguments are angles in radians.
30828      *
30829      * <li>  The parallactic angle at a point in the sky is the position
30830      *      angle of the vertical, i.e. the angle between the directions to
30831      *      the north celestial pole and to the zenith respectively.
30832      *
30833      * <li>  The result is returned in the range -pi to +pi.
30834      *
30835      * <li>  At the pole itself a zero result is returned.
30836      *
30837      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30838      *      rotation axis and the adopted zenith.  In many applications it
30839      *      will be sufficient to use the published geodetic latitude of the
30840      *      site.  In very precise (sub-arcsecond) applications, phi can be
30841      *      corrected for polar motion.
30842      *
30843      * <li>  Should the user wish to work with respect to the astronomical
30844      *      zenith rather than the geodetic zenith, phi will need to be
30845      *      adjusted for deflection of the vertical (often tens of
30846      *      arcseconds), and the zero point of the hour angle ha will also
30847      *      be affected.
30848      *</ol>
30849      *  Reference:
30850      *     Smart, W.M., "Spherical Astronomy", Cambridge University Press,
30851      *     6th edition (Green, 1977), p49.
30852      *
30853      *  Last revision:   2017 September 12
30854      *
30855      * @since JSOFA release 20180130
30856      *
30857      */
30858     public static double jauHd2pa (double ha, double dec, double phi)
30859     {
30860         double cp, cqsz, sqsz;
30861 
30862 
30863         cp = cos(phi);
30864         sqsz = cp*sin(ha);
30865         cqsz = sin(phi)*cos(dec) - cp*sin(dec)*cos(ha);
30866         return ( ( sqsz != 0.0 || cqsz != 0.0 ) ? atan2(sqsz,cqsz) : 0.0 );
30867 
30868         /* Finished. */
30869     }
30870 
30871 
30872     /**
30873      * Tangent point soulutions. A class to contain tangent point soutions and an indication as to how many of the solutions are valid
30874      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30875      * @since JSOFA release 20180130
30876      */
30877     public static class TangentPointSolution
30878     {
30879         public SphericalCoordinate sol1;
30880         public SphericalCoordinate sol2;
30881 
30882         /** nsolutions. The number of useful solutions
30883          */
30884         public int nsolutions;
30885         /**
30886          * @param sol1
30887          * @param sol2
30888          * @param flag
30889 
30890          */
30891         public TangentPointSolution(SphericalCoordinate sol1,
30892                 SphericalCoordinate sol2, int flag) {
30893             this.sol1 = sol1;
30894             this.sol2 = sol2;
30895             this.nsolutions = flag;
30896         }
30897         public TangentPointSolution()
30898         {
30899             this.sol1 = null;
30900             this.sol2 = null;
30901             this.nsolutions = 0;
30902         }
30903     }
30904     /**
30905      *
30906      *  In the tangent plane projection, given the rectangular coordinates
30907      *  of a star and its spherical coordinates, determine the spherical
30908      *  coordinates of the tangent point.
30909      *
30910      *  <p>This function is derived from the International Astronomical Union's
30911      *  SOFA (Standards of Fundamental Astronomy) software collection.
30912      *
30913      *  <p>Status:  support function.
30914      *
30915      * <!-- Given: -->
30916      *   @param  xi     double  rectangular coordinates of star image (Note 2)
30917      *   @param  eta     double  rectangular coordinates of star image (Note 2)
30918      *   @param  a        double  star's spherical coordinates (Note 3)
30919      *   @param  b        double  star's spherical coordinates (Note 3)
30920      *
30921      * <!-- Returned: -->
30922      *     @return  tangent point's spherical coordinate solutions
30923      *
30924      *  Returned (function value):
30925      *                int     number of solutions:
30926      *                        0 = no solutions returned (Note 5)
30927      *                        1 = only the first solution is useful (Note 6)
30928      *                        2 = both solutions are useful (Note 6)
30929      *
30930      * <p>Notes: <ol>
30931      *
30932      * <li> The tangent plane projection is also called the "gnomonic
30933      *     projection" and the "central projection".
30934      *
30935      * <li> The eta axis points due north in the adopted coordinate system.
30936      *     If the spherical coordinates are observed (RA,Dec), the tangent
30937      *     plane coordinates (xi,eta) are conventionally called the
30938      *     "standard coordinates".  If the spherical coordinates are with
30939      *     respect to a right-handed triad, (xi,eta) are also right-handed.
30940      *     The units of (xi,eta) are, effectively, radians at the tangent
30941      *     point.
30942      *
30943      * <li> All angular arguments are in radians.
30944      *
30945      * <li> The angles a01 and a02 are returned in the range 0-2pi.  The
30946      *     angles b01 and b02 are returned in the range +/-pi, but in the
30947      *     usual, non-pole-crossing, case, the range is +/-pi/2.
30948      *
30949      * <li> Cases where there is no solution can arise only near the poles.
30950      *     For example, it is clearly impossible for a star at the pole
30951      *     itself to have a non-zero xi value, and hence it is meaningless
30952      *     to ask where the tangent point would have to be to bring about
30953      *     this combination of xi and dec.
30954      *
30955      * <li> Also near the poles, cases can arise where there are two useful
30956      *     solutions.  The return value indicates whether the second of the
30957      *     two solutions returned is useful;  1 indicates only one useful
30958      *     solution, the usual case.
30959      *
30960      * <li> The basis of the algorithm is to solve the spherical triangle PSC,
30961      *     where P is the north celestial pole, S is the star and C is the
30962      *     tangent point.  The spherical coordinates of the tangent point are
30963      *     [a0,b0];  writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), side c
30964      *     is then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
30965      *     found) is (pi/2-b0).  Angle C is given by sin(C) = xi/rho and
30966      *     cos(C) = eta/rho.  Angle P (to be found) is the longitude
30967      *     difference between star and tangent point (a-a0).
30968      *
30969      * <li> This function is a member of the following set:
30970      * 
30971      *{@code
30972      *         spherical      vector         solve for
30973      *
30974      *         iauTpxes      iauTpxev         xi,eta
30975      *         iauTpsts      iauTpstv          star
30976      *       > iauTpors <    iauTporv         origin
30977      *}
30978      *</ol>
30979      *  Called:
30980      *     iauAnp       normalize angle into range 0 to 2pi
30981      *
30982      *  References:
30983      *
30984      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
30985      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
30986      *
30987      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
30988      *     1987, Chapter 13.
30989      *
30990      * @version   2018 January 2
30991      *
30992      * @since JSOFA release 20180130
30993      *
30994      */
30995     public static TangentPointSolution jauTpors(double xi, double eta, double a, double b)
30996     {
30997         double xi2, r, sb, cb, rsb, rcb, w2, w, s, c;
30998         double a01, b01, a02, b02;
30999 
31000 
31001         xi2 = xi*xi;
31002         r = sqrt(1.0 + xi2 + eta*eta);
31003         sb = sin(b);
31004         cb = cos(b);
31005         rsb = r*sb;
31006         rcb = r*cb;
31007         w2 = rcb*rcb - xi2;
31008         if ( w2 >= 0.0 ) {
31009             w = sqrt(w2);
31010             s = rsb - eta*w;
31011             c = rsb*eta + w;
31012             if ( xi == 0.0 && w == 0.0 ) w = 1.0;
31013             a01 = jauAnp(a - atan2(xi,w));
31014             b01 = atan2(s,c);
31015             w = -w;
31016             s = rsb - eta*w;
31017             c = rsb*eta + w;
31018             a02 = jauAnp(a - atan2(xi,w));
31019             b02 = atan2(s,c);
31020             return new TangentPointSolution(new SphericalCoordinate(a01, b01), new SphericalCoordinate(a02, b02), 
31021                     (abs(rsb) < 1.0) ? 1 : 2);
31022         } else {
31023             return new TangentPointSolution();
31024         }
31025 
31026         /* Finished. */
31027 
31028     }
31029 
31030     /**
31031      * Tangent point soutions as direction cosines. A container class for two possible solutiuons as well as an indication of the number of valid solutions.
31032      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
31033      * @since 27 Mar 2018
31034      */
31035     public static class TangentPointDirectionCosines {
31036         public double dc1[];
31037         public double dc2[];
31038         /** nsolution. number of valid solutions.
31039          */
31040         public int nsolution;
31041         /**
31042          * @param dc1 direction cosines 
31043          * @param dc2 direction cosines
31044          * @param nsolution number of valid solutions
31045          */
31046         public TangentPointDirectionCosines(double[] dc1, double[] dc2,
31047                 int nsolution) {
31048             this.dc1 = dc1;
31049             this.dc2 = dc2;
31050             this.nsolution = nsolution;
31051         }
31052         /**
31053          * 
31054          */
31055         public TangentPointDirectionCosines() {
31056             this.nsolution = 0;
31057         }
31058 
31059     }
31060     /**
31061      *
31062      *  In the tangent plane projection, given the rectangular coordinates
31063      *  of a star and its direction cosines, determine the direction
31064      *  cosines of the tangent point.
31065      *
31066      *  <p>This function is derived from the International Astronomical Union's
31067      *  SOFA (Standards of Fundamental Astronomy) software collection.
31068      *
31069      *  <p>Status:  support function.
31070      *
31071      * <!-- Given: -->
31072      *     @param xi   double    rectangular coordinates of star image (Note 2)
31073      *     @param eta     double    rectangular coordinates of star image (Note 2)
31074      *     @param v        double[3] star's direction cosines (Note 3)
31075      *
31076      * <!-- Returned: -->
31077      *     @return       tangent point's direction cosines, Solutions 1 &amp; 2 
31078      *                   int     number of solutions:
31079      *                        0 = no solutions returned (Note 4)
31080      *                        1 = only the first solution is useful (Note 5)
31081      *                        2 = both solutions are useful (Note 5)
31082      *
31083      * <p>Notes: <ol>
31084      *
31085      * <li> The tangent plane projection is also called the "gnomonic
31086      *     projection" and the "central projection".
31087      *
31088      * <li> The eta axis points due north in the adopted coordinate system.
31089      *     If the direction cosines represent observed (RA,Dec), the tangent
31090      *     plane coordinates (xi,eta) are conventionally called the
31091      *     "standard coordinates".  If the direction cosines are with
31092      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31093      *     The units of (xi,eta) are, effectively, radians at the tangent
31094      *     point.
31095      *
31096      * <li> The vector v must be of unit length or the result will be wrong.
31097      *
31098      * <li> Cases where there is no solution can arise only near the poles.
31099      *     For example, it is clearly impossible for a star at the pole
31100      *     itself to have a non-zero xi value, and hence it is meaningless
31101      *     to ask where the tangent point would have to be.
31102      *
31103      * <li> Also near the poles, cases can arise where there are two useful
31104      *     solutions.  The return value indicates whether the second of the
31105      *     two solutions returned is useful;  1 indicates only one useful
31106      *     solution, the usual case.
31107      *
31108      * <li> The basis of the algorithm is to solve the spherical triangle
31109      *     PSC, where P is the north celestial pole, S is the star and C is
31110      *     the tangent point.  Calling the celestial spherical coordinates
31111      *     of the star and tangent point (a,b) and (a0,b0) respectively, and
31112      *     writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), and
31113      *     transforming the vector v into (a,b) in the normal way, side c is
31114      *     then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
31115      *     found) is (pi/2-b0), while angle C is given by sin(C) = xi/rho
31116      *     and cos(C) = eta/rho;  angle P (to be found) is (a-a0).  After
31117      *     solving the spherical triangle, the result (a0,b0) can be
31118      *     expressed in vector form as v0.
31119      *
31120      * <li> This function is a member of the following set:
31121      * {@code
31122      *         spherical      vector         solve for
31123      *
31124      *         iauTpxes      iauTpxev         xi,eta
31125      *         iauTpsts      iauTpstv          star
31126      *         iauTpors    > iauTporv <       origin
31127      * }
31128      *</ol>
31129      *  References:
31130      *
31131      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31132      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31133      *
31134      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31135      *     1987, Chapter 13.
31136      *
31137      * @version   2018 January 2
31138      *
31139      * @since JSOFA release 20180130
31140      *
31141      */
31142 
31143     public static TangentPointDirectionCosines jauTporv(double xi, double eta, double v[])
31144     {
31145         double x, y, z, rxy2, xi2, eta2p1, r, rsb, rcb, w2, w, c;
31146         double v01[] = new double[3];
31147         double v02[] = new double[3];
31148 
31149         x = v[0];
31150         y = v[1];
31151         z = v[2];
31152         rxy2 = x*x + y*y;
31153         xi2 = xi*xi;
31154         eta2p1 = eta*eta + 1.0;
31155         r = sqrt(xi2 + eta2p1);
31156         rsb = r*z;
31157         rcb = r*sqrt(x*x + y*y);
31158         w2 = rcb*rcb - xi2;
31159         if ( w2 > 0.0 ) {
31160             w = sqrt(w2);
31161             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
31162             v01[0] = c * (x*w + y*xi);
31163             v01[1] = c * (y*w - x*xi);
31164             v01[2] = (rsb - eta*w) / eta2p1;
31165             w = - w;
31166             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
31167             v02[0] = c * (x*w + y*xi);
31168             v02[1] = c * (y*w - x*xi);
31169             v02[2] = (rsb - eta*w) / eta2p1;
31170             return new TangentPointDirectionCosines(v01,v02,(abs(rsb) < 1.0) ? 1 : 2);
31171         } else {
31172             return new TangentPointDirectionCosines();
31173         }
31174 
31175         /* Finished. */
31176     }
31177 
31178     /**
31179      *
31180      *  In the tangent plane projection, given the star's rectangular
31181      *  coordinates and the spherical coordinates of the tangent point,
31182      *  solve for the spherical coordinates of the star.
31183      *
31184      *  <p>This function is derived from the International Astronomical Union's
31185      *  SOFA (Standards of Fundamental Astronomy) software collection.
31186      *
31187      *  <p>Status:  support function.
31188      *
31189      * <!-- Given: -->
31190      *     @param xi    double  rectangular coordinates of star image (Note 2)
31191      *     @param eta    double  rectangular coordinates of star image (Note 2)
31192      *     @param a0     double  tangent point's spherical coordinates
31193      *     @param b0     double  tangent point's spherical coordinates
31194      *
31195      * <!-- Returned: -->
31196      *     @return     star's spherical coordinates
31197      *<ol>
31198      * <li> The tangent plane projection is also called the "gnomonic
31199      *     projection" and the "central projection".
31200      *
31201      * <li> The eta axis points due north in the adopted coordinate system.
31202      *     If the spherical coordinates are observed (RA,Dec), the tangent
31203      *     plane coordinates (xi,eta) are conventionally called the
31204      *     "standard coordinates".  If the spherical coordinates are with
31205      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31206      *     The units of (xi,eta) are, effectively, radians at the tangent
31207      *     point.
31208      *
31209      * <li> All angular arguments are in radians.
31210      *
31211      * <li> This function is a member of the following set:
31212      *{@code
31213      *         spherical      vector         solve for
31214      *
31215      *         iauTpxes      iauTpxev         xi,eta
31216      *       > iauTpsts <    iauTpstv          star
31217      *         iauTpors      iauTporv         origin
31218      * }
31219      *</ol>
31220      *  Called:
31221      *     iauAnp       normalize angle into range 0 to 2pi
31222      *
31223      *  References:
31224      *
31225      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31226      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31227      *
31228      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31229      *     1987, Chapter 13.
31230      *
31231      * @version   2018 January 2
31232      *
31233      * @since JSOFA release 20180130
31234      *
31235      */
31236     public static SphericalCoordinate jauTpsts(double xi, double eta, double a0, double b0)
31237     {
31238         double sb0, cb0, d;
31239 
31240         sb0 = sin(b0);
31241         cb0 = cos(b0);
31242         d = cb0 - eta*sb0;
31243         return new SphericalCoordinate( jauAnp(atan2(xi,d) + a0),
31244                 atan2(sb0+eta*cb0, sqrt(xi*xi+d*d)));
31245 
31246         /* Finished. */
31247     }
31248 
31249     /**
31250      * Tangent Plane Position consisting of (xi, eta) pairs in radians.
31251      * 
31252      * 
31253      * <p>Notes: <ol>
31254      *
31255      * <li> The tangent plane projection is also called the "gnomonic
31256      *     projection" and the "central projection".
31257      *
31258      * <li> The eta axis points due north in the adopted coordinate system.
31259      *     If the spherical coordinates are observed (RA,Dec), the tangent
31260      *     plane coordinates (xi,eta) are conventionally called the
31261      *     "standard coordinates".  For right-handed spherical coordinates,
31262      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31263      *     effectively, radians at the tangent point.
31264      *     </ol>
31265      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
31266      * 
31267      * @since JSOFA release 20180130
31268      */
31269     public static class TangentPlaneCoordinate {
31270         public double xi;
31271         public double eta;
31272         /** status.
31273          *                         0 = OK
31274          *                                1 = star too far from axis
31275          *                                2 = antistar on tangent plane
31276          *                                3 = antistar too far from axis
31277          */
31278         public int status;
31279         public TangentPlaneCoordinate(double xi, double eta, int j){
31280             this.xi = xi;
31281             this.eta = eta;
31282             this.status = j;
31283         }
31284     }
31285 
31286 
31287     /**
31288      *
31289      *  In the tangent plane projection, given the star's rectangular
31290      *  coordinates and the direction cosines of the tangent point, solve
31291      *  for the direction cosines of the star.
31292      *
31293      *  <p>This function is derived from the International Astronomical Union's
31294      *  SOFA (Standards of Fundamental Astronomy) software collection.
31295      *
31296      *  <p>Status:  support function.
31297      *
31298      * <!-- Given: -->
31299      *     @param xi  double     rectangular coordinates of star image (Note 2)
31300      *     @param eta  double     rectangular coordinates of star image (Note 2)
31301      *     @param v0      double[3]  tangent point's direction cosines
31302      *
31303      * <!-- Returned: -->
31304      *     @return      double[3]  star's direction cosines
31305      * <ol>
31306      * <li> The tangent plane projection is also called the "gnomonic
31307      *     projection" and the "central projection".
31308      *
31309      * <li> The eta axis points due north in the adopted coordinate system.
31310      *     If the direction cosines represent observed (RA,Dec), the tangent
31311      *     plane coordinates (xi,eta) are conventionally called the
31312      *     "standard coordinates".  If the direction cosines are with
31313      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31314      *     The units of (xi,eta) are, effectively, radians at the tangent
31315      *     point.
31316      *
31317      * <li> The method used is to complete the star vector in the (xi,eta)
31318      *     based triad and normalize it, then rotate the triad to put the
31319      *     tangent point at the pole with the x-axis aligned to zero
31320      *     longitude.  Writing (a0,b0) for the celestial spherical
31321      *     coordinates of the tangent point, the sequence of rotations is
31322      *     (b-pi/2) around the x-axis followed by (-a-pi/2) around the
31323      *     z-axis.
31324      *
31325      * <li> If vector v0 is not of unit length, the returned vector v will
31326      *     be wrong.
31327      *
31328      * <li> If vector v0 points at a pole, the returned vector v will be
31329      *     based on the arbitrary assumption that the longitude coordinate
31330      *     of the tangent point is zero.
31331      *
31332      * <li> This function is a member of the following set:
31333      *{@code
31334      *         spherical      vector         solve for
31335      *
31336      *         iauTpxes      iauTpxev         xi,eta
31337      *         iauTpsts    > iauTpstv <        star
31338      *         iauTpors      iauTporv         origin
31339      * }
31340      *</ol>
31341      *  References:
31342      *
31343      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31344      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31345      *
31346      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31347      *     1987, Chapter 13.
31348      *
31349      * @version   2018 January 2
31350      *
31351      * @since JSOFA release 20180130
31352      *
31353      */
31354     public static double[] jauTpstv(double xi, double eta, double v0[])
31355     {
31356         double x, y, z, f, r;
31357         double v[] = new double[3];
31358 
31359 
31360         /* Tangent point. */
31361         x = v0[0];
31362         y = v0[1];
31363         z = v0[2];
31364 
31365         /* Deal with polar case. */
31366         r = sqrt(x*x + y*y);
31367         if ( r == 0.0 ) {
31368             r = 1e-20;
31369             x = r;
31370         }
31371 
31372         /* Star vector length to tangent plane. */
31373         f = sqrt(1.0 + xi*xi + eta*eta);
31374 
31375         /* Apply the transformation and normalize. */
31376         v[0] = (x - (xi*y + eta*x*z) / r) / f;
31377         v[1] = (y + (xi*x - eta*y*z) / r) / f;
31378         v[2] = (z + eta*r) / f;
31379         return v;
31380 
31381         /* Finished. */
31382 
31383     }
31384 
31385     /**
31386      *
31387      *  In the tangent plane projection, given celestial spherical
31388      *  coordinates for a star and the tangent point, solve for the star's
31389      *  rectangular coordinates in the tangent plane.
31390      *
31391      *  <p>This function is derived from the International Astronomical Union's
31392      *  SOFA (Standards of Fundamental Astronomy) software collection.
31393      *
31394      *  <p>Status:  support function.
31395      *
31396      * <!-- Given: -->
31397      *     @param a       double  star's spherical coordinates
31398      *     @param b       double  star's spherical coordinates
31399      *     @param a0     double  tangent point's spherical coordinates
31400      *     @param b0     double  tangent point's spherical coordinates
31401      *
31402      * <!-- Returned: -->
31403      *     @return  rectangular coordinates of star image (Note 2)
31404       *               int     status:  0 = OK
31405      *                                1 = star too far from axis
31406      *                                2 = antistar on tangent plane
31407      *                                3 = antistar too far from axis
31408      *
31409      * <p>Notes: <ol>
31410      *
31411      * <li> The tangent plane projection is also called the "gnomonic
31412      *     projection" and the "central projection".
31413      *
31414      * <li> The eta axis points due north in the adopted coordinate system.
31415      *     If the spherical coordinates are observed (RA,Dec), the tangent
31416      *     plane coordinates (xi,eta) are conventionally called the
31417      *     "standard coordinates".  For right-handed spherical coordinates,
31418      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31419      *     effectively, radians at the tangent point.
31420      *
31421      * <li> All angular arguments are in radians.
31422      *
31423      * <li> This function is a member of the following set:
31424      *{@code
31425      *         spherical      vector         solve for
31426      *
31427      *       > iauTpxes <    iauTpxev         xi,eta
31428      *         iauTpsts      iauTpstv          star
31429      *         iauTpors      iauTporv         origin
31430      *}
31431      *</ol>
31432      *  References:
31433      *
31434      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31435      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31436      *
31437      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31438      *     1987, Chapter 13.
31439      *
31440      * @version   2018 January 2
31441      *
31442      * @since JSOFA release 20180130
31443      *
31444      */
31445     public static TangentPlaneCoordinate jauTpxes(double a, double b, double a0, double b0)
31446     {
31447         int j;
31448         double sb0, sb, cb0, cb, da, sda, cda, d;
31449 
31450 
31451         /* Functions of the spherical coordinates. */
31452         sb0 = sin(b0);
31453         sb = sin(b);
31454         cb0 = cos(b0);
31455         cb = cos(b);
31456         da = a - a0;
31457         sda = sin(da);
31458         cda = cos(da);
31459 
31460         /* Reciprocal of star vector length to tangent plane. */
31461         d = sb*sb0 + cb*cb0*cda;
31462 
31463         /* Check for error cases. */
31464         if ( d > TANGENT_TINY ) {
31465             j = 0;
31466         } else if ( d >= 0.0 ) {
31467             j = 1;
31468             d = TANGENT_TINY;
31469         } else if ( d > -TANGENT_TINY ) {
31470             j = 2;
31471             d = -TANGENT_TINY;
31472         } else {
31473             j = 3;
31474         }
31475 
31476         /* Return the tangent plane coordinates (even in dubious cases). */
31477         return new TangentPlaneCoordinate( cb*sda / d,
31478                 (sb*cb0 - cb*sb0*cda) / d, j);
31479 
31480 
31481         /* Finished. */
31482     }
31483 
31484     /**
31485      *
31486      *  In the tangent plane projection, given celestial direction cosines
31487      *  for a star and the tangent point, solve for the star's rectangular
31488      *  coordinates in the tangent plane.
31489      *
31490      *  <p>This function is derived from the International Astronomical Union's
31491      *  SOFA (Standards of Fundamental Astronomy) software collection.
31492      *
31493      *  <p>Status:  support function.
31494      *
31495      * <!-- Given: -->
31496      *     @param v         double[3]  direction cosines of star (Note 4)
31497      *     @param v0        double[3]  direction cosines of tangent point (Note 4)
31498      *
31499      * <!-- Returned: -->
31500      *     @return     tangent plane coordinates of star
31501      *               int        status: 0 = OK
31502      *                                  1 = star too far from axis
31503      *                                  2 = antistar on tangent plane
31504      *                                  3 = antistar too far from axis
31505      *
31506      * <p>Notes: <ol>
31507      *
31508      * <li> The tangent plane projection is also called the "gnomonic
31509      *     projection" and the "central projection".
31510      *
31511      * <li> The eta axis points due north in the adopted coordinate system.
31512      *     If the direction cosines represent observed (RA,Dec), the tangent
31513      *     plane coordinates (xi,eta) are conventionally called the
31514      *     "standard coordinates".  If the direction cosines are with
31515      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31516      *     The units of (xi,eta) are, effectively, radians at the tangent
31517      *     point.
31518      *
31519      * <li> The method used is to extend the star vector to the tangent
31520      *     plane and then rotate the triad so that (x,y) becomes (xi,eta).
31521      *     Writing (a,b) for the celestial spherical coordinates of the
31522      *     star, the sequence of rotations is (a+pi/2) around the z-axis
31523      *     followed by (pi/2-b) around the x-axis.
31524      *
31525      * <li> If vector v0 is not of unit length, or if vector v is of zero
31526      *     length, the results will be wrong.
31527      *
31528      * <li> If v0 points at a pole, the returned (xi,eta) will be based on
31529      *     the arbitrary assumption that the longitude coordinate of the
31530      *     tangent point is zero.
31531      *
31532      * <li> This function is a member of the following set:
31533      *{@code
31534      *         spherical      vector         solve for
31535      *
31536      *         iauTpxes    > iauTpxev <       xi,eta
31537      *         iauTpsts      iauTpstv          star
31538      *         iauTpors      iauTporv         origin
31539      * }
31540      *</ol>
31541      *  References:
31542      *
31543      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31544      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31545      *
31546      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31547      *     1987, Chapter 13.
31548      *
31549      * @version   2018 January 2
31550      *
31551      * @since JSOFA release 20180130
31552      *
31553      */
31554     public static TangentPlaneCoordinate jauTpxev(double v[], double v0[])
31555     {
31556         int j;
31557         double x, y, z, x0, y0, z0, r2, r, w, d;
31558 
31559 
31560         /* Star and tangent point. */
31561         x = v[0];
31562         y = v[1];
31563         z = v[2];
31564         x0 = v0[0];
31565         y0 = v0[1];
31566         z0 = v0[2];
31567 
31568         /* Deal with polar case. */
31569         r2 = x0*x0 + y0*y0;
31570         r = sqrt(r2);
31571         if ( r == 0.0 ) {
31572             r = 1e-20;
31573             x0 = r;
31574         }
31575 
31576         /* Reciprocal of star vector length to tangent plane. */
31577         w = x*x0 + y*y0;
31578         d = w + z*z0;
31579 
31580         /* Check for error cases. */
31581         if ( d > TANGENT_TINY ) {
31582             j = 0;
31583         } else if ( d >= 0.0 ) {
31584             j = 1;
31585             d = TANGENT_TINY;
31586         } else if ( d > -TANGENT_TINY ) {
31587             j = 2;
31588             d = -TANGENT_TINY;
31589         } else {
31590             j = 3;
31591         }
31592 
31593         /* Return the tangent plane coordinates (even in dubious cases). */
31594         d *= r;
31595         return new TangentPlaneCoordinate( (y*x0 - x*y0) / d,
31596                 (z*r2 - z0*w) / d, j);
31597 
31598 
31599         /* Finished. */
31600     }
31601 
31602     /**
31603      *  Convert B1950.0 FK4 star catalog data to J2000.0 FK5.
31604      *  This function converts a star's catalog data from the old FK4
31605      * (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system.
31606      *  
31607      *  <p>This function is derived from the International Astronomical Union's
31608      *  SOFA (Standards of Fundamental Astronomy) software collection.
31609      *  
31610      *  Status:  support function.
31611      *  
31612      * 
31613      *  <!-- Given: --> (all B1950.0, FK4)
31614      *     @param r1950    double   B1950.0 RA (rad)
31615      *     @param d1950    double   B1950.0 Dec (rad)
31616      *     @param dr1950  double   B1950.0 proper motions (rad/trop.yr)
31617      *     @param dd1950  double   B1950.0 proper motions (rad/trop.yr)
31618      *     @param p1950          double   parallax (arcsec)
31619      *     @param v1950          double   radial velocity (km/s, +ve = moving away)
31620      *  Returned:
31621      *  
31622      *   @return  - catalogue coordinates (all J2000.0, FK5)
31623      *   
31624      * <p>Notes: <ol>
31625      * 
31626      * <li> The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt,
31627      *     and are per year rather than per century.
31628      * <li> The conversion is somewhat complicated, for several reasons:
31629      *     . Change of standard epoch from B1950.0 to J2000.0.
31630      *     . An intermediate transition date of 1984 January 1.0 TT.
31631      *     . A change of precession model.
31632      *     . Change of time unit for proper motion (tropical to Julian).
31633      *     . FK4 positions include the E-terms of aberration, to simplify
31634      *       the hand computation of annual aberration.  FK5 positions
31635      *       assume a rigorous aberration computation based on the Earth's
31636      *       barycentric velocity.
31637      *     . The E-terms also affect proper motions, and in particular cause
31638      *       objects at large distances to exhibit fictitious proper
31639      *       motions.
31640      *     The algorithm is based on Smith et al. (1989) and Yallop et al.
31641      *     (1989), which presented a matrix method due to Standish (1982) as
31642      *     developed by Aoki et al. (1983), using Kinoshita's development of
31643      *     Andoyer's post-Newcomb precession.  The numerical constants from
31644      *     Seidelmann (1992) are used canonically.
31645      * <li> Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for.
31646      *     Conversions for different epochs and equinoxes would require
31647      *     additional treatment for precession, proper motion and E-terms.
31648      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31649      *     of the poles do not embody differential E-terms effects and
31650      *     should, strictly speaking, be handled in a different manner from
31651      *     stars outside these regions.  However, given the general lack of
31652      *     homogeneity of the star data available for routine astrometry,
31653      *     the difficulties of handling positions that may have been
31654      *     determined from astrometric fields spanning the polar and non-
31655      *     polar regions, the likelihood that the differential E-terms
31656      *     effect was not taken into account when allowing for proper motion
31657      *     in past astrometry, and the undesirability of a discontinuity in
31658      *     the algorithm, the decision has been made in this SOFA algorithm
31659      *     to include the effects of differential E-terms on the proper
31660      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31661      *     and measuring "on the sky" rather than in terms of RA change, the
31662      *     errors resulting from this simplification are less than
31663      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31664      *     proper motion.
31665      * </ol>
31666      *  Called:
31667      *     iauAnp       normalize angle into range 0 to 2pi
31668      *     iauPv2s      pv-vector to spherical coordinates
31669      *     iauPdp       scalar product of two p-vectors
31670      *     iauPvmpv     pv-vector minus pv_vector
31671      *     iauPvppv     pv-vector plus pv_vector
31672      *     iauS2pv      spherical coordinates to pv-vector
31673      *     iauSxp       multiply p-vector by scalar
31674      * <p> References: <ul>
31675      * <li> Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31676      *     FK4-based positions of stars to epoch J2000.0 positions in
31677      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31678      *     128, 263-267.
31679      *  <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31680      *     Astronomical Almanac", ISBN 0-935702-68-7.
31681      * <li>Smith, C.A. et al., 1989, "The transformation of astrometric
31682      *     catalog systems to the equinox J2000.0".  Astron.J. 97, 265.
31683      * <li>Standish, E.M., 1982, "Conversion of positions and proper motions
31684      *     from B1950.0 to the IAU system at J2000.0".  Astron.Astrophys.,
31685      *     115, 1, 20-22.
31686      * <li>Yallop, B.D. et al., 1989, "Transformation of mean star places
31687      *     from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
31688      *     Astron.J. 97, 274.
31689      *     </ul>
31690      *  @version   2018 December 5
31691      *  @since SOFA release 2019-07-22
31692      */
31693     public static CatalogCoords jauFk425(double r1950, double d1950,
31694             double dr1950, double dd1950,
31695             double p1950, double v1950
31696             )
31697     {
31698         /* Radians per year to arcsec per century */
31699         final double PMF = 100.0*DR2AS;
31700 
31701         /* Small number to avoid arithmetic problems */
31702         final double TINY = 1e-30;
31703 
31704         /* Miscellaneous */
31705         double r, d, ur, ud, px, rv, pxvf, w;
31706         int i, j, k, l;
31707 
31708         /* Pv-vectors */
31709         double r0[][], 
31710         pv1[][], pv2[][] = new double[2][3];
31711 
31712         /*
31713          * CANONICAL CONSTANTS (Seidelmann 1992)
31714          */
31715 
31716         /* Km per sec to AU per tropical century */
31717         /* = 86400 * 36524.2198782 / 149597870.7 */
31718         final double VF = 21.095;
31719 
31720         /* Constant pv-vector (cf. Seidelmann 3.591-2, vectors A and Adot) */
31721         final double a[][] = new double[][] {
31722             { -1.62557e-6, -0.31919e-6, -0.13843e-6 },
31723             { +1.245e-3,   -1.580e-3,   -0.659e-3   }
31724         };
31725 
31726         /* 3x2 matrix of pv-vectors (cf. Seidelmann 3.591-4, matrix M) */
31727         final double em[][][][] = new double [][][][] {
31728 
31729             { { { +0.9999256782,     -0.0111820611,     -0.0048579477     },
31730                 { +0.00000242395018, -0.00000002710663, -0.00000001177656 } },
31731 
31732                 { { +0.0111820610,     +0.9999374784,     -0.0000271765     },
31733                     { +0.00000002710663, +0.00000242397878, -0.00000000006587 } },
31734 
31735                 { { +0.0048579479,     -0.0000271474,     +0.9999881997,    },
31736                         { +0.00000001177656, -0.00000000006582, +0.00000242410173 } } },
31737 
31738             { { { -0.000551,         -0.238565,         +0.435739        },
31739                 { +0.99994704,       -0.01118251,       -0.00485767       } },
31740 
31741                             { { +0.238514,         -0.002667,         -0.008541        },
31742                     { +0.01118251,       +0.99995883,       -0.00002718       } },
31743 
31744                             { { -0.435623,         +0.012254,         +0.002117         },
31745                         { +0.00485767,       -0.00002714,       +1.00000956       } } }
31746 
31747         };
31748 
31749         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31750 
31751         /* The FK4 data (units radians and arcsec per tropical century). */
31752         r = r1950;
31753         d = d1950;
31754         ur = dr1950*PMF;
31755         ud = dd1950*PMF;
31756         px = p1950;
31757         rv = v1950;
31758 
31759         /* Express as a pv-vector. */
31760         pxvf = px*VF;
31761         w = rv*pxvf;
31762         r0 = jauS2pv(r, d, 1.0, ur, ud, w);
31763 
31764         /* Allow for E-terms (cf. Seidelmann 3.591-2). */
31765         pv1 = jauPvmpv(r0, a);
31766         pv2[0] = jauSxp(jauPdp(r0[0], a[0]), r0[0]);
31767         pv2[1] = jauSxp(jauPdp(r0[0], a[1]), r0[0]);
31768         pv1 = jauPvppv(pv1, pv2);
31769 
31770         /* Convert pv-vector to Fricke system (cf. Seidelmann 3.591-3). */
31771         for ( i = 0; i < 2; i++ ) {
31772             for ( j = 0; j < 3; j++ ) {
31773                 w = 0.0;
31774                 for ( k = 0; k < 2; k++ ) {
31775                     for ( l = 0; l < 3; l++ ) {
31776                         w += em[i][j][k][l] * pv1[k][l];
31777                     }
31778                 }
31779                 pv2[i][j] = w;
31780             }
31781         }
31782 
31783         /* Revert to catalog form. */
31784         SphericalPositionVelocity sv = jauPv2s(pv2);//, &r, &d, &w, &ur, &ud, &rd);
31785         if ( px > TINY ) {
31786             rv = sv.vel.r/pxvf;
31787             px = px/sv.pos.r;
31788         }
31789 
31790         /* Return the results. */
31791         return new CatalogCoords(jauAnp(sv.pos.theta), sv.pos.phi, sv.vel.theta/PMF, sv.vel.phi/PMF, px, rv);
31792 
31793     }  
31794 
31795 
31796     /**
31797      *  Convert a B1950.0 FK4 star position to J2000.0 FK5, assuming zero
31798      *  proper motion in the FK5 system.
31799      *  <p>This function is derived from the International Astronomical Union's
31800      *  SOFA (Standards of Fundamental Astronomy) software collection.
31801      *  Status:  support function.
31802      *  This function converts a star's catalog data from the old FK4
31803      *  (Bessel-Newcomb) system to the later IAU 1976 FK5 (Fricke) system,
31804      *  in such a way that the FK5 proper motion is zero.  Because such a
31805      *  star has, in general, a non-zero proper motion in the FK4 system,
31806      *  the routine requires the epoch at which the position in the FK4
31807      *  system was determined.
31808      *  
31809      *  <!-- Given: -->
31810      *     @param r1950    double   B1950.0 FK4 RA at epoch (rad)
31811      *     @param d1950    double   B1950.0 FK4 Dec at epoch (rad)
31812      *     @param bepoch         double   Besselian epoch (e.g. 1979.3)
31813      * <!-- Returned: -->
31814      *     @return  J2000.0 FK5 RA,Dec (rad)
31815      * <p>Notes: <ol>
31816 
31817      * <li> The epoch bepoch is strictly speaking Besselian, but if a
31818      *     Julian epoch is supplied the result will be affected only to a
31819      *     negligible extent.
31820      * <li> The method is from Appendix 2 of Aoki et al. (1983), but using
31821      *     the constants of Seidelmann (1992).  See the routine iauFk425
31822      *     for a general introduction to the FK4 to FK5 conversion.
31823      * <li> Conversion from equinox B1950.0 FK4 to equinox J2000.0 FK5 only
31824      *     is provided for.  Conversions for different starting and/or
31825      *     ending epochs would require additional treatment for precession,
31826      *     proper motion and E-terms.
31827      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31828      *     of the poles do not embody differential E-terms effects and
31829      *     should, strictly speaking, be handled in a different manner from
31830      *     stars outside these regions.  However, given the general lack of
31831      *     homogeneity of the star data available for routine astrometry,
31832      *     the difficulties of handling positions that may have been
31833      *     determined from astrometric fields spanning the polar and non-
31834      *     polar regions, the likelihood that the differential E-terms
31835      *     effect was not taken into account when allowing for proper motion
31836      *     in past astrometry, and the undesirability of a discontinuity in
31837      *     the algorithm, the decision has been made in this SOFA algorithm
31838      *     to include the effects of differential E-terms on the proper
31839      *     motions for all stars, whether polar or not.  At epoch 2000.0,
31840      *     and measuring "on the sky" rather than in terms of RA change, the
31841      *     errors resulting from this simplification are less than
31842      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31843      *     proper motion.
31844      * </ol>
31845      * <p> References: <ul>
31846      * <li>Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31847      *     FK4-based positions of stars to epoch J2000.0 positions in
31848      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31849      *     128, 263-267.
31850      * <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
31851      *     Astronomical Almanac", ISBN 0-935702-68-7.
31852      * </ul>
31853      *  Called:
31854      *     iauAnp       normalize angle into range 0 to 2pi
31855      *     iauC2s       p-vector to spherical
31856      *     iauEpb2jd    Besselian epoch to Julian date
31857      *     iauEpj       Julian date to Julian epoch
31858      *     iauPdp       scalar product of two p-vectors
31859      *     iauPmp       p-vector minus p-vector
31860      *     iauPpsp      p-vector plus scaled p-vector
31861      *     iauPvu       update a pv-vector
31862      *     iauS2c       spherical to p-vector
31863      *  @version   2018 December 5
31864      *  @since SOFA release 2019-07-22
31865      */
31866     public static SphericalCoordinate jauFk45z(double r1950, double d1950, double bepoch)
31867     {
31868         /* Radians per year to arcsec per century */
31869         final double PMF = 100.0*DR2AS;
31870 
31871         /* Position and position+velocity vectors */
31872         double r0[], p[], pv[][] = new double[2][3];
31873 
31874         /* Miscellaneous */
31875         double w;
31876         int i, j, k;
31877 
31878         /*
31879          * CANONICAL CONSTANTS (Seidelmann 1992)
31880          */
31881 
31882         /* Vectors A and Adot (Seidelmann 3.591-2) */
31883         final double a[]  = new double[]{ -1.62557e-6, -0.31919e-6, -0.13843e-6 };
31884         final double ad[] = new double[]{ +1.245e-3,   -1.580e-3,   -0.659e-3   };
31885 
31886         /* 3x2 matrix of p-vectors (cf. Seidelmann 3.591-4, matrix M) */
31887         final double em[][][] = new double[][][] {
31888             { { +0.9999256782, -0.0111820611, -0.0048579477 },
31889                 { +0.0111820610, +0.9999374784, -0.0000271765 },
31890                 { +0.0048579479, -0.0000271474, +0.9999881997 } },
31891             { { -0.000551,     -0.238565,     +0.435739     },
31892                     { +0.238514,     -0.002667,     -0.008541     },
31893                     { -0.435623,     +0.012254,     +0.002117     } }
31894         };
31895 
31896         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
31897 
31898         /* Spherical coordinates to p-vector. */
31899         r0 = jauS2c(r1950, d1950);
31900 
31901         /* Adjust p-vector A to give zero proper motion in FK5. */
31902         w  = (bepoch - 1950) / PMF;
31903         p = jauPpsp(a, w, ad );
31904 
31905         /* Remove E-terms. */
31906         p = jauPpsp(p, -jauPdp(r0,p), r0);
31907         p = jauPmp(r0, p);
31908 
31909         /* Convert to Fricke system pv-vector (cf. Seidelmann 3.591-3). */
31910         for ( i = 0; i < 2; i++ ) {
31911             for ( j = 0; j < 3; j++ ) {
31912                 w = 0.0;
31913                 for ( k = 0; k < 3; k++ ) {
31914                     w += em[i][j][k] * p[k];
31915                 }
31916                 pv[i][j] = w;
31917             }
31918         }
31919 
31920         /* Allow for fictitious proper motion. */
31921         JulianDate jd = jauEpb2jd(bepoch);
31922         w = (jauEpj(jd.djm0,jd.djm1)-2000.0) / PMF;
31923         pv = jauPvu(w, pv);
31924 
31925         /* Revert to spherical coordinates. */
31926         SphericalCoordinate sc = jauC2s(pv[0]);
31927         sc.alpha = jauAnp(sc.alpha);
31928         return sc;
31929 
31930     }
31931 
31932 
31933     /**
31934      *  Convert J2000.0 FK5 star catalog data to B1950.0 FK4.
31935       *  <p>This function is derived from the International Astronomical Union's
31936      *  SOFA (Standards of Fundamental Astronomy) software collection.
31937      *  Status:  support function.
31938      *  <!--Given: (all J2000.0, FK5) -->
31939      *     @param r2000   double   J2000.0 RA (rad)
31940      *     @param d2000    double   J2000.0 Dec (rad)
31941      *     @param dr2000  double   J2000.0 proper motions (rad/Jul.yr)
31942      *     @param dd2000  double   J2000.0 proper motions (rad/Jul.yr)
31943      *     @param p2000          double   parallax (arcsec)
31944      *     @param v2000          double   radial velocity (km/s, +ve = moving away)
31945      *  
31946      *   @return (all B1950.0, FK4)
31947      * <p>Notes: <ol>
31948 
31949      * <li> The proper motions in RA are dRA/dt rather than cos(Dec)*dRA/dt,
31950      *     and are per year rather than per century.
31951      * <li> The conversion is somewhat complicated, for several reasons:
31952      *     . Change of standard epoch from J2000.0 to B1950.0.
31953      *     . An intermediate transition date of 1984 January 1.0 TT.
31954      *     . A change of precession model.
31955      *     . Change of time unit for proper motion (Julian to tropical).
31956      *     . FK4 positions include the E-terms of aberration, to simplify
31957      *       the hand computation of annual aberration.  FK5 positions
31958      *       assume a rigorous aberration computation based on the Earth's
31959      *       barycentric velocity.
31960      *     . The E-terms also affect proper motions, and in particular cause
31961      *       objects at large distances to exhibit fictitious proper
31962      *       motions.
31963      *     The algorithm is based on Smith et al. (1989) and Yallop et al.
31964      *     (1989), which presented a matrix method due to Standish (1982) as
31965      *     developed by Aoki et al. (1983), using Kinoshita's development of
31966      *     Andoyer's post-Newcomb precession.  The numerical constants from
31967      *     Seidelmann (1992) are used canonically.
31968      * <li> In the FK4 catalog the proper motions of stars within 10 degrees
31969      *     of the poles do not embody differential E-terms effects and
31970      *     should, strictly speaking, be handled in a different manner from
31971      *     stars outside these regions.  However, given the general lack of
31972      *     homogeneity of the star data available for routine astrometry,
31973      *     the difficulties of handling positions that may have been
31974      *     determined from astrometric fields spanning the polar and non-
31975      *     polar regions, the likelihood that the differential E-terms
31976      *     effect was not taken into account when allowing for proper motion
31977      *     in past astrometry, and the undesirability of a discontinuity in
31978      *     the algorithm, the decision has been made in this SOFA algorithm
31979      *     to include the effects of differential E-terms on the proper
31980      *     motions for all stars, whether polar or not.  At epoch J2000.0,
31981      *     and measuring "on the sky" rather than in terms of RA change, the
31982      *     errors resulting from this simplification are less than
31983      *     1 milliarcsecond in position and 1 milliarcsecond per century in
31984      *     proper motion.
31985      * </ol>
31986      *  Called:
31987      *     iauAnp       normalize angle into range 0 to 2pi
31988      *     iauPdp       scalar product of two p-vectors
31989      *     iauPm        modulus of p-vector
31990      *     iauPmp       p-vector minus p-vector
31991      *     iauPpp       p-vector pluus p-vector
31992      *     iauPv2s      pv-vector to spherical coordinates
31993      *     iauS2pv      spherical coordinates to pv-vector
31994      *     iauSxp       multiply p-vector by scalar
31995      * <p> References: <ul>
31996      * <li>Aoki, S. et al., 1983, "Conversion matrix of epoch B1950.0
31997      *     FK4-based positions of stars to epoch J2000.0 positions in
31998      *     accordance with the new IAU resolutions".  Astron.Astrophys.
31999      *     128, 263-267.
32000      * <li>Seidelmann, P.K. (ed), 1992, "Explanatory Supplement to the
32001      *     Astronomical Almanac", ISBN 0-935702-68-7.
32002      * <li>Smith, C.A. et al., 1989, "The transformation of astrometric
32003      *     catalog systems to the equinox J2000.0".  Astron.J. 97, 265.
32004      * <li>Standish, E.M., 1982, "Conversion of positions and proper motions
32005      *     from B1950.0 to the IAU system at J2000.0".  Astron.Astrophys.,
32006      *     115, 1, 20-22.
32007      * <li>Yallop, B.D. et al., 1989, "Transformation of mean star places
32008      *     from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
32009      *     Astron.J. 97, 274.
32010      *     </ul>
32011      *  @version   2018 December 5
32012      *  @since SOFA release 2019-07-22
32013      */
32014     public static CatalogCoords jauFk524(double r2000, double d2000,
32015             double dr2000, double dd2000,
32016             double p2000, double v2000)
32017     {
32018         /* Radians per year to arcsec per century */
32019         final double PMF = 100.0*DR2AS;
32020 
32021         /* Small number to avoid arithmetic problems */
32022         final double TINY = 1e-30;
32023 
32024         /* Miscellaneous */
32025         double r, d, ur, ud, px, rv, pxvf, w;
32026         int i, j, k, l;
32027 
32028         /* Vectors, p and pv */
32029         double r0[][], r1[][] = new double[2][3], p1[], p2[], pv[][] = new double[2][3];
32030 
32031         /*
32032          * CANONICAL CONSTANTS (Seidelmann 1992)
32033          */
32034 
32035         /* Km per sec to AU per tropical century */
32036         /* = 86400 * 36524.2198782 / 149597870.7 */
32037         final double VF = 21.095;
32038 
32039         /* Constant pv-vector (cf. Seidelmann 3.591-2, vectors A and Adot) */
32040         final double a[][] = new double[][] {
32041             { -1.62557e-6, -0.31919e-6, -0.13843e-6 },
32042             { +1.245e-3,   -1.580e-3,   -0.659e-3   }
32043         };
32044 
32045         /* 3x2 matrix of pv-vectors (cf. Seidelmann 3.592-1, matrix M^-1) */
32046         final double em[][][][] = new double[][][][] {
32047 
32048             { { { +0.9999256795,     +0.0111814828,     +0.0048590039,    },
32049                 { -0.00000242389840, -0.00000002710544, -0.00000001177742 } },
32050 
32051                 { { -0.0111814828,     +0.9999374849,     -0.0000271771,    },
32052                     { +0.00000002710544, -0.00000242392702, +0.00000000006585 } },
32053 
32054                 { { -0.0048590040,     -0.0000271557,     +0.9999881946,    },
32055                         { +0.00000001177742, +0.00000000006585, -0.00000242404995 } } },
32056 
32057             { { { -0.000551,         +0.238509,         -0.435614,        },
32058                 { +0.99990432,       +0.01118145,       +0.00485852       } },
32059 
32060                             { { -0.238560,         -0.002667,         +0.012254,        },
32061                     { -0.01118145,       +0.99991613,       -0.00002717       } },
32062 
32063                             { { +0.435730,         -0.008541,         +0.002117,        },
32064                         { -0.00485852,       -0.00002716,       +0.99996684       } } }
32065 
32066         };
32067 
32068         /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
32069 
32070         /* The FK5 data (units radians and arcsec per Julian century). */
32071         r = r2000;
32072         d = d2000;
32073         ur = dr2000*PMF;
32074         ud = dd2000*PMF;
32075         px = p2000;
32076         rv = v2000;
32077 
32078         /* Express as a pv-vector. */
32079         pxvf = px * VF;
32080         w = rv * pxvf;
32081         r0 = jauS2pv(r, d, 1.0, ur, ud, w);
32082 
32083         /* Convert pv-vector to Bessel-Newcomb system (cf. Seidelmann 3.592-1). */
32084         for ( i = 0; i < 2; i++ ) {
32085             for ( j = 0; j < 3; j++ ) {
32086                 w = 0.0;
32087                 for ( k = 0; k < 2; k++ ) {
32088                     for ( l = 0; l < 3; l++ ) {
32089                         w += em[i][j][k][l] * r0[k][l];
32090                     }
32091                 }
32092                 r1[i][j] = w;
32093             }
32094         }
32095 
32096         /* Apply E-terms (equivalent to Seidelmann 3.592-3, one iteration). */
32097 
32098         /* Direction. */
32099         w = jauPm(r1[0]);
32100         p1 =jauSxp(jauPdp(r1[0],a[0]), r1[0]);
32101         p2 = jauSxp(w, a[0]);
32102         p1 = jauPmp(p2, p1);
32103         p1 = jauPpp(r1[0], p1);
32104 
32105         /* Recompute length. */
32106         w = jauPm(p1);
32107 
32108         /* Direction. */
32109         p1 = jauSxp(jauPdp(r1[0],a[0]), r1[0]);
32110         p2 = jauSxp(w, a[0]);
32111         p1 = jauPmp(p2, p1);
32112         pv[0] = jauPpp(r1[0], p1);
32113 
32114         /* Derivative. */
32115         p1 =jauSxp(jauPdp(r1[0],a[1]), pv[0]);
32116         p2 = jauSxp(w, a[1]);
32117         p1 = jauPmp(p2, p1);
32118         pv[1] = jauPpp(r1[1], p1);
32119 
32120         /* Revert to catalog form. */
32121         SphericalPositionVelocity sv = jauPv2s(pv);//, &r, &d, &w, &ur, &ud, &rd);
32122         if ( px > TINY ) {
32123             rv = sv.vel.r/pxvf;
32124             px = px/sv.pos.r;
32125         }
32126 
32127         /* Return the results. */
32128         return new CatalogCoords(jauAnp(sv.pos.theta), sv.pos.phi, sv.vel.theta/PMF, sv.vel.phi/PMF, px, rv);
32129     }
32130 
32131     /**
32132      *  Convert a J2000.0 FK5 star position to B1950.0 FK4, assuming zero
32133      *  proper motion in FK5 and parallax.
32134      *  <p>This function is derived from the International Astronomical Union's
32135      *  SOFA (Standards of Fundamental Astronomy) software collection.
32136      *  Status:  support function.
32137      *     @param r2000    double   J2000.0 FK5 RA (rad)
32138      *     @param d2000    double   J2000.0 FK5 Dec (rad)
32139      *     @param bepoch         double   Besselian epoch (e.g. 1950.0)
32140      *     @return    B1950.0 FK4 RA,Dec (rad) at epoch BEPOCH
32141      * 
32142      * <p>Notes: <ol>
32143 
32144      * <li> In contrast to the iauFk524  routine, here the FK5 proper
32145      *     motions, the parallax and the radial velocity are presumed zero.
32146      * <li> This function converts a star position from the IAU 1976 FK5
32147      *    (Fricke) system to the former FK4 (Bessel-Newcomb) system, for
32148      *     cases such as distant radio sources where it is presumed there is
32149      *     zero parallax and no proper motion.  Because of the E-terms of
32150      *     aberration, such objects have (in general) non-zero proper motion
32151      *     in FK4, and the present routine returns those fictitious proper
32152      *     motions.
32153      * <li> Conversion from B1950.0 FK4 to J2000.0 FK5 only is provided for.
32154      *     Conversions involving other equinoxes would require additional
32155      *     treatment for precession.
32156      * <li> The position returned by this routine is in the B1950.0 FK4
32157      *     reference system but at Besselian epoch BEPOCH.  For comparison
32158      *     with catalogs the BEPOCH argument will frequently be 1950.0. (In
32159      *     this context the distinction between Besselian and Julian epoch
32160      *     is insignificant.)
32161      * <li> The RA component of the returned (fictitious) proper motion is
32162      *     dRA/dt rather than cos(Dec)*dRA/dt.
32163      * </ol>
32164      *  Called:
32165      *     jauAnp       normalize angle into range 0 to 2pi
32166      *     jauC2s       p-vector to spherical
32167      *     jauFk524     FK4 to FK5
32168      *     jauS2c       spherical to p-vector
32169      *  @version   2018 December 5
32170      *  @since SOFA release 2019-07-22
32171      */
32172     public static CatalogCoords jauFk54z(double r2000, double d2000, double bepoch)
32173     {
32174         double  p[], w, v[]= new double[3];
32175         int i;
32176 
32177 
32178         /* FK5 equinox J2000.0 to FK4 equinox B1950.0. */
32179         CatalogCoords cc = jauFk524(r2000, d2000, 0.0, 0.0, 0.0, 0.0);
32180 
32181         /* Spherical to Cartesian. */
32182         p = jauS2c(cc.pos.alpha, cc.pos.delta );
32183 
32184         /* Fictitious proper motion (radians per year). */
32185         v[0] = - cc.pm.alpha*p[1] - cc.pm.delta*cos(cc.pos.alpha)*sin(cc.pos.delta);
32186         v[1] =   cc.pm.alpha*p[0] - cc.pm.delta*sin(cc.pos.alpha)*sin(cc.pos.delta);
32187         v[2] =             cc.pm.delta*cos(cc.pos.delta);
32188 
32189         /* Apply the motion. */
32190         w = bepoch - 1950.0;
32191         for ( i = 0; i < 3; i++ ) {
32192             p[i] += w*v[i];
32193         }
32194 
32195         /* Cartesian to spherical. */
32196         SphericalCoordinate sp = jauC2s(p);
32197         cc.pos.alpha = jauAnp(sp.alpha);
32198         cc.pos.delta = sp.delta;
32199 
32200         return cc;
32201 
32202     }
32203 
32204 /*
32205 * Coefficients for Moon longitude and distance series
32206 */
32207    private static class Termlr {
32208       int nd;           /* multiple of D  in argument           */
32209       int nem;          /*     "    "  M   "    "               */
32210       int nemp;         /*     "    "  M'  "    "               */
32211       int nf;           /*     "    "  F   "    "               */
32212       double coefl;     /* coefficient of L sine argument (deg) */
32213       double coefr;     /* coefficient of R cosine argument (m) */
32214     public Termlr(int nd, int nem, int nemp, int nf, double coefl,
32215             double coefr) {
32216         this.nd = nd;
32217         this.nem = nem;
32218         this.nemp = nemp;
32219         this.nf = nf;
32220         this.coefl = coefl;
32221         this.coefr = coefr;
32222     }
32223    };
32224 
32225 /*
32226 * Coefficients for Moon latitude series
32227 */
32228    private static class Termb {
32229       int nd;           /* multiple of D  in argument           */
32230       int nem;          /*     "    "  M   "    "               */
32231       int nemp;         /*     "    "  M'  "    "               */
32232       int nf;           /*     "    "  F   "    "               */
32233       double coefb;     /* coefficient of B sine argument (deg) */
32234     public Termb(int nd, int nem, int nemp, int nf, double coefb) {
32235         this.nd = nd;
32236         this.nem = nem;
32237         this.nemp = nemp;
32238         this.nf = nf;
32239         this.coefb = coefb;
32240     }
32241    };
32242 
32243 
32244    /**
32245     *
32246     *  Approximate geocentric position and velocity of the Moon.
32247     *
32248     *  This function is part of the International Astronomical Union's
32249     *  SOFA (Standards Of Fundamental Astronomy) software collection.
32250     *
32251     *  <p>Status:  support function.
32252     *
32253     *  <p>n.b. Not IAU-endorsed and without canonical status.
32254     *
32255     *  <!-- Given: -->
32256     *  @param   date1  double         TT date part A (Notes 1,4)
32257     *  @param   date2  double         TT date part B (Notes 1,4)
32258     *
32259     *  <!-- Returned: -->
32260     *  @return   pv     double[2][3]   Moon p,v, GCRS (AU, AU/d, Note 5)
32261     *
32262     *  <p>Notes:
32263     *  <ol>
32264     *  <li>The TT date date1+date2 is a Julian Date, apportioned in any
32265     *     convenient way between the two arguments.  For example,
32266     *     JD(TT)=2450123.7 could be expressed in any of these ways, among
32267     *     others:
32268     *
32269     *            date1          date2
32270     *
32271     *         2450123.7           0.0       (JD method)
32272     *         2451545.0       -1421.3       (J2000 method)
32273     *         2400000.5       50123.2       (MJD method)
32274     *         2450123.5           0.2       (date &amp; time method)
32275     *
32276     *     The JD method is the most natural and convenient to use in cases
32277     *     where the loss of several decimal digits of resolution is
32278     *     acceptable.  The J2000 method is best matched to the way the
32279     *     argument is handled internally and will deliver the optimum
32280     *     resolution.  The MJD method and the date &amp; time methods are both
32281     *     good compromises between resolution and convenience.  The limited
32282     *     accuracy of the present algorithm is such that any of the methods
32283     *     is satisfactory.
32284     *
32285     *  <li> This function is a full implementation of the algorithm
32286     *     published by Meeus (see reference) except that the light-time
32287     *     correction to the Moon's mean longitude has been omitted.
32288     *
32289     *  <li> Comparisons with ELP/MPP02 over the interval 1950-2100 gave RMS
32290     *     errors of 2.9 arcsec in geocentric direction, 6.1 km in position
32291     *     and 36 mm/s in velocity.  The worst case errors were 18.3 arcsec
32292     *     in geocentric direction, 31.7 km in position and 172 mm/s in
32293     *     velocity.
32294     *
32295     *  <li> The original algorithm is expressed in terms of "dynamical time",
32296     *     which can either be TDB or TT without any significant change in
32297     *     accuracy.  UT cannot be used without incurring significant errors
32298     *     (30 arcsec in the present era) due to the Moon's 0.5 arcsec/sec
32299     *     movement.
32300     *
32301     *  <li> The result is with respect to the GCRS (the same as J2000.0 mean
32302     *     equator and equinox to within 23 mas).
32303     *
32304     *  <li> Velocity is obtained by a complete analytical differentiation
32305     *     of the Meeus model.
32306     *
32307     *  <li> The Meeus algorithm generates position and velocity in mean
32308     *     ecliptic coordinates of date, which the present function then
32309     *     rotates into GCRS.  Because the ecliptic system is precessing,
32310     *     there is a coupling between this spin (about 1.4 degrees per
32311     *     century) and the Moon position that produces a small velocity
32312     *     contribution.  In the present function this effect is neglected
32313     *     as it corresponds to a maximum difference of less than 3 mm/s and
32314     *     increases the RMS error by only 0.4%.
32315     *  </ol>
32316     *  <p>References:
32317     *  <ul>
32318     *  <li>   Meeus, J., Astronomical Algorithms, 2nd edition, Willmann-Bell,
32319     *     1998, p337.
32320     *
32321     *  <li>   Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
32322     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 1994, 282, 663
32323     *  </ul>
32324     *  Defined in sofam.h:
32325     *     DAU           astronomical unit (m)
32326     *     DJC           days per Julian century
32327     *     DJ00          reference epoch (J2000.0), Julian Date
32328     *     DD2R          degrees to radians
32329     *
32330     *  Called:
32331     *     iauS2pv      spherical coordinates to pv-vector
32332     *     iauPfw06     bias-precession F-W angles, IAU 2006
32333     *     iauIr        initialize r-matrix to identity
32334     *     iauRz        rotate around Z-axis
32335     *     iauRx        rotate around X-axis
32336     *     iauRxpv      product of r-matrix and pv-vector
32337     *
32338     *  @version  2021 May 11
32339     *
32340     *  @since SOFA release 2021-05-12
32341     *
32342     *  <!-- Copyright (C) 2021 IAU SOFA Board.  See notes at end. -->
32343     */
32344    public static double[][] jauMoon98 ( double date1, double date2 )
32345    {
32346        /*
32347         **  Coefficients for fundamental arguments:
32348         **
32349         **  . Powers of time in Julian centuries
32350         **  . Units are degrees.
32351         */
32352 
32353        /* Moon's mean longitude (wrt mean equinox and ecliptic of date) */
32354        final double elp0 = 218.31665436,        /* Simon et al. (1994). */
32355                elp1 = 481267.88123421,
32356                elp2 = -0.0015786,
32357                elp3 = 1.0 / 538841.0,
32358                elp4 = -1.0 / 65194000.0;
32359        double elp, delp;
32360 
32361        /* Moon's mean elongation */
32362        final double d0 = 297.8501921,
32363                d1 = 445267.1114034,
32364                d2 = -0.0018819,
32365                d3 = 1.0 / 545868.0,
32366                d4 = 1.0 / 113065000.0;
32367        double d, dd;
32368 
32369        /* Sun's mean anomaly */
32370        final double em0 = 357.5291092,
32371                em1 = 35999.0502909,
32372                em2 = -0.0001536,
32373                em3 = 1.0 / 24490000.0,
32374                em4 = 0.0;
32375        double em, dem;
32376 
32377        /* Moon's mean anomaly */
32378        final double emp0 = 134.9633964,
32379                emp1 = 477198.8675055,
32380                emp2 = 0.0087414,
32381                emp3 = 1.0 / 69699.0,
32382                emp4 = -1.0 / 14712000.0;
32383        double emp, demp;
32384 
32385        /* Mean distance of the Moon from its ascending node */
32386        final double f0 = 93.2720950,
32387                f1 = 483202.0175233,
32388                f2 = -0.0036539,
32389                f3 = 1.0 / 3526000.0,
32390                f4 = 1.0 / 863310000.0;
32391        double f, df;
32392 
32393        /*
32394         ** Other arguments
32395         */
32396 
32397        /* Meeus A_1, due to Venus (deg) */
32398        final double a10 = 119.75,
32399                a11 = 131.849;
32400        double a1, da1;
32401 
32402        /* Meeus A_2, due to Jupiter (deg) */
32403        final double a20 = 53.09,
32404                a21 = 479264.290;
32405        double a2, da2;
32406 
32407        /* Meeus A_3, due to sidereal motion of the Moon in longitude (deg) */
32408        final double a30 = 313.45,
32409                a31 = 481266.484;
32410        double a3, da3;
32411 
32412        /* Coefficients for Meeus "additive terms" (deg) */
32413        final double al1 =  0.003958,
32414                al2 =  0.001962,
32415                al3 =  0.000318;
32416        final double ab1 = -0.002235,
32417                ab2 =  0.000382,
32418                ab3 =  0.000175,
32419                ab4 =  0.000175,
32420                ab5 =  0.000127,
32421                ab6 = -0.000115;
32422 
32423        /* Fixed term in distance (m) */
32424        final double r0 = 385000560.0;
32425 
32426        /* Coefficients for (dimensionless) E factor */
32427        final double e1 = -0.002516,
32428                e2 = -0.0000074;
32429        double e, de, esq, desq;
32430 
32431 
32432        final Termlr tlr[] = {     new Termlr(0,  0,  1,  0,  6.288774, -20905355.0),
32433                new Termlr(2,  0, -1,  0,  1.274027,  -3699111.0),
32434                new Termlr(2,  0,  0,  0,  0.658314,  -2955968.0),
32435                new Termlr(0,  0,  2,  0,  0.213618,   -569925.0),
32436                new Termlr(0,  1,  0,  0, -0.185116,     48888.0),
32437                new Termlr(0,  0,  0,  2, -0.114332,     -3149.0),
32438                new Termlr(2,  0, -2,  0,  0.058793,    246158.0),
32439                new Termlr(2, -1, -1,  0,  0.057066,   -152138.0),
32440                new Termlr(2,  0,  1,  0,  0.053322,   -170733.0),
32441                new Termlr(2, -1,  0,  0,  0.045758,   -204586.0),
32442                new Termlr(0,  1, -1,  0, -0.040923,   -129620.0),
32443                new Termlr(1,  0,  0,  0, -0.034720,    108743.0),
32444                new Termlr(0,  1,  1,  0, -0.030383,    104755.0),
32445                new Termlr(2,  0,  0, -2,  0.015327,     10321.0),
32446                new Termlr(0,  0,  1,  2, -0.012528,         0.0),
32447                new Termlr(0,  0,  1, -2,  0.010980,     79661.0),
32448                new Termlr(4,  0, -1,  0,  0.010675,    -34782.0),
32449                new Termlr(0,  0,  3,  0,  0.010034,    -23210.0),
32450                new Termlr(4,  0, -2,  0,  0.008548,    -21636.0),
32451                new Termlr(2,  1, -1,  0, -0.007888,     24208.0),
32452                new Termlr(2,  1,  0,  0, -0.006766,     30824.0),
32453                new Termlr(1,  0, -1,  0, -0.005163,     -8379.0),
32454                new Termlr(1,  1,  0,  0,  0.004987,    -16675.0),
32455                new Termlr(2, -1,  1,  0,  0.004036,    -12831.0),
32456                new Termlr(2,  0,  2,  0,  0.003994,    -10445.0),
32457                new Termlr(4,  0,  0,  0,  0.003861,    -11650.0),
32458                new Termlr(2,  0, -3,  0,  0.003665,     14403.0),
32459                new Termlr(0,  1, -2,  0, -0.002689,     -7003.0),
32460                new Termlr(2,  0, -1,  2, -0.002602,         0.0),
32461                new Termlr(2, -1, -2,  0,  0.002390,     10056.0),
32462                new Termlr(1,  0,  1,  0, -0.002348,      6322.0),
32463                new Termlr(2, -2,  0,  0,  0.002236,     -9884.0),
32464                new Termlr(0,  1,  2,  0, -0.002120,      5751.0),
32465                new Termlr(0,  2,  0,  0, -0.002069,         0.0),
32466                new Termlr(2, -2, -1,  0,  0.002048,     -4950.0),
32467                new Termlr(2,  0,  1, -2, -0.001773,      4130.0),
32468                new Termlr(2,  0,  0,  2, -0.001595,         0.0),
32469                new Termlr(4, -1, -1,  0,  0.001215,     -3958.0),
32470                new Termlr(0,  0,  2,  2, -0.001110,         0.0),
32471                new Termlr(3,  0, -1,  0, -0.000892,      3258.0),
32472                new Termlr(2,  1,  1,  0, -0.000810,      2616.0),
32473                new Termlr(4, -1, -2,  0,  0.000759,     -1897.0),
32474                new Termlr(0,  2, -1,  0, -0.000713,     -2117.0),
32475                new Termlr(2,  2, -1,  0, -0.000700,      2354.0),
32476                new Termlr(2,  1, -2,  0,  0.000691,         0.0),
32477                new Termlr(2, -1,  0, -2,  0.000596,         0.0),
32478                new Termlr(4,  0,  1,  0,  0.000549,     -1423.0),
32479                new Termlr(0,  0,  4,  0,  0.000537,     -1117.0),
32480                new Termlr(4, -1,  0,  0,  0.000520,     -1571.0),
32481                new Termlr(1,  0, -2,  0, -0.000487,     -1739.0),
32482                new Termlr(2,  1,  0, -2, -0.000399,         0.0),
32483                new Termlr(0,  0,  2, -2, -0.000381,     -4421.0),
32484                new Termlr(1,  1,  1,  0,  0.000351,         0.0),
32485                new Termlr(3,  0, -2,  0, -0.000340,         0.0),
32486                new Termlr(4,  0, -3,  0,  0.000330,         0.0),
32487                new Termlr(2, -1,  2,  0,  0.000327,         0.0),
32488                new Termlr(0,  2,  1,  0, -0.000323,      1165.0),
32489                new Termlr(1,  1, -1,  0,  0.000299,         0.0),
32490                new Termlr(2,  0,  3,  0,  0.000294,         0.0),
32491                new Termlr(2,  0, -1, -2,  0.000000,      8752.0)};
32492 
32493        final int NLR = tlr.length;
32494 
32495 
32496 
32497        final  Termb tb[] = {    new Termb(0,  0,  0,  1,  5.128122),
32498                new Termb(0,  0,  1,  1,  0.280602),
32499                new Termb(0,  0,  1, -1,  0.277693),
32500                new Termb(2,  0,  0, -1,  0.173237),
32501                new Termb(2,  0, -1,  1,  0.055413),
32502                new Termb(2,  0, -1, -1,  0.046271),
32503                new Termb(2,  0,  0,  1,  0.032573),
32504                new Termb(0,  0,  2,  1,  0.017198),
32505                new Termb(2,  0,  1, -1,  0.009266),
32506                new Termb(0,  0,  2, -1,  0.008822),
32507                new Termb(2, -1,  0, -1,  0.008216),
32508                new Termb(2,  0, -2, -1,  0.004324),
32509                new Termb(2,  0,  1,  1,  0.004200),
32510                new Termb(2,  1,  0, -1, -0.003359),
32511                new Termb(2, -1, -1,  1,  0.002463),
32512                new Termb(2, -1,  0,  1,  0.002211),
32513                new Termb(2, -1, -1, -1,  0.002065),
32514                new Termb(0,  1, -1, -1, -0.001870),
32515                new Termb(4,  0, -1, -1,  0.001828),
32516                new Termb(0,  1,  0,  1, -0.001794),
32517                new Termb(0,  0,  0,  3, -0.001749),
32518                new Termb(0,  1, -1,  1, -0.001565),
32519                new Termb(1,  0,  0,  1, -0.001491),
32520                new Termb(0,  1,  1,  1, -0.001475),
32521                new Termb(0,  1,  1, -1, -0.001410),
32522                new Termb(0,  1,  0, -1, -0.001344),
32523                new Termb(1,  0,  0, -1, -0.001335),
32524                new Termb(0,  0,  3,  1,  0.001107),
32525                new Termb(4,  0,  0, -1,  0.001021),
32526                new Termb(4,  0, -1,  1,  0.000833),
32527                new Termb(0,  0,  1, -3,  0.000777),
32528                new Termb(4,  0, -2,  1,  0.000671),
32529                new Termb(2,  0,  0, -3,  0.000607),
32530                new Termb(2,  0,  2, -1,  0.000596),
32531                new Termb(2, -1,  1, -1,  0.000491),
32532                new Termb(2,  0, -2,  1, -0.000451),
32533                new Termb(0,  0,  3, -1,  0.000439),
32534                new Termb(2,  0,  2,  1,  0.000422),
32535                new Termb(2,  0, -3, -1,  0.000421),
32536                new Termb(2,  1, -1,  1, -0.000366),
32537                new Termb(2,  1,  0,  1, -0.000351),
32538                new Termb(4,  0,  0,  1,  0.000331),
32539                new Termb(2, -1,  1,  1,  0.000315),
32540                new Termb(2, -2,  0, -1,  0.000302),
32541                new Termb(0,  0,  1,  3, -0.000283),
32542                new Termb(2,  1,  1, -1, -0.000229),
32543                new Termb(1,  1,  0, -1,  0.000223),
32544                new Termb(1,  1,  0,  1,  0.000223),
32545                new Termb(0,  1, -2, -1, -0.000220),
32546                new Termb(2,  1, -1, -1, -0.000220),
32547                new Termb(1,  0,  1,  1, -0.000185),
32548                new Termb(2, -1, -2, -1,  0.000181),
32549                new Termb(0,  1,  2,  1, -0.000177),
32550                new Termb(4,  0, -2, -1,  0.000176),
32551                new Termb(4, -1, -1, -1,  0.000166),
32552                new Termb(1,  0,  1, -1, -0.000164),
32553                new Termb(4,  0,  1, -1,  0.000132),
32554                new Termb(1,  0, -1, -1, -0.000119),
32555                new Termb(4, -1,  0, -1,  0.000115),
32556                new Termb(2, -2,  0,  1,  0.000107)};
32557 
32558        final int NB = tb.length;
32559 
32560        /* Miscellaneous */
32561        int n, i;
32562        double t, elpmf, delpmf, vel, vdel, vr, vdr, a1mf, da1mf, a1pf,
32563        da1pf, dlpmp, slpmp, vb, vdb, v, dv, emn, empn, dn, fn, en,
32564        den, arg, darg, farg, coeff, el, del, r, dr, b, db, rm[][]= new double[3][3];
32565 
32566        /* ------------------------------------------------------------------ */
32567 
32568        /* Centuries since J2000.0 */
32569        t = ((date1 - DJ00) + date2) / DJC;
32570 
32571        /* --------------------- */
32572        /* Fundamental arguments */
32573        /* --------------------- */
32574 
32575        /* Arguments (radians) and derivatives (radians per Julian century)
32576    for the current date. */
32577 
32578        /* Moon's mean longitude. */
32579        elp = DD2R * fmod ( elp0
32580                + ( elp1
32581                        + ( elp2
32582                                + ( elp3
32583                                        +   elp4 * t ) * t ) * t ) * t, 360.0 );
32584        delp = DD2R * (     elp1
32585                + ( elp2 * 2.0
32586                        + ( elp3 * 3.0
32587                                +   elp4 * 4.0 * t ) * t ) * t );
32588 
32589        /* Moon's mean elongation. */
32590        d = DD2R * fmod ( d0
32591                + ( d1
32592                        + ( d2
32593                                + ( d3
32594                                        +   d4 * t ) * t ) * t ) * t, 360.0 );
32595        dd = DD2R * (     d1
32596                + ( d2 * 2.0
32597                        + ( d3 * 3.0
32598                                +   d4 * 4.0 * t ) * t ) * t );
32599 
32600        /* Sun's mean anomaly. */
32601        em = DD2R * fmod ( em0
32602                + ( em1
32603                        + ( em2
32604                                + ( em3
32605                                        +   em4 * t ) * t ) * t ) * t, 360.0 );
32606        dem = DD2R * (     em1
32607                + ( em2 * 2.0
32608                        + ( em3 * 3.0
32609                                +   em4 * 4.0 * t ) * t ) * t );
32610 
32611        /* Moon's mean anomaly. */
32612        emp = DD2R * fmod ( emp0
32613                + ( emp1
32614                        + ( emp2
32615                                + ( emp3
32616                                        +   emp4 * t ) * t ) * t ) * t, 360.0 );
32617        demp = DD2R * (     emp1
32618                + ( emp2 * 2.0
32619                        + ( emp3 * 3.0
32620                                +   emp4 * 4.0 * t ) * t ) * t );
32621 
32622        /* Mean distance of the Moon from its ascending node. */
32623        f = DD2R * fmod ( f0
32624                + ( f1
32625                        + ( f2
32626                                + ( f3
32627                                        +   f4 * t ) * t ) * t ) * t, 360.0 );
32628        df = DD2R * (     f1
32629                + ( f2 * 2.0
32630                        + ( f3 * 3.0
32631                                +   f4 * 4.0 * t ) * t ) * t );
32632 
32633        /* Meeus further arguments. */
32634        a1 = DD2R * ( a10 + a11*t );
32635        da1 = DD2R * al1;
32636        a2 = DD2R * ( a20 + a21*t );
32637        da2 = DD2R * a21;
32638        a3 = DD2R * ( a30 + a31*t );
32639        da3 = DD2R * a31;
32640 
32641        /* E-factor, and square. */
32642        e = 1.0 + ( e1 + e2*t ) * t;
32643        de = e1 + 2.0*e2*t;
32644        esq = e*e;
32645        desq = 2.0*e*de;
32646 
32647        /* Use the Meeus additive terms (deg) to start off the summations. */
32648        elpmf = elp - f;
32649        delpmf = delp - df;
32650        vel = al1 * sin(a1)
32651                + al2 * sin(elpmf)
32652                + al3 * sin(a2);
32653        vdel = al1 * cos(a1) * da1
32654                + al2 * cos(elpmf) * delpmf
32655                + al3 * cos(a2) * da2;
32656 
32657        vr = 0.0;
32658        vdr = 0.0;
32659 
32660        a1mf = a1 - f;
32661        da1mf = da1 - df;
32662        a1pf = a1 + f;
32663        da1pf = da1 + df;
32664        dlpmp = elp - emp;
32665        slpmp = elp + emp;
32666        vb = ab1 * sin(elp)
32667                + ab2 * sin(a3)
32668                + ab3 * sin(a1mf)
32669                + ab4 * sin(a1pf)
32670                + ab5 * sin(dlpmp)
32671                + ab6 * sin(slpmp);
32672        vdb = ab1 * cos(elp) * delp
32673                + ab2 * cos(a3) * da3
32674                + ab3 * cos(a1mf) * da1mf
32675                + ab4 * cos(a1pf) * da1pf
32676                + ab5 * cos(dlpmp) * (delp-demp)
32677                + ab6 * cos(slpmp) * (delp+demp);
32678 
32679        /* ----------------- */
32680        /* Series expansions */
32681        /* ----------------- */
32682 
32683        /* Longitude and distance plus derivatives. */
32684        for ( n = NLR-1; n >= 0; n-- ) {
32685            dn = (double) tlr[n].nd;
32686            emn = (double) ( i = tlr[n].nem );
32687            empn = (double) tlr[n].nemp;
32688            fn = (double) tlr[n].nf;
32689            switch ( abs(i) ) {
32690            case 1:
32691                en = e;
32692                den = de;
32693                break;
32694            case 2:
32695                en = esq;
32696                den = desq;
32697                break;
32698            default:
32699                en = 1.0;
32700                den = 0.0;
32701            }
32702            arg = dn*d + emn*em + empn*emp + fn*f;
32703            darg = dn*dd + emn*dem + empn*demp + fn*df;
32704            farg = sin(arg);
32705            v = farg * en;
32706            dv = cos(arg)*darg*en + farg*den;
32707            coeff = tlr[n].coefl;
32708            vel += coeff * v;
32709            vdel += coeff * dv;
32710            farg = cos(arg);
32711            v = farg * en;
32712            dv = -sin(arg)*darg*en + farg*den;
32713            coeff = tlr[n].coefr;
32714            vr += coeff * v;
32715            vdr += coeff * dv;
32716        }
32717        el = elp + DD2R*vel;
32718        del = ( delp + DD2R*vdel ) / DJC;
32719        r = ( vr + r0 ) / DAU;
32720        dr = vdr / DAU / DJC;
32721 
32722        /* Latitude plus derivative. */
32723        for ( n = NB-1; n >= 0; n-- ) {
32724            dn = (double) tb[n].nd;
32725            emn = (double) ( i = tb[n].nem );
32726            empn = (double) tb[n].nemp;
32727            fn = (double) tb[n].nf;
32728            switch ( abs(i) ) {
32729            case 1:
32730                en = e;
32731                den = de;
32732                break;
32733            case 2:
32734                en = esq;
32735                den = desq;
32736                break;
32737            default:
32738                en = 1.0;
32739                den = 0.0;
32740            }
32741            arg = dn*d + emn*em + empn*emp + fn*f;
32742            darg = dn*dd + emn*dem + empn*demp + fn*df;
32743            farg = sin(arg);
32744            v = farg * en;
32745            dv = cos(arg)*darg*en + farg*den;
32746            coeff = tb[n].coefb;
32747            vb += coeff * v;
32748            vdb += coeff * dv;
32749        }
32750        b = vb * DD2R;
32751        db = vdb * DD2R / DJC;
32752 
32753        /* ------------------------------ */
32754        /* Transformation into final form */
32755        /* ------------------------------ */
32756 
32757        /* Longitude, latitude to x, y, z (AU). */
32758        double[][] pv = jauS2pv ( el, b, r, del, db, dr );
32759 
32760        /* IAU 2006 Fukushima-Williams bias+precession angles. */
32761        FWPrecessionAngles fw = jauPfw06 ( date1, date2 );  
32762 
32763        /* Mean ecliptic coordinates to GCRS rotation matrix. */
32764        jauIr ( rm );
32765        jauRz ( fw.psib, rm );
32766        jauRx ( -fw.phib, rm );
32767        jauRz ( -fw.gamb, rm );
32768 
32769        /* Rotate the Moon position and velocity into GCRS (Note 6). */
32770        return jauRxpv ( rm, pv);
32771    }
32772 
32773    /**
32774     *  Transform a star's ICRS catalog entry (epoch J2000.0) into ICRS
32775     *  astrometric place.
32776     *
32777     *  This function is part of the International Astronomical Union's
32778     *  SOFA (Standards of Fundamental Astronomy) software collection.
32779     *
32780     *  Status:  support function.
32781     *
32782     * <!-- Given: -->
32783     *  @param   rc     double   ICRS right ascension at J2000.0 (radians, Note 1)
32784     *  @param   dc     double   ICRS declination at J2000.0 (radians, Note 1)
32785     *  @param   pr     double   RA proper motion (radians/year, Note 2)
32786     *  @param   pd     double   Dec proper motion (radians/year)
32787     *  @param   px     double   parallax (arcsec)
32788     *  @param   rv     double   radial velocity (km/s, +ve if receding)
32789     *  @param   date1  double   TDB as a 2-part...
32790     *  @param   date2  double   ...Julian Date (Note 3)
32791     *
32792     * <!-- Returned:-->
32793     *  @return   ra,da  double*  ICRS astrometric RA,Dec (radians)
32794     *
32795     *  <p>Notes:
32796     *  <ol>
32797     *  <li> Star data for an epoch other than J2000.0 (for example from the
32798     *     Hipparcos catalog, which has an epoch of J1991.25) will require a
32799     *     preliminary call to iauPmsafe before use.
32800     *
32801     *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
32802     *
32803     *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
32804     *     convenient way between the two arguments.  For example,
32805     *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
32806     *     others:
32807     *
32808     *            date1          date2
32809     *
32810     *         2450123.7           0.0       (JD method)
32811     *         2451545.0       -1421.3       (J2000 method)
32812     *         2400000.5       50123.2       (MJD method)
32813     *         2450123.5           0.2       (date &amp; time method)
32814     *
32815     *     The JD method is the most natural and convenient to use in cases
32816     *     where the loss of several decimal digits of resolution is
32817     *     acceptable.  The J2000 method is best matched to the way the
32818     *     argument is handled internally and will deliver the optimum
32819     *     resolution.  The MJD method and the date &amp; time methods are both
32820     *     good compromises between resolution and convenience.  For most
32821     *     applications of this function the choice will not be at all
32822     *     critical.
32823     *
32824     *     TT can be used instead of TDB without any significant impact on
32825     *     accuracy.
32826     * </ol>
32827     *  Called:
32828     *     iauApci13    astrometry parameters, ICRS-CIRS, 2013
32829     *     iauAtccq     quick catalog ICRS to astrometric
32830     *
32831     *  @version  2021 April 18
32832     *
32833     *  @since SOFA release 2021-05-12
32834     *
32835     * <!--  Copyright (C) 2021 IAU SOFA Board.  See notes at end. -->
32836     */
32837    public static SphericalCoordinate jauAtcc13(double rc, double dc,
32838            double pr, double pd, double px, double rv,
32839            double date1, double date2)
32840    {
32841        /* Star-independent astrometry parameters */
32842        Astrom astrom = new Astrom();
32843 
32844        /* The transformation parameters. */
32845        jauApci13(date1, date2, astrom);
32846 
32847        /* Catalog ICRS (epoch J2000.0) to astrometric. */
32848        return jauAtccq(rc, dc, pr, pd, px, rv, astrom);
32849 
32850        /* Finished. */
32851    }
32852 
32853    /**
32854     *  Quick transformation of a star's ICRS catalog entry (epoch J2000.0)
32855     *  into ICRS astrometric place, given precomputed star-independent
32856     *  astrometry parameters.
32857     *
32858     *  Use of this function is appropriate when efficiency is important and
32859     *  where many star positions are to be transformed for one date.  The
32860     *  star-independent parameters can be obtained by calling one of the
32861     *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
32862     *
32863     *  If the parallax and proper motions are zero the transformation has
32864     *  no effect.
32865     *
32866     *  This function is part of the International Astronomical Union's
32867     *  SOFA (Standards of Fundamental Astronomy) software collection.
32868     *
32869     *  Status:  support function.
32870     *
32871     * <!-- Given: -->
32872     *  @param   rc  double     ICRS RA at J2000.0 (radians)
32873     *  @param   dc  double     ICRS Dec at J2000.0 (radians)
32874     *  @param   pr     double     RA proper motion (radians/year, Note 3)
32875     *  @param   pd     double     Dec proper motion (radians/year)
32876     *  @param   px     double     parallax (arcsec)
32877     *  @param   rv     double     radial velocity (km/s, +ve if receding)
32878     *  @param   astrom Astrom star-independent astrometry parameters:
32879     *
32880     *  <!-- Returned: -->
32881     *   @return  ra,da  SphericalCoordinate    ICRS astrometric RA,Dec (radians)
32882     *
32883     *  <p>Notes:
32884     *  <ol>
32885     *  <li> All the vectors are with respect to BCRS axes.
32886     *
32887     *  <li> Star data for an epoch other than J2000.0 (for example from the
32888     *     Hipparcos catalog, which has an epoch of J1991.25) will require a
32889     *     preliminary call to iauPmsafe before use.
32890     *
32891     *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
32892     *</ol>
32893     *  Called:
32894     *     iauPmpx      proper motion and parallax
32895     *     iauC2s       p-vector to spherical
32896     *     iauAnp       normalize angle into range 0 to 2pi
32897     *
32898     *  @version  2021 April 18
32899     *
32900     *  @since SOFA release 2021-05-12
32901     *
32902     *  <!-- Copyright (C) 2021 IAU SOFA Board.  See notes at end. -->
32903     */
32904    public static SphericalCoordinate jauAtccq(double rc, double dc,
32905            double pr, double pd, double px, double rv,
32906            Astrom astrom)
32907    {
32908        double p[];
32909 
32910 
32911        /* Proper motion and parallax, giving BCRS coordinate direction. */
32912        p = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
32913 
32914        /* ICRS astrometric RA,Dec. */
32915        SphericalCoordinate co = jauC2s(p);
32916        co.alpha = jauAnp(co.alpha);
32917        return co;
32918 
32919        /* Finished. */
32920    }
32921 
32922 } // end of JSOFA Class
32923 
32924 /*
32925  * Copyright © 2021 Paul Harrison, University of Manchester.
32926  * 
32927  * This JSOFA software is derived from the official C release of the "Standards Of Fundamental Astronomy" (SOFA) library 
32928  * of the International Astronomical Union. The intention is to reproduce the functionality and algorithms of 
32929  * the official SOFA library in a pure Java form.
32930  * 
32931  * The responsibility for the maintenance and supply of the JSOFA library lies with the author (not the IAU SOFA Board), 
32932  * However, The JSOFA software is provided "as is" and the author makes no warranty as to its use or performance. 
32933  * The author does not and cannot warrant the performance or results which the user may obtain by using the JSOFA software. 
32934  * The author makes no warranties, express or implied, as to non-infringement of third party rights, merchantability,
32935  * or fitness for any particular purpose. In no event will the author be liable to the user for any consequential, 
32936  * incidental, or special damages, including any lost profits or lost savings, even if the author has been advised
32937  * of such damages, or for any claim by any third party.
32938  * 
32939  * Other conditions of the original license (reproduced below) are carried over as applicable.
32940  */
32941 
32942 /*----------------------------------------------------------------------
32943 *
32944 *  Copyright (C) 2021
32945 *  Standards Of Fundamental Astronomy Board
32946 *  of the International Astronomical Union.
32947 *
32948 *  =====================
32949 *  SOFA Software License
32950 *  =====================
32951 *
32952 *  NOTICE TO USER:
32953 *
32954 *  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
32955 *  CONDITIONS WHICH APPLY TO ITS USE.
32956 *
32957 *  1. The Software is owned by the IAU SOFA Board ("SOFA").
32958 *
32959 *  2. Permission is granted to anyone to use the SOFA software for any
32960 *     purpose, including commercial applications, free of charge and
32961 *     without payment of royalties, subject to the conditions and
32962 *     restrictions listed below.
32963 *
32964 *  3. You (the user) may copy and distribute SOFA source code to others,
32965 *     and use and adapt its code and algorithms in your own software,
32966 *     on a world-wide, royalty-free basis.  That portion of your
32967 *     distribution that does not consist of intact and unchanged copies
32968 *     of SOFA source code files is a "derived work" that must comply
32969 *     with the following requirements:
32970 *
32971 *     a) Your work shall be marked or carry a statement that it
32972 *        (i) uses routines and computations derived by you from
32973 *        software provided by SOFA under license to you; and
32974 *        (ii) does not itself constitute software provided by and/or
32975 *        endorsed by SOFA.
32976 *
32977 *     b) The source code of your derived work must contain descriptions
32978 *        of how the derived work is based upon, contains and/or differs
32979 *        from the original SOFA software.
32980 *
32981 *     c) The names of all routines in your derived work shall not
32982 *        include the prefix "iau" or "sofa" or trivial modifications
32983 *        thereof such as changes of case.
32984 *
32985 *     d) The origin of the SOFA components of your derived work must
32986 *        not be misrepresented;  you must not claim that you wrote the
32987 *        original software, nor file a patent application for SOFA
32988 *        software or algorithms embedded in the SOFA software.
32989 *
32990 *     e) These requirements must be reproduced intact in any source
32991 *        distribution and shall apply to anyone to whom you have
32992 *        granted a further right to modify the source code of your
32993 *        derived work.
32994 *
32995 *     Note that, as originally distributed, the SOFA software is
32996 *     intended to be a definitive implementation of the IAU standards,
32997 *     and consequently third-party modifications are discouraged.  All
32998 *     variations, no matter how minor, must be explicitly marked as
32999 *     such, as explained above.
33000 *
33001 *  4. You shall not cause the SOFA software to be brought into
33002 *     disrepute, either by misuse, or use for inappropriate tasks, or
33003 *     by inappropriate modification.
33004 *
33005 *  5. The SOFA software is provided "as is" and SOFA makes no warranty
33006 *     as to its use or performance.   SOFA does not and cannot warrant
33007 *     the performance or results which the user may obtain by using the
33008 *     SOFA software.  SOFA makes no warranties, express or implied, as
33009 *     to non-infringement of third party rights, merchantability, or
33010 *     fitness for any particular purpose.  In no event will SOFA be
33011 *     liable to the user for any consequential, incidental, or special
33012 *     damages, including any lost profits or lost savings, even if a
33013 *     SOFA representative has been advised of such damages, or for any
33014 *     claim by any third party.
33015 *
33016 *  6. The provision of any version of the SOFA software under the terms
33017 *     and conditions specified herein does not imply that future
33018 *     versions will also be made available under the same terms and
33019 *     conditions.
33020 *
33021 *  In any published work or commercial product which uses the SOFA
33022 *  software directly, acknowledgement (see www.iausofa.org) is
33023 *  appreciated.
33024 *
33025 *  Correspondence concerning SOFA software should be addressed as
33026 *  follows:
33027 *
33028 *      By email:  sofa@ukho.gov.uk
33029 *      By post:   IAU SOFA Center
33030 *                 HM Nautical Almanac Office
33031 *                 UK Hydrographic Office
33032 *                 Admiralty Way, Taunton
33033 *                 Somerset, TA1 2DN
33034 *                 United Kingdom
33035 *
33036 *--------------------------------------------------------------------*/
33037 
33038 
33039 /*
33040  * $Log$
33041  */