void recrad_c ( ConstSpiceDouble rectan,
SpiceDouble * range,
SpiceDouble * ra,
SpiceDouble * dec )
Convert rectangular coordinates to range, right ascension, and
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
rectan I Rectangular coordinates of a point.
range O Distance of the point from the origin.
ra O Right ascension in radians.
dec O Declination in radians.
rectan The rectangular coordinates of a point.
range is the distance of the point `rectan' from the origin.
The units associated with `range' are those associated
with the input `rectan'.
ra is the right ascension of `rectan'. This is the angular
distance measured toward the east from the prime meridian
to the meridian containing the input point. The direction
of increasing right ascension is from the +X axis towards
the +Y axis.
`ra' is output in radians. The range of `ra' is [0, 2*pi].
dec is the declination of `rectan'. This is the angle from
the XY plane of the ray from the origin through the
`dec' is output in radians. The range of `dec' is
1) If the X and Y components of `rectan' are both zero, the
right ascension is set to zero.
2) If `rectan' is the zero vector, right ascension and declination
are both set to zero.
The following code fragment converts right ascension and
declination from the B1950 reference frame to the J2000 frame.
SpiceDouble mtrans [ 3 ][ 3 ];
SpiceDouble v1950 [ 3 ];
SpiceDouble v2000 [ 3 ];
Convert RA and DEC to a 3-vector expressed in the B1950 frame.
radrec_c ( 1.0, ra, dec, v1950 );
We use the CSPICE routine pxform_c to obtain the transformation
matrix for converting vectors between the B1950 and J2000
reference frames. Since both frames are inertial, the input time
value we supply to pxform_c is arbitrary. We choose zero seconds
past the J2000 epoch as the input value.
pxform_c ( "B1950", "J2000", 0.0, mtrans );
Transform the vector to the J2000 frame.
mxv_c ( mtrans, v1950, v2000 );
Find the RA and DEC of the J2000-relative vector.
recrad_c ( v2000, &r, &ra, &dec );
N.J. Bachman (JPL)
H.A. Neilan (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.1.2, 30-JUL-2003 (NJB)
Various header corrections were made.
-CSPICE Version 1.1.0, 22-OCT-1998 (NJB)
Made input vector const.
-CSPICE Version 1.0.0, 08-FEB-1998 (EDW)
rectangular coordinates to ra and dec
rectangular to right_ascension and declination