ftp.nice.ch/pub/next/science/astronomy/usat-NeXT.N.bs.tar.gz#/usat/almanacAA/epsiln.c

This is epsiln.c in view mode; [Download] [Up]

/************************************************************************/
/* epsiln.c								*/
/*									*/
/* Obliquity of the ecliptic at Julian date J				*/
/*									*/
/* IAU Coefficients are from:						*/
/* J. H. Lieske, T. Lederle, W. Fricke, and B. Morando,			*/
/* "Expressions for the Precession Quantities Based upon the IAU (1976)	*/
/* System of Astronomical Constants,"  Astronomy and Astrophysics	*/
/* 58, 1-16 (1977).							*/
/*									*/
/* Before or after 200 years from J2000, the formula used is from:	*/
/* J. Laskar, "Secular terms of classical planetary theories		*/
/* using the results of general theory," Astronomy and Astrophysics	*/
/* 157, 59070 (1986).							*/
/*									*/
/*  See precess.c and page B18 of the Astronomical Almanac.		*/
/************************************************************************/

/***** description
 *
 *	$Id: epsiln.c,v 1.3 1993/04/21 21:14:29 craig Exp $
 *
 */

/***** modification history
 *
 *	$Log: epsiln.c,v $
 * Revision 1.3  1993/04/21  21:14:29  craig
 * Changed path of the satellite.h include.
 * Changed ecnsts to pcnsts.
 *
 * Revision 1.2  1993/04/21  15:14:24  craig
 * First working version. Ran through indent and converted to ansi.
 * Added hooks for use with the satellite programs.
 *
 *
 */

/***** include files *****/

#include <math.h>
#include "aaproto.h"
#include "satellite.h"

/***** global variables *****/

extern struct MCONSTANTS mcnsts;
extern struct PCONSTANTS pcnsts;

/* The results of the program are returned in these global variables: */

double jdeps = -1.0;			/* Date for which obliquity was
					   last computed */
double eps = 0.0;			/* The computed obliquity in
					   radians */
double coseps = 0.0;			/* Cosine of the obliquity */
double sineps = 0.0;			/* Sine of the obliquity */

/**********/
/* epsiln */
/**********/

int    epsiln (double J)
{
    double T;

    if (J == jdeps)
    {
	return (0);
    }

    T = (J - pcnsts.J2000) / pcnsts.dapcen;

    if (fabs (T) < 2.0)
    {
	/* This expansion is from the AA. Note the official 1976 IAU
	   number is 23d 26' 21.448", but the JPL numerical integration
	   found 21.4119". */

	eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448)
	    * mcnsts.sec2ra;
    }
    else
    {
	/* This expansion is from Laskar, cited above. Bretagnon and Simon
	   say, in Planetary Programs and Tables, that it is accurate to
	   0.1" over a span of 6000 years. Laskar estimates the precision
	   to be 0.01" after 1000 years and a few seconds of arc after
	   10000 years. */

	T /= 10.0;
	eps = (((((((((2.45e-10 * T + 5.79e-9) * T + 2.787e-7) * T
				    + 7.12e-7) * T - 3.905e-5) * T
			    - 2.4967e-3) * T - 5.138e-3) * T
		    + 1.99925) * T - 0.0155) * T - 468.093)
	    * T + 84381.448;
	eps *= mcnsts.sec2ra;
    }

    coseps = cos (eps);
    sineps = sin (eps);
    jdeps = J;

    return (0);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.