1 /*
2  *  - - - - - - - - - - - -
3  *   g a l _ b p l p v 8 7
4  *  - - - - - - - - - - - -
5  *
6  *  This routine is part of the General Astrodynamics Library
7  *
8  *  Description:
9  *
10  *  Pluto barycentric position and velocity, with respect to the
11  *  FK5 Reference Frame.
12  *
13  *  Status:
14  *
15  *     internal support routine.
16  *
17  *  Given:
18  *
19  *     tt1                 d            TT epoch part 1 (Note 1)
20  *     tt2                 d            TT epoch part 2 (Note 1)
21  *     ref                 i            Reference frame
22  *                                        0 = dynamical equinox and ecliptic J2000.
23  *                                        1 = FK5 (VSOP87)
24  *
25  *  Returned:
26  *
27  *     pv               d[2][3]         position/velocity (AU, AU/Day)
28  *
29  *  Called:
30  *
31  *     gal_vsop87                       Compute VSOP87 position and velocity
32  *
33  *  Notes:
34  *
35  *  1) The epoch tt1+tt2 is a Julian Date, apportioned in
36  *     any convenient way between the two arguments.  For example,
37  *     JD(TDB)=2450123.7 could be expressed in any of these ways,
38  *     among others:
39  *
40  *               tt1          tt2
41  *
42  *         2450123.7          0.0       (JD method)
43  *         2451545.0      -1421.3       (J2000 method)
44  *         2400000.5      50123.2       (MJD method)
45  *         2450123.5          0.2       (date & time method)
46  *
47  *     The JD method is the most natural and convenient to use in
48  *     cases where the loss of several decimal digits of resolution
49  *     is acceptable.  The J2000 method is best matched to the way
50  *     the argument is handled internally and will deliver the
51  *     optimum resolution.  The MJD method and the date & time methods
52  *     are both good compromises between resolution and convenience.
53  *     However, the accuracy of the result is more likely to be
54  *     limited by the algorithm itself than the way the epoch has been
55  *     expressed.
56  *
57  *  2) On return, the arrays pvh and pvb contain the following:
58  *
59  *        pv[0][0]  x       }
60  *        pv[0][1]  y       } position, AU
61  *        pv[0][2]  z       }
62  *
63  *        pv[1][0]  xdot    }
64  *        pv[1][1]  ydot    } velocity, AU/day
65  *        pv[1][2]  zdot    }
66  *
67  *     The vectors are barycentric with respect to the FK5 Reference Frame.
68  *     The time unit is one day in TT
69  *
70  *  3) The tables of Pluto have been constructed by J. Chapront (BDL) with a new
71  *     method of approximation using frequency analysis as described in the paper
72  *     This representation uses the result of numerical integration DE200 of Jet
73  *     Propulsion Laboratory as a source: Standish E. M., 1990, The observational
74  *     basis for JPL'DE200, the planetary ephemerides of the Astronomical Almanac.
75  *     Astron. Astrophys., 233, 252.
76  *
77  *  4) The interval of validity is 146120 days.
78  *     Start : Jan 01 1700 0h  JD2341972.5
79  *     End :   Jan 24 2100 0h  JD2488092.5
80  *
81  *  5) The tables contain series which represent the heliocentric rectangular
82  *     coordinates of Pluto as functions of time. The reference frame is defined
83  *     with dynamical equinox and equator J2000 (DE200). The time scale is
84  *     Barycentric Dynamical Time (TDB).
85  *
86  *  References:
87  *
88  *  Representation of planetary ephemerides by frequency analysis.
89  *  Application to the five outer planets.
90  *  Astron. & Astrophys.Suppl. Ser., 109, 191 (1995).
91  *
92  *
93  *  This revision:
94  *
95  *     2009 January 9
96  *
97  *  Copyright (C) 2008, 2009 Paul C. L. Willmott. See notes at end.
98  *
99  *-----------------------------------------------------------------------
100  */
101 
102 #include "gal_bplpv87.h"
103 #include "gal_vsop87.h"
104 #include "gal_bsupv87.h"
105 void
gal_bplpv87(double tt1,double tt2,int ref,double pv[2][3])106 gal_bplpv87
107  (
108     double tt1,
109     double tt2,
110     int ref,
111     double pv[2][3]
112  )
113 
114 {
115 
116   double su[2][3], pl[2][3] ;
117 
118 /*
119  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
120  */
121 
122 /*
123  * Get Sun barycentric position & velocity
124  */
125 
126   gal_bsupv87 ( tt1, tt2, ref, su ) ;
127 
128 /*
129  * Get Pluto heliocentric position & velocity
130  */
131 
132   gal_hplpv87 ( tt1, tt2, ref, pl ) ;
133 
134 /*
135  * Calculate Pluto barycentric position & velocity
136  */
137 
138   gal_pvppv ( pl, su, pv ) ;
139 
140 /*
141  * Finished.
142  */
143 
144 }
145 
146 /*
147  *  gal - General Astrodynamics Library
148  *  Copyright (C) 2008, 2009 Paul C. L. Willmott
149  *
150  *  This program is free software; you can redistribute it and/or modify
151  *  it under the terms of the GNU General Public License as published by
152  *  the Free Software Foundation; either version 2 of the License, or
153  *  (at your option) any later version.
154  *
155  *  This program is distributed in the hope that it will be useful,
156  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
157  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
158  *  GNU General Public License for more details.
159  *
160  *  You should have received a copy of the GNU General Public License along
161  *  with this program; if not, write to the Free Software Foundation, Inc.,
162  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
163  *
164  *  Contact:
165  *
166  *  Paul Willmott
167  *  vp9mu@amsat.org
168  */
169