/********************************************************/
/*                       ecliptic.h                     */
/*     Header file for utility functions concerning     */
/*            ecliptic latitude and longitude.          */
/********************************************************/

/*-------------------- ecliptic_obliq --------------------
 * Description: Returns the obliquity of the ecliptic at
 *              a specified instant.
 *
 * Parameters:  double T -- Julian centuries from noon GMT
 *                          on 0/1/1900 to required instant.
 * Returns:     obliquity of ecliptic, in radians.
 * Other info:  none.
 */

  double ecliptic_obliq(double T);
                                                          

/*-------------------- ecliptic_kepler -------------------
 * Description: Solves Kepler's equation.
 *
 * Parameters:  double M     -- Mean anomaly.
 *              double e     -- Eccentricity.
 *              double *Eptr -- Pointer to double to fill in with
 *                              eccentric anomaly.
 * Returns:     TRUE if eccentric anomaly converged OK, FALSE if
 *              there was a problem (in which case *Eptr may be
 *              a poor approximation).
 * Other info:  All angles in radians.  *Eptr may be < 0 or > 2 Pi.
 */

  BOOL ecliptic_kepler(double M, double e, double *Eptr);


/*------------------ ecliptic_sunorbit -------------------
 * Description: Calculates the elements of the Sun's "orbit"
 *              for the instant implied by T.
 *
 * Parameters:  double T     -- No. of Julian centuries from
 *                              noon GMT on 0/1/1900.
 *              double *Lptr -- Ptr to double to fill in with mean
 *                              longitude.
 *              double *Mptr -- Ptr to double to fill in with mean
 *                              anomaly.
 *              double *eptr -- Ptr to double to fill in with eccentricity.
 * Returns:     void.
 * Other info:  All angles in radians, in range 0 <= angle < 2 Pi.
 */

  void ecliptic_sunorbit(double T, double *Lptr, double *Mptr, double *eptr);



/*-------------------- ecliptic_radec --------------------
 * Description: Converts ecliptic latitude and longitude
 *              to right ascension and declination (radians).
 *
 * Parameters:  REAL elatit  -- ecliptic latitude.
 *              REAL elongit -- ecliptic longitude.
 *              double T     -- Julian centuries from noon GMT on
 *                              0/1/1900 to required instant.
 *              REAL *raptr  -- pointer to REAL to fill in
 *                              with right ascension.
 *              REAL *decptr -- pointer to REAL to fill in
 *                              with declination.
 * Returns:     void.
 * Other info:  All angles in radians.
 */

  void ecliptic_radec(REAL elatit, REAL elongit, double T, 
                      REAL *raptr, REAL *decptr);
