7
* Approximate topocentric apparent RA,Dec of a planet
16
* void palRdplan( double date, int np, double elong, double phi,
17
* double * ra, double * dec, double * diam );
20
* date = double (Given)
21
* MJD of observation (JD-2400000.5) in TDB. For all practical
22
* purposes TT can be used instead of TDB, and for many applications
23
* UT will do (except for the Moon).
34
* elong = double (Given)
35
* Observer's east longitude (radians)
36
* phi = double (Given)
37
* Observer's geodetic latitude (radians)
38
* ra = double * (Returned)
39
* RA (topocentric apparent, radians)
40
* dec = double * (Returned)
41
* Dec (topocentric apparent, radians)
42
* diam = double * (Returned)
43
* Angular diameter (equatorial, radians)
46
* Approximate topocentric apparent RA,Dec of a planet, and its
50
* TIMJ: Tim Jenness (JAC, Hawaii)
51
* {enter_new_authors_here}
54
* - Unlike with slaRdplan, Pluto is not supported.
55
* - The longitude and latitude allow correction for geocentric
56
* parallax. This is a major effect for the Moon, but in the
57
* context of the limited accuracy of the present routine its
58
* effect on planetary positions is small (negligible for the
59
* outer planets). Geocentric positions can be generated by
60
* appropriate use of the routines palDmoon and iauPlan94.
64
* Initial version, with some documentation from SLA/F.
65
* {enter_further_changes_here}
68
* Copyright (C) 2012 Science and Technology Facilities Council.
69
* All Rights Reserved.
72
* This program is free software; you can redistribute it and/or
73
* modify it under the terms of the GNU General Public License as
74
* published by the Free Software Foundation; either version 3 of
75
* the License, or (at your option) any later version.
77
* This program is distributed in the hope that it will be
78
* useful, but WITHOUT ANY WARRANTY; without even the implied
79
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
80
* PURPOSE. See the GNU General Public License for more details.
82
* You should have received a copy of the GNU General Public License
83
* along with this program; if not, write to the Free Software
84
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
88
* {note_any_bugs_here}
98
void palRdplan( double date, int np, double elong, double phi,
99
double * ra, double * dec, double * diam ) {
102
const double AUKM = 1.49597870e8;
104
/* Equatorial radii (km) */
105
const double EQRAU[] = {
117
/* Local variables */
127
double dx,dy,dz,r,tl;
130
if (np < 0 || np > 8 ) np=0; /* Sun */
132
/* Approximate local sidereal time */
133
stl = palGmst( date - palDt( palEpj(date)) / 86400.0) + elong;
135
/* Geocentre to Moon (mean of date) */
138
/* Nutation to true of date */
139
palNut( date, rmat );
140
iauRxp( rmat, v, vgm );
141
iauRxp( rmat, &(v[3]), &(vgm[3]) );
146
/* geocentre to Moon (true of date) */
147
for (i=0; i<6; i++) {
153
/* Not moon: precession/nutation matrix J2000 to date */
154
palPrenut( 2000.0, date, rmat );
156
/* Sun to Earth-Moon Barycentre (J2000) */
157
palPlanet( date, 3, v, &j );
159
/* Precession and nutation to date */
160
iauRxp( rmat, v, vse );
161
iauRxp( rmat, &(v[3]), &(vse[3]) );
163
/* Sun to geocentre (true of date) */
164
for (i=0; i<6; i++) {
165
vsg[i] = vse[i] - 0.012150581 * vgm[i];
171
/* Geocentre to Sun */
172
for (i=0; i<6; i++) {
178
/* Sun to Planet (J2000) */
179
palPlanet( date, np, v, &j );
181
/* Precession and nutation to date */
182
iauRxp( rmat, v, vsp );
183
iauRxp( rmat, &(v[3]), &(vsp[3]) );
185
/* Geocentre to planet */
186
for (i=0; i<6; i++) {
187
v[i] = vsp[i] - vsg[i];
194
/* Refer to origina at the observer */
195
palPvobs( phi, 0.0, stl, vgo );
196
for (i=0; i<6; i++) {
200
/* Geometric distance (AU) */
204
r = sqrt( dx*dx + dy*dy + dz*dz );
209
/* Correct position for planetary aberration */
210
for (i=0; i<3; i++) {
215
iauC2s( v, ra, dec );
218
/* Angular diameter (radians) */
219
*diam = 2.0 * asin( EQRAU[np] / (r * AUKM ) );