Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input Detailed_Output Parameters Exceptions Files Particulars Examples Restrictions Literature_References Author_and_Institution Version Index_Entries

#### Procedure

```   void recrad_c ( ConstSpiceDouble    rectan,
SpiceDouble       * range,
SpiceDouble       * ra,
SpiceDouble       * dec      )

```

#### Abstract

```
Convert rectangular coordinates to range, right ascension, and
declination.
```

```
None.
```

#### Keywords

```
CONVERSION,  COORDINATES

```

#### Brief_I/O

```
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.
```

#### Detailed_Input

```
rectan     The rectangular coordinates of a point.
```

#### Detailed_Output

```
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
point.

`dec' is output in radians.  The range of `dec' is
[-pi/2, pi/2].
```

```
None.
```

#### Exceptions

```
Error free.

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.
```

```
None.
```

#### Particulars

```   None.
```

#### Examples

```
The following code fragment converts right ascension and
declination from the B1950 reference frame to the J2000 frame.

#include "SpiceUsr.h"

SpiceDouble      ra;
SpiceDouble      dec;
SpiceDouble      r;
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 );

```

```
None.
```

```
None.
```

#### Author_and_Institution

```
N.J. Bachman    (JPL)
H.A. Neilan     (JPL)
E.D. Wright     (JPL)
```

#### Version

```
-CSPICE Version 1.1.2, 30-JUL-2003 (NJB)

-CSPICE Version 1.1.0, 22-OCT-1998 (NJB)

```
`Wed Apr  5 17:54:41 2017`