Index: trunk/SophyaExt/XephemAstroLib/Makefile
===================================================================
--- trunk/SophyaExt/XephemAstroLib/Makefile	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/Makefile	(revision 1457)
@@ -0,0 +1,21 @@
+include $(DPCBASEREP)/Include/MakefileUser.h
+
+all: libxastro.a
+
+clean:
+	rm -f libxastro.a
+	rm -f *.o
+
+install:
+	rm -f $(EXTINCPATH)/XAstro/*
+	rm -f $(EXTLIBPATH)/libxastro.a
+	cp -v *.h $(EXTINCPATH)/XAstro/.
+	cp -v libxastro.a $(EXTLIBPATH)/.
+
+OBJASTRO := $(addsuffix .o,$(basename $(wildcard *.c)))
+
+libxastro.a : $(OBJASTRO)
+	$(AR) $(ARFLAGS) $@ $(OBJASTRO)
+
+%.o: %.c
+	$(COMPILE.c) -o $@ $<
Index: trunk/SophyaExt/XephemAstroLib/P_.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/P_.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/P_.h	(revision 1457)
@@ -0,0 +1,14 @@
+/* surround declarations with P_() to include prototypes if it looks likes
+ * compiler should handle them.
+ */
+#ifndef P_
+#if defined(__STDC__) || defined(__cplusplus) || NeedFunctionPrototypes
+#define P_(s) s
+#else
+#define P_(s) ()
+#endif
+#endif /* P_ */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: P_.h,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/README
===================================================================
--- trunk/SophyaExt/XephemAstroLib/README	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/README	(revision 1457)
@@ -0,0 +1,21 @@
+This library contains the basic ephemeris code.
+
+Earth satellite orbit propagation is based on the NORAD SGP4/SDP4 code, as
+converted from the orginal FORTRAN to C by Magnus Backstrom. The paper
+"Spacetrack Report Number 3: Models for Propagation of NORAD Element Sets"
+describes the calculations.
+See http://www.celestrak.com/NORAD/documentation/spacetrk.pdf.
+He following files implement this package:
+    actan.c
+    deep.c
+    deepconst.h
+    satlib.h
+    satspec.h
+    sattypes.h
+    sdp4.c
+    sgp4.c
+    thetag.c
+    vector.h
+
+! For RCS Only -- Do Not Edit
+! @(#) $RCSfile: README,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
Index: trunk/SophyaExt/XephemAstroLib/VERSION
===================================================================
--- trunk/SophyaExt/XephemAstroLib/VERSION	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/VERSION	(revision 1457)
@@ -0,0 +1,5 @@
+--------------------------------------------------------
+     "libastro" Xephem library version 3.4
+--------------------------------------------------------
+That code comes out of the Xephem software "libastro" part.
+http://www.clearskyinstitute.com/xephem/xephem.html
Index: trunk/SophyaExt/XephemAstroLib/aa_hadec.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/aa_hadec.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/aa_hadec.c	(revision 1457)
@@ -0,0 +1,78 @@
+/* function to convert between alt/az and ha/dec.
+ */
+
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+static void aaha_aux P_((double lat, double x, double y, double *p, double *q));
+
+/* given geographical latitude (n+, radians), lat, altitude (up+, radians),
+ * alt, and azimuth (angle round to the east from north+, radians),
+ * return hour angle (radians), ha, and declination (radians), dec.
+ */
+void
+aa_hadec (lat, alt, az, ha, dec)
+double lat;
+double alt, az;
+double *ha, *dec;
+{
+	aaha_aux (lat, az, alt, ha, dec);
+	if (*ha > PI)
+	    *ha -= 2*PI;
+}
+
+/* given geographical (n+, radians), lat, hour angle (radians), ha, and
+ * declination (radians), dec, return altitude (up+, radians), alt, and
+ * azimuth (angle round to the east from north+, radians),
+ */
+void
+hadec_aa (lat, ha, dec, alt, az)
+double lat;
+double ha, dec;
+double *alt, *az;
+{
+	aaha_aux (lat, ha, dec, az, alt);
+}
+
+#ifdef NEED_GEOC
+/* given a geographic (surface-normal) latitude, phi, return the geocentric
+ * latitude, psi.
+ */
+double
+geoc_lat (phi)
+double phi;
+{
+#define	MAXLAT	degrad(89.9999)	/* avoid tan() greater than this */
+	return (fabs(phi)>MAXLAT ? phi : atan(tan(phi)/1.00674));
+}
+#endif
+
+/* the actual formula is the same for both transformation directions so
+ * do it here once for each way.
+ * N.B. all arguments are in radians.
+ */
+static void
+aaha_aux (lat, x, y, p, q)
+double lat;
+double x, y;
+double *p, *q;
+{
+	static double last_lat = -3434, slat, clat;
+	double cap, B;
+
+	if (lat != last_lat) {
+	    slat = sin(lat);
+	    clat = cos(lat);
+	    last_lat = lat;
+	}
+
+	solve_sphere (-x, PI/2-y, slat, clat, &cap, &B);
+	*p = B;
+	*q = PI/2 - acos(cap);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aa_hadec.c,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/aberration.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/aberration.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/aberration.c	(revision 1457)
@@ -0,0 +1,136 @@
+/* aberration, Jean Meeus, "Astronomical Algorithms", Willman-Bell, 1995;
+ * based on secular unperturbed Kepler orbit
+ *
+ * the corrections should be applied to ra/dec and lam/beta of the 
+ * epoch of date.
+ */
+
+#include <stdio.h>
+#include <math.h>
+
+#if defined(__STDC__)
+#include <stdlib.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+
+#define ABERR_CONST	(20.49552/3600./180.*PI)  /* aberr const in rad */
+#define AB_ECL_EOD	0
+#define AB_EQ_EOD	1
+
+static void ab_aux P_((double mjd, double *x, double *y, double lsn,
+	int mode));
+
+/* apply aberration correction to ecliptical coordinates *lam and *bet
+ * (in radians) for a given time mjd and handily supplied longitude of sun,
+ * lsn (in radians)
+ */
+void
+ab_ecl (mjd, lsn, lam, bet)
+double mjd, lsn, *lam, *bet;
+{
+	ab_aux(mjd, lam, bet, lsn, AB_ECL_EOD);
+}
+
+/* apply aberration correction to equatoreal coordinates *ra and *dec
+ * (in radians) for a given time mjd and handily supplied longitude of sun,
+ * lsn (in radians)
+ */
+void
+ab_eq (mjd, lsn, ra, dec)
+double mjd, lsn, *ra, *dec;
+{
+	ab_aux(mjd, ra, dec, lsn, AB_EQ_EOD);
+}
+
+/* because the e-terms are secular, keep the real transformation for both
+ * coordinate systems in here with the secular variables cached.
+ * mode == AB_ECL_EOD:	x = lam, y = bet	(ecliptical)
+ * mode == AB_EQ_EOD:	x = ra,  y = dec	(equatoreal)
+ */
+static void
+ab_aux (mjd, x, y, lsn, mode)
+double mjd, *x, *y, lsn;
+int mode;
+{
+	static double lastmjd = -10000;
+	static double eexc;	/* earth orbit excentricity */
+	static double leperi;	/* ... and longitude of perihelion */
+	static char dirty = 1;	/* flag for cached trig terms */
+
+	if (mjd != lastmjd) {
+	    double T;		/* centuries since J2000 */
+
+	    T = (mjd - J2000)/36525.;
+	    eexc = 0.016708617 - (42.037e-6 + 0.1236e-6 * T) * T;
+	    leperi = degrad(102.93735 + (0.71953 + 0.00046 * T) * T);
+	    lastmjd = mjd;
+	    dirty = 1;
+	}
+
+	switch (mode) {
+	case AB_ECL_EOD:		/* ecliptical coords */
+	    {
+		double *lam = x, *bet = y;
+		double dlsun, dlperi;
+
+		dlsun = lsn - *lam;
+		dlperi = leperi - *lam;
+
+		/* valid only for *bet != +-PI/2 */
+		*lam -= ABERR_CONST/cos(*bet) * (cos(dlsun) -
+				eexc*cos(dlperi));
+		*bet -= ABERR_CONST*sin(*bet) * (sin(dlsun) -
+				eexc*sin(dlperi));
+	    }
+	    break;
+
+	case AB_EQ_EOD:			/* equatoreal coords */
+	    {
+		double *ra = x, *dec = y;
+		double sr, cr, sd, cd, sls, cls;/* trig values coords */
+		static double cp, sp, ce, se;	/* .. and perihel/eclipic */
+		double dra, ddec;		/* changes in ra and dec */
+
+		if (dirty) {
+		    double eps;
+
+		    cp = cos(leperi);
+		    sp = sin(leperi);
+		    obliquity(mjd, &eps);
+		    se = sin(eps);
+		    ce = cos(eps);
+		    dirty = 0;
+		}
+
+		sr = sin(*ra);
+		cr = cos(*ra);
+		sd = sin(*dec);
+		cd = cos(*dec);
+		sls = sin(lsn);
+		cls = cos(lsn);
+
+		dra = ABERR_CONST/cd * ( -(cr * cls * ce + sr * sls) +
+			    eexc * (cr * cp * ce + sr * sp));
+
+		ddec = se/ce * cd - sr * sd;	/* tmp use */
+		ddec = ABERR_CONST * ( -(cls * ce * ddec + cr * sd * sls) +
+			    eexc * (cp * ce * ddec + cr * sd * sp) );
+		
+		*ra += dra;
+		range (ra, 2*PI);
+		*dec += ddec;
+	    }
+	    break;
+
+	default:
+	    printf ("ab_aux: bad mode: %d\n", mode);
+	    exit (1);
+	    break;
+
+	} /* switch (mode) */
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aberration.c,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/actan.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/actan.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/actan.c	(revision 1457)
@@ -0,0 +1,61 @@
+#include <math.h>
+
+/* @(#) $Id: actan.c,v 1.1.1.1 2001-04-10 14:40:45 cmv Exp $ */
+
+double
+actan(double sinx, double cosx)
+{
+    double ret;
+
+    ret = 0.0;
+    if(cosx < 0.0) {
+	ret = M_PI;
+    } else if(cosx == 0.0) {
+	if(sinx < 0.0) {
+	    return 3.0 * M_PI_2;
+	} else if(sinx == 0.0) {
+	    return ret;
+	} else /* sinx > 0.0 */ {
+	    return M_PI_2;
+	}
+    } else /* cosx > 0.0 */ {
+	if(sinx < 0.0) {
+	    ret = 2.0 * M_PI;
+	} else if(sinx == 0.0) {
+	    return ret;
+	}
+    }
+
+    return ret + atan(sinx / cosx);
+}
+
+
+#if 0
+
+#define D(X) (180.0 * (X) / M_PI)
+
+void main() {
+    double a, b;
+
+    a =  0.0; b =  2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  1.0; b =  2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  2.0; b =  2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  2.0; b =  1.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  2.0; b =  0.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  2.0; b = -1.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  2.0; b = -2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  1.0; b = -2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a =  0.0; b = -2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -1.0; b = -2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -2.0; b = -2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -2.0; b = -1.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -2.0; b =  0.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -2.0; b =  1.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -2.0; b =  2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+    a = -1.0; b =  2.0; printf("actan(%f, %f) = %f\n", a, b, D(actan(a, b)));
+}
+
+#endif /* 0 */
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: actan.c,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/airmass.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/airmass.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/airmass.c	(revision 1457)
@@ -0,0 +1,27 @@
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* given apparent altitude find airmass.
+ * R.H. Hardie, 1962, `Photoelectric Reductions', Chapter 8 of Astronomical
+ * Techniques, W.A. Hiltner (Ed), Stars and Stellar Systems, II (University
+ * of Chicago Press: Chicago), pp178-208. 
+ */
+void
+airmass (aa, Xp)
+double aa;		/* apparent altitude, rads */
+double *Xp;		/* airmasses */
+{
+	double sm1;	/* secant zenith angle, minus 1 */
+
+	/* degenerate near or below horizon */
+	if (aa < degrad(3.0))
+	    aa = degrad(3.0);
+
+	sm1 = 1.0/sin(aa) - 1.0;
+	*Xp = 1.0 + sm1*(0.9981833 - sm1*(0.002875 + 0.0008083*sm1));
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: airmass.c,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/anomaly.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/anomaly.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/anomaly.c	(revision 1457)
@@ -0,0 +1,66 @@
+/* improved by rclark@lpl.arizona.edu (Richard Clark) */
+
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+
+#define TWOPI   	(2*PI)
+#define	STOPERR		(1e-8)
+
+/* given the mean anomaly, ma, and the eccentricity, s, of elliptical motion,
+ * find the true anomaly, *nu, and the eccentric anomaly, *ea.
+ * all angles in radians.
+ */
+void
+anomaly (ma, s, nu, ea)
+double ma, s;
+double *nu, *ea;
+{
+        double m, fea, corr;
+
+        if (s < 1.0) {
+            /* elliptical */
+            double dla;
+
+            m = ma-TWOPI*(long)(ma/TWOPI);
+            if (m > PI) m -= TWOPI;
+            if (m < -PI) m += TWOPI;
+            fea = m;
+
+            for (;;) {
+                dla = fea-(s*sin(fea))-m;
+                if (fabs(dla)<STOPERR)
+                    break;
+                /* avoid runnaway corrections for e>.97 and M near 0*/
+                corr = 1-(s*cos(fea));
+                if (corr < .1) corr = .1;
+                dla /= corr;
+                fea -= dla;
+            }
+            *nu = 2*atan(sqrt((1+s)/(1-s))*tan(fea/2));
+        } else {
+            /* hyperbolic */
+	    double fea1;
+
+            m = fabs(ma);
+            fea = m / (s-1.);
+	    fea1 = pow(6*m/(s*s),1./3.);
+            /* whichever is smaller is the better initial guess */
+            if (fea1 < fea) fea = fea1;
+
+	    corr = 1;
+            while (fabs(corr) > STOPERR) {
+		corr = (m - s * sinh(fea) + fea) / (s*cosh(fea) - 1);
+		fea += corr;
+            }
+            if (ma < 0.) fea = -fea;
+            *nu = 2*atan(sqrt((s+1)/(s-1))*tanh(fea/2));
+        }
+        *ea = fea;
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: anomaly.c,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/ap_as.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/ap_as.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/ap_as.c	(revision 1457)
@@ -0,0 +1,62 @@
+#include <string.h>
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+
+/* convert the given apparent RA/Dec to astrometric precessed to Mjd IN PLACE.
+ * we have no un-abberation etc so to find the correction: assume
+ * *rap and *decp are astrometric@EOD, convert to apparent and back out
+ * the difference; then precess to Mjd.
+ */
+void
+ap_as (np, Mjd, rap, decp)
+Now *np;
+double Mjd;
+double *rap, *decp;
+{
+	Obj o;
+	Now n;
+
+	zero_mem ((void *)&o, sizeof(o));
+	o.o_type = FIXED;
+	o.f_RA = (float)*rap;
+	o.f_dec = (float)*decp;
+	o.f_epoch = (float)mjd;
+	memcpy ((void *)&n, (void *)np, sizeof(Now));
+	n.n_epoch = EOD;
+	obj_cir (&n, &o);
+	*rap -= o.s_ra - *rap;
+	range (rap, 2*PI);
+	*decp -= o.s_dec - *decp;
+	if (*decp >  PI/2) *decp =  PI - *decp;
+	if (*decp < -PI/2) *decp = -PI - *decp;
+	precess (mjd, Mjd, rap, decp);
+}
+
+/* convert the given astrometric RA/Dec which are precessed to Mjd into
+ * apparent @ EOD IN PLACE.
+ */
+void
+as_ap (np, Mjd, rap, decp)
+Now *np;
+double Mjd;
+double *rap, *decp;
+{
+	Obj o;
+	Now n;
+
+	zero_mem ((void *)&o, sizeof(o));
+	o.o_type = FIXED;
+	o.f_RA = (float)*rap;
+	o.f_dec = (float)*decp;
+	o.f_epoch = (float)Mjd;
+	memcpy ((void *)&n, (void *)np, sizeof(Now));
+	n.n_epoch = EOD;
+	obj_cir (&n, &o);
+	*rap = o.s_ra;
+	*decp = o.s_dec;
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: ap_as.c,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/astro.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/astro.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/astro.h	(revision 1457)
@@ -0,0 +1,187 @@
+#ifndef PI
+#define	PI		3.141592653589793
+#endif
+
+/* conversions among hours (of ra), degrees and radians. */
+#define	degrad(x)	((x)*PI/180.)
+#define	raddeg(x)	((x)*180./PI)
+#define	hrdeg(x)	((x)*15.)
+#define	deghr(x)	((x)/15.)
+#define	hrrad(x)	degrad(hrdeg(x))
+#define	radhr(x)	deghr(raddeg(x))
+
+/* ratio of from synodic (solar) to sidereal (stellar) rate */
+#define	SIDRATE		.9972695677
+
+#define	SPD	(24.0*3600.0)	/* seconds per day */
+
+/* manifest names for planets.
+ * N.B. must coincide with usage in pelement.c and plans.c.
+ * N.B. only the first 8 are valid for use with plans().
+ */
+#define	MERCURY	0
+#define	VENUS	1
+#define	MARS	2
+#define	JUPITER	3
+#define	SATURN	4
+#define	URANUS	5
+#define	NEPTUNE	6
+#define	PLUTO	7
+
+/* a few more handy ones */
+#define	SUN	8
+#define	MOON	9
+#define	OBJX	10
+#define	OBJY	11
+#define	OBJZ	12
+#define	NOBJ	13	/* total number of basic objects */
+
+/* starting point for MJD calculations
+ */
+#define MJD0  2415020.0
+#define J2000 (2451545.0 - MJD0)      /* let compiler optimise */
+
+
+
+/* global function declarations */
+
+/* aa_hadec.c */
+extern void aa_hadec P_((double lat, double alt, double az, double *ha,
+    double *dec));
+extern void hadec_aa P_((double lat, double ha, double dec, double *alt,
+    double *az)); 
+
+/* aberration.c */
+extern void ab_ecl P_((double mjd, double lsn, double *lam, double *bet));
+extern void ab_eq P_((double mjd, double lsn, double *ra, double *dec));
+
+/* airmass.c */
+extern void airmass P_((double aa, double *Xp));
+
+/* anomaly.c */
+extern void anomaly P_((double ma, double s, double *nu, double *ea));
+
+/* chap95.c */
+extern int chap95 P_((double mjd, int obj, double prec, double *ret));
+
+/* chap95_data.c */
+
+/* comet.c */
+extern void comet P_((double mjd, double ep, double inc, double ap, double qp,
+    double om, double *lpd, double *psi, double *rp, double *rho, double *lam,
+    double *bet));
+
+/* deltat.c */
+extern double deltat P_((double mjd));
+
+/* eq_ecl.c */
+extern void eq_ecl P_((double mjd, double ra, double dec, double *lat,
+    double *lng));
+extern void ecl_eq P_((double mjd, double lat, double lng, double *ra,
+    double *dec));
+
+/* eq_gal.c */
+extern void eq_gal P_((double mjd, double ra, double dec, double *lat,
+    double *lng));
+extern void gal_eq P_((double mjd, double lat, double lng, double *ra,
+    double *dec));
+
+/* formats.c */
+extern void fs_sexa P_((char *out, double a, int w, int fracbase));
+extern void fs_date P_((char out[], double jd));
+extern void f_scansex P_((double o, char *str, double *dp));
+extern void f_sscandate P_((char *bp, int pref, int *m, double *d, int *y));
+extern int scansex P_((char *str, double *dp));
+
+/* helio.c */
+extern void heliocorr P_((double jd, double ra, double dec, double *hcp));
+
+/* libration.c */
+extern void llibration P_((double JD, double *llatp, double *llonp));
+
+/* misc.c */
+extern void zero_mem P_((void *loc, unsigned len));
+extern int tickmarks P_((double min, double max, int numdiv, double ticks[]));
+extern int lc P_((int cx, int cy, int cw, int x1, int y1, int x2, int y2,
+    int *sx1, int *sy1, int *sx2, int *sy2));
+extern void hg_mag P_((double h, double g, double rp, double rho, double rsn,
+    double *mp));
+extern int magdiam P_((int fmag, int magstp, double scale, double mag,
+    double size));
+extern void gk_mag P_((double g, double k, double rp, double rho, double *mp));
+extern double atod P_((char *buf));
+extern void solve_sphere P_((double A, double b, double cc, double sc,
+    double *cap, double *Bp));
+extern double delra P_((double dra));
+
+/* mjd.c */
+extern void cal_mjd P_((int mn, double dy, int yr, double *mjd));
+extern void mjd_cal P_((double mjd, int *mn, double *dy, int *yr));
+extern int mjd_dow P_((double mjd, int *dow));
+extern int isleapyear P_((int year));
+extern void mjd_dpm P_((double mjd, int *ndays));
+extern void mjd_year P_((double mjd, double *yr));
+extern void year_mjd P_((double y, double *mjd));
+extern void rnd_second P_((double *t));
+extern void mjd_dayno P_((double jd, int *yr, double *dy));
+extern double mjd_day P_((double jd));
+extern double mjd_hr P_((double jd));
+extern void range P_((double *v, double r));
+
+/* moon.c */
+extern void moon P_((double mjd, double *lam, double *bet, double *rho,
+    double *msp, double *mdp));
+
+/* mooncolong.c */
+extern void moon_colong P_((double jd, double lt, double lg, double *cp, double *kp, double *ap, double *sp));
+
+/* nutation.c */
+extern void nutation P_((double mjd, double *deps, double *dpsi));
+extern void nut_eq P_((double mjd, double *ra, double *dec));
+
+/* obliq.c */
+extern void obliquity P_((double mjd, double *eps));
+
+/* parallax.c */
+extern void ta_par P_((double tha, double tdec, double phi, double ht,
+    double *rho, double *aha, double *adec));
+
+/* plans.c */
+extern void plans P_((double mjd, int p, double *lpd0, double *psi0,
+    double *rp0, double *rho0, double *lam, double *bet, double *dia,
+    double *mag));
+
+/* precess.c */
+extern void precess P_((double mjd1, double mjd2, double *ra, double *dec));
+
+/* reduce.c */
+extern void reduce_elements P_((double mjd0, double mjd, double inc0,
+    double ap0, double om0, double *inc, double *ap, double *om));
+
+/* refract.c */
+extern void unrefract P_((double pr, double tr, double aa, double *ta));
+extern void refract P_((double pr, double tr, double ta, double *aa));
+
+/* riset.c */
+extern void riset P_((double ra, double dec, double lat, double dis,
+    double *lstr, double *lsts, double *azr, double *azs, int *status));
+
+/* sphcart.c */
+extern void sphcart P_((double l, double b, double r, double *x, double *y,
+    double *z));
+extern void cartsph P_((double x, double y, double z, double *l, double *b,
+    double *r));
+
+/* sun.c */
+extern void sunpos P_((double mjd, double *lsn, double *rsn, double *bsn));
+
+/* utc_gst.c */
+extern void utc_gst P_((double mjd, double utc, double *gst));
+extern void gst_utc P_((double mjd, double gst, double *utc));
+
+/* vsop87.c */
+extern int vsop87 P_((double mjd, int obj, double prec, double *ret));
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: astro.h,v $ $Date: 2001-04-10 14:40:45 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/auxil.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/auxil.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/auxil.c	(revision 1457)
@@ -0,0 +1,50 @@
+/* aux functions so programs besides XEphem can use this library.
+ */
+
+#include <stdio.h>
+
+#if defined (__STDC__)
+#include <stdlib.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+#include "preferences.h"
+
+static int prefs[NPREFS] = {
+    PREF_TOPO, PREF_METRIC, PREF_MDY, PREF_UTCTZ, PREF_HIPREC, PREF_NOMSGBELL,
+    PREF_PREFILL, PREF_TIPSON, PREF_CONFIRMON
+};
+
+/* called anytime we want to know a preference.
+ */
+int
+pref_get(pref)
+Preferences pref;
+{
+	return (prefs[pref]);
+}
+
+/* call to force a certain preference, return the old setting.
+ */
+int
+pref_set (pref, new)
+Preferences pref;
+int new;
+{
+	int prior = pref_get(pref);
+	prefs[pref] = new;
+	return (prior);
+}
+
+/* given an mjd, return it modified for terrestial dynamical time */
+double
+mm_mjed (np)
+Now *np;
+{
+	return (mjd + deltat(mjd)/86400.0);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: auxil.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/chap95.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/chap95.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/chap95.c	(revision 1457)
@@ -0,0 +1,180 @@
+/* heliocentric rectangular equatorial coordinates of Jupiter to Pluto;
+ * from Chapront's expansion of DE200/extension of DE200;  mean equator J2000.0
+ *
+ * calculation time (milliseconds) on an HP 715/75, Jupiter to Pluto:
+ * (each coordinate component counted as 1 term,
+ * secular terms included for JD 2448908.5 = 1992 Oct 13.0)
+ *
+ *      prec	terms	rates	no rates
+ *	0.0	2256	5.1	4.6
+ *
+ *	1e-7	792	2.6	2.4	--> nominal precision rel. to DE200
+ *	1e-6	535	2.1	2.0
+ *	1e-5	350	1.8	1.6
+ *	1e-4	199	1.5	1.4
+ *	1e-3	96	1.2	1.1
+ *
+ *	no drop	2256	4.5	3.9	(code without test criterion)
+ */
+
+#include <math.h>
+#include "P_.h"
+#include "astro.h"
+#include "chap95.h"
+
+extern void zero_mem P_((void *loc, unsigned len));
+
+#define CHAP_MAXTPOW	2	/* NB: valid for all 5 outer planets */
+
+/* chap95()
+ *
+ * input:
+ *	mjd	modified JD; days from J1900.0 = 2415020.0
+ *
+ *	prec	precision level, in radians.
+ *		if (prec = 0.0), you get the full precision, namely
+ *		a deviation of not more than 0.02 arc seconds (1e-7 rad)
+ *		from the JPL DE200 integration, on which this expansion
+ *		is based.
+ *
+ *	obj	object number as in astro.h (jupiter=3, saturn=4, ...)
+ *
+ * output:
+ *	ret[6]	cartesian components of position and velocity
+ *
+ * return:
+ *	0	Ok
+ *	1	time out of range [CHAP_BEGIN .. CHAP_END]
+ *	2	object out of range [JUPITER .. PLUTO]
+ *	3	precision out of range [0.0 .. 1e-3]
+ */
+int
+chap95 (mjd, obj, prec, ret)
+double mjd;
+int obj;
+double prec;
+double *ret;
+{
+	static double a0[] = {		/* semimajor axes for precision ctrl */
+	    0.39, 0.72, 1.5, 5.2, 9.6, 19.2, 30.1, 39.5, 1.0
+	};
+	double sum[CHAP_MAXTPOW+1][6];	/* [T^0, ..][X,Y,Z,X',Y',Z'] */
+	double T, t;			/* time in centuries and years */
+	double ca, sa, Nu;		/* aux vars for terms */
+	double precT[CHAP_MAXTPOW+1];	/* T-augmented precision threshold */
+	chap95_rec *rec;		/* term coeffs */
+	int cooidx;
+
+	/* check parameters */
+	if (mjd < CHAP_BEGIN || mjd > CHAP_END)
+		return (1);
+
+	if (obj < JUPITER || obj > PLUTO)
+		return (2);
+
+	if (prec < 0.0 || prec > 1e-3)
+		return (3);
+
+	/* init the sums */
+	zero_mem ((void *)sum, sizeof(sum));
+
+	T = (mjd - J2000)/36525.0;	/* centuries since J2000.0 */
+
+	/* modify precision treshold for
+	 * a) term storing scale
+	 * b) convert radians to au
+	 * c) account for skipped terms (more terms needed for better prec)
+	 *    threshold empirically established similar to VSOP; stern
+	 * d) augment for secular terms
+	 */
+	precT[0] = prec * CHAP_SCALE				/* a) */
+			* a0[obj]				/* b) */
+			/ (10. * (-log10(prec + 1e-35) - 2));	/* c) */
+	t = 1./(fabs(T) + 1e-35);				/* d) */
+	precT[1] = precT[0]*t;
+	precT[2] = precT[1]*t;
+
+	t = T * 100.0;		/* YEARS since J2000.0 */
+
+	ca = sa = Nu = 0.;	/* shut up compiler warning 'uninitialised' */
+
+	switch (obj) {		/* set initial term record pointer */
+	    case JUPITER:	rec = chap95_jupiter;	break;
+	    case SATURN:	rec = chap95_saturn;	break;
+	    case URANUS:	rec = chap95_uranus;	break;
+	    case NEPTUNE:	rec = chap95_neptune;	break;
+	    case PLUTO:		rec = chap95_pluto;	break;
+	    default:
+		return (2);	/* wrong object: severe internal trouble */
+	}
+
+	/* do the term summation into sum[T^n] slots */
+	for (; rec->n >= 0; ++rec) {
+	    double *amp;
+
+	    /* NOTE:  The formula
+	     * X = SUM[i=1,Records] T**n_i*(CX_i*cos(Nu_k*t)+SX_i*sin(Nu_k*t))
+	     * could be rewritten as  SUM( ... A sin (B + C*t) )
+	     * "saving" trigonometric calls.  However, e.g. for Pluto,
+	     * there are only 65 distinct angles NU_k (130 trig calls).
+	     * With that manipulation, EVERY arg_i would be different for X,
+	     * Y and Z, which is 3*96 terms.  Hence, the formulation as
+	     * given is good (optimal?).
+	     */
+
+	    for (cooidx = 0, amp = rec->amp; cooidx < 3; ++cooidx) {
+		double C, S, term, termdot;
+		short n;		/* fast access */
+
+		C = *amp++;
+		S = *amp++;
+		n = rec->n;
+
+		/* drop term if too small
+		 * this is quite expensive:  17% of loop time
+		 */
+		if (fabs(C) + fabs(S) < precT[n])
+			continue;
+
+		if (n == 0 && cooidx == 0) {	/* new Nu only here */
+		    double arg;
+
+		    Nu = rec->Nu;
+		    arg = Nu * t;
+		    arg -= floor(arg/(2.*PI))*(2.*PI);
+		    ca = cos(arg);	/* blast it - even for Nu = 0.0 */
+		    sa = sin(arg);
+		}
+
+		term = C * ca + S * sa;
+		sum[n][cooidx] += term;
+#if CHAP_GETRATE
+		termdot = (-C * sa + S * ca) * Nu;
+		sum[n][cooidx+3] += termdot;
+		if (n > 0) sum[n - 1][cooidx+3] += n/100.0 * term;
+#endif
+	    } /* cooidx */
+	} /* records */
+
+	/* apply powers of time and sum up */
+	for (cooidx = 0; cooidx < 6; ++cooidx) {
+	    ret[cooidx] = (sum[0][cooidx] +
+			T * (sum[1][cooidx] +
+			T * (sum[2][cooidx] )) )/CHAP_SCALE;
+	}
+
+	/* TEST: if the MAIN terms are dropped, get angular residue
+	ret[0] = sqrt(ret[0]*ret[0] + ret[1]*ret[1] + ret[2]*ret[2])/a0[obj];
+	*/
+
+#if CHAP_GETRATE
+	for (cooidx = 3; cooidx < 6; ++cooidx) {
+	    ret[cooidx] /= 365.25;	/* yearly to daily rate */
+	}
+#endif
+
+    return (0);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: chap95.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/chap95.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/chap95.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/chap95.h	(revision 1457)
@@ -0,0 +1,69 @@
+/* Position of outer planets; straightforward from:
+ftp://adc.gsfc.nasa.gov/pub/adc/archives/journal_tables/A+AS/109/181:
+
+J/A+AS/109/181                            Planetary ephemerides (Chapront, 1995)
+===============================================================================
+Representation of planetary ephemerides by frequency analysis. Application to
+the five outer planets.
+       CHAPRONT J.
+      <Astron. Astrophys. Suppl. Ser. 109, 181 (1995)>
+      =1995A&AS..109..181C      (SIMBAD/NED Reference)
+===============================================================================
+
+Keywords: ephemerides - planets and satellites: general - methods: numerical
+
+Contents:
+  Heliocentric equatorial rectangular coordinates of the five outer planets
+  (X, Y and Z). The source is based on DE200 (tables 4 to 7) or a reconstruction
+  of DE200 by numerical integration (tables 9 to 13). The reference frame is
+  the mean equator and equinox J2000 of DE200.
+
+  The general formulation of the series X is:
+  X = SUM[i=1,Records] T**n_i*(CX_i*cos(Nu_k*t)+SX_i*sin(Nu_k*t))
+  The formulation is identical for Y and Z.
+  T is the time (TDB) in Julian centuries from J2000:
+        T = (JulianDate - 2451545.0)/36525
+  t is the time (TDB) in Julian years from J2000:
+        t = (JulianDate - 2451545.0)/365.25
+  Nu is the frequency. Frequencies are identical for all terms of rank k:
+                Nu_k = Nu_i when n_i = 0
+                For purely secular terms k = 0 and Nu_0 = 0
+
+===============================================================================
+(End)                                          Patricia Bauer [CDS] 03-Oct-1994
+*/
+
+#define CHAP_SCALE	1e10
+
+/* JDs of validity period */
+#define CHAP_BEGIN	(2338032.5 - MJD0)	/* 1689/3/19 */
+#define CHAP_END	(2542032.5 - MJD0)	/* 2247/10/1 */
+
+/* coding flags */
+/* calculating rates increases time by about 10%
+ *
+ * On an HP715/75, for pluto the times per step are 0.00049 s and 0.00057 s
+ * This method is quite fast.
+ */
+#define CHAP_GETRATE    1
+
+typedef struct {
+	short n;	/* order of time; "-1" marks end of list */
+	double amp[6];	/* amplitudes of cosine and sine terms for x,y,z */
+			/* in original order [CX,SX,CY,SY,CZ,SZ] */
+	double Nu;	/* Frequency Nu_k; given only at n=0 */
+} chap95_rec;
+
+extern chap95_rec chap95_jupiter[];
+extern chap95_rec chap95_saturn[];
+extern chap95_rec chap95_uranus[];
+extern chap95_rec chap95_neptune[];
+extern chap95_rec chap95_pluto[];
+
+#include "P_.h"
+extern int chap95 P_((double mjd, int obj, double prec, double *ret));
+
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: chap95.h,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/chap95_data.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/chap95_data.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/chap95_data.c	(revision 1457)
@@ -0,0 +1,783 @@
+/* data tables for Chapront95 expansion of DE200 for outer planets
+ *
+ * created by automatic conversion from original distribution files at
+ * ftp://adc.gsfc.nasa.gov/pub/adc/archives/journal_tables/A+AS/109/181
+ */
+
+#include "chap95.h"
+
+chap95_rec chap95_jupiter[] = {
+	{ 0, { -3658015942., 0., -908357166., 0., -300271978., 0. }, 0. },
+	{ 1, { 3211736., 0., -12066362., 0., -5380492., 0. },  },
+	{ 0, { 4891337., 5430776., -9059458., 4045908., -3979137., 1598300. }, 0.0168745727060282 },
+	{ 1, { -1952368., 3224556., -3665363., -6161184., -1519962., -2703058. },  },
+	{ 0, { 589280., -62004., -1226982., 1326111., -536148., 568311. }, 0.0319163179770344 },
+	{ 0, { -132797., 113059., 332715., -538044., 144358., -232591. }, 0.0404897860926306 },
+	{ 0, { 19390., -8208., -31003., 153367., -13456., 65630. }, 0.0595473299932462 },
+	{ 0, { -2479., -51303., 154576., 368773., 65961., 157222. }, 0.0831987723231718 },
+	{ 1, { -170149., 190549., 249291., -236183., 108588., -106146. },  },
+	{ 0, { -14177274., -32784827., -28623327., 13932421., -12074567., 6670491. }, 0.1015656301267251 },
+	{ 1, { -3789129., 1413684., 2551178., 1957155., 1164465., 819456. },  },
+	{ 0, { 12762505., 226609., -4837955., 12330917., -2405339., 5249055. }, 0.1121334694975955 },
+	{ 1, { 547155., 1481967., -2013999., -2660987., -879208., -1179904. },  },
+	{ 0, { -62226., -41759., -601831., 240767., -255949., 106231. }, 0.1235484250413803 },
+	{ 0, { 38451., -38927., 103878., -40998., 43472., -16957. }, 0.1380033981088614 },
+	{ 0, { 6892., -67712., 62422., 39405., 26942., 18451. }, 0.1534434914458037 },
+	{ 0, { -75., 8062., -21151., -17198., -9222., -7580. }, 0.1694333239035300 },
+	{ 0, { 35355., 38181., 70566., -4376., 30386., -2939. }, 0.1895181584594278 },
+	{ 0, { -743715., -251198., -403257., 598432., -166123., 265466. }, 0.2002642151969322 },
+	{ 0, { 5834437., -10339387., 9606367., 9534188., 3806370., 4385708. }, 0.2140513638608579 },
+	{ 1, { 1033031., -590411., -1874404., 575478., -835406., 235620. },  },
+	{ 2, { 514744., -29792., -180518., -472533., -83894., -204253. },  },
+	{ 0, { 160903., -61277., -282564., -163689., -122933., -69902. }, 0.2282692683160305 },
+	{ 0, { -27903., 23114., 66255., 2167., 28792., 688. }, 0.2391180221674930 },
+	{ 0, { 4501., -5373., -15639., 12832., -6785., 5553. }, 0.2594200270243392 },
+	{ 0, { -7016., 15969., 7639., -40047., 3504., -17544. }, 0.2773387700991547 },
+	{ 0, { 12123., -71452., 49781., 137809., 20807., 61532. }, 0.2898870950096423 },
+	{ 0, { 9304., 220632., -262203., -258243., -112815., -119757. }, 0.2988785450891279 },
+	{ 0, { -326815., -368979., 836570., 374605., 369053., 187133. }, 0.3074463122377075 },
+	{ 0, { -285560., 1568528., -1374181., -462165., -548097., -222596. }, 0.3260929459480317 },
+	{ 1, { 61071., -241375., 291550., 243626., 110389., 123427. },  },
+	{ 2, { 227305., 162244., -116416., 352218., -65158., 140646. },  },
+	{ 0, { 132035., 23450., 116510., 219543., 39775., 92330. }, 0.3428930094327709 },
+	{ 0, { -45107., 4887., -87029., -68971., -33182., -29857. }, 0.3524288275557115 },
+	{ 0, { 11180., 1421., 46242., 3234., 18448., 1726. }, 0.3676619945918164 },
+	{ 0, { 55636., 74415., 46443., -53844., 16908., -25824. }, 0.3817149836030239 },
+	{ 0, { -38712., -7953., 29506., -14698., 13883., -4384. }, 0.4024967272931009 },
+	{ 0, { 737722., -3325874., -1725701., 1468892., -912453., 541637. }, 0.4182255664674069 },
+	{ 0, { 5843515., 17000877., -16425950., 5641739., -7208900., 1880856. }, 0.4281067291965077 },
+	{ 1, { -2114864., 879909., -1266263., -2982111., -450528., -1332322. },  },
+	{ 0, { -110808., 282843., -713054., 221824., -319044., 77631. }, 0.4373541005020147 },
+	{ 0, { 27829., -71864., 150036., -117804., 67370., -49093. }, 0.4560888031675395 },
+	{ 0, { 539822., 432225., -319385., 741980., -155058., 309230. }, 0.4797023746036813 },
+	{ 1, { 353284., -620503., 706907., 178082., 295983., 93413. },  },
+	{ 2, { -261070., -393195., 329623., -469610., 151911., -193312. },  },
+	{ 0, { -2161367., -547925., 176106., -2360409., 138737., -1001848. }, 0.5007107300722267 },
+	{ 0, { 27247697., -10878578., 11956310., 25892704., 4272604., 11389311. }, 0.5164419295757459 },
+	{ 0, { 42877248480., -29362030594., 27366424342., 39132999157., 10686125728., 17489248357. }, 0.5296606590588865 },
+	{ 1, { -15857296., -20344255., 19186229., -13052624., 8755482., -9908361. },  },
+	{ 2, { 6609281., 13149967., -10297853., 6131752., -4439009., 2280289. },  },
+	{ 0, { -18516226., 26000654., -21956172., -17721375., -8891106., -8274169. }, 0.5451799187785868 },
+	{ 0, { 924882., -10894893., 8857638., 2001907., 3741179., 1161552. }, 0.5595376466726170 },
+	{ 0, { 27311120., 29858821., -26928769., 14296744., -12217212., 5123580. }, 0.5795066100144535 },
+	{ 1, { 13030129., -18873913., 10742323., 12477743., 4123021., 5837654. },  },
+	{ 2, { -7424534., -11497916., 9860547., -3566473., 4394376., -1162013. },  },
+	{ 0, { -26277687., -24566747., 22551607., -14225886., 10328130., -5247184. }, 0.5911608643334181 },
+	{ 1, { 8339866., -11546546., 6481932., 8138775., 2473924., 3793057. },  },
+	{ 0, { -712821., 106326., 116149., -425425., 75173., -183273. }, 0.6154942605989902 },
+	{ 0, { 10367622., 10279698., -8594103., 9404066., -3937577., 3712537. }, 0.6326027345940838 },
+	{ 1, { 897045., 857895., -751707., 469816., -332572., 171768. },  },
+	{ 0, { 189069., -432469., 40216., 165708., -8464., 80857. }, 0.6444812066531010 },
+	{ 1, { 358961., 188063., -197366., 119155., -93776., 37030. },  },
+	{ 0, { 2801., -42321., 23044., 13212., 9231., 7153. }, 0.6631203366491857 },
+	{ 0, { 4336., 3618., -871., -1752., -434., -1180. }, 0.6824152589010221 },
+	{ 0, { -14481., -6624., 4573., -1496., 2554., -8. }, 0.7002707215510490 },
+	{ 0, { -223890., 106356., -2013., -41001., 13805., -21357. }, 0.7195602591163895 },
+	{ 1, { 28954., 129738., -23285., -9336., -9672., -11954. },  },
+	{ 0, { 500290., -303873., -27592., 125875., -40399., 71687. }, 0.7280600120460897 },
+	{ 0, { 729018., -876869., -461257., 537352., -184892., 325523. }, 0.7385877731868745 },
+	{ 1, { -549774., 403499., -445388., -787700., -178960., -329235. },  },
+	{ 0, { -154224., -136331., 129548., -90101., 64599., -32148. }, 0.7506622252123309 },
+	{ 0, { 36827., 21410., -22046., 16972., -12019., 7006. }, 0.7602186192346818 },
+	{ 0, { -9432., -929., 4761., -3712., 2630., -1835. }, 0.7714697369886172 },
+	{ 0, { 2272., -244., -1058., 1139., -553., 579. }, 0.7851226034217180 },
+	{ 0, { 236., 2440., 694., 90., 191., -135. }, 0.8150362349770407 },
+	{ 0, { 2171., -25731., -8199., 18101., -2071., 8952. }, 0.8291920856012017 },
+	{ 0, { -6488604., 1912961., -2051708., -5704251., -640826., -2468602. }, 0.8459901559232306 },
+	{ 1, { 133871., -10089., -90464., 3174., -43566., 7399. },  },
+	{ 2, { 3748., 19859., 25943., -57668., 8170., -24731. },  },
+	{ 0, { 41412., 22074., -6939., -4045., -5698., -1697. }, 0.8578592213260567 },
+	{ 0, { 574., 1501., -732., 4283., -255., 1685. }, 0.8738246080594192 },
+	{ 0, { 2322., -1798., 335., 937., 88., 501. }, 0.8963147077496537 },
+	{ 0, { -43604., -1899., 4040., -39896., 2661., -17151. }, 0.9105458422489332 },
+	{ 0, { 3596., -6271., 379., 5996., 286., 2760. }, 0.9259391061890530 },
+	{ 0, { -999582., 6287537., -5679601., -791405., -2413314., -507432. }, 0.9494173054851961 },
+	{ 1, { 111599., -339713., 235481., 52027., 98992., 33925. },  },
+	{ 2, { -33602., -140395., 93339., -35641., 41369., -10865. },  },
+	{ 0, { 149940., -187453., 95997., 203410., 38908., 91533. }, 0.9614421422806174 },
+	{ 0, { 46262., 123227., -97700., -14018., -43879., -8187. }, 0.9766842863215204 },
+	{ 0, { -150852., -63931., 82864., -16270., 39997., -7673. }, 0.9902969827486889 },
+	{ 0, { 580431., 130968., -306415., 215177., -145258., 96440. }, 1.0007147457558208 },
+	{ 0, { -315446., -113604., 191678., -91901., 90254., -41025. }, 1.0094608196461621 },
+	{ 1, { -3456., -446353., 229052., 185524., 103258., 88674. },  },
+	{ 0, { -189618., 113597., 8806., -140678., 6615., -64661. }, 1.0246980386783211 },
+	{ 0, { 4202483., 3000173., -2459447., 3363962., -1179328., 1385544. }, 1.0482030530764612 },
+	{ 1, { 1203874., -292900., 70065., 779465., 3811., 351179. },  },
+	{ 0, { 735702407., -1021641460., 944902088., 667150510., 387126729., 310854521. }, 1.0592824949737543 },
+	{ 1, { -225227., -2656169., 2070353., -678917., 860531., -321583. },  },
+	{ 0, { -906103., 1248865., -1249024., -614151., -510434., -296157. }, 1.0735437556293621 },
+	{ 0, { 133104., -244102., 224418., -12870., 91960., 2555. }, 1.0875704154537504 },
+	{ 0, { -98191., 334119., -93120., 114027., -39453., 36051. }, 1.1091289342301658 },
+	{ 1, { 131527., 1551., 58039., -54878., 19569., -21191. },  },
+	{ 2, { 65753., -188377., 68757., -76650., 28565., -25385. },  },
+	{ 0, { 61867., -343846., 16261., -113012., 8972., -35330. }, 1.1225031990563263 },
+	{ 0, { -7347., 137455., 17960., 22121., 5845., 4618. }, 1.1328877109810458 },
+	{ 0, { 11044., -88733., -25019., 37631., -8977., 18971. }, 1.1464066922869334 },
+	{ 0, { 11350781., -248125., 270190., 10489566., -145232., 4511204. }, 1.1622993228682923 },
+	{ 0, { -52127., 35850., -14691., -77957., -5084., -33671. }, 1.1728440239417584 },
+	{ 1, { -12008., 23292., -2942., -7282., -1291., -3563. },  },
+	{ 0, { 4294., 460., -3058., 3439., -1373., 1474. }, 1.1878668274609869 },
+	{ 0, { -1289., -734., 1786., -2248., 786., -941. }, 1.1998692758026896 },
+	{ 0, { 361., -793., 308., -1262., 122., -515. }, 1.2317935880659059 },
+	{ 0, { -195., 2534., -191., 3923., -67., 1609. }, 1.2448441509199817 },
+	{ 0, { -5385., -19904., 6349., -3489., 3158., -1221. }, 1.2560282933480911 },
+	{ 0, { 413790., -613072., 546872., 412919., 228594., 191066. }, 1.2653944427657104 },
+	{ 1, { -20115., 4841., -30066., -2156., -12194., -733. },  },
+	{ 0, { -56810., -2443., 14410., -37878., 7539., -15830. }, 1.2776927606634534 },
+	{ 1, { -883., -20034., 8211., 10587., 3489., 5153. },  },
+	{ 0, { -2444., 1465., 414., 793., 279., 259. }, 1.2924980461987274 },
+	{ 0, { 864., -632., -623., -218., -312., -55. }, 1.3014788911147197 },
+	{ 0, { 26233., -115536., 1588., -54448., 260., -17749. }, 1.3673745438817879 },
+	{ 0, { -366768., 241272., -241508., -348534., -93295., -154126. }, 1.3764442873088090 },
+	{ 1, { -4898., -22923., 39935., -25211., 16711., -10168. },  },
+	{ 0, { 7481., -4670., -7877., -4002., -3598., -1348. }, 1.3867469996002664 },
+	{ 0, { -2408., 1756., 2965., 1290., 1336., 416. }, 1.3958662188525488 },
+	{ 0, { 972., -751., -912., -28., -417., 39. }, 1.4068178503492994 },
+	{ 0, { -20343., 4804., -6579., -18594., -2298., -8037. }, 1.4396065958679622 },
+	{ 0, { 894., 1313., 1992., 632., 793., 162. }, 1.4496940872610145 },
+	{ 0, { -1983., -4631., -7582., 723., -2974., 660. }, 1.4625845924962999 },
+	{ 0, { 648492., 510288., -503142., 612739., -227097., 254982. }, 1.4790870471301645 },
+	{ 1, { -7847., 5399., -12816., -32834., -5768., -13533. },  },
+	{ 2, { -5935., 4107., 3696., -8454., 1585., -3763. },  },
+	{ 0, { 471., -326., 1178., -492., 455., -210. }, 1.5004111597792062 },
+	{ 0, { -1102., 5980., -5712., -389., -2409., -319. }, 1.5140608680143952 },
+	{ 0, { 235., -531., 427., -154., 168., -42. }, 1.5277453924778683 },
+	{ 0, { 1530., 1846., -2090., 2162., -918., 867. }, 1.5510420454912401 },
+	{ 0, { -8695., -5270., 3702., -11973., 1786., -4877. }, 1.5653775377343770 },
+	{ 0, { 108442., 13977., -7635., 130460., -5580., 54970. }, 1.5750243622459430 },
+	{ 0, { 12988439., -44123991., 40567288., 11522384., 17076170., 6015693. }, 1.5888946239094504 },
+	{ 1, { -297436., -96470., 75756., -224551., 37973., -97866. },  },
+	{ 2, { -140095., 49206., -15492., -114871., -4072., -51280. },  },
+	{ 0, { -213784., 360331., -204961., -174648., -85958., -85816. }, 1.5999174688094493 },
+	{ 0, { 34848., -82622., 33382., 30061., 14595., 15488. }, 1.6100691344943834 },
+	{ 1, { 43010., 10308., -12996., 14235., -6844., 6576. },  },
+	{ 0, { -1221., -3776., 845., 910., 489., 461. }, 1.6263710325060152 },
+	{ 0, { 554., 745., -310., -340., -171., -141. }, 1.6392210890659527 },
+	{ 0, { 20026., -16502., -3852., -9369., -2306., -3026. }, 1.6820002884969334 },
+	{ 0, { 813659., -336143., 300160., 724773., 109085., 319540. }, 1.6916922798012188 },
+	{ 1, { 1602., -17457., 27667., -10914., 11558., -4357. },  },
+	{ 0, { -5880., 742., -5245., -7508., -2092., -3141. }, 1.7051957386154943 },
+	{ 0, { 1260., 203., 1855., 1795., 753., 722. }, 1.7137017697983383 },
+	{ 0, { -181., 118., 893., -230., 356., -133. }, 1.7715707154892435 },
+	{ 0, { 715., -2305., -3568., 635., -1416., 471. }, 1.7804397794409668 },
+	{ 0, { 100206., -23631., 4854., 93727., 818., 43069. }, 1.7946296659726320 },
+	{ 1, { 4224., -2685., 2729., -6839., 1031., -2737. },  },
+	{ 2, { 84., 2460., 356., -441., 163., -287. },  },
+	{ 0, { -3928., 2396., -1944., -4367., -655., -1968. }, 1.8082885005321963 },
+	{ 1, { -1281., -1070., 1425., -1360., 663., -508. },  },
+	{ 0, { -434., -572., -639., 581., -222., 273. }, 1.8824124715680111 },
+	{ 0, { 5875., -12921., -96., 9965., 681., 4780. }, 1.8981641851181350 },
+	{ 1, { 3309., -927., -4565., 1029., -1995., 584. },  },
+	{ 0, { -14234., 16692., -15551., -9091., -6255., -4365. }, 1.9094415371356366 },
+	{ 1, { -5299., -4657., 1995., -4393., 1032., -1732. },  },
+	{ 0, { -215., 526., -123., -7., -42., -32. }, 1.9243893317056575 },
+	{ 0, { -1607., 1027., -1015., -1384., -397., -623. }, 1.9690057130935361 },
+	{ 0, { 907., -182., 55., -552., -12., -217. }, 1.9888685259410335 },
+	{ 0, { 80093., 1775., -15336., 49616., -8505., 21779. }, 2.0075896690458515 },
+	{ 1, { 3675., 886., 9437., 1003., 3841., 302. },  },
+	{ 2, { -2718., 2441., 1312., 2111., 647., 750. },  },
+	{ 0, { -749., 2213., 3067., 2387., 1321., 864. }, 2.0177406604319246 },
+	{ 0, { 82., 445., -97., 12., -47., -15. }, 2.0452450030168667 },
+	{ 0, { 939., 145., -364., 1452., -175., 622. }, 2.0918668035808388 },
+	{ 0, { 29763., -11270., 1340., 26747., 35., 12241. }, 2.1052596067061962 },
+	{ 1, { -752., -10176., 11464., -2886., 4981., -1015. },  },
+	{ 0, { -122433., -1948247., 1789021., -131787., 769924., -8458. }, 2.1185267640432053 },
+	{ 1, { -14746., -2745., 3642., -14273., 1472., -6101. },  },
+	{ 2, { -1381., -4337., 4157., -766., 1816., -296. },  },
+	{ 0, { 207., 2382., -2373., 455., -1016., 119. }, 2.1318821280894955 },
+	{ 0, { 317., -2045., -1566., 2287., -544., 1086. }, 2.2071860619320218 },
+	{ 0, { 45591., -42445., 35109., 42326., 14234., 19311. }, 2.2209783021218397 },
+	{ 1, { 100., -868., 334., -2387., 63., -853. },  },
+	{ 2, { -274., 556., 48., -449., -11., -223. },  },
+	{ 0, { 347., -11., -113., -232., -65., -97. }, 2.3082627901909945 },
+	{ 0, { 16054., -5418., 3307., 5345., 1043., 2606. }, 2.3219886353180517 },
+	{ 1, { -19., -205., 4127., -783., 1741., -387. },  },
+	{ 2, { -647., 309., -95., 84., -24., 13. },  },
+	{ 0, { 2409., -2117., -2607., -228., -1170., 136. }, 2.4200734218253461 },
+	{ 1, { 19., -536., 414., 216., 214., 119. },  },
+	{ 0, { 2201., 3681., -3051., 2808., -1347., 1419. }, 2.4294275957278497 },
+	{ 0, { -423., 745., -737., -631., -315., -318. }, 2.4385609820738123 },
+	{ 0, { 300., -1484., -1399., 755., -530., 425. }, 2.5260130486716892 },
+	{ 0, { 5490., -1919., 480., 4689., 156., 2132. }, 2.5361042359568997 },
+	{ 1, { 215., -174., 275., -263., 81., -64. },  },
+	{ 0, { 308., -156., 185., 292., 82., 121. }, 2.5459330159552604 },
+	{ 0, { 5463., 46., 202., 1602., -48., 766. }, 2.6374295145352566 },
+	{ 1, { 581., 381., 1106., 451., 460., 165. },  },
+	{ 0, { -36662., -85712., 78236., -34663., 34443., -12759. }, 2.6481663000165407 },
+	{ 0, { 1477., -1072., -1320., -336., -622., -3. }, 2.7397040327703399 },
+	{ 0, { 1659., -2071., 2391., 2294., 963., 1120. }, 2.7490048220101793 },
+	{ 1, { -1336., -455., -28., -609., -7., -260. },  },
+	{ 0, { 1366., -1582., -496., 1101., -173., 602. }, 2.8494750099923127 },
+	{ 1, { 141., -92., 188., -517., 50., -205. },  },
+	{ 2, { -23., 180., 65., -168., 19., -81. },  },
+	{ 0, { 1495., 362., 78., -117., -5., -23. }, 2.9530548702113095 },
+	{ 1, { 107., 70., 510., 245., 223., 92. },  },
+	{ 0, { 497., -250., -298., -554., -148., -215. }, 3.0510128159210788 },
+	{ 0, { 602., -271., -371., 232., -153., 154. }, 3.1654820818460752 },
+	{ 0, { -3037., -3424., 3284., -2814., 1483., -1134. }, 3.1775127563235914 },
+	{ 0, { 483., 216., 36., -224., 1., -77. }, 3.2694305438716178 },
+	{ 0, { 4935., 381., -381., 4408., -298., 2013. }, 3.3406022698986924 },
+	{ 0, { 235., -159., -104., -386., -58., -142. }, 3.3695779911862527 },
+	{ 0, { 339., -47., -126., -82., -67., -13. }, 3.4790904552288531 },
+	{ 0, { -5663., -29987., 27509., -5003., 11933., -2162. }, 6.2830762443769794 },
+	{ 0, { -59., -82., -23., 24., -12., 18. }, 8.4686530580615642 },
+	{ 0, { -17635., 511., -921., -16011., 697., -7231. }, 10.2131290491330340 },
+	{ 0, { -227., 115., -23., -264., 11., -116. }, 10.2220725794374050 },
+	{ /* end jupiter */ -1,  },
+};
+
+chap95_rec chap95_saturn[] = {
+	{ 0, { 359537177., 0., -7206382337., 0., -2991243838., 0. }, 0. },
+	{ 1, { -20377631., 0., 15883341., 0., 8071624., 0. },  },
+	{ 0, { -64236683., -52860196., 142442224., -49744952., 58042432., -24365782. }, 0.0168745727060282 },
+	{ 0, { 30177751., 18129933., -67656128., 22849231., -27163043., 12315751. }, 0.0265670063186787 },
+	{ 1, { -8215259., 21212644., -23554648., -50768821., -12209063., -18901172. },  },
+	{ 0, { 1964057., 724735., -4686899., 1417179., -1646759., 941321. }, 0.0493811968866401 },
+	{ 1, { -134000., 3348965., -10011640., -8728398., -4234207., -2535628. },  },
+	{ 0, { 5686743., 3475773., -334368., 3091703., 72747., 926256. }, 0.0662237107929899 },
+	{ 0, { 554020., 1079938., -2966895., -1601162., -1509110., -278930. }, 0.0843726142307477 },
+	{ 0, { 4610964., 21987586., 31945199., -5263812., 13882828., -4598499. }, 0.1010129457774524 },
+	{ 0, { -66034588., -94070401., 111667599., -68387008., 47456033., -25071683. }, 0.1128014605528121 },
+	{ 1, { -4294328., -12886739., 37728596., -1754644., 11349347., 1748900. },  },
+	{ 0, { 6081642., 23561987., -38577166., -9734586., -12217167., -502775. }, 0.1245386660916166 },
+	{ 0, { -11635904., -19574871., 36907731., -11918213., 11119486., -6364841. }, 0.1376921108585382 },
+	{ 0, { 104499813., 75674727., -132241710., 152846005., -35848667., 59734045. }, 0.1532223867622918 },
+	{ 0, { -119336309., -65929841., 110429555., -174948245., 28176754., -66225503. }, 0.1635156403544941 },
+	{ 1, { 52564319., -48818442., 77555859., 94135021., 31177405., 26437148. },  },
+	{ 2, { 56660530., 23619473., -35687037., 84928050., -8020678., 31023884. },  },
+	{ 0, { 59047999., -9112158., 18208825., 74844916., 8173908., 26476289. }, 0.1849404508049137 },
+	{ 0, { -195085048., 130948239., -157301623., -207103141., -57416134., -80784650. }, 0.1994326216901347 },
+	{ 0, { 61319082350., -72972816459., 68513342186., 55646924765., 25657191842., 26113032275. }, 0.2133734516582497 },
+	{ 1, { 58897194., 107088220., -104901917., 68459614., -34345682., 47420026. },  },
+	{ 2, { -100212137., 21822222., -43604349., -89401596., -12674282., -32150723. },  },
+	{ 0, { 18845535., -49223999., 35615797., 26623302., 16402647., 15391365. }, 0.2335002178020494 },
+	{ 0, { -4180907., 4465884., 38621., -479609., 814285., -1219056. }, 0.2510310507212479 },
+	{ 1, { -18966213., 1413107., 11641634., -15116208., 6182492., -9256829. },  },
+	{ 0, { 3257184., 9509868., -11066286., -7321147., -6968557., -3079573. }, 0.2622227446243415 },
+	{ 0, { -1404116., -417364., 2858988., 1478988., 1856930., 162727. }, 0.2775489797512927 },
+	{ 0, { 1467706., 1107543., -4409004., 226468., -2199319., 678454. }, 0.2926511843672006 },
+	{ 0, { -63623237., -37507272., 39122548., -67696931., 18154709., -27796755. }, 0.3162439145857524 },
+	{ 1, { -3829645., 1269380., -9251051., -8961610., -4871745., -2487901. },  },
+	{ 2, { 1909651., 1468024., -7914338., 6203925., -2960534., 3971621. },  },
+	{ 0, { 6281876., -3642612., -4761114., 23447042., 286480., 12241212. }, 0.3340526064764550 },
+	{ 0, { -5802348., 5752123., -4991225., -30347977., -5911367., -14358380. }, 0.3467225133858732 },
+	{ 0, { 7539581., -27234846., 89254406., 72087653., 50683522., 25464083. }, 0.3654342931118227 },
+	{ 1, { -16970597., 906805., 25342361., -65544284., 5459306., -34110644. },  },
+	{ 2, { -5198192., 11224087., -33200716., -38195205., -20121188., -14873633. },  },
+	{ 0, { -2145161., 31156404., -111624554., -59422928., -60033284., -17237400. }, 0.3766625707476834 },
+	{ 0, { -2433702., -8759560., 35127703., 5461246., 17518688., -795950. }, 0.3868793178145906 },
+	{ 0, { 3948221., 3250926., -14710717., 6016597., -6668684., 4126312. }, 0.4021189702952532 },
+	{ 0, { -64852219., -1152783., 37078116., -78426047., 17075754., -36402504. }, 0.4173317886569649 },
+	{ 0, { 2598837096., -322512661., 333925850., 2403155625., 25718615., 1008149551. }, 0.4268085445169599 },
+	{ 1, { -8046615., 50513333., -65775281., -14855286., -30373245., -5862741. },  },
+	{ 0, { 14632122., -1627420., 391595., 27967394., 1503248., 13109492. }, 0.4393540871607130 },
+	{ 0, { -3977607., 2348335., -4492336., -11638695., -3044963., -5280793. }, 0.4516261147924168 },
+	{ 0, { 3891847., -6235742., 13257786., 12849113., 7381680., 5287411. }, 0.4647357720725654 },
+	{ 0, { -2681944., 5714068., -11275550., -8345687., -6000449., -3297402. }, 0.4765294470438712 },
+	{ 1, { -3310032., -1656488., 6283436., -7934719., 2454880., -4374462. },  },
+	{ 2, { 581001., -2310426., 4449727., 1912796., 2258154., 644572. },  },
+	{ 0, { -543181., 190668., 100357., -477814., 102237., -296580. }, 0.4992649823773071 },
+	{ 0, { 734019., 40318., 205332., 241668., 50065., 172083. }, 0.5130863461740709 },
+	{ 0, { 34991657., -27811324., 27384011., 28671165., 10659597., 13066000. }, 0.5295353231453532 },
+	{ 1, { -995667., 165111., 1788489., 16637., 818086., -43110. },  },
+	{ 2, { -317358., -198759., -6708., 263693., 27631., 133736. },  },
+	{ 0, { -31862., -65198., 73955., 29129., 36339., 15797. }, 0.5497097571860546 },
+	{ 0, { -4929., 225052., -215444., -8168., -89868., -12808. }, 0.5633695884286543 },
+	{ 0, { 24691., 22218., -9270., 18179., -4474., 5589. }, 0.5991350601911121 },
+	{ 0, { 289471., 202198., -100019., 60710., -58404., 1113. }, 0.6158926177569189 },
+	{ 1, { 99636., -158087., 49023., 12201., 5200., 13036. },  },
+	{ 0, { -1368816., -1646305., 699872., -1449808., 365729., -462486. }, 0.6277831102482128 },
+	{ 0, { 86066856., 61934875., -56200895., 80007767., -26961118., 30372088. }, 0.6401904307430363 },
+	{ 1, { -1903624., 1069032., -956603., -1766047., -334714., -771306. },  },
+	{ 2, { 388212., 231504., -217129., 594559., -86428., 243060. },  },
+	{ 0, { 806222., 541401., -454902., 1046875., -196326., 413041. }, 0.6510631728715514 },
+	{ 0, { -45865., -22253., 10036., -80738., 2915., -31853. }, 0.6610474418282967 },
+	{ 0, { 7873., 2358., 3189., 5877., 1281., 2008. }, 0.6837277548947647 },
+	{ 0, { -98664., 39992., -40413., -90837., -12525., -38879. }, 0.7043645359718698 },
+	{ 0, { -1946., 3664., 10236., -357., 4293., -1167. }, 0.7177278015736290 },
+	{ 0, { -284513., 3015890., 2554237., 521699., 1046024., 49179. }, 0.7348232721925007 },
+	{ 1, { 192624., 52403., 33461., -150025., -105., -61152. },  },
+	{ 0, { -574265., -320413., 457058., -572461., 214214., -240685. }, 0.7435248864377025 },
+	{ 1, { 1145., -36334., 41717., 108651., 15647., 49114. },  },
+	{ 0, { 4558., -12170., 12006., 2809., 4790., 1802. }, 0.7636282240814432 },
+	{ 0, { -13700., 9256., -10447., -12051., -3998., -5133. }, 0.7781708314331308 },
+	{ 0, { 2247., -693., 1592., 1083., 680., 202. }, 0.7950594399751412 },
+	{ 0, { -1275., 5493., -6655., 924., -2492., 1116. }, 0.8129117802019118 },
+	{ 0, { -1223., -19571., 23014., -16306., 6735., -10155. }, 0.8251778324059539 },
+	{ 0, { 303076., 327040., 524629., -601728., 145475., -284414. }, 0.8382097667143232 },
+	{ 1, { -68015., 68576., -104282., -95123., -56039., -18028. },  },
+	{ 0, { 804121., 5204866., -4807644., 856208., -2083791., 112505. }, 0.8530682323228537 },
+	{ 1, { 29622., -215766., 182882., 33800., 76379., -13007. },  },
+	{ 0, { -13943., 51584., -40954., -8800., -23024., -3606. }, 0.8654403493251860 },
+	{ 0, { 3328., -7556., 4381., 1661., 2910., -36. }, 0.8766682028622256 },
+	{ 0, { -1505., 1631., -856., 784., -507., 674. }, 0.8895787094971168 },
+	{ 0, { -7919., -1616., 1989., -5290., 1264., -2147. }, 0.9133756947048002 },
+	{ 0, { -719., -2923., 1034., -5631., 504., -2040. }, 0.9236279354499169 },
+	{ 0, { 235224., 39046., -67004., -248093., -51203., -88317. }, 0.9453092341234691 },
+	{ 1, { 23462., -3456., -13540., 1977., -2121., 4776. },  },
+	{ 2, { -14574., -833., 1399., 12342., 2166., 4371. },  },
+	{ 0, { -26186., -43172., 35585., -24094., 17801., -8640. }, 0.9587102428763801 },
+	{ 0, { 5306., 3426., -2598., 4654., -1521., 1836. }, 0.9687040706037242 },
+	{ 0, { -1404., -1568., 973., -1250., 478., -476. }, 0.9844044794489883 },
+	{ 0, { 710., 549., -640., -936., -297., -397. }, 1.0125530865194814 },
+	{ 0, { -4798., 528., 2241., 2772., 1073., 1027. }, 1.0243303434648821 },
+	{ 0, { 19204., -11735., -10052., -9127., -4600., -2887. }, 1.0350677988213037 },
+	{ 0, { -70967., 104737., 71732., 36807., 31189., 9485. }, 1.0444890430562743 },
+	{ 0, { -225798., 798684., 944928., 428637., 404105., 131989. }, 1.0535670598935039 },
+	{ 0, { 421437., -821624., 460671., 296203., 193979., 145015. }, 1.0624723083698995 },
+	{ 1, { 404141., 190563., -153412., 239290., -77801., 95534. },  },
+	{ 0, { -6822., -2424., -12141., -503., -4568., -254. }, 1.0799687683920178 },
+	{ 0, { 5231., 2124., 4765., -2411., 1681., -1002. }, 1.0944898935961935 },
+	{ 0, { -4360., -571., -2843., 2544., -920., 1015. }, 1.1034700208578079 },
+	{ 0, { 2352., -783., 1220., -2044., 355., -732. }, 1.1190075299813413 },
+	{ 0, { -5735., 3169., 186., 5121., 420., 1436. }, 1.1356439922218147 },
+	{ 0, { 26551., -30281., 5089., -56530., 4098., -12591. }, 1.1476494842799982 },
+	{ 0, { 182096., 230606., 190305., 20362., 32484., -34547. }, 1.1561539197957733 },
+	{ 1, { -46354., -35766., 25278., 21603., 6113., 24924. },  },
+	{ 2, { -6693., -10691., -762., -24972., 5267., -3607. },  },
+	{ 0, { 7509., -14080., 2266., 4828., -2812., 2396. }, 1.1724975800169239 },
+	{ 0, { -1097., 4594., -221., -711., 861., -846. }, 1.1827508062529084 },
+	{ 0, { 268., -1663., 197., 151., -139., 350. }, 1.1922546935063294 },
+	{ 0, { 3821., -6929., -9691., -9738., -1997., -3976. }, 1.2526642649376578 },
+	{ 1, { -3679., 2852., -872., 4458., -151., 647. },  },
+	{ 0, { 103288., 30887., 44394., -80994., 5313., -31354. }, 1.2615381418438327 },
+	{ 0, { 11722., -929., 20555., -32545., 6476., -10964. }, 1.2737411543354145 },
+	{ 0, { -17778., 2234., -8752., -2076., -2194., -1934. }, 1.2848042137871682 },
+	{ 1, { -807., -10464., -4345., -4583., -776., -1210. },  },
+	{ 0, { -2021., 243., -476., 1775., -175., 485. }, 1.2966706439177036 },
+	{ 0, { -414., 1251., 1334., 193., 402., 122. }, 1.3428511130177547 },
+	{ 0, { -6545., 29273., 20095., -2836., 7521., 1278. }, 1.3563973340863262 },
+	{ 1, { 13556., 3272., -1197., -10568., 545., -3663. },  },
+	{ 0, { -180708., 208447., 210704., 176234., 95276., 55650. }, 1.3681253803708262 },
+	{ 1, { 18503., 8458., -1041., -19835., 212., -7272. },  },
+	{ 2, { -2022., 9714., 3806., 25., 1699., 1106. },  },
+	{ 0, { 967., -692., -12., -1766., -76., -677. }, 1.3856345885533017 },
+	{ 0, { 704., -587., -2388., 1139., -927., 144. }, 1.4516885121122214 },
+	{ 0, { -2400., 3304., 8864., -6463., 3877., -1185. }, 1.4602508651959594 },
+	{ 0, { 69982., 97834., 73391., 17685., 16742., -10304. }, 1.4727239692395073 },
+	{ 1, { -11044., -13056., 19308., 14020., 3724., 10827. },  },
+	{ 2, { -6082., -426., 3637., -7457., 3010., -854. },  },
+	{ 0, { 2590., -1868., 1096., 1043., -731., -69. }, 1.4872423683478513 },
+	{ 0, { -938., 62., 121., -521., 280., -164. }, 1.4985129994148070 },
+	{ 0, { 1803., 2377., 1110., -3335., 260., -1477. }, 1.5652937634682971 },
+	{ 0, { 64498., -5114., 68142., -30202., 22032., -11748. }, 1.5815555196973523 },
+	{ 1, { -22825., 4620., 14325., -12393., 6615., -5873. },  },
+	{ 2, { -7166., 4559., -5012., 2048., -1874., 652. },  },
+	{ 0, { -2200., -10219., 11039., 3346., 4934., 1509. }, 1.5955514308541998 },
+	{ 0, { 1099., 1374., -2363., -260., -1043., -86. }, 1.6049203503395801 },
+	{ 0, { -1208., -104., 561., 969., 230., 560. }, 1.6737223157218182 },
+	{ 0, { -86480., 70728., 67924., 86008., 31534., 31153. }, 1.6843589552967209 },
+	{ 1, { 933., 1492., 4350., -2566., 1516., -847. },  },
+	{ 2, { -1244., -445., -70., 369., 72., 345. },  },
+	{ 0, { 1465., -2624., 397., -65., -76., -7. }, 1.6977622139834585 },
+	{ 0, { 14992., 53026., 36206., 5674., 12375., -4229. }, 1.7889276713056903 },
+	{ 1, { -1089., -6208., 2064., 7721., -744., 4049. },  },
+	{ 2, { -1281., -2343., -210., 276., 49., 532. },  },
+	{ 0, { 3295., -4264., -3112., 6622., -2534., 1159. }, 1.8013654629975304 },
+	{ 1, { 1876., 442., -2702., -870., -615., -793. },  },
+	{ 0, { 21586., 22255., 25169., -13704., 7397., -6814. }, 1.8952695349759525 },
+	{ 1, { 1293., 636., 1855., -2161., 651., -493. },  },
+	{ 2, { -1508., -959., -1185., 1162., -341., 540. },  },
+	{ 0, { -837., -468., -77., 639., 49., 332. }, 1.9082748451618770 },
+	{ 0, { -39181., 17943., 18554., 39996., 9033., 15315. }, 2.0006786235742782 },
+	{ 1, { 70., 479., 1963., -746., 664., -147. },  },
+	{ 2, { -729., 4., -323., -76., -29., 30. },  },
+	{ 0, { -726., 389., 1661., 467., 647., 367. }, 2.0949703642270960 },
+	{ 0, { -2813., 21512., 16741., 5023., 6930., 302. }, 2.1045989992211052 },
+	{ 0, { 6314., -196., -4305., 3407., -2614., -923. }, 2.1133294411524268 },
+	{ 0, { -1183., -1102., 1934., -946., 1020., -24. }, 2.1218152921149840 },
+	{ 0, { 7013., 13819., 14243., -3085., 4615., -2198. }, 2.2116085451863530 },
+	{ 1, { 548., 591., 1334., -724., 439., -127. },  },
+	{ 2, { -499., -647., -721., 383., -233., 184. },  },
+	{ 0, { -96., -348., -69., 163., -3., 83. }, 2.2246966026380783 },
+	{ 0, { -16878., 3417., 3609., 17709., 2011., 6948. }, 2.3169860146393306 },
+	{ 1, { -184., 273., 1066., -86., 376., 65. },  },
+	{ 2, { -421., -143., -106., -9., 9., 50. },  },
+	{ 0, { -1773., 10467., 5877., 4502., 2612., 236. }, 2.4212184393363345 },
+	{ 1, { 100., -1698., -212., 1585., -581., 698. },  },
+	{ 2, { -416., -532., 192., 38., 49., 218. },  },
+	{ 0, { 922., 6585., 6161., 638., 2178., -274. }, 2.5279051498015881 },
+	{ 1, { 305., 668., 969., -324., 338., -92. },  },
+	{ 0, { -7788., -691., -557., 7570., 62., 3142. }, 2.6333307376329276 },
+	{ 1, { -16., 174., 511., 158., 148., 85. },  },
+	{ 0, { -2797., 3622., 2705., 2693., 1341., 812. }, 2.7374368855151237 },
+	{ 0, { 1332., 523., -1008., -331., -394., -592. }, 2.7462646949156313 },
+	{ 0, { -528., 3192., 2851., 1151., 1069., 178. }, 2.8441606111313287 },
+	{ 1, { 54., 266., 527., 58., 138., 54. },  },
+	{ 0, { -3128., -1136., -1090., 3069., -358., 1285. }, 2.9496547906250985 },
+	{ 0, { -1332., 1366., 789., 1313., 449., 356. }, 3.0553439327040071 },
+	{ 1, { 46., -504., -405., 221., -232., 58. },  },
+	{ 0, { -722., 1469., 1417., 916., 574., 235. }, 3.1603882818225530 },
+	{ 1, { -8., 210., 314., 24., 105., 6. },  },
+	{ 0, { -1228., -704., -610., 1193., -210., 520. }, 3.2660150757959667 },
+	{ 0, { 4966., 349., -230., 4527., -271., 2058. }, 3.3406700896158381 },
+	{ 0, { -1003., 494., 345., 782., 229., 294. }, 3.3700954272546491 },
+	{ 0, { -642., 504., 417., 592., 188., 175. }, 3.4766263286125869 },
+	{ 0, { -5495., -30050., 27370., -5109., 11883., -2182. }, 6.2830758491321381 },
+	{ 1, { 12., 3., -21., -32., -16., -11. },  },
+	{ 0, { -127., 83., -47., -145., -13., -74. }, 8.4563910900857575 },
+	{ 0, { -17655., 888., -832., -16055., 726., -7281. }, 10.2133651230379790 },
+	{ 1, { -15., -178., 73., 27., 40., 18. },  },
+	{ 0, { 10., 56., 204., -33., 91., -14. }, 10.2233419556680150 },
+	{ /* end saturn */ -1,  },
+};
+
+chap95_rec chap95_uranus[] = {
+	{ 0, { 13442911073., 0., -1930919457., 0., -1035250405., 0. }, 0. },
+	{ 1, { 54660667., 0., 47196247., 0., 21339801., 0. },  },
+	{ 0, { -6259970., -59715827., 56026092., -14879299., 23598892., -7731463. }, 0.0168745727060282 },
+	{ 0, { 5314993., 24095734., -17644181., 11961180., -6018215., 6587969. }, 0.0271621114651946 },
+	{ 0, { 816977., 27548111., -6448076., -468658., -4057252., -1448251. }, 0.0379771556339559 },
+	{ 0, { -1624242., 11338144., -20621799., 1496992., -5688694., 248222. }, 0.0558181533535525 },
+	{ 0, { 131350139561., 139711771423., -127221614269., 120945393838., -57589414088., 51010747052. }, 0.0747869939016385 },
+	{ 1, { 83579181., -50475439., 18032923., 50477352., 27217847., 30911037. },  },
+	{ 2, { 56177356., -62348507., 45006161., 56816875., 23394627., 20236290. },  },
+	{ 0, { -3192217., -67613872., 26532975., 31518890., 20804461., -5888651. }, 0.0851607526391989 },
+	{ 0, { 41246376., 168261887., -122401100., -97532527., -40313762., 5947933. }, 0.1076082382556661 },
+	{ 0, { -36235133., -140754409., 98201785., 64357246., 36255198., -9379330. }, 0.1131136321134916 },
+	{ 1, { 90255544., -46394994., -47508423., 75649120., 8064423., 19668708. },  },
+	{ 0, { -32042356., -21687295., 28029568., 15213468., 1662570., -3156568. }, 0.1256919464048962 },
+	{ 0, { 44969984., -2310664., -13084603., 20841905., 1428192., 12115421. }, 0.1384460864609660 },
+	{ 0, { -524718966., -4511367463., 4156633821., -484927968., 1817662129., -148236372. }, 0.1495664992280332 },
+	{ 0, { 61267776., 1565740., -24266489., 45519765., -3901964., 18298390. }, 0.1552897599647365 },
+	{ 0, { -7222268., 4911333., 3283374., -6377102., -254066., -1537379. }, 0.1694039594031046 },
+	{ 0, { 5873930., -4900474., -1827803., 7852582., -31798., 1819946. }, 0.1845250832150644 },
+	{ 0, { 1077339., 18380396., -901066., -10767827., -265560., 162663. }, 0.2002468734837309 },
+	{ 0, { -154311950., -219502970., 131091842., 178959446., 20655458., 5719299. }, 0.2141097583453364 },
+	{ 0, { -5528333., 212500368., -111109179., -139612191., -43337512., -21342579. }, 0.2193685795401007 },
+	{ 1, { -104517351., 177302072., 101064024., -75975513., -8816707., 3791842. },  },
+	{ 0, { 173653756., 151082404., -200861767., -135511564., -29950212., -17024507. }, 0.2293024101260499 },
+	{ 0, { -125918181., -44661266., 113832135., 56003631., 10092584., 6332126. }, 0.2359817391381943 },
+	{ 0, { 47624832., 2554277., -41914694., -13040594., -2759654., -2423818. }, 0.2431604796510437 },
+	{ 0, { -8805576., 2810717., 8600588., 666061., 636138., 663527. }, 0.2535948403663328 },
+	{ 0, { 1249271., -2422256., -2280787., 1243851., -81187., -241977. }, 0.2733943804314553 },
+	{ 0, { 90677., 14160054., 8529623., -8138579., 1686982., 1494393. }, 0.2885148535115661 },
+	{ 0, { 1004449., -20392040., -8104371., 18545176., -2778508., 705194. }, 0.2992461358046305 },
+	{ 1, { 5543727., 3362260., -1567031., -3163455., 585366., 471498. },  },
+	{ 2, { 2655788., 6883407., 3736665., -5070470., 1464904., 724248. },  },
+	{ 0, { 6192631., 6484479., 3731891., -6957619., 2642135., 445342. }, 0.3105692746147310 },
+	{ 0, { -1442546., -845134., -640944., 1375084., -614517., 35173. }, 0.3190867931520337 },
+	{ 0, { 683659., 282897., 363207., -694577., 243073., -261582. }, 0.3384589317094125 },
+	{ 0, { 210243., 95767., -88268., -40253., -126237., -71385. }, 0.3483018025771290 },
+	{ 0, { -122260., -61161., 139582., -75155., 89557., -59104. }, 0.3543646679104152 },
+	{ 0, { -341621., -166635., -6649., -236115., -4011., -98828. }, 0.3749354720310226 },
+	{ 0, { -34509., -47428., -33958., 69865., -15389., 28074. }, 0.3881544744399507 },
+	{ 0, { 127606., 82441., 63875., -131276., 30216., -55026. }, 0.4044642096018178 },
+	{ 0, { -55719., 35282., 53204., 42166., 20409., 8040. }, 0.4146735688956036 },
+	{ 0, { 745574., -86708., 85642., 660718., 2349., 278769. }, 0.4267276978319757 },
+	{ 0, { 46965., -63806., -140582., -2689., -51451., -6263. }, 0.4523712047583937 },
+	{ 1, { -44676., -29125., -21496., 62165., -11514., 20667. },  },
+	{ 0, { -47313., 131228., 153909., 13721., 54937., 13501. }, 0.4584750578982092 },
+	{ 0, { 64299., -217224., -204896., -47815., -89991., -26071. }, 0.4786471499447322 },
+	{ 0, { -216., 53443., -19130., -71538., -27839., -11228. }, 0.4920510287505367 },
+	{ 0, { -151224., -75735., -3305., 268854., -6542., 67361. }, 0.5051499531573665 },
+	{ 0, { 928196., 102377., -314167., -1414544., -33869., -402228. }, 0.5147029966036326 },
+	{ 0, { -1724399., 110969., 999802., 2605327., 184425., 789530. }, 0.5199630930448305 },
+	{ 0, { 40911206., -27399316., 26874089., 37399873., 10439229., 16767175. }, 0.5296669053399393 },
+	{ 1, { 583136., 1214598., 1755827., -1272416., 584159., -311166. },  },
+	{ 0, { 1173041., -1074191., -1886355., -1719260., -508991., -616258. }, 0.5369668320738028 },
+	{ 0, { -202800., 314145., 489969., 260218., 136957., 100165. }, 0.5445620632918582 },
+	{ 0, { 30834., -64556., -105954., -37083., -35677., -17746. }, 0.5559973222735549 },
+	{ 0, { 388., 18963., 34845., -2990., 13141., -175. }, 0.5645354635177183 },
+	{ 0, { -3029., -2222., -3901., 4299., -1477., 1512. }, 0.5864917785646289 },
+	{ 0, { 364., -3970., 4198., -17799., 1736., -7653. }, 0.6024030347783642 },
+	{ 0, { -64408., -16238., -14709., 52293., -7099., 22267. }, 0.6155618610057497 },
+	{ 0, { -8702., 7365., -847., 28860., 2496., 17960. }, 0.6266278765065182 },
+	{ 0, { 37681., 20807., -24633., 19631., -10642., 8265. }, 0.6366292306281224 },
+	{ 0, { 3191., 5638., -2365., 9854., -1386., 3658. }, 0.6449290790303238 },
+	{ 0, { -5177., -823., -2003., 5908., -949., 2341. }, 0.6763170666119763 },
+	{ 0, { -3638., 10059., 7207., 4377., 3151., 2651. }, 0.6862778987939261 },
+	{ 0, { 11748., -14352., -13920., -7897., -5625., -2944. }, 0.6979445752019332 },
+	{ 0, { -8438., 12018., 9236., 3586., 3477., 1505. }, 0.7048114577856822 },
+	{ 0, { 1834., -5463., -4042., -1281., -1755., -771. }, 0.7111948880743650 },
+	{ 0, { -4692., -8326., -4750., 8084., -2967., 3594. }, 0.7473196860221153 },
+	{ 0, { 4040., 13701., 10942., -11503., 6915., -5226. }, 0.7526899558709467 },
+	{ 0, { 22865., -59285., -48182., -15767., -20987., -6907. }, 0.7617757396112786 },
+	{ 1, { 3873., 1796., -260., -5778., -1031., -4126. },  },
+	{ 0, { 272., -668., 1897., 1033., 987., 184. }, 0.7769058037180200 },
+	{ 0, { -2176., 7071., 5492., 2930., 2571., 1313. }, 0.8199388514022748 },
+	{ 0, { -184998., 97937., 88915., 171155., 41794., 73600. }, 0.8350541004724259 },
+	{ 1, { -197., -3126., -715., 1748., -208., 825. },  },
+	{ 0, { -5824., 1942., -2170., -8871., -927., -3596. }, 0.8453935583217296 },
+	{ 0, { 252., 2148., -787., 1499., -241., 459. }, 0.8551127263577434 },
+	{ 0, { 3107., 6817., 10906., 19., 4504., -914. }, 0.8879713761393457 },
+	{ 0, { 6532., -6647., -8432., -9470., -3566., -3649. }, 0.8938517525956896 },
+	{ 1, { 2415., -4253., -3554., -6203., -2191., -2419. },  },
+	{ 0, { -3926., 523., -5326., 11396., -2537., 5007. }, 0.9076103122110721 },
+	{ 0, { 1486., 6143., -4417., -1583., -1883., -794. }, 0.9528977392964432 },
+	{ 0, { 1226., -908., 2507., -1706., 1029., -874. }, 0.9646777216958613 },
+	{ 0, { -11300., -22605., 26258., -9349., 12130., -5605. }, 0.9849512095278805 },
+	{ 1, { 1457., -2630., 860., 1293., 487., 641. },  },
+	{ 2, { -685., -2643., -646., -848., -225., -318. },  },
+	{ 0, { -2190., -3253., -891., -1611., -317., -665. }, 0.9964090016851210 },
+	{ 0, { -1179., -3116., -2763., 1595., -1346., 737. }, 1.0352639155374268 },
+	{ 0, { 7916., 3274., -3481., 4472., -1826., 2498. }, 1.0515675436820877 },
+	{ 0, { 697761., -973027., 901279., 634785., 369311., 295489. }, 1.0592810372818169 },
+	{ 1, { -1426., -5270., 2981., -566., 1562., -288. },  },
+	{ 0, { -1789., 2512., -1045., -777., -493., -461. }, 1.0720350844573199 },
+	{ 0, { 3343., -1231., -1017., -2862., -464., -1223. }, 1.1429483332496098 },
+	{ 0, { 11373., -2498., -1580., 8748., -883., 3741. }, 1.1609636069979286 },
+	{ 1, { -1522., -2635., 28., 1104., -15., 464. },  },
+	{ 0, { -1975., 3205., 2553., 2452., 995., 1112. }, 1.1691873087779718 },
+	{ 0, { -9107., -5910., -5019., 8600., -1999., 3899. }, 1.2152142837985198 },
+	{ 1, { -4., -1508., -1102., -242., -397., -127. },  },
+	{ 0, { -1971., 699., -3., 1482., -78., 551. }, 1.2226982614159414 },
+	{ 0, { -31., -206., 25., 63., 54., 23. }, 1.2355263592688024 },
+	{ 0, { 2581., 7563., 7150., -2433., 3120., -1128. }, 1.2857063346850945 },
+	{ 1, { 1638., -740., -410., -2267., -163., -1002. },  },
+	{ 0, { 6494., 16800., 14424., -5912., 6217., -2861. }, 1.2908372220692612 },
+	{ 0, { -2870., 4014., 4972., 2882., 2300., 1194. }, 1.3652019003010083 },
+	{ 1, { 121., -268., -412., 87., -162., 47. },  },
+	{ 2, { 204., -295., -187., 24., -76., 9. },  },
+	{ 0, { -3114., 953., -618., -2692., -475., -1304. }, 1.4390426416344881 },
+	{ 0, { 643., 554., -351., 588., -171., 247. }, 1.4790740463977397 },
+	{ 0, { 470., -497., -239., -9., -101., -35. }, 1.5778081754901920 },
+	{ 0, { 12015., -42122., 38323., 10981., 16121., 5766. }, 1.5889777636732787 },
+	{ 1, { -377., -28., -105., 615., -60., 248. },  },
+	{ 2, { -102., -86., -77., -32., -33., -28. },  },
+	{ 0, { -1329., 1696., 1422., 1073., 644., 441. }, 1.6698689170399983 },
+	{ 0, { 653., -443., 76., 737., 22., 321. }, 1.6917823552881666 },
+	{ 0, { 4010., -973., -776., -3727., -389., -1621. }, 1.7447101363840591 },
+	{ 0, { 796., 753., 911., -908., 375., -434. }, 1.8195524075201825 },
+	{ 0, { -67., 529., -320., 151., -164., 92. }, 1.8944084825549634 },
+	{ 0, { 10., -1636., 1676., -13., 718., 43. }, 2.1173586606692205 },
+	{ 0, { -176., -699., -800., 57., -346., 33. }, 2.1995558975407743 },
+	{ 0, { 4804., 493., -302., 4547., -271., 2069. }, 3.3406137564373255 },
+	{ 1, { -37., 63., -60., 6., -25., 5. },  },
+	{ 0, { -6127., -30327., 27236., -5550., 11893., -2472. }, 6.2830758108542479 },
+	{ 1, { 13., 96., 24., 144., -4., 74. },  },
+	{ 2, { 94., 86., 39., 73., 3., 45. },  },
+	{ 0, { -103., 11., 317., -154., 157., -57. }, 8.4710588767699999 },
+	{ 0, { -1072., -875., 799., -1217., 416., -503. }, 10.1988027176192690 },
+	{ 0, { -7126., 105., -353., -6736., 285., -3012. }, 10.2074359814049150 },
+	{ 1, { -735., 3920., -3778., -636., -1657., -531. },  },
+	{ 0, { -9779., 1441., -1464., -8409., -23., -3858. }, 10.2156685960931930 },
+	{ /* end uranus */ -1,  },
+};
+
+chap95_rec chap95_neptune[] = {
+	{ 0, { -2753381808., 0., -2555187184., 0., -977694282., 0. }, 0. },
+	{ 1, { -53706852., 0., 9024894., 0., 5113590., 0. },  },
+	{ 0, { 5353414., 16329756., -10315608., -18211298., -4313685., -7909387. }, 0.0179617912970447 },
+	{ 0, { -19054385., -287482557., 282900211., 40600685., 114409567., 24195009. }, 0.0323644369574163 },
+	{ 0, { 171759338654., 246707191188., -226959547603., 161070501549., -97171931583., 59786666580. }, 0.0381185507042915 },
+	{ 0, { 269128284., 157897034., -86709918., 293605458., -39838078., 115245563. }, 0.0449423189622218 },
+	{ 0, { -93736103., -37825790., -26561507., -91732038., -9592733., -35920288. }, 0.0600427026897851 },
+	{ 0, { 178516553., 51475281., 124180124., 108331691., 49005129., 40587728. }, 0.0705779080356058 },
+	{ 0, { -1684231243., 681665499., -958998993., -1353650791., -355010040., -565296249. }, 0.0772675784146183 },
+	{ 0, { 1122264068., -578428299., 1063564939., 463713621., 414676760., 190864744. }, 0.0843726142307477 },
+	{ 0, { -781685034., 475952164., -808860716., -228929931., -316705638., -94548544. }, 0.0871507153151969 },
+	{ 0, { 56385979., -39979207., 64276567., 7694958., 25352958., 3214483. }, 0.1012471242645664 },
+	{ 1, { 63310243., 43285497., 22448880., 66731902., 8926250., 26309541. },  },
+	{ 0, { 2712359., -37080616., 26122509., -21572378., 10482381., -8529034. }, 0.1128959119291703 },
+	{ 0, { 1376659., 7176921., -1442553., 7206580., -479409., 2921144. }, 0.1246811309098641 },
+	{ 0, { -2552808., -3146754., -931704., -4559708., -491329., -1812338. }, 0.1349961443322037 },
+	{ 0, { 1162812., 462968., 719939., 2310847., 376498., 885784. }, 0.1402125408882514 },
+	{ 0, { -252283., -142326., -110247., -49287., -46731., -28945. }, 0.1616161402063230 },
+	{ 0, { 243162., -91598., 106479., 16854., 55597., 8501. }, 0.1776262925892778 },
+	{ 0, { -672251., 231673., -319786., 386301., -155882., 135214. }, 0.1904084544956719 },
+	{ 0, { 1867133., -1866896., 239943., -1803069., 228227., -732880. }, 0.2026926199831023 },
+	{ 0, { 32066276., -61274160., 6958960., -9094869., 4399306., -3854675. }, 0.2132050927412489 },
+	{ 1, { -11587231., -5526999., -7458452., 2330330., -3274130., 322813. },  },
+	{ 0, { -16700375., 45567407., 14051147., 28126677., 3238872., 12733553. }, 0.2160078733553654 },
+	{ 0, { 601249., -3740179., -1686685., -1590049., -510731., -804485. }, 0.2225065497464809 },
+	{ 0, { 71272., 256103., 179344., -10427., 65192., 15214. }, 0.2362432045351159 },
+	{ 0, { -58547., -82547., -51318., 58153., -20501., 15047. }, 0.2470536247773912 },
+	{ 0, { -6723., 19924., 26278., 12439., 9453., 3700. }, 0.2721326326759872 },
+	{ 0, { -3710., 4976., -7051., 254., -1464., 195. }, 0.2834391769690069 },
+	{ 0, { -12572., -6375., 5687., 15436., 615., 5233. }, 0.2938091870567225 },
+	{ 0, { -14716., 204103., 159833., 45074., 65416., 11053. }, 0.3117802888037338 },
+	{ 0, { -17577., 42568., 85327., -50768., 36610., -17999. }, 0.3148973170728874 },
+	{ 0, { -12308., -4224., -5418., 20456., -3011., 7048. }, 0.3237199721077774 },
+	{ 0, { -453., 863., 3006., -1602., 798., -820. }, 0.3434014414974197 },
+	{ 0, { -4296., 775., 4295., 2013., 1131., 245. }, 0.3679427772208049 },
+	{ 0, { 2844., 8238., -10394., 16799., -2798., 8324. }, 0.3785701069003719 },
+	{ 0, { -12477., -18952., 16324., -32949., 3954., -15266. }, 0.3833769854125967 },
+	{ 0, { -22365., 128., 5047., -4988., 1724., -1653. }, 0.3921552738853996 },
+	{ 0, { 4383., -6090., 178., -7672., -722., -3343. }, 0.4052046013289639 },
+	{ 0, { 714788., -68799., 122150., 736324., 10410., 310430. }, 0.4266933782608374 },
+	{ 1, { 12121., 14734., 49080., -28648., 20910., -8012. },  },
+	{ 0, { 46510., -21693., -58299., -84149., -12783., -39407. }, 0.4328778616668182 },
+	{ 0, { -18771., 8624., 16635., 18600., 2724., 10462. }, 0.4397536016965201 },
+	{ 0, { 3796., -9377., -6884., 415., -1798., -1014. }, 0.4503999814583104 },
+	{ 0, { -7089., 1370., -2220., 4940., -839., 2525. }, 0.4636405151525668 },
+	{ 0, { 5125., -1762., 2170., -4527., 631., -2166. }, 0.4745702135817129 },
+	{ 0, { 36688., -1584., -8174., -32426., -3946., -13037. }, 0.4886034832877044 },
+	{ 0, { -5607., 1955., 1641., 547., 484., -201. }, 0.5046352473687760 },
+	{ 0, { 45109., -21568., 12616., 26255., 6182., 12720. }, 0.5178003462986053 },
+	{ 0, { 40893658., -28000813., 26124943., 37354584., 10197353., 16693506. }, 0.5296623039564303 },
+	{ 1, { -21062., -35782., 31769., -20330., 15353., -11834. },  },
+	{ 2, { 10720., 5927., -12424., -538., -3613., -359. },  },
+	{ 0, { -28607., 23386., -38172., -43627., -12236., -20256. }, 0.5403804874893231 },
+	{ 0, { 66., 635., 4597., 3533., 1279., 1843. }, 0.5486365851140401 },
+	{ 0, { -1646., 2776., -3727., -1793., -1436., -354. }, 0.5631942288095021 },
+	{ 0, { -353., 460., 306., -526., 107., -133. }, 0.5739537566607668 },
+	{ 0, { -48., -518., 599., -406., 229., -183. }, 0.6031743297859348 },
+	{ 0, { -230., -43., -65., 493., -36., 204. }, 0.6175060453479511 },
+	{ 0, { 19445., 2550., -25130., 13108., -10967., 5418. }, 0.6333639350967218 },
+	{ 0, { 13473., 21421., -1023., 17345., -1204., 6355. }, 0.6373233385189475 },
+	{ 1, { 864., -8826., 6444., 11189., 2532., 4949. },  },
+	{ 0, { 1578., 3023., 2194., 1035., 836., 338. }, 0.6488504417528818 },
+	{ 0, { -3340., -7100., -6757., 2738., -2684., 1301. }, 0.6617542675140329 },
+	{ 0, { 1017., 744., 847., -982., 332., -425. }, 0.6999703675245400 },
+	{ 1, { 42., 10., 19., -41., 10., -16. },  },
+	{ 0, { 1891., 647., -479., 1705., -149., 715. }, 0.7361514522905745 },
+	{ 0, { -747., -1284., 1091., -507., 523., -190. }, 0.7442630004913908 },
+	{ 0, { -25., 104., -104., -129., -52., -37. }, 0.7785774183375729 },
+	{ 0, { -512., 349., 592., 506., 250., 205. }, 0.8337771392669406 },
+	{ 0, { -6683., 244., -856., -5864., -184., -2467. }, 0.8456021851592702 },
+	{ 1, { -1203., -318., -1016., 257., -373., 120. },  },
+	{ 0, { -24., 3933., -1820., 1132., -757., 301. }, 0.8511022350336571 },
+	{ 0, { 201., -293., -309., -190., -131., -68. }, 0.8740442975723336 },
+	{ 0, { 308., -601., -394., -483., -169., -197. }, 0.9077766553319553 },
+	{ 0, { -16598., 27372., 14431., 13730., 6210., 4914. }, 0.9458755575816939 },
+	{ 1, { -126., -1380., -1472., 3523., -609., 1504. },  },
+	{ 2, { 143., -540., 222., -105., 87., -32. },  },
+	{ 0, { 329., 51., -160., 190., -86., 81. }, 0.9622835434242619 },
+	{ 0, { 128., 272., 129., -159., 60., -76. }, 0.9782201450147658 },
+	{ 0, { 420., 770., -363., -155., -115., -92. }, 1.0124707282567436 },
+	{ 0, { -2248., -3936., 3766., -2218., 1312., -630. }, 1.0195444397190756 },
+	{ 0, { -857., -445., 435., -868., 168., -286. }, 1.0327159571739788 },
+	{ 0, { 3376., 287., -315., 3751., -219., 1451. }, 1.0465646752474935 },
+	{ 0, { 703800., -971644., 898780., 636713., 368186., 296800. }, 1.0592831516596322 },
+	{ 1, { -2151., -2956., 2235., -1431., 946., -697. },  },
+	{ 2, { -483., -834., 925., 208., 376., 16. },  },
+	{ 0, { -2186., 1237., -468., -857., -221., -500. }, 1.0699466056843263 },
+	{ 0, { 186., -107., -155., -33., -60., 1. }, 1.0856512764294945 },
+	{ 0, { -29., 176., 74., -52., 22., -24. }, 1.1079517768853906 },
+	{ 1, { 68., -82., -7., 40., -2., 17. },  },
+	{ 2, { 47., -125., -59., 70., -19., 30. },  },
+	{ 0, { -79., -181., -17., 75., 0., 31. }, 1.1242912886086618 },
+	{ 0, { 11970., 27., -219., 9608., -385., 4137. }, 1.1622448658047415 },
+	{ 1, { 148., -416., -127., 187., -55., 93. },  },
+	{ 0, { -1209., -240., 543., 444., 267., 180. }, 1.1657893477276102 },
+	{ 0, { 469., -600., 571., 404., 237., 192. }, 1.2652830224888050 },
+	{ 0, { -354., 198., -247., -335., -95., -149. }, 1.3749277491569207 },
+	{ 0, { 1875., 1364., 1214., -1793., 447., -768. }, 1.4364654070205274 },
+	{ 1, { 8., 17., -6., -31., -6., -14. },  },
+	{ 0, { -139., 116., 212., 18., 88., 1. }, 1.4674691182537039 },
+	{ 0, { 498., 950., -86., 629., -57., 244. }, 1.4773951127670801 },
+	{ 0, { -211., 132., -176., -151., -46., -37. }, 1.5126367782986652 },
+	{ 0, { 388., -45., -90., 143., -56., 57. }, 1.5755868837627032 },
+	{ 0, { -262., 394., 82., 179., 60., 76. }, 1.5824073222387700 },
+	{ 0, { 12274., -42141., 38563., 10654., 16215., 5586. }, 1.5888971797699629 },
+	{ 1, { 79., 26., 108., -116., 43., -61. },  },
+	{ 0, { 785., -282., 272., 723., 98., 317. }, 1.6918870360592064 },
+	{ 0, { 107., -210., -181., -174., -73., -72. }, 1.9281473841900221 },
+	{ 0, { -121., -1883., 1696., -129., 731., -7. }, 2.1185461864868773 },
+	{ 0, { 4845., 396., -313., 4430., -275., 2018. }, 3.3406127811310191 },
+	{ 1, { 1., 25., -4., 6., -1., 2. },  },
+	{ 0, { -5503., -29918., 27443., -5129., 11901., -2218. }, 6.2830758192539502 },
+	{ 0, { 149., -16., 70., 137., 24., 69. }, 6.6811483956904603 },
+	{ 0, { 14., 35., -47., -48., -19., -18. }, 8.4710967963441863 },
+	{ 1, { 1., -1., -17., -7., -7., -4. },  },
+	{ 0, { -17638., 555., -991., -16049., 673., -7250. }, 10.2132840866995910 },
+	{ 0, { -44., -259., 211., -59., 89., -24. }, 12.5662764645159580 },
+	{ /* end neptune */ -1,  },
+};
+
+chap95_rec chap95_pluto[] = {
+	{ 0, { 101045891905., 0., 110312086224., 0., 6172492792., 0. }, 0. },
+	{ 1, { 2736962357., 0., 7289921703., 0., 8356828229., 0. },  },
+	{ 0, { -197631754827., 306850452168., -363706825084., -174047739469., -83742488844., -166197114948. }, 0.0255535185296511 },
+	{ 1, { -10339882709., 3627560682., -1704596538., 16082008148., -2615797675., 26582875457. },  },
+	{ 2, { 4555881844., 5354987944., 14163087849., 13295578846., 16544976961., 15318697408. },  },
+	{ 0, { 12877551757., 9141005248., 38823958976., 14074786713., 47081142550., 15934841957. }, 0.0383093966256461 },
+	{ 0, { -20363081906., 43534352230., -68888048997., -6054817551., -37922256273., -13665923314. }, 0.0512632279013590 },
+	{ 0, { 11372859069., -7331041505., 34135169446., -14164330338., 35562426110., -15256543947. }, 0.0629625800045217 },
+	{ 0, { -25223811753., 30334977886., -76993608077., 67207355885., -78022096909., 72709750549. }, 0.0739104871604531 },
+	{ 0, { 19031032676., -21606847641., 49490563510., -67837042251., 54793488046., -76660221358. }, 0.0843726142307477 },
+	{ 1, { 9888109415., 13390931761., 31569755508., 36949340015., 35801709881., 41063108577. },  },
+	{ 2, { -5391246864., 9125341237., -13760381761., 26757260022., -14709006932., 29981422406. },  },
+	{ 0, { 77016900., 8576436595., -758303524., 19868503441., 945693837., 21114141886. }, 0.1009656667626818 },
+	{ 0, { -425710709., -2201772586., -2981443460., -6781825029., -3324565933., -7783206250. }, 0.1181216342983851 },
+	{ 1, { 2255988361., -245384099., 5983679140., -939391729., 6514267045., -1323842110. },  },
+	{ 2, { 531179571., 1086625691., 2182247914., 3044397909., 2484824490., 3408389022. },  },
+	{ 0, { 670122662., 438458646., 1753307958., 718209879., 2047795531., 636335929. }, 0.1384952768343311 },
+	{ 0, { -179746215., -90394676., -766063009., -205567765., -854408253., -261725146. }, 0.1499201895782055 },
+	{ 1, { 110140865., -359336510., 28912500., -843378659., -67920831., -973289319. },  },
+	{ 0, { -118071179., 1819649., -265130729., 91955370., -298913452., 133716152. }, 0.1607487697162686 },
+	{ 0, { 38739517., 9002149., 12071193., -2098061., 15714901., -32081340. }, 0.1760768320056049 },
+	{ 0, { -2332129., 6073325., -5475022., 19141973., -5216109., 20872520. }, 0.1900452184842649 },
+	{ 0, { 8137788., -2826068., -3014741., -6719062., -5256740., -14189611. }, 0.2024941844674784 },
+	{ 0, { 18559203., -16541614., 25112499., 27558953., 14213163., 19938478. }, 0.2134752084935937 },
+	{ 0, { 1940133., -1267576., -1439934., -1986889., -2525015., -3851133. }, 0.2269557049635166 },
+	{ 1, { 1917476., -1704590., 4921317., -5434051., 4782139., -6305807. },  },
+	{ 0, { -822410., -563503., -2747944., -903463., -3210523., -702889. }, 0.2402479397150676 },
+	{ 0, { 962595., -74013., 1141117., 518365., 966375., 17190. }, 0.2531177145689346 },
+	{ 0, { -135658., -8463., -393590., 160618., -448155., 267162. }, 0.2643717493874742 },
+	{ 0, { 231442., -143885., 176186., -1443., 93050., -109960. }, 0.2777029906063622 },
+	{ 0, { -3000., -245., -27453., 92186., -35712., 133397. }, 0.2900297658482435 },
+	{ 0, { 55997., -115242., -44421., -45883., -43549., -47825. }, 0.3037412654012783 },
+	{ 0, { -14892., 15253., 52487., 23252., 43486., 48497. }, 0.3142803959054077 },
+	{ 0, { -2949., -95938., -94512., -17869., -51976., 3765. }, 0.3264027536592037 },
+	{ 0, { 8894., 9213., 33696., 2580., 28347., 6790. }, 0.3373713684595000 },
+	{ 0, { -16468., -43883., -57588., 8839., -17108., 18484. }, 0.3506196546089751 },
+	{ 0, { -4324., 14942., 537., 2320., 8817., -1258. }, 0.3768935755307548 },
+	{ 0, { -2257., -145., -272., -4909., 4559., -6184. }, 0.3901294315026133 },
+	{ 0, { -10889., 10437., -5474., 6213., 16279., -4595. }, 0.4045287784128869 },
+	{ 0, { 719443., -70760., 86542., 684112., 3209., 279550. }, 0.4267968486470127 },
+	{ 1, { 3728., 5875., 3969., 4141., 3826., 956. },  },
+	{ 2, { 9968., 1181., 2923., 6780., 6338., 2119. },  },
+	{ 0, { 6842., 1584., 10374., 4788., 8573., -4658. }, 0.4456721426794963 },
+	{ 0, { -10089., 9939., 3641., 7449., 544., 598. }, 0.4579662921251779 },
+	{ 0, { 1823., 688., 6471., -612., 1565., -5241. }, 0.4724826607880908 },
+	{ 0, { -3424., 9654., 4992., 7807., 583., 1356. }, 0.4869141744280314 },
+	{ 0, { -449., -1794., 3826., -7250., -2319., -7298. }, 0.5001714317315645 },
+	{ 0, { 15872., 9071., 15995., 31749., 10331., 14516. }, 0.5137491938947873 },
+	{ 0, { 40907450., -28046763., 26106307., 37325417., 10171143., 16690754. }, 0.5296557456960209 },
+	{ 1, { -42177., -28947., 38775., -19498., 29548., -4665. },  },
+	{ 2, { 3107., 30472., -6348., 11400., 8980., 1831. },  },
+	{ 0, { -7558., 61741., -13579., -15470., 9629., -26943. }, 0.5428748902518665 },
+	{ 0, { -5153., -16254., 1129., 1453., -5621., 9705. }, 0.5545763246422408 },
+	{ 1, { 4786., -5955., 927., 2343., -4914., 1978. },  },
+	{ 0, { -472., -1295., 65., -1013., 81., 865. }, 0.5737334589484931 },
+	{ 0, { 1071., -818., -1860., -1756., -2076., -217. }, 0.6240874769868805 },
+	{ 0, { 35210., 26306., -24283., 31193., -11240., 11870. }, 0.6381677442023816 },
+	{ 1, { -1433., -467., -610., 819., -193., 1466. },  },
+	{ 2, { -2302., -1111., 916., -1272., 326., -143. },  },
+	{ 0, { 713., -751., -578., -1512., 156., -696. }, 0.6775366989691358 },
+	{ 1, { 60., 611., -229., 120., -170., -479. },  },
+	{ 0, { 566., 1322., -824., 882., 271., -163. }, 0.7307010456855323 },
+	{ 1, { 315., -273., 931., -867., 656., -752. },  },
+	{ 0, { 2637., -5581., -3871., -2275., -3921., 187. }, 0.8349274544218315 },
+	{ 0, { -6012., 8879., 923., -5393., 1314., -3852. }, 0.8466308769723183 },
+	{ 1, { -2430., -2929., -1564., 2843., 65., 3053. },  },
+	{ 2, { -373., -2949., -1724., 190., -949., 999. },  },
+	{ 0, { 3787., 756., 723., -3294., -966., -1395. }, 0.8803279870880313 },
+	{ 0, { 5446., -1146., -595., -4608., -1861., -1044. }, 0.9048452745134871 },
+	{ 0, { 5058., -2711., -831., -3667., -1554., -139. }, 0.9284980837327494 },
+	{ 0, { 1760., -6922., -4114., -3639., -1717., 694. }, 0.9630502889662660 },
+	{ 1, { 963., 1525., 703., -3798., -966., -2055. },  },
+	{ 0, { -854., -5315., -3964., -3549., -797., 142. }, 0.9850575449612223 },
+	{ 1, { 453., 513., -533., -1316., -1407., -442. },  },
+	{ 0, { -1452., 2161., -2167., -2392., 843., -1017. }, 1.0358203937225836 },
+	{ 0, { 717822., -1016247., 926007., 647088., 383619., 291083. }, 1.0592833248900753 },
+	{ 1, { -29524., -7934., 4354., -18649., -4618., -10392. },  },
+	{ 2, { -5165., 7903., -5462., -3951., -3606., -275. },  },
+	{ 0, { -13391., 43036., -26981., -8012., -15174., 6191. }, 1.0698620958167548 },
+	{ 1, { -19633., -2810., 1597., -10192., -4219., -4352. },  },
+	{ 0, { 273., 2230., -349., -375., 851., 287. }, 1.0830212781676249 },
+	{ 0, { 10855., -624., 671., 9748., 207., 3846. }, 1.1622398168028405 },
+	{ 1, { -33., 92., -124., -554., -92., -612. },  },
+	{ 0, { 448., -1008., 1081., 183., 623., -187. }, 1.2654499680761597 },
+	{ 0, { -207., 526., 176., -733., 246., -400. }, 1.3757220045803040 },
+	{ 0, { 638., 340., -422., 36., 44., 18. }, 1.4777197679290477 },
+	{ 0, { 12128., -41950., 38517., 10211., 16357., 5050. }, 1.5888963534561586 },
+	{ 1, { -267., 195., -296., 12., -482., 121. },  },
+	{ 2, { -41., 86., -13., 298., -132., 311. },  },
+	{ 0, { 667., -280., 347., 903., -21., 475. }, 1.6918774676128379 },
+	{ 0, { 30., -1843., 2162., 314., 1153., 512. }, 2.1185453910327063 },
+	{ 0, { 4845., 477., -393., 4358., -362., 2072. }, 3.3406128168607023 },
+	{ 0, { -5939., -29727., 27855., -4133., 12163., -1725. }, 6.2830758108873654 },
+	{ 1, { 5., -58., 6., 45., 39., 54. },  },
+	{ 0, { -223., 149., 91., 102., 231., 420. }, 8.4710959288534031 },
+	{ 0, { -17640., -47., -831., -15721., 782., -7065. }, 10.2132856585962150 },
+	{ 1, { 165., 60., -38., 154., 112., 136. },  },
+	{ 2, { 20., 46., 112., -30., 119., 10. },  },
+	{ /* end pluto */ -1,  },
+};
+
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: chap95_data.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/circum.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/circum.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/circum.c	(revision 1457)
@@ -0,0 +1,757 @@
+/* given a Now and an Obj with the object definition portion filled in,
+ * fill in the sky position (s_*) portions.
+ * calculation of positional coordinates reworked by
+ * Michael Sternberg <sternberg@physik.tu-chemnitz.de>
+ *  3/11/98: deflect was using op->s_hlong before being set in cir_pos().
+ *  4/19/98: just edit a comment
+ */
+
+#include <stdio.h>
+#include <math.h>
+#if defined(__STDC__)
+#include <stdlib.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+#include "preferences.h"
+
+
+static int obj_planet P_((Now *np, Obj *op));
+static int obj_fixed P_((Now *np, Obj *op));
+static int obj_elliptical P_((Now *np, Obj *op));
+static int obj_hyperbolic P_((Now *np, Obj *op));
+static int obj_parabolic P_((Now *np, Obj *op));
+static int sun_cir P_((Now *np, Obj *op));
+static int moon_cir P_((Now *np, Obj *op));
+static void cir_sky P_((Now *np, double lpd, double psi, double rp, double *rho,
+    double lam, double bet, double lsn, double rsn, Obj *op));
+static void cir_pos P_((Now *np, double bet, double lam, double *rho, Obj *op));
+static void elongation P_((double lam, double bet, double lsn, double *el));
+static void deflect P_((double mjd1, double lpd, double psi, double rsn,
+    double lsn, double rho, double *ra, double *dec));
+static double h_albsize P_((double H));
+
+/* given a Now and an Obj, fill in the approprirate s_* fields within Obj.
+ * return 0 if all ok, else -1.
+ */
+int
+obj_cir (np, op)
+Now *np;
+Obj *op;
+{
+	switch (op->o_type) {
+	case FIXED:	 return (obj_fixed (np, op));
+	case ELLIPTICAL: return (obj_elliptical (np, op));
+	case HYPERBOLIC: return (obj_hyperbolic (np, op));
+	case PARABOLIC:  return (obj_parabolic (np, op));
+	case EARTHSAT:   return (obj_earthsat (np, op));
+	case PLANET:     return (obj_planet (np, op));
+	default:
+	    printf ("obj_cir() called with type %d\n", op->o_type);
+	    exit(1);
+	    return (-1);	/* just for lint */
+	}
+}
+
+static int
+obj_planet (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+	double lpd, psi;	/* heliocentric ecliptic long and lat */
+	double rp;		/* dist from sun */
+	double rho;		/* dist from earth */
+	double lam, bet;	/* geocentric ecliptic long and lat */
+	double dia, mag;	/* angular diameter at 1 AU and magnitude */
+	double f;		/* fractional phase from earth */
+	int p;
+
+	/* validate code and check for a few special cases */
+	p = op->pl.pl_code;
+	if (p < 0 || p > MOON) {
+	    printf ("unknown planet code: %d\n", p);
+	    exit(1);
+	}
+	else if (p == SUN)
+	    return (sun_cir (np, op));
+	else if (p == MOON)
+	    return (moon_cir (np, op));
+
+	/* find solar ecliptical longitude and distance to sun from earth */
+	sunpos (mjed, &lsn, &rsn, 0);
+
+	/* find helio long/lat; sun/planet and earth/plant dist; ecliptic
+	 * long/lat; diameter and mag.
+	 */
+	plans(mjed, p, &lpd, &psi, &rp, &rho, &lam, &bet, &dia, &mag);
+
+	/* fill in all of op->s_* stuff except s_size and s_mag */
+	cir_sky (np, lpd, psi, rp, &rho, lam, bet, lsn, rsn, op);
+
+	/* compute magnitude and angular size */
+	f = op->s_phase ? 5*log10(rp*rho) - 5*log10(op->s_phase/100) : 100;
+	set_smag (op, mag+f);
+	op->s_size = (float)(dia/rho);
+
+	return (0);
+}
+
+static int
+obj_fixed (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun, dist from sn to earth*/
+	double lam, bet;	/* geocentric ecliptic long and lat */
+	double ha;		/* local hour angle */
+	double el;		/* elongation */
+	double alt, az;		/* current alt, az */
+	double ra, dec;		/* ra and dec at epoch of date */
+	double lst;
+
+	if (epoch != EOD && (float)epoch != op->f_epoch) {
+	    /* want a certain epoch -- if it's not what the database is at
+	     * we change the original to save time next time assuming the
+	     * user is likely to stick with this for a while.
+	     */
+	    double tra = op->f_RA, tdec = op->f_dec;
+	    float tepoch = (float)epoch;	/* compare w/float precision */
+	    precess (op->f_epoch, tepoch, &tra, &tdec);
+	    op->f_epoch = tepoch;
+	    op->f_RA = (float)tra;
+	    op->f_dec = (float)tdec;
+	}
+
+	/* set ra/dec to astrometric @ epoch of date */
+	ra = op->f_RA;
+	dec = op->f_dec;
+	precess (op->f_epoch, mjd, &ra, &dec);
+
+	/* convert equatoreal ra/dec to mean geocentric ecliptic lat/long */
+	eq_ecl (mjd, ra, dec, &bet, &lam);
+
+	/* find solar ecliptical long.(mean equinox) and distance from earth */
+	sunpos (mjed, &lsn, &rsn, NULL);
+
+	/* allow for relativistic light bending near the sun */
+	deflect (mjd, lam, bet, lsn, rsn, 1e10, &ra, &dec);
+
+	/* TODO: correction for annual parallax would go here */
+
+	/* correct EOD equatoreal for nutation/aberation to form apparent 
+	 * geocentric
+	 */
+	nut_eq(mjd, &ra, &dec);
+	ab_eq(mjd, lsn, &ra, &dec);
+	op->s_gaera = (float)ra;
+	op->s_gaedec = (float)dec;
+
+	/* set s_ra/dec -- apparent if EOD else astrometric */
+	if (epoch == EOD) {
+	    op->s_ra = (float)ra;
+	    op->s_dec = (float)dec;
+	} else {
+	    /* annual parallax at time mjd is to be added here, too, but
+	     * technically in the frame of epoch (usually different from mjd)
+	     */
+	    op->s_ra = op->f_RA;	/* already precessed */
+	    op->s_dec = op->f_dec;
+	}
+
+	/* compute elongation from ecliptic long/lat and sun geocentric long */
+	elongation (lam, bet, lsn, &el);
+	el = raddeg(el);
+	op->s_elong = (float)el;
+
+	/* these are really the same fields ...
+	op->s_mag = op->f_mag;
+	op->s_size = op->f_size;
+	*/
+
+	/* alt, az: correct for refraction; use eod ra/dec. */
+	now_lst (np, &lst);
+	ha = hrrad(lst) - ra;
+	hadec_aa (lat, ha, dec, &alt, &az);
+	refract (pressure, temp, alt, &alt);
+	op->s_alt = alt;
+	op->s_az = az;
+
+	return (0);
+}
+
+/* compute sky circumstances of an object in heliocentric elliptic orbit at *np.
+ */
+static int
+obj_elliptical (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+	double dt;		/* light travel time to object */
+	double lg;		/* helio long of earth */
+	double nu, ea;		/* true anomaly and eccentric anomaly */
+	double ma;		/* mean anomaly */
+	double rp=0;		/* distance from the sun */
+	double lo, slo, clo;	/* angle from ascending node */
+	double inc;		/* inclination */
+	double psi=0;		/* heliocentric latitude */
+	double spsi=0, cpsi=0;	/* trig of heliocentric latitude */
+	double lpd; 		/* heliocentric longitude */
+	double rho=0;		/* distance from the Earth */
+	double om;		/* arg of perihelion */
+	double Om;		/* long of ascending node. */
+	double lam;    		/* geocentric ecliptic longitude */
+	double bet;    		/* geocentric ecliptic latitude */
+	double e;		/* fast eccentricity */
+	double ll=0, sll, cll;	/* helio angle between object and earth */
+	double mag;		/* magnitude */
+	double e_n;		/* mean daily motion */
+	double rpd=0;
+	double y;
+	int pass;
+
+	/* find location of earth from sun now */
+	sunpos (mjed, &lsn, &rsn, 0);
+	lg = lsn + PI;
+
+	/* faster access to eccentricty */
+	e = op->e_e;
+
+	/* mean daily motion is derived fro mean distance */
+	e_n = 0.9856076686/pow((double)op->e_a, 1.5);
+
+	/* correct for light time by computing position at time mjd, then
+	 *   again at mjd-dt, where
+	 *   dt = time it takes light to travel earth-object distance.
+	 */
+	dt = 0;
+	for (pass = 0; pass < 2; pass++) {
+
+	    reduce_elements (op->e_epoch, mjd-dt, degrad(op->e_inc),
+					degrad (op->e_om), degrad (op->e_Om),
+					&inc, &om, &Om);
+
+	    ma = degrad (op->e_M + (mjed - op->e_cepoch - dt) * e_n);
+	    anomaly (ma, e, &nu, &ea);
+	    rp = op->e_a * (1-e*e) / (1+e*cos(nu));
+	    lo = nu + om;
+	    slo = sin(lo);
+	    clo = cos(lo);
+	    spsi = slo*sin(inc);
+	    y = slo*cos(inc);
+	    psi = asin(spsi);
+	    lpd = atan(y/clo)+Om;
+	    if (clo<0) lpd += PI;
+	    range (&lpd, 2*PI);
+	    cpsi = cos(psi);
+	    rpd = rp*cpsi;
+	    ll = lpd-lg;
+	    rho = sqrt(rsn*rsn+rp*rp-2*rsn*rp*cpsi*cos(ll));
+
+	    dt = rho*LTAU/3600.0/24.0;	/* light travel time, in days / AU */
+	}
+
+	/* compute sin and cos of ll */
+	sll = sin(ll);
+	cll = cos(ll);
+
+	/* find geocentric ecliptic longitude and latitude */
+	if (rpd < rsn)
+	    lam = atan(-1*rpd*sll/(rsn-rpd*cll))+lg+PI;
+	else
+	    lam = atan(rsn*sll/(rpd-rsn*cll))+lpd;
+	range (&lam, 2*PI);
+	bet = atan(rpd*spsi*sin(lam-lpd)/(cpsi*rsn*sll));
+
+	/* fill in all of op->s_* stuff except s_size and s_mag */
+	cir_sky (np, lpd, psi, rp, &rho, lam, bet, lsn, rsn, op);
+
+	/* compute magnitude and size */
+	if (op->e_mag.whichm == MAG_HG) {
+	    /* the H and G parameters from the Astro. Almanac.
+	     */
+	    if (op->e_size)
+		op->s_size = (float)(op->e_size / rho);
+	    else {
+		hg_mag (op->e_mag.m1, op->e_mag.m2, rp, rho, rsn, &mag);
+		op->s_size = (float)(h_albsize (op->e_mag.m1)/rho);
+
+	    }
+	} else {
+	    /* the g/k model of comets */
+	    gk_mag (op->e_mag.m1, op->e_mag.m2, rp, rho, &mag);
+	    op->s_size = (float)(op->e_size / rho);
+	}
+	set_smag (op, mag);
+
+	return (0);
+}
+
+/* compute sky circumstances of an object in heliocentric hyperbolic orbit.
+ */
+static int
+obj_hyperbolic (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+	double dt;		/* light travel time to object */
+	double lg;		/* helio long of earth */
+	double nu, ea;		/* true anomaly and eccentric anomaly */
+	double ma;		/* mean anomaly */
+	double rp=0;		/* distance from the sun */
+	double lo, slo, clo;	/* angle from ascending node */
+	double inc;		/* inclination */
+	double psi=0;		/* heliocentric latitude */
+	double spsi=0, cpsi=0;	/* trig of heliocentric latitude */
+	double lpd; 		/* heliocentric longitude */
+	double rho=0;		/* distance from the Earth */
+	double om;		/* arg of perihelion */
+	double Om;		/* long of ascending node. */
+	double lam;    		/* geocentric ecliptic longitude */
+	double bet;    		/* geocentric ecliptic latitude */
+	double e;		/* fast eccentricity */
+	double ll=0, sll, cll;	/* helio angle between object and earth */
+	double n;		/* mean daily motion */
+	double mag;		/* magnitude */
+	double a;		/* mean distance */
+	double rpd=0;
+	double y;
+	int pass;
+
+	/* find solar ecliptical longitude and distance to sun from earth */
+	sunpos (mjed, &lsn, &rsn, 0);
+
+	lg = lsn + PI;
+	e = op->h_e;
+	a = op->h_qp/(e - 1.0);
+	n = .98563/sqrt(a*a*a);
+
+	/* correct for light time by computing position at time mjd, then
+	 *   again at mjd-dt, where
+	 *   dt = time it takes light to travel earth-object distance.
+	 */
+	dt = 0;
+	for (pass = 0; pass < 2; pass++) {
+
+	    reduce_elements (op->h_epoch, mjd-dt, degrad(op->h_inc),
+			    degrad (op->h_om), degrad (op->h_Om),
+			    &inc, &om, &Om);
+
+	    ma = degrad ((mjed - op->h_ep - dt) * n);
+	    anomaly (ma, e, &nu, &ea);
+	    rp = a * (e*e-1.0) / (1.0+e*cos(nu));
+	    lo = nu + om;
+	    slo = sin(lo);
+	    clo = cos(lo);
+	    spsi = slo*sin(inc);
+	    y = slo*cos(inc);
+	    psi = asin(spsi);
+	    lpd = atan(y/clo)+Om;
+	    if (clo<0) lpd += PI;
+	    range (&lpd, 2*PI);
+	    cpsi = cos(psi);
+	    rpd = rp*cpsi;
+	    ll = lpd-lg;
+	    rho = sqrt(rsn*rsn+rp*rp-2*rsn*rp*cpsi*cos(ll));
+
+	    dt = rho*5.775518e-3;	/* light travel time, in days */
+	}
+
+	/* compute sin and cos of ll */
+	sll = sin(ll);
+	cll = cos(ll);
+
+	/* find geocentric ecliptic longitude and latitude */
+	if (rpd < rsn)
+	    lam = atan(-1*rpd*sll/(rsn-rpd*cll))+lg+PI;
+	else
+	    lam = atan(rsn*sll/(rpd-rsn*cll))+lpd;
+	range (&lam, 2*PI);
+	bet = atan(rpd*spsi*sin(lam-lpd)/(cpsi*rsn*sll));
+
+	/* fill in all of op->s_* stuff except s_size and s_mag */
+	cir_sky (np, lpd, psi, rp, &rho, lam, bet, lsn, rsn, op);
+
+	/* compute magnitude and size */
+	gk_mag (op->h_g, op->h_k, rp, rho, &mag);
+	set_smag (op, mag);
+	op->s_size = (float)(op->h_size / rho);
+
+	return (0);
+}
+
+/* compute sky circumstances of an object in heliocentric hyperbolic orbit.
+ */
+static int
+obj_parabolic (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+	double lam;    		/* geocentric ecliptic longitude */
+	double bet;    		/* geocentric ecliptic latitude */
+	double mag;		/* magnitude */
+	double inc, om, Om;
+	double lpd, psi, rp, rho;
+	double dt;
+	int pass;
+
+	/* find solar ecliptical longitude and distance to sun from earth */
+	sunpos (mjed, &lsn, &rsn, 0);
+
+	/* two passes to correct lam and bet for light travel time. */
+	dt = 0.0;
+	for (pass = 0; pass < 2; pass++) {
+	    reduce_elements (op->p_epoch, mjd-dt, degrad(op->p_inc),
+		degrad(op->p_om), degrad(op->p_Om), &inc, &om, &Om);
+	    comet (mjed-dt, op->p_ep, inc, om, op->p_qp, Om,
+				    &lpd, &psi, &rp, &rho, &lam, &bet);
+	    dt = rho*LTAU/3600.0/24.0;	/* light travel time, in days / AU */
+	}
+
+	/* fill in all of op->s_* stuff except s_size and s_mag */
+	cir_sky (np, lpd, psi, rp, &rho, lam, bet, lsn, rsn, op);
+
+	/* compute magnitude and size */
+	gk_mag (op->p_g, op->p_k, rp, rho, &mag);
+	set_smag (op, mag);
+	op->s_size = (float)(op->p_size / rho);
+
+	return (0);
+}
+
+/* find sun's circumstances now.
+ */
+static int
+sun_cir (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+	double bsn;		/* true latitude beta of sun */
+	double dhlong;
+
+	sunpos (mjed, &lsn, &rsn, &bsn);/* sun's true coordinates; mean ecl. */
+
+	op->s_sdist = 0.0;
+	op->s_elong = 0.0;
+	op->s_phase = 100.0;
+	set_smag (op, -26.8);	/* TODO */
+	dhlong = lsn-PI;	/* geo- to helio- centric */
+	range (&dhlong, 2*PI);
+	op->s_hlong = (float)dhlong;
+	op->s_hlat = (float)(-bsn);
+
+	/* fill sun's ra/dec, alt/az in op */
+	cir_pos (np, bsn, lsn, &rsn, op);
+	op->s_edist = (float)rsn;
+	op->s_size = (float)(raddeg(4.65242e-3/rsn)*3600*2);
+
+	return (0);
+}
+
+/* find moon's circumstances now.
+ */
+static int
+moon_cir (np, op)
+Now *np;
+Obj *op;
+{
+	double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+	double lam;    		/* geocentric ecliptic longitude */
+	double bet;    		/* geocentric ecliptic latitude */
+	double edistau;		/* earth-moon dist, in au */
+	double el;		/* elongation, rads east */
+	double ms;		/* sun's mean anomaly */
+	double md;		/* moon's mean anomaly */
+	double i;
+
+	moon (mjed, &lam, &bet, &edistau, &ms, &md);	/* mean ecliptic & EOD*/
+	sunpos (mjed, &lsn, &rsn, NULL);		/* mean ecliptic & EOD*/
+
+	op->s_hlong = (float)lam;		/* save geo in helio fields */
+	op->s_hlat = (float)bet;
+
+	/* find angular separation from sun */
+	elongation (lam, bet, lsn, &el);
+	op->s_elong = (float)raddeg(el);		/* want degrees */
+
+	/* solve triangle of earth, sun, and elongation for moon-sun dist */
+	op->s_sdist = (float) sqrt (edistau*edistau + rsn*rsn
+						    - 2.0*edistau*rsn*cos(el));
+
+	/* TODO: improve mag; this is based on a flat moon model. */
+	set_smag (op, -12.7 + 2.5*(log10(PI) - log10(PI/2*(1+1.e-6-cos(el)))));
+
+	/* find phase -- allow for projection effects */
+	i = 0.1468*sin(el)*(1 - 0.0549*sin(md))/(1 - 0.0167*sin(ms));
+	op->s_phase = (float)((1+cos(PI-el-degrad(i)))/2*100);
+
+	/* fill moon's ra/dec, alt/az in op and update for topo dist */
+	cir_pos (np, bet, lam, &edistau, op);
+
+	op->s_edist = (float)edistau;
+	op->s_size = (float)(3600*2.0*raddeg(asin(MRAD/MAU/edistau)));
+						/* moon angular dia, seconds */
+
+	return (0);
+}
+
+/* fill in all of op->s_* stuff except s_size and s_mag.
+ * this is used for sol system objects (except sun and moon); never FIXED.
+ */
+static void
+cir_sky (np, lpd, psi, rp, rho, lam, bet, lsn, rsn, op)
+Now *np;
+double lpd, psi;	/* heliocentric ecliptic long and lat */
+double rp;		/* dist from sun */
+double *rho;		/* dist from earth: in as geo, back as geo or topo */
+double lam, bet;	/* true geocentric ecliptic long and lat */
+double lsn, rsn;	/* true geoc lng of sun; dist from sn to earth*/
+Obj *op;
+{
+	double el;		/* elongation */
+	double f;		/* fractional phase from earth */
+
+	/* compute elongation and phase */
+	elongation (lam, bet, lsn, &el);
+	el = raddeg(el);
+	op->s_elong = (float)el;
+	f = 0.25 * ((rp+ *rho)*(rp+ *rho) - rsn*rsn)/(rp* *rho);
+	op->s_phase = (float)(f*100.0); /* percent */
+
+	/* set heliocentric long/lat; mean ecliptic and EOD */
+	op->s_hlong = (float)lpd;
+	op->s_hlat = (float)psi;
+
+	/* fill solar sys body's ra/dec, alt/az in op */
+	cir_pos (np, bet, lam, rho, op);        /* updates rho */
+
+	/* set earth/planet and sun/planet distance */
+	op->s_edist = (float)(*rho);
+	op->s_sdist = (float)rp;
+}
+
+/* fill equatoreal and horizontal op-> fields; stern
+ *
+ *    input:          lam/bet/rho geocentric mean ecliptic and equinox of day
+ * 
+ * algorithm at EOD:
+ *   ecl_eq	--> ra/dec	geocentric mean equatoreal EOD (via mean obliq)
+ *   deflect	--> ra/dec	  relativistic deflection
+ *   nut_eq	--> ra/dec	geocentric true equatoreal EOD
+ *   ab_eq	--> ra/dec	geocentric apparent equatoreal EOD
+ *					if (PREF_GEO)  --> output
+ *   ta_par	--> ra/dec	topocentric apparent equatoreal EOD
+ *					if (!PREF_GEO)  --> output
+ *   hadec_aa	--> alt/az	topocentric horizontal
+ *   refract	--> alt/az	observed --> output
+ *
+ * algorithm at fixed epoch:
+ *   ecl_eq	--> ra/dec	geocentric mean equatoreal EOD (via mean obliq)
+ *   deflect	--> ra/dec	  relativistic deflection [for alt/az only]
+ *   nut_eq	--> ra/dec	geocentric true equatoreal EOD [for aa only]
+ *   ab_eq	--> ra/dec	geocentric apparent equatoreal EOD [for aa only]
+ *   ta_par	--> ra/dec	topocentric apparent equatoreal EOD
+ *     precess	--> ra/dec	topocentric equatoreal fixed equinox [eq only]
+ *					--> output
+ *   hadec_aa	--> alt/az	topocentric horizontal
+ *   refract	--> alt/az	observed --> output
+ */
+static void
+cir_pos (np, bet, lam, rho, op)
+Now *np;
+double bet, lam;/* geo lat/long (mean ecliptic of date) */
+double *rho;	/* in: geocentric dist in AU; out: geo- or topocentic dist */
+Obj *op;	/* object to set s_ra/dec as per epoch */
+{
+	double ra, dec;		/* apparent ra/dec, corrected for nut/ab */
+	double tra, tdec;	/* astrometric ra/dec, no nut/ab */
+	double lsn, rsn;	/* solar geocentric (mean ecliptic of date) */
+	double ha_in, ha_out;	/* local hour angle before/after parallax */
+	double dec_out;		/* declination after parallax */
+	double dra, ddec;	/* parallax correction */
+	double alt, az;		/* current alt, az */
+	double lst;             /* local sidereal time */
+	double rho_topo;        /* topocentric distance in earth radii */
+
+	/* convert to equatoreal [mean equator, with mean obliquity] */
+	ecl_eq (mjd, bet, lam, &ra, &dec);
+	tra = ra;	/* keep mean coordinates */
+	tdec = dec;
+
+	/* get sun position */
+	sunpos(mjed, &lsn, &rsn, NULL);
+
+	/* allow for relativistic light bending near the sun.
+	 * (avoid calling deflect() for the sun itself).
+	 */
+	if (!is_planet(op,SUN) && !is_planet(op,MOON))
+	    deflect (mjd, op->s_hlong, op->s_hlat, lsn, rsn, *rho, &ra, &dec);
+
+	/* correct ra/dec to form geocentric apparent */
+	nut_eq (mjd, &ra, &dec);
+	if (!is_planet(op,MOON))
+	    ab_eq (mjd, lsn, &ra, &dec);
+	op->s_gaera = (float)ra;
+	op->s_gaedec = (float)dec;
+
+	/* find parallax correction for equatoreal coords */
+	now_lst (np, &lst);
+	ha_in = hrrad(lst) - ra;
+	rho_topo = *rho * MAU/ERAD;             /* convert to earth radii */
+	ta_par (ha_in, dec, lat, elev, &rho_topo, &ha_out, &dec_out);
+
+	/* transform into alt/az and apply refraction */
+	hadec_aa (lat, ha_out, dec_out, &alt, &az);
+	refract (pressure, temp, alt, &alt);
+	op->s_alt = alt;
+	op->s_az = az;
+
+	/* Get parallax differences and apply to apparent or astrometric place
+	 * as needed.  For the astrometric place, rotating the CORRECTIONS
+	 * back from the nutated equator to the mean equator will be
+	 * neglected.  This is an effect of about 0.1" at moon distance.
+	 * We currently don't have an inverse nutation rotation.
+	 */
+	if (pref_get(PREF_EQUATORIAL) == PREF_GEO) {
+	    /* no topo corrections to eq. coords */
+	    dra = ddec = 0.0;
+	} else {
+	    dra = ha_in - ha_out;	/* ra sign is opposite of ha */
+	    ddec = dec_out - dec;
+	    *rho = rho_topo * ERAD/MAU; /* return topocentric distance in AU */
+	}
+
+	/* fill in ra/dec fields */
+	if (epoch == EOD) {		/* apparent geo/topocentric */
+	    ra = ra + dra;
+	    dec = dec + ddec;
+	} else {			/* astrometric geo/topocent */
+	    ra = tra + dra;
+	    dec = tdec + ddec;
+	    precess (mjd, epoch, &ra, &dec);
+	}
+	range(&ra, 2*PI);
+	op->s_ra = (float)ra;
+	op->s_dec = (float)dec;
+}
+
+/* given geocentric ecliptic longitude and latitude, lam and bet, of some object
+ * and the longitude of the sun, lsn, find the elongation, el. this is the
+ * actual angular separation of the object from the sun, not just the difference
+ * in the longitude. the sign, however, IS set simply as a test on longitude
+ * such that el will be >0 for an evening object <0 for a morning object.
+ * to understand the test for el sign, draw a graph with lam going from 0-2*PI
+ *   down the vertical axis, lsn going from 0-2*PI across the hor axis. then
+ *   define the diagonal regions bounded by the lines lam=lsn+PI, lam=lsn and
+ *   lam=lsn-PI. the "morning" regions are any values to the lower left of the
+ *   first line and bounded within the second pair of lines.
+ * all angles in radians.
+ */
+static void
+elongation (lam, bet, lsn, el)
+double lam, bet, lsn;
+double *el;
+{
+	*el = acos(cos(bet)*cos(lam-lsn));
+	if (lam>lsn+PI || (lam>lsn-PI && lam<lsn)) *el = - *el;
+}
+
+/* apply relativistic light bending correction to ra/dec; stern
+ *
+ * The algorithm is from:
+ * Mean and apparent place computations in the new IAU 
+ * system. III - Apparent, topocentric, and astrometric 
+ * places of planets and stars
+ * KAPLAN, G. H.;  HUGHES, J. A.;  SEIDELMANN, P. K.;
+ * SMITH, C. A.;  YALLOP, B. D.
+ * Astronomical Journal (ISSN 0004-6256), vol. 97, April 1989, p. 1197-1210.
+ *
+ * This article is a very good collection of formulea for geocentric and
+ * topocentric place calculation in general.  The apparent and
+ * astrometric place calculation in this file currently does not follow
+ * the strict algorithm from this paper and hence is not fully correct.
+ * The entire calculation is currently based on the rotating EOD frame and
+ * not the "inertial" J2000 frame.
+ */
+static void
+deflect (mjd1, lpd, psi, lsn, rsn, rho, ra, dec)
+double mjd1;		/* epoch */
+double lpd, psi;	/* heliocentric ecliptical long / lat */
+double rsn, lsn;	/* distance and longitude of sun */
+double rho;		/* geocentric distance */
+double *ra, *dec;	/* geocentric equatoreal */
+{
+	double hra, hdec;	/* object heliocentric equatoreal */
+	double el;		/* HELIOCENTRIC elongation object--earth */
+	double g1, g2;		/* relativistic weights */
+	double u[3];		/* object geocentric cartesian */
+	double q[3];		/* object heliocentric cartesian unit vect */
+	double e[3];		/* earth heliocentric cartesian unit vect */
+	double qe, uq, eu;	/* scalar products */
+	int i;			/* counter */
+
+#define G	1.32712438e20	/* heliocentric grav const; in m^3*s^-2 */
+#define c	299792458.0	/* speed of light in m/s */
+
+	elongation(lpd, psi, lsn-PI, &el);
+	el = fabs(el);
+	/* only continue if object is within about 10 deg around the sun
+	 * and not obscured by the sun's disc (radius 0.25 deg)
+	 *
+	 * precise geocentric deflection is:  g1 * tan(el/2)
+	 *	radially outwards from sun;  the vector munching below
+	 *	just applys this component-wise
+	 *	Note:	el = HELIOCENTRIC elongation.
+	 *		g1 is always about 0.004 arc seconds
+	 *		g2 varies from 0 (highest contribution) to 2
+	 */
+	if (el<degrad(170) || el>degrad(179.75)) return;
+
+	/* get cartesian vectors */
+	sphcart(*ra, *dec, rho, u, u+1, u+2);
+
+	ecl_eq(mjd1, psi, lpd, &hra, &hdec);
+	sphcart(hra, hdec, 1.0, q, q+1, q+2);
+
+	ecl_eq(mjd1, 0.0, lsn-PI, &hra, &hdec);
+	sphcart(hra, hdec, 1.0, e, e+1, e+2);
+
+	/* evaluate scalar products */
+	qe = uq = eu = 0.0;
+	for(i=0; i<=2; ++i) {
+	    qe += q[i]*e[i];
+	    uq += u[i]*q[i];
+	    eu += e[i]*u[i];
+	}
+
+	g1 = 2*G/(c*c*MAU)/rsn;
+	g2 = 1 + qe;
+
+	/* now deflect geocentric vector */
+	g1 /= g2;
+	for(i=0; i<=2; ++i)
+	    u[i] += g1*(uq*e[i] - eu*q[i]);
+	
+	/* back to spherical */
+	cartsph(u[0], u[1], u[2], ra, dec, &rho);	/* rho thrown away */
+}
+
+/* estimate size in arc seconds @ 1AU from absolute magnitude, H, and assuming
+ * an albedo of 0.1. With this assumption an object with diameter of 1500m
+ * has an absolute mag of 18.
+ */
+static double
+h_albsize (H)
+double H;
+{
+	return (3600*raddeg(.707*1500*pow(2.51,(18-H)/2)/MAU));
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: circum.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/circum.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/circum.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/circum.h	(revision 1457)
@@ -0,0 +1,443 @@
+/* the Now and Obj typedefs.
+ * also, a few miscellaneous constants and declarations.
+ */
+#ifndef _CIRCUM_H
+#define _CIRCUM_H
+
+#define	SPD	(24.0*3600.0)	/* seconds per day */
+#define	MAU	(1.4959787e11)	/* m / au */
+#define	LTAU	499.005		/* seconds light takes to travel 1 AU */
+#define	ERAD	(6.37816e6)	/* earth equitorial radius, m */
+#define	MRAD	(1.740e6)	/* moon equitorial radius, m */
+#define	SRAD	(6.95e8)	/* sun equitorial radius, m */
+#define	FTPM	3.28084		/* ft per m */
+#define	ESAT_MAG	2	/* default satellite magnitude */
+#define	FAST_SAT_RPD	0.25	/* max earth sat rev/day considered "fast" */
+
+#define	EOD	(-9786)		/* special epoch flag: use epoch of date */
+
+/* info about the local observing circumstances and misc preferences */
+typedef struct {
+	double n_mjd;	/* modified Julian date, ie, days since
+			 * Jan 0.5 1900 (== 12 noon, Dec 30, 1899), utc.
+			 * enough precision to get well better than 1 second.
+			 * N.B. if not first member, must move NOMJD inits.
+			 */
+	double n_lat;	/* geographic (surface-normal) lat, >0 north, rads */
+	double n_lng;	/* longitude, >0 east, rads */
+	double n_tz;	/* time zone, hrs behind UTC */
+	double n_temp;	/* atmospheric temp, degrees C */
+	double n_pressure; /* atmospheric pressure, mBar */
+	double n_elev;	/* elevation above sea level, earth radii */
+	double n_dip;	/* dip of sun below hzn at twilight, >0 below, rads */
+	double n_epoch;	/* desired precession display epoch as an mjd, or EOD */
+	char n_tznm[8];	/* time zone name; 7 chars or less, always 0 at end */
+} Now;
+
+/* handy shorthands for fields in a Now pointer, np */
+#define mjd	np->n_mjd
+#define lat	np->n_lat
+#define lng	np->n_lng
+#define tz	np->n_tz
+#define temp	np->n_temp
+#define pressure np->n_pressure
+#define elev	np->n_elev
+#define	dip	np->n_dip
+#define epoch	np->n_epoch
+#define tznm	np->n_tznm
+#define mjed	mm_mjed(np)
+
+/* structures to describe objects of various types.
+ */
+
+/* magnitude values in two different systems */
+typedef struct {
+    float m1, m2;	/* either g/k or H/G, depending on... */
+    int whichm;		/* one of MAG_gk or MAG_HG */
+} Mag;
+
+/* whichm */
+#define MAG_HG          0       /* using 0 makes HG the initial default */
+#define MAG_gk          1
+
+/* we actually store magnitudes times this scale factor in a short int */
+#define	MAGSCALE	100.0
+#define	set_smag(op,m)	((op)->s_mag = (short)floor((m)*MAGSCALE + 0.5))
+#define	set_fmag(op,m)	((op)->f_mag = (short)floor((m)*MAGSCALE + 0.5))
+#define	get_mag(op)	((op)->s_mag / MAGSCALE)
+
+/* longest object name, including trailing '\0' */
+#define	MAXNM	14
+
+/* Obj is a massive union.
+ * many fields are in common so we use macros to make things a little easier.
+ */
+
+typedef unsigned char ObjType_t;
+typedef unsigned char ObjAge_t;
+
+/* fields common to *all* structs in the Obj union.
+ */
+#define	OBJ_COMMON_FLDS							\
+    ObjType_t co_type;	/* current object type; see flags, below */	\
+    unsigned char co_flags;/* FUSER*... used by others */		\
+    char co_name[MAXNM];/* name, including \0 */			\
+    float co_ra;	/* geo/topo app/mean ra, rads */		\
+    float co_dec;	/* geo/topo app/mean dec, rads */		\
+    float co_gaera;	/* geo apparent ra, rads */			\
+    float co_gaedec;	/* geo apparent dec, rads */			\
+    double co_az;	/* azimuth, >0 e of n, rads */			\
+    double co_alt;	/* altitude above topocentric horizon, rads */	\
+    float co_elong;	/* angular sep btwen obj and sun, >0 E, degs */	\
+    float co_size;	/* angular size, arc secs */			\
+    short co_mag;	/* visual magnitude * MAGSCALE */		\
+    ObjAge_t co_age	/* update aging code; see db.c */
+
+/* fields common to all solar system objects in the Obj union */
+#define	OBJ_SOLSYS_FLDS							\
+    OBJ_COMMON_FLDS;	/* all the fixed ones plus ... */		\
+    float so_sdist;	/* dist from object to sun, au */		\
+    float so_edist;	/* dist from object to earth, au */		\
+    float so_hlong;	/* heliocentric longitude, rads */		\
+    float so_hlat;	/* heliocentric latitude, rads */		\
+    float so_phase	/* phase, % */
+
+
+/* a generic object */
+typedef struct {
+    OBJ_COMMON_FLDS;
+} ObjAny;
+
+/* a generic sol system object */
+typedef struct {
+    OBJ_SOLSYS_FLDS;
+} ObjSS;
+
+/* basic Fixed object info.
+ */
+typedef unsigned char byte;
+typedef struct {
+    OBJ_COMMON_FLDS;
+    char  fo_class;	/* object class --  see db.c:db_set_field() et al */
+    char  fo_spect[2];	/* spectral codes, if appropriate */
+    byte  fo_ratio;	/* minor/major diameter ratio. use s/get_ratio() */
+    byte  fo_pa;	/* position angle, E of N, rads. use s/get_pa() */
+    float fo_epoch;	/* epoch of f_RA/dec */
+    float fo_ra;	/* ra, rads, at given epoch */
+    float fo_dec;	/* dec, rads, at given epoch */
+} ObjF;
+
+#define	fo_mag	co_mag	/* pseudonym for so_mag since it is not computed */
+#define	fo_size	co_size	/* pseudonym for so_size since it is not computed */
+
+/* macros to pack/unpack some fields */
+#define	SRSCALE		255.0		/* galaxy size ratio scale */
+#define	PASCALE		(255.0/(2*PI))	/* pos angle scale factor */
+#define	get_ratio(op)	((int)(op)->f_ratio/SRSCALE)
+#define	set_ratio(op,maj,min) ((op)->f_ratio = (byte)(((maj) > 0)	    \
+					? ((min)*SRSCALE/(double)(maj)+0.5) \
+					: 0))
+#define	get_pa(op)	((double)(op)->f_pa/PASCALE)
+#define	set_pa(op,s)	((op)->f_pa = (byte)((s)*PASCALE + 0.5))
+
+#define	NCLASSES	128 /* n potential fo_classes -- allow for all ASCII */
+
+/* basic planet object info */
+typedef struct {
+    OBJ_SOLSYS_FLDS;
+    int pl_code;	/* one of the codes in astro.h */
+} ObjPl;
+
+/* basic info about an object in elliptical heliocentric orbit */
+typedef struct {
+    OBJ_SOLSYS_FLDS;
+    float  eo_inc;	/* inclination, degrees */
+    float  eo_Om;	/* longitude of ascending node, degrees */
+    float  eo_om;	/* argument of perihelion, degress */
+    float  eo_a;	/* mean distance, aka,semi-maj axis,AU */
+    float  eo_e;	/* eccentricity */
+    float  eo_M;	/* mean anomaly, ie, degrees from perihelion at cepoch*/
+    float  eo_size;	/* angular size, in arc seconds at 1 AU */
+    double eo_cepoch;	/* epoch date (M reference), as an mjd */
+    double eo_epoch;	/* equinox year (inc/Om/om reference), as an mjd. */
+    Mag    eo_mag;	/* magnitude */
+} ObjE;
+
+/* basic info about an object in hyperbolic heliocentric orbit */
+typedef struct {
+    OBJ_SOLSYS_FLDS;
+    double ho_epoch;	/* equinox year (inc/Om/om reference), as an mjd */
+    double ho_ep;	/* epoch of perihelion, as an mjd */
+    float  ho_inc;	/* inclination, degs */
+    float  ho_Om;	/* longitude of ascending node, degs */
+    float  ho_om;	/* argument of perihelion, degs. */
+    float  ho_e;	/* eccentricity */
+    float  ho_qp;	/* perihelion distance, AU */
+    float  ho_g, ho_k;	/* magnitude model coefficients */
+    float  ho_size;	/* angular size, in arc seconds at 1 AU */
+} ObjH;
+
+/* basic info about an object in parabolic heliocentric orbit */
+typedef struct {
+    OBJ_SOLSYS_FLDS;
+    double po_epoch;	/* reference epoch, as an mjd */
+    double po_ep;	/* epoch of perihelion, as an mjd */
+    float  po_inc;	/* inclination, degs */
+    float  po_qp;	/* perihelion distance, AU */
+    float  po_om;	/* argument of perihelion, degs. */
+    float  po_Om;	/* longitude of ascending node, degs */
+    float  po_g, po_k;	/* magnitude model coefficients */
+    float  po_size;	/* angular size, in arc seconds at 1 AU */
+} ObjP;
+
+/* basic earth satellite object info */
+typedef struct {
+    OBJ_COMMON_FLDS;
+    double eso_epoch;	/* reference epoch, as an mjd */
+    double eso_n;	/* mean motion, rev/day
+			 * N.B. we need double due to a sensitive differencing
+			 * operation used to compute MeanAnomaly in
+			 * esat_main()/satellite.c.
+			 */
+    float  eso_inc;	/* inclination, degs */
+    float  eso_raan;	/* RA of ascending node, degs */
+    float  eso_e;	/* eccentricity */
+    float  eso_ap;	/* argument of perigee at epoch, degs */
+    float  eso_M;	/* mean anomaly, ie, degrees from perigee at epoch */
+    float  eso_decay;	/* orbit decay rate, rev/day^2 */
+    float  eso_drag;	/* object drag coefficient, (earth radii)^-1 */
+    int    eso_orbit;	/* integer orbit number of epoch */
+
+    /* computed "sky" results unique to earth satellites */
+    float  ess_elev;	/* height of satellite above sea level, m */
+    float  ess_range;	/* line-of-site distance from observer to satellite, m*/
+    float  ess_rangev;	/* rate-of-change of range, m/s */
+    float  ess_sublat;	/* latitude below satellite, >0 north, rads */
+    float  ess_sublng;	/* longitude below satellite, >0 east, rads */
+    int    ess_eclipsed;/* 1 if satellite is in earth's shadow, else 0 */
+} ObjES;
+
+typedef union {
+    ObjAny  any;	/* these fields valid for all types */
+    ObjSS   anyss;	/* these fields valid for all solar system types */
+    ObjPl   pl;		/* planet */
+    ObjF    f;		/* fixed object */
+    ObjE    e;		/* object in heliocentric elliptical orbit */
+    ObjH    h;		/* object in heliocentric hyperbolic trajectory */
+    ObjP    p;		/* object in heliocentric parabolic trajectory */
+    ObjES   es;		/* earth satellite */
+} Obj;
+
+
+/* for o_flags -- everybody must agree */
+#define	FUSER0		0x01
+#define	FUSER1		0x02
+#define	FUSER2		0x04
+#define	FUSER3		0x08
+#define	FUSER4		0x10
+#define	FUSER5		0x20
+#define	FUSER6		0x40
+#define	FUSER7		0x80
+
+/* mark an object as being a "field star" */
+#define	FLDSTAR		FUSER3
+
+/* Obj shorthands: */
+#define	o_type	any.co_type
+#define	o_name	any.co_name
+#define	o_flags	any.co_flags
+#define	o_age	any.co_age
+#define	s_ra	any.co_ra
+#define	s_dec	any.co_dec
+#define	s_gaera	any.co_gaera
+#define	s_gaedec any.co_gaedec
+#define	s_az	any.co_az
+#define	s_alt	any.co_alt
+#define	s_elong	any.co_elong
+#define	s_size	any.co_size
+#define	s_mag	any.co_mag
+
+#define	s_sdist	anyss.so_sdist
+#define	s_edist	anyss.so_edist
+#define	s_hlong	anyss.so_hlong
+#define	s_hlat	anyss.so_hlat
+#define	s_phase anyss.so_phase
+
+#define	s_elev		es.ess_elev
+#define	s_range		es.ess_range
+#define	s_rangev	es.ess_rangev
+#define	s_sublat	es.ess_sublat
+#define	s_sublng	es.ess_sublng
+#define	s_eclipsed	es.ess_eclipsed
+
+#define	f_class	f.fo_class
+#define	f_spect	f.fo_spect
+#define	f_ratio	f.fo_ratio
+#define	f_pa	f.fo_pa
+#define	f_epoch	f.fo_epoch
+#define	f_RA	f.fo_ra
+#define	f_dec	f.fo_dec
+#define	f_mag	f.fo_mag
+#define	f_size	f.fo_size
+
+#define	e_cepoch e.eo_cepoch
+#define	e_epoch	e.eo_epoch
+#define	e_inc	e.eo_inc
+#define	e_Om	e.eo_Om
+#define	e_om	e.eo_om
+#define	e_a	e.eo_a
+#define	e_e	e.eo_e
+#define	e_M	e.eo_M
+#define	e_size	e.eo_size
+#define	e_mag	e.eo_mag
+
+#define	h_epoch	h.ho_epoch
+#define	h_ep	h.ho_ep
+#define	h_inc	h.ho_inc
+#define	h_Om	h.ho_Om
+#define	h_om	h.ho_om
+#define	h_e	h.ho_e
+#define	h_qp	h.ho_qp
+#define	h_g	h.ho_g
+#define	h_k	h.ho_k
+#define	h_size	h.ho_size
+
+#define	p_epoch	p.po_epoch
+#define	p_ep	p.po_ep
+#define	p_inc	p.po_inc
+#define	p_qp	p.po_qp
+#define	p_om	p.po_om
+#define	p_Om	p.po_Om
+#define	p_g	p.po_g
+#define	p_k	p.po_k
+#define	p_size	p.po_size
+
+#define	es_epoch	es.eso_epoch
+#define	es_inc		es.eso_inc
+#define	es_raan		es.eso_raan
+#define	es_e		es.eso_e
+#define	es_ap		es.eso_ap
+#define	es_M		es.eso_M
+#define	es_n		es.eso_n
+#define	es_decay	es.eso_decay
+#define	es_drag		es.eso_drag
+#define	es_orbit	es.eso_orbit
+
+/* insure we always refer to the fields and no monkey business */
+#undef OBJ_COMMON_FLDS
+#undef OBJ_SOLSYS_FLDS
+
+/* o_type code.
+ * N.B. names are assigned in order in objmenu.c
+ * N.B. if add one: update the size init in db_init(); switch in obj_cir().
+ * N.B. UNDEFOBJ must be zero so new objects are undefinied by being zeroed.
+ * N.B. maintain the bitmasks too.
+ * N.B. PLANET must be last -- see objmenu.c
+ */
+enum ObjType {
+    UNDEFOBJ=0,
+    FIXED, ELLIPTICAL, HYPERBOLIC, PARABOLIC, EARTHSAT, PLANET,
+    NOBJTYPES
+};
+
+/* types as handy bitmasks too */
+#define	FIXEDM		(1<<FIXED)
+#define	ELLIPTICALM	(1<<ELLIPTICAL)
+#define	HYPERBOLICM	(1<<HYPERBOLIC)
+#define	PARABOLICM	(1<<PARABOLIC)
+#define	EARTHSATM	(1<<EARTHSAT)
+#define	PLANETM		(1<<PLANET)
+#define	ALLM		(FIXEDM | HYPERBOLICM | PARABOLICM | EARTHSATM \
+						      | ELLIPTICALM | PLANETM)
+
+/* define a code for each member in each object type struct.
+ * making them globally unique avoids a nested switch in db_set_field() and
+ * helps with dynamic prompting based on preferences.
+ */
+enum {
+    O_TYPE, O_NAME,
+    F_RA, F_DEC, F_EPOCH, F_MAG, F_SIZE, F_CLASS, F_SPECT,
+    E_INC, E_LAN, E_AOP, E_A, E_N, E_E, E_M, E_CEPOCH, E_EPOCH,E_M1,E_M2,E_SIZE,
+    H_EP, H_INC, H_LAN, H_AOP, H_E, H_QP, H_EPOCH, H_G, H_K, H_SIZE,
+    P_EP, P_INC, P_AOP, P_QP, P_LAN, P_EPOCH, P_G, P_K, P_SIZE,
+    ES_EPOCH,ES_INC,ES_RAAN,ES_E,ES_AP,ES_M,ES_N,ES_DECAY,ES_ORBIT,ES_DRAG
+};
+
+/* rise, set and transit information.
+ */
+typedef struct {
+    int rs_flags;	/* info about what has been computed and any
+			 * special conditions; see flags, below.
+			 */
+    double rs_risetm;	/* mjd time of rise today */
+    double rs_riseaz;	/* azimuth of rise, rads E of N */
+    double rs_trantm;	/* mjd time of transit today */
+    double rs_tranalt;	/* altitude of transit, rads up from horizon */
+    double rs_settm;	/* mjd time of set today */
+    double rs_setaz;	/* azimuth of set, rads E of N */
+} RiseSet;
+
+/* RiseSet flags */
+#define	RS_NORISE	0x0001	/* object does not rise as such today */
+#define	RS_NOSET	0x0002	/* object does not set as such today */
+#define	RS_NOTRANS	0x0004	/* object does not transit as such today */
+#define	RS_CIRCUMPOLAR	0x0010	/* object stays up all day today */
+#define	RS_NEVERUP	0x0020	/* object never up at all today */
+#define	RS_ERROR	0x1000	/* can't figure out anything! */
+#define	RS_RISERR	(0x0100|RS_ERROR) /* error computing rise */
+#define	RS_SETERR	(0x0200|RS_ERROR) /* error computing set */
+#define	RS_TRANSERR	(0x0400|RS_ERROR) /* error computing transit */
+
+#define	is_type(op,m)	((1<<(op)->o_type) & (m))
+#define	is_planet(op,p)	(is_type(op,PLANETM) && ((ObjPl *)op)->pl_code==(p))
+#define	is_ssobj(op)	is_type(op,PLANETM|HYPERBOLICM|PARABOLICM|ELLIPTICALM)
+
+/* used to maintain progress state with db_scanint() and db_scan */
+typedef struct {
+    int m;	/* mask of *N types desired */
+    int t;	/* current Object type, as per ObjType */
+    int n;	/* number of objects "scanned" so far */
+    ObjF *op;	/* local list to also scan */
+    int nop;	/* number in op[] */
+} DBScan;
+
+#endif /* _CIRCUM_H */
+
+
+
+/* Some handy declarations */
+
+/* ap_as.c */
+extern void ap_as P_(( Now *np, double Mjd, double *rap, double *decp));
+extern void as_ap P_(( Now *np, double Mjd, double *rap, double *decp));
+
+/* aux.c */
+extern double mm_mjed P_((Now *np));
+
+/* circum.c */
+extern int obj_cir P_((Now *np, Obj *op));
+
+/* earthsat.c */
+extern int obj_earthsat P_((Now *np, Obj *op));
+
+/* dbfmt.c */
+extern int db_crack_line P_((char s[], Obj *op, char whynot[]));
+extern void db_write_line P_((Obj *op, char *lp));
+extern int get_fields P_((char *s, int delim, char *fields[]));
+extern int db_chk_planet P_((char name[], Obj *op));
+extern int db_tle P_((char *name, char *l1, char *l2, Obj *op));
+
+/* misc.c */
+extern void now_lst P_((Now *np, double *lstp));
+extern void radec2ha P_((Now *np, double ra, double dec, double *hap));
+extern char *obj_description P_((Obj *op));
+extern int is_deepsky P_((Obj *op));
+
+/* riset_cir.c */
+extern void riset_cir P_((Now *np, Obj *op, double dis, RiseSet *rp));
+extern void twilight_cir P_((Now *np, double dis, double *dawn, double *dusk,
+    int *status));
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: circum.h,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/comet.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/comet.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/comet.c	(revision 1457)
@@ -0,0 +1,86 @@
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* given a modified Julian date, mjd, and a set of heliocentric parabolic
+ * orbital elements referred to the epoch of date (mjd):
+ *   ep:   epoch of perihelion,
+ *   inc:  inclination,
+ *   ap:   argument of perihelion (equals the longitude of perihelion minus the
+ *	   longitude of ascending node)
+ *   qp:   perihelion distance,
+ *   om:   longitude of ascending node;
+ * find:
+ *   lpd:  heliocentric longitude, 
+ *   psi:  heliocentric latitude,
+ *   rp:   distance from the sun to the planet, 
+ *   rho:  distance from the Earth to the planet,
+ *   lam:  geocentric ecliptic longitude, 
+ *   bet:  geocentric ecliptic latitude,
+ *         none are corrected for light time, ie, they are the true values for
+ *	   the given instant.
+ *
+ * all angles are in radians, all distances in AU.
+ * mutual perturbation corrections with other solar system objects are not
+ * applied. corrections for nutation and abberation must be made by the caller.
+ * The RA and DEC calculated from the fully-corrected ecliptic coordinates are
+ * then the apparent geocentric coordinates. Further corrections can be made,
+ * if required, for atmospheric refraction and geocentric parallax.
+ */
+void
+comet (mjd, ep, inc, ap, qp, om, lpd, psi, rp, rho, lam, bet)
+double mjd;
+double ep, inc, ap, qp, om;
+double *lpd, *psi, *rp, *rho, *lam, *bet;
+{
+	double w, s, s2;
+	double l, sl, cl, y;
+	double spsi, cpsi;
+	double rd, lsn, rsn;
+	double lg, re, ll;
+	double cll, sll;
+	double nu;
+
+#define	ERRLMT	0.0001
+        w = ((mjd-ep)*3.649116e-02)/(qp*sqrt(qp));
+        s = w/3;
+	for (;;) {
+	    double d;
+	    s2 = s*s;
+	    d = (s2+3)*s-w;
+	    if (fabs(d) <= ERRLMT)
+		break;
+	    s = ((2*s*s2)+w)/(3*(s2+1));
+	}
+
+        nu = 2*atan(s);
+	*rp = qp*(1+s2);
+	l = nu+ap;
+        sl = sin(l);
+	cl = cos(l);
+	spsi = sl*sin(inc);
+        *psi = asin(spsi);
+	y = sl*cos(inc);
+        *lpd = atan(y/cl)+om;
+	cpsi = cos(*psi);
+        if (cl<0) *lpd += PI;
+	range (lpd, 2*PI);
+        rd = *rp * cpsi;
+	sunpos (mjd, &lsn, &rsn, 0);
+	lg = lsn+PI;
+        re = rsn;
+	ll = *lpd - lg;
+        cll = cos(ll);
+	sll = sin(ll);
+        *rho = sqrt((re * re)+(*rp * *rp)-(2*re*rd*cll));
+        if (rd<re) 
+            *lam = atan((-1*rd*sll)/(re-(rd*cll)))+lg+PI;
+	else
+	    *lam = atan((re*sll)/(rd-(re*cll)))+*lpd;
+	range (lam, 2*PI);
+        *bet = atan((rd*spsi*sin(*lam-*lpd))/(cpsi*re*sll));
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: comet.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/dbfmt.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/dbfmt.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/dbfmt.c	(revision 1457)
@@ -0,0 +1,1016 @@
+/* code to convert between .edb format and an Obj */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+
+#if defined(__STDC__)
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+#include "preferences.h"
+
+extern void zero_mem P_((void *loc, unsigned len));
+extern double atod P_((char *buf));
+
+int get_fields P_((char *s, int delim, char *fields[]));
+int db_set_field P_((char bp[], int id, PrefDateFormat pref, Obj *op));
+int db_chk_planet P_((char name[], Obj *op));
+
+#define MAXDBLINE       256     /* longest allowed db line */
+
+#define FLDSEP          ','     /* major field separator */
+#define SUBFLD          '|'     /* subfield separator */
+#define MAXFLDS 20              /* must be more than on any expected line */
+
+#define ASIZ(a) (sizeof(a)/sizeof(a[0]))
+
+static int line_candidate P_((char *buf));
+static void crack_year P_((char *bp, PrefDateFormat pref, double *p));
+static int db_get_field P_((Obj *op, int id, char *bp));
+static int tle_sum P_((char *l));
+static double tle_fld P_((char *l, int from, int thru));
+static double tle_expfld P_((char *l, int start));
+
+/* crack the given .edb database line into op.
+ * if ok
+ *   return 0
+ * else
+ *   if whynot
+ *     if not even a candidate
+ *       set whynot[0] = '\0'
+ *     else
+ *       fill whynot with reason message.
+ *   return -1
+ */
+int
+db_crack_line (s, op, whynot)
+char s[];
+Obj *op;
+char whynot[];
+{
+	char *flds[MAXFLDS];	/* point to each field for easy reference */
+	char *sflds[MAXFLDS];	/* point to each sub field for easy reference */
+	char copy[MAXDBLINE];	/* work copy; leave s untouched */
+	int nf, nsf;		/* number of fields and subfields */
+	int i;
+
+	/* basic initial check */
+	if (line_candidate (s) < 0) {
+	    if (whynot)
+		whynot[0] = '\0';
+	    return (-1);
+	}
+
+	/* do all the parsing on a copy */
+	(void) strcpy (copy, s);
+	i = strlen(copy);
+	if (copy[i-1] == '\n')
+	    copy[i-1] = '\0';
+
+	/* parse into main fields */
+	nf = get_fields (copy, FLDSEP, flds);
+
+	/* need at least 2: name and type */
+	if (nf < 2) {
+	    if (whynot)
+		sprintf (whynot, "Found only %d fields", nf);
+	    return (-1);
+	}
+
+	/* switch out on type of object - the second field */
+	switch (flds[1][0]) {
+	case 'f': {
+	    static int ids[] = {F_RA, F_DEC, F_MAG};
+	    if (nf < 5 || nf > 7) {
+		if (whynot)
+		    sprintf (whynot, "f needs 5-7 fields: %d", nf);
+		return (-1);
+	    }
+	    zero_mem ((void *)op, sizeof(ObjF));
+	    op->o_type = FIXED;
+	    nsf = get_fields(flds[1], SUBFLD, sflds);
+	    if (nsf > 1 && db_set_field (sflds[1], F_CLASS, PREF_MDY, op) < 0) {
+		if (whynot)
+		    sprintf (whynot, "Bad f class: %c", sflds[1][0]);
+		return (-1);
+	    }
+	    if (nsf > 2)
+		(void) db_set_field (sflds[2], F_SPECT, PREF_MDY, op);
+	    for (i = 2; i < ASIZ(ids)+2; i++)
+		(void) db_set_field (flds[i], ids[i-2], PREF_MDY, op);
+	    (void) db_set_field (nf>5 && flds[5][0] ? flds[5] : "2000",
+							F_EPOCH, PREF_MDY, op);
+	    if (nf == 7)
+		(void) db_set_field (flds[6], F_SIZE, PREF_MDY, op);
+	    break;
+	}
+
+	case 'e': {
+	    static int ids[] = {E_INC, E_LAN, E_AOP, E_A, E_N, E_E, E_M,
+						E_CEPOCH, E_EPOCH, E_M1, E_M2
+	    };
+	    if (nf != 13 && nf != 14) {
+		if (whynot)
+		    sprintf (whynot, "e needs 13 or 14 fields: %d", nf);
+		return (-1);
+	    }
+	    zero_mem ((void *)op, sizeof(ObjE));
+	    op->o_type = ELLIPTICAL;
+	    for (i = 2; i < ASIZ(ids)+2; i++)
+		(void) db_set_field (flds[i], ids[i-2], PREF_MDY, op);
+	    if (nf == 14)
+		(void) db_set_field (flds[13], E_SIZE, PREF_MDY, op);
+	    break;
+	}
+
+	case 'h': {
+	    static int ids[]= {H_EP,H_INC,H_LAN,H_AOP,H_E,H_QP,H_EPOCH,H_G,H_K};
+	    if (nf != 11 && nf != 12) {
+		if (whynot)
+		    sprintf (whynot, "h needs 11 or 12 fields: %d", nf);
+		return (-1);
+	    }
+	    zero_mem ((void *)op, sizeof(ObjH));
+	    op->o_type = HYPERBOLIC;
+	    for (i = 2; i < ASIZ(ids)+2; i++)
+		(void) db_set_field (flds[i], ids[i-2], PREF_MDY, op);
+	    if (nf == 12)
+		(void) db_set_field (flds[11], H_SIZE, PREF_MDY, op);
+	    break;
+	}
+
+	case 'p': {
+	    static int ids[] = {P_EP,P_INC,P_AOP,P_QP,P_LAN,P_EPOCH,P_G,P_K};
+	    if (nf != 10 && nf != 11) {
+		if (whynot)
+		    sprintf (whynot, "p needs 10 or 11 fields: %d", nf);
+		return (-1);
+	    }
+	    zero_mem ((void *)op, sizeof(ObjP));
+	    op->o_type = PARABOLIC;
+	    for (i = 2; i < ASIZ(ids)+2; i++)
+		(void) db_set_field (flds[i], ids[i-2], PREF_MDY, op);
+	    if (nf == 11)
+		(void) db_set_field (flds[10], P_SIZE, PREF_MDY, op);
+	    break;
+	}
+
+	case 'E': {
+	    static int ids[] = {ES_EPOCH,ES_INC,ES_RAAN,ES_E,ES_AP,ES_M,ES_N,
+							    ES_DECAY,ES_ORBIT};
+	    if (nf != 11 && nf != 12) {
+		if (whynot)
+		    sprintf (whynot, "E needs 11 or 12 fields: %d", nf);
+		return (-1);
+	    }
+	    zero_mem ((void *)op, sizeof(ObjES));
+	    op->o_type = EARTHSAT;
+	    for (i = 2; i < ASIZ(ids)+2; i++)
+		(void) db_set_field (flds[i], ids[i-2], PREF_MDY, op);
+	    if (nf == 12)
+		(void) db_set_field (flds[11], ES_DRAG, PREF_MDY, op);
+	    break;
+	}
+
+	case 'P':
+	    /* allow, though ignore, anything after the P */
+	    i = db_chk_planet (flds[0], op);	/* does o_name too */
+	    if (i < 0) {
+		if (whynot)
+		    sprintf (whynot, "Bad planet: %s", flds[0]);
+	    }
+	    return (i);
+
+	default:
+	    if (whynot)
+		sprintf (whynot, "Unknown type: %c", flds[1][0]);
+	    return (-1);
+	}
+
+	/* load up o_name */
+	(void) db_set_field (flds[0], O_NAME, PREF_MDY, op);
+
+	return (0);
+}
+
+/* return 0 if TLE checksum is ok, else -1 */
+static int
+tle_sum (l)
+char *l;
+{
+	char *lastl = l + 68;
+	int sum;
+
+	for (sum = 0; l < lastl; ) {
+	    char c = *l++;
+	    if (c == '\0')
+		return (-1);
+	    if (isdigit(c))
+		sum += c - '0';
+	    else if (c == '-')
+		sum++;
+	}
+
+	return (*l - '0' == (sum%10) ? 0 : -1);
+}
+
+/* extract the given columns and return value.
+ * N.B. from and to are 1-based within l
+ */
+static double
+tle_fld (l, from, thru)
+char *l;
+int from, thru;
+{
+	char buf[32];
+
+	sprintf (buf, "%.*s", thru-from+1, l+from-1);
+	return (atod (buf));
+}
+
+/* extract the exponential value starting at the given column.
+ * N.B. start is 1-based within l
+ */
+static double
+tle_expfld (l, start)
+char *l;
+int start;
+{
+	char buf[32];
+	double v;
+
+	sprintf (buf, ".%.*s", 5, l+start);
+	v = atod (buf) * pow (10.0, tle_fld(l, start+6, start+7));
+	if (l[start-1] == '-')
+	    v = -v;
+	return (v);
+}
+
+/* given 3 lines, first of which is name and next 2 are TLE, fill op.
+ * we skip leading whitespace on all lines.
+ * we do /not/ assume the 2 TLE lines are 0 terminated, but we do reach out into
+ *   each as far as 69 chars.
+ * we detect nonconformance as efficiently as possible.
+ * name ends at first '\0', '\r' or '\n'.
+ * if ok return 0 else return -1
+ */
+int
+db_tle (name, l1, l2, op)
+char *name, *l1, *l2;
+Obj *op;
+{
+	double ep;
+	int i;
+
+	/* check for correct line numbers, macthing satellite numbers and
+	 * correct checksums.
+	 */
+	while (isspace(*l1))
+	    l1++;
+	if (*l1 != '1')
+	    return (-1);
+	while (isspace(*l2))
+	    l2++;
+	if (*l2 != '2')
+	    return (-1);
+	if (strncmp (l1+2, l2+2, 5))
+	    return (-1);
+	if (tle_sum (l1) < 0)
+	    return (-1);
+	if (tle_sum (l2) < 0)
+	    return (-1);
+
+	/* assume it's ok from here out */
+
+	/* fresh */
+	zero_mem ((void *)op, sizeof(ObjES));
+	op->o_type = EARTHSAT;
+
+	/* name, sans leading and trailing whitespace */
+	while (isspace(*name))
+	    name++;
+	i = strcspn (name, "\r\n");
+	while (i > 0 && name[i-1] == ' ')
+	    --i;
+	if (i == 0)
+	    return (-1);
+	if (i > MAXNM-1)
+	    i = MAXNM-1;
+	sprintf (op->o_name, "%.*s", i, name);
+
+	/* goodies from "line 1" */
+	op->es_drag = (float) tle_expfld (l1, 54);
+	i = (int) tle_fld (l1, 19, 20);
+	if (i < 57)
+	    i += 100;
+	cal_mjd (1, tle_fld(l1, 21, 32), i+1900, &ep);
+	op->es_epoch = ep;
+
+	/* goodies from "line 2" */
+	op->es_n = tle_fld (l2, 53, 63);
+	op->es_inc = (float)tle_fld (l2, 9, 16);
+	op->es_raan = (float)tle_fld (l2, 18, 25);
+	op->es_e = (float)(tle_fld (l2, 27, 33) * 1e-7);
+	op->es_ap = (float)tle_fld (l2, 35, 42);
+	op->es_M = (float)tle_fld (l2, 44, 51);
+	op->es_orbit = (int)tle_fld (l2, 64, 68);
+
+	/* yes! */
+	return (0);
+}
+
+/* write the given Obj in .edb format to lp[].
+ * we do _not_ include a trailing '\n'.
+ */
+void
+db_write_line (op, lp)
+Obj *op;
+char *lp;
+{
+	int priorpref;
+	int i;
+
+	/* .edb format always uses MDY.
+	 * N.B. must restore old value before returning from here!
+	 */
+	priorpref = pref_set (PREF_DATE_FORMAT, PREF_MDY);
+
+	switch (op->o_type) {
+	case FIXED: {
+	    static int ids[] = {F_CLASS, F_SPECT, F_RA, F_DEC, F_MAG, F_EPOCH,
+		F_SIZE
+	    };
+
+	    sprintf (lp, "%s,f", op->o_name);
+	    lp += strlen(lp);
+	    for (i = 0; i < ASIZ(ids); i++)
+		lp += db_get_field (op, ids[i], lp);
+	    break;
+	    }
+
+	case ELLIPTICAL: {
+	    static int ids[] = {E_INC, E_LAN, E_AOP, E_A, E_N, E_E, E_M,
+					E_CEPOCH, E_EPOCH, E_M1, E_M2, E_SIZE
+	    };
+
+	    sprintf (lp, "%s,e", op->o_name);
+	    lp += strlen(lp);
+	    for (i = 0; i < ASIZ(ids); i++)
+		lp += db_get_field (op, ids[i], lp);
+	    break;
+	    }
+
+	case HYPERBOLIC: {
+	    static int ids[]= {H_EP, H_INC, H_LAN, H_AOP, H_E, H_QP, H_EPOCH,
+		H_G, H_K, H_SIZE
+	    };
+
+	    sprintf (lp, "%s,h", op->o_name);
+	    lp += strlen(lp);
+	    for (i = 0; i < ASIZ(ids); i++)
+		lp += db_get_field (op, ids[i], lp);
+	    break;
+	    }
+
+	case PARABOLIC: {
+	    static int ids[] = {P_EP, P_INC, P_AOP, P_QP, P_LAN, P_EPOCH, P_G,
+		P_K, P_SIZE
+	    };
+
+	    sprintf (lp, "%s,p", op->o_name);
+	    lp += strlen(lp);
+	    for (i = 0; i < ASIZ(ids); i++)
+		lp += db_get_field (op, ids[i], lp);
+	    break;
+	    }
+
+	case EARTHSAT: {
+	    static int ids[] = {ES_EPOCH, ES_INC, ES_RAAN, ES_E, ES_AP, ES_M,
+		ES_N, ES_DECAY,ES_ORBIT,ES_DRAG
+	    };
+
+	    sprintf (lp, "%s,E", op->o_name);
+	    lp += strlen(lp);
+	    for (i = 0; i < ASIZ(ids); i++)
+		lp += db_get_field (op, ids[i], lp);
+	    break;
+	    }
+
+	case PLANET:
+	    sprintf (lp, "%s,P", op->o_name);
+	    lp += strlen(lp);
+	    break;
+
+	default:
+	    printf ("Unknown type for %s: %d\n", op->o_name, op->o_type);
+	    exit(1);
+	}
+
+	/* restore date format preference */
+	(void) pref_set (PREF_DATE_FORMAT, priorpref);
+}
+
+/* given a text buffer and a field id, and a PREF_DATE_FORMAT,
+ *   set the corresponding member in *op.
+ * return 0 if ok, else -1.
+ */
+int
+db_set_field (bp, id, pref, op)
+char bp[];
+int id;
+PrefDateFormat pref;
+Obj *op;
+{
+	double tmp;
+
+	/* include all the enums and in numeric order to give us the best
+	 * possible chance the compiler will implement this as a jump table.
+	 */
+	switch (id) {
+	case O_TYPE:
+	    printf ("db_set_field: called with id==O_TYPE\n");
+	    exit(1);
+	    break;
+	case O_NAME:
+	    (void) strncpy (op->o_name, bp, sizeof(op->o_name)-1);
+	    op->o_name[sizeof(op->o_name)-1] = '\0';
+	    break;
+	case F_RA:
+	    f_scansex (radhr(op->f_RA), bp, &tmp);
+	    op->f_RA = (float) hrrad(tmp);
+	    break;
+	case F_DEC:
+	    f_scansex (raddeg(op->f_dec), bp, &tmp);
+	    op->f_dec = (float) degrad(tmp);
+	    break;
+	case F_EPOCH:
+	    tmp = op->f_epoch;
+	    crack_year (bp, pref, &tmp);
+	    op->f_epoch = (float) tmp;
+	    break;
+	case F_MAG:
+	    set_fmag (op, atod(bp));
+	    break;
+	case F_SIZE:
+	    op->f_size = (float) atod(bp);
+	    {
+		/* optional minor axis and position angle subfields */
+		char *sflds[MAXFLDS];
+		int nsf = get_fields(bp, SUBFLD, sflds);
+
+		if (nsf == 3) {
+		    set_ratio(op, op->s_size, atod(sflds[1]));
+		    set_pa(op,degrad(atod(sflds[2])));
+		} else {
+		    set_ratio(op,1,1);	/* round */
+		    set_pa(op,0.0);
+		}
+	    }
+	    break;
+	case F_CLASS:
+	    switch (bp[0]) {
+	    case 'A': case 'B': case 'C': case 'D': case 'F': case 'G':
+	    case 'H': case 'K': case 'J': case 'L': case 'M': case 'N':
+	    case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T':
+	    case 'U': case 'V':
+		op->f_class = bp[0];
+		break;
+	    default:
+		return (-1);
+	    }
+	    break;
+	case F_SPECT: {
+	    int i, j;
+	    /* fill f_spect all the way */
+	    for (i = j = 0; i < sizeof(op->f_spect); i++)
+		if ((op->f_spect[i] = bp[j]) != 0)
+		    j++;
+	    break;
+	}
+
+	case E_INC:
+	    op->e_inc = (float) atod (bp);
+	    break;
+	case E_LAN:
+	    op->e_Om = (float) atod (bp);
+	    break;
+	case E_AOP:
+	    op->e_om = (float) atod (bp);
+	    break;
+	case E_A:
+	    op->e_a = (float) atod (bp);
+	    break;
+	case E_N:
+	    /* retired */
+	    break;
+	case E_E:
+	    op->e_e = (float) atod (bp);
+	    break;
+	case E_M:
+	    op->e_M = (float) atod (bp);
+	    break;
+	case E_CEPOCH:
+	    crack_year (bp, pref, &op->e_cepoch);
+	    break;
+	case E_EPOCH:
+	    crack_year (bp, pref, &op->e_epoch);
+	    break;
+	case E_M1:
+	    switch (bp[0]) {
+	    case 'g':
+		op->e_mag.whichm = MAG_gk;
+		bp++;
+		break;
+	    case 'H':
+		op->e_mag.whichm = MAG_HG;
+		bp++;
+		break;
+	    default:
+		/* leave type unchanged if no or unrecognized prefix */
+		break;
+	    }
+	    op->e_mag.m1 = (float) atod(bp);
+	    break;
+	case E_M2:
+	    switch (bp[0]) {
+	    case 'k':
+		op->e_mag.whichm = MAG_gk;
+		bp++;
+		break;
+	    case 'G':
+		op->e_mag.whichm = MAG_HG;
+		bp++;
+		break;
+	    default:
+		/* leave type unchanged if no or unrecognized prefix */
+		break;
+	    }
+	    op->e_mag.m2 = (float) atod(bp);
+	    break;
+	case E_SIZE:
+	    op->e_size = (float) atod (bp);
+	    break;
+
+	case H_EP:
+	    crack_year (bp, pref, &op->h_ep);
+	    break;
+	case H_INC:
+	    op->h_inc = (float) atod (bp);
+	    break;
+	case H_LAN:
+	    op->h_Om = (float) atod (bp);
+	    break;
+	case H_AOP:
+	    op->h_om = (float) atod (bp);
+	    break;
+	case H_E:
+	    op->h_e = (float) atod (bp);
+	    break;
+	case H_QP:
+	    op->h_qp = (float) atod (bp);
+	    break;
+	case H_EPOCH:
+	    crack_year (bp, pref, &op->h_epoch);
+	    break;
+	case H_G:
+	    op->h_g = (float) atod (bp);
+	    break;
+	case H_K:
+	    op->h_k = (float) atod (bp);
+	    break;
+	case H_SIZE:
+	    op->h_size = (float) atod (bp);
+	    break;
+
+	case P_EP:
+	    crack_year (bp, pref, &op->p_ep);
+	    break;
+	case P_INC:
+	    op->p_inc = (float) atod (bp);
+	    break;
+	case P_AOP:
+	    op->p_om = (float) atod (bp);
+	    break;
+	case P_QP:
+	    op->p_qp = (float) atod (bp);
+	    break;
+	case P_LAN:
+	    op->p_Om = (float) atod (bp);
+	    break;
+	case P_EPOCH:
+	    crack_year (bp, pref, &op->p_epoch);
+	    break;
+	case P_G:
+	    op->p_g = (float) atod (bp);
+	    break;
+	case P_K:
+	    op->p_k = (float) atod (bp);
+	    break;
+	case P_SIZE:
+	    op->p_size = (float) atod (bp);
+	    break;
+
+	case ES_EPOCH:
+	    crack_year (bp, pref, &op->es_epoch);
+	    break;
+	case ES_INC:
+	    op->es_inc = (float) atod (bp);
+	    break;
+	case ES_RAAN:
+	    op->es_raan = (float) atod (bp);
+	    break;
+	case ES_E:
+	    op->es_e = (float) atod (bp);
+	    break;
+	case ES_AP:
+	    op->es_ap = (float) atod (bp);
+	    break;
+	case ES_M:
+	    op->es_M = (float) atod (bp);
+	    break;
+	case ES_N:
+	    op->es_n = atod (bp);
+	    break;
+	case ES_DECAY:
+	    op->es_decay = (float) atod (bp);
+	    break;
+	case ES_ORBIT:
+	    op->es_orbit = atoi (bp);
+	    break;
+	case ES_DRAG:
+	    op->es_drag = (float) atod (bp);
+	    break;
+
+	default:
+	    printf ("BUG! db_set_field: bad id: %d\n", id);
+	    exit (1);
+	}
+
+	return (0);
+}
+
+/* given a null-terminated string, fill in fields[] with the starting addresses
+ * of each field delimited by delim or '\0'.
+ * N.B. each character matching delim is REPLACED BY '\0' IN PLACE.
+ * N.B. 0-length fields count, so even if *s=='\0' we return 1.
+ * return the number of fields.
+ */
+int
+get_fields (s, delim, fields)
+char *s;
+int delim;
+char *fields[];
+{
+	int n;
+	char c;
+
+	*fields = s;
+	n = 0;
+	do {
+	    c = *s++;
+	    if (c == delim || c == '\0') {
+		s[-1] = '\0';
+		*++fields = s;
+		n++;
+	    }
+	} while (c);
+
+	return (n);
+}
+
+/* check name for being a planet.
+ * if so, fill in *op and return 0, else return -1.
+ */
+int
+db_chk_planet (name, op)
+char name[];
+Obj *op;
+{
+	char namecpy[256];
+	int i;
+
+	/* these must match the order in astro.h */
+	static char *planet_names[] = {
+	    "Mercury", "Venus", "Mars", "Jupiter", "Saturn",
+	    "Uranus", "Neptune", "Pluto", "Sun", "Moon",
+	};
+
+	/* make a copy to match our case -- strcasecmp() not entirely portable*/
+	strcpy (namecpy, name);
+	if (islower(namecpy[0]))
+	    namecpy[0] = toupper(namecpy[0]);
+	for (i = 1; namecpy[i]; i++)
+	    if (isupper(namecpy[i]))
+		namecpy[i] = tolower(namecpy[i]);
+
+	for (i = MERCURY; i <= MOON; i++) {
+	    if (strcmp (namecpy, planet_names[i]) == 0) {
+		zero_mem ((void *)op, sizeof(ObjPl));
+		op->o_type = PLANET;
+		(void) strcpy (op->o_name, planet_names[i]);
+		op->pl.pl_code = i;
+		return (0);
+	    }
+	}
+
+	return (-1);
+}
+
+/* return 0 if buf qualifies as a database line worthy of a cracking
+ * attempt, else -1.
+ */
+static int
+line_candidate (buf)
+char *buf;
+{
+	char c = buf[0];
+
+	return (c == '#' || c == '!' || isspace(c) ? -1 : 0);
+}
+
+/* given either a decimal year (xxxx[.xxx]) or a calendar (x/x/x)
+ * and a DateFormat preference convert it to an mjd and store it at *p.
+ */
+static void
+crack_year (bp, pref, p)
+char *bp;
+PrefDateFormat pref;
+double *p;
+{
+	int m, y;
+	double d;
+
+	mjd_cal (*p, &m, &d, &y);	/* init with current */
+	f_sscandate (bp, pref, &m, &d, &y);
+	cal_mjd (m, d, y, p);
+}
+
+/* given an *op and a field id, add it to the given text buffer bp.
+ * return the number of characters added to bp.
+ */
+static int
+db_get_field (op, id, bp)
+Obj *op;
+int id;
+char *bp;
+{
+	char *bpsave = bp;
+	double tmp;
+
+	/* include all the enums and in numeric order to give us the best
+	 * possible chance the compiler will implement this as a jump table.
+	 */
+	switch (id) {
+	case F_RA:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_sexa (bp, radhr(op->f_RA), 2, 36000);
+	    bp += strlen(bp);
+	    break;
+	case F_DEC:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_sexa (bp, raddeg(op->f_dec), 3, 3600);
+	    bp += strlen(bp);
+	    break;
+	case F_EPOCH:
+	    mjd_year (op->f_epoch, &tmp);
+	    sprintf (bp, ",%.6g", tmp); /* %.7g gives 2000.001 */
+	    bp += strlen(bp);
+	    break;
+	case F_MAG:
+	    sprintf (bp, ",%6.2f", get_mag(op));
+	    bp += strlen(bp);
+	    break;
+	case F_SIZE:
+	    sprintf (bp, ",%.7g", op->f_size);
+	    bp += strlen(bp);
+	    if (op->f_ratio || op->f_pa) {
+		sprintf (bp,"|%g|%g", op->f_size*get_ratio(op),
+							    raddeg(get_pa(op)));
+		bp += strlen(bp);
+	    }
+	    break;
+	case F_CLASS:
+	    if (op->f_class) {
+		sprintf (bp, "|%c", op->f_class);
+		bp += strlen(bp);
+	    }
+	    break;
+	case F_SPECT:
+	    if (op->f_spect[0] != '\0') {
+		sprintf (bp, "|%c", op->f_spect[0]);
+		bp += strlen(bp);
+		if (op->f_spect[1] != '\0') {
+		    sprintf (bp, "%c", op->f_spect[1]);
+		    bp += strlen(bp);
+		}
+	    }
+	    break;
+
+	case E_INC:
+	    sprintf (bp, ",%.7g", op->e_inc);
+	    bp += strlen(bp);
+	    break;
+	case E_LAN:
+	    sprintf (bp, ",%.7g", op->e_Om);
+	    bp += strlen(bp);
+	    break;
+	case E_AOP:
+	    sprintf (bp, ",%.7g", op->e_om);
+	    bp += strlen(bp);
+	    break;
+	case E_A:
+	    sprintf (bp, ",%.7g", op->e_a);
+	    bp += strlen(bp);
+	    break;
+	case E_N:
+	    /* retired */
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    break;
+	case E_E:
+	    sprintf (bp, ",%.7g", op->e_e);
+	    bp += strlen(bp);
+	    break;
+	case E_M:
+	    sprintf (bp, ",%.7g", op->e_M);
+	    bp += strlen(bp);
+	    break;
+	case E_CEPOCH:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->e_cepoch);
+	    bp += strlen(bp);
+	    break;
+	case E_EPOCH:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->e_epoch);
+	    bp += strlen(bp);
+	    break;
+	case E_M1:
+	    if (op->e_mag.whichm == MAG_gk) {
+		sprintf (bp, ",g%.7g", op->e_mag.m1);
+		bp += strlen(bp);
+	    } else if (op->e_mag.whichm == MAG_HG) {
+		sprintf (bp, ",H%.7g", op->e_mag.m1);
+		bp += strlen(bp);
+	    } else {
+		sprintf (bp, ",%.7g", op->e_mag.m1);
+		bp += strlen(bp);
+	    }
+	    break;
+	case E_M2:
+	    sprintf (bp, ",%.7g", op->e_mag.m2);
+	    bp += strlen(bp);
+	    break;
+	case E_SIZE:
+	    sprintf (bp, ",%.7g", op->e_size);
+	    bp += strlen(bp);
+	    break;
+
+	case H_EP:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->h_ep);
+	    bp += strlen(bp);
+	    break;
+	case H_INC:
+	    sprintf (bp, ",%.7g", op->h_inc);
+	    bp += strlen(bp);
+	    break;
+	case H_LAN:
+	    sprintf (bp, ",%.7g", op->h_Om);
+	    bp += strlen(bp);
+	    break;
+	case H_AOP:
+	    sprintf (bp, ",%.7g", op->h_om);
+	    bp += strlen(bp);
+	    break;
+	case H_E:
+	    sprintf (bp, ",%.7g", op->h_e);
+	    bp += strlen(bp);
+	    break;
+	case H_QP:
+	    sprintf (bp, ",%.7g", op->h_qp);
+	    bp += strlen(bp);
+	    break;
+	case H_EPOCH:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->h_epoch);
+	    bp += strlen(bp);
+	    break;
+	case H_G:
+	    sprintf (bp, ",%.7g", op->h_g);
+	    bp += strlen(bp);
+	    break;
+	case H_K:
+	    sprintf (bp, ",%.7g", op->h_k);
+	    bp += strlen(bp);
+	    break;
+	case H_SIZE:
+	    sprintf (bp, ",%.7g", op->h_size);
+	    bp += strlen(bp);
+	    break;
+
+	case P_EP:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->p_ep);
+	    bp += strlen(bp);
+	    break;
+	case P_INC:
+	    sprintf (bp, ",%.7g", op->p_inc);
+	    bp += strlen(bp);
+	    break;
+	case P_AOP:
+	    sprintf (bp, ",%.7g", op->p_om);
+	    bp += strlen(bp);
+	    break;
+	case P_QP:
+	    sprintf (bp, ",%.7g", op->p_qp);
+	    bp += strlen(bp);
+	    break;
+	case P_LAN:
+	    sprintf (bp, ",%.7g", op->p_Om);
+	    bp += strlen(bp);
+	    break;
+	case P_EPOCH:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->p_epoch);
+	    bp += strlen(bp);
+	    break;
+	case P_G:
+	    sprintf (bp, ",%.7g", op->p_g);
+	    bp += strlen(bp);
+	    break;
+	case P_K:
+	    sprintf (bp, ",%.7g", op->p_k);
+	    bp += strlen(bp);
+	    break;
+	case P_SIZE:
+	    sprintf (bp, ",%.7g", op->p_size);
+	    bp += strlen(bp);
+	    break;
+
+	case ES_EPOCH:
+	    sprintf (bp, ",");
+	    bp += strlen(bp);
+	    fs_date (bp, op->es_epoch);
+	    bp += strlen(bp);
+	    break;
+	case ES_INC:
+	    sprintf (bp, ",%.7g", op->es_inc);
+	    bp += strlen(bp);
+	    break;
+	case ES_RAAN:
+	    sprintf (bp, ",%.7g", op->es_raan);
+	    bp += strlen(bp);
+	    break;
+	case ES_E:
+	    sprintf (bp, ",%.7g", op->es_e);
+	    bp += strlen(bp);
+	    break;
+	case ES_AP:
+	    sprintf (bp, ",%.7g", op->es_ap);
+	    bp += strlen(bp);
+	    break;
+	case ES_M:
+	    sprintf (bp, ",%.7g", op->es_M);
+	    bp += strlen(bp);
+	    break;
+	case ES_N:
+	    sprintf (bp, ",%.7g", op->es_n);
+	    bp += strlen(bp);
+	    break;
+	case ES_DECAY:
+	    sprintf (bp, ",%.7g", op->es_decay);
+	    bp += strlen(bp);
+	    break;
+	case ES_ORBIT:
+	    sprintf (bp, ",%d", op->es_orbit);
+	    bp += strlen(bp);
+	    break;
+	case ES_DRAG:
+	    sprintf (bp, ",%.7g", op->es_drag);
+	    bp += strlen(bp);
+	    break;
+
+	default:
+	    printf ("BUG! db_set_field: bad id: %d\n", id);
+	    exit (1);
+	}
+
+	return (bp - bpsave);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: dbfmt.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/deep.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/deep.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/deep.c	(revision 1457)
@@ -0,0 +1,790 @@
+#include <stdlib.h>
+#include <math.h>
+
+#include "deepconst.h"
+#include "satspec.h"
+
+/* *      DEEP SPACE                                         31 OCT 80 */
+/*       SUBROUTINE DEEP */
+/*       COMMON/E1/XMO,XNODEO,OMEGAO,EO,XINCL,XNO,XNDT2O, */
+/*      1           XNDD6O,BSTAR,X,Y,Z,XDOT,YDOT,ZDOT,EPOCH,DS50 */
+/*       COMMON/C1/CK2,CK4,E6A,QOMS2T,S,TOTHRD, */
+/*      1           XJ3,XKE,XKMPER,XMNPDA,AE */
+/*       COMMON/C2/DE2RA,PI,PIO2,TWOPI,X3PIO2 */
+/*       DOUBLE PRECISION EPOCH, DS50 */
+/*       DOUBLE PRECISION */
+/*      *     DAY,PREEP,XNODCE,ATIME,DELT,SAVTSN,STEP2,STEPN,STEPP */
+/*       DATA              ZNS,           C1SS,          ZES/ */
+/*      A                  1.19459E-5,    2.9864797E-6, .01675/ */
+/*       DATA              ZNL,           C1L,           ZEL/ */
+/*      A                  1.5835218E-4,  4.7968065E-7,  .05490/ */
+/*       DATA              ZCOSIS,        ZSINIS,        ZSINGS/ */
+/*      A                  .91744867,     .39785416,     -.98088458/ */
+/*       DATA              ZCOSGS,        ZCOSHS,        ZSINHS/ */
+/*      A                  .1945905,      1.0,           0.0/ */
+/*       DATA Q22,Q31,Q33/1.7891679E-6,2.1460748E-6,2.2123015E-7/ */
+/*       DATA G22,G32/5.7686396,0.95240898/ */
+/*       DATA G44,G52/1.8014998,1.0508330/ */
+/*       DATA G54/4.4108898/ */
+/*       DATA ROOT22,ROOT32/1.7891679E-6,3.7393792E-7/ */
+/*       DATA ROOT44,ROOT52/7.3636953E-9,1.1428639E-7/ */
+/*       DATA ROOT54/2.1765803E-9/ */
+/*       DATA THDT/4.3752691E-3/ */
+
+#define XMO	(sat->elem->se_XMO)
+#define XNODEO	(sat->elem->se_XNODEO)
+#define OMEGAO	(sat->elem->se_OMEGAO)
+#define EO	(sat->elem->se_EO)
+#define XINCL	(sat->elem->se_XINCL)
+#define XNO	(sat->elem->se_XNO)
+#define XNDT20	(sat->elem->se_XNDT20)
+#define XNDD60	(sat->elem->se_XNDD60)
+#define BSTAR	(sat->elem->se_BSTAR)
+#define EPOCH	(sat->elem->se_EPOCH)
+
+#define ZNS	(1.19459E-5)
+#define C1SS	(2.9864797E-6)
+#define ZES	(.01675)
+#define ZNL	(1.5835218E-4)
+#define C1L	(4.7968065E-7)
+#define ZEL	(.05490)
+#define ZCOSIS	(.91744867)
+#define ZSINIS	(.39785416)
+#define ZSINGS	(-.98088458)
+#define ZCOSGS	(.1945905)
+#define ZCOSHS	(1.0)
+#define ZSINHS	(0.0)
+
+#define Q22	(1.7891679E-6)
+#define Q31	(2.1460748E-6)
+#define Q33	(2.2123015E-7)
+#define G22	(5.7686396)
+#define G32	(0.95240898)
+#define G44	(1.8014998)
+#define G52	(1.0508330)
+#define G54	(4.4108898)
+#define ROOT22	(1.7891679E-6)
+#define ROOT32	(3.7393792E-7)
+#define ROOT44	(7.3636953E-9)
+#define ROOT52	(1.1428639E-7)
+#define ROOT54	(2.1765803E-9)
+#define THDT	(4.3752691E-3)
+
+#define IRESFL	(sat->deep->deep_flags.IRESFL)
+#define ISYNFL	(sat->deep->deep_flags.ISYNFL)
+
+#define s_SINIQ	(sat->deep->deep_s_SINIQ)
+#define s_COSIQ	(sat->deep->deep_s_COSIQ)
+#define s_OMGDT	(sat->deep->deep_s_OMGDT)
+#define ATIME	(sat->deep->deep_ATIME)
+#define D2201	(sat->deep->deep_D2201)
+#define D2211	(sat->deep->deep_D2211)
+#define D3210	(sat->deep->deep_D3210)
+#define D3222	(sat->deep->deep_D3222)
+#define D4410	(sat->deep->deep_D4410)
+#define D4422	(sat->deep->deep_D4422)
+#define D5220	(sat->deep->deep_D5220)
+#define D5232	(sat->deep->deep_D5232)
+#define D5421	(sat->deep->deep_D5421)
+#define D5433	(sat->deep->deep_D5433)
+#define DEL1	(sat->deep->deep_DEL1)
+#define DEL2	(sat->deep->deep_DEL2)
+#define DEL3	(sat->deep->deep_DEL3)
+#define E3	(sat->deep->deep_E3)
+#define EE2	(sat->deep->deep_EE2)
+#define FASX2	(sat->deep->deep_FASX2)
+#define FASX4	(sat->deep->deep_FASX4)
+#define FASX6	(sat->deep->deep_FASX6)
+#define OMEGAQ	(sat->deep->deep_OMEGAQ)
+#define PE	(sat->deep->deep_PE)
+#define PINC	(sat->deep->deep_PINC)
+#define PL	(sat->deep->deep_PL)
+#define SAVTSN	(sat->deep->deep_SAVTSN)
+#define SE2	(sat->deep->deep_SE2)
+#define SE3	(sat->deep->deep_SE3)
+#define SGH2	(sat->deep->deep_SGH2)
+#define SGH3	(sat->deep->deep_SGH3)
+#define SGH4	(sat->deep->deep_SGH4)
+#define SGHL	(sat->deep->deep_SGHL)
+#define SGHS	(sat->deep->deep_SGHS)
+#define SH2	(sat->deep->deep_SH2)
+#define SH3	(sat->deep->deep_SH3)
+#define SHS	(sat->deep->deep_SHS)
+#define SHL	(sat->deep->deep_SHL)
+#define SI2	(sat->deep->deep_SI2)
+#define SI3	(sat->deep->deep_SI3)
+#define SL2	(sat->deep->deep_SL2)
+#define SL3	(sat->deep->deep_SL3)
+#define SL4	(sat->deep->deep_SL4)
+#define SSE	(sat->deep->deep_SSE)
+#define SSG	(sat->deep->deep_SSG)
+#define SSH	(sat->deep->deep_SSH)
+#define SSI	(sat->deep->deep_SSI)
+#define SSL	(sat->deep->deep_SSL)
+#define STEP2	(sat->deep->deep_STEP2)
+#define STEPN	(sat->deep->deep_STEPN)
+#define STEPP	(sat->deep->deep_STEPP)
+#define THGR	(sat->deep->deep_THGR)
+#define XFACT	(sat->deep->deep_XFACT)
+#define XGH2	(sat->deep->deep_XGH2)
+#define XGH3	(sat->deep->deep_XGH3)
+#define XGH4	(sat->deep->deep_XGH4)
+#define XH2	(sat->deep->deep_XH2)
+#define XH3	(sat->deep->deep_XH3)
+#define XI2	(sat->deep->deep_XI2)
+#define XI3	(sat->deep->deep_XI3)
+#define XL2	(sat->deep->deep_XL2)
+#define XL3	(sat->deep->deep_XL3)
+#define XL4	(sat->deep->deep_XL4)
+#define XLAMO	(sat->deep->deep_XLAMO)
+#define XLI	(sat->deep->deep_XLI)
+#define XNI	(sat->deep->deep_XNI)
+#define XNQ	(sat->deep->deep_XNQ)
+#define XQNCL	(sat->deep->deep_XQNCL)
+#define ZMOL	(sat->deep->deep_ZMOL)
+#define ZMOS	(sat->deep->deep_ZMOS)
+
+/* *     ENTRANCE FOR DEEP SPACE INITIALIZATION */
+
+/*       ENTRY DPINIT(EQSQ,SINIQ,COSIQ,RTEQSQ,AO,COSQ2,SINOMO,COSOMO, */
+/*      1         BSQ,XLLDOT,OMGDT,XNODOT,XNODP) */
+
+void
+dpinit(SatData *sat, double EQSQ, double SINIQ, double COSIQ,
+	    double RTEQSQ, double AO, double COSQ2, double SINOMO,
+	    double COSOMO, double BSQ, double XLLDOT, double OMGDT,
+	    double XNODOT, double XNODP)
+{
+    double A1, A10, A2, A3, A4, A5, A6, A7, A8, A9, AINV2, AQNV, BFACT,
+	C, CC, COSQ, CTEM, DAY, DS50, EOC, EQ, F220, F221, F311, F321, F322,
+	F330, F441, F442, F522, F523, F542, F543, G200, G201, G211, G300,
+	G310, G322, G410, G422, G520, G521, G532, G533, GAM, PREEP, S1, S2,
+	S3, S4, S5, S6, S7, SE, SGH, SH, SI, SINI2, SINQ, SL, STEM, TEMP,
+	TEMP1, X1, X2, X3, X4, X5, X6, X7, X8, XMAO, XNO2, XNODCE, XNOI,
+	XPIDOT, Z1, Z11, Z12, Z13, Z2, Z21, Z22, Z23, Z3, Z31, Z32, Z33,
+	ZCOSG, ZCOSGL, ZCOSH, ZCOSHL, ZCOSI, ZCOSIL, ZE, ZMO, ZN, ZSING,
+	ZSINGL, ZSINH, ZSINHL, ZSINI, ZSINIL, ZX, ZY;
+
+    int c;
+#if 0
+    A1=A10=A2=A3=A4=A5=A6=A7=A8=A9=AINV2=AQNV=BFACT = signaling_nan();
+    C=CC=COSQ=CTEM=DAY=DS50=EOC=EQ=F220=F221=F311=F321=F322 = signaling_nan();
+    F330=F441=F442=F522=F523=F542=F543=G200=G201=G211=G300 = signaling_nan();
+    G310=G322=G410=G422=G520=G521=G532=G533=GAM=PREEP=S1=S2 = signaling_nan();
+    S3=S4=S5=S6=S7=SE=SGH=SH=SI=SINI2=SINQ=SL=STEM=TEMP = signaling_nan();
+    TEMP1=X1=X2=X3=X4=X5=X6=X7=X8=XMAO=XNO2=XNODCE=XNOI = signaling_nan();
+    XPIDOT=Z1=Z11=Z12=Z13=Z2=Z21=Z22=Z23=Z3=Z31=Z32=Z33 = signaling_nan();
+    ZCOSG=ZCOSGL=ZCOSH=ZCOSHL=ZCOSI=ZCOSIL=ZE=ZMO=ZN=ZSING = signaling_nan();
+    ZSINGL=ZSINH=ZSINHL=ZSINI=ZSINIL=ZX=ZY = signaling_nan();
+#endif
+    if(!sat->deep)
+	sat->deep = (struct deep_data *) malloc(sizeof(struct deep_data));
+    else
+	return;
+
+    /* init_deep(sat->deep); */
+    PREEP = 0.0;
+
+    ZCOSGL = ZCOSHL = ZCOSIL = ZSINGL = ZSINHL = ZSINIL = 0.0;
+
+    /* Save some of the arguments, for use by dpsec() and dpper() */
+    s_SINIQ = SINIQ;
+    s_COSIQ = COSIQ;
+    s_OMGDT = OMGDT;
+
+    THGR = thetag(EPOCH, &DS50);
+
+    EQ = EO;
+    XNQ = XNODP;
+    AQNV = 1.0/AO;
+    XQNCL = XINCL;
+    XMAO = XMO;
+    XPIDOT = OMGDT + XNODOT;
+    SINQ = sin(XNODEO);
+    COSQ = cos(XNODEO);
+    OMEGAQ = OMEGAO;
+
+    /* INITIALIZE LUNAR SOLAR TERMS */
+
+    DAY = DS50 + 18261.5;
+
+    if(DAY != PREEP) {
+	PREEP = DAY;
+	XNODCE = 4.5236020 - 9.2422029E-4 * DAY;
+	STEM = sin(XNODCE);
+	CTEM = cos(XNODCE);
+	ZCOSIL = .91375164 - .03568096 * CTEM;
+	ZSINIL = sqrt(1.0 - ZCOSIL * ZCOSIL);
+	ZSINHL = .089683511 * STEM / ZSINIL;
+	ZCOSHL = sqrt(1.0 - ZSINHL * ZSINHL);
+	C = 4.7199672 + .22997150 * DAY;
+	GAM = 5.8351514 + .0019443680 * DAY;
+	ZMOL = fmod(C-GAM, TWOPI);
+	ZX = .39785416 * STEM / ZSINIL;
+	ZY = ZCOSHL * CTEM + 0.91744867 * ZSINHL * STEM;
+	ZX = actan(ZX, ZY);
+	ZX = GAM + ZX - XNODCE;
+	ZCOSGL = cos(ZX);
+	ZSINGL = sin(ZX);
+	ZMOS = 6.2565837 + .017201977 * DAY;
+	ZMOS = fmod(ZMOS, TWOPI);
+    }
+
+    /* DO SOLAR TERMS */
+
+    SAVTSN = 1.0E20;
+    ZCOSG = ZCOSGS;
+    ZSING = ZSINGS;
+    ZCOSI = ZCOSIS;
+    ZSINI = ZSINIS;
+    ZCOSH = COSQ;
+    ZSINH = SINQ;
+    CC = C1SS;
+    ZN = ZNS;
+    ZE = ZES;
+    ZMO = ZMOS;
+    XNOI = 1.0 / XNQ;
+
+    for(c = 0; c < 2; c++) {
+	A1 = ZCOSG * ZCOSH + ZSING * ZCOSI * ZSINH;
+	A3 = -ZSING * ZCOSH + ZCOSG * ZCOSI * ZSINH;
+	A7 = -ZCOSG * ZSINH + ZSING * ZCOSI * ZCOSH;
+	A8 = ZSING * ZSINI;
+	A9 = ZSING * ZSINH + ZCOSG * ZCOSI * ZCOSH;
+	A10 = ZCOSG * ZSINI;
+	A2 = COSIQ * A7 + SINIQ * A8;
+	A4 = COSIQ * A9 + SINIQ * A10;
+	A5 = - SINIQ * A7 + COSIQ * A8;
+	A6 = - SINIQ * A9 + COSIQ * A10;
+
+	X1 = A1 * COSOMO + A2 * SINOMO;
+	X2 = A3 * COSOMO + A4 * SINOMO;
+	X3 = - A1 * SINOMO + A2 * COSOMO;
+	X4 = - A3 * SINOMO + A4 * COSOMO;
+	X5 = A5 * SINOMO;
+	X6 = A6 * SINOMO;
+	X7 = A5 * COSOMO;
+	X8 = A6 * COSOMO;
+
+	Z31 = 12.0 * X1 * X1 -3.0 * X3 * X3;
+	Z32 = 24.0 * X1 * X2 -6.0 * X3 * X4;
+	Z33 = 12.0 * X2 * X2 -3.0 * X4 * X4;
+	Z1 = 3.0 * (A1 * A1 + A2 * A2) + Z31 * EQSQ;
+	Z2 = 6.0 * (A1 * A3 + A2 * A4) + Z32 * EQSQ;
+	Z3 = 3.0 * (A3 * A3 + A4 * A4) + Z33 * EQSQ;
+	Z11 = -6.0 * A1 * A5 + EQSQ * (-24.0 * X1 * X7 - 6.0 * X3 * X5);
+
+	Z12 = -6.0 * (A1 * A6 + A3 * A5) +
+	    EQSQ * (-24.0 * (X2 * X7 + X1 * X8) - 6.0 * (X3 * X6 + X4 * X5));
+
+	Z13 = -6.0 * A3 * A6 + EQSQ * (-24.0 * X2 * X8 - 6.0 * X4 * X6);
+	Z21 = 6.0 * A2 * A5 + EQSQ * (24.0 * X1 * X5 - 6.0 * X3 * X7);
+
+	Z22 = 6.0 * (A4 * A5 + A2 * A6) +
+	    EQSQ * (24.0 * (X2 * X5 + X1 * X6) - 6.0 * (X4 * X7 + X3 * X8));
+
+	Z23 = 6.0 * A4 * A6 + EQSQ * (24.0 * X2 * X6 - 6.0 * X4 * X8);
+	Z1 = Z1 + Z1 + BSQ * Z31;
+	Z2 = Z2 + Z2 + BSQ * Z32;
+	Z3 = Z3 + Z3 + BSQ * Z33;
+	S3 = CC * XNOI;
+	S2 = -.5 * S3 / RTEQSQ;
+	S4 = S3 * RTEQSQ;
+	S1 = -15.0 * EQ * S4;
+	S5 = X1 * X3 + X2 * X4;
+	S6 = X2 * X3 + X1 * X4;
+	S7 = X2 * X4 - X1 * X3;
+	SE = S1 * ZN * S5;
+	SI = S2 * ZN * (Z11 + Z13);
+	SL = -ZN * S3 * (Z1 + Z3 - 14.0 - 6.0 * EQSQ);
+	SGH = S4 * ZN * (Z31 + Z33 - 6.0);
+	SH = -ZN * S2 * (Z21 + Z23);
+
+	if(XQNCL < 5.2359877E-2)
+	    SH = 0.0;
+
+	EE2 = 2.0 * S1 * S6;
+	E3 = 2.0 * S1 * S7;
+	XI2 = 2.0 * S2 * Z12;
+	XI3 = 2.0 * S2 * (Z13 - Z11);
+	XL2 = -2.0 * S3 * Z2;
+	XL3 = -2.0 * S3 * (Z3 - Z1);
+	XL4 = -2.0 * S3 * (-21.0 - 9.0 * EQSQ) * ZE;
+	XGH2 = 2.0 * S4 * Z32;
+	XGH3 = 2.0 * S4 * (Z33 - Z31);
+	XGH4 = -18.0 * S4 * ZE;
+	XH2 = -2.0 * S2 * Z22;
+	XH3 = -2.0 * S2 * (Z23 - Z21);
+
+	if(c == 0) {
+	    /* DO LUNAR TERMS */
+	    SSE = SE;
+	    SSI = SI;
+	    SSL = SL;
+	    SSH = SH / SINIQ;
+	    SSG = SGH - COSIQ * SSH;
+	    SE2 = EE2;
+	    SI2 = XI2;
+	    SL2 = XL2;
+	    SGH2 = XGH2;
+	    SH2 = XH2;
+	    SE3 = E3;
+	    SI3 = XI3;
+	    SL3 = XL3;
+	    SGH3 = XGH3;
+	    SH3 = XH3;
+	    SL4 = XL4;
+	    SGH4 = XGH4;
+
+	    ZCOSG = ZCOSGL;
+	    ZSING = ZSINGL;
+	    ZCOSI = ZCOSIL;
+	    ZSINI = ZSINIL;
+	    ZCOSH = ZCOSHL * COSQ + ZSINHL * SINQ;
+	    ZSINH = SINQ * ZCOSHL - COSQ * ZSINHL;
+	    ZN = ZNL;
+	    CC = C1L;
+	    ZE = ZEL;
+	    ZMO = ZMOL;
+	}
+    }
+
+    SSE = SSE + SE;
+    SSI = SSI + SI;
+    SSL = SSL + SL;
+    SSG = SSG + SGH - COSIQ / SINIQ * SH;
+    SSH = SSH + SH / SINIQ;
+
+    /* GEOPOTENTIAL RESONANCE INITIALIZATION FOR 12 HOUR ORBITS */
+
+    IRESFL = 0;
+    ISYNFL = 0;
+
+    if(XNQ <= .0034906585 || XNQ >= .0052359877) {
+
+	if(XNQ < (8.26E-3) || XNQ > (9.24E-3))
+	    return;
+
+	if(EQ < 0.5)
+	    return;
+
+	IRESFL = 1;
+	EOC = EQ * EQSQ;
+	G201 = -.306 - (EQ - .64) * .440;
+
+	if(EQ <= (.65)) {
+	    G211 = 3.616 - 13.247 * EQ + 16.290 * EQSQ;
+	    G310 = -19.302 + 117.390 * EQ - 228.419 * EQSQ + 156.591 * EOC;
+	    G322 = -18.9068 + 109.7927 * EQ - 214.6334 * EQSQ + 146.5816 * EOC;
+	    G410 = -41.122 + 242.694 * EQ - 471.094 * EQSQ + 313.953 * EOC;
+	    G422 = -146.407 + 841.880 * EQ - 1629.014 * EQSQ + 1083.435 * EOC;
+	    G520 = -532.114 + 3017.977 * EQ - 5740 * EQSQ + 3708.276 * EOC;
+	} else {
+	    G211 = -72.099 + 331.819 * EQ - 508.738 * EQSQ + 266.724 * EOC;
+	    G310 = -346.844 + 1582.851 * EQ - 2415.925 * EQSQ + 1246.113 * EOC;
+	    G322 = -342.585 + 1554.908 * EQ - 2366.899 * EQSQ + 1215.972 * EOC;
+	    G410 = -1052.797 + 4758.686 * EQ - 7193.992 * EQSQ +
+		3651.957 * EOC;
+	    G422 = -3581.69 + 16178.11 * EQ - 24462.77 * EQSQ + 12422.52 * EOC;
+
+	    if(EQ > (.715))
+		G520 = -5149.66 + 29936.92 * EQ - 54087.36 * EQSQ +
+		    31324.56 * EOC;
+
+	    G520 = 1464.74 - 4664.75 * EQ + 3763.64 * EQSQ;
+	}
+
+	if(EQ < (.7)) {
+	    G533 = -919.2277 + 4988.61 * EQ - 9064.77 * EQSQ + 5542.21 * EOC;
+
+	    G521 = -822.71072 + 4568.6173 * EQ - 8491.4146 * EQSQ +
+		5337.524 * EOC;
+
+	    G532 = -853.666 + 4690.25 * EQ - 8624.77 * EQSQ + 5341.4 * EOC;
+	} else {
+	    G533 = -37995.78 + 161616.52 * EQ - 229838.2 * EQSQ +
+		109377.94 * EOC;
+
+	    G521 = -51752.104 + 218913.95 * EQ - 309468.16 * EQSQ +
+		146349.42 * EOC;
+
+	    G532 = -40023.88 + 170470.89 * EQ - 242699.48 * EQSQ +
+		115605.82 * EOC;
+	}
+
+	SINI2 = SINIQ * SINIQ;
+	F220 = .75 * (1.0 + 2.0 * COSIQ + COSQ2);
+	F221 = 1.5 * SINI2;
+	F321 = 1.875 * SINIQ * (1.0 - 2.0 * COSIQ - 3.0 * COSQ2);
+	F322 = -1.875 * SINIQ * (1.0 + 2.0 * COSIQ - 3.0 * COSQ2);
+	F441 = 35.0 * SINI2 * F220;
+	F442 = 39.3750 * SINI2 * SINI2;
+
+	F522 = 9.84375 * SINIQ * (SINI2 * (1.0 - 2.0 * COSIQ - 5.0 * COSQ2) +
+				  .33333333 * (-2.0 + 4.0 * COSIQ +
+					       6.0 * COSQ2));
+
+	F523 = SINIQ * (4.92187512 * SINI2 * (-2.0 - 4.0 * COSIQ +
+					      10.0 * COSQ2) +
+					      6.56250012 * (1.0 +
+							    2.0 * COSIQ -
+							    3.0 * COSQ2));
+
+	F542 = 29.53125 * SINIQ * (2.0 - 8.0 * COSIQ +
+				   COSQ2 * (-12.0 + 8.0 * COSIQ +
+					    10.0 * COSQ2));
+
+	F543 = 29.53125 * SINIQ * (-2.0 - 8.0 * COSIQ +
+				   COSQ2 * (12.0 + 8.0 * COSIQ -
+					    10.0 * COSQ2));
+
+	XNO2 = XNQ * XNQ;
+	AINV2 = AQNV * AQNV;
+	TEMP1 = 3.0 * XNO2 * AINV2;
+	TEMP = TEMP1 * ROOT22;
+	D2201 = TEMP * F220 * G201;
+	D2211 = TEMP * F221 * G211;
+	TEMP1 = TEMP1 * AQNV;
+	TEMP = TEMP1 * ROOT32;
+	D3210 = TEMP * F321 * G310;
+	D3222 = TEMP * F322 * G322;
+	TEMP1 = TEMP1 * AQNV;
+	TEMP = 2.0 * TEMP1 * ROOT44;
+	D4410 = TEMP * F441 * G410;
+	D4422 = TEMP * F442 * G422;
+	TEMP1 = TEMP1 * AQNV;
+	TEMP = TEMP1 * ROOT52;
+	D5220 = TEMP * F522 * G520;
+	D5232 = TEMP * F523 * G532;
+	TEMP = 2.0 * TEMP1 * ROOT54;
+	D5421 = TEMP * F542* G521;
+	D5433 = TEMP * F543* G533;
+	XLAMO = XMAO + XNODEO + XNODEO - THGR - THGR;
+	BFACT = XLLDOT + XNODOT + XNODOT - THDT - THDT;
+	BFACT = BFACT + SSL + SSH + SSH;
+    } else {
+	/* SYNCHRONOUS RESONANCE TERMS INITIALIZATION */
+
+	IRESFL = 1;
+	ISYNFL = 1;
+	G200 = 1.0 + EQSQ * (-2.5 + .8125 * EQSQ);
+	G310 = 1.0 + 2.0 * EQSQ;
+	G300 = 1.0 + EQSQ * (-6.0 + 6.60937 * EQSQ);
+	F220 = .75 * (1.0 + COSIQ) * (1.0 + COSIQ);
+	F311 = .9375 * SINIQ * SINIQ * (1.0 + 3.0 * COSIQ) -
+	    .75 * (1.0 + COSIQ);
+	F330 = 1.0 + COSIQ;
+	F330 = 1.875 * F330 * F330 * F330;
+	DEL1 = 3.0 * XNQ * XNQ * AQNV * AQNV;
+	DEL2 = 2.0 * DEL1 * F220 * G200 * Q22;
+	DEL3 = 3.0 * DEL1 * F330 * G300 * Q33 * AQNV;
+	DEL1 = DEL1 * F311 * G310 * Q31 * AQNV;
+	FASX2 = .13130908;
+	FASX4 = 2.8843198;
+	FASX6 = .37448087;
+	XLAMO = XMAO + XNODEO + OMEGAO - THGR;
+	BFACT = XLLDOT + XPIDOT - THDT;
+	BFACT = BFACT + SSL + SSG + SSH;
+
+    }
+
+    XFACT = BFACT - XNQ;
+
+    XLI = XLAMO;
+    XNI = XNQ;
+    ATIME = 0.0;
+    STEPP = 720.0;
+    STEPN = -720.0;
+    STEP2 = 259200.0;
+}
+
+/* ENTRANCE FOR DEEP SPACE SECULAR EFFECTS */
+
+void
+dpsec(SatData *sat, double *XLL, double *OMGASM, double *XNODES,
+	   double *EM, double *XINC, double *XN, double T)
+{
+    double DELT, XL, TEMP, XOMI, X2OMI, X2LI, XLDOT;
+    double XNDOT, XNDDT, FT;
+    int state, iret, iretn, done;
+
+    DELT = XLDOT = XNDOT = XNDDT = FT = 0.0;
+    iret = iretn = 0;
+
+#if 0
+    DELT = XL = TEMP = XOMI = X2OMI = X2LI = XLDOT = signaling_nan();
+    XNDOT = XNDDT = FT = signaling_nan();
+#endif
+
+    *XLL = *XLL + SSL * T;
+    *OMGASM = *OMGASM + SSG * T;
+    *XNODES = *XNODES + SSH * T;
+    *EM = EO + SSE * T;
+    *XINC = XINCL + SSI * T;
+
+    if(*XINC < 0.0) {
+	*XINC = -*XINC;
+	*XNODES = *XNODES + PI;
+	*OMGASM = *OMGASM - PI;
+    }
+
+    if(IRESFL == 0)
+	return;
+
+    state = 1;
+    done = 0;
+    while(!done) {
+	/* printf("state = %d\n", state); */
+	switch(state) {
+	case 1:
+	    /*
+	     * Chunk #1
+	     */
+	    if(ATIME == 0.0 || (T >= 0.0 && ATIME < 0.0) ||
+	       (T < 0.0 && ATIME >= 0.0)) {
+		/*
+		 * Chunk #10
+		 */
+		if(T >= 0.0)
+		    DELT = STEPP;
+		else
+		    DELT = STEPN;
+
+		ATIME = 0.0;
+		XNI = XNQ;
+		XLI = XLAMO;
+		state = 4;
+		break;
+	    }
+
+	    /* Fall through */
+	case 2:
+	    /*
+	     * Chunk #2
+	     */
+	    if(fabs(T) < fabs(ATIME)) {
+		/*
+		 * Chunk #2
+		 */
+		if(T >= 0.0)
+		    DELT = STEPN;
+		else
+		    DELT = STEPP;
+
+		iret = 1;
+		state = 8;
+		break;
+	    }
+
+	    /*
+	     * Chunk #3
+	     */
+	    if(T > 0.0)
+		DELT = STEPP;
+	    else
+		DELT = STEPN;
+
+	    /* fall through */
+	case 4:
+	    /*
+	     * Chunk #4
+	     */
+	    if(fabs(T - ATIME) >= STEPP) {
+		iret = 4;
+		state = 8;
+	    } else {
+		/*
+		 * Chunk #5
+		 */
+		FT = T - ATIME;
+		iretn = 6;
+		state = 7;
+	    }
+
+	    break;
+
+	case 6:
+	    /*
+	     * Chunk #6
+	     */
+	    *XN = XNI + XNDOT * FT + XNDDT * FT * FT * 0.5;
+	    XL = XLI + XLDOT * FT + XNDOT * FT * FT * 0.5;
+	    TEMP = -*XNODES + THGR + T * THDT;
+
+	    if(ISYNFL == 0)
+		*XLL = XL + 2.0 * TEMP;
+	    else
+		*XLL = XL - *OMGASM + TEMP;
+
+	    done = 1;
+	    break;
+
+	case 7:
+	    /* DOT TERMS CALCULATED */
+
+	    /*
+	     * Chunk #7
+	     */
+	    if(ISYNFL != 0) {
+		XNDOT =
+		    DEL1 * sin(XLI - FASX2) +
+		    DEL2 * sin(2.0 * (XLI - FASX4)) +
+		    DEL3 * sin(3.0 * (XLI - FASX6));
+
+		XNDDT =
+		    DEL1 * cos(XLI - FASX2) +
+		    2.0 * DEL2 * cos(2.0 * (XLI - FASX4)) +
+		    3.0 * DEL3 * cos(3.0 * (XLI - FASX6));
+	    } else {
+		XOMI = OMEGAQ + s_OMGDT * ATIME;
+		X2OMI = XOMI + XOMI;
+		X2LI = XLI + XLI;
+		XNDOT = D2201 * sin(X2OMI + XLI - G22) +
+		    D2211 * sin(XLI - G22) +
+		    D3210 * sin(XOMI + XLI - G32) +
+		    D3222 * sin(- XOMI + XLI - G32) +
+		    D4410 * sin(X2OMI + X2LI - G44) +
+		    D4422 * sin(X2LI - G44) +
+		    D5220 * sin(XOMI + XLI - G52) +
+		    D5232 * sin(- XOMI + XLI - G52) +
+		    D5421 * sin(XOMI + X2LI - G54) +
+		    D5433 * sin(- XOMI + X2LI - G54);
+
+		XNDDT = D2201 * cos(X2OMI + XLI - G22) +
+		    D2211 * cos(XLI - G22) +
+		    D3210 * cos(XOMI + XLI - G32) +
+		    D3222 * cos(- XOMI + XLI - G32) +
+		    D5220 * cos(XOMI + XLI - G52) +
+		    D5232 * cos(- XOMI + XLI - G52) +
+		    2.*(D4410 * cos(X2OMI + X2LI - G44) +
+			D4422 * cos(X2LI - G44) +
+			D5421 * cos(XOMI + X2LI - G54) +
+			D5433 * cos(- XOMI + X2LI - G54));
+	    }
+
+	    XLDOT = XNI + XFACT;
+	    XNDDT = XNDDT * XLDOT;
+
+	    state = iretn;
+	    break;
+
+	case 8:
+	    /*
+	     * Chunk #8
+	     */
+
+	    /* INTEGRATOR */
+	    iretn = 9;
+	    state = 7;
+	    break;
+
+	case 9:
+	    XLI = XLI + XLDOT * DELT + XNDOT * STEP2;
+	    XNI = XNI + XNDOT * DELT + XNDDT * STEP2;
+	    ATIME = ATIME + DELT;
+
+	    state = iret;
+	    break;
+	}
+    }
+}
+
+/* local */
+
+/* C */
+/* C     ENTRANCES FOR LUNAR-SOLAR PERIODICS */
+/* C */
+/* C */
+/*       ENTRY DPPER(EM,XINC,OMGASM,XNODES,XLL) */
+void
+dpper(SatData *sat, double *EM, double *XINC, double *OMGASM,
+	   double *XNODES, double *XLL, double T)
+{
+    double SINIS, COSIS, ZM, ZF, SINZF, F2, F3, SES, SIS, SLS, SEL, SIL, SLL, PGH, PH, SINOK, COSOK, ALFDP, BETDP, DALF, DBET, XLS, DLS;
+
+#if 0
+    SINIS = COSIS = ZM = ZF = SINZF = F2 = F3 = SES = SIS = signaling_nan();
+    SLS = SEL = SIL = SLL = PGH = signaling_nan();
+    PH = SINOK = COSOK = ALFDP = BETDP = DALF = DBET = XLS = signaling_nan();
+    DLS = signaling_nan();;
+#endif
+    SINIS = sin(*XINC);
+    COSIS = cos(*XINC);
+
+
+/*       IF (DABS(SAVTSN-T).LT.(30.D0))    GO TO 210 */
+    if(fabs(SAVTSN - T) >= (30.0)) {
+	SAVTSN = T;
+	ZM = ZMOS + ZNS * T;
+/*   205 ZF = ZM + 2.0 * ZES * sin(ZM) */
+	ZF = ZM + 2.0 * ZES * sin(ZM);
+	SINZF = sin(ZF);
+	F2 = .5 * SINZF * SINZF - .25;
+	F3 = -.5 * SINZF * cos(ZF);
+	SES = SE2 * F2 + SE3 * F3;
+	SIS = SI2 * F2 + SI3 * F3;
+	SLS = SL2 * F2 + SL3 * F3 + SL4 * SINZF;
+	SGHS = SGH2 * F2 + SGH3 * F3 + SGH4 * SINZF;
+	SHS = SH2 * F2 + SH3 * F3;
+	ZM = ZMOL + ZNL * T;
+	ZF = ZM + 2.0 * ZEL * sin(ZM);
+	SINZF = sin(ZF);
+	F2 = .5 * SINZF * SINZF -.25;
+	F3 = -.5 * SINZF * cos(ZF);
+	SEL = EE2 * F2 + E3 * F3;
+	SIL = XI2 * F2 + XI3 * F3;
+	SLL = XL2 * F2 + XL3 * F3 + XL4 * SINZF;
+	SGHL = XGH2 * F2 + XGH3 * F3 + XGH4 * SINZF;
+	SHL = XH2 * F2 + XH3 * F3;
+	PE = SES + SEL;
+	PINC = SIS + SIL;
+	PL = SLS + SLL;
+    }
+
+/*   210 PGH=SGHS+SGHL */
+    PGH = SGHS + SGHL;
+    PH = SHS + SHL;
+    *XINC = *XINC + PINC;
+    *EM = *EM + PE;
+
+/*       IF(XQNCL.LT.(.2)) GO TO 220 */
+    if(XQNCL >= (.2)) {
+/*       GO TO 218 */
+/* C */
+/* C     APPLY PERIODICS DIRECTLY */
+/* C */
+/*   218 PH=PH/SINIQ */
+	PH = PH / s_SINIQ;
+	PGH = PGH - s_COSIQ * PH;
+	*OMGASM = *OMGASM + PGH;
+	*XNODES = *XNODES + PH;
+	*XLL = *XLL + PL;
+/*       GO TO 230 */
+    } else {
+/* C */
+/* C     APPLY PERIODICS WITH LYDDANE MODIFICATION */
+/* C */
+/*   220 SINOK=sin(XNODES) */
+	SINOK = sin(*XNODES);
+	COSOK = cos(*XNODES);
+	ALFDP = SINIS * SINOK;
+	BETDP = SINIS * COSOK;
+	DALF = PH * COSOK + PINC * COSIS * SINOK;
+	DBET = -PH * SINOK + PINC * COSIS * COSOK;
+	ALFDP = ALFDP + DALF;
+	BETDP = BETDP + DBET;
+	XLS = *XLL + *OMGASM + COSIS * *XNODES;
+	DLS = PL + PGH - PINC * *XNODES * SINIS;
+	XLS = XLS + DLS;
+	*XNODES = actan(ALFDP, BETDP);
+	*XLL = *XLL + PL;
+	*OMGASM = XLS - *XLL - cos(*XINC) * *XNODES;
+    }
+/*   230 CONTINUE */
+/*       RETURN */
+
+}
+/*       END */
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: deep.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/deepconst.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/deepconst.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/deepconst.h	(revision 1457)
@@ -0,0 +1,34 @@
+#ifndef _CONST_H
+#define _CONST_H
+
+/* $Id: deepconst.h,v 1.1.1.1 2001-04-10 14:40:46 cmv Exp $ */
+
+
+#define GE (3.986005E14)
+
+#define PI (3.1415926535897932385)
+
+#define XKE	(7.43669161E-2)
+#define CK2	(5.413080E-4)
+#define CK4	(6.2098875E-7)
+#define E6A	(10E6)
+#define QOMS2T	(1.88027916E-9)
+#define S	(1.01222928)
+#define TOTHRD	(2.0/3.0) /* 6.6666666666666666667E-1 */
+#define XJ3	(-2.53881E-6)
+/* #define XKE	KE */
+#define XKMPER	(6378.135)
+#define XMNPDA	(1440.0)
+#define AE	(1.0)
+#define DE2RA	(1.7453292519943295769E-2)
+#define PIO2	(1.57079632679489661925)	/* PI/2 */
+#define TWOPI	(6.2831853071795864770)
+#define X3PIO2	(4.7123889803846898578)	/* 3*PI/2 */
+
+#define RHO	(0.15696590235)
+
+#endif /* _CONST_H */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: deepconst.h,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/deltat.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/deltat.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/deltat.c	(revision 1457)
@@ -0,0 +1,307 @@
+/* DeltaT = Ephemeris Time - Universal Time
+ *
+ * original code by Stephen Moshier <moshier@world.std.com>,
+ * adapted to xephem by Michael Sternberg <sternberg@physik.tu-chemnitz.de>
+ * smoothed transitions and updated by Neal McBurnett <nealmcb@bell-labs.com>
+ *
+ **********************************************************************
+ *
+ * The tabulated values of deltaT, in hundredths of a second,
+ * were taken from The Astronomical Almanac, page K8.  The program
+ * adjusts for a value of secular tidal acceleration ndot = -25.8
+ * arcsec per century squared, the value used in JPL's DE403 ephemeris.
+ * ELP2000 (and DE200) used the value -23.8946.
+ *
+ * The tabulated range is 1620.0 through 1998.0.  Bessel's interpolation
+ * formula is implemented to obtain fourth order interpolated values at
+ * intermediate times.
+ *
+ * For dates earlier than the tabulated range, the program
+ * calculates approximate formulae of Stephenson and Morrison
+ * or K. M. Borkowski.  These approximations have an estimated
+ * error of 15 minutes at 1500 B.C.  They are not adjusted for small
+ * improvements in the current estimate of ndot because the formulas
+ * were derived from studies of ancient eclipses and other historical
+ * information, whose interpretation depends only partly on ndot.
+ *
+ * For future vaues of deltaT, the function smoothly transitions with
+ * a linear segment back to Stephenson & Morrison's quadratic formula
+ * in 2130.
+ *
+ * Input is mjd (modified julian date from MJD0 on). [stern]
+ *  Note that xephem uses a different epoch for this "mjd" than the
+ *  normal value of JD=240000.5.
+ * See AA page B4.
+ *
+ * Output double deltat(mjd) is ET-UT1 in seconds.
+ *
+ *
+ * References:
+ *
+ * Stephenson, F. R., and L. V. Morrison, "Long-term changes
+ * in the rotation of the Earth: 700 B.C. to A.D. 1980,"
+ * Philosophical Transactions of the Royal Society of London
+ * Series A 313, 47-70 (1984)
+ *
+ * Borkowski, K. M., "ELP2000-85 and the Dynamical Time
+ * - Universal Time relation," Astronomy and Astrophysics
+ * 205, L8-L10 (1988)
+ * Borkowski's formula is derived from eclipses going back to 2137 BC
+ * and uses lunar position based on tidal coefficient of -23.9 arcsec/cy^2.
+ *
+ * Chapront-Touze, Michelle, and Jean Chapront, _Lunar Tables
+ * and Programs from 4000 B.C. to A.D. 8000_, Willmann-Bell 1991
+ * Their table agrees with the one here, but the entries are
+ * rounded to the nearest whole second.
+ *
+ * Stephenson, F. R., and M. A. Houlden, _Atlas of Historical
+ * Eclipse Maps_, Cambridge U. Press (1986)
+ *
+ * from obsolete extrapolation code [stern]:
+ * Morrison, L. V. and F. R. Stephenson, "Sun and Planetary System"
+ * vol 96,73 eds. W. Fricke, G. Teleki, Reidel, Dordrecht (1982)
+ *
+ **********************************************************************
+ *
+ * changes by stern:
+ *   - adopted #include's for xephem
+ *   - made dt[] static
+ *   - made mjd the time argument [was: year Y].
+ *   - updated observed and extrapolated data from tables at
+ *	ftp://maia.usno.navy.mil/ser7/ -- data deviated by up to 0.8 s
+ *   - removed references to "extern double dtgiven"
+ *   - removed DEMO #define and its references
+ *   - replaced treatment after TABEND by linear extrapolation instead
+ *	of second order version
+ *   - installed lastmjd cache (made ans static)
+ *
+ *   - no changes to table interpolation scheme and past extrapolations */
+
+#include "P_.h"
+#include "astro.h"
+
+#define TABSTART 1620.0
+#define TABEND 2006.0
+#define TABSIZ 387
+
+/* Note, Stephenson and Morrison's table starts at the year 1630.
+ * The Chapronts' table does not agree with the Almanac prior to 1630.
+ * The actual accuracy decreases rapidly prior to 1780.
+ */
+static short dt[TABSIZ] = {
+    /* 1620.0 thru 1659.0 */
+    12400, 11900, 11500, 11000, 10600, 10200, 9800, 9500, 9100, 8800,
+    8500, 8200, 7900, 7700, 7400, 7200, 7000, 6700, 6500, 6300,
+    6200, 6000, 5800, 5700, 5500, 5400, 5300, 5100, 5000, 4900,
+    4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3800,
+    /* 1660.0 thru 1699.0 */
+    3700, 3600, 3500, 3400, 3300, 3200, 3100, 3000, 2800, 2700,
+    2600, 2500, 2400, 2300, 2200, 2100, 2000, 1900, 1800, 1700,
+    1600, 1500, 1400, 1400, 1300, 1200, 1200, 1100, 1100, 1000,
+    1000, 1000, 900, 900, 900, 900, 900, 900, 900, 900,
+    /* 1700.0 thru 1739.0 */
+    900, 900, 900, 900, 900, 900, 900, 900, 1000, 1000,
+    1000, 1000, 1000, 1000, 1000, 1000, 1000, 1100, 1100, 1100,
+    1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100,
+    1100, 1100, 1100, 1100, 1200, 1200, 1200, 1200, 1200, 1200,
+    /* 1740.0 thru 1779.0 */
+    1200, 1200, 1200, 1200, 1300, 1300, 1300, 1300, 1300, 1300,
+    1300, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1500, 1500,
+    1500, 1500, 1500, 1500, 1500, 1600, 1600, 1600, 1600, 1600,
+    1600, 1600, 1600, 1600, 1600, 1700, 1700, 1700, 1700, 1700,
+    /* 1780.0 thru 1799.0 */
+    1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700, 1700,
+    1700, 1700, 1600, 1600, 1600, 1600, 1500, 1500, 1400, 1400,
+    /* 1800.0 thru 1819.0 */
+    1370, 1340, 1310, 1290, 1270, 1260, 1250, 1250, 1250, 1250,
+    1250, 1250, 1250, 1250, 1250, 1250, 1250, 1240, 1230, 1220,
+    /* 1820.0 thru 1859.0 */
+    1200, 1170, 1140, 1110, 1060, 1020, 960, 910, 860, 800,
+    750, 700, 660, 630, 600, 580, 570, 560, 560, 560,
+    570, 580, 590, 610, 620, 630, 650, 660, 680, 690,
+    710, 720, 730, 740, 750, 760, 770, 770, 780, 780,
+    /* 1860.0 thru 1899.0 */
+    788, 782, 754, 697, 640, 602, 541, 410, 292, 182,
+    161, 10, -102, -128, -269, -324, -364, -454, -471, -511,
+    -540, -542, -520, -546, -546, -579, -563, -564, -580, -566,
+    -587, -601, -619, -664, -644, -647, -609, -576, -466, -374,
+    /* 1900.0 thru 1939.0 */
+    -272, -154, -2, 124, 264, 386, 537, 614, 775, 913,
+    1046, 1153, 1336, 1465, 1601, 1720, 1824, 1906, 2025, 2095,
+    2116, 2225, 2241, 2303, 2349, 2362, 2386, 2449, 2434, 2408,
+    2402, 2400, 2387, 2395, 2386, 2393, 2373, 2392, 2396, 2402,
+    /* 1940.0 thru 1979.0 */
+     2433, 2483, 2530, 2570, 2624, 2677, 2728, 2778, 2825, 2871,
+     2915, 2957, 2997, 3036, 3072, 3107, 3135, 3168, 3218, 3268,
+     3315, 3359, 3400, 3447, 3503, 3573, 3654, 3743, 3829, 3920,
+     4018, 4117, 4223, 4337, 4449, 4548, 4646, 4752, 4853, 4959,
+    /* 1980.0 thru 1995.0 */
+     5054, 5138, 5217, 5296, 5379, 5434, 5487, 5532, 5582, 5630,
+     5686, 5757, 5831, 5912, 5998, 6078,
+    /* new USNO data (stern) */
+     6163, 6230,
+    /* 1999 USNO data 1998.0 thru 2000.0 (McBurnett) */
+     6297, 6347, 6383, 
+    /* 1999 extrapolation (McBurnett), 2001.0 thru 2006.0
+       Ramp up to 1.6 s/yr to transition smoothly to Stevenson formula
+       in 2130.0 */
+     6440, 6510, 6600, 6750, 6900, 7060
+
+    /* original 1997 USNO extrapolation (stern), 1998.0 thru 2004.0
+     6296, 6420,
+     6510, 6600, 6700, 6800, 6900   */ /* 7000, 7100, 7200, 7300, 7400, */
+
+    /* Extrapolated values (USNO) (original Moshier) [1996.0 thru 2005.0]
+     6183, 6280, 6377, 6475,
+     6572, 6667, 6765, 6861, 6957
+     */
+};
+
+/* calculate  DeltaT = ET - UT1 in seconds.  Describes the irregularities
+ * of the Earth rotation rate in the ET time scale.
+ */
+double deltat(mjd)
+double mjd;
+{
+	double Y;
+	double p, B;
+	int d[6];
+	int i, iy, k;
+	double floor();
+	static double ans;
+	static double lastmjd = -10000;
+
+	if (mjd == lastmjd) {
+	    return(ans);
+	}
+	lastmjd = mjd;
+
+	Y = 2000.0 + (mjd - J2000)/365.25;
+
+	if( Y > TABEND  &&  Y < 2130.0 ) {
+	    /* linear interpolation from table end; stern */
+	    B = Y - TABEND;
+	    ans = dt[TABSIZ-1] + B * (dt[TABSIZ-1]  - dt[TABSIZ-2]);
+	    ans *= 0.01;
+	    return(ans);
+	}
+
+	if( Y < TABSTART  ||  Y >= 2130.0 ) {
+	    if( (Y >= 948.0 - 15.0  &&  Y < TABSTART) ||  Y >= 2130.0 ) {
+		/* Stephenson and Morrison, stated domain is 948 to 1600:
+		 * 25.5(centuries from 1800)^2 - 1.9159(centuries from 1955)^2
+		 * Here we offset by -15 y to minimize the discontinuity,
+		 * thus we use it from 933.0 to 1620.0,
+		 * and from the end of the table to 2130.0.
+		 * f(1620.0) = 60.955200, slope -0.079 s/y
+		 * f(2004.0) = 105.649728, slope 1.02 s/y
+		 * f(2048.0) = 155.176, slope 1.23 s/y
+		 * f(2084.0) = 202.49, slope 1.4 s/y
+		 * f(2130.0) = 272, slope .1616
+	         * f(2150.0) = 305, slope .17
+		 */
+		B = 0.01*(Y - 2000.0);
+		ans = (23.58 * B + 100.3)*B + 101.6;
+	    } else {
+		/* Borkowski */
+	        /* f(2004.0) = 542.7435, slope 2.65 s/y */
+		B = 0.01*(Y - 2000.0)  +  3.75;
+		ans = 35.0 * B * B  +  40.;
+	    }
+	    return(ans);
+	}
+
+	/* Besselian interpolation from tabulated values.
+	 * See AA page K11.
+	 */
+
+	/* value for 1620.1 is 121.96 or so, not 124.0 */
+
+	/* Index into the table.
+	 */
+	p = floor(Y);
+	iy = (int)(p - TABSTART);
+	/* Zeroth order estimate is value at start of year
+	 */
+	ans = dt[iy];
+	k = iy + 1;
+	if( k >= TABSIZ )
+	    goto done; /* No data, can't go on. */
+
+	/* The fraction of tabulation interval
+	 */
+	p = Y - p;
+
+	/* First order interpolated value
+	 */
+	ans += p*(dt[k] - dt[iy]);
+	if( (iy-1 < 0) || (iy+2 >= TABSIZ) )
+	    goto done; /* can't do second differences */
+
+	/* Make table of first differences
+	 */
+	k = iy - 2;
+	for( i=0; i<5; i++ ) {
+	    if( (k < 0) || (k+1 >= TABSIZ) )
+		d[i] = 0;
+	    else d[i] = dt[k+1] - dt[k];
+		k += 1;
+	}
+
+	/* Compute second differences
+	 */
+	for( i=0; i<4; i++ )
+	    d[i] = d[i+1] - d[i];
+	B = 0.25*p*(p-1.0);
+	ans += B*(d[1] + d[2]);
+	if( iy+2 >= TABSIZ )
+	    goto done;
+
+	/* Compute third differences
+	 */
+	for( i=0; i<3; i++ )
+	    d[i] = d[i+1] - d[i];
+	B = 2.0*B/3.0;
+	ans += (p-0.5)*B*d[1];
+	if( (iy-2 < 0) || (iy+3 > TABSIZ) )
+	    goto done;
+
+	/* Compute fourth differences
+	 */
+	for( i=0; i<2; i++ )
+	    d[i] = d[i+1] - d[i];
+	B = 0.125*B*(p+1.0)*(p-2.0);
+	ans += B*(d[0] + d[1]);
+
+	done:
+	/* Astronomical Almanac table is corrected by adding the expression
+	 *     -0.000091 (ndot + 26)(year-1955)^2  seconds
+	 * to entries prior to 1955 (AA page K8), where ndot is the secular
+	 * tidal term in the mean motion of the Moon.
+	 *
+	 * Entries after 1955 are referred to atomic time standards and
+	 * are not affected by errors in Lunar or planetary theory.
+	 */
+	ans *= 0.01;
+	if( Y < 1955.0 ) {
+	    B = (Y - 1955.0);
+	    ans += -0.000091 * (-25.8 + 26.0) * B * B;
+	}
+	return( ans );
+}
+
+
+#ifdef TEST_DT
+main()
+{
+	double ans, y;
+
+	while (scanf("%lf", &y) == 1) {
+		ans = deltat((y - 2000.0)*365.25 + J2000);
+		printf("%.4lf %.4lf\n", y, ans);
+	}
+}
+#endif
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: deltat.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/earthsat.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/earthsat.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/earthsat.c	(revision 1457)
@@ -0,0 +1,799 @@
+/* this file contains routines to support Earth satellites.
+ *
+ * Orbit propagation is based on the NORAD SGP4/SDP4 code, as converted from
+ *   the original FORTRAN to C by Magnus Backstrom. The paper "Spacetrack
+ *   Report Number 3: Models for Propagation of NORAD Element Sets" describes
+ *   the calculations.
+ *   See http://www.celestrak.com/NORAD/documentation/spacetrk.pdf.
+ *
+ * A few topocentric routines are also used from the 'orbit' program which is
+ *   Copyright (c) 1986,1987,1988,1989,1990 Robert W. Berger N3EMO
+ *
+ */
+
+/* define this to use orbit's propagator
+#define USE_ORBIT_PROPAGATOR
+ */
+
+/* define this to print some stuff
+#define ESAT_TRACE
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+#if defined(__STDC__)
+#include <stdlib.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+#include "preferences.h"
+
+#include "vector.h"
+#include "sattypes.h"
+#include "satlib.h"
+
+
+#define ESAT_MAG        2       /* fake satellite magnitude */
+
+typedef double MAT3x3[3][3];
+
+static void esat_prop P_((Now *np, Obj *op, double *SatX, double *SatY, double
+    *SatZ, double *SatVX, double *SatVY, double *SatVZ));
+static void GetSatelliteParams P_((Obj *op));
+static void GetSiteParams P_((Now *np));
+static double Kepler P_((double MeanAnomaly, double Eccentricity));
+static void GetSubSatPoint P_((double SatX, double SatY, double SatZ,
+    double T, double *Latitude, double *Longitude, double *Height));
+static void GetSatPosition P_((double EpochTime, double EpochRAAN,
+    double EpochArgPerigee, double SemiMajorAxis, double Inclination,
+    double Eccentricity, double RAANPrecession, double PerigeePrecession,
+    double T, double TrueAnomaly, double *X, double *Y, double *Z,
+    double *Radius, double *VX, double *VY, double *VZ));
+static void GetSitPosition P_((double SiteLat, double SiteLong,
+    double SiteElevation, double CrntTime, double *SiteX, double *SiteY,
+    double *SiteZ, double *SiteVX, double *SiteVY, MAT3x3 SiteMatrix));
+static void GetRange P_((double SiteX, double SiteY, double SiteZ,
+    double SiteVX, double SiteVY, double SatX, double SatY, double SatZ,
+    double SatVX, double SatVY, double SatVZ, double *Range,
+    double *RangeRate));
+static void GetTopocentric P_((double SatX, double SatY, double SatZ,
+    double SiteX, double SiteY, double SiteZ, MAT3x3 SiteMatrix, double *X,
+    double *Y, double *Z));
+static void GetBearings P_((double SatX, double SatY, double SatZ,
+    double SiteX, double SiteY, double SiteZ, MAT3x3 SiteMatrix,
+    double *Azimuth, double *Elevation));
+static int Eclipsed P_((double SatX, double SatY, double SatZ,
+    double SatRadius, double CrntTime));
+static void InitOrbitRoutines P_((double EpochDay, int AtEod));
+
+#ifdef USE_ORBIT_PROPAGATOR 
+static void GetPrecession P_((double SemiMajorAxis, double Eccentricity,
+    double Inclination, double *RAANPrecession, double *PerigeePrecession));
+#endif /* USE_ORBIT_PROPAGATOR */
+
+/* stuff from orbit */
+/* char VersionStr[] = "N3EMO Orbit Simulator  v3.9"; */
+
+#ifdef PI2
+#undef PI2
+#endif
+
+#define PI2 (PI*2)
+
+#define MinutesPerDay (24*60.0)
+#define SecondsPerDay (60*MinutesPerDay)
+#define HalfSecond (0.5/SecondsPerDay)
+#define EarthRadius 6378.16             /* Kilometers           */
+#define C 2.997925e5                    /* Kilometers/Second    */
+#define RadiansPerDegree (PI/180)
+#define ABS(x) ((x) < 0 ? (-(x)) : (x))
+#define SQR(x) ((x)*(x))
+ 
+#define EarthFlat (1/298.25)            /* Earth Flattening Coeff. */
+#define SiderealSolar 1.0027379093
+#define SidRate (PI2*SiderealSolar/SecondsPerDay)	/* radians/second */
+#define GM 398600			/* Kilometers^3/seconds^2 */
+ 
+#define Epsilon (RadiansPerDegree/3600)     /* 1 arc second */
+#define SunRadius 695000		
+#define SunSemiMajorAxis  149598845.0  	    /* Kilometers 		   */
+ 
+/*  Keplerian Elements and misc. data for the satellite              */
+static double  EpochDay;                   /* time of epoch                 */
+static double EpochMeanAnomaly;            /* Mean Anomaly at epoch         */
+static long EpochOrbitNum;                 /* Integer orbit # of epoch      */
+static double EpochRAAN;                   /* RAAN at epoch                 */
+static double epochMeanMotion;             /* Revolutions/day               */
+static double OrbitalDecay;                /* Revolutions/day^2             */
+static double EpochArgPerigee;             /* argument of perigee at epoch  */
+static double Eccentricity;
+static double Inclination;
+ 
+/* Site Parameters */
+static double SiteLat,SiteLong,SiteAltitude;
+
+
+static double SidDay,SidReference;	/* Date and sidereal time	*/
+
+/* Keplerian elements for the sun */
+static double SunEpochTime,SunInclination,SunRAAN,SunEccentricity,
+       SunArgPerigee,SunMeanAnomaly,SunMeanMotion;
+
+/* values for shadow geometry */
+static double SinPenumbra,CosPenumbra;
+
+
+/* given a Now and an Obj with info about an earth satellite in the es_* fields
+ * fill in the s_* sky fields describing the satellite.
+ * as usual, we compute the geocentric ra/dec precessed to np->n_epoch and
+ * compute topocentric altitude accounting for refraction.
+ * return 0 if all ok, else -1.
+ */
+int
+obj_earthsat (np, op)
+Now *np;
+Obj *op;
+{
+	double Radius;              /* From geocenter                  */
+	double SatX,SatY,SatZ;	    /* In Right Ascension based system */
+	double SatVX,SatVY,SatVZ;   /* Kilometers/second	       */
+	double SiteX,SiteY,SiteZ;
+	double SiteVX,SiteVY;
+	double SiteMatrix[3][3];
+	double Height;
+	double SSPLat,SSPLong;
+	double Azimuth,Elevation,Range;
+	double RangeRate;
+	double dtmp;
+	double CrntTime;
+	double ra, dec;
+
+#ifdef ESAT_TRACE
+	printf ("\n");
+	printf ("Name = %s\n", op->o_name);
+	printf ("current jd = %13.5f\n", mjd+MJD0);
+	printf ("current mjd = %g\n", mjd);
+	printf ("satellite jd = %13.5f\n", op->es_epoch+MJD0);
+	printf ("satellite mjd = %g\n", op->es_epoch);
+#endif /* ESAT_TRACE */
+
+	/* xephem uses noon 12/31/1899 as 0; orbit uses midnight 1/1/1900.
+	 * thus, xephem runs 12 hours, or 1/2 day, behind of what orbit wants.
+	 */
+	CrntTime = mjd + 0.5;
+
+	/* extract the XEphem data forms into those used by orbit.
+	 * (we still use some functions and names from orbit, thank you).
+	 */
+	InitOrbitRoutines(CrntTime, 1);
+	GetSatelliteParams(op);
+	GetSiteParams(np);
+
+	/* propagate to np->n_mjd */
+	esat_prop (np, op, &SatX, &SatY, &SatZ, &SatVX, &SatVY, &SatVZ);
+	Radius = sqrt (SatX*SatX + SatY*SatY + SatZ*SatZ);
+
+	/* find geocentric EOD equatorial directly from xyz vector */
+	dtmp = atan2 (SatY, SatX);
+	range (&dtmp, 2*PI);
+	op->s_gaera = (float) dtmp;
+	op->s_gaedec = (float) atan2 (SatZ, sqrt(SatX*SatX + SatY*SatY));
+
+	/* find topocentric from site location */
+	GetSitPosition(SiteLat,SiteLong,SiteAltitude,CrntTime,
+		    &SiteX,&SiteY,&SiteZ,&SiteVX,&SiteVY,SiteMatrix);
+	GetBearings(SatX,SatY,SatZ,SiteX,SiteY,SiteZ,SiteMatrix,
+		    &Azimuth,&Elevation);
+
+	op->s_az = Azimuth;
+	refract (pressure, temp, Elevation, &dtmp);
+	op->s_alt = dtmp;
+
+	/* Range: line-of-site distance to satellite, m
+	 * RangeRate: m/s
+	 */
+	GetRange(SiteX,SiteY,SiteZ,SiteVX,SiteVY,
+	    SatX,SatY,SatZ,SatVX,SatVY,SatVZ,&Range,&RangeRate);
+
+	op->s_range = (float)(Range*1000);	/* we want m */
+	op->s_rangev = (float)(RangeRate*1000);	/* we want m/s */
+ 
+	/* SSPLat: sub-satellite latitude, rads 
+	 * SSPLong: sub-satellite longitude, >0 west, rads 
+	 * Height: height of satellite above ground, m
+	 */
+	GetSubSatPoint(SatX,SatY,SatZ,CrntTime,
+	    &SSPLat,&SSPLong,&Height);
+
+	op->s_elev = (float)(Height*1000);	/* we want m */
+	op->s_sublat = (float)SSPLat;
+	op->s_sublng = (float)(-SSPLong);	/* we want +E */
+
+	op->s_eclipsed = Eclipsed(SatX,SatY,SatZ,Radius,CrntTime);
+
+#ifdef ESAT_TRACE
+	printf ("CrntTime = %g\n", CrntTime);
+	printf ("SatX = %g\n", SatX);
+	printf ("SatY = %g\n", SatY);
+	printf ("SatZ = %g\n", SatZ);
+	printf ("Radius = %g\n", Radius);
+	printf ("SatVX = %g\n", SatVX);
+	printf ("SatVY = %g\n", SatVY);
+	printf ("SatVZ = %g\n", SatVZ);
+	printf ("SiteX = %g\n", SiteX);
+	printf ("SiteY = %g\n", SiteY);
+	printf ("SiteZ = %g\n", SiteZ);
+	printf ("SiteVX = %g\n", SiteVX);
+	printf ("SiteVY = %g\n", SiteVY);
+	printf ("Height = %g\n", Height);
+	printf ("SSPLat = %g\n", SSPLat);
+	printf ("SSPLong = %g\n", SSPLong);
+	printf ("Azimuth = %g\n", Azimuth);
+	printf ("Elevation = %g\n", Elevation);
+	printf ("Range = %g\n", Range);
+	printf ("RangeRate = %g\n", RangeRate);
+	fflush (stdout);
+#endif	/* ESAT_TRACE */
+
+	/* find s_ra/dec, depending on current options. */
+	if (pref_get(PREF_EQUATORIAL) == PREF_TOPO) {
+	    double ha, lst;
+	    aa_hadec (lat, (double)op->s_alt, (double)op->s_az, &ha, &dec);
+	    now_lst (np, &lst);
+	    ra = hrrad(lst) - ha;
+	    range (&ra, 2*PI);
+	} else {
+	    ra = op->s_gaera;
+	    dec = op->s_gaedec;
+	}
+	if (epoch != EOD)
+	    precess (mjd, epoch, &ra, &dec);
+	op->s_ra = (float)ra;
+	op->s_dec = (float)dec;
+
+	/* just make up a size and brightness */
+	set_smag (op, ESAT_MAG);
+	op->s_size = (float)0;
+
+	return (0);
+}
+
+/* find position and velocity vector for given Obj at the given time.
+ * set USE_ORBIT_PROPAGATOR depending on desired propagator to use.
+ */
+static void
+esat_prop (np, op, SatX, SatY, SatZ, SatVX, SatVY, SatVZ)
+Now *np;
+Obj *op;
+double *SatX,*SatY,*SatZ;
+double *SatVX,*SatVY,*SatVZ;
+{
+#ifdef USE_ORBIT_PROPAGATOR
+	double ReferenceOrbit;      /* Floating point orbit # at epoch */
+	double CurrentOrbit;
+	long OrbitNum;
+	double RAANPrecession,PerigeePrecession;
+	double MeanAnomaly,TrueAnomaly;
+	double SemiMajorAxis;
+	double AverageMotion,       /* Corrected for drag              */
+	    CurrentMotion;
+	double Radius;
+	double CrntTime;
+
+	SemiMajorAxis = 331.25 * exp(2*log(MinutesPerDay/epochMeanMotion)/3);
+	GetPrecession(SemiMajorAxis,Eccentricity,Inclination,&RAANPrecession,
+			    &PerigeePrecession);
+
+	ReferenceOrbit = EpochMeanAnomaly/PI2 + EpochOrbitNum;
+     
+	CrntTime = mjd + 0.5;
+	AverageMotion = epochMeanMotion + (CrntTime-EpochDay)*OrbitalDecay/2;
+	CurrentMotion = epochMeanMotion + (CrntTime-EpochDay)*OrbitalDecay;
+
+	SemiMajorAxis = 331.25 * exp(2*log(MinutesPerDay/CurrentMotion)/3);
+     
+	CurrentOrbit = ReferenceOrbit + (CrntTime-EpochDay)*AverageMotion;
+
+	OrbitNum = CurrentOrbit;
+     
+	MeanAnomaly = (CurrentOrbit-OrbitNum)*PI2;
+     
+	TrueAnomaly = Kepler(MeanAnomaly,Eccentricity);
+
+	GetSatPosition(EpochDay,EpochRAAN,EpochArgPerigee,SemiMajorAxis,
+		Inclination,Eccentricity,RAANPrecession,PerigeePrecession,
+		CrntTime,TrueAnomaly,SatX,SatY,SatZ,&Radius,SatVX,SatVY,SatVZ);
+
+#ifdef ESAT_TRACE
+	printf ("O Radius = %g\n", Radius);
+	printf ("ReferenceOrbit = %g\n", ReferenceOrbit);
+	printf ("CurrentOrbit = %g\n", CurrentOrbit);
+	printf ("RAANPrecession = %g\n", RAANPrecession);
+	printf ("PerigeePrecession = %g\n", PerigeePrecession);
+	printf ("MeanAnomaly = %g\n", MeanAnomaly);
+	printf ("TrueAnomaly = %g\n", TrueAnomaly);
+	printf ("SemiMajorAxis = %g\n", SemiMajorAxis);
+	printf ("AverageMotion = %g\n", AverageMotion);
+	printf ("CurrentMotion = %g\n", CurrentMotion);
+#endif	/* ESAT_TRACE */
+
+#else	/* ! USE_ORBIT_PROPAGATOR */
+#define	MPD		1440.0		/* minutes per day */
+
+	SatElem se;
+	SatData sd;
+	Vec3 posvec, velvec;
+	double dy;
+	double dt;
+	int yr;
+
+	/* init */
+	memset ((void *)&se, 0, sizeof(se));
+	memset ((void *)&sd, 0, sizeof(sd));
+	sd.elem = &se;
+
+	/* se_EPOCH is packed as yr*1000 + dy, where yr is years since 1900
+	 * and dy is day of year, Jan 1 being 1
+	 */
+	mjd_dayno (op->es_epoch, &yr, &dy);
+	yr -= 1900;
+	dy += 1;
+	se.se_EPOCH = yr*1000 + dy;
+
+	/* others carry over with some change in units */
+	se.se_XNO = op->es_n * (2*PI/MPD);	/* revs/day to rads/min */
+	se.se_XINCL = (float)degrad(op->es_inc);
+	se.se_XNODEO = (float)degrad(op->es_raan);
+	se.se_EO = op->es_e;
+	se.se_OMEGAO = (float)degrad(op->es_ap);
+	se.se_XMO = (float)degrad(op->es_M);
+	se.se_BSTAR = op->es_drag;
+	se.se_XNDT20 = op->es_decay*(2*PI/MPD/MPD); /*rv/dy^^2 to rad/min^^2*/
+
+	se.se_id.orbit = op->es_orbit;
+
+	dt = (mjd-op->es_epoch)*MPD;
+
+#ifdef ESAT_TRACE
+	printf ("se_EPOCH  : %30.20f\n", se.se_EPOCH);
+	printf ("se_XNO    : %30.20f\n", se.se_XNO);
+	printf ("se_XINCL  : %30.20f\n", se.se_XINCL);
+	printf ("se_XNODEO : %30.20f\n", se.se_XNODEO);
+	printf ("se_EO     : %30.20f\n", se.se_EO);
+	printf ("se_OMEGAO : %30.20f\n", se.se_OMEGAO);
+	printf ("se_XMO    : %30.20f\n", se.se_XMO);
+	printf ("se_BSTAR  : %30.20f\n", se.se_BSTAR);
+	printf ("se_XNDT20 : %30.20f\n", se.se_XNDT20);
+	printf ("se_orbit  : %30d\n",    se.se_id.orbit);
+	printf ("dt        : %30.20f\n", dt);
+#endif /* ESAT_TRACE */
+
+	/* compute the state vectors */
+	if (se.se_XNO >= (1.0/225.0))
+	    sgp4(&sd, &posvec, &velvec, dt); /* NEO */
+	else
+	    sdp4(&sd, &posvec, &velvec, dt); /* GEO */
+	if (sd.prop.sgp4)
+	    free (sd.prop.sgp4);	/* sd.prop.sdp4 is in same union */
+	if (sd.deep)
+	    free (sd.deep);
+
+	*SatX = ERAD*posvec.x/1000;	/* earth radii to km */
+	*SatY = ERAD*posvec.y/1000;
+	*SatZ = ERAD*posvec.z/1000;
+	*SatVX = 100*velvec.x;		/* ?? */
+	*SatVY = 100*velvec.y;
+	*SatVZ = 100*velvec.z;
+#endif
+}
+
+
+/* grab the xephem stuff from op and copy into orbit's globals.
+ */
+static void
+GetSatelliteParams(op)
+Obj *op;
+{
+	/* the following are for the orbit functions */
+	/* xephem uses noon 12/31/1899 as 0; orbit uses midnight 1/1/1900 as 1.
+	 * thus, xephem runs 12 hours, or 1/2 day, behind of what orbit wants.
+	 */
+	EpochDay = op->es_epoch + 0.5;
+
+	/* xephem stores inc in degrees; orbit wants rads */
+	Inclination = degrad(op->es_inc);
+
+	/* xephem stores RAAN in degrees; orbit wants rads */
+	EpochRAAN = degrad(op->es_raan);
+
+	Eccentricity = op->es_e;
+
+	/* xephem stores arg of perigee in degrees; orbit wants rads */
+	EpochArgPerigee = degrad(op->es_ap);
+
+	/* xephem stores mean anomaly in degrees; orbit wants rads */
+	EpochMeanAnomaly = degrad (op->es_M);
+
+	epochMeanMotion = op->es_n;
+
+	OrbitalDecay = op->es_decay;
+
+	EpochOrbitNum = op->es_orbit;
+}
+
+
+ 
+static void
+GetSiteParams(np)
+Now *np;
+{
+	SiteLat = lat;
+     
+	/* xephem stores longitude as >0 east; orbit wants >0 west */
+	SiteLong = 2.0*PI - lng;
+     
+	/* what orbit calls altitude xephem calls elevation and stores it from
+	 * sea level in earth radii; orbit wants km
+	 */
+	SiteAltitude = elev*ERAD/1000.0;
+     
+	/* we don't implement a minimum horizon altitude cutoff
+	SiteMinElev = 0;
+	 */
+
+#ifdef ESAT_TRACE
+	printf ("SiteLat = %g\n", SiteLat);
+	printf ("SiteLong = %g\n", SiteLong);
+	printf ("SiteAltitude = %g\n", SiteAltitude);
+	fflush (stdout);
+#endif
+}
+
+ 
+/* Solve Kepler's equation                                      */
+/* Inputs:                                                      */
+/*      MeanAnomaly     Time Since last perigee, in radians.    */
+/*                      PI2 = one complete orbit.               */
+/*      Eccentricity    Eccentricity of orbit's ellipse.        */
+/* Output:                                                      */
+/*      TrueAnomaly     Angle between perigee, geocenter, and   */
+/*                      current position.                       */
+ 
+static
+double Kepler(MeanAnomaly,Eccentricity)
+register double MeanAnomaly,Eccentricity;
+ 
+{
+register double E;              /* Eccentric Anomaly                    */
+register double Error;
+register double TrueAnomaly;
+ 
+    E = MeanAnomaly ;/*+ Eccentricity*sin(MeanAnomaly);  -- Initial guess */
+    do
+        {
+        Error = (E - Eccentricity*sin(E) - MeanAnomaly)
+                / (1 - Eccentricity*cos(E));
+        E -= Error;
+        }
+   while (ABS(Error) >= Epsilon);
+
+    if (ABS(E-PI) < Epsilon)
+        TrueAnomaly = PI;
+      else
+        TrueAnomaly = 2*atan(sqrt((1+Eccentricity)/(1-Eccentricity))
+                                *tan(E/2));
+    if (TrueAnomaly < 0)
+        TrueAnomaly += PI2;
+ 
+    return TrueAnomaly;
+}
+ 
+static void
+GetSubSatPoint(SatX,SatY,SatZ,T,Latitude,Longitude,Height)
+double SatX,SatY,SatZ,T;
+double *Latitude,*Longitude,*Height;
+{
+    double r;
+    /* ECD: long i; */
+
+    r = sqrt(SQR(SatX) + SQR(SatY) + SQR(SatZ));
+
+    *Longitude = PI2*((T-SidDay)*SiderealSolar + SidReference)
+		    - atan2(SatY,SatX);
+
+    /* ECD:
+     * want Longitude in range -PI to PI , +W
+     */
+    range (Longitude, 2*PI);
+    if (*Longitude > PI)
+	*Longitude -= 2*PI;
+
+    *Latitude = atan(SatZ/sqrt(SQR(SatX) + SQR(SatY)));
+
+#if SSPELLIPSE
+#else
+    *Height = r - EarthRadius;
+#endif
+}
+ 
+ 
+#ifdef USE_ORBIT_PROPAGATOR
+static void
+GetPrecession(SemiMajorAxis,Eccentricity,Inclination,
+        RAANPrecession,PerigeePrecession)
+double SemiMajorAxis,Eccentricity,Inclination;
+double *RAANPrecession,*PerigeePrecession;
+{
+  *RAANPrecession = 9.95*pow(EarthRadius/SemiMajorAxis,3.5) * cos(Inclination)
+                 / SQR(1-SQR(Eccentricity)) * RadiansPerDegree;
+ 
+  *PerigeePrecession = 4.97*pow(EarthRadius/SemiMajorAxis,3.5)
+         * (5*SQR(cos(Inclination))-1)
+                 / SQR(1-SQR(Eccentricity)) * RadiansPerDegree;
+}
+#endif /* USE_ORBIT_PROPAGATOR */
+ 
+/* Compute the satellite postion and velocity in the RA based coordinate
+ * system.
+ * ECD: take care not to let Radius get below EarthRadius.
+ */
+
+static void
+GetSatPosition(EpochTime,EpochRAAN,EpochArgPerigee,SemiMajorAxis,
+	Inclination,Eccentricity,RAANPrecession,PerigeePrecession,
+	T,TrueAnomaly,X,Y,Z,Radius,VX,VY,VZ)
+ 
+double EpochTime,EpochRAAN,EpochArgPerigee;
+double SemiMajorAxis,Inclination,Eccentricity;
+double RAANPrecession,PerigeePrecession,T, TrueAnomaly;
+double *X,*Y,*Z,*Radius,*VX,*VY,*VZ;
+
+{
+    double RAAN,ArgPerigee;
+ 
+
+    double Xw,Yw,VXw,VYw;	/* In orbital plane */
+    double Tmp;
+    double Px,Qx,Py,Qy,Pz,Qz;	/* Escobal transformation 31 */
+    double CosArgPerigee,SinArgPerigee;
+    double CosRAAN,SinRAAN,CoSinclination,SinInclination;
+
+    *Radius = SemiMajorAxis*(1-SQR(Eccentricity))
+                        / (1+Eccentricity*cos(TrueAnomaly));
+
+    if (*Radius <= EarthRadius)
+	*Radius = EarthRadius;
+
+
+    Xw = *Radius * cos(TrueAnomaly);
+    Yw = *Radius * sin(TrueAnomaly);
+    
+    Tmp = sqrt(GM/(SemiMajorAxis*(1-SQR(Eccentricity))));
+
+    VXw = -Tmp*sin(TrueAnomaly);
+    VYw = Tmp*(cos(TrueAnomaly) + Eccentricity);
+
+    ArgPerigee = EpochArgPerigee + (T-EpochTime)*PerigeePrecession;
+    RAAN = EpochRAAN - (T-EpochTime)*RAANPrecession;
+
+    CosRAAN = cos(RAAN); SinRAAN = sin(RAAN);
+    CosArgPerigee = cos(ArgPerigee); SinArgPerigee = sin(ArgPerigee);
+    CoSinclination = cos(Inclination); SinInclination = sin(Inclination);
+    
+    Px = CosArgPerigee*CosRAAN - SinArgPerigee*SinRAAN*CoSinclination;
+    Py = CosArgPerigee*SinRAAN + SinArgPerigee*CosRAAN*CoSinclination;
+    Pz = SinArgPerigee*SinInclination;
+    Qx = -SinArgPerigee*CosRAAN - CosArgPerigee*SinRAAN*CoSinclination;
+    Qy = -SinArgPerigee*SinRAAN + CosArgPerigee*CosRAAN*CoSinclination;
+    Qz = CosArgPerigee*SinInclination;
+
+    *X = Px*Xw + Qx*Yw;		/* Escobal, transformation #31 */
+    *Y = Py*Xw + Qy*Yw;
+    *Z = Pz*Xw + Qz*Yw;
+
+    *VX = Px*VXw + Qx*VYw;
+    *VY = Py*VXw + Qy*VYw;
+    *VZ = Pz*VXw + Qz*VYw;
+}
+
+/* Compute the site postion and velocity in the RA based coordinate
+   system. SiteMatrix is set to a matrix which is used by GetTopoCentric
+   to convert geocentric coordinates to topocentric (observer-centered)
+    coordinates. */
+
+static void
+GetSitPosition(SiteLat,SiteLong,SiteElevation,CrntTime,
+             SiteX,SiteY,SiteZ,SiteVX,SiteVY,SiteMatrix)
+
+double SiteLat,SiteLong,SiteElevation,CrntTime;
+double *SiteX,*SiteY,*SiteZ,*SiteVX,*SiteVY;
+MAT3x3 SiteMatrix;
+
+{
+    static double G1,G2; /* Used to correct for flattening of the Earth */
+    static double CosLat,SinLat;
+    static double OldSiteLat = -100000;  /* Used to avoid unneccesary recomputation */
+    static double OldSiteElevation = -100000;
+    double Lat;
+    double SiteRA;	/* Right Ascension of site			*/
+    double CosRA,SinRA;
+
+    if ((SiteLat != OldSiteLat) || (SiteElevation != OldSiteElevation))
+	{
+	OldSiteLat = SiteLat;
+	OldSiteElevation = SiteElevation;
+	Lat = atan(1/(1-SQR(EarthFlat))*tan(SiteLat));
+
+	CosLat = cos(Lat);
+	SinLat = sin(Lat);
+
+	G1 = EarthRadius/(sqrt(1-(2*EarthFlat-SQR(EarthFlat))*SQR(SinLat)));
+	G2 = G1*SQR(1-EarthFlat);
+	G1 += SiteElevation;
+	G2 += SiteElevation;
+	}
+
+
+    SiteRA = PI2*((CrntTime-SidDay)*SiderealSolar + SidReference)
+	         - SiteLong;
+    CosRA = cos(SiteRA);
+    SinRA = sin(SiteRA);
+    
+
+    *SiteX = G1*CosLat*CosRA;
+    *SiteY = G1*CosLat*SinRA;
+    *SiteZ = G2*SinLat;
+    *SiteVX = -SidRate * *SiteY;
+    *SiteVY = SidRate * *SiteX;
+
+    SiteMatrix[0][0] = SinLat*CosRA;
+    SiteMatrix[0][1] = SinLat*SinRA;
+    SiteMatrix[0][2] = -CosLat;
+    SiteMatrix[1][0] = -SinRA;
+    SiteMatrix[1][1] = CosRA;
+    SiteMatrix[1][2] = 0.0;
+    SiteMatrix[2][0] = CosRA*CosLat;
+    SiteMatrix[2][1] = SinRA*CosLat;
+    SiteMatrix[2][2] = SinLat;
+}
+
+static void
+GetRange(SiteX,SiteY,SiteZ,SiteVX,SiteVY,
+	SatX,SatY,SatZ,SatVX,SatVY,SatVZ,Range,RangeRate)
+
+double SiteX,SiteY,SiteZ,SiteVX,SiteVY;
+double SatX,SatY,SatZ,SatVX,SatVY,SatVZ;
+double *Range,*RangeRate;
+{
+    double DX,DY,DZ;
+
+    DX = SatX - SiteX; DY = SatY - SiteY; DZ = SatZ - SiteZ;
+
+    *Range = sqrt(SQR(DX)+SQR(DY)+SQR(DZ));    
+
+    *RangeRate = ((SatVX-SiteVX)*DX + (SatVY-SiteVY)*DY + SatVZ*DZ)
+			/ *Range;
+}
+
+/* Convert from geocentric RA based coordinates to topocentric
+   (observer centered) coordinates */
+
+static void
+GetTopocentric(SatX,SatY,SatZ,SiteX,SiteY,SiteZ,SiteMatrix,X,Y,Z)
+double SatX,SatY,SatZ,SiteX,SiteY,SiteZ;
+double *X,*Y,*Z;
+MAT3x3 SiteMatrix;
+{
+    SatX -= SiteX;
+    SatY -= SiteY;
+    SatZ -= SiteZ;
+
+    *X = SiteMatrix[0][0]*SatX + SiteMatrix[0][1]*SatY
+	+ SiteMatrix[0][2]*SatZ; 
+    *Y = SiteMatrix[1][0]*SatX + SiteMatrix[1][1]*SatY
+	+ SiteMatrix[1][2]*SatZ; 
+    *Z = SiteMatrix[2][0]*SatX + SiteMatrix[2][1]*SatY
+	+ SiteMatrix[2][2]*SatZ; 
+}
+
+static void
+GetBearings(SatX,SatY,SatZ,SiteX,SiteY,SiteZ,SiteMatrix,Azimuth,Elevation)
+double SatX,SatY,SatZ,SiteX,SiteY,SiteZ;
+MAT3x3 SiteMatrix;
+double *Azimuth,*Elevation;
+{
+    double x,y,z;
+
+    GetTopocentric(SatX,SatY,SatZ,SiteX,SiteY,SiteZ,SiteMatrix,&x,&y,&z);
+
+    *Elevation = atan(z/sqrt(SQR(x) + SQR(y)));
+
+    *Azimuth = PI - atan2(y,x);
+
+    if (*Azimuth < 0)
+	*Azimuth += PI;
+}
+
+static int
+Eclipsed(SatX,SatY,SatZ,SatRadius,CrntTime)
+double SatX,SatY,SatZ,SatRadius,CrntTime;
+{
+    double MeanAnomaly,TrueAnomaly;
+    double SunX,SunY,SunZ,SunRad;
+    double vx,vy,vz;
+    double CosTheta;
+
+    MeanAnomaly = SunMeanAnomaly+ (CrntTime-SunEpochTime)*SunMeanMotion*PI2;
+    TrueAnomaly = Kepler(MeanAnomaly,SunEccentricity);
+
+    GetSatPosition(SunEpochTime,SunRAAN,SunArgPerigee,SunSemiMajorAxis,
+		SunInclination,SunEccentricity,0.0,0.0,CrntTime,
+		TrueAnomaly,&SunX,&SunY,&SunZ,&SunRad,&vx,&vy,&vz);
+
+    CosTheta = (SunX*SatX + SunY*SatY + SunZ*SatZ)/(SunRad*SatRadius)
+		 *CosPenumbra + (SatRadius/EarthRadius)*SinPenumbra;
+
+    if (CosTheta < 0)
+        if (CosTheta < -sqrt(SQR(SatRadius)-SQR(EarthRadius))/SatRadius
+	    		*CosPenumbra + (SatRadius/EarthRadius)*SinPenumbra)
+	  
+	    return 1;
+    return 0;
+}
+
+/* Initialize the Sun's keplerian elements for a given epoch.
+   Formulas are from "Explanatory Supplement to the Astronomical Ephemeris".
+   Also init the sidereal reference				*/
+
+static void
+InitOrbitRoutines(EpochDay, AtEod)
+double EpochDay;
+int AtEod;
+{
+    double T,T2,T3,Omega;
+    int n;
+    double SunTrueAnomaly,SunDistance;
+
+    T = (floor(EpochDay)-0.5)/36525;
+    T2 = T*T;
+    T3 = T2*T;
+
+    SidDay = floor(EpochDay);
+
+    SidReference = (6.6460656 + 2400.051262*T + 0.00002581*T2)/24;
+    SidReference -= floor(SidReference);
+
+    /* Omega is used to correct for the nutation and the abberation */
+    Omega = AtEod ? (259.18 - 1934.142*T) * RadiansPerDegree : 0.0;
+    n = (int)(Omega / PI2);
+    Omega -= n*PI2;
+
+    SunEpochTime = EpochDay;
+    SunRAAN = 0;
+
+    SunInclination = (23.452294 - 0.0130125*T - 0.00000164*T2
+		    + 0.000000503*T3 +0.00256*cos(Omega)) * RadiansPerDegree;
+    SunEccentricity = (0.01675104 - 0.00004180*T - 0.000000126*T2);
+    SunArgPerigee = (281.220833 + 1.719175*T + 0.0004527*T2
+			+ 0.0000033*T3) * RadiansPerDegree;
+    SunMeanAnomaly = (358.475845 + 35999.04975*T - 0.00015*T2
+			- 0.00000333333*T3) * RadiansPerDegree;
+    n = (int)(SunMeanAnomaly / PI2);
+    SunMeanAnomaly -= n*PI2;
+
+    SunMeanMotion = 1/(365.24219879 - 0.00000614*T);
+
+    SunTrueAnomaly = Kepler(SunMeanAnomaly,SunEccentricity);
+    SunDistance = SunSemiMajorAxis*(1-SQR(SunEccentricity))
+			/ (1+SunEccentricity*cos(SunTrueAnomaly));
+
+    SinPenumbra = (SunRadius-EarthRadius)/SunDistance;
+    CosPenumbra = sqrt(1-SQR(SinPenumbra));
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: earthsat.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/eq_ecl.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/eq_ecl.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/eq_ecl.c	(revision 1457)
@@ -0,0 +1,78 @@
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+static void ecleq_aux P_((int sw, double mjd, double x, double y,
+    double *p, double *q));
+
+#define	EQtoECL	1
+#define	ECLtoEQ	(-1)
+
+
+/* given the modified Julian date, mjd, and an equitorial ra and dec, each in
+ * radians, find the corresponding geocentric ecliptic latitude, *lat, and
+ * longititude, *lng, also each in radians.
+ * correction for the effect on the angle of the obliquity due to nutation is
+ * not included.
+ */
+void
+eq_ecl (mjd, ra, dec, lat, lng)
+double mjd;
+double ra, dec;
+double *lat, *lng;
+{
+	ecleq_aux (EQtoECL, mjd, ra, dec, lng, lat);
+}
+
+/* given the modified Julian date, mjd, and a geocentric ecliptic latitude,
+ * *lat, and longititude, *lng, each in radians, find the corresponding
+ * equitorial ra and dec, also each in radians.
+ * correction for the effect on the angle of the obliquity due to nutation is
+ * not included.
+ */
+void
+ecl_eq (mjd, lat, lng, ra, dec)
+double mjd;
+double lat, lng;
+double *ra, *dec;
+{
+	ecleq_aux (ECLtoEQ, mjd, lng, lat, ra, dec);
+}
+
+static void
+ecleq_aux (sw, mjd, x, y, p, q)
+int sw;			/* +1 for eq to ecliptic, -1 for vv. */
+double mjd;
+double x, y;		/* sw==1: x==ra, y==dec.  sw==-1: x==lng, y==lat. */
+double *p, *q;		/* sw==1: p==lng, q==lat. sw==-1: p==ra, q==dec. */
+{
+	static double lastmjd = -10000;	/* last mjd calculated */
+	static double seps, ceps;	/* sin and cos of mean obliquity */
+	double sx, cx, sy, cy, ty;
+
+	if (mjd != lastmjd) {
+	    double eps;
+	    obliquity (mjd, &eps);		/* mean obliquity for date */
+    	    seps = sin(eps);
+	    ceps = cos(eps);
+	    lastmjd = mjd;
+	}
+
+	sy = sin(y);
+	cy = cos(y);				/* always non-negative */
+        if (fabs(cy)<1e-20) cy = 1e-20;		/* insure > 0 */
+        ty = sy/cy;
+	cx = cos(x);
+	sx = sin(x);
+        /* modifs CMV *q = asin((sy*ceps)-(cy*seps*sx*sw)); */
+        *q = (sy*ceps)-(cy*seps*sx*sw);
+        if(*q<-1.) *q = -PI/2.; else if(*q>1.) *q = PI/2.; else *q = asin(*q);
+        *p = atan(((sx*ceps)+(ty*seps*sw))/cx);
+        if (cx<0) *p += PI;		/* account for atan quad ambiguity */
+	range (p, 2*PI);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: eq_ecl.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/eq_gal.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/eq_gal.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/eq_gal.c	(revision 1457)
@@ -0,0 +1,104 @@
+/* code to convert between equitorial and galactic coordinates */
+
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+static void galeq_aux P_((int sw, double x, double y, double *p, double *q));
+static void galeq_init P_((void));
+
+#define	EQtoGAL	1
+#define	GALtoEQ	(-1)
+#define	SMALL	(1e-20)
+
+static double an = degrad(32.93192);    /* G lng of asc node on equator */
+static double gpr = degrad(192.85948);  /* RA of North Gal Pole, 2000 */
+static double gpd = degrad(27.12825);   /* Dec of  " */
+static double cgpd, sgpd;		/* cos() and sin() of gpd */
+static double mjd2000;			/* mjd of 2000 */
+static int before;			/* whether these have been set yet */
+
+/* given ra and dec, each in radians, for the given epoch, find the
+ * corresponding galactic latitude, *lat, and longititude, *lng, also each in
+ * radians.
+ */
+void
+eq_gal (mjd, ra, dec, lat, lng)
+double mjd, ra, dec;
+double *lat, *lng;
+{
+	galeq_init();
+	precess (mjd, mjd2000, &ra, &dec);
+	galeq_aux (EQtoGAL, ra, dec, lng, lat);
+}
+
+/* given galactic latitude, lat, and longititude, lng, each in radians, find
+ * the corresponding equitorial ra and dec, also each in radians, at the 
+ * given epoch.
+ */
+void
+gal_eq (mjd, lat, lng, ra, dec)
+double mjd, lat, lng;
+double *ra, *dec;
+{
+	galeq_init();
+	galeq_aux (GALtoEQ, lng, lat, ra, dec);
+	precess (mjd2000, mjd, ra, dec);
+}
+
+static void
+galeq_aux (sw, x, y, p, q)
+int sw;			/* +1 for eq to gal, -1 for vv. */
+double x, y;		/* sw==1: x==ra, y==dec.  sw==-1: x==lng, y==lat. */
+double *p, *q;		/* sw==1: p==lng, q==lat. sw==-1: p==ra, q==dec. */
+{
+	double sy, cy, a, ca, sa, b, sq, c, d; 
+
+	cy = cos(y);
+	sy = sin(y);
+	a = x - an;
+	if (sw == EQtoGAL)
+	    a = x - gpr;
+	ca = cos(a);
+	sa = sin(a);
+	b = sa;
+	if (sw == EQtoGAL)
+	    b = ca;
+	sq = (cy*cgpd*b) + (sy*sgpd);
+	*q = asin (sq);
+
+	if (sw == GALtoEQ) {
+	    c = cy*ca;
+	    d = (sy*cgpd) - (cy*sgpd*sa);
+	    if (fabs(d) < SMALL)
+		d = SMALL;
+	    *p = atan (c/d) + gpr;
+	} else {
+	    c = sy - (sq*sgpd);
+	    d = cy*sa*cgpd;
+	    if (fabs(d) < SMALL)
+		d = SMALL;
+	    *p = atan (c/d) + an;
+	}
+
+	if (d < 0) *p += PI;
+	if (*p < 0) *p += 2*PI;
+	if (*p > 2*PI) *p -= 2*PI;
+}
+
+/* set up the definitions */
+static void
+galeq_init()
+{
+	if (!before) {
+	    cgpd = cos (gpd);
+	    sgpd = sin (gpd);
+	    mjd2000 = J2000;
+	    before = 1;
+	}
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: eq_gal.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/formats.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/formats.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/formats.c	(revision 1457)
@@ -0,0 +1,307 @@
+#include <stdio.h>
+#include <math.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "P_.h"
+#include "astro.h"
+#include "preferences.h"
+
+/* sprint the variable a in sexagesimal format into out[].
+ * w is the number of spaces for the whole part.
+ * fracbase is the number of pieces a whole is to broken into; valid options:
+ *	360000:	<w>:mm:ss.ss
+ *	36000:	<w>:mm:ss.s
+ *	3600:	<w>:mm:ss
+ *	600:	<w>:mm.m
+ *	60:	<w>:mm
+ */
+void
+fs_sexa (out, a, w, fracbase)
+char *out;
+double a;
+int w;
+int fracbase;
+{
+	unsigned long n;
+	int d;
+	int f;
+	int m;
+	int s;
+	int isneg;
+
+	/* save whether it's negative but do all the rest with a positive */
+	isneg = (a < 0);
+	if (isneg)
+	    a = -a;
+
+	/* convert to an integral number of whole portions */
+	n = (unsigned long)(a * fracbase + 0.5);
+	d = n/fracbase;
+	f = n%fracbase;
+
+	/* form the whole part; "negative 0" is a special case */
+	if (isneg && d == 0)
+	    (void) sprintf (out, "%*s-0", w-2, "");
+	else
+	    (void) sprintf (out, "%*d", w, isneg ? -d : d);
+	out += w;
+
+	/* do the rest */
+	switch (fracbase) {
+	case 60:	/* dd:mm */
+	    m = f/(fracbase/60);
+	    (void) sprintf (out, ":%02d", m);
+	    break;
+	case 600:	/* dd:mm.m */
+	    (void) sprintf (out, ":%02d.%1d", f/10, f%10);
+	    break;
+	case 3600:	/* dd:mm:ss */
+	    m = f/(fracbase/60);
+	    s = f%(fracbase/60);
+	    (void) sprintf (out, ":%02d:%02d", m, s);
+	    break;
+	case 36000:	/* dd:mm:ss.s*/
+	    m = f/(fracbase/60);
+	    s = f%(fracbase/60);
+	    (void) sprintf (out, ":%02d:%02d.%1d", m, s/10, s%10);
+	    break;
+	case 360000:	/* dd:mm:ss.ss */
+	    m = f/(fracbase/60);
+	    s = f%(fracbase/60);
+	    (void) sprintf (out, ":%02d:%02d.%02d", m, s/100, s%100);
+	    break;
+	default:
+	    printf ("fs_sexa: unknown fracbase: %d\n", fracbase);
+	    exit(1);
+	}
+}
+
+/* put the given modified Julian date, jd, in out[] according to preference
+ * format.
+ */
+void
+fs_date (out, jd)
+char out[];
+double jd;
+{
+	int p = pref_get (PREF_DATE_FORMAT);
+	int m, y;
+	double d;
+
+	mjd_cal (jd, &m, &d, &y);
+	/* beware of %g rounding day up */
+	if ((d < 1.0 && d - floor(d) >= .9999995)
+				    || (d < 10.0 && d - floor(d) >= .999995)
+				    || (d >= 10.0 && d - floor(d) >= .99995))
+	    mjd_cal (mjd_day(jd+0.5), &m, &d, &y);
+
+	switch (p) {
+	case PREF_YMD:
+	    (void) sprintf (out, "%4d/%02d/%02.6g", y, m, d);
+	    break;
+	case PREF_DMY:
+	    (void) sprintf (out, "%2.6g/%02d/%-4d", d, m, y);
+	    break;
+	case PREF_MDY:
+	    (void) sprintf (out, "%2d/%02.6g/%-4d", m, d, y);
+	    break;
+	default:
+	    printf ("fs_date: bad date pref: %d\n", p);
+	    exit (1);
+	}
+}
+
+/* scan a sexagesimal string and update a double. the string is of the form
+ *   H:M:S. a negative value may be indicated by a '-' char before any
+ *   component. All components may be integral or real. In addition to ':' the
+ *    separator may also be '/' or ';' or ',' or '-'.
+ * any components not specified in bp[] are copied from old's.
+ *   eg:  ::10	only changes S
+ *        10    only changes H
+ *        10:0  changes H and M
+ */
+void
+f_scansex (o, bp, np)
+double o;	/* old value */
+char bp[];	/* input string */
+double *np;	/* new value */
+{
+	double oh, om, os;
+	double nh, nm, ns;
+	int nneg;
+	double tmp;
+	char c;
+
+	/* fast macro to scan each segment of bp */
+#define	SCANSEX(new,old)						\
+	if (*bp == '-') {nneg = 1; bp++;}				\
+	if (sscanf (bp, "%lf", &new) != 1) new = old;			\
+	while ((c=(*bp)) != '\0') {					\
+	    bp++;							\
+	    if (c==':' || c=='/' || c==';' || c==',' || c=='-')		\
+		break;							\
+	}
+
+	/* get h:m:s components of o in case bp[] defers.
+	 * and constrain to positive for now.
+	 */
+	if (o < 0.0)
+	    o = -o;
+        oh = floor(o);
+	tmp = (o - oh)*60.0;
+	om = floor(tmp);
+	os = (tmp - om)*60.0;
+	
+	/* round to small portion of a second to reduce differencing errors. */
+	if (os > 59.99999) {
+	    os = 0.0;
+	    if ((om += 1.0) >= 60.0) {
+		om = 0.0;
+		oh += 1.0;
+	    }
+	}
+
+	/* scan each component of the buffer */
+	while (*bp == ' ') bp++;
+	nneg = 0;
+	SCANSEX (nh, oh)
+	SCANSEX (nm, om)
+	SCANSEX (ns, os)
+
+	/* back to hours */
+	tmp = ns/3600.0 + nm/60.0 + nh;
+	if (nneg)
+	    tmp = -tmp;
+
+	*np = tmp;
+}
+
+/* crack a floating date string, bp, of the form X/Y/Z determined by the
+ *   PREF_DATE_FORMAT preference into its components. allow the day to be a
+ *   floating point number,
+ * a lone component is always a year if it contains a decimal point or pref
+ *   is MDY or DMY and it is not a reasonable month or day value, respectively.
+ * leave any unspecified component unchanged.
+ * actually, the slashes may be anything but digits or a decimal point.
+ */
+void
+f_sscandate (bp, pref, m, d, y)
+char *bp;
+int pref;       /* one of PREF_X for PREF_DATE_FORMAT */
+int *m, *y;
+double *d;
+{
+        double comp[3]; /* the three components */
+        int set[3];     /* set[i] is 1 if component i is present */
+	int in;		/* scan state: 1 while we are in a component */
+	int ncomp;	/* incremented as each component is discovered */
+	int ndp;	/* number of decimal points in last component */
+        char *bp0 = NULL, c;
+
+	set[0] = set[1] = set[2] = 0;
+	ncomp = 0;
+	in = 0;
+	ndp = 0;
+
+	/* scan the input string.
+	 * '\0' counts as a component terminator too.
+	 */
+	do {
+	    /* here, *bp is the next character to be investigated */
+	    c = *bp;
+	    if (c == '.' || isdigit(c) || (c == '-' && !in)) {
+		/* found what passes for a floating point number */
+		if (in == 0) {
+		    /* save the beginning of it in bp0 and init ndp */
+		    bp0 = bp;
+		    in = 1;
+		    ndp = 0;
+		}
+		if (c == '.')
+		    ndp++;
+	    } else if (c != ' ') {
+		/* not in a number now ... */
+		if (in) {
+		    /* ... but we *were* in a number, so it counts */
+		    if (ncomp >= 3)
+			return;	/* too many components.. just bail */
+		    comp[ncomp] = atod (bp0);
+		    set[ncomp] = 1;
+		    in = 0;
+		}
+
+		/* regardless, a non-blank non-float means another component */
+		ncomp++;
+	    }
+	    bp++;
+	} while (c);
+
+	/* it's a decimal year if there is exactly one component and
+	 *   it contains a decimal point
+	 *   or we are in MDY format and it's not in the range 1..12
+	 *   or we are in DMY format and it's not int the rangle 1..31
+	 */
+	if (ncomp == 1 &&
+		(ndp > 0
+		 || (pref == PREF_MDY && !(comp[0] >= 1 && comp[0] <= 12))
+		 || (pref == PREF_DMY && !(comp[0] >= 1 && comp[0] <= 31)))) {
+	    double Mjd;
+	    year_mjd (comp[0], &Mjd);
+	    mjd_cal (Mjd, m, d, y);
+	    return;
+	}
+
+        switch (pref) {
+        case PREF_MDY:
+            if (set[0]) *m = (int)comp[0];
+            if (set[1]) *d = comp[1];
+            if (set[2]) *y = (int)comp[2];
+            break;
+        case PREF_YMD:
+            if (set[0]) *y = (int)comp[0];
+            if (set[1]) *m = (int)comp[1];
+            if (set[2]) *d = comp[2];
+            break;
+        case PREF_DMY:
+            if (set[0]) *d = comp[0];
+            if (set[1]) *m = (int)comp[1];
+            if (set[2]) *y = (int)comp[2];
+            break;
+	}
+}
+
+/* given a string of the form xx:mm[:ss] or xx:mm.dd, convert it to a double at
+ * *dp. actually, ':' may also be ';', '/' or ',' too. all components may be 
+ * floats.
+ * return -1 if trouble, else 0
+ */
+int
+scansex (str, dp)
+char *str;
+double *dp;
+{
+	double x, m = 0.0, s = 0.0;
+	int isneg;
+	int nf;
+
+	while (isspace(*str))
+	    str++;
+	if (*str == '-') {
+	    isneg = 1;
+	    str++;
+	} else
+	    isneg = 0;
+
+	nf = sscanf (str, "%lf%*[:;/,]%lf%*[:;/,]%lf", &x, &m, &s);
+	if (nf < 1)
+	    return (-1);
+	*dp = x + m/60.0 + s/3600.0;
+	if (isneg)
+	    *dp = - *dp;
+	return (0);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: formats.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/helio.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/helio.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/helio.c	(revision 1457)
@@ -0,0 +1,54 @@
+#include <stdlib.h>
+#include <math.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* given geocentric time jd and coords of a distant object at ra/dec (J2000),
+ * find the difference in time between light arriving at earth vs the sun.
+ * *hcp must be subtracted from geocentric jd to get heliocentric jd.
+ * From RLM Oct 12, 1995.
+ */
+void
+heliocorr (jd, ra, dec, hcp)
+double jd, ra, dec;
+double *hcp;
+{
+	double e;	/* obliquity of ecliptic */
+	double n;	/* day number */
+	double g;	/* solar mean anomaly */
+	double L;	/* solar ecliptic longitude */
+	double l;	/* mean solar ecliptic longitude */
+	double R;	/* sun distance, AU */
+	double X, Y;	/* equatorial rectangular solar coords */
+	double cdec, sdec;
+	double cra, sra;
+
+	/* following algorithm really wants EOD */
+	precess (J2000, jd - MJD0, &ra, &dec);
+
+	cdec = cos(dec);
+	sdec = sin(dec);
+	cra = cos(ra);
+	sra = sin(ra);
+
+	n = jd - 2451545.0;	/* use epoch 2000 */
+	e = degrad(23.439 - 0.0000004*n);
+	g = degrad(357.528) + degrad(0.9856003)*n;
+	L = degrad(280.461) + degrad(0.9856474)*n;
+	l = L + degrad(1.915)*sin(g) + degrad(0.02)*sin(2.0*g);
+	R = 1.00014 - 0.01671*cos(g) - 0.00014*cos(2.0*g);
+	X = R*cos(l);
+	Y = R*cos(e)*sin(l);
+
+#if 0
+	    printf ("n=%g g=%g L=%g l=%g R=%g X=%g Y=%g\n",
+				n, raddeg(g), raddeg(L), raddeg(l), R, X, Y);
+#endif
+
+	*hcp = 0.0057755 * (cdec*cra*X + (cdec*sra + tan(e)*sdec)*Y);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: helio.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/libration.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/libration.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/libration.c	(revision 1457)
@@ -0,0 +1,2230 @@
+/* This file contains code to calculate the libration in Lunar lat and long.
+ * It is based entirely on code supplied to me 2 Oct 1996 by Stephen L. Moshier,
+ * <moshier@world.std.com>, which implements a trigonometric expansion to
+ * approximate the librations according to JPL DE403. The following doc file
+ * was also supplied therewith:
+
+This program calculates a trigonometric series adjusted for a best fit
+to the lunar librations from the Jet Propulsion Laboratory's DE403
+ephemeris.
+
+lblon403.c and lblat403.c are series for the selenographic longitude
+and latitude of the earth.  The longitude series matches DE403
+with a maximum discrepancy of 2.6" (0.4" rms).  The latitude has a
+maximum discrepancy of 1.9" (0.2" rms).  The two series are valid in
+the Julian year interval 1600 to 2200.
+
+In both Eckhardt and DE403 the moon's principal moment of inertia axes
+form the lunar body coordinate system. The estimated geographic
+locations of these axes vary as measurements and theories gradually
+become more refined.  There is a significant difference between
+Eckhardt and DE403 in the constant term of the longitude.  Almanac and
+cartography coordinates drop the constant term (which is -64" for
+DE403).  That practice gives librations relative to the mean
+selenographic longitude of the earth, for which the discrepancy from
+one theory to the next is small.
+
+Steve Moshier
+October, 1996
+
+ * Any errors in adapting this code to xephem are strictly my own.
+ * Elwood Downey.
+*/
+
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+#define CHAR short
+
+
+
+/* plantbl.h */
+
+struct plantbl {
+  /*  char max_harmonic[9]; */
+  char max_harmonic[14];
+  char max_power_of_t;
+  CHAR *arg_tbl;
+  int *lon_tbl;
+  int *lat_tbl;
+  int *rad_tbl;
+  double distance;
+  double timescale;
+  double trunclvl;
+};
+
+
+
+/* libra403.c */
+
+static double JD2000 = 2451545.0;
+/* Conversion factors between degrees and radians */
+static double STR = 4.8481368110953599359e-6;	/* radians per arc second */
+
+static double ss[14][24];
+static double cc[14][24];
+
+/* Reduce arc seconds modulo 360 degrees,
+   answer in arc seconds.  */
+static double
+mods3600 (x)
+     double x;
+{
+  double y;
+  y = x - 1.296e6 * floor (x / 1.296e6);
+  return y;
+}
+
+/* Prepare lookup table of sin and cos ( i * L_k )
+   for required multiple angles.
+   K is the array offset corresponding to the planet.
+   ARG is in radians.
+   n is the highest harmonic to compute.  */
+static int
+sscc (k, arg, n)
+     int k;
+     double arg;
+     int n;
+{
+  double cu, su, cv, sv, s;
+  int i;
+
+  if (n <= 0)
+    return 0;
+
+  su = sin (arg);
+  cu = cos (arg);
+  ss[k][0] = su;		/* sin(L) */
+  cc[k][0] = cu;		/* cos(L) */
+  sv = 2.0 * su * cu;
+  cv = cu * cu - su * su;
+  ss[k][1] = sv;		/* sin(2L) */
+  cc[k][1] = cv;
+  for (i = 2; i < n; i++)
+    {
+      s = su * cv + cu * sv;
+      cv = cu * cv - su * sv;
+      sv = s;
+      ss[k][i] = sv;		/* sin( i+1 L ) */
+      cc[k][i] = cv;
+    }
+  return (0);
+}
+
+
+/* Mean elements.
+   Copied from cmoon.c, DE404 version.  */
+
+static double Jlast = -1.0e38;
+static double T;
+
+static int
+dargs (J, plan)
+     double J;
+     struct plantbl *plan;
+{
+  double T2, w;
+
+  if (J == Jlast)
+    return 0;
+
+  T = (J - JD2000) / 36525.0;
+  T2 = T * T;
+
+  /* Mean anomaly of sun = l' (J. Laskar) */
+  w = mods3600 (129596581.038354 * T + 1287104.76154);
+  w += ((((((((
+		1.62e-20 * T
+		- 1.0390e-17) * T
+	      - 3.83508e-15) * T
+	     + 4.237343e-13) * T
+	    + 8.8555011e-11) * T
+	   - 4.77258489e-8) * T
+	  - 1.1297037031e-5) * T
+	 + 1.4732069041e-4) * T
+	- 0.552891801772) * T2;
+  sscc (10, STR * w, plan->max_harmonic[10]);
+
+  /* Mean distance of moon from its ascending node = F */
+  w = mods3600 ((1739527263.0983 - 2.079419901760e-01) * T + 335779.55755);
+  w = w + ((-9.646018347184e-06 * T2	/* F, t^4 */
+	    - 1.138215912580e-03) * T	/* F, t^3 */
+	   - 1.312045233711e+01) * T;	/* F, t^2 */
+  sscc (11, STR * w, plan->max_harmonic[11]);
+
+  /* Mean anomaly of moon = l */
+  w = mods3600 ((1717915923.4728 - 2.035946368532e-01) * T + 485868.28096);
+  w = w + ((-3.421689790404e-04 * T2	/* l, t^4 */
+	    + 4.768357585780e-02) * T	/* l, t^3 */
+	   + 3.146734198839e+01) * T;	/* l, t^2 */
+  sscc (9, STR * w, plan->max_harmonic[9]);
+
+  /* Mean elongation of moon = D */
+  w = mods3600 ((1602961601.4603 + 3.962893294503e-01) * T + 1072260.73512);
+  w = w + ((-2.905334122698e-04 * T2	/* D, t^4 */
+	    - 5.834100476561e-03) * T	/* D, t^3 */
+	   - 6.847070905410e+00) * T;	/* D, t^2 */
+  sscc (12, STR * w, plan->max_harmonic[12]);
+
+  /* Mean longitude of moon, re mean ecliptic and equinox of date */
+  w = mods3600 ((1732564372.83264 - 6.784914260953e-01) * T + 785939.95571);
+  w = w + ((-8.466472828815e-05 * T2	/* L, t^4 */
+	    + 5.722859298199e-03) * T	/* L, t^3 */
+	   - 5.663161722088e+00) * T;	/* L, t^2 */
+  sscc (13, STR * w, plan->max_harmonic[13]);
+
+  /* Mean longitudes of planets (Laskar, Bretagnon) */
+
+  /* Venus.  */
+  w = mods3600 (210664136.4335482 * T + 655127.283046);
+  w += ((((((((
+		-9.36e-023 * T
+		- 1.95e-20) * T
+	      + 6.097e-18) * T
+	     + 4.43201e-15) * T
+	    + 2.509418e-13) * T
+	   - 3.0622898e-10) * T
+	  - 2.26602516e-9) * T
+	 - 1.4244812531e-5) * T
+	+ 0.005871373088) * T2;
+  sscc (1, STR * w, plan->max_harmonic[1]);
+
+  /* Earth.  */
+  w = mods3600 (129597742.26669231 * T + 361679.214649);
+  w += ((((((((-1.16e-22 * T
+	       + 2.976e-19) * T
+	      + 2.8460e-17) * T
+	     - 1.08402e-14) * T
+	    - 1.226182e-12) * T
+	   + 1.7228268e-10) * T
+	  + 1.515912254e-7) * T
+	 + 8.863982531e-6) * T
+	- 2.0199859001e-2) * T2;
+  sscc (2, STR * w, plan->max_harmonic[2]);
+
+  /* Mars.  */
+  w = mods3600 (68905077.59284 * T + 1279559.78866);
+  w += (-1.043e-5 * T + 9.38012e-3) * T2;
+  sscc (3, STR * w, plan->max_harmonic[3]);
+
+  /* Jupiter.  */
+  w = mods3600 (10925660.428608 * T + 123665.342120);
+  w += (1.543273e-5 * T - 3.06037836351e-1) * T2;
+  sscc (4, STR * w, plan->max_harmonic[4]);
+
+  /* Saturn.  */
+  w = mods3600 (4399609.65932 * T + 180278.89694);
+  w += ((4.475946e-8 * T - 6.874806E-5) * T + 7.56161437443E-1) * T2;
+  sscc (5, STR * w, plan->max_harmonic[5]);
+  return 0;
+}
+
+
+
+/* Evaluate series PLAN at Julian date J.
+   Result in arcseconds, usually.  */
+
+static double
+gplan (J, plan)
+     double J;
+     struct plantbl *plan;
+{
+  double su, cu, sv, cv;
+  double t, sl;
+  int j, k, m, k1, ip, np, nt;
+  CHAR *p;
+  int *pl;
+
+  dargs (J, plan);
+  /* Point to start of table of arguments. */
+  p = plan->arg_tbl;
+  /* Point to tabulated cosine and sine amplitudes.  */
+  pl = plan->lon_tbl;
+  sl = 0.0;
+
+  for (;;)
+    {
+      /* Find sine and cosine of argument for this term in the series.
+	 The argument has the form J_1 L_1 + J_2 L_2 + ...
+	 where J_i are integers and L_i are mean elements.  */
+
+      /* Number of periodic arguments. */
+      np = *p++;
+      if (np < 0)
+	break;
+      if (np == 0)
+	{
+	  /* If no periodic arguments, it is a polynomial term.
+	     Evaluate A_n T^n + A_n-1 T^n-1 + ... + A_0.  */
+	  nt = *p++;
+	  cu = *pl++;
+	  for (ip = 0; ip < nt; ip++)
+	    cu = cu * T + *pl++;
+	  sl += cu;
+	  continue;
+	}
+      k1 = 0;
+      cv = 0.0;
+      sv = 0.0;
+      for (ip = 0; ip < np; ip++)
+	{
+	  /* What harmonic.  */
+	  j = *p++;
+	  /* Which planet.  */
+	  m = *p++ - 1;
+	  if (j)
+	    {
+	      k = j;
+	      if (j < 0)
+		k = -k;
+	      k -= 1;
+	      /* sin(k*angle) for planet m.  */
+	      su = ss[m][k];
+	      if (j < 0)
+		su = -su;
+	      /* cos(k*angle) for planet m.  */
+	      cu = cc[m][k];
+	      if (k1 == 0)
+		{
+		  /* Set sine and cosine of first angle. */
+		  sv = su;
+		  cv = cu;
+		  k1 = 1;
+		}
+	      else
+		{
+		  /* Combine angles by trigonometry.  */
+		  t = su * cv + cu * sv;
+		  cv = cu * cv - su * sv;
+		  sv = t;
+		}
+	    }
+	}
+      /* Now cv = cos(arg), sv = sin(arg).
+	 Evaluate
+	 cu = (C_n T^n + C_n-1 T^n-1 + ... + C_0) cos(arg)
+	 su = (S_n T^n + S_n-1 T^n-1 + ... + S_0) sin(arg).  */
+
+      /* Highest power of T.  */
+      nt = *p++;
+      /* Coefficients C_i, S_i.  */
+      cu = *pl++;
+      su = *pl++;
+      for (ip = 0; ip < nt; ip++)
+	{
+	  cu = cu * T + *pl++;
+	  su = su * T + *pl++;
+	}
+      sl += cu * cv + su * sv;
+    }
+  return (plan->trunclvl * sl);
+}
+
+
+
+/* lblat403.c */
+
+static int lattabr[] = {-1};
+static int lattabb[] = {-1};
+static int lattabl[] = {
+    785710,
+
+     -1958,       780,
+
+      -178,      2850,      2243,      5927,      2714,     -2911,
+
+      -174,      5888,    -16705,     10828,    -15113,    -25049,
+
+      -172,      1976,
+
+        37,    -13560,
+
+       -40,      -911,
+
+      -300,       691,
+
+      3779,       722,
+
+        68,     -1048,
+
+     -3092,        -4,      3011,       -31,       250, -14293664,
+
+      -149,      -228,
+
+        -5,      -842,
+
+        62,     57967,
+
+        -7,    -11207,
+
+        15,    -66055,
+
+       -79,    -71560,
+
+         8,      2998,
+
+     -1062,       -46,
+
+        -2,       711,
+
+        -5,        -2,
+
+       367,        -5,      -353,         1,      -117,   2324027,
+
+         0,      -176,
+
+        19,        -4,
+
+        -3,     -1229,
+
+         7,      4327,
+
+        -2,       112,
+
+        -1,      -540,
+
+        73,    102982,
+
+         0,      -137,
+
+         2,       239,
+
+         0,      -216,
+
+         2,      3707,
+
+        -1,      -100,
+
+        -2,       124,
+
+         0,       408,
+
+         1,       561,
+
+         0,       594,
+
+         0,     11866,
+
+        -2,      -229,
+
+        11,      6768,
+
+         2,         1,
+
+        -2,      -788,       -24,    314732,
+
+        -5,     -3238,
+
+        -2,     -1263,
+
+        -1,        94,
+
+        -2,       206,
+
+      -283,   6489836,
+
+        63,      2562,
+
+        -6,      1220,
+
+         0,       135,
+
+       795,      -338,
+
+      -406,      -101,
+
+       757,      -383,
+
+       -73,    -31018,
+
+        -5,     -3010,
+
+         6,      5821,
+
+       167,         7,
+
+         2,    122623,
+
+        41,    138924,
+
+         2,       253,
+
+         0,      -198,
+
+       135,        30,
+
+         2,       934,
+
+        62,       -14,
+
+      -531,   -297537,
+
+        -3,      -205,
+
+         1,      -393,
+
+        -4,      -156,
+
+      -467,        90,
+
+         9,      -346,
+
+       -55,      1368,
+
+      4414,      2094,
+
+       480,       510,
+
+        35,       728,
+
+      6832,      6429,
+
+     -2099,     -3703,
+
+        -9,       579,
+
+       239,      1738,
+
+        22,       968,     60260,     -8929,
+
+        26,       -64,
+
+         0,         0,
+
+       -47,      -351,      2248,     -1175,      3976,      7150,
+
+     15191,         1,    -15535,      -143,     -2308,-239959618,
+
+       -45,       355,      2252,      1189,      4009,     -7131,
+
+      -158,       499,
+
+       776,       -34,
+
+      -389,      4363,
+
+        30,        28,
+
+         0,      -593,
+
+         1,        -1,
+
+        58,       -66,
+
+         4,      1552,
+
+        -1,       244,
+
+       288,        59,
+
+      -276,        62,
+
+         8,      3309,
+
+         2,      1249,
+
+      -156,        -3,
+
+         0,     -7903,
+
+       -47,    154458,
+
+      -710,       160,
+
+         0,       288,
+
+       328,    219514,
+
+        -1,       113,
+
+        -1,      1515,
+
+       -20,     28493,
+
+        13,      9011,
+
+        -1,      1110,
+
+        -1,      -103,
+
+         0,       312,
+
+         1,       360,
+
+         6,      6139,
+
+        -1,       142,
+
+        -1,      -709,
+
+        -1,      -242,
+
+        67,     67200,
+
+         5,      4148,
+
+         1,       137,
+
+       -15,    -17969,
+
+        -2,     -3372,
+
+        -2,     -1739,
+
+       154,    116200,
+
+        -1,      -640,
+
+      -269,   -336274,
+
+         0,     -1557,
+
+        -1,      -353,
+
+       993,        39,
+
+        -1,      -294,
+
+      -646,      -135,
+
+       750,        -3,      -661,         8,      -163,   2591179,
+
+        -1,      -258,
+
+         0,       381,
+
+         6,      8272,
+
+       -44,    -92044,
+
+       -29,     70397,
+
+       -25,    -17892,
+
+         1,        67,
+
+       -44,    -17118,
+
+      2743,       349,
+
+        -4,       231,
+
+      1501,      3099,
+
+       -33,        21,
+
+     -1130,        97,      1263,       164,      -226, -13139965,
+
+       839,      -202,
+
+        -1,       660,
+
+        12,    -10482,
+
+         1,        17,
+
+        -2,     -1480,
+
+       -45,    -26084,
+
+         2,       259,
+
+         0,       258,
+
+        -1,     -1560,
+
+        32,     73046,
+
+        -1,      -370,
+
+        -1,       -77,
+
+        46,     20687,
+
+         1,       742,
+
+         1,      2399,
+
+         2,       741,
+
+         0,        52,
+
+         0,       112,
+
+         0,       297,
+
+         2,       825,
+
+         0,       161,
+
+         1,      4228,
+
+         0,       212,
+
+        -1,      -105,
+
+         6,      2782,
+
+         9,     37199,
+
+         3,      5045,
+
+       105,        -1,
+
+        -1,      -179,
+
+        75,     31274,
+
+        -3,     -1321,
+
+        -1,       363,
+
+         0,      1137,
+
+        58,    104090,
+
+        -2,     -2695,
+
+        -1,      -392,
+
+       -35,    -21763,
+
+        -2,      -205,
+
+       567,        38,
+
+        -7,       117,
+
+      -569,        -9,       321,  -1522061,
+
+        -4,       276,
+
+        -2,      -590,
+
+         2,       632,
+
+       -14,    -10601,
+
+         4,      8703,
+
+       -10,     16870,
+
+        -4,      -995,
+
+       597,        -6,      -386,   -805403,
+
+      1025,      -474,
+
+        -2,       201,
+
+       -95,        16,
+
+      -127,    135570,
+
+         0,      -173,
+
+        10,      8565,
+
+        -3,      1812,
+
+        -1,      -108,
+
+      -107,      -649,
+
+         0,       151,
+
+         1,       950,
+
+         1,       312,
+
+         1,       403,
+
+         0,      -576,
+
+         7,      4418,
+
+        -3,     -4769,
+
+        -1,      -769,
+
+        63,     38890,
+
+         0,      -101,
+
+         0,       169,
+
+        -3,    -14837,
+
+         1,       372,
+
+         0,      -674,
+
+        -3,     -1488,
+
+       -36,   -196300,
+
+         0,      -176,
+
+       -10,     -4811,
+
+        -2,      -991,
+
+         1,       831,
+
+         1,      3138,
+
+      -103,    -51819,
+
+         0,      -133,
+
+        -4,     22171,
+
+         2,       820,
+
+         1,       149,
+
+      2227,      1277,
+
+      -502,     -3049,
+
+         1,       122,
+
+         0,       370,
+
+         0,       166,
+
+         2,       772,
+
+         2,      2057,
+
+        -1,      -486,
+
+        13,    -15447,
+
+        -2,     -1619,
+
+         0,       335,
+
+         0,      -206,
+
+         0,      -104,
+
+       -19,    -19726,
+
+         0,       414,
+
+        -8,     -3425,
+
+       -19,        -1,
+
+         1,       546,
+
+         0,      -392,
+
+         0,     -2754,
+
+         0,      -158,
+
+        -3,     -1790,
+
+        -1,      -230,
+
+         0,      -190,
+
+         0,      -366,
+
+         0,      -154,
+
+};
+
+static CHAR latargs[] = {
+  0,  0,
+  3,  1,  2,  9,  3,-20,  4,  0,
+  4,  1, 13, -1, 10,  3,  2, -4,  3,  2,
+  4,  1, 13, -1, 10, -5,  2,  9,  3,  2,
+  3,  9, 10, -9, 14,  1,  3,  0,
+  3,  1, 11, -1, 12,  1, 13,  0,
+  4,  1, 10, -2, 11,  1, 12, -2, 13,  0,
+  4,  2, 11, -1, 14, 18,  2,-18,  3,  0,
+  3,  1, 13, -1, 10,  1,  3,  0,
+  2,  1, 10, -1, 14,  0,
+  2,  1, 10, -1, 12,  2,
+  4,  1, 14,-18,  2, 16,  3,  1,  5,  0,
+  3,  2, 10, -1, 12, -1, 13,  0,
+  3,  1, 10,  1, 11, -1, 12,  0,
+  4,  1, 10, -1, 11,  1, 12, -2, 13,  0,
+  2,  1, 12, -1, 13,  0,
+  3,  1, 10, -1, 11, -1, 12,  0,
+  3,  3, 10, -1, 12, -2, 13,  0,
+  2,  2, 10, -2, 13,  0,
+  3,  1, 10,  2, 11, -1, 12,  0,
+  3,  1, 10, -2, 13,  1,  3,  0,
+  3,  1, 10,  1, 12, -2, 13,  2,
+  3,  1, 11,  1, 12, -1, 13,  0,
+  2,  2, 12, -2, 13,  0,
+  3,  1, 10, -2, 11, -1, 12,  0,
+  3,  1, 10, -3, 12,  2, 13,  0,
+  4,  3, 10,  1, 11, -1, 12, -2, 13,  0,
+  3,  2, 10,  1, 12, -3, 13,  0,
+  4,  1, 10,  1, 11,  1, 12, -2, 13,  0,
+  2,  3, 12, -3, 13,  0,
+  4,  1, 10, -1, 11, -3, 12,  2, 13,  0,
+  3,  3, 10,  1, 12, -4, 13,  0,
+  4,  1, 10,  2, 11,  1, 12, -2, 13,  0,
+  3,  1, 10,  3, 12, -4, 13,  0,
+  4,  1, 10,  3, 11,  1, 12, -2, 13,  0,
+  3,  3, 11,  1, 12, -2, 13,  0,
+  4,  2, 10,  1, 11,  1, 12, -4, 13,  0,
+  2,  3, 12, -4, 13,  0,
+  3,  2, 11,  1, 12, -2, 13,  0,
+  4,  1, 10,  1, 11,  1, 12, -3, 13,  0,
+  3,  2, 10,  1, 12, -4, 13,  0,
+  4,  1, 14, -3,  2,-16,  3, -4,  4,  0,
+  3,  1, 11,  1, 12, -2, 13,  1,
+  3,  1, 10,  1, 12, -3, 13,  0,
+  4,  2, 10,  1, 11, -1, 12, -2, 13,  0,
+  3,  2, 10, -3, 12,  2, 13,  0,
+  4,  1, 10, -1, 11, -1, 12,  1, 13,  0,
+  2,  1, 12, -2, 13,  0,
+  2,  2, 13, -1, 14,  0,
+  2,  2, 11, -1, 12,  0,
+  4,  1, 10, -1, 11,  1, 12, -3, 13,  0,
+  3,  2, 10, -3, 14,  4,  4,  0,
+  2,  1, 10, -2, 13,  0,
+  3,  1, 13, -3,  3,  4,  4,  0,
+  3,  2, 10, -1, 12, -2, 13,  0,
+  3,  2, 10, -1, 11, -1, 12,  0,
+  3,  1, 10, -1, 12,  1, 13,  0,
+  2,  1, 10, -1, 11,  0,
+  3,  1, 11, -1, 12,  2, 13,  0,
+  2,  1, 11, -1, 12,  0,
+  3,  1, 10, -1, 12, -1, 13,  0,
+  4,  2, 13, -1, 12,  2,  2, -2,  3,  0,
+  3,  1, 13,  2,  2, -3,  3,  0,
+  4,  2, 10, -1, 11, -1, 12, -2, 13,  0,
+  3,  1, 13, -1,  2,  2,  3,  0,
+  2,  2, 10, -1, 12,  0,
+  4,  2, 13, -1, 12,  2,  3, -2,  5,  0,
+  4,  2, 13, -1, 12,  3,  2, -3,  3,  0,
+  4,  2, 10, -2, 11,  1, 12, -2, 13,  0,
+  3,  1, 13,  1,  3, -2,  5,  0,
+  4,  1, 10,  1, 11, -1, 12,  1, 13,  0,
+  3,  1, 13, -5,  2,  9,  3,  0,
+  3,  1, 14,  2,  3, -4,  4,  0,
+  3,  3, 10,  4, 12, -6, 14,  0,
+  3,  1, 13,  3,  2, -4,  3,  0,
+  1,  1, 10,  0,
+  3,  1, 13, -3, 12,  9,  2,  0,
+  4,  1, 10, -1, 11,  1, 12, -1, 13,  0,
+  3,  2, 11, -1, 12,  2, 13,  0,
+  1,  1, 14,  1,
+  4,  1, 12,  1, 10, -1, 14,  1,  5,  0,
+  4,  9, 13, -9, 10,  7,  2, 10,  3,  0,
+  3,  1, 12, -8,  2, 13,  3,  2,
+  1,  1, 12,  2,
+  3,  1, 12,  8,  2,-13,  3,  2,
+  2,  1, 13,  2,  4,  0,
+  4,  2, 13, -1, 12,  5,  2, -6,  3,  0,
+  3,  1, 13, -2, 12,  1,  3,  0,
+  3,  1, 13, -3,  2,  6,  3,  0,
+  4,  1, 10, -1, 11, -1, 12, -1, 13,  0,
+  2,  1, 14,  2,  5,  0,
+  2,  1, 10, -2, 12,  0,
+  2,  2, 10, -3, 12,  0,
+  4,  2, 13, -1, 12,  4,  2, -4,  3,  0,
+  3,  1, 14,  4,  2, -6,  3,  0,
+  2,  1, 13,  1,  2,  0,
+  3,  2, 10,  1, 11, -1, 12,  0,
+  4,  2, 10, -1, 11,  1, 12, -2, 13,  0,
+  2,  1, 10,  1, 11,  0,
+  3,  1, 10,  1, 12, -1, 13,  0,
+  2,  1, 11,  1, 12,  0,
+  3,  3, 12, -2, 13, -1,  3,  0,
+  3,  4, 10, -1, 12, -2, 13,  0,
+  3,  2, 10,  1, 12, -2, 13,  0,
+  4,  1, 10,  1, 11,  1, 12, -1, 13,  0,
+  2,  2, 11,  1, 12,  0,
+  2,  3, 12, -2, 13,  0,
+  4,  2, 10,  1, 11,  1, 12, -2, 13,  0,
+  3,  1, 11,  3, 12, -2, 13,  0,
+  3,  4, 10,  1, 12, -4, 13,  0,
+  4,  2, 10,  2, 11,  1, 12, -2, 13,  0,
+  4,  1, 10,  2, 11,  1, 12, -4, 13,  0,
+  4,  1, 10,  1, 11,  1, 12, -4, 13,  0,
+  4,  1, 10,  3, 11, -1, 12, -2, 13,  0,
+  4,  1, 10, -2, 11, -1, 12,  2, 13,  0,
+  3,  1, 11,  1, 12, -3, 13,  0,
+  3,  1, 10,  1, 12, -4, 13,  0,
+  4,  1, 10,  2, 11, -1, 12, -2, 13,  0,
+  3,  3, 10, -1, 12, -4, 13,  0,
+  4,  1, 10, -1, 11, -1, 12,  2, 13,  0,
+  2,  1, 12, -3, 13,  0,
+  4,  1, 10, -1, 11,  1, 12, -4, 13,  0,
+  4,  1, 10,  1, 11, -1, 12, -2, 13,  0,
+  3,  2, 10, -1, 12, -3, 13,  0,
+  3,  1, 10, -1, 12,  2, 13,  0,
+  3,  1, 10, -2, 11,  1, 12,  0,
+  3,  1, 11, -1, 12,  3, 13,  0,
+  1,  2, 13,  0,
+  3,  1, 11, -1, 12, -1, 13,  0,
+  3,  1, 10, -3, 13, -1,  3,  0,
+  3,  1, 10, -1, 12, -2, 13,  2,
+  3,  3, 10, -1, 11, -1, 12,  0,
+  3,  2, 10, -1, 12,  1, 13,  0,
+  4,  1, 10,  1, 11, -1, 12,  2, 13,  0,
+  3,  1, 10, -1, 11,  1, 12,  0,
+  2,  1, 12,  1, 13,  0,
+  4,  1, 10, -1, 11, -1, 12, -2, 13,  0,
+  3,  1, 10,  1, 11, -3, 12,  0,
+  2,  3, 10, -1, 12,  0,
+  1,  2, 10,  0,
+  4,  2, 10, -1, 11,  1, 12, -1, 13,  0,
+  3,  1, 13,  1, 10,  1, 11,  0,
+  3,  2, 13,  3,  3, -2, 11,  0,
+  2,  1, 10,  1, 12,  2,
+  3,  1, 10, -3, 14,  2,  5,  0,
+  3,  3, 10, -1, 14,  4,  5,  0,
+  3,  1, 11,  1, 12,  1, 13,  0,
+  1,  2, 12,  0,
+  4,  1, 10, -2, 11, -1, 12, -2, 13,  0,
+  2,  1, 10, -3, 12,  0,
+  3,  3, 10,  1, 11, -1, 12,  0,
+  4,  3, 10, -1, 11,  1, 12, -2, 13,  0,
+  3,  2, 10,  1, 12, -1, 13,  0,
+  3,  1, 10,  1, 11,  1, 12,  0,
+  2,  3, 12, -1, 13,  0,
+  3,  1, 10, -1, 11, -3, 12,  0,
+  3,  3, 10,  1, 12, -2, 13,  0,
+  3,  1, 10,  2, 11,  1, 12,  0,
+  3,  1, 10,  3, 12, -2, 13,  0,
+  4,  3, 10,  1, 11,  1, 12, -2, 13,  0,
+  4,  1, 10,  1, 11,  3, 12, -2, 13,  0,
+  4,  2, 10,  1, 11,  1, 12, -6, 13,  0,
+  3,  2, 11,  1, 12, -4, 13,  0,
+  3,  2, 10,  1, 12, -6, 13,  0,
+  4,  2, 10,  2, 11, -1, 12, -4, 13,  0,
+  3,  1, 11,  1, 12, -4, 13,  0,
+  3,  3, 11, -1, 12, -2, 13,  0,
+  3,  1, 10,  1, 12, -5, 13,  0,
+  4,  2, 10,  1, 11, -1, 12, -4, 13,  0,
+  2,  1, 12, -4, 13,  0,
+  3,  2, 11, -1, 12, -2, 13,  0,
+  2,  1, 10, -4, 13,  0,
+  4,  1, 10,  1, 11, -1, 12, -3, 13,  0,
+  3,  2, 10, -1, 12, -4, 13,  0,
+  4,  2, 10, -1, 11, -1, 12,  2, 13,  0,
+  3,  1, 10, -1, 12,  3, 13,  0,
+  3,  1, 11, -1, 12,  4, 13,  0,
+  3,  1, 11, -1, 12, -2, 13,  0,
+  3,  1, 10, -1, 12, -3, 13,  0,
+  4,  2, 10, -1, 11, -1, 12, -4, 13,  0,
+  3,  2, 10, -1, 12,  2, 13,  0,
+  3,  2, 10, -2, 11,  1, 12,  0,
+  2,  1, 10,  2, 13,  0,
+  4,  1, 10, -1, 11,  1, 12,  1, 13,  0,
+  2,  1, 12,  2, 13,  1,
+  4,  1, 10, -1, 11, -1, 12, -3, 13,  0,
+  3,  2, 10, -3, 12, -2, 13,  0,
+  4,  2, 10,  1, 11, -1, 12,  2, 13,  0,
+  3,  2, 10, -1, 11,  1, 12,  0,
+  3,  1, 10,  1, 12,  1, 13,  0,
+  3,  1, 11,  1, 12,  2, 13,  0,
+  2,  4, 10, -1, 12,  0,
+  2,  2, 10,  1, 12,  1,
+  4,  1, 13,  1, 12, 10,  2, -2,  3,  0,
+  3,  2, 11,  1, 12,  2, 13,  0,
+  2,  2, 12,  1, 14,  0,
+  1,  3, 12,  0,
+  3,  3, 10,  1, 12, -1, 13,  0,
+  3,  2, 10,  1, 11,  1, 12,  0,
+  3,  4, 10,  1, 12, -2, 13,  0,
+  3,  2, 10,  3, 12, -2, 13,  0,
+  3,  4, 10, -9,  3, -1,  4,  0,
+  4,  1, 10,  1, 11,  1, 12, -6, 13,  0,
+  3,  1, 10,  1, 12, -6, 13,  0,
+  4,  1, 10,  2, 11, -1, 12, -4, 13,  0,
+  3,  3, 10, -1, 12, -6, 13,  0,
+  4,  1, 10, -1, 11, -1, 12,  4, 13,  0,
+  4,  1, 10,  1, 11, -1, 12, -4, 13,  0,
+  3,  1, 10, -1, 12,  4, 13,  0,
+  4,  1, 10, -2, 11,  1, 12,  2, 13,  0,
+  3,  1, 10, -1, 12, -4, 13,  0,
+  4,  3, 10, -1, 11, -1, 12,  2, 13,  0,
+  4,  1, 10,  1, 11, -1, 12,  4, 13,  0,
+  4,  1, 10, -1, 11,  1, 12,  2, 13,  0,
+  2,  1, 12,  3, 13,  0,
+  4,  1, 10, -1, 11, -1, 12, -4, 13,  0,
+  3,  3, 10, -1, 12,  2, 13,  0,
+  3,  1, 10,  1, 12,  2, 13,  0,
+  3,  1, 11,  1, 12,  3, 13,  0,
+  3,  1, 10, -3, 12, -2, 13,  0,
+  3,  3, 10, -1, 11,  1, 12,  0,
+  3,  2, 10,  1, 12,  1, 13,  0,
+  4,  1, 10,  1, 11,  1, 12,  2, 13,  0,
+  2,  3, 10,  1, 12,  0,
+  4,  2, 10,  1, 11,  1, 12,  1, 13,  0,
+  2,  1, 10,  3, 12,  0,
+  3,  3, 10,  1, 11,  1, 12,  0,
+  3,  5, 10,  1, 12, -2, 13,  0,
+  3,  4, 14, -4,  2,  8,  3,  0,
+  3,  5, 10, -9,  3, -1,  4,  0,
+  4,  2, 10,  1, 11, -1, 12, -6, 13,  0,
+  2,  1, 12, -6, 13,  0,
+  3,  2, 11, -1, 12, -4, 13,  0,
+  3,  2, 10, -1, 12, -6, 13,  0,
+  3,  1, 11, -1, 12, -4, 13,  0,
+  3,  2, 10, -1, 12,  4, 13,  0,
+  2,  1, 12,  4, 13,  0,
+  4,  2, 10, -1, 11,  1, 12,  2, 13,  0,
+  3,  1, 11,  1, 12,  4, 13,  0,
+  3,  1, 11, -3, 12, -2, 13,  0,
+  3,  4, 10, -1, 12,  2, 13,  0,
+  3,  2, 10,  1, 12,  2, 13,  0,
+  4,  2, 10,  1, 11,  1, 12,  2, 13,  0,
+  2,  4, 10,  1, 12,  0,
+  3,  7, 12, -2, 10, -4,  5,  0,
+  3,  1, 10, -1, 12, -6, 13,  0,
+  4,  1, 10, -1, 11,  1, 12,  4, 13,  0,
+  3,  1, 10,  1, 12,  4, 13,  0,
+  4,  3, 10, -1, 11,  1, 12,  2, 13,  0,
+  3,  3, 10,  1, 12,  2, 13,  0,
+  2,  5, 10,  1, 12,  0,
+  2,  1, 12,  6, 13,  0,
+  3,  2, 10,  1, 12,  4, 13,  0,
+  3,  4, 10,  1, 12,  2, 13,  0,
+ -1
+};
+
+/* Total terms = 254, small = 254 */
+static struct plantbl liblat = {
+  /*  {  0, 18, 18, 20,  4,  0,  0,  0,  0,  9,  3,  7,  9,  9,}, */
+  /* Use max of liblon, liblat.  */
+  {  0, 18, 18, 20,  4,  2,  0,  0,  0,  9, 16,  7,  9,  9,},
+ 2,
+ latargs,
+ lattabl,
+ lattabb,
+ lattabr,
+ 3.850000e+05,
+ 36525.0,
+ 1.0e-4,
+};
+
+
+/* lblon403.c */
+static int lontabr[] = {-1};
+static int lontabb[] = {-1};
+static int lontabl[] = {
+   -640001,
+
+       -19,         3,
+
+        -1,         0,
+
+        -3,        17,
+
+         2,        -9,
+
+         2,         3,
+
+       141,      1816,
+
+         2,       -76,
+
+        78,       -81,
+
+         3,         1,
+
+        50,       -13,
+
+       -12,        18,
+
+        -6,        74,
+
+        19,        10,
+
+       -19,       701,
+
+       -26,        37,
+
+        36,      -122,
+
+       131,       -71,
+
+       -40,         1,
+
+     61463,     12853,
+
+         5,       -29,
+
+       354,       201,
+
+        94,        -5,
+
+        31,        25,
+
+       -73,       -22,
+
+       673,      1435,
+
+      3844,        44,
+
+       -44,        -8,
+
+       195,       -16,
+
+      -827,   -171768,
+
+      7051,     -4116,
+
+      1036,       616,     -2034,      6300,    -13786,     -3808,
+
+      -118,      -536,     -1246,       771,      2555,      3214,
+
+       203,        26,
+
+      2975,      -715,
+
+      -743,      1286,
+
+      -232,       -50,
+
+         4,       234,
+
+      -139,       475,
+
+         0,       -98,
+
+        -3,    -11848,
+
+         0,       118,
+
+      -202,       146,
+
+    -33673,      7601,
+
+      -150,        88,
+
+     -1720,      1002,
+
+      -293,       481,
+
+     -2078,         1,
+
+       199,    220655,
+
+       137,      7459,
+
+      -127,        28,
+
+       -10,      2259,
+
+         4,       450,
+
+       -26,        30,       -76,     19043,       215,  -7577830,
+
+       -65,       -45,
+
+        -5,    -14189,
+
+        -6,      -496,
+
+         9,      3265,
+
+         0,      -131,
+
+        48,       -90,
+
+        -9,      -155,
+
+        -2,        21,
+
+       151,        19,
+
+      -101,      -516,
+
+      -827,         3,       796,         2,       134,  -2215850,
+
+       -11,     -1908,
+
+         0,       451,
+
+        -2,      1399,
+
+         3,         7,
+
+      -163,         5,
+
+     -1582,        61,
+
+       -22,    -77215,
+
+       167,   -471084,
+
+       -85,       -28,
+
+         1,      -473,
+
+        -1,       444,
+
+         4,        89,
+
+         6,       -88,
+
+      -157,    -87813,
+
+         3,       274,
+
+        -3,     -1036,
+
+         7,    -17005,
+
+        -1,      -332,
+
+         0,        50,
+
+        -1,      -228,
+
+        -5,     -2986,
+
+        -1,      -334,
+
+         1,      -452,
+
+         0,         4,
+
+         0,      -247,
+
+        -3,     -2493,
+
+        -4,     -1000,
+
+         0,      -160,
+
+         0,     -3163,
+
+       -75,    -74207,
+
+        13,       829,
+
+        32,       481,
+
+       -33,    -11859,
+
+        -2,     -3634,
+
+         7,     -1611,
+
+         3,       520,
+
+        -1,      2534,
+
+         5,      -446,
+
+      -471,         8,       399,      5160,       201,  -2057189,
+
+        83,     -2106,
+
+        11,     12240,
+
+         3,      -270,
+
+       248,      1112,
+
+       -63,    -61809,
+
+      -183,       594,
+
+        27,     25844,
+
+        -3,      5594,
+
+         8,       571,
+
+       -23,     -1855,
+
+       477,      -466,
+
+         0,     -1257,
+
+       247,      1550,
+
+    -10178,      -175,      9570,      -423,      2610, -45917681,
+
+       -51,       937,
+
+     -1001,       168,
+
+      -168,       882,
+
+      1260,     -2894,      4306,     -1515,
+
+         7,       402,
+
+         0,        36,
+
+      -280,      -373,
+
+       -19,       840,
+
+     -1227,      -138,
+
+      3486,   1478247,
+
+      1649,      -644,
+
+       840,       377,
+
+        47,     -1464,
+
+       167,  -1251123,
+
+      -194,      -713,       133,    284429,
+
+         0,      -191,
+
+        -3,      1534,
+
+      -700,       918,
+
+        -7,      -633,
+
+      -221,      -559,
+
+         1,        99,
+
+       -17,     -3513,
+
+       -30,        14,
+
+      -602,     -5006,
+
+       908,      4178,
+
+       542,      -379,
+
+      1568,       782,       528,      2761,
+
+    -38994,    -25804,
+
+   1696398,   -324306,
+
+     47292,     71061,    457883,     52470,    159777, 224906030,
+
+    -13068,    -18508,
+
+      -104,      3754,
+
+       541,       614,      -290,      1412,
+
+       -48,       162,
+
+        42,       -50,
+
+      -609,     -4969,
+
+        44,    -11435,
+
+      -473,      -412,
+
+        22,     -6389,
+
+       -87,        44,
+
+       -39,    180182,
+
+     -4186,     -2227,
+
+      -503,      -208,
+
+       976,      -512,     -1016,     -4403,
+
+        16,     25357,
+
+       565,      -891,
+
+        28,     38836,
+
+      -659,      -855,
+
+      -200,       619,
+
+         1,     -1780,
+
+        24,     17531,
+
+      1053,       335,
+
+       502,      2745,      -309,  -1094576,
+
+        -1,      -263,
+
+         3,      -394,
+
+         0,      4152,
+
+        -1,      -467,
+
+      -339,   -132142,
+
+       -14,    -11676,
+
+        29,     63360,
+
+         0,       129,
+
+       -12,     -4802,
+
+        -1,      -180,
+
+         2,      3424,
+
+         0,        45,
+
+        -1,      -155,
+
+        -1,       -74,
+
+         0,      -134,
+
+        -4,     -1588,
+
+        -1,     -3424,
+
+         2,       119,
+
+       -57,    -27417,
+
+         0,       168,
+
+         0,       206,
+
+       -21,    -80823,
+
+         8,      2324,
+
+        -4,       835,
+
+       396,        -6,      -244,   -308040,
+
+         0,      -294,
+
+       -56,     -1332,
+
+         2,      -110,
+
+       306,      4060,       -58,  -1644587,
+
+      -155,      -210,
+
+        67,     -1642,
+
+        27,     32070,
+
+         9,      3592,
+
+        -8,       -17,
+
+        -1,         2,
+
+        -9,     -4580,
+
+         5,      1940,
+
+         5,     -1217,
+
+        62,      -862,
+
+      -522,     -1163,
+
+         0,         0,
+
+     -1646,         1,      1169,       109,      1395,  23634968,
+
+         2,         0,
+
+      -512,      1148,
+
+        -9,        32,
+
+         0,     -2749,
+
+       969,        -4,
+
+         2,       351,
+
+         1,       105,
+
+       152,     97075,
+
+       -55,    -84524,
+
+       -49,       607,        29,   -242117,
+
+         4,      6518,
+
+         5,       -77,
+
+         1,       -39,
+
+         9,         1,
+
+         5,      -231,
+
+      2296,       -10,     -2453,         3,       138,   7689964,
+
+         0,      -689,
+
+         1,     12635,
+
+      5444,       372,
+
+         9,     -1843,
+
+      3485,      -560,
+
+       909,         3,      -742,        -1,       -66,  -6945414,
+
+         8,        -7,
+
+        -3,      -181,
+
+         1,      1282,
+
+      -115,    -76497,
+
+         3,       -90,
+
+         1,      -142,
+
+        -5,     10263,
+
+       -33,     -9479,
+
+         0,      -657,
+
+        19,     15040,
+
+        -2,      1084,
+
+        -1,      -295,
+
+      -161,       403,
+
+         0,      -175,
+
+        -1,      -392,
+
+        -4,     -3096,
+
+        -9,     -2928,
+
+         1,       332,
+
+       -56,    -43733,
+
+         1,       572,
+
+         2,      -660,
+
+         4,      7540,
+
+         4,      -659,
+
+      -505,   -382941,
+
+        -3,       256,
+
+         2,        30,
+
+        76,    145296,
+
+        -4,      4115,
+
+         9,      6329,
+
+        11,      6962,
+
+         0,      -338,
+
+         1,       153,
+
+         2,      -147,
+
+      -270,       211,
+
+      -519,        97,       385,   1912268,
+
+        -1,      1495,
+
+        -3,       223,
+
+       254,    152832,
+
+        15,      6709,
+
+        -8,     -5835,
+
+       -12,    -29016,
+
+         0,     -5641,
+
+        -2,      4217,
+
+        -2,     -1176,
+
+      -496,         4,       331,    360972,
+
+         1,       918,
+
+        -2,      -136,
+
+      -111,   -762309,
+
+         2,      -610,
+
+         1,        96,
+
+       -11,     -5468,
+
+         0,      4856,
+
+         0,        -2,
+
+       -16,      -668,
+
+        20,      1963,
+
+        -1,       -95,
+
+         0,       -83,
+
+         0,       -96,
+
+        -2,      -902,
+
+         0,     -1523,
+
+       -14,     -5691,
+
+       -10,    -18650,
+
+         0,       131,
+
+         0,       128,
+
+         0,       243,
+
+         1,       644,
+
+       -76,    138046,
+
+        -1,       316,
+
+         8,      2703,
+
+        15,     11758,
+
+        -1,        16,
+
+         2,     -2867,
+
+         5,      6504,
+
+       180,    143085,
+
+        -1,       224,
+
+        86,    -96384,
+
+         1,       471,
+
+         0,      -407,
+
+        -3,     -2886,
+
+        -1,      -919,
+
+         0,       742,
+
+        -2,      1145,
+
+        59,     19306,
+
+         0,        67,
+
+       -61,    -67569,
+
+       -14,     11725,
+
+        -1,      -395,
+
+         1,       772,
+
+        -1,       -49,
+
+       563,       871,      1951,       -22,
+
+        -1,      -711,
+
+         0,       240,
+
+        -6,     -3912,
+
+         1,      2812,
+
+         0,       106,
+
+         0,       378,
+
+         4,     19609,
+
+         6,      3331,
+
+         2,       930,
+
+         0,       -37,
+
+         0,      -502,
+
+         0,     -1257,
+
+        21,     10531,
+
+         2,    -16662,
+
+         0,      -267,
+
+        -1,        22,
+
+         6,      1104,
+
+       -14,     -5544,
+
+         1,      -250,
+
+        -1,      1248,
+
+         0,       325,
+
+         2,      2163,
+
+         2,     -1421,
+
+         0,        73,
+
+        -1,       -67,
+
+         2,       771,
+
+        -1,     -2085,
+
+         0,        67,
+
+         1,       226,
+
+         1,       212,
+
+         0,        56,
+
+};
+
+static CHAR lonargs[] = {
+  0,  0,
+  4,  1, 10,  3, 11,-18,  2, 13,  3,  0,
+  4, -2, 12,  2, 13,  5,  2, -6,  3,  0,
+  4,  2, 10, -2, 13, -2,  3,  3,  5,  0,
+  3,  1, 10, -1, 14,  1,  5,  0,
+  4, -2, 10,  2, 13, -5,  3, -6,  4,  0,
+  2,  1, 12, -1, 14,  0,
+  4, -2, 10,  2, 13,  2,  3, -2,  5,  0,
+  2,  1,  3, -2,  4,  0,
+  4, -1, 12,  1, 13, -3,  2,  6,  3,  0,
+  1,  1,  5,  0,
+  4, -1, 10,  2, 13,-15,  2, 13,  3,  0,
+  4,  2, 10, -2, 13, -3,  2,  3,  3,  0,
+  2,  2, 12, -2, 14,  0,
+  3,  1, 10, -1, 11, -1, 13,  0,
+  2, 11,  2,-18,  3,  0,
+  2,  3,  2, -5,  3,  0,
+  2,  2,  3, -4,  4,  0,
+  2,  5,  2, -8,  3,  0,
+  2,  1, 10, -1, 12,  0,
+  4, -1, 12,  1, 14,  3,  2, -5,  3,  0,
+  3,  6, 12, -6, 13, -4,  2,  0,
+  2,  3,  3, -6,  4,  0,
+  2,  5,  3, -9,  4,  0,
+  4, -1, 10,  2, 13,-18,  2, 18,  3,  0,
+  3,  2, 10, -2,  3, -2, 13,  0,
+  2,  2,  2, -3,  3,  0,
+  4,  2, 10, -2, 13, -4,  2,  5,  3,  0,
+  2,  4,  3, -7,  4,  0,
+  2,  2, 10, -2, 12,  0,
+  2,  3,  3, -5,  4,  0,
+  3,  3,  2, -4,  3, -1,  4,  2,
+  3,  1,  2, -5,  3,  7,  4,  2,
+  4, -2, 10,  2, 13,  5,  2, -6,  3,  0,
+  2,  1,  2, -2,  3,  0,
+  2,  2,  3, -3,  4,  0,
+  4, -1, 12,  1, 14,  4,  2, -6,  3,  0,
+  2,  1,  3, -1,  4,  0,
+  2,  4,  2, -6,  3,  0,
+  4,  2, 10, -2, 13, -2,  2,  2,  3,  0,
+  2,  1,  2, -1,  3,  0,
+  3,  2, 10,  1, 11, -2, 12,  0,
+  2,  1,  3, -3,  5,  0,
+  3,  2, 10, -1,  3, -2, 13,  0,
+  2,  4,  3, -6,  4,  0,
+  2,  1,  3, -2,  5,  0,
+  2,  3,  3, -4,  4,  0,
+  2,  3,  2, -4,  3,  0,
+  2,  1, 10, -1, 13,  0,
+  2,  1,  3, -1,  5,  0,
+  2,  1,  3, -2,  6,  0,
+  2,  2,  3, -2,  4,  0,
+  2,  1,  3, -1,  6,  0,
+  1,  1, 11,  2,
+  2,  1,  3,  1,  5,  0,
+  3,  1, 11, -2, 12,  2, 13,  0,
+  3,  1, 10, -2, 12,  1, 13,  0,
+  2,  2,  2, -2,  3,  0,
+  3,  2, 10, -1, 11, -2, 12,  0,
+  2,  4,  3, -5,  4,  0,
+  2,  3,  3, -3,  4,  0,
+  3,  4, 10, -2, 12, -2, 13,  0,
+  1,  1,  2,  0,
+  2,  2,  3, -3,  5,  0,
+  2,  2, 10, -2, 13,  2,
+  2,  2,  3, -2,  5,  0,
+  2,  3,  3, -3,  2,  0,
+  3,  1, 10,  1, 11, -1, 13,  0,
+  3,  3,  3, -1,  2,  1,  4,  0,
+  2,  2,  3, -1,  5,  0,
+  3,  1, 10,  1, 12, -2, 13,  0,
+  1,  2, 11,  0,
+  2,  2, 12, -2, 13,  0,
+  2,  2,  2, -1,  3,  0,
+  2,  4,  2, -4,  3,  0,
+  2,  3, 10, -3, 13,  0,
+  4,  2, 10, -2, 13,  1,  3, -1,  5,  0,
+  2,  3,  3, -3,  5,  0,
+  3,  2, 10,  1, 11, -2, 13,  0,
+  3,  1, 10,  2, 12, -3, 13,  0,
+  1,  3, 11,  0,
+  3,  1, 11,  2, 12, -2, 13,  0,
+  2,  5,  2, -5,  3,  0,
+  2,  4, 10, -4, 13,  0,
+  2,  6,  2, -6,  3,  0,
+  3,  2, 10,  2, 11, -2, 13,  0,
+  3,  2, 10,  2, 12, -4, 13,  0,
+  3,  2, 11,  2, 12, -2, 13,  0,
+  3,  4, 10,  1, 11, -4, 13,  0,
+  4,  1, 10,  1, 11,  2, 12, -4, 13,  0,
+  3,  1, 10,  3, 11, -2, 13,  0,
+  3,  3, 10,  1, 11, -4, 13,  0,
+  4,  1, 10, -2, 11, -2, 12,  2, 13,  0,
+  3,  1, 10,  2, 12, -4, 13,  0,
+  3,  1, 10,  2, 11, -2, 13,  0,
+  3,  2, 10,  1, 11, -3, 13,  0,
+  3,  1, 13, -2,  2,  1,  4,  0,
+  2,  3, 10, -4, 13,  0,
+  4,  1, 10, -1, 11, -2, 12,  2, 13,  0,
+  4, -1, 10,  2, 13, -2,  2,  2,  3,  0,
+  2,  1, 10, -3, 11,  0,
+  2,  2, 12, -3, 13,  0,
+  2,  2, 11, -1, 13,  0,
+  3,  1, 10,  1, 11, -2, 13,  2,
+  4, -1, 10,  2, 13, -1,  3,  1,  5,  0,
+  2,  2, 10, -3, 13,  0,
+  3,  3, 10, -1, 11, -4, 13,  0,
+  3,  4, 11,  2, 13,-11,  2,  0,
+  3,  1, 10, -2, 12,  2, 13,  0,
+  3,  1, 12, -2, 13,  1,  5,  0,
+  2,  1, 10, -2, 11,  0,
+  2,  1, 11, -1, 13,  0,
+  3,  1, 10, -2, 13,  1,  5,  0,
+  3,  1, 10, -2,  3,  2,  5,  0,
+  3, 18,  2,-18,  3,  2,  5,  0,
+  3,  1, 10, -3,  2,  3,  3,  0,
+  3,  2, 13, 16, 11,-18,  2,  0,
+  2,  1, 10, -2, 13,  2,
+  3,  1, 13, -2, 10,  5,  4,  0,
+  3,  2, 12, -2, 14,  7,  2,  0,
+  3,  1, 10, -2,  3,  3,  5,  0,
+  3,  1, 12, -1,  3, -2,  5,  1,
+  3,  2, 10, -1, 11, -3, 13,  0,
+  3,  3, 10, -2, 12, -2, 13,  0,
+  2,  8,  2, -1,  3,  0,
+  4,  1, 10,  1, 11, -2, 12,  2, 13,  0,
+  3,  1, 12, -2, 14,  2,  4,  0,
+  2,  1, 10, -1, 11,  0,
+  3,  8,  2, -5,  3,  8,  4,  0,
+  2, 18,  2,-17,  3,  0,
+  3,  1, 10, -1,  3,  1,  5,  0,
+  1,  1, 13,  0,
+  3,  1, 10, -1, 11, -2, 13,  1,
+  3,  1, 10,  1, 11, -2, 12,  0,
+  3,  1, 10, -1,  2,  1,  3,  0,
+  3,  2, 13, -8,  2,  1,  3,  0,
+  2,  3, 10, -2, 12,  0,
+  3,  2, 10, -1, 12, -1,  5,  0,
+  3,  3, 10, -2, 11, -2, 13,  0,
+  3,  2, 10, -1, 11, -1, 13,  0,
+  3,  2, 10,  1,  3, -2,  4,  0,
+  3,  1, 12, -1, 10, -1, 14,  0,
+  4, -1, 10,  2, 13,  2,  3, -3,  5,  0,
+  3,  2, 13, -4,  2, -5,  3,  0,
+  3,  2, 12,  2, 10, -3, 14,  1,
+  2,  1, 12, -2,  5,  0,
+  2, 10,  2, -3, 11,  0,
+  1,  1, 10,  2,
+  3,  1, 12, -2, 10, -2,  5,  0,
+  2, 18,  2,-16,  3,  0,
+  2,  2, 12, -3, 14,  1,
+  3,  1, 13,-17,  2,  2, 11,  0,
+  3,  1, 10,  1,  2, -3,  4,  0,
+  3,  1, 12,  1, 10, -1, 14,  0,
+  4, -1, 10,  2, 13,  2,  3, -2,  5,  0,
+  3,  1, 10, -1,  3,  2,  4,  0,
+  4, -1, 10,  2, 13,  3,  2, -3,  3,  0,
+  4,  1, 10, -2, 11,  2, 12, -2, 13,  0,
+  2,  1, 11,  1, 13,  0,
+  3,  8,  2,  2,  3, -3,  4,  0,
+  1,  1, 12,  0,
+  3,  6,  2,  9,  3,-10,  4,  1,
+  3,  1, 10, -2, 11, -2, 13,  0,
+  2,  8,  2,  1,  4,  0,
+  2,  1, 10, -2, 12,  0,
+  2, 11,  2, -4,  3,  0,
+  3,  3, 11, -2, 14,  6,  2,  0,
+  3,  3, 10, -1, 11, -2, 13,  0,
+  2,  2, 10, -1, 13,  0,
+  3,  1, 12, -2,  2,  4,  3,  0,
+  2,  1, 10,  1, 11,  1,
+  4,  1, 10, -1, 11,  2, 12, -2, 13,  0,
+  2,  2, 11,  1, 13,  0,
+  2,  2, 12, -1, 13,  0,
+  3,  1, 10, -1, 11, -2, 12,  0,
+  2,  3, 10, -2, 13,  0,
+  2,  1, 10,  2, 11,  0,
+  3,  1, 10,  2, 12, -2, 13,  0,
+  3,  1, 11,  2, 12, -1, 13,  0,
+  3,  3, 10,  1, 11, -2, 13,  0,
+  2,  1, 10,  3, 11,  0,
+  4,  1, 10,  1, 11,  2, 12, -2, 13,  0,
+  2,  5, 10, -4, 13,  0,
+  3,  3, 10,  2, 11, -2, 13,  0,
+  3,  3, 10,  2, 12, -4, 13,  0,
+  2,  4, 11, -2, 13,  0,
+  3,  2, 10,  2, 11, -4, 13,  0,
+  2,  3, 11, -2, 13,  0,
+  3,  1, 10,  2, 11, -3, 13,  0,
+  3,  2, 10,  1, 11, -4, 13,  0,
+  2,  3, 10, -5, 13,  0,
+  2,  2, 12, -4, 13,  0,
+  2,  2, 11, -2, 13,  0,
+  3,  1, 10,  1, 11, -3, 13,  0,
+  3,  2, 13, -2,  3,  2,  5,  0,
+  2,  2, 10, -4, 13,  1,
+  4,  2, 10, -1, 11, -2, 12,  2, 13,  0,
+  2,  2, 14, -2,  2,  0,
+  3,  1, 10, -2, 12,  3, 13,  0,
+  2,  1, 11, -2, 13,  1,
+  3,  2, 14, -2,  2,  3,  5,  0,
+  3,  2, 13, -1,  3,  1,  5,  0,
+  2,  1, 10, -3, 13,  0,
+  3,  2, 10, -1, 11, -4, 13,  0,
+  4,  2, 10,  1, 11, -2, 12, -2, 13,  0,
+  3,  2, 13,  1, 14, -8,  2,  0,
+  3,  2, 10, -2, 12,  2, 13,  0,
+  2,  2, 10, -2, 11,  0,
+  3,  1, 10, -1, 11,  1, 13,  0,
+  3,  1, 12, -2, 13, -1, 14,  0,
+  3,  2, 13, -8,  2, 13,  3,  0,
+  3,  3, 10, -5, 13,  5,  4,  0,
+  1,  2, 13,  2,
+  3,  3, 10, -1, 13,  5,  4,  0,
+  3,  2, 13,  8,  2,-13,  3,  0,
+  2,  2, 11, -2, 12,  0,
+  3,  1, 10, -1, 11, -3, 13,  0,
+  3,  1, 10, -1, 12, -2, 13,  0,
+  3,  2, 10, -2, 11, -4, 13,  0,
+  3,  2, 10, -2, 12, -2, 13,  0,
+  2,  2, 10, -1, 11,  0,
+  2,  1, 10,  1, 13,  0,
+  2,  1, 11,  2, 13,  1,
+  2,  1, 11, -2, 12,  0,
+  3,  1, 10, -2, 12, -1, 13,  0,
+  2,  4, 10, -2, 12,  0,
+  2,  3, 10, -1, 12,  0,
+  3,  3, 10, -1, 11, -1, 13,  0,
+  1,  2, 10,  2,
+  2,  2, 14, -2,  5,  0,
+  3,  1, 10,  1, 11,  1, 13,  0,
+  2,  1, 10,  1, 12,  0,
+  2,  2, 11,  2, 13,  0,
+  2,  1, 12,  1, 14,  0,
+  1,  2, 12,  2,
+  2,  1, 10, -3, 12,  0,
+  3,  4, 10, -1, 11, -2, 13,  0,
+  2,  3, 10, -1, 13,  0,
+  2,  2, 10,  1, 11,  0,
+  3,  1, 10,  2, 11,  1, 13,  0,
+  3,  1, 10,  2, 12, -1, 13,  0,
+  2,  1, 11,  2, 12,  0,
+  2,  4, 10, -2, 13,  0,
+  2,  2, 10,  2, 11,  0,
+  3,  2, 10,  2, 12, -2, 13,  0,
+  2,  4, 12, -2, 13,  0,
+  3,  4, 10,  1, 11, -2, 13,  0,
+  3,  2, 13, 11,  2,-13,  3,  0,
+  3,  1, 10,  3, 11, -4, 13,  0,
+  3,  3, 10,  1, 11, -6, 13,  0,
+  3,  1, 10,  2, 11, -4, 13,  0,
+  2,  3, 10, -6, 13,  0,
+  3,  1, 10, -3, 11,  2, 13,  0,
+  3,  1, 10,  1, 11, -4, 13,  0,
+  2,  2, 10, -5, 13,  0,
+  3,  1, 10, -2, 12,  4, 13,  0,
+  3,  1, 10, -2, 11,  2, 13,  0,
+  2,  1, 11, -3, 13,  0,
+  2,  1, 10, -4, 13,  0,
+  4,  1, 10,  2, 11, -2, 12, -2, 13,  0,
+  3,  3, 10, -2, 12, -4, 13,  0,
+  3,  1, 10, -1, 11,  2, 13,  0,
+  1,  3, 13,  0,
+  3,  1, 10, -1, 11, -4, 13,  0,
+  4,  1, 10,  1, 11, -2, 12, -2, 13,  0,
+  3,  3, 10, -2, 12,  2, 13,  0,
+  2,  3, 10, -2, 11,  0,
+  3,  2, 10, -1, 11,  1, 13,  0,
+  3,  1, 12,  2, 13, -2,  5,  0,
+  2,  1, 10,  2, 13,  1,
+  2,  1, 11,  3, 13,  0,
+  3,  1, 10, -2, 11, -4, 13,  0,
+  3,  1, 10, -2, 12, -2, 13,  0,
+  2,  3, 10, -1, 11,  0,
+  2,  2, 10,  1, 13,  0,
+  3,  1, 10,  1, 11,  2, 13,  0,
+  3,  1, 10, -1, 11,  2, 12,  0,
+  2,  2, 12,  1, 13,  0,
+  4,  1, 10, -1, 11, -2, 12, -2, 13,  0,
+  1,  3, 10,  1,
+  3,  2, 10,  1, 11,  1, 13,  0,
+  3,  1, 10,  2, 11,  2, 13,  0,
+  2,  1, 10,  2, 12,  0,
+  3,  1, 11,  2, 12,  1, 13,  0,
+  2,  4, 10, -1, 13,  0,
+  2,  3, 10,  1, 11,  0,
+  3,  1, 10,  1, 11,  2, 12,  0,
+  4,  1, 10, -1, 11,  4, 12, -2, 13,  0,
+  2,  5, 10, -2, 13,  0,
+  3,  3, 10,  2, 12, -2, 13,  0,
+  3,  1, 10,  4, 12, -2, 13,  0,
+  3,  2, 10,  2, 11, -6, 13,  0,
+  2,  3, 11, -4, 13,  0,
+  3,  2, 10,  1, 11, -6, 13,  0,
+  2,  2, 11, -4, 13,  0,
+  2,  2, 10, -6, 13,  0,
+  2,  1, 11, -4, 13,  0,
+  2,  1, 10, -5, 13,  0,
+  3,  2, 10, -1, 11, -6, 13,  0,
+  4,  2, 10,  1, 11, -2, 12, -4, 13,  0,
+  3,  2, 10, -2, 11,  2, 13,  0,
+  1,  4, 13,  0,
+  3,  2, 11, -2, 12, -2, 13,  0,
+  3,  2, 10, -2, 12, -4, 13,  0,
+  3,  2, 10, -1, 11,  2, 13,  0,
+  2,  1, 10,  3, 13,  0,
+  2,  1, 11,  4, 13,  0,
+  3,  1, 11, -2, 12, -2, 13,  0,
+  2,  2, 10,  2, 13,  0,
+  3,  1, 10,  1, 11,  3, 13,  0,
+  2,  2, 12,  2, 13,  0,
+  2,  4, 10, -1, 11,  0,
+  2,  3, 10,  1, 13,  0,
+  3,  2, 10,  1, 11,  2, 13,  0,
+  3,  2, 10, -1, 11,  2, 12,  0,
+  3,  1, 10,  2, 12,  1, 13,  0,
+  3,  1, 11,  2, 12,  2, 13,  0,
+  1,  4, 10,  0,
+  3,  3, 10,  1, 11,  1, 13,  0,
+  2,  2, 10,  2, 12,  0,
+  1,  4, 12,  0,
+  2,  4, 10,  1, 11,  0,
+  3,  2, 10,  1, 11,  2, 12,  0,
+  2,  6, 10, -2, 13,  0,
+  3,  5, 12, -1, 14,  2,  4,  1,
+  3,  1, 10,  1, 11, -6, 13,  0,
+  3,  1, 10, -2, 11,  4, 13,  0,
+  2,  1, 10, -6, 13,  0,
+  3,  1, 10, -1, 11,  4, 13,  0,
+  3,  1, 10, -1, 11, -6, 13,  0,
+  4,  1, 10,  1, 11, -2, 12, -4, 13,  0,
+  2,  1, 10,  4, 13,  0,
+  3,  1, 10, -2, 12, -4, 13,  0,
+  3,  3, 10, -1, 11,  2, 13,  0,
+  2,  2, 10,  3, 13,  0,
+  3,  1, 10,  1, 11,  4, 13,  0,
+  4,  1, 10, -1, 11,  2, 12,  2, 13,  0,
+  2,  3, 10,  2, 13,  0,
+  3,  1, 10,  2, 12,  2, 13,  0,
+  3,  3, 10,  1, 11,  2, 13,  0,
+  3,  1, 10, -1, 11,  4, 12,  0,
+  1,  5, 10,  0,
+  2,  3, 10,  2, 12,  0,
+  2,  1, 11, -6, 13,  0,
+  1,  6, 13,  0,
+  3,  2, 10, -1, 11,  4, 13,  0,
+  2,  2, 10,  4, 13,  0,
+  2,  2, 12,  4, 13,  0,
+  3,  4, 10, -1, 11,  2, 13,  0,
+  3,  2, 10,  1, 11,  4, 13,  0,
+  2,  4, 10,  2, 13,  0,
+  3,  2, 10,  2, 12,  2, 13,  0,
+  1,  6, 10,  0,
+  2,  1, 10,  6, 13,  0,
+  2,  3, 10,  4, 13,  0,
+  2,  5, 10,  2, 13,  0,
+ -1
+};
+
+/* Total terms = 356, small = 356 */
+static struct plantbl liblon = {
+  /*  {  0, 18, 18, 10,  3,  2,  0,  0,  0,  6, 16,  6,  6,  3,}, */
+  /* Use max of liblon, liblat.  */
+  {  0, 18, 18, 20,  4,  2,  0,  0,  0,  9, 16,  7,  9,  9,},
+ 2,
+ lonargs,
+ lontabl,
+ lontabb,
+ lontabr,
+ 3.850000e+05,
+ 36525.0,
+ 1.0e-4,
+};
+
+
+
+/* given a Julian date, return the lunar libration in lat and long, in rads.
+ */
+void
+llibration (JD, llatp, llonp)
+double JD;
+double *llatp;
+double *llonp;
+{
+	double lon, lat;	/* arc seconds */
+	
+	lon = gplan (JD, &liblon);
+	lat = gplan (JD, &liblat);
+
+	*llonp = degrad (lon/3600.0);
+	*llatp = degrad (lat/3600.0);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: libration.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/misc.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/misc.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/misc.c	(revision 1457)
@@ -0,0 +1,475 @@
+/* misc handy functions.
+ * every system has such, no?
+ *  4/20/98 now_lst() always just returns apparent time
+ */
+
+#include <stdio.h>
+#include <math.h>
+
+#if defined(__STDC__)
+#include <stdlib.h>
+#include <string.h>
+#else
+extern double atof();
+#endif
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+
+/* zero from loc for len bytes */
+void
+zero_mem (loc, len)
+void *loc;
+unsigned len;
+{
+	(void) memset (loc, 0, len);
+}
+
+/* given min and max and an approximate number of divisions desired,
+ * fill in ticks[] with nicely spaced values and return how many.
+ * N.B. return value, and hence number of entries to ticks[], might be as
+ *   much as 2 more than numdiv.
+ */
+int
+tickmarks (min, max, numdiv, ticks)
+double min, max;
+int numdiv;
+double ticks[];
+{
+        static int factor[] = { 1, 2, 5 };
+        double minscale;
+        double delta;
+	double lo;
+        double v;
+        int n;
+
+        minscale = fabs(max - min);
+        delta = minscale/numdiv;
+        for (n=0; n < sizeof(factor)/sizeof(factor[0]); n++) {
+	    double scale;
+	    double x = delta/factor[n];
+            if ((scale = (pow(10.0, ceil(log10(x)))*factor[n])) < minscale)
+		minscale = scale;
+	}
+        delta = minscale;
+
+        lo = floor(min/delta);
+        for (n = 0; (v = delta*(lo+n)) < max+delta; )
+	    ticks[n++] = v;
+
+	return (n);
+}
+
+/* given an Obj *, return its type as a descriptive string.
+ * if it's of type fixed then return its class description.
+ * N.B. we return the address of static storage -- do not free or change.
+ */
+char *
+obj_description (op)
+Obj *op;
+{
+	static struct {
+	    char class;
+	    char *desc;
+	} fixed_class_map[] = {
+	    {'A', "Cluster of Galaxies"},
+	    {'B', "Binary Star"},
+	    {'C', "Globular Cluster"},
+	    {'D', "Double Star"},
+	    {'F', "Diffuse Nebula"},
+	    {'G', "Spiral Galaxy"},
+	    {'H', "Spherical Galaxy"},
+	    {'J', "Radio"},
+	    {'K', "Dark Nebula"},
+	    {'L', "Pulsar"},
+	    {'M', "Multiple Star"},
+	    {'N', "Bright Nebula"},
+	    {'O', "Open Cluster"},
+	    {'P', "Planetary Nebula"},
+	    {'Q', "Quasar"},
+	    {'R', "Supernova Remnant"},
+	    {'S', "Star"},
+	    {'T', "Star-like Object"},
+	    {'U', "Cluster, with nebulosity"},
+	    {'V', "Variable Star"},
+	};
+#define	NFCM	(sizeof(fixed_class_map)/sizeof(fixed_class_map[0]))
+
+	switch (op->o_type) {
+	case FIXED:
+	    if (op->f_class) {
+		int i;
+		for (i = 0; i < NFCM; i++)
+		    if (fixed_class_map[i].class == op->f_class)
+			return (fixed_class_map[i].desc);
+	    }
+	    return (op->o_type == FIXED ? "Fixed" : "Field Star");
+	case PARABOLIC:
+	    return ("Solar - Parabolic");
+	case HYPERBOLIC:
+	    return ("Solar - Hyperbolic");
+	case ELLIPTICAL:
+	    return ("Solar - Elliptical");
+	case PLANET:
+	    return ("Planet");
+	case EARTHSAT:
+	    return ("Earth Sat");
+	default:
+	    printf ("obj_description: unknown type: 0x%x\n", op->o_type);
+	    exit (1);
+	    return (NULL);	/* for lint */
+	}
+}
+
+/* given a Now *, find the local apparent sidereal time, in hours.
+ */
+void
+now_lst (np, lstp)
+Now *np;
+double *lstp;
+{
+	static double last_mjd = -23243, last_lng = 121212, last_lst;
+	double eps, lst, deps, dpsi;
+
+	if (last_mjd == mjd && last_lng == lng) {
+	    *lstp = last_lst;
+	    return;
+	}
+
+	utc_gst (mjd_day(mjd), mjd_hr(mjd), &lst);
+	lst += radhr(lng);
+
+	obliquity(mjd, &eps);
+	nutation(mjd, &deps, &dpsi);
+	lst += radhr(dpsi*cos(eps+deps));
+
+	range (&lst, 24.0);
+
+	last_mjd = mjd;
+	last_lng = lng;
+	*lstp = last_lst = lst;
+}
+
+/* convert ra to ha, in range -PI .. PI.
+ * need dec too if not already apparent.
+ */
+void
+radec2ha (np, ra, dec, hap)
+Now *np;
+double ra, dec;
+double *hap;
+{
+	double ha, lst;
+
+	if (epoch != EOD)
+	    as_ap (np, epoch, &ra, &dec);
+	now_lst (np, &lst);
+	ha = hrrad(lst) - ra;
+	if (ha < -PI) ha += 2*PI;
+	if (ha >  PI) ha -= 2*PI;
+	*hap = ha;
+}
+
+/* given a circle and a line segment, find a segment of the line inside the 
+ *   circle.
+ * return 0 and the segment end points if one exists, else -1.
+ * We use a parametric representation of the line:
+ *   x = x1 + (x2-x1)*t and y = y1 + (y2-y1)*t, 0 < t < 1
+ * and a centered representation of the circle:
+ *   (x - xc)**2 + (y - yc)**2 = r**2
+ * and solve for the t's that work, checking for usual conditions.
+ */
+int
+lc (cx, cy, cw, x1, y1, x2, y2, sx1, sy1, sx2, sy2)
+int cx, cy, cw;			/* circle bounding box corner and width */
+int x1, y1, x2, y2;		/* line segment endpoints */
+int *sx1, *sy1, *sx2, *sy2;	/* segment inside the circle */
+{
+	int dx = x2 - x1;
+	int dy = y2 - y1;
+	int r = cw/2;
+	int xc = cx + r;
+	int yc = cy + r;
+	int A = x1 - xc;
+	int B = y1 - yc;
+	double a = dx*dx + dy*dy;	/* O(2 * 2**16 * 2**16) */
+	double b = 2*(dx*A + dy*B);	/* O(4 * 2**16 * 2**16) */
+	double c = A*A + B*B - r*r;	/* O(2 * 2**16 * 2**16) */
+	double d = b*b - 4*a*c;		/* O(2**32 * 2**32) */
+	double sqrtd;
+	double t1, t2;
+
+	if (d <= 0)
+	    return (-1);	/* containing line is purely outside circle */
+
+	sqrtd = sqrt(d);
+	t1 = (-b - sqrtd)/(2.0*a);
+	t2 = (-b + sqrtd)/(2.0*a);
+
+	if (t1 >= 1.0 || t2 <= 0.0)
+	    return (-1);	/* segment is purely outside circle */
+
+	/* we know now that some part of the segment is inside,
+	 * ie, t1 < 1 && t2 > 0
+	 */
+
+	if (t1 <= 0.0) {
+	    /* (x1,y1) is inside circle */
+	    *sx1 = x1;
+	    *sy1 = y1;
+	} else {
+	    *sx1 = (int)(x1 + dx*t1);
+	    *sy1 = (int)(y1 + dy*t1);
+	}
+
+	if (t2 >= 1.0) {
+	    /* (x2,y2) is inside circle */
+	    *sx2 = x2;
+	    *sy2 = y2;
+	} else {
+	    *sx2 = (int)(x1 + dx*t2);
+	    *sy2 = (int)(y1 + dy*t2);
+	}
+
+	return (0);
+}
+
+/* compute visual magnitude using the H/G parameters used in the Astro Almanac.
+ * these are commonly used for asteroids.
+ */
+void
+hg_mag (h, g, rp, rho, rsn, mp)
+double h, g;
+double rp;	/* sun-obj dist, AU */
+double rho;	/* earth-obj dist, AU */
+double rsn;	/* sun-earth dist, AU */
+double *mp;
+{
+	double psi_t, Psi_1, Psi_2, beta;
+	double c;
+	double tb2;
+
+	c = (rp*rp + rho*rho - rsn*rsn)/(2*rp*rho);
+	if (c <= -1)
+	    beta = PI;
+	else if (c >= 1)
+	    beta = 0;
+	else
+	    beta = acos(c);;
+	tb2 = tan(beta/2.0);
+	/* psi_t = exp(log(tan(beta/2.0))*0.63); */
+	psi_t = pow (tb2, 0.63);
+	Psi_1 = exp(-3.33*psi_t);
+	/* psi_t = exp(log(tan(beta/2.0))*1.22); */
+	psi_t = pow (tb2, 1.22);
+	Psi_2 = exp(-1.87*psi_t);
+	*mp = h + 5.0*log10(rp*rho) - 2.5*log10((1-g)*Psi_1 + g*Psi_2);
+}
+
+/* given faintest desired mag, mag step magstp, image scale and object
+ * magnitude and size, return diameter to draw object, in pixels, or 0 if
+ * dimmer than fmag.
+ */
+int
+magdiam (fmag, magstp, scale, mag, size)
+int fmag;	/* faintest mag */
+int magstp;	/* mag range per dot size */
+double scale;	/* rads per pixel */
+double mag;	/* magnitude */
+double size;	/* rads, or 0 */
+{
+	int diam, sized;
+	
+	if (mag > fmag)
+	    return (0);
+	diam = (int)((fmag - mag)/magstp + 1);
+	sized = (int)(size/scale + 0.5);
+	if (sized > diam)
+	    diam = sized;
+
+	return (diam);
+}
+
+/* computer visual magnitude using the g/k parameters commonly used for comets.
+ */
+void
+gk_mag (g, k, rp, rho, mp)
+double g, k;
+double rp;	/* sun-obj dist, AU */
+double rho;	/* earth-obj dist, AU */
+double *mp;
+{
+	*mp = g + 5.0*log10(rho) + 2.5*k*log10(rp);
+}
+
+/* given a string convert to floating point and return it as a double.
+ * this is to isolate possible unportabilities associated with declaring atof().
+ * it's worth it because atof() is often some 50% faster than sscanf ("%lf");
+ */
+double
+atod (buf)
+char *buf;
+{
+	return (atof (buf));
+}
+
+/* solve a spherical triangle:
+ *           A
+ *          /  \
+ *         /    \
+ *      c /      \ b
+ *       /        \
+ *      /          \
+ *    B ____________ C
+ *           a
+ *
+ * given A, b, c find B and a in range 0..B..2PI and 0..a..PI, respectively..
+ * cap and Bp may be NULL if not interested in either one.
+ * N.B. we pass in cos(c) and sin(c) because in many problems one of the sides
+ *   remains constant for many values of A and b.
+ */
+void
+solve_sphere (A, b, cc, sc, cap, Bp)
+double A, b;
+double cc, sc;
+double *cap, *Bp;
+{
+	double cb = cos(b), sb = sin(b);
+	double cA = cos(A);
+	double ca;
+	double B;
+
+	ca = cb*cc + sb*sc*cA;
+	if (ca >  1.0) ca =  1.0;
+	if (ca < -1.0) ca = -1.0;
+	if (cap)
+	    *cap = ca;
+
+	if (!Bp)
+	    return;
+
+	if (cc > .99999) {
+	    /* as c approaches 0, B approaches pi - A */
+	    B = PI - A;
+	} else if (cc < -.99999) {
+	    /* as c approaches PI, B approaches A */
+	    B = A;
+	} else {
+	    /* compute cB and sB and remove common factor of sa from quotient.
+	     * be careful where B causes atan to blow.
+	     */
+	    double sA = sin(A);
+	    double x, y;
+
+	    y = sA*sb*sc;
+	    x = cb - ca*cc;
+	
+	    if (fabs(x) < 1e-5)
+		B = y < 0 ? 3*PI/2 : PI/2;
+	    else
+		B = atan2 (y, x);
+	}
+
+	*Bp = B;
+	range (Bp, 2*PI);
+}
+
+/* #define WANT_MATHERR if your system supports it. it gives SGI fits.
+ */
+#undef WANT_MATHERR
+#if defined(WANT_MATHERR)
+/* attempt to do *something* reasonable when a math function blows.
+ */
+matherr (xp)
+struct exception *xp;
+{
+	static char *names[8] = {
+	    "acos", "asin", "atan2", "pow",
+	    "exp", "log", "log10", "sqrt"
+	};
+	int i;
+
+	/* catch-all */
+	xp->retval = 0.0;
+
+	for (i = 0; i < sizeof(names)/sizeof(names[0]); i++)
+	    if (strcmp (xp->name, names[i]) == 0)
+		switch (i) {
+		case 0:	/* acos */
+		    xp->retval = xp->arg1 >= 1.0 ? 0.0 : -PI;
+		    break;
+		case 1: /* asin */
+		    xp->retval = xp->arg1 >= 1.0 ? PI/2 : -PI/2;
+		    break;
+		case 2: /* atan2 */
+		    if (xp->arg1 == 0.0)
+			xp->retval = xp->arg2 < 0.0 ? PI : 0.0;
+		    else if (xp->arg2 == 0.0)
+			xp->retval = xp->arg1 < 0.0 ? -PI/2 : PI/2;
+		    else
+			xp->retval = 0.0;
+		    break;
+		case 3: /* pow */
+		/* FALLTHRU */
+		case 4: /* exp */
+		    xp->retval = xp->o_type == OVERFLOW ? 1e308 : 0.0;
+		    break;
+		case 5: /* log */
+		/* FALLTHRU */
+		case 6: /* log10 */
+		    xp->retval = xp->arg1 <= 0.0 ? -1e308 : 0;
+		    break;
+		case 7: /* sqrt */
+		    xp->retval = 0.0;
+		    break;
+		}
+
+        return (1);     /* suppress default error handling */
+}
+#endif
+
+/* given the difference in two RA's, in rads, return their difference,
+ *   accounting for wrap at 2*PI. caller need *not* first force it into the
+ *   range 0..2*PI.
+ */
+double
+delra (dra)
+double dra;
+{
+	double fdra = fmod(fabs(dra), 2*PI);
+
+	if (fdra > PI)
+	    fdra = 2*PI - fdra;
+	return (fdra);
+}
+
+/* return 1 if object is considered to be "deep sky", else 0.
+ * The only things deep-sky are fixed objects other than stars.
+ */
+int
+is_deepsky (op)
+Obj *op;
+{
+	int deepsky = 0;
+
+	if (is_type(op, FIXEDM)) {
+	    switch (op->f_class) {
+	    case 'T':
+	    case 'B':
+	    case 'D':
+	    case 'M':
+	    case 'S':
+	    case 'V':
+		break;
+	    default:
+		deepsky = 1;
+		break;
+	    }
+	}
+
+	return (deepsky);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: misc.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/mjd.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/mjd.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/mjd.c	(revision 1457)
@@ -0,0 +1,263 @@
+/* functions to manipulate the modified-julian-date used throughout xephem. */
+
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* given a date in months, mn, days, dy, years, yr,
+ * return the modified Julian date (number of days elapsed since 1900 jan 0.5),
+ * *mjd.
+ */
+void
+cal_mjd (mn, dy, yr, mjd)
+int mn, yr;
+double dy;
+double *mjd;
+{
+	static double last_mjd, last_dy;
+	static int last_mn, last_yr;
+	int b, d, m, y;
+	long c;
+
+	if (mn == last_mn && yr == last_yr && dy == last_dy) {
+	    *mjd = last_mjd;
+	    return;
+	}
+
+	m = mn;
+	y = (yr < 0) ? yr + 1 : yr;
+	if (mn < 3) {
+	    m += 12;
+	    y -= 1;
+	}
+
+	if (yr < 1582 || (yr == 1582 && (mn < 10 || (mn == 10 && dy < 15))))
+	    b = 0;
+	else {
+	    int a;
+	    a = y/100;
+	    b = 2 - a + a/4;
+	}
+
+	if (y < 0)
+	    c = (long)((365.25*y) - 0.75) - 694025L;
+	else
+	    c = (long)(365.25*y) - 694025L;
+
+	d = (int)(30.6001*(m+1));
+
+	*mjd = b + c + d + dy - 0.5;
+
+	last_mn = mn;
+	last_dy = dy;
+	last_yr = yr;
+	last_mjd = *mjd;
+}
+
+/* given the modified Julian date (number of days elapsed since 1900 jan 0.5,),
+ * mjd, return the calendar date in months, *mn, days, *dy, and years, *yr.
+ */
+void
+mjd_cal (mjd, mn, dy, yr)
+double mjd;
+int *mn, *yr;
+double *dy;
+{
+	static double last_mjd, last_dy;
+	static int last_mn, last_yr;
+	double d, f;
+	double i, a, b, ce, g;
+
+	/* we get called with 0 quite a bit from unused epoch fields.
+	 * 0 is noon the last day of 1899.
+	 */
+	if (mjd == 0.0) {
+	    *mn = 12;
+	    *dy = 31.5;
+	    *yr = 1899;
+	    return;
+	}
+
+	if (mjd == last_mjd) {
+	    *mn = last_mn;
+	    *yr = last_yr;
+	    *dy = last_dy;
+	    return;
+	}
+
+	d = mjd + 0.5;
+	i = floor(d);
+	f = d-i;
+	if (f == 1) {
+	    f = 0;
+	    i += 1;
+	}
+
+	if (i > -115860.0) {
+	    a = floor((i/36524.25)+.99835726)+14;
+	    i += 1 + a - floor(a/4.0);
+	}
+
+	b = floor((i/365.25)+.802601);
+	ce = i - floor((365.25*b)+.750001)+416;
+	g = floor(ce/30.6001);
+	*mn = (int)(g - 1);
+	*dy = ce - floor(30.6001*g)+f;
+	*yr = (int)(b + 1899);
+
+	if (g > 13.5)
+	    *mn = (int)(g - 13);
+	if (*mn < 2.5)
+	    *yr = (int)(b + 1900);
+	if (*yr < 1)
+	    *yr -= 1;
+
+	last_mn = *mn;
+	last_dy = *dy;
+	last_yr = *yr;
+	last_mjd = mjd;
+}
+
+/* given an mjd, set *dow to 0..6 according to which day of the week it falls
+ * on (0=sunday).
+ * return 0 if ok else -1 if can't figure it out.
+ */
+int
+mjd_dow (mjd, dow)
+double mjd;
+int *dow;
+{
+	/* cal_mjd() uses Gregorian dates on or after Oct 15, 1582.
+	 * (Pope Gregory XIII dropped 10 days, Oct 5..14, and improved the leap-
+	 * year algorithm). however, Great Britian and the colonies did not
+	 * adopt it until Sept 14, 1752 (they dropped 11 days, Sept 3-13,
+	 * due to additional accumulated error). leap years before 1752 thus
+	 * can not easily be accounted for from the cal_mjd() number...
+	 */
+	if (mjd < -53798.5) {
+	    /* pre sept 14, 1752 too hard to correct |:-S */
+	    return (-1);
+	}
+	*dow = ((long)floor(mjd-.5) + 1) % 7;/* 1/1/1900 (mjd 0.5) is a Monday*/
+	if (*dow < 0)
+	    *dow += 7;
+	return (0);
+}
+
+/* given a year, return whether it is a leap year */
+int
+isleapyear (y)
+int y;
+{
+	return ((y%4==0 && y%100!=0) || y%400==0);
+}
+
+/* given a mjd, return the the number of days in the month.  */
+void
+mjd_dpm (mjd, ndays)
+double mjd;
+int *ndays;
+{
+	static short dpm[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+	int m, y;
+	double d;
+
+	mjd_cal (mjd, &m, &d, &y);
+	*ndays = (m==2 && isleapyear(y)) ? 29 : dpm[m-1];
+}
+
+/* given a mjd, return the year and number of days since 00:00 Jan 1 */
+void
+mjd_dayno (mjd, yr, dy)
+double mjd;
+int *yr;
+double *dy;
+{
+	double yrd;
+	int yri;
+	int dpy;
+
+	mjd_year (mjd, &yrd);
+	*yr = yri = (int)yrd;
+	dpy = isleapyear(yri) ? 366 : 365;
+	*dy = dpy*(yrd-yri);
+}
+
+/* given a mjd, return the year as a double. */
+void
+mjd_year (mjd, yr)
+double mjd;
+double *yr;
+{
+	static double last_mjd, last_yr;
+	int m, y;
+	double d;
+	double e0, e1;	/* mjd of start of this year, start of next year */
+
+	if (mjd == last_mjd) {
+	    *yr = last_yr;
+	    return;
+	}
+
+	mjd_cal (mjd, &m, &d, &y);
+	if (y == -1) y = -2;
+	cal_mjd (1, 1.0, y, &e0);
+	cal_mjd (1, 1.0, y+1, &e1);
+	*yr = y + (mjd - e0)/(e1 - e0);
+
+	last_mjd = mjd;
+	last_yr = *yr;
+}
+
+/* given a decimal year, return mjd */
+void
+year_mjd (y, mjd)
+double y;
+double *mjd;
+{
+	double e0, e1;	/* mjd of start of this year, start of next year */
+	int yf = (int)floor (y);
+	if (yf == -1) yf = -2;
+
+	cal_mjd (1, 1.0, yf, &e0);
+	cal_mjd (1, 1.0, yf+1, &e1);
+	*mjd = e0 + (y - yf)*(e1-e0);
+}
+
+/* round a time in days, *t, to the nearest second, IN PLACE. */
+void
+rnd_second (t)
+double *t;
+{
+	*t = floor(*t*SPD+0.5)/SPD;
+}
+	
+/* given an mjd, truncate it to the beginning of the whole day */
+double
+mjd_day(jd)
+double jd;
+{
+	return (floor(jd-0.5)+0.5);
+}
+
+/* given an mjd, return the number of hours past midnight of the whole day */
+double
+mjd_hr(jd)
+double jd;
+{
+	return ((jd-mjd_day(jd))*24.0);
+}
+
+/* insure 0 <= *v < r.
+ */
+void
+range (v, r)
+double *v, r;
+{
+	*v -= r*floor(*v/r);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: mjd.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/moon.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/moon.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/moon.c	(revision 1457)
@@ -0,0 +1,3487 @@
+/* geocentric moon polar coordinates re mean equinox and ecliptic of date
+
+   S. L. Moshier
+   December, 1996
+
+**********************************************************************
+   Adapted by Michael Sternberg <sternberg@physik.tu-chemnitz.de>
+   for xephem with minor modifications from the originals at:
+   ftp://ftp.std.com/pub/astronomy/selenog.zip
+
+   Precision < 0.05" from -1369 to +2950.
+   Uses table lookup techniques to limit calls to trigonometric functions.
+
+   NB:  Uses International Earth Rotation System (IERS) which is
+	taken as equivalent to FK5 for the purposes of xephem.
+
+   original files used:
+	chewtab.c   mean.c      mlr404.c
+	mlat404.c   selenog.c
+
+   changes:
+	added prototypes, grouped and cleaned up vars and #defines,
+	removed _MSC_VER #ifdefs, uniqed names in moonlr and moonlat,
+	included plantbl.h in .c file, dropped out librations for now.
+
+	in struct plantbl, promoted "char *arg_tbl" to "short *".
+	reason: - more portable (BTW: this is the only place in xephem
+		where "signed char" would have been needed)
+		- using "short" costs a mere 7k memory but avoids core
+		dumps on a machine which we didn't anticipate.
+
+**********************************************************************
+
+
+              Residuals against JPL ephemeris DE404 (arc seconds)
+
+First date in file = 1221000.5
+Number of samples = 1053099
+Sampling interval = 1.515625 days
+
+Peak excursions from these mostly different test points
+were consolidated with the above.  They added .01" to a few
+of the peak readings.
+First date in file = 1221000.50
+Number of samples = 524290.0
+Sampling interval = 3.0 days
+
+
+ Julian Years             Longitude          Latitude           Distance
+                                                               1 = 1.9 km
+                       Peak  RMS   Ave    Peak  RMS   Ave    Peak  RMS   Ave
+ -1369.0 to -1000.0:   0.43  0.07  0.00   0.33  0.05 -0.00   0.18  0.03  0.00 
+ -1000.0 to  -500.0:   0.49  0.06 -0.00   0.33  0.04 -0.00   0.18  0.03  0.00 
+  -500.0 to     0.0:   0.48  0.06  0.00   0.32  0.04  0.00   0.15  0.03  0.00 
+     0.0 to   500.0:   0.45  0.05  0.00   0.30  0.04 -0.00   0.17  0.03 -0.00 
+   500.0 to  1000.0:   0.48  0.05 -0.00   0.29  0.04  0.00   0.17  0.03 -0.00 
+  1000.0 to  1500.0:   0.42  0.05 -0.00   0.28  0.04 -0.00   0.16  0.03  0.00 
+  1500.0 to  2000.0:   0.35  0.05 -0.00   0.26  0.04  0.00   0.15  0.03  0.00 
+  2000.0 to  2500.0:   0.39  0.06  0.00   0.25  0.04 -0.00   0.15  0.03 -0.00 
+  2500.0 to  3000.0:   0.44  0.07 -0.00   0.30  0.05 -0.00   0.19  0.03 -0.00 
+  3000.0 to  3000.8:   0.23  0.08 -0.04   0.11  0.04 -0.00   0.08  0.03 -0.00 
+ */
+
+#include <math.h>
+#if defined(__STDC__)
+#include <stdlib.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+
+#define CHAR short
+
+#define NARGS 18
+ 
+struct plantbl {
+  char max_harmonic[NARGS];
+  char max_power_of_t;
+  CHAR *arg_tbl;
+  long *lon_tbl;
+  long *lat_tbl;
+  long *rad_tbl;
+  double distance;
+  double timescale;
+  double trunclvl;
+};
+
+static double mods3600 P_((double x));
+static void mean_elements P_((double JED));
+static int sscc P_((int k, double arg, int n));
+static int g2plan P_((double J, struct plantbl *plan, double *pobj, int flag));
+static double g1plan P_((double J, struct plantbl *plan));
+static int gecmoon P_((double J, struct plantbl *lrtab,
+	struct plantbl *lattab, double *pobj));
+
+/* time points */
+#define MOSHIER_J2000 (2451545.0)
+
+#define MOSHIER_BEGIN (1221000.5 - MJD0) /* directly from above */
+#define MOSHIER_END   (2798525.5 - MJD0) /* 2950.0; from libration table */
+
+
+static double Args[NARGS];
+static double LP_equinox;
+static double NF_arcsec;
+static double Ea_arcsec;
+static double pA_precession;
+
+
+/* This storage ought to be allocated dynamically.  */
+double ss[NARGS][30];
+double cc[NARGS][30];
+
+/* Time, in units of 10,000 Julian years from JED 2451545.0.  */
+static double T;
+
+/* Conversion factors between degrees and radians */
+#define DTR 1.7453292519943295769e-2
+#define RTD 5.7295779513082320877e1
+#define RTS 2.0626480624709635516e5	/* arc seconds per radian */
+#define STR 4.8481368110953599359e-6	/* radians per arc second */
+#define AUKM 1.4959787e8
+
+
+static long lrtabl[] = {
+    175667,     66453,      5249,       -42,
+     20057,       403,     -2360,      6148,
+     -7644,     24646,     -1273,      9127,
+     -1395,      1958,
+       232,      -289,
+       -97,       553,        69,       130,
+       -80,         6,
+       129,      -868,        26,       -89,
+      1042,      1172,       194,      -112,
+    -47433,   -241666,    224626,   -103752,
+     63419,    127606,
+      2294,      -691,     -1827,     -1254,
+        -1,      -119,
+      1057,       324,
+       505,      -195,       254,      -641,
+       -36,      1008,     -1082,        -3,
+       -87,       122,
+       161,        11,
+         2,      -106,
+        29,      -123,
+       -32,        41,
+      -524,       -35,
+       133,      -595,
+       225,       837,      -108,      -191,
+     -2294,       841,      -340,      -394,
+      -351,     -1039,       238,      -108,
+       -66,        21,
+      1405,       869,       520,      2776,
+      -174,        71,
+       425,       652,     -1260,       -80,
+       249,        77,
+      -192,       -17,
+       -97,       134,
+        -7,       -54,
+      -802,     -7436,     -2824,     70869,
+       -35,      2481,
+      1865,      1749,     -2166,      2415,
+        33,      -183,
+      -835,       283,
+        27,       -45,
+        56,       235,
+         2,       718,
+     -1206,       275,       -87,      -158,
+        -7,     -2534,         0,     10774,
+         1,      -324,
+      -208,       821,
+       281,      1340,      -797,       440,
+       224,        72,
+       -65,        -5,
+        -7,       -44,
+       -48,        66,
+      -151,       -40,
+       -41,       -45,
+        76,      -108,
+       -18,      1202,         0,     -2501,
+      1438,      -595,       900,      3040,
+     -3435,        -5,
+      -100,       -26,
+         0,    -13714,
+      -183,        68,
+       453,       -83,
+      -228,       325,
+        97,        13,
+         2,       105,
+       -61,       257,
+         0,        57,
+        88,       -11,
+        -1,     -8220,
+         0,       275,
+       -43,       -10,
+      -199,       105,
+         1,     -5849,         2,     24887,
+      -128,        48,
+       712,       970,     -1407,       845,
+      -266,       378,
+       311,      1526,     -1751,        27,
+         0,   -185858,
+       133,      6383,
+      -108,        25,
+        -7,      1944,
+         5,       390,
+       -11,        31,
+       277,      -384,       158,        72,
+       -81,       -41,       -13,      -111,
+     -2332,    -65804,      -698,    505812,
+        34,   1676716,       -72,  -6664384,
+       154,       -57,        52,        95,
+        -4,        -5,
+        -7,        37,
+       -63,       -32,
+         4,      3349,         1,    -14370,
+        16,       -83,
+         0,      -401,
+        13,      3013,
+        48,       -20,
+         0,       250,
+        51,       -79,
+        -7,      -146,
+       148,         9,
+         0,       -64,
+       -17,       -59,
+       -67,      -492,
+        -2,   2116601,
+       -12,     -1848,
+         8,      -436,
+        -6,       324,         0,     -1363,
+      -163,         9,
+         0,       -74,
+        63,      8167,       -29,     37587,
+       -22,    -74501,
+       -71,       497,
+        -1,    551747,
+       -87,       -22,
+         0,       -51,
+        -1,      -463,
+         0,      -444,
+         3,        89,
+        15,       -84,
+       -36,     -6829,        -5,    -21663,
+         0,     86058,
+         0,      -298,
+        -2,       751,        -2,     -1015,
+         0,        69,
+         1,     -4989,         0,     21458,
+         0,      -330,
+         0,        -7,
+         0,      -226,
+         0,     -1407,         0,      2942,
+         0,        66,
+         0,       667,
+         0,      -155,
+         0,       105,
+         0,      -107,
+         0,       -74,
+         0,       -52,
+         0,        91,
+         0,        59,
+         0,       235,
+        -1,     -1819,         0,      2470,
+        71,        13,
+         0,      1026,
+        14,       -54,
+         0,      -174,
+      -121,       -19,
+         0,      -200,
+         0,      3008,
+       -16,     -8043,       -10,    -37136,
+        -3,     73724,
+      -157,        -5,
+         0,      -854,
+         8,       147,
+       -13,      -893,
+         0,     11869,
+       -23,      -172,
+        89,        14,
+        -1,       872,         0,     -3744,
+        11,      1606,
+         0,      -559,
+        -1,     -2530,
+         0,       454,
+         0,      -193,
+       -60,       -10,
+       -82,       -13,
+       -75,         6,
+        36,        81,
+       354,   -162836,       148,   -516569,
+         4,   2054441,
+         4,       -94,
+        39,        38,
+        61,       -30,
+         2,       121,
+       -11,       590,
+        62,      2108,
+         0,    -12242,
+      -476,       -42,
+       -84,       113,
+      -394,       236,
+         0,       276,
+       -49,        31,
+         0,        86,
+         1,     -1313,
+         1,        69,
+       -60,        88,
+       -46,        18,
+         0,    -63818,
+        14,       -93,
+       113,       547,      -618,        17,
+        -7,     12290,        -1,    -25679,
+         0,        92,
+      -115,        50,
+       -48,       233,
+         4,      1311,         1,     -5567,
+         3,      1251,
+        29,       548,
+      -244,       257,
+        -2,      1825,
+        42,       637,
+       -46,        68,
+       -62,         8,
+         3,       110,
+       445,      -100,      -316,      -202,
+      2925,      -621,       763,      1495,
+      -169,      -184,        20,       -76,
+      -475,      -138,         8,      -141,
+      -197,      1351,     -1284,       422,
+      -129,      1879,      -102,      8382,
+        -9,  45864958,
+      -215,      1350,     -1285,       422,
+      -481,      -136,         8,      -140,
+        40,       -53,
+      2622,      -543,       700,      1406,
+       402,       -95,      -318,      -194,
+       122,        13,
+       -30,       147,
+      -121,      -902,
+        61,       -23,
+       -63,         7,
+        69,       479,
+      -224,       228,
+        -7,       500,
+         0,      -429,
+       -42,       193,
+       -92,        37,
+        67,         5,
+      -350,       -31,
+         0,        67,
+       -55,        -5,
+         0,        47,
+       -36,        53,
+         5,       561,
+         0,      -126,
+         0,       871,
+       -52,         4,
+      -201,    116922,       -22,    371352,
+       -12,  -1473285,
+         0,        87,
+      -164,        84,
+        -3,       422,
+        30,      1434,
+       -26,        38,
+         2,  -1249943,
+      -404,       -34,
+       -57,        79,
+         5,       509,
+         1,       131,
+      -344,       168,
+       112,     22540,        30,     71218,
+        18,   -283983,
+         0,      -851,
+         0,     -1538,
+         0,      1360,
+       -12,        51,
+       -48,        68,
+        88,       -20,
+         1,        63,
+         0,      -568,
+       303,        25,
+         0,      -122,
+        87,       586,      -606,       -14,
+         0,      -100,
+       -85,         8,
+      -165,        54,
+       -45,       140,
+         0,       -54,
+         4,      -831,         1,      3495,
+        31,       116,
+       -46,       -11,
+      -371,       190,
+      -507,       399,
+        -2,        57,
+       -60,        36,
+      -198,     -1174,      -613,      4988,
+       -87,        -4,
+       141,       560,      -276,       187,
+      1876,      1379,       778,      4386,
+        24,       -15,
+       167,      -774,
+       -71,        -9,
+       -62,        90,
+        98,       580,      -663,        -7,
+        34,      -112,
+        57,        15,
+      -355,      -214,
+     -3240,    -13605,     12229,     -5723,
+      3496,      7063,
+        33,       -51,
+      1908,      1160,      -226,       715,
+       964,      1170,     -1264,       623,
+     14071,      5280,      5614,      3026,
+       488,      1576,        -2, 226395859,
+       824,      1106,     -1287,       617,
+      1917,      1156,      -214,       718,
+        90,       -97,
+     12078,     -2366,      3282,      6668,
+      -219,      9179,       593,      2015,
+      -282,      -186,
+        57,        25,
+        31,      -102,
+       -77,        -4,
+      -268,      -341,        -7,       -45,
+        -3,        74,
+        15,      -615,
+       -88,        -7,
+       234,      -353,
+         1,      -119,
+      -163,     -1159,      -601,      4969,
+        22,       -58,
+       -17,    -11434,
+        17,        54,
+       348,       348,      -460,       434,
+      -371,       175,
+       -11,      -204,
+         4,     -6440,
+        -5,       -53,
+        -4,    -14388,       -37,    -45231,
+        -7,    179562,
+       -44,       136,
+      -160,        49,
+      -101,        81,
+        -1,      -188,
+         0,         2,
+        -4,     12124,       -11,    -25217,
+        71,       543,      -557,       -14,
+       -75,       526,
+         0,    395274,
+      -233,       -16,
+        93,       -20,
+       -43,        61,
+         0,     -1275,
+         0,      -824,
+         1,      -415,         0,      1762,
+      -261,       131,
+       -45,        64,
+      -297,       -25,
+         0,    -17533,
+        -6,       -56,
+        21,      1100,
+         1,       327,
+         1,        66,
+        23,      -217,
+       -83,        -7,
+        83,     86847,        49,    275754,
+        -4,  -1093857,
+       -46,         2,
+         0,       -24,
+         0,      -419,
+         0,     -5833,
+         1,       506,
+         0,      -827,
+        -1,      -377,
+       -11,       -78,
+         0,    131945,
+        -2,      -334,
+         1,       -75,
+         0,       -72,
+         0,      -213,
+        -6,      5564,        -2,    -11618,
+         0,      1790,
+         0,      -131,
+         0,         6,
+         0,       -76,
+         0,      -130,
+         0,     -1115,         0,      4783,
+         0,      -195,
+         0,      -627,
+         0,       -55,
+         0,       -83,
+         0,       163,
+         0,       -54,
+         0,        82,
+         0,       149,
+         0,      -754,         0,      1578,
+         0,       138,
+         0,        68,
+         2,     -2506,         0,      3399,
+         0,      -125,
+        86,        16,
+         0,     -6350,         0,     27316,
+        18,       -63,
+         0,      -169,
+        -1,        46,
+      -136,       -21,
+         0,      -239,
+       -30,     -8788,       -15,    -40549,
+        -4,     80514,
+       -46,        -8,
+      -168,        -6,
+        -1,       536,         0,     -2314,
+         9,       148,
+       -13,      -842,
+        -1,    307713,
+       -23,      -175,
+        95,        15,
+         0,      -297,
+        11,      1341,
+         0,      -106,
+         0,         5,
+        -4,        68,
+      -114,        10,
+        32,        75,
+       159,   -130487,        98,   -413967,
+         2,   1647339,
+        -4,       -85,
+       100,       -46,
+         2,        95,
+       -11,       461,
+        51,      1647,
+         0,    -32090,
+      -375,       -33,
+       -65,        86,
+      -300,       180,
+         0,       836,         0,     -3576,
+         0,      -222,
+         0,      -993,
+       -41,        60,
+         0,     -4537,
+      -431,       -34,
+         2,       927,         0,     -1931,
+       -79,        33,
+       -31,       144,
+        -1,       284,         0,     -1207,
+         0,        88,
+       -11,       315,
+      -178,       177,
+        -1,       144,
+       -58,       986,
+        11,        86,
+      -228,      -110,
+      2636,      -494,       718,      1474,
+        28,       -35,
+       -24,       782,      -797,       277,
+      2142,     -1231,       856,      1853,
+        74,     10797,         0,  23699298,
+       -21,       786,      -796,       277,
+        27,       -34,
+      2615,      -494,       712,      1461,
+      -226,      -109,
+       -11,       663,
+         0,      -123,
+      -169,       157,
+       -54,       266,
+         0,       -76,
+         1,      -634,         0,      2738,
+       -25,       106,
+       -63,        24,
+         0,      -372,
+      -221,       -24,
+         0,     -5356,
+         0,      -219,
+         0,        91,
+       -28,      7684,        -6,     24391,
+        -1,    -96795,
+       -77,        43,
+         2,        95,
+       -47,        -3,
+         0,    -84530,
+         2,       310,
+         1,        88,
+       111,     19331,        32,     61306,
+         4,   -243595,
+         0,       770,
+         0,      -103,
+         0,       160,
+         0,       356,
+         0,       236,
+       -41,       354,
+        39,       303,
+        12,       -56,
+       873,      -143,       238,       482,
+       -28,        35,
+       -93,        31,
+        -3,   7690211,
+       -91,        33,
+       -34,        43,
+       824,      -130,       226,       450,
+       -39,       341,
+        -1,      -687,
+         0,      -303,
+        11,     -2935,         1,     12618,
+       121,       924,         9,     -1836,
+      -268,     -1144,      -678,      3685,
+       -69,      -261,
+         0,  -4115951,
+       -69,      -261,
+         5,      -151,
+         0,       -88,
+         0,        91,
+         0,       187,
+         0,     -1281,
+         1,        77,
+         1,      6059,         3,     19238,
+         0,    -76305,
+         0,       -90,
+         0,      -238,
+         0,      -962,         0,      4133,
+         0,        96,
+         0,      9483,
+         0,        85,
+         0,      -688,
+         0,     -5607,
+         0,        55,
+         0,      -752,
+         0,        71,
+         0,       303,
+         0,      -288,
+         0,        57,
+         0,        45,
+         0,       189,
+         0,       401,
+         0,     -1474,         0,      3087,
+         0,       -71,
+         0,      2925,
+         0,       -75,
+         0,       359,
+         0,        55,
+         1,    -10155,         0,     43735,
+         0,      -572,
+         0,       -49,
+         0,      -660,
+         0,     -3591,         0,      7516,
+         0,       668,
+        -1,       -53,
+        -2,    384259,
+         0,      -163,
+         0,       -93,
+         1,       112,
+       -95,    -11528,       -22,    -36505,
+        -1,    145308,
+         5,       145,
+         0,      4047,
+         1,      1483,         0,     -6352,
+         0,       991,         0,     -4262,
+         0,       -93,
+         0,      -334,
+         0,      -160,
+         0,      -153,
+       -10,       127,
+        51,       185,
+       -77,        18,
+        56,      1217,         6,   1919574,
+       -74,        17,
+        50,       180,
+        -5,        93,
+         0,      -104,
+         0,       -58,
+        -3,      -353,        -1,      1499,
+         0,      -229,
+       -15,        86,
+         0,    -93657,
+         0,      1561,         0,     -6693,
+         0,     -5839,
+         1,      6791,         0,    -29143,
+         1,      -701,         0,      3015,
+         0,      2543,
+         0,       693,
+        -1,    361233,
+         0,       -50,
+         0,       946,
+        -1,      -140,
+       -70,       407,
+         0,   -450995,
+         0,      -368,
+         0,        54,
+         0,      -802,
+         0,       -96,
+         0,      1274,         0,     -5459,
+         0,      -614,         0,      2633,
+         0,       685,
+         0,      -915,
+         0,       -85,
+         0,        88,
+         0,       106,
+         0,       928,
+         0,      -726,         0,      1523,
+         0,      5715,
+         0,     -4338,         0,     18706,
+         0,      -135,
+         0,      -132,
+         0,      -158,
+         0,       -98,
+         0,       680,
+        -1,    138968,
+         0,      -192,
+         0,     -1698,
+         0,     -2734,         0,     11769,
+         0,         4,
+         0,       673,         0,     -2891,
+         0,       889,         0,     -3821,
+         0,       121,
+        -1,    143783,
+         0,       231,
+        -9,        51,
+         0,    -57413,
+         0,      -483,
+         0,      -407,
+         0,       676,         0,     -2902,
+         0,       531,
+         0,       445,
+         0,       672,
+         0,     19336,
+         0,        70,
+         0,    -39976,
+         0,       -68,
+         0,      4203,
+         0,      -406,
+         0,       446,
+         0,      -108,
+         0,        79,
+         0,        84,
+         0,       734,
+         0,       255,
+         0,      3944,
+         0,      -655,         0,      2825,
+         0,      -109,
+         0,      -234,
+         0,        57,
+         0,     19773,
+         0,     -2013,
+         0,       958,
+         0,      -521,
+         0,      -757,
+         0,     10594,
+         0,     -9901,
+         0,       199,
+         0,      -275,
+         0,        64,
+         0,        54,
+         0,       165,
+         0,      1110,
+         0,     -3286,
+         0,       909,
+         0,        54,
+         0,        87,
+         0,       258,
+         0,      1261,
+         0,       -51,
+         0,       336,
+         0,      -114,
+         0,      2185,
+         0,      -850,
+         0,        75,
+         0,       -69,
+         0,      -103,
+         0,       776,
+         0,     -1238,
+         0,       137,
+         0,        67,
+         0,      -260,
+         0,       130,
+         0,        49,
+         0,       228,
+         0,       215,
+         0,      -178,
+         0,        57,
+         0,      -133,
+};
+static long lrtabb[] = {-1};
+static long lrtabr[] = {
+     -5422,     -2120,      1077,       772,
+        39,        75,         3,        10,
+      -468,      -326,      -113,       -78,
+        -4,        -2,
+         1,         3,
+        29,        24,         4,         2,
+         1,         0,
+        -9,         7,        -2,         0,
+       -32,       -13,        -3,        -3,
+       233,       126,        89,        77,
+       -33,        16,
+         3,        -3,         0,        -1,
+         2,         0,
+         0,         1,
+         4,         9,         1,         1,
+        16,        -1,         0,        18,
+         3,         2,
+         0,         0,
+         0,         0,
+         0,         0,
+         0,         0,
+         0,        -1,
+       -22,        -5,
+        10,         3,         1,         1,
+       -15,         7,        -2,         1,
+        -8,       -11,        -1,        -2,
+        -1,         1,
+        46,       -58,       126,       -23,
+         4,         8,
+        35,         8,        10,       -17,
+         0,         0,
+         0,         0,
+       -10,        -7,
+         0,         0,
+       -23,         3,       151,        10,
+      -327,         0,
+         4,        -5,         6,         5,
+         1,         0,
+        -1,        -3,
+         0,         0,
+         0,         1,
+      -185,         0,
+        -3,       -24,        -5,        -2,
+     -1062,         3,      4560,         0,
+        -3,         0,
+         4,         1,
+         8,        -1,         2,         4,
+         0,         1,
+         0,        -1,
+         0,         0,
+        -1,         0,
+         0,         1,
+         0,         0,
+        -1,        -1,
+       277,         3,      -583,         1,
+        -1,         4,       -32,         7,
+         0,       -34,
+         1,        -1,
+    -23685,         0,
+        -1,        -2,
+        -1,        -7,
+        -5,        -4,
+         0,         2,
+        -2,         0,
+        -5,        -1,
+        35,         0,
+         0,         2,
+       202,         0,
+       180,         0,
+         0,        -1,
+        -3,        -6,
+      -193,         0,       770,        -1,
+        -2,        -4,
+       -32,        23,       -28,       -46,
+       -13,        -9,
+       -54,        10,        -1,       -61,
+    -44895,         0,
+      -230,         5,
+        -1,        -4,
+       -71,         0,
+       -15,         0,
+         1,         0,
+        15,        11,        -3,         6,
+         2,        -3,         4,        -1,
+      2576,      -138,    -19881,       -47,
+    -65906,        -1,    261925,        -4,
+        -2,        -7,         4,        -2,
+         0,         0,
+        -1,         0,
+         1,        -3,
+       172,        -2,      -727,         0,
+         4,         1,
+       324,         0,
+      -139,         1,
+         1,         3,
+      -276,         0,
+         5,         3,
+         9,         0,
+        -1,        10,
+       -37,         0,
+         5,        -1,
+        76,       -10,
+   1318810,         1,
+        12,        -1,
+       -38,         1,
+      -141,         0,       611,         0,
+         0,       -11,
+         4,         0,
+      -627,         2,     -2882,        -3,
+      5711,        -2,
+       -48,        -7,
+     55294,         0,
+         2,        -7,
+        31,         0,
+        34,         0,
+      -259,         0,
+       -55,         2,
+         6,         3,
+     -4273,        20,    -13554,         3,
+     53878,         0,
+       -46,         0,
+       -85,         0,       114,         0,
+       -45,         0,
+      -818,         0,      3520,         0,
+        34,         0,
+      -157,         0,
+        29,         0,
+      -878,         0,      1838,         0,
+      -428,         0,
+       161,         0,
+        24,         0,
+        65,         0,
+        19,         0,
+        15,         0,
+        12,         0,
+       -26,         0,
+       -14,         0,
+      -149,         0,
+       584,         0,      -793,         0,
+         4,       -23,
+      -238,         0,
+       -18,        -5,
+        45,         0,
+        -7,        42,
+        79,         0,
+     -1723,         0,
+      2895,        -6,     13362,        -4,
+    -26525,        -1,
+        -2,        57,
+       291,         0,
+        52,        -3,
+      -327,         5,
+     -2755,         0,
+       -63,         9,
+         5,       -33,
+      -261,        -1,      1122,         0,
+       621,        -4,
+      -227,         0,
+      1077,         0,
+      -167,         0,
+        85,         0,
+        -4,        23,
+        -5,        32,
+         3,        30,
+       -32,        14,
+     64607,       141,    204958,        59,
+   -815115,         2,
+       -37,        -1,
+        15,       -15,
+        12,        24,
+        48,        -1,
+       235,         4,
+       843,       -25,
+      4621,         0,
+       -17,       191,
+        45,        34,
+        95,       159,
+      -132,         0,
+        13,        20,
+        32,         0,
+      -540,         0,
+        29,         0,
+        37,        25,
+         8,        19,
+     22127,         0,
+       -35,        -5,
+       232,       -48,         7,       262,
+      5428,         3,    -11342,         1,
+       -45,         0,
+       -21,       -49,
+      -100,       -21,
+      -626,         1,      2665,         0,
+       532,        -2,
+       235,       -12,
+      -111,      -105,
+       774,         1,
+      -283,        17,
+        29,        20,
+         3,        27,
+        47,        -2,
+       -43,      -192,       -87,       136,
+      -269,     -1264,       646,      -330,
+       -79,        73,       -33,        -9,
+        60,      -205,        61,         4,
+      -584,       -85,      -182,      -555,
+      -780,       -57,     -3488,       -45,
+ -19818328,        -4,
+       583,        93,       182,       555,
+       -59,       208,       -60,        -4,
+        23,        17,
+       235,      1133,      -608,       302,
+        41,       174,        84,      -137,
+         6,       -53,
+        63,        13,
+      -392,        52,
+       -10,       -27,
+        -3,       -27,
+       199,       -31,
+        99,        97,
+      -218,        -3,
+       209,         0,
+        84,        18,
+        16,        40,
+         2,       -30,
+        14,      -154,
+        30,         0,
+        -2,        24,
+      -108,         0,
+       -24,       -16,
+       262,        -2,
+        55,         0,
+      -304,         0,
+         2,        25,
+     55112,        95,    175036,        11,
+   -694477,         5,
+        41,         0,
+       -38,       -76,
+       199,         1,
+       679,       -14,
+       -17,       -12,
+    582619,         1,
+       -16,       191,
+        38,        27,
+      -234,         2,
+       -60,         0,
+        80,       163,
+    -10296,        48,    -32526,        13,
+    129703,         8,
+     -1366,         0,
+      -741,         0,
+      -646,         0,
+        25,         6,
+        33,        23,
+        10,        43,
+       -31,         0,
+        -6,         0,
+       -12,       147,
+        59,         0,
+       287,       -42,        -7,       297,
+       -59,         0,
+        -4,       -42,
+       -27,       -81,
+       -69,       -22,
+        27,         0,
+      -423,        -2,      1779,        -1,
+       -57,        15,
+         5,       -23,
+        94,       182,
+      -197,      -250,
+        24,         1,
+       -18,       -30,
+       581,       -98,     -2473,      -303,
+        -2,        43,
+      -277,        70,       -92,      -136,
+      -681,       925,     -2165,       384,
+        -8,       -12,
+       382,        82,
+        -4,        35,
+       -45,       -31,
+      -286,        48,         3,      -328,
+       -55,       -17,
+         8,       -28,
+      -106,       175,
+     -6735,      1601,     -2832,     -6052,
+      3495,     -1730,
+       -25,       -17,
+      -574,       944,      -354,      -112,
+      -579,       476,      -308,      -625,
+     -2411,      7074,     -1529,      2828,
+     -1335,       247,-112000844,        -1,
+       545,      -409,       305,       637,
+       572,      -950,       356,       106,
+        48,        44,
+      1170,      5974,     -3298,      1624,
+     -4538,      -106,      -996,       294,
+        92,      -139,
+       -12,        28,
+        50,        16,
+         2,       -38,
+       169,      -133,        22,        -3,
+        38,         1,
+       305,         7,
+         4,       -44,
+       175,       116,
+        59,         1,
+      -573,        81,      2453,       297,
+        29,        11,
+      5674,        -8,
+       -27,         9,
+       173,      -173,       215,       228,
+       -87,      -184,
+       102,        -5,
+      3206,         2,
+       -53,         2,
+      7159,        -7,     22505,       -19,
+    -89344,        -3,
+        67,        22,
+        24,        79,
+       -40,       -50,
+        94,         0,
+       186,         0,
+     -6063,         0,     12612,        -5,
+      -271,        35,         7,      -278,
+      -479,       -74,
+    426754,         0,
+         8,      -116,
+       -10,       -47,
+       -31,       -22,
+       645,         0,
+       426,         0,
+      -213,         0,       903,         0,
+       -67,      -133,
+       -33,       -23,
+        13,      -152,
+     -9316,         0,
+        29,        -3,
+      -564,        11,
+      -167,         0,
+       -34,         0,
+       114,        12,
+         4,       -44,
+    -44561,        42,   -141493,        25,
+    561256,        -2,
+        -1,       -24,
+      -261,         0,
+       211,         0,
+     -4263,         0,
+      -262,         1,
+      1842,         0,
+       202,         0,
+        41,        -6,
+     77165,         0,
+       176,        -1,
+        39,         1,
+       -24,         0,
+       118,         0,
+     -2991,        -4,      6245,        -1,
+     46886,         0,
+       -75,         0,
+      -100,         0,
+        40,         0,
+        75,         0,
+      -618,         0,      2652,         0,
+       112,         0,
+      1780,         0,
+        30,         0,
+        49,         0,
+        86,         0,
+        33,         0,
+       -30,         0,
+       -95,         0,
+       277,         0,      -580,         0,
+       -35,         0,
+      -319,         0,
+      1622,         1,     -2201,         0,
+        79,         0,
+        10,       -57,
+      2363,         0,    -10162,         0,
+       -41,       -12,
+        62,         0,
+        30,         1,
+       -14,        89,
+     -2721,         0,
+      5780,       -19,     26674,       -10,
+    -52964,        -2,
+        -5,        30,
+        -4,       111,
+      -317,        -1,      1369,         0,
+        93,        -6,
+      -564,         9,
+   -115913,         0,
+      -113,        15,
+        10,       -62,
+        99,         0,
+       891,        -7,
+        36,         0,
+       108,         0,
+       -42,        -2,
+         7,        75,
+       -50,        21,
+     86822,       104,    275441,        65,
+  -1096109,         1,
+       -56,         3,
+        31,        66,
+        63,        -1,
+       307,         7,
+      1097,       -34,
+     17453,         0,
+       -22,       250,
+        57,        43,
+       120,       200,
+      -297,         0,      1269,         0,
+       166,         0,
+      -662,         0,
+        40,        28,
+      1521,         0,
+       -23,       288,
+       351,        -2,      -729,         0,
+       -22,       -52,
+       -96,       -21,
+      -139,        -1,       589,         0,
+        35,         0,
+       210,         7,
+      -118,      -119,
+        62,         0,
+      -583,       -26,
+       -42,         5,
+       -73,       152,
+      -330,     -1759,       983,      -479,
+       -23,       -19,
+      -522,       -15,      -185,      -533,
+       739,      1559,     -1300,       614,
+     -7332,        52, -15836758,         0,
+       524,        16,       185,       532,
+        23,        18,
+       330,      1751,      -978,       476,
+        73,      -151,
+       519,        18,
+        38,         0,
+       105,       113,
+      -178,       -37,
+        26,         0,
+       262,         1,     -1139,         0,
+        71,        17,
+        16,        42,
+       151,         0,
+        16,      -148,
+      4147,         0,
+       149,         0,
+       -30,         0,
+      2980,         9,      9454,         2,
+    -37519,         0,
+       -28,       -49,
+        37,        -1,
+         2,       -31,
+     33870,         0,
+      -208,         1,
+       -59,         1,
+    -13105,        68,    -41564,        21,
+    165148,         3,
+     -1022,         0,
+       -40,         0,
+      -132,         0,
+      -228,         0,
+        95,         0,
+      -138,       -16,
+      -126,        16,
+        24,         5,
+       -57,      -346,       191,       -94,
+       -14,       -11,
+       -12,       -37,
+  -3053364,        -1,
+        13,        36,
+        17,        13,
+        51,       327,      -179,        90,
+       138,        16,
+       233,         0,
+        62,         0,
+      1164,         0,     -5000,         0,
+      -407,       117,       770,         9,
+        -4,         1,        21,         2,
+         1,         0,
+    -16869,         0,
+        -1,         0,
+         1,         0,
+        35,         0,
+       -78,         0,
+        78,         0,
+      -533,         0,
+       -31,         1,
+     -2448,        -6,     -7768,        -1,
+     30812,         0,
+        37,         0,
+      -227,         0,
+       197,         0,      -846,         0,
+       -77,         0,
+      4171,         0,
+       -67,         0,
+       287,         0,
+      2532,         0,
+       -19,         0,
+       -40,         0,
+       -56,         0,
+       128,         0,
+        83,         0,
+       -45,         0,
+       -36,         0,
+       -92,         0,
+      -134,         0,
+       714,         0,     -1495,         0,
+        32,         0,
+      -981,         0,
+        15,         0,
+      -166,         0,
+       -59,         0,
+      4923,         0,    -21203,         0,
+       246,         0,
+        15,         0,
+       104,         0,
+      1683,         0,     -3523,         0,
+      -865,         0,
+       -25,         1,
+   -186329,        -1,
+        10,         0,
+        50,         0,
+        53,         0,
+      5455,       -45,     17271,       -10,
+    -68747,         0,
+        69,        -2,
+     -7604,         0,
+      -724,         1,      3101,         0,
+       -46,         0,       200,         0,
+       -44,         0,
+        97,         0,
+       -53,         0,
+        62,         0,
+       -54,        -4,
+        88,       -24,
+        -9,       -36,
+      -581,        27,   -914711,         3,
+         8,        35,
+       -86,        24,
+        51,         3,
+        48,         0,
+        26,         0,
+       133,         1,      -577,         0,
+       105,         0,
+        -3,        -1,
+      3194,         0,
+       528,         0,     -2263,         0,
+      2028,         0,
+     -3266,         1,     14016,         0,
+        10,         0,       -41,         0,
+      -100,         0,
+       -32,         0,
+   -124348,         0,
+        16,         0,
+      -325,         0,
+        50,        -1,
+         1,         0,
+      -553,         0,
+         0,         0,
+         0,         0,
+         2,         0,
+       -34,         0,
+      -444,         0,      1902,         0,
+         9,         0,       -37,         0,
+       254,         0,
+       156,         0,
+        -2,         0,
+       -35,         0,
+       -48,         0,
+      -368,         0,
+       327,         0,      -686,         0,
+     -2263,         0,
+      1952,         0,     -8418,         0,
+       -13,         0,
+        52,         0,
+         9,         0,
+        21,         0,
+      -261,         0,
+    -62404,         0,
+         0,         0,
+        79,         0,
+      1056,         0,     -4547,         0,
+      -351,         0,
+      -305,         0,      1310,         0,
+        -1,         0,         6,         0,
+         0,         0,
+    -55953,         0,
+       -80,         0,
+         0,         0,
+       168,         0,
+      -147,         0,
+       127,         0,
+      -265,         0,      1138,         0,
+        -1,         0,
+        -9,         0,
+        -8,         0,
+     -5984,         0,
+       -22,         0,
+        -5,         0,
+         0,         0,
+         0,         0,
+       127,         0,
+        -2,         0,
+        10,         0,
+       -31,         0,
+       -29,         0,
+      -286,         0,
+       -98,         0,
+     -1535,         0,
+       252,         0,     -1087,         0,
+        43,         0,
+         4,         0,
+       -19,         0,
+     -7620,         0,
+        29,         0,
+      -322,         0,
+       203,         0,
+         0,         0,
+     -3587,         0,
+        10,         0,
+         0,         0,
+        94,         0,
+         0,         0,
+        -1,         0,
+        -1,         0,
+      -315,         0,
+         1,         0,
+         0,         0,
+         0,         0,
+       -30,         0,
+       -94,         0,
+      -460,         0,
+         1,         0,
+      -114,         0,
+         0,         0,
+      -746,         0,
+         4,         0,
+       -23,         0,
+        24,         0,
+         0,         0,
+      -237,         0,
+         1,         0,
+         0,         0,
+       -18,         0,
+         0,         0,
+         0,         0,
+       -16,         0,
+       -76,         0,
+       -67,         0,
+         0,         0,
+       -16,         0,
+         0,         0,
+};
+static CHAR lrargs[] = {
+  0,  3,
+  3,  4,  3, -8,  4,  3,  5,  1,
+  2,  2,  5, -5,  6,  2,
+  5, -1, 10,  2, 13, -1, 11,  3,  3, -7,  4,  0,
+  3,  1, 13, -1, 11,  2,  5,  1,
+  2,  4,  5,-10,  6,  0,
+  4,  2, 10, -2, 13, 14,  3,-23,  4,  1,
+  3,  3,  2, -7,  3,  4,  4,  1,
+  3, -1, 13, 18,  2,-16,  3,  2,
+  2,  8,  2,-13,  3,  1,
+  5,  2, 10, -2, 13,  2,  3, -3,  5,  1,  6,  0,
+  3, -1, 13, 26,  2,-29,  3,  0,
+  3,  1, 10, -1, 11,  2,  4,  1,
+  4,  1, 10, -1, 13,  3,  2, -4,  3,  1,
+  4,  1, 10, -1, 13,  3,  3, -4,  4,  0,
+  3, -1, 10, 15,  2,-12,  3,  0,
+  4,  2, 10, -3, 13, 24,  2,-24,  3,  0,
+  3, -1, 10, 23,  2,-25,  3,  0,
+  4,  1, 10, -1, 11,  1,  3,  1,  6,  0,
+  4,  2, 10, -2, 11,  5,  2, -6,  3,  0,
+  4,  2, 10, -2, 13,  6,  2, -8,  3,  0,
+  4, -2, 10,  1, 13, 12,  2, -8,  3,  1,
+  5, -1, 10,  1, 13, -1, 11, 20,  2,-20,  3,  1,
+  4, -2, 10,  1, 13,  3,  1, -1,  3,  1,
+  5,  2, 10, -2, 13,  2,  3, -5,  5,  5,  6,  0,
+  4,  2, 10, -2, 13,  2,  3, -3,  5,  1,
+  4,  2, 10, -2, 13,  6,  3, -8,  4,  0,
+  4, -2, 10,  1, 13, 20,  2,-21,  3,  1,
+  4,  1, 10, -1, 11,  1,  3,  1,  5,  0,
+  1,  1,  6,  0,
+  4,  2, 10, -2, 13,  5,  3, -6,  4,  0,
+  3,  3,  2, -5,  3,  2,  5,  0,
+  2, -1, 11,  1, 14,  1,
+  4,  2, 10, -2, 13,  2,  3, -2,  5,  0,
+  2,  1,  3, -2,  4,  1,
+  4,  1, 10, -1, 11,  5,  2, -7,  3,  0,
+  1,  1,  5,  0,
+  2,  7,  3,-13,  4,  0,
+  4, -2, 10,  1, 13, 15,  2,-13,  3,  0,
+  4,  2, 10, -2, 13,  3,  2, -3,  3,  0,
+  2, -2, 11,  2, 14,  1,
+  3,  1, 10,  1, 12, -1, 13,  1,
+  3, -1, 13, 21,  2,-21,  3,  0,
+  2,  3,  2, -5,  3,  0,
+  2,  2,  3, -4,  4,  1,
+  2,  5,  2, -8,  3,  0,
+  3, -1, 13, 23,  2,-24,  3,  0,
+  2,  6,  3,-11,  4,  0,
+  1,  2,  5,  0,
+  2,  3,  3, -6,  4,  0,
+  2,  5,  3, -9,  4,  0,
+  4,  1, 10, -1, 11,  1,  3, -2,  5,  0,
+  3,  2, 10,  2, 12, -2, 13,  1,
+  2,  2,  2, -3,  3,  2,
+  2,  4,  3, -7,  4,  0,
+  2,  2, 13, -2, 11,  0,
+  2,  3,  3, -5,  4,  0,
+  2,  1,  2, -2,  3,  0,
+  2,  2,  3, -3,  4,  0,
+  4,  1, 10, -1, 11,  4,  2, -5,  3,  0,
+  2,  1,  3, -1,  4,  0,
+  2,  4,  2, -6,  3,  0,
+  4,  2, 10, -2, 13,  2,  2, -2,  3,  0,
+  3,  1, 10, -1, 11,  1,  2,  0,
+  2,  1,  2, -1,  3,  0,
+  3,  1, 12,  2, 13, -2, 11,  0,
+  2,  5,  3, -8,  4,  0,
+  2,  1,  3, -3,  5,  0,
+  3,  2, 10,  1, 12, -2, 13,  1,
+  2,  4,  3, -6,  4,  0,
+  2,  1,  3, -2,  5,  1,
+  2,  3,  3, -4,  4,  0,
+  2,  3,  2, -4,  3,  1,
+  2,  1, 10, -1, 13,  0,
+  2,  1,  3, -1,  5,  0,
+  2,  1,  3, -2,  6,  0,
+  2,  2,  3, -2,  4,  0,
+  2,  1,  3, -1,  6,  0,
+  2,  8,  2,-14,  3,  0,
+  3,  1,  3,  2,  5, -5,  6,  1,
+  3,  5,  3, -8,  4,  3,  5,  1,
+  1,  1, 12,  3,
+  3,  3,  3, -8,  4,  3,  5,  1,
+  3,  1,  3, -2,  5,  5,  6,  0,
+  2,  8,  2,-12,  3,  0,
+  2,  1,  3,  1,  5,  0,
+  3,  2, 10,  1, 12, -2, 11,  1,
+  2,  5,  2, -7,  3,  0,
+  3,  1, 10,  1, 13, -2, 11,  0,
+  2,  2,  2, -2,  3,  0,
+  2,  5,  3, -7,  4,  0,
+  3,  1, 12, -2, 13,  2, 11,  0,
+  2,  4,  3, -5,  4,  0,
+  2,  3,  3, -3,  4,  0,
+  1,  1,  2,  0,
+  3,  3, 10,  1, 12, -3, 13,  0,
+  2,  2,  3, -4,  5,  0,
+  2,  2,  3, -3,  5,  0,
+  2,  2, 10, -2, 13,  0,
+  2,  2,  3, -2,  5,  0,
+  2,  3,  2, -3,  3,  0,
+  3,  1, 10, -1, 12, -1, 13,  1,
+  2,  2,  3, -1,  5,  0,
+  2,  2,  3, -2,  6,  0,
+  1,  2, 12,  2,
+  3, -2, 10,  1, 11,  1, 14,  0,
+  2,  2, 10, -2, 11,  0,
+  2,  2,  2, -1,  3,  0,
+  4, -2, 10,  2, 13,  1,  2, -1,  3,  0,
+  2,  4,  2, -4,  3,  0,
+  2,  3, 10, -3, 13,  0,
+  4, -2, 10,  2, 13,  1,  3, -1,  5,  0,
+  2,  3,  3, -3,  5,  0,
+  3,  2, 10, -1, 12, -2, 13,  2,
+  3,  3, 10, -1, 13, -2, 11,  0,
+  1,  3, 12,  1,
+  4, -2, 10,  2, 13,  2,  2, -2,  3,  0,
+  3,  2, 10, -1, 12, -2, 11,  1,
+  2,  5,  2, -5,  3,  0,
+  2,  4, 10, -4, 13,  0,
+  2,  6,  2, -6,  3,  0,
+  3,  2, 10, -2, 12, -2, 13,  1,
+  3,  4, 10, -2, 13, -2, 11,  0,
+  3,  2, 10, -2, 12, -2, 11,  0,
+  2,  7,  2, -7,  3,  0,
+  3,  2, 10, -3, 12, -2, 13,  0,
+  2,  8,  2, -8,  3,  0,
+  2,  9,  2, -9,  3,  0,
+  2, 10,  2,-10,  3,  0,
+  3,  2, 10, -4, 12, -1, 13,  0,
+  3,  4, 10, -2, 12, -3, 13,  0,
+  4,  4, 10, -1, 12, -1, 13, -2, 11,  0,
+  3,  2, 10, -3, 12, -1, 13,  1,
+  4, -2, 10,  1, 13,  3,  3, -2,  5,  0,
+  3,  4, 10, -1, 12, -3, 13,  0,
+  4, -2, 10,  1, 13,  3,  3, -3,  5,  0,
+  4,  2, 10, -2, 12,  1, 13, -2, 11,  0,
+  4, -2, 10,  1, 13,  2,  2, -1,  3,  0,
+  3,  3, 10, -1, 12, -2, 11,  0,
+  3,  4, 10, -1, 13, -2, 11,  0,
+  3,  2, 10, -2, 12, -1, 13,  2,
+  4, -2, 10,  1, 13,  2,  3, -1,  5,  0,
+  3,  3, 10, -1, 12, -2, 13,  0,
+  4, -2, 10,  1, 13,  3,  2, -3,  3,  0,
+  4, -2, 10,  1, 13,  2,  3, -2,  5,  0,
+  2,  4, 10, -3, 13,  0,
+  4, -2, 10,  1, 13,  2,  3, -3,  5,  0,
+  3, -2, 10,  1, 13,  1,  2,  0,
+  4,  2, 10, -1, 12,  1, 13, -2, 11,  1,
+  4, -2, 10,  1, 13,  2,  2, -2,  3,  0,
+  2,  3, 12, -1, 13,  0,
+  2,  3, 10, -2, 11,  0,
+  2,  1, 10, -2, 12,  0,
+  4,  4, 10,  1, 12, -1, 13, -2, 11,  0,
+  3, -1, 13,  3,  2, -2,  3,  0,
+  3, -1, 13,  3,  3, -2,  5,  0,
+  3, -2, 10, 18,  2,-15,  3,  0,
+  5,  2, 10, -1, 13,  3,  3, -8,  4,  3,  5,  0,
+  3,  2, 10, -1, 12, -1, 13,  2,
+  5, -2, 10,  1, 13,  5,  3, -8,  4,  3,  5,  0,
+  5, -2, 10,  1, 13,  1,  3,  2,  5, -5,  6,  0,
+  4,  2, 10, -2, 13, 18,  2,-17,  3,  0,
+  4, -2, 10,  1, 13,  1,  3, -1,  6,  0,
+  4, -2, 10,  1, 13,  2,  3, -2,  4,  0,
+  4, -2, 10,  1, 13,  1,  3, -1,  5,  0,
+  2,  3, 10, -2, 13,  0,
+  4, -2, 10,  1, 13,  3,  2, -4,  3,  0,
+  4, -2, 10,  1, 13,  3,  3, -4,  4,  0,
+  4, -2, 10,  1, 13,  1,  3, -2,  5,  0,
+  3,  4, 10,  1, 12, -3, 13,  0,
+  4, -2, 10,  1, 13,  1,  3, -3,  5,  0,
+  3, -1, 13,  4,  2, -4,  3,  0,
+  4, -2, 10,  1, 13,  1,  2, -1,  3,  0,
+  4, -2, 10,  1, 13,  1,  3, -1,  4,  0,
+  4, -2, 10,  1, 13,  2,  3, -3,  4,  0,
+  4, -2, 10,  1, 13,  3,  3, -5,  4,  0,
+  3,  2, 10,  1, 13, -2, 11,  0,
+  4, -2, 10, -1, 13,  1, 11,  1, 14,  0,
+  4, -2, 10,  1, 13,  2,  2, -3,  3,  1,
+  2,  2, 12, -1, 13,  1,
+  3,  3, 10,  1, 12, -2, 11,  0,
+  4,  2, 10, -1, 13,  2,  3, -4,  4,  0,
+  4,  2, 10, -1, 13,  3,  2, -5,  3,  0,
+  2,  1, 10, -1, 12,  1,
+  3, -1, 13,  3,  2, -3,  3,  0,
+  3, -2, 10,  1, 13,  1,  5,  0,
+  4,  2, 10, -1, 13,  1,  3, -2,  4,  0,
+  3, -1, 13,  2,  3, -2,  5,  0,
+  4,  2, 10, -1, 13, -1, 11,  1, 14,  0,
+  3, -1, 13,  5,  3, -6,  4,  0,
+  3, -2, 10,  1, 13,  1,  6,  0,
+  3, -1, 10,  1,  3, -1,  5,  0,
+  4, -2, 10,  1, 13,  8,  2,-13,  3,  1,
+  3, -2, 10, 18,  2,-16,  3,  1,
+  5, -2, 10,  1, 13,  3,  2, -7,  3,  4,  4,  1,
+  4,  2, 10, -1, 13,  2,  5, -5,  6,  1,
+  5,  2, 10, -1, 13,  4,  3, -8,  4,  3,  5,  1,
+  2,  2, 10, -1, 13,  2,
+  5, -2, 10,  1, 13,  4,  3, -8,  4,  3,  5,  1,
+  4, -2, 10,  1, 13,  2,  5, -5,  6,  1,
+  5,  2, 10, -1, 13,  3,  2, -7,  3,  4,  4,  0,
+  4,  2, 10, -2, 13, 18,  2,-16,  3,  1,
+  4,  2, 10, -1, 13,  8,  2,-13,  3,  1,
+  3, -1, 10,  3,  2, -4,  3,  0,
+  3, -1, 13,  6,  2, -8,  3,  0,
+  3, -1, 13,  2,  3, -3,  5,  0,
+  3, -1, 13,  6,  3, -8,  4,  0,
+  3,  2, 10, -1, 13,  1,  6,  0,
+  4, -2, 10,  1, 13, -1, 11,  1, 14,  0,
+  4, -2, 10,  1, 13,  1,  3, -2,  4,  0,
+  3,  2, 10, -1, 13,  1,  5,  0,
+  3,  3, 10,  1, 12, -2, 13,  0,
+  4, -2, 10,  1, 13,  3,  2, -5,  3,  0,
+  4, -2, 10,  1, 13,  2,  3, -4,  4,  0,
+  2, -1, 13,  1,  2,  0,
+  4,  2, 10, -1, 13,  2,  2, -3,  3,  0,
+  3, -1, 10,  1,  2, -1,  3,  0,
+  3, -1, 13,  4,  2, -5,  3,  0,
+  3,  2, 10, -3, 13,  2, 11,  0,
+  4,  2, 10, -1, 13,  2,  3, -3,  4,  0,
+  3, -1, 13,  2,  2, -2,  3,  0,
+  4,  2, 10, -1, 13,  1,  2, -1,  3,  0,
+  4,  2, 10,  1, 12,  1, 13, -2, 11,  0,
+  3, -2, 13, 18,  2,-15,  3,  0,
+  2,  1, 12, -1, 13,  2,
+  3, -1, 13,  1,  3, -1,  6,  0,
+  4,  2, 10, -1, 13,  1,  3, -2,  5,  0,
+  3, -1, 13,  2,  3, -2,  4,  0,
+  3, -1, 13,  1,  3, -1,  5,  0,
+  4,  2, 10, -1, 13,  3,  3, -4,  4,  0,
+  1,  1, 10,  0,
+  3, -1, 13,  3,  2, -4,  3,  0,
+  3, -1, 13,  3,  3, -4,  4,  0,
+  4,  2, 10, -1, 13,  1,  3, -1,  5,  0,
+  4,  2, 10, -1, 13,  2,  3, -2,  4,  0,
+  3, -1, 13,  1,  3, -2,  5,  0,
+  3,  2, 10,  1, 12, -1, 13,  2,
+  3,  1, 12,  1, 13, -2, 11,  0,
+  3, -1, 13,  1,  2, -1,  3,  0,
+  4,  2, 10, -1, 13,  2,  2, -2,  3,  0,
+  3, -1, 13,  4,  2, -6,  3,  0,
+  3, -1, 13,  2,  3, -3,  4,  0,
+  3,  1, 13,  1,  2, -2,  3,  0,
+  4,  2, 10, -1, 13,  3,  3, -3,  4,  0,
+  2,  3, 13, -2, 11,  0,
+  4,  2, 10, -1, 13,  4,  2, -5,  3,  0,
+  3,  1, 10,  1,  2, -1,  3,  0,
+  3, -1, 13,  2,  2, -3,  3,  1,
+  3,  2, 10,  2, 12, -3, 13,  0,
+  3,  2, 10, -1, 13,  1,  2,  0,
+  3,  1, 13,  2,  3, -4,  4,  0,
+  3,  1, 13,  3,  2, -5,  3,  0,
+  2, 21,  2,-21,  3,  0,
+  3,  1, 10,  1, 12, -2, 13,  1,
+  4,  2, 10, -1, 13,  2,  3, -4,  5,  0,
+  4,  2, 10, -1, 13,  7,  3,-10,  4,  0,
+  2, -1, 13,  1,  5,  0,
+  3,  1, 13,  1,  3, -2,  4,  0,
+  4,  2, 10, -3, 13,  2,  3, -2,  5,  0,
+  3,  1, 10,  1,  3, -2,  5,  0,
+  3,  1, 13, -1, 11,  1, 14,  1,
+  2, -1, 13,  1,  6,  0,
+  4,  2, 10, -1, 13,  6,  3, -8,  4,  1,
+  4,  2, 10, -1, 13,  2,  3, -3,  5,  1,
+  3, -1, 13,  8,  3,-15,  4,  0,
+  4,  2, 10, -1, 13,  6,  2, -8,  3,  0,
+  5,  2, 10, -1, 13, -2, 11,  5,  2, -6,  3,  0,
+  3,  1, 10,  3,  3, -4,  4,  0,
+  3,  1, 10,  3,  2, -4,  3,  1,
+  4,  1, 10, -1, 13, -1, 11,  2,  4,  0,
+  3, -2, 13, 26,  2,-29,  3,  0,
+  3, -1, 13,  8,  2,-13,  3,  0,
+  3, -2, 13, 18,  2,-16,  3,  2,
+  4, -1, 13,  3,  2, -7,  3,  4,  4,  0,
+  3,  1, 13,  2,  5, -5,  6,  1,
+  4,  1, 13,  4,  3, -8,  4,  3,  5,  1,
+  1,  1, 13,  3,
+  4, -1, 13,  4,  3, -8,  4,  3,  5,  1,
+  3, -1, 13,  2,  5, -5,  6,  1,
+  4,  1, 13,  3,  2, -7,  3,  4,  4,  0,
+  2, 18,  2,-16,  3,  1,
+  3,  1, 13,  8,  2,-13,  3,  2,
+  2, 26,  2,-29,  3,  0,
+  4,  1, 10,  1, 13, -1, 11,  2,  4,  0,
+  5,  2, 10,  1, 13, -2, 11,  5,  2, -6,  3,  0,
+  3,  1, 13,  8,  3,-15,  4,  1,
+  4,  2, 10, -3, 13,  2,  3, -3,  5,  0,
+  3,  1, 10,  1,  3, -1,  5,  0,
+  2,  1, 13,  1,  6,  0,
+  4,  2, 10, -1, 13,  5,  3, -6,  4,  0,
+  3,  1, 10,  2,  3, -2,  4,  0,
+  3, -1, 13, -1, 11,  1, 14,  1,
+  4,  2, 10, -1, 13,  2,  3, -5,  6,  0,
+  4,  2, 10, -1, 13,  2,  3, -2,  5,  0,
+  5,  2, 10, -1, 13,  2,  3, -4,  5,  5,  6,  0,
+  3, -1, 13,  1,  3, -2,  4,  1,
+  2,  1, 13,  1,  5,  0,
+  4,  2, 10, -1, 13,  4,  3, -4,  4,  0,
+  4,  2, 10, -1, 13,  3,  2, -3,  3,  0,
+  4,  2, 10,  2, 12, -1, 13, -2, 11,  0,
+  2,  1, 10,  1, 12,  2,
+  3, -1, 13,  3,  2, -5,  3,  0,
+  3, -1, 13,  2,  3, -4,  4,  0,
+  4,  2, 10, -1, 13,  2,  3, -1,  5,  0,
+  4,  2, 10, -1, 13,  2,  3, -2,  6,  0,
+  3,  1, 10,  1, 12, -2, 11,  0,
+  3,  2, 10,  2, 12, -1, 13,  1,
+  3,  1, 13,  2,  2, -3,  3,  1,
+  3, -1, 13,  1, 11,  1, 14,  0,
+  2,  1, 13, -2, 11,  0,
+  4,  2, 10, -1, 13,  5,  2, -6,  3,  0,
+  3, -1, 13,  1,  2, -2,  3,  0,
+  3,  1, 13,  2,  3, -3,  4,  0,
+  3,  1, 13,  1,  2, -1,  3,  0,
+  4,  2, 10, -1, 13,  4,  2, -4,  3,  0,
+  3,  2, 10,  1, 12, -3, 13,  1,
+  3,  1, 13,  1,  3, -2,  5,  0,
+  3,  1, 13,  3,  3, -4,  4,  0,
+  3,  1, 13,  3,  2, -4,  3,  0,
+  2,  1, 10, -2, 13,  0,
+  4,  2, 10, -1, 13,  3,  3, -4,  5,  0,
+  3,  1, 13,  1,  3, -1,  5,  0,
+  3,  1, 13,  2,  3, -2,  4,  0,
+  3,  1, 13,  1,  3, -1,  6,  0,
+  4,  2, 10, -1, 13,  3,  3, -3,  5,  0,
+  4,  2, 10, -1, 13,  6,  2, -7,  3,  0,
+  2,  1, 12,  1, 13,  2,
+  4,  2, 10, -1, 13,  3,  3, -2,  5,  0,
+  4,  2, 10,  1, 12, -1, 13, -2, 11,  0,
+  2,  1, 10,  2, 12,  0,
+  2,  1, 10, -2, 11,  0,
+  3,  1, 13,  2,  2, -2,  3,  0,
+  3,  1, 12, -1, 13,  2, 11,  0,
+  4,  2, 10, -1, 13,  5,  2, -5,  3,  0,
+  3,  1, 13,  2,  3, -3,  5,  0,
+  2,  2, 10, -3, 13,  0,
+  3,  1, 13,  2,  3, -2,  5,  0,
+  3,  1, 13,  3,  2, -3,  3,  0,
+  3,  1, 10, -1, 12, -2, 13,  0,
+  4,  2, 10, -1, 13,  6,  2, -6,  3,  0,
+  2,  2, 12,  1, 13,  1,
+  3,  2, 10, -1, 13, -2, 11,  0,
+  3,  1, 10, -1, 12, -2, 11,  0,
+  3,  2, 10,  1, 13, -4, 11,  0,
+  3,  1, 13,  4,  2, -4,  3,  0,
+  4,  2, 10, -1, 13,  7,  2, -7,  3,  0,
+  3,  2, 10, -1, 12, -3, 13,  1,
+  2,  3, 12,  1, 13,  0,
+  4,  2, 10, -1, 12, -1, 13, -2, 11,  0,
+  3,  1, 13,  5,  2, -5,  3,  0,
+  4,  2, 10, -1, 13,  8,  2, -8,  3,  0,
+  3,  2, 10, -2, 12, -3, 13,  0,
+  4,  2, 10, -1, 13,  9,  2, -9,  3,  0,
+  3,  4, 10, -3, 12, -2, 13,  0,
+  2,  2, 10, -4, 12,  0,
+  3,  4, 10, -2, 12, -2, 13,  1,
+  2,  6, 10, -4, 13,  0,
+  3,  4, 10, -1, 12, -2, 11,  0,
+  2,  2, 10, -3, 12,  1,
+  3,  3, 10, -2, 12, -1, 13,  0,
+  3, -2, 10,  3,  3, -2,  5,  0,
+  3,  4, 10, -1, 12, -2, 13,  1,
+  3, -2, 10,  3,  3, -3,  5,  0,
+  2,  5, 10, -3, 13,  0,
+  3, -2, 10,  4,  2, -4,  3,  0,
+  3, -2, 10,  2,  2, -1,  3,  0,
+  2,  4, 10, -2, 11,  0,
+  2,  2, 10, -2, 12,  2,
+  3, -2, 10,  3,  3, -2,  4,  0,
+  3, -2, 10,  2,  3, -1,  5,  0,
+  3,  3, 10, -1, 12, -1, 13,  1,
+  3, -2, 10,  3,  2, -3,  3,  0,
+  3, -2, 10,  2,  3, -2,  5,  0,
+  2,  4, 10, -2, 13,  0,
+  3, -2, 10,  2,  3, -3,  5,  0,
+  2, -2, 10,  1,  2,  0,
+  4,  2, 10, -1, 12,  2, 13, -2, 11,  0,
+  3, -2, 10,  2,  2, -2,  3,  0,
+  3,  3, 10,  1, 13, -2, 11,  0,
+  3,  4, 10,  1, 12, -2, 11,  0,
+  4,  2, 10, -1, 12, -1, 11,  1, 14,  0,
+  4, -2, 10, -1, 13, 18,  2,-15,  3,  0,
+  4,  2, 10,  3,  3, -8,  4,  3,  5,  0,
+  2,  2, 10, -1, 12,  2,
+  4, -2, 10,  5,  3, -8,  4,  3,  5,  0,
+  4,  2, 10, -1, 13, 18,  2,-17,  3,  0,
+  3, -2, 10,  1,  3, -1,  6,  0,
+  3, -2, 10,  2,  3, -2,  4,  0,
+  3, -2, 10,  1,  3, -1,  5,  0,
+  2,  3, 10, -1, 13,  0,
+  3, -2, 10,  3,  2, -4,  3,  0,
+  3, -2, 10,  3,  3, -4,  4,  0,
+  3, -2, 10,  1,  3, -2,  5,  0,
+  3,  4, 10,  1, 12, -2, 13,  1,
+  4,  2, 10, -1, 12, -2, 13,  2, 11,  0,
+  3, -2, 10,  1,  2, -1,  3,  0,
+  3, -2, 10,  2,  3, -3,  4,  0,
+  3,  2, 10,  2, 13, -2, 11,  0,
+  3, -2, 10,  2,  2, -3,  3,  0,
+  2,  2, 12, -2, 13,  1,
+  3,  2, 10,  2,  3, -4,  4,  0,
+  3,  2, 10,  3,  2, -5,  3,  0,
+  3,  1, 10, -1, 12,  1, 13,  1,
+  3, -2, 13,  3,  2, -3,  3,  0,
+  2, -2, 10,  1,  5,  0,
+  3,  2, 10,  1,  3, -2,  4,  0,
+  3, -2, 13,  2,  3, -2,  5,  0,
+  3,  2, 10, -1, 11,  1, 14,  0,
+  4,  4, 10, -2, 13,  2,  3, -3,  5,  0,
+  3, -2, 10,  8,  2,-13,  3,  0,
+  4, -2, 10, -1, 13, 18,  2,-16,  3,  1,
+  4, -2, 10,  3,  2, -7,  3,  4,  4,  0,
+  4,  2, 10,  4,  3, -8,  4,  3,  5,  1,
+  1,  2, 10,  3,
+  4, -2, 10,  4,  3, -8,  4,  3,  5,  1,
+  4,  2, 10,  3,  2, -7,  3,  4,  4,  0,
+  4,  2, 10, -1, 13, 18,  2,-16,  3,  1,
+  3,  2, 10,  8,  2,-13,  3,  0,
+  3, -2, 10, -1, 11,  1, 14,  0,
+  4,  4, 10, -2, 13,  2,  3, -2,  5,  0,
+  3, -2, 10,  1,  3, -2,  4,  0,
+  2,  2, 10,  1,  5,  0,
+  4,  4, 10, -2, 13,  3,  2, -3,  3,  0,
+  3,  3, 10,  1, 12, -1, 13,  1,
+  3, -2, 10,  3,  2, -5,  3,  0,
+  3, -2, 10,  2,  3, -4,  4,  0,
+  3,  4, 10,  2, 12, -2, 13,  0,
+  3,  2, 10,  2,  2, -3,  3,  0,
+  3,  2, 10, -2, 13,  2, 11,  0,
+  3,  2, 10,  1,  2, -1,  3,  0,
+  4,  2, 10,  1, 12,  2, 13, -2, 11,  0,
+  2,  1, 12, -2, 13,  2,
+  3,  2, 10,  1,  3, -2,  5,  0,
+  3, -2, 13,  1,  3, -1,  5,  0,
+  3,  2, 10,  3,  2, -4,  3,  0,
+  2,  1, 10,  1, 13,  0,
+  3,  2, 10,  1,  3, -1,  5,  0,
+  3,  2, 10,  2,  3, -2,  4,  0,
+  2,  2, 10,  1, 12,  2,
+  2,  1, 12, -2, 11,  0,
+  3, -2, 13,  1,  2, -1,  3,  0,
+  3,  1, 10, -1, 13,  2, 11,  0,
+  3,  2, 10,  2,  2, -2,  3,  0,
+  3,  1, 10,  1, 12, -3, 13,  0,
+  3,  2, 13, -1, 11,  1, 14,  0,
+  3,  2, 10,  2,  3, -3,  5,  0,
+  3,  2, 10,  6,  2, -8,  3,  0,
+  3, -3, 13, 18,  2,-16,  3,  1,
+  3,  2, 13,  2,  5, -5,  6,  0,
+  4,  2, 13,  4,  3, -8,  4,  3,  5,  0,
+  1,  2, 13,  0,
+  4, -2, 13,  4,  3, -8,  4,  3,  5,  0,
+  3, -2, 13,  2,  5, -5,  6,  0,
+  3,  1, 13, 18,  2,-16,  3,  1,
+  3, -2, 13, -1, 11,  1, 14,  0,
+  3,  2, 10,  2,  3, -2,  5,  0,
+  3,  2, 10,  3,  2, -3,  3,  0,
+  3,  1, 10,  1, 12,  1, 13,  1,
+  2,  2, 10,  2, 12,  1,
+  2,  1, 11,  1, 14,  1,
+  4, -1, 13, -2, 11, 18,  2,-16,  3,  0,
+  1,  2, 11,  0,
+  4, -1, 13,  2, 11, 18,  2,-16,  3,  0,
+  2, -3, 11,  1, 14,  0,
+  3,  2, 13,  1,  2, -1,  3,  0,
+  3,  2, 10,  4,  2, -4,  3,  0,
+  3,  2, 10,  1, 12, -4, 13,  0,
+  2,  1, 10, -3, 13,  0,
+  3,  2, 13,  1,  3, -1,  5,  0,
+  2,  1, 12,  2, 13,  2,
+  3,  1, 10,  2, 12,  1, 13,  0,
+  3,  1, 10, -1, 13, -2, 11,  0,
+  2,  1, 12,  2, 11,  1,
+  3,  2, 10,  5,  2, -5,  3,  0,
+  2,  2, 10, -4, 13,  0,
+  3,  2, 10,  6,  2, -6,  3,  0,
+  2,  2, 12,  2, 13,  0,
+  3,  2, 10, -2, 13, -2, 11,  0,
+  2,  2, 12,  2, 11,  0,
+  2,  2, 10, -4, 11,  0,
+  3,  2, 10,  7,  2, -7,  3,  0,
+  3,  2, 10, -1, 12, -4, 13,  0,
+  4,  2, 10, -1, 12, -2, 13, -2, 11,  0,
+  3,  2, 10,  8,  2, -8,  3,  0,
+  3,  2, 10,  9,  2, -9,  3,  0,
+  3,  4, 10, -3, 12, -1, 13,  0,
+  3,  6, 10, -1, 12, -3, 13,  0,
+  3,  4, 10, -2, 12, -1, 13,  1,
+  3,  5, 10, -1, 12, -2, 13,  0,
+  2,  6, 10, -3, 13,  0,
+  4,  4, 10, -1, 12,  1, 13, -2, 11,  0,
+  3,  2, 10, -3, 12,  1, 13,  0,
+  2,  3, 10, -2, 12,  0,
+  3,  4, 10, -1, 12, -1, 13,  1,
+  2,  5, 10, -2, 13,  0,
+  3,  6, 10,  1, 12, -3, 13,  0,
+  3,  4, 10,  1, 13, -2, 11,  0,
+  3,  2, 10, -2, 12,  1, 13,  1,
+  2,  3, 10, -1, 12,  0,
+  4, -2, 10, -1, 13,  2,  3, -2,  5,  0,
+  2,  4, 10, -1, 13,  0,
+  4,  2, 10, -2, 12, -1, 13,  2, 11,  0,
+  3,  4, 10, -3, 13,  2, 11,  0,
+  4, -2, 10, -1, 13,  2,  2, -2,  3,  0,
+  3,  2, 10, -1, 12,  1, 13,  2,
+  4, -2, 10, -1, 13,  1,  3, -1,  5,  0,
+  1,  3, 10,  0,
+  3,  4, 10,  1, 12, -1, 13,  1,
+  4,  2, 10, -1, 12, -1, 13,  2, 11,  1,
+  4, -2, 10, -1, 13,  1,  2, -1,  3,  0,
+  3,  2, 10,  3, 13, -2, 11,  0,
+  2,  2, 12, -3, 13,  0,
+  3,  1, 10, -1, 12,  2, 13,  0,
+  4,  2, 10,  1, 13, -1, 11,  1, 14,  0,
+  4, -2, 10, -2, 13, 18,  2,-16,  3,  0,
+  5,  2, 10,  1, 13,  4,  3, -8,  4,  3,  5,  0,
+  2,  2, 10,  1, 13,  1,
+  5, -2, 10, -1, 13,  4,  3, -8,  4,  3,  5,  0,
+  3,  2, 10, 18,  2,-16,  3,  0,
+  4, -2, 10, -1, 13, -1, 11,  1, 14,  0,
+  4,  4, 10, -1, 13,  2,  3, -2,  5,  0,
+  4,  4, 10, -1, 13,  3,  2, -3,  3,  0,
+  2,  3, 10,  1, 12,  1,
+  3,  4, 10,  2, 12, -1, 13,  0,
+  4,  2, 10, -1, 13,  1, 11,  1, 14,  0,
+  3,  2, 10, -1, 13,  2, 11,  0,
+  2,  1, 12, -3, 13,  1,
+  2,  1, 10,  2, 13,  0,
+  3,  2, 10,  1, 12,  1, 13,  1,
+  3,  1, 12, -1, 13, -2, 11,  1,
+  2,  1, 10,  2, 11,  0,
+  4,  2, 10,  1, 12, -1, 13,  2, 11,  0,
+  1,  3, 13,  0,
+  4,  2, 10,  1, 13,  2,  3, -2,  5,  0,
+  3,  1, 10,  1, 12,  2, 13,  0,
+  3,  2, 10,  2, 12,  1, 13,  0,
+  3,  1, 13,  1, 11,  1, 14,  0,
+  2,  1, 13,  2, 11,  0,
+  3,  1, 10,  1, 12,  2, 11,  0,
+  4,  2, 10,  2, 12, -1, 13,  2, 11,  0,
+  2,  1, 13, -4, 11,  0,
+  2,  1, 10, -4, 13,  0,
+  2,  1, 12,  3, 13,  1,
+  3,  1, 12,  1, 13,  2, 11,  1,
+  2,  2, 10, -5, 13,  0,
+  3,  2, 10, -3, 13, -2, 11,  0,
+  3,  2, 10, -1, 13, -4, 11,  0,
+  3,  6, 10, -2, 12, -2, 13,  0,
+  2,  4, 10, -3, 12,  0,
+  3,  6, 10, -1, 12, -2, 13,  0,
+  2,  4, 10, -2, 12,  1,
+  2,  6, 10, -2, 13,  0,
+  2,  4, 10, -1, 12,  1,
+  2,  5, 10, -1, 13,  0,
+  3,  6, 10,  1, 12, -2, 13,  0,
+  4,  4, 10, -1, 12, -2, 13,  2, 11,  0,
+  3,  4, 10,  2, 13, -2, 11,  0,
+  3,  2, 10, -2, 12,  2, 13,  0,
+  1,  4, 10,  0,
+  3,  2, 10, -2, 12,  2, 11,  0,
+  3,  4, 10, -2, 13,  2, 11,  0,
+  3,  2, 10, -1, 12,  2, 13,  1,
+  2,  3, 10,  1, 13,  0,
+  2,  4, 10,  1, 12,  1,
+  3,  2, 10, -1, 12,  2, 11,  1,
+  3,  3, 10, -1, 13,  2, 11,  0,
+  2,  2, 10,  2, 13,  0,
+  3,  3, 10,  1, 12,  1, 13,  0,
+  3,  2, 10,  1, 11,  1, 14,  0,
+  2,  2, 10,  2, 11,  0,
+  2,  1, 12, -4, 13,  0,
+  2,  1, 10,  3, 13,  0,
+  3,  2, 10,  1, 12,  2, 13,  1,
+  3,  1, 12, -2, 13, -2, 11,  0,
+  3,  1, 10,  1, 13,  2, 11,  0,
+  3,  2, 10,  1, 12,  2, 11,  0,
+  1,  4, 13,  0,
+  3,  1, 10,  1, 12,  3, 13,  0,
+  2,  2, 13,  2, 11,  0,
+  4,  1, 10,  1, 12,  1, 13,  2, 11,  0,
+  1,  4, 11,  0,
+  2,  1, 12,  4, 13,  0,
+  3,  1, 12,  2, 13,  2, 11,  0,
+  3,  2, 10, -4, 13, -2, 11,  0,
+  3,  6, 10, -2, 12, -1, 13,  0,
+  2,  8, 10, -3, 13,  0,
+  3,  6, 10, -1, 12, -1, 13,  0,
+  3,  4, 10, -2, 12,  1, 13,  0,
+  2,  6, 10, -1, 13,  0,
+  3,  4, 10, -1, 12,  1, 13,  1,
+  3,  6, 10,  1, 12, -1, 13,  0,
+  4,  4, 10, -1, 12, -1, 13,  2, 11,  0,
+  3,  2, 10, -2, 12,  3, 13,  0,
+  2,  4, 10,  1, 13,  0,
+  3,  4, 10, -1, 13,  2, 11,  0,
+  3,  2, 10, -1, 12,  3, 13,  0,
+  3,  4, 10,  1, 12,  1, 13,  0,
+  4,  2, 10, -1, 12,  1, 13,  2, 11,  0,
+  2,  2, 10,  3, 13,  0,
+  3,  2, 10,  1, 13,  2, 11,  0,
+  3,  2, 10, -1, 13,  4, 11,  0,
+  3,  2, 10,  1, 12,  3, 13,  0,
+  3,  1, 12, -3, 13, -2, 11,  0,
+  3,  1, 10,  2, 13,  2, 11,  0,
+  4,  2, 10,  1, 12,  1, 13,  2, 11,  0,
+  1,  5, 13,  0,
+  2,  3, 13,  2, 11,  0,
+  2,  1, 13,  4, 11,  0,
+  3,  1, 12,  3, 13,  2, 11,  0,
+  2,  8, 10, -2, 13,  0,
+  2,  6, 10, -1, 12,  0,
+  1,  6, 10,  0,
+  3,  6, 10, -2, 13,  2, 11,  0,
+  3,  4, 10, -1, 12,  2, 13,  0,
+  3,  4, 10, -1, 12,  2, 11,  0,
+  2,  4, 10,  2, 13,  0,
+  2,  4, 10,  2, 11,  0,
+  3,  2, 10, -1, 12,  4, 13,  0,
+  3,  4, 10,  1, 12,  2, 13,  0,
+  4,  2, 10, -1, 12,  2, 13,  2, 11,  0,
+  2,  2, 10,  4, 13,  0,
+  3,  2, 10,  2, 13,  2, 11,  0,
+  2,  2, 10,  4, 11,  0,
+  1,  6, 13,  0,
+  2,  4, 13,  2, 11,  0,
+  2,  2, 13,  4, 11,  0,
+  3,  6, 10, -1, 12,  1, 13,  0,
+  2,  6, 10,  1, 13,  0,
+  2,  4, 10,  3, 13,  0,
+  3,  4, 10,  1, 13,  2, 11,  0,
+  2,  2, 10,  5, 13,  0,
+  3,  2, 10,  3, 13,  2, 11,  0,
+ -1
+};
+
+static long btabr[] = {-1};
+static long btabb[] = {-1};
+static long btabl[] = {
+        -3,        -4,
+         4,     -1856,         0,      8043,
+        -9,     -1082,
+        -1,      -310,
+        -1,      -522,
+      -330,     -1449,      -853,      4656,
+       -66,         7,
+        -1,   9996928,
+       -66,         6,
+        23,       183,
+         0,       173,
+         0,       -56,
+         0,        50,
+         0,      -785,
+         1,        51,
+         0,       -60,
+         1,     11843,         0,    -50754,
+         0,      1834,         1,     -7910,
+         0,    -48060,
+         1,        56,
+         0,     13141,        -1,    -56318,
+         0,      2541,
+        -1,      -649,
+      -133,       778,
+       -46,         8,
+         1,   1665737,
+       -47,         7,
+         0,        65,
+         0,        45,
+         0,      -138,
+         0,     -1005,
+         0,     -2911,
+         0,       -47,
+         0,        96,
+         0,      -394,
+         2,        76,
+         2,    -17302,         0,     74337,
+         0,      -101,
+         0,        58,
+         0,      -171,
+         0,       -77,
+         0,     -1283,         0,      2686,
+         0,       -55,
+         0,        99,
+         0,        55,
+         0,       397,
+         0,       540,
+         0,       626,
+        -1,     -5188,         0,     10857,
+         0,      -216,
+        -2,      -123,
+         0,      6337,
+         2,       224,
+      -152,    -23472,       -29,    -74336,         0,    295775,
+       -20,       149,
+        -2,        84,
+         9,       304,
+         0,     -3051,
+       -70,        -6,
+       -57,        34,
+         0,      -638,
+         0,      -201,
+       -73,         9,
+         0,      -100,
+      -101,        -8,
+         0,       -57,
+         0,      -207,
+        -3,        80,
+       -45,        45,
+        -5,       102,
+       -59,       -23,
+        52,       201,
+       -48,       233,      -220,        71,
+         4,      2810,         0,   6236541,
+       -61,       218,      -216,        67,
+        51,       201,
+       -59,       -23,
+      -144,      -837,      -457,      3029,
+       -45,        42,
+       -15,        73,
+        -6,      -169,
+         0,       135,
+       -64,        -7,
+         0,    -16245,
+         0,       -81,
+       -74,       -10,
+         0,       702,         0,     -3013,
+         0,     -5889,
+         1,       141,
+        58,      9598,        12,     30443,         1,   -120946,
+        -1,       -84,
+        -2,     11246,        -1,    -48391,
+         0,      1393,
+         0,       200,
+      -136,       -17,
+         0,       558,
+       -64,        -8,
+         0,       -71,
+         0,    317577,
+       -28,       183,
+         1,       219,
+         0,       421,
+         0,      -133,
+       501,      -139,
+         3,       354,
+      -101,       -13,
+        74,         7,
+       144,       -84,
+        59,        -2,
+         1,        64,
+     -2931,     12559,     -4641,      2638,      -303,     -2058,
+       -13,      -100,      -123,       -79,
+    -19214,      6084,      1494,     26993,     15213,    -82219,
+        42,        52,        48,      -101,
+       -53,        -4,
+         4,        47,
+        58,      -131,
+        46,        14,
+       -21,        -6,
+     -1311,     -8791,     10198,     -4185,      2815,      5640,
+       167,       422,      -229,        83,
+      3140,        39,      1221,       120,        96,       -30,
+        -1, 184612405,
+       187,       416,      -226,        81,
+     -1985,    -10083,      9983,     -4464,      2807,      5643,
+       -21,        -9,
+       113,      -367,
+       120,       580,      -667,        27,
+         8,        66,
+       -56,        -6,
+       337,        95,
+       -87,      3303,
+        -1,        65,
+        68,      -374,
+         0,      -574,
+        15,       -94,
+         0,       -53,
+         0,     -1303,
+         0,      -236,
+       283,        36,
+        -1,       -54,
+       269,       -35,
+         0,       -83,
+         0,       -52,
+         0,       730,         0,     -3129,
+         0,       813,
+         0,     -4299,
+         1,        59,
+        -6,      5130,         1,     16239,        -1,    -64603,
+         0,       -80,
+        91,        12,
+         0,      -561,
+       133,       -17,
+         0,       250,
+       -12,        71,
+         0,    155664,
+        82,       -11,
+         0,       106,
+         0,      -604,
+         0,     21862,
+        55,        -7,
+         0,     -1514,         0,      6501,
+         0,       906,
+         0,       -68,
+         0,       241,
+         0,       366,
+         0,        70,
+         0,     -1382,         0,      5957,
+         0,       113,
+         0,       -51,
+         0,       -55,
+         0,       731,
+         0,      -264,
+         0,     65788,
+         1,     -1504,         0,      3147,
+         0,       217,
+         0,     -4105,         0,     17658,
+         1,        69,
+         0,     -3518,
+         0,     -1767,
+       -43,     -7044,       -10,    -22304,         0,     88685,
+         3,        91,
+         0,      -485,
+         0,       -57,
+        -1,    333548,
+       -24,       172,
+        11,       544,         1,     -1132,
+         0,       353,
+         0,      -188,
+         0,        53,
+         0,        77,
+       158,      -887,
+        35,       131,
+       -54,        13,
+         0,   1994821,
+       -53,        14,
+        36,       125,
+         2,        56,
+         0,      -243,
+         0,      -364,
+        -2,      1916,         0,     -8227,
+         0,     15700,        -1,    -67308,
+         1,        66,
+         0,    -53686,
+         1,      3058,         1,    -13177,
+         0,       -72,
+         0,       -72,
+         0,        61,
+         0,     15812,
+         0,       165,
+         8,       -96,
+       318,      1341,       803,     -4252,
+        24,       193,
+      1137,      -226,       310,       622,
+       -56,        30,
+        -3,  10101666,
+       -56,        30,
+      1096,      -225,       300,       600,
+       -31,       409,
+        -1,      -507,
+         0,      -287,
+         0,     -1869,         0,      8026,
+         1,       544,        -1,     -1133,
+         0,     27984,
+         0,       -62,
+         0,      -249,
+         0,       187,
+         0,     -1096,
+         1,        53,
+         2,     12388,         0,    -53107,
+         0,      -322,
+         0,       -94,
+         0,     15157,
+         0,      -582,
+         0,      3291,
+         0,       565,
+         0,       106,
+         0,       112,
+         0,       306,
+         0,       809,
+         0,       130,
+         0,      -961,         0,      4149,
+         0,       174,
+         0,      -105,
+         0,      2196,
+         0,        59,
+         0,     36737,
+        -1,     -1832,         0,      3835,
+         0,      -139,
+         0,     24138,
+         0,      1325,
+         1,        64,
+         0,      -361,
+         0,     -1162,
+       -44,     -6320,       -10,    -20003,         0,     79588,
+         2,        80,
+         0,     -2059,
+         0,      -304,
+         0,     21460,
+         0,      -166,
+         0,       -87,
+        89,      -493,
+        32,       114,
+        34,       510,         1,   1172616,
+        31,       113,
+        -1,        57,
+         0,       214,
+         0,      -656,
+         0,      -646,
+         0,      1850,         0,     -7931,
+         0,     -6674,
+         0,      2944,         0,    -12641,
+         0,       916,
+        45,      -255,
+        16,        60,
+        -1,    619116,
+        16,        57,
+         0,       -58,
+         0,      1045,
+         0,      -156,
+       -15,        88,
+         0,    -62964,
+         0,      -126,
+         0,      1490,         0,     -6387,
+         0,       119,
+         0,      1338,
+         0,       -56,
+         0,       204,
+         0,       153,
+         0,       940,
+         0,       251,
+         0,       312,
+         0,       584,
+         0,      -786,         0,      3388,
+         0,       -52,
+         0,      4733,
+         0,       618,
+         0,     29982,
+         0,       101,
+         0,      -174,
+         0,     -2637,         0,     11345,
+         0,      -284,
+         0,      -524,
+         0,      -121,
+         0,      1464,
+        11,       -60,
+        -1,    151205,
+         0,       139,
+         0,     -2448,
+         0,       -51,
+         0,      -768,
+         0,      -638,
+         0,       552,         0,     -2370,
+         0,        70,
+         0,        64,
+         0,        57,
+         0,     39840,
+         0,       104,
+         0,    -10194,
+         0,      -635,
+         0,        69,
+         0,       113,
+         0,        67,
+         0,        96,
+         0,       367,
+         0,       134,
+         0,       596,
+         0,        63,
+         0,      1622,
+         0,       483,
+         0,        72,
+         0,     11917,
+         0,       -63,
+         0,      1273,
+         0,       -66,
+         0,      -262,
+         0,       -97,
+         0,       103,
+         0,     15196,
+         0,     -1445,
+         0,       -66,
+         0,       -55,
+         0,      -323,
+         0,      2632,
+         0,     -1179,
+         0,        59,
+         0,       -56,
+         0,        78,
+         0,        65,
+         0,       422,
+         0,       309,
+         0,      2125,
+         0,       -66,
+         0,       124,
+         0,       -57,
+         0,      1379,
+         0,      -304,
+         0,       177,
+         0,      -118,
+         0,       146,
+         0,       283,
+         0,       119,
+};
+static CHAR bargs[] = {
+  0,  1,
+  3,  1, 10,  1, 12, -1, 11,  1,
+  4,  2, 10,  2, 12, -1, 13, -1, 11,  0,
+  5,  2, 10, -1, 13, -1, 11,  3,  2, -3,  3,  0,
+  5,  2, 10, -1, 13, -1, 11,  2,  3, -2,  5,  0,
+  2, -1, 13,  1, 14,  1,
+  5, -1, 13,  1, 11,  4,  3, -8,  4,  3,  5,  0,
+  2,  1, 13, -1, 11,  0,
+  5,  1, 13, -1, 11,  4,  3, -8,  4,  3,  5,  0,
+  5,  2, 10, -1, 13, -1, 11,  2,  3, -3,  5,  0,
+  4,  1, 10,  1, 12, -2, 13,  1, 11,  0,
+  4,  1, 13, -1, 11,  1,  2, -1,  3,  0,
+  5,  2, 10, -1, 13, -1, 11,  2,  2, -2,  3,  0,
+  3,  1, 10, -2, 13,  1, 11,  0,
+  4,  1, 13, -1, 11,  1,  3, -1,  5,  0,
+  4, -1, 13,  1, 11,  1,  2, -1,  3,  0,
+  3,  1, 12,  1, 13, -1, 11,  1,
+  4,  2, 10,  1, 12, -1, 13, -1, 11,  1,
+  2,  1, 10, -1, 11,  0,
+  4, -1, 13,  1, 11,  1,  3, -1,  5,  0,
+  3,  1, 12, -1, 13,  1, 11,  1,
+  3,  2, 10, -3, 13,  1, 11,  0,
+  3,  2, 12,  1, 13, -1, 11,  0,
+  3, -2, 10,  1, 13,  1, 14,  0,
+  6, -2, 10,  1, 13,  1, 11,  4,  3, -8,  4,  3,  5,  0,
+  3,  2, 10, -1, 13, -1, 11,  0,
+  6,  2, 10, -1, 13, -1, 11,  4,  3, -8,  4,  3,  5,  0,
+  4, -1, 13,  1, 11,  2,  3, -2,  5,  0,
+  4, -1, 13,  1, 11,  3,  2, -3,  3,  0,
+  3,  1, 10, -1, 12, -1, 11,  0,
+  3,  2, 12, -1, 13,  1, 11,  0,
+  3,  2, 10,  1, 13, -3, 11,  0,
+  5, -2, 10,  1, 13,  1, 11,  1,  2, -1,  3,  0,
+  4,  2, 10, -1, 12, -3, 13,  1, 11,  0,
+  3,  3, 10, -2, 13, -1, 11,  0,
+  5, -2, 10,  1, 13,  1, 11,  1,  3, -1,  5,  0,
+  4,  2, 10, -1, 12, -1, 13, -1, 11,  1,
+  2,  3, 10, -3, 11,  0,
+  5, -2, 10,  1, 13,  1, 11,  2,  2, -2,  3,  0,
+  4,  2, 10, -1, 12,  1, 13, -3, 11,  0,
+  3,  4, 10, -3, 13, -1, 11,  0,
+  4,  2, 10, -2, 12, -1, 13, -1, 11,  1,
+  3,  4, 10, -1, 13, -3, 11,  0,
+  4,  2, 10, -3, 12, -1, 13, -1, 11,  0,
+  3,  4, 10, -1, 12, -3, 11,  0,
+  3,  2, 10, -3, 12, -1, 11,  0,
+  4,  4, 10, -1, 12, -2, 13, -1, 11,  0,
+  2,  4, 10, -3, 11,  0,
+  3,  2, 10, -2, 12, -1, 11,  1,
+  4,  3, 10, -1, 12, -1, 13, -1, 11,  0,
+  4, -2, 10,  1, 11,  2,  3, -2,  5,  0,
+  3,  4, 10, -2, 13, -1, 11,  0,
+  4, -2, 10,  1, 11,  2,  2, -2,  3,  0,
+  3,  2, 10, -1, 12, -1, 11,  2,
+  3, -2, 10,  1, 12,  1, 14,  0,
+  4, -2, 10,  1, 11,  2,  3, -2,  4,  0,
+  4, -2, 10,  1, 11,  1,  3, -1,  5,  0,
+  3,  3, 10, -1, 13, -1, 11,  0,
+  4, -2, 10,  1, 11,  3,  2, -4,  3,  0,
+  4, -2, 10,  1, 11,  1,  3, -2,  5,  0,
+  4,  2, 10, -1, 12, -2, 13,  1, 11,  0,
+  4, -2, 10,  1, 11,  1,  2, -1,  3,  0,
+  2, -1, 10,  1,  2,  0,
+  3,  2, 10,  2, 13, -3, 11,  0,
+  4, -2, 10,  1, 11,  2,  2, -3,  3,  0,
+  3,  2, 12, -2, 13,  1, 11,  0,
+  4,  1, 10, -1, 12,  1, 13, -1, 11,  0,
+  3, -2, 10,  1, 11,  1,  5,  0,
+  4,  2, 10, -1, 11,  1,  3, -2,  4,  0,
+  3,  2, 10, -2, 11,  1, 14,  0,
+  4, -2, 10,  1, 11,  8,  2,-13,  3,  0,
+  5, -2, 10, -1, 13,  1, 11, 18,  2,-16,  3,  0,
+  5,  2, 10, -1, 11,  4,  3, -8,  4,  3,  5,  1,
+  2,  2, 10, -1, 11,  1,
+  5, -2, 10,  1, 11,  4,  3, -8,  4,  3,  5,  1,
+  5,  2, 10, -1, 13, -1, 11, 18,  2,-16,  3,  0,
+  4,  2, 10, -1, 11,  8,  2,-13,  3,  0,
+  2, -2, 10,  1, 14,  1,
+  4, -2, 10,  1, 11,  1,  3, -2,  4,  0,
+  3,  2, 10, -1, 11,  1,  5,  0,
+  2,  2, 12, -1, 11,  0,
+  4,  3, 10,  1, 12, -1, 13, -1, 11,  0,
+  4,  2, 10, -1, 11,  2,  2, -3,  3,  0,
+  3,  2, 10, -2, 13,  1, 11,  0,
+  4,  2, 10, -1, 11,  1,  2, -1,  3,  0,
+  3,  1, 10,  1,  2, -2,  3,  0,
+  3,  1, 12, -2, 13,  1, 11,  1,
+  3,  1, 10,  1, 13, -1, 11,  0,
+  4,  2, 10, -1, 11,  1,  3, -1,  5,  0,
+  3,  2, 10,  1, 12, -1, 11,  2,
+  3, -2, 10, -1, 12,  1, 14,  0,
+  2,  1, 12, -1, 11,  1,
+  3,  1, 10, -1, 13,  1, 11,  0,
+  4,  2, 10, -1, 11,  2,  2, -2,  3,  0,
+  3,  1, 10,  2,  2, -3,  3,  0,
+  4,  2, 10,  1, 12, -2, 13,  1, 11,  0,
+  3, -1, 10,  1,  2, -2,  3,  0,
+  3, -1, 11,  1,  2, -1,  3,  0,
+  2,  2, 13, -1, 11,  0,
+  2, -2, 13,  1, 14,  0,
+  4,  2, 10, -1, 11,  2,  3, -2,  5,  0,
+  4,  2, 10, -1, 11,  3,  2, -3,  3,  0,
+  4,  2, 10,  2, 12, -2, 13, -1, 11,  0,
+  3,  1, 10,  1,  3, -2,  5,  0,
+  4,  1, 10,  1, 12,  1, 13, -1, 11,  0,
+  3,  1, 10,  3,  2, -4,  3,  0,
+  3,  1, 10,  1,  3, -1,  5,  0,
+  3,  1, 10,  1,  3, -2,  6,  0,
+  3,  1, 10,  2,  3, -2,  4,  0,
+  4,  1, 10,  1, 12, -1, 13, -1, 11,  0,
+  3,  2, 10,  2, 12, -1, 11,  2,
+  4,  1, 10,  1,  3,  2,  5, -5,  6,  1,
+  1,  1, 14,  2,
+  3,  1, 10,  8,  2,-12,  3,  1,
+  5, -2, 10,  1, 13, -1, 11, 20,  2,-21,  3,  0,
+  5,  2, 10, -2, 13,  1, 11,  2,  3, -3,  5,  0,
+  3,  1, 10,  1,  3,  1,  6,  0,
+  4, -1, 13, -1, 11, 26,  2,-29,  3,  0,
+  3, -1, 11,  8,  2,-13,  3,  0,
+  4, -1, 13, -1, 11, 18,  2,-16,  3,  2,
+  4, -1, 13,  1, 11, 10,  2, -3,  3,  1,
+  1,  1, 11,  3,
+  4, -1, 13, -1, 11, 10,  2, -3,  3,  1,
+  4, -1, 13,  1, 11, 18,  2,-16,  3,  2,
+  3,  1, 11,  8,  2,-13,  3,  0,
+  2,  1, 10,  2,  4,  0,
+  4,  2, 10, -1, 11,  5,  2, -6,  3,  1,
+  5,  2, 10, -2, 13, -1, 11,  2,  3, -3,  5,  0,
+  5, -2, 10,  1, 13,  1, 11, 20,  2,-21,  3,  0,
+  3,  1, 10,  1,  3,  1,  5,  0,
+  2, -2, 11,  1, 14,  0,
+  5,  2, 10, -2, 13,  1, 11,  2,  3, -2,  5,  0,
+  3,  1, 10,  5,  2, -7,  3,  0,
+  4,  1, 10,  1, 12, -1, 13,  1, 11,  0,
+  3,  1, 10,  2,  2, -2,  3,  0,
+  4,  2, 10,  2, 12, -2, 13,  1, 11,  0,
+  2,  2, 13, -3, 11,  0,
+  4,  2, 10, -1, 11,  4,  2, -4,  3,  0,
+  3,  1, 10,  4,  2, -5,  3,  0,
+  3,  1, 10, -3, 13,  1, 11,  0,
+  2,  1, 10,  1,  2,  0,
+  3,  1, 11,  1,  2, -1,  3,  0,
+  4,  2, 10, -1, 11,  3,  3, -3,  5,  0,
+  3,  1, 12,  2, 13, -1, 11,  1,
+  4,  2, 10,  1, 12, -2, 13, -1, 11,  0,
+  3,  1, 10, -1, 13, -1, 11,  0,
+  3,  1, 11,  1,  3, -1,  5,  0,
+  2,  1, 12,  1, 11,  2,
+  4,  2, 10, -1, 11,  5,  2, -5,  3,  0,
+  3,  1, 10,  5,  2, -6,  3,  0,
+  3,  2, 10,  1, 12, -3, 11,  0,
+  3,  1, 10,  2,  2, -1,  3,  0,
+  3,  2, 10, -4, 13,  1, 11,  0,
+  3, -2, 10,  2, 13,  1, 14,  0,
+  3,  2, 10, -2, 13, -1, 11,  0,
+  3,  1, 10,  3,  2, -2,  3,  0,
+  4,  1, 10, -1, 12, -1, 13, -1, 11,  0,
+  2,  2, 12,  1, 11,  0,
+  2,  2, 10, -3, 11,  0,
+  3,  1, 10,  4,  2, -3,  3,  0,
+  4,  2, 10, -1, 12, -2, 13, -1, 11,  1,
+  3,  2, 10, -1, 12, -3, 11,  0,
+  3,  4, 10, -4, 13, -1, 11,  0,
+  4,  2, 10, -2, 12, -2, 13, -1, 11,  0,
+  4,  4, 10, -2, 12, -1, 13, -1, 11,  0,
+  3,  6, 10, -3, 13, -1, 11,  0,
+  4,  4, 10, -1, 12, -1, 13, -1, 11,  1,
+  4,  2, 10, -3, 12, -1, 13,  1, 11,  0,
+  3,  5, 10, -2, 13, -1, 11,  0,
+  3,  4, 10,  1, 13, -3, 11,  0,
+  4,  2, 10, -2, 12,  1, 13, -1, 11,  0,
+  3,  3, 10, -1, 12, -1, 11,  0,
+  3,  4, 10, -1, 13, -1, 11,  0,
+  4,  2, 10, -2, 12, -1, 13,  1, 11,  1,
+  3,  4, 10, -3, 13,  1, 11,  0,
+  4,  2, 10, -1, 12,  1, 13, -1, 11,  1,
+  5, -2, 10,  1, 13, -1, 11,  2,  2, -2,  3,  0,
+  2,  3, 10, -1, 11,  0,
+  4,  4, 10,  1, 12, -1, 13, -1, 11,  0,
+  4,  2, 10, -1, 12, -1, 13,  1, 11,  2,
+  5, -2, 10,  1, 13, -1, 11,  1,  3, -1,  5,  0,
+  3,  3, 10, -2, 13,  1, 11,  0,
+  5, -2, 10,  1, 13, -1, 11,  1,  2, -1,  3,  0,
+  3,  2, 10,  1, 13, -1, 11,  0,
+  3, -2, 10, -1, 13,  1, 14,  0,
+  3,  2, 12, -1, 13, -1, 11,  1,
+  3,  3, 10,  1, 12, -1, 11,  0,
+  3,  1, 10, -1, 12,  1, 11,  0,
+  4, -1, 13, -1, 11,  3,  2, -3,  3,  0,
+  4, -1, 13, -1, 11,  2,  3, -2,  5,  0,
+  3,  2, 10, -1, 13,  1, 14,  0,
+  4, -2, 10, -1, 11, 18,  2,-16,  3,  0,
+  6,  2, 10, -1, 13,  1, 11,  4,  3, -8,  4,  3,  5,  0,
+  3,  2, 10, -1, 13,  1, 11,  0,
+  6, -2, 10,  1, 13, -1, 11,  4,  3, -8,  4,  3,  5,  0,
+  5,  2, 10, -2, 13,  1, 11, 18,  2,-16,  3,  0,
+  4, -2, 10,  1, 13, -2, 11,  1, 14,  0,
+  3,  1, 12, -3, 13,  1, 11,  0,
+  3,  1, 10,  2, 13, -1, 11,  0,
+  4,  2, 10,  1, 12,  1, 13, -1, 11,  1,
+  3,  1, 12, -1, 13, -1, 11,  1,
+  4, -1, 13, -1, 11,  1,  3, -1,  5,  0,
+  2,  1, 10,  1, 11,  0,
+  4,  2, 10,  1, 12, -1, 13,  1, 11,  1,
+  3,  1, 12,  1, 13, -3, 11,  0,
+  4, -1, 13, -1, 11,  1,  2, -1,  3,  0,
+  5,  2, 10, -1, 13,  1, 11,  2,  2, -2,  3,  0,
+  2,  3, 13, -1, 11,  0,
+  4,  1, 10,  1, 12, -2, 13, -1, 11,  0,
+  4,  2, 10,  2, 12,  1, 13, -1, 11,  0,
+  2,  1, 13,  1, 14,  1,
+  5,  2, 10, -1, 13,  1, 11,  2,  3, -3,  5,  0,
+  4, -2, 13, -1, 11, 18,  2,-16,  3,  1,
+  5,  1, 13,  1, 11,  4,  3, -8,  4,  3,  5,  0,
+  2,  1, 13,  1, 11,  0,
+  5, -1, 13, -1, 11,  4,  3, -8,  4,  3,  5,  0,
+  3,  1, 11, 18,  2,-16,  3,  1,
+  3, -1, 13, -2, 11,  1, 14,  0,
+  5,  2, 10, -1, 13,  1, 11,  2,  3, -2,  5,  0,
+  5,  2, 10, -1, 13,  1, 11,  3,  2, -3,  3,  0,
+  3,  1, 10,  1, 12,  1, 11,  1,
+  4,  2, 10,  2, 12, -1, 13,  1, 11,  1,
+  2,  1, 13, -3, 11,  0,
+  4,  1, 13,  1, 11,  1,  2, -1,  3,  0,
+  3,  1, 12,  3, 13, -1, 11,  0,
+  4,  2, 10,  1, 12, -3, 13, -1, 11,  0,
+  3,  1, 10, -2, 13, -1, 11,  0,
+  4,  1, 13,  1, 11,  1,  3, -1,  5,  0,
+  3,  1, 12,  1, 13,  1, 11,  1,
+  2,  1, 10, -3, 11,  0,
+  3,  1, 12, -1, 13,  3, 11,  0,
+  3,  2, 10, -3, 13, -1, 11,  0,
+  3,  2, 12,  1, 13,  1, 11,  0,
+  3,  2, 10, -1, 13, -3, 11,  0,
+  4,  2, 10, -1, 12, -3, 13, -1, 11,  0,
+  4,  2, 10, -1, 12, -1, 13, -3, 11,  0,
+  4,  6, 10, -1, 12, -2, 13, -1, 11,  0,
+  3,  4, 10, -2, 12, -1, 11,  0,
+  3,  6, 10, -2, 13, -1, 11,  0,
+  4,  4, 10, -2, 12, -2, 13,  1, 11,  0,
+  3,  4, 10, -1, 12, -1, 11,  1,
+  3,  2, 10, -3, 12,  1, 11,  0,
+  3,  5, 10, -1, 13, -1, 11,  0,
+  4,  4, 10, -1, 12, -2, 13,  1, 11,  0,
+  4,  2, 10, -2, 12,  2, 13, -1, 11,  0,
+  2,  4, 10, -1, 11,  0,
+  3,  2, 10, -2, 12,  1, 11,  1,
+  4,  3, 10, -1, 12, -1, 13,  1, 11,  0,
+  3,  4, 10, -2, 13,  1, 11,  0,
+  4,  2, 10, -1, 12,  2, 13, -1, 11,  0,
+  4, -2, 10, -1, 11,  2,  2, -2,  3,  0,
+  3,  3, 10,  1, 13, -1, 11,  0,
+  3,  4, 10,  1, 12, -1, 11,  0,
+  3,  2, 10, -1, 12,  1, 11,  2,
+  4, -2, 10, -1, 11,  1,  3, -1,  5,  0,
+  3,  3, 10, -1, 13,  1, 11,  0,
+  4,  4, 10,  1, 12, -2, 13,  1, 11,  0,
+  3,  2, 10,  2, 13, -1, 11,  0,
+  3,  2, 12, -2, 13, -1, 11,  0,
+  4,  1, 10, -1, 12,  1, 13,  1, 11,  0,
+  2,  2, 10,  1, 14,  0,
+  5, -2, 10, -1, 13, -1, 11, 18,  2,-16,  3,  0,
+  2,  2, 10,  1, 11,  1,
+  5,  2, 10, -1, 13,  1, 11, 18,  2,-16,  3,  0,
+  3, -2, 10, -2, 11,  1, 14,  0,
+  4,  3, 10,  1, 12, -1, 13,  1, 11,  0,
+  3,  2, 10, -2, 13,  3, 11,  0,
+  4,  2, 10,  1, 12,  2, 13, -1, 11,  0,
+  3,  1, 12, -2, 13, -1, 11,  1,
+  3,  1, 10,  1, 13,  1, 11,  0,
+  3,  2, 10,  1, 12,  1, 11,  1,
+  2,  4, 13, -1, 11,  0,
+  2,  2, 13,  1, 14,  0,
+  4, -3, 13, -1, 11, 18,  2,-16,  3,  0,
+  2,  2, 13,  1, 11,  0,
+  4,  1, 13,  1, 11, 18,  2,-16,  3,  0,
+  4,  2, 10,  1, 11,  2,  3, -2,  5,  0,
+  4,  1, 10,  1, 12,  1, 13,  1, 11,  0,
+  3,  2, 10,  2, 12,  1, 11,  0,
+  2,  2, 11,  1, 14,  0,
+  1,  3, 11,  0,
+  3,  1, 10, -3, 13, -1, 11,  0,
+  3,  1, 12,  2, 13,  1, 11,  1,
+  2,  1, 12,  3, 11,  0,
+  3,  2, 10, -4, 13, -1, 11,  0,
+  3,  2, 12,  2, 13,  1, 11,  0,
+  3,  2, 10, -2, 13, -3, 11,  0,
+  4,  6, 10, -1, 12, -1, 13, -1, 11,  0,
+  3,  6, 10, -1, 13, -1, 11,  0,
+  4,  4, 10, -2, 12, -1, 13,  1, 11,  0,
+  3,  6, 10, -3, 13,  1, 11,  0,
+  4,  4, 10, -1, 12,  1, 13, -1, 11,  0,
+  4,  4, 10, -1, 12, -1, 13,  1, 11,  1,
+  3,  5, 10, -2, 13,  1, 11,  0,
+  3,  4, 10,  1, 13, -1, 11,  0,
+  4,  2, 10, -2, 12,  1, 13,  1, 11,  0,
+  3,  4, 10, -1, 13,  1, 11,  0,
+  4,  2, 10, -1, 12,  3, 13, -1, 11,  0,
+  4,  4, 10,  1, 12,  1, 13, -1, 11,  0,
+  4,  2, 10, -1, 12,  1, 13,  1, 11,  1,
+  2,  3, 10,  1, 11,  0,
+  4,  4, 10,  1, 12, -1, 13,  1, 11,  0,
+  4,  2, 10, -1, 12, -1, 13,  3, 11,  0,
+  3,  2, 10,  3, 13, -1, 11,  0,
+  3,  2, 10,  1, 13,  1, 14,  0,
+  3,  2, 10,  1, 13,  1, 11,  0,
+  3,  3, 10,  1, 12,  1, 11,  0,
+  3,  2, 10, -1, 13,  3, 11,  0,
+  4,  2, 10,  1, 12,  3, 13, -1, 11,  0,
+  3,  1, 12, -3, 13, -1, 11,  0,
+  3,  1, 10,  2, 13,  1, 11,  0,
+  4,  2, 10,  1, 12,  1, 13,  1, 11,  1,
+  3,  1, 12, -1, 13, -3, 11,  0,
+  2,  1, 10,  3, 11,  0,
+  2,  5, 13, -1, 11,  0,
+  2,  3, 13,  1, 11,  0,
+  4,  1, 10,  1, 12,  2, 13,  1, 11,  0,
+  2,  1, 13,  3, 11,  0,
+  3,  1, 12,  3, 13,  1, 11,  0,
+  3,  1, 12,  1, 13,  3, 11,  0,
+  3,  2, 10, -5, 13, -1, 11,  0,
+  3,  6, 10, -1, 12, -1, 11,  0,
+  4,  6, 10, -1, 12, -2, 13,  1, 11,  0,
+  2,  6, 10, -1, 11,  0,
+  3,  4, 10, -2, 12,  1, 11,  0,
+  3,  6, 10, -2, 13,  1, 11,  0,
+  4,  4, 10, -1, 12,  2, 13, -1, 11,  0,
+  3,  4, 10, -1, 12,  1, 11,  0,
+  3,  4, 10,  2, 13, -1, 11,  0,
+  4,  2, 10, -2, 12,  2, 13,  1, 11,  0,
+  2,  4, 10,  1, 11,  0,
+  3,  4, 10, -2, 13,  3, 11,  0,
+  4,  2, 10, -1, 12,  2, 13,  1, 11,  0,
+  3,  3, 10,  1, 13,  1, 11,  0,
+  3,  4, 10,  1, 12,  1, 11,  0,
+  3,  2, 10, -1, 12,  3, 11,  0,
+  3,  2, 10,  4, 13, -1, 11,  0,
+  3,  2, 10,  2, 13,  1, 11,  0,
+  2,  2, 10,  3, 11,  0,
+  3,  1, 12, -4, 13, -1, 11,  0,
+  3,  1, 10,  3, 13,  1, 11,  0,
+  4,  2, 10,  1, 12,  2, 13,  1, 11,  0,
+  2,  4, 13,  1, 11,  0,
+  2,  2, 13,  3, 11,  0,
+  1,  5, 11,  0,
+  3,  1, 12,  4, 13,  1, 11,  0,
+  4,  6, 10, -1, 12, -1, 13,  1, 11,  0,
+  3,  6, 10,  1, 13, -1, 11,  0,
+  3,  6, 10, -1, 13,  1, 11,  0,
+  4,  4, 10, -1, 12,  1, 13,  1, 11,  0,
+  3,  4, 10,  1, 13,  1, 11,  0,
+  3,  4, 10, -1, 13,  3, 11,  0,
+  4,  2, 10, -1, 12,  3, 13,  1, 11,  0,
+  4,  4, 10,  1, 12,  1, 13,  1, 11,  0,
+  3,  2, 10,  3, 13,  1, 11,  0,
+  3,  2, 10,  1, 13,  3, 11,  0,
+  2,  5, 13,  1, 11,  0,
+  2,  3, 13,  3, 11,  0,
+  2,  6, 10,  1, 11,  0,
+  3,  4, 10,  2, 13,  1, 11,  0,
+  3,  2, 10,  4, 13,  1, 11,  0,
+ -1
+};
+struct plantbl moonlr = {
+  {  3, 26, 29, 23,  5, 10,  0,  0,  0,  8,  4,  4,  6,  2,  0,  0,  0,  0,},
+ 3,
+ lrargs,
+ lrtabl,
+ lrtabb,
+ lrtabr,
+ 2.5735686895300000e-03,
+ 3.6525000000000000e+06,
+ 1.0000000000000000e-04,
+};
+
+struct plantbl moonlat = {
+  {  0, 26, 29,  8,  3,  5,  0,  0,  0,  6,  5,  3,  5,  1,  0,  0,  0,  0,},
+ 3,
+ bargs,
+ btabl,
+ btabb,
+ btabr,
+ 0.0000000000000000e+00,
+ 3.6525000000000000e+06,
+ 1.0000000000000000e-04,
+};
+
+
+/* Reduce arc seconds modulo 360 degrees
+   answer in arc seconds  */
+static double
+mods3600(x)
+     double x;
+{
+  double y;
+#if !defined(__STDC__)
+  double floor();
+#endif
+
+  y = x - 1296000. * floor( x/1296000.);
+  return(y);
+}
+
+
+/* Time argument is Julian ephemeris date.  */
+
+static void
+mean_elements (JED)
+     double JED;
+{
+  double x, T, T2;
+
+  /* Time variables.  T is in Julian centuries.  */
+  T = (JED - MOSHIER_J2000) / 36525.0;
+  T2 = T*T;
+
+  /* Mean longitudes of planets (Simon et al, 1994)
+     .047" subtracted from constant term for offset to DE403 origin. */
+
+  /* Mercury */
+  x = mods3600( 538101628.6889819 * T + 908103.213 );
+  x += (6.39e-6 * T
+	 - 0.0192789) * T2;
+  Args[0] = x;
+
+  /* Venus */
+  x = mods3600( 210664136.4335482 * T + 655127.236 );
+  x += (-6.27e-6  * T
+	 + 0.0059381) * T2;
+  Args[1] = x;
+
+  /* Earth  */
+  x = mods3600( 129597742.283429 * T + 361679.198 );
+  x += (-5.23e-6 * T
+	 - 2.04411e-2 ) * T2;
+  Ea_arcsec = x;
+  Args[2] = x;
+
+  /* Mars */
+  x = mods3600(  68905077.493988 * T +  1279558.751 );
+  x += (-1.043e-5 * T
+	 + 0.0094264) * T2;
+  Args[3] = x;
+
+  /* Jupiter */
+  x = mods3600( 10925660.377991 * T + 123665.420 );
+  x += ((((-3.4e-10 * T
+	    + 5.91e-8) * T
+	   + 4.667e-6) * T
+	  + 5.706e-5) * T
+         - 3.060378e-1)*T2;
+  Args[4] = x;
+
+   /* Saturn */
+  x = mods3600( 4399609.855372 * T + 180278.752 );
+  x += (((( 8.3e-10 * T
+	  - 1.452e-7) * T
+	  - 1.1484e-5) * T
+	   - 1.6618e-4) * T
+	 + 7.561614E-1)*T2;
+  Args[5] = x;
+
+  /* Uranus */
+  x = mods3600( 1542481.193933 * T + 1130597.971 )
+       + (0.00002156*T - 0.0175083)*T2;
+  Args[6] = x;
+
+  /* Neptune */
+  x = mods3600( 786550.320744 * T + 1095655.149 )
+       + (-0.00000895*T + 0.0021103)*T2;
+  Args[7] = x;
+
+  /* Copied from cmoon.c, DE404 version.  */
+  /* Mean elongation of moon = D */
+  x = mods3600( 1.6029616009939659e+09 * T + 1.0722612202445078e+06 );
+  x += (((((-3.207663637426e-013 * T
+	       + 2.555243317839e-011) * T
+	      + 2.560078201452e-009) * T
+	     - 3.702060118571e-005) * T
+            + 6.9492746836058421e-03) * T /* D, t^3 */
+           - 6.7352202374457519e+00) * T2; /* D, t^2 */
+  Args[9] = x;
+
+  /* Mean distance of moon from its ascending node = F */
+  x = mods3600( 1.7395272628437717e+09 * T + 3.3577951412884740e+05 );
+  x += ((((( 4.474984866301e-013 * T
+	       + 4.189032191814e-011) * T
+	       - 2.790392351314e-009) * T
+	      - 2.165750777942e-006) * T
+	      - 7.5311878482337989e-04) * T /* F, t^3 */
+	     - 1.3117809789650071e+01) * T2; /* F, t^2 */
+  NF_arcsec = x;
+  Args[10] = x;
+
+/* Mean anomaly of sun = l' (J. Laskar) */
+  x = mods3600(1.2959658102304320e+08 * T + 1.2871027407441526e+06);
+  x += ((((((((
+	       1.62e-20 * T
+	       - 1.0390e-17 ) * T
+	      - 3.83508e-15 ) * T
+	     + 4.237343e-13 ) * T
+	    + 8.8555011e-11 ) * T
+	   - 4.77258489e-8 ) * T
+	  - 1.1297037031e-5 ) * T
+	 + 8.7473717367324703e-05) * T
+	- 5.5281306421783094e-01) * T2;
+  Args[11] = x;
+
+  /* Mean anomaly of moon = l */
+  x = mods3600( 1.7179159228846793e+09 * T + 4.8586817465825332e+05 );
+  x += (((((-1.755312760154e-012) * T
+		+ 3.452144225877e-011 * T
+		- 2.506365935364e-008) * T
+	       - 2.536291235258e-004) * T
+              + 5.2099641302735818e-02) * T /* l, t^3 */
+             + 3.1501359071894147e+01) * T2; /* l, t^2 */
+  Args[12] = x;
+
+  /* Mean longitude of moon, re mean ecliptic and equinox of date = L  */
+  x = mods3600( 1.7325643720442266e+09 * T + 7.8593980921052420e+05);
+  x += ((((( 7.200592540556e-014 * T
+	     + 2.235210987108e-010) * T
+	    - 1.024222633731e-008) * T
+	   - 6.073960534117e-005) * T
+	 + 6.9017248528380490e-03) * T /* L, t^3 */
+	- 5.6550460027471399e+00) * T2; /* L, t^2 */
+  LP_equinox = x;
+  Args[13] = x;
+
+  /* Precession of the equinox  */
+ x = ((((((((( -8.66e-20*T - 4.759e-17)*T
+           + 2.424e-15)*T
+           + 1.3095e-12)*T
+           + 1.7451e-10)*T
+           - 1.8055e-8)*T
+           - 0.0000235316)*T
+           + 0.000076)*T
+           + 1.105414)*T
+           + 5028.791959)*T;
+  /* Moon's longitude re fixed J2000 equinox.  */
+ /*
+   Args[13] -= x;
+ */
+   pA_precession = x;
+
+  /*  OM = LP - NF; */
+
+  /* Free librations.  */
+  /*  LB 2.891725 years, psi amplitude 1.8" */
+  Args[14] = mods3600( 4.48175409e7 * T + 8.060457e5 );
+
+  /* 24.2 years */
+  Args[15] = mods3600(  5.36486787e6 * T - 391702.8 );
+
+#if 0
+  /* 27.34907 days */
+  Args[16] = mods3600( 1.7308227257e9 * T - 4.443583e5 );
+#endif
+  /* LA 74.7 years. */
+Args[17] = mods3600( 1.73573e6 * T );
+}
+
+
+/* Prepare lookup table of sin and cos ( i*Lj )
+ * for required multiple angles
+ */
+static int 
+sscc (k, arg, n)
+     int k;
+     double arg;
+     int n;
+{
+  double cu, su, cv, sv, s;
+  int i;
+
+  s = STR * arg;
+  su = sin (s);
+  cu = cos (s);
+  ss[k][0] = su;		/* sin(L) */
+  cc[k][0] = cu;		/* cos(L) */
+  sv = 2.0 * su * cu;
+  cv = cu * cu - su * su;
+  ss[k][1] = sv;		/* sin(2L) */
+  cc[k][1] = cv;
+  for (i = 2; i < n; i++)
+    {
+      s = su * cv + cu * sv;
+      cv = cu * cv - su * sv;
+      sv = s;
+      ss[k][i] = sv;		/* sin( i+1 L ) */
+      cc[k][i] = cv;
+    }
+  return (0);
+}
+
+/* Generic program to accumulate sum of trigonometric series
+   in two variables (e.g., longitude, radius)
+   of the same list of arguments.  */
+static int 
+g2plan (J, plan, pobj, flag)
+     double J;
+     struct plantbl *plan;
+     double pobj[];
+     int flag;
+{
+  int i, j, k, m, k1, ip, np, nt;
+  /* On some systems such as Silicon Graphics, char is unsigned
+     by default.  */
+  CHAR *p;
+  long *pl, *pr;
+  double su, cu, sv, cv;
+  double t, sl, sr;
+
+  mean_elements (J);
+  /* For librations, moon's longitude is sidereal.  */
+  if (flag)
+    Args[13] -= pA_precession;
+
+  T = (J - MOSHIER_J2000) / plan->timescale;
+  /* Calculate sin( i*MM ), etc. for needed multiple angles.  */
+  for (i = 0; i < NARGS; i++)
+    {
+      if ((j = plan->max_harmonic[i]) > 0)
+	{
+	  sscc (i, Args[i], j);
+	}
+    }
+
+  /* Point to start of table of arguments. */
+  p = plan->arg_tbl;
+  /* Point to tabulated cosine and sine amplitudes.  */
+  pl = plan->lon_tbl;
+  pr = plan->rad_tbl;
+  sl = 0.0;
+  sr = 0.0;
+
+  for (;;)
+    {
+      /* argument of sine and cosine */
+      /* Number of periodic arguments. */
+      np = *p++;
+      if (np < 0)
+	break;
+      if (np == 0)
+	{			/* It is a polynomial term.  */
+	  nt = *p++;
+	  /* Longitude polynomial. */
+	  cu = *pl++;
+	  for (ip = 0; ip < nt; ip++)
+	    {
+	      cu = cu * T + *pl++;
+	    }
+	  /*	  sl +=  mods3600 (cu); */
+	  sl += cu;
+	  /* Radius polynomial. */
+	  cu = *pr++;
+	  for (ip = 0; ip < nt; ip++)
+	    {
+	      cu = cu * T + *pr++;
+	    }
+	  sr += cu;
+	  continue;
+	}
+      k1 = 0;
+      cv = 0.0;
+      sv = 0.0;
+      for (ip = 0; ip < np; ip++)
+	{
+	  /* What harmonic.  */
+	  j = *p++;
+	  /* Which planet.  */
+	  m = *p++ - 1;
+	  if (j)
+	    {
+	      k = abs (j);
+	      k -= 1;
+	      su = ss[m][k];	/* sin(k*angle) */
+	      if (j < 0)
+		su = -su;
+	      cu = cc[m][k];
+	      if (k1 == 0)
+		{		/* set first angle */
+		  sv = su;
+		  cv = cu;
+		  k1 = 1;
+		}
+	      else
+		{		/* combine angles */
+		  t = su * cv + cu * sv;
+		  cv = cu * cv - su * sv;
+		  sv = t;
+		}
+	    }
+	}
+      /* Highest power of T.  */
+      nt = *p++;
+      /* Longitude. */
+      cu = *pl++;
+      su = *pl++;
+      for (ip = 0; ip < nt; ip++)
+	{
+	  cu = cu * T + *pl++;
+	  su = su * T + *pl++;
+	}
+      sl += cu * cv + su * sv;
+      /* Radius. */
+      cu = *pr++;
+      su = *pr++;
+      for (ip = 0; ip < nt; ip++)
+	{
+	  cu = cu * T + *pr++;
+	  su = su * T + *pr++;
+	}
+      sr += cu * cv + su * sv;
+    }
+  t = plan->trunclvl;
+  pobj[0] = t * sl;
+  pobj[2] = t * sr;
+  return (0);
+}
+
+
+
+/* Generic program to accumulate sum of trigonometric series
+   in one variable.  */
+
+static double
+g1plan (J, plan)
+     double J;
+     struct plantbl *plan;
+{
+  int i, j, k, m, k1, ip, np, nt;
+  /* On some systems such as Silicon Graphics, char is unsigned
+     by default.  */
+  CHAR *p;
+  long *pl;
+  double su, cu, sv, cv;
+  double t, sl;
+
+  T = (J - MOSHIER_J2000) / plan->timescale;
+  mean_elements (J);
+  /* Calculate sin( i*MM ), etc. for needed multiple angles.  */
+  for (i = 0; i < NARGS; i++)
+    {
+      if ((j = plan->max_harmonic[i]) > 0)
+	{
+	  sscc (i, Args[i], j);
+	}
+    }
+
+  /* Point to start of table of arguments. */
+  p = plan->arg_tbl;
+  /* Point to tabulated cosine and sine amplitudes.  */
+  pl = plan->lon_tbl;
+  sl = 0.0;
+
+  for (;;)
+    {
+      /* argument of sine and cosine */
+      /* Number of periodic arguments. */
+      np = *p++;
+      if (np < 0)
+	break;
+      if (np == 0)
+	{			/* It is a polynomial term.  */
+	  nt = *p++;
+	  cu = *pl++;
+	  for (ip = 0; ip < nt; ip++)
+	    {
+	      cu = cu * T + *pl++;
+	    }
+	  /*	  sl +=  mods3600 (cu); */
+	  sl += cu;
+	  continue;
+	}
+      k1 = 0;
+      cv = 0.0;
+      sv = 0.0;
+      for (ip = 0; ip < np; ip++)
+	{
+	  /* What harmonic.  */
+	  j = *p++;
+	  /* Which planet.  */
+	  m = *p++ - 1;
+	  if (j)
+	    {
+	      k = abs (j);
+	      k -= 1;
+	      su = ss[m][k];	/* sin(k*angle) */
+	      if (j < 0)
+		su = -su;
+	      cu = cc[m][k];
+	      if (k1 == 0)
+		{		/* set first angle */
+		  sv = su;
+		  cv = cu;
+		  k1 = 1;
+		}
+	      else
+		{		/* combine angles */
+		  t = su * cv + cu * sv;
+		  cv = cu * cv - su * sv;
+		  sv = t;
+		}
+	    }
+	}
+      /* Highest power of T.  */
+      nt = *p++;
+      /* Cosine and sine coefficients.  */
+      cu = *pl++;
+      su = *pl++;
+      for (ip = 0; ip < nt; ip++)
+	{
+	  cu = cu * T + *pl++;
+	  su = su * T + *pl++;
+	}
+      sl += cu * cv + su * sv;
+    }
+  return (plan->trunclvl * sl);
+}
+
+
+/* geocentric moon, mean ecliptic and equinox of date
+ * J is Julian Epemeris Date
+ * output in pobj[]:
+ * pobj[0]:  l in rad
+ * pobj[1]:  b in rad
+ * pobj[2]:  r in au
+ */
+static int 
+gecmoon (J, lrtab, lattab, pobj)
+     double J;
+     struct plantbl *lrtab, *lattab;
+     double pobj[];
+{
+  double x;
+
+  g2plan (J, lrtab, pobj, 0);
+  x = pobj[0];
+  x += LP_equinox;
+  if (x < -6.45e5)
+    x += 1.296e6;
+  if (x > 6.45e5)
+    x -= 1.296e6;
+  pobj[0] = STR * x;
+  x = g1plan (J, lattab);
+  pobj[1] = STR * x;
+  pobj[2] = (STR * pobj[2] + 1.0) * lrtab->distance;
+  return 0;
+}
+
+/*********** end stephen moshier's moon code ****************/
+
+static void moon_fast P_((double mjd, double *lam, double *bet,
+	double *hp, double *msp, double *mdp));
+
+/* previous version (elwood):
+ *
+ * given the mjd, find the geocentric ecliptic longitude, lam, and latitude,
+ *   bet, and horizontal parallax, hp for the moon. also return the sun's
+ *   mean anomaly, *msp, and the moon's mean anomaly, *mdp.
+ * N.B. series for long and lat are good to about 10 and 3 arcseconds. however,
+ *   math errors cause up to 100 and 30 arcseconds error, even if use double.
+ *   why?? suspect highly sensitive nature of difference used to get m1..6.
+ * N.B. still need to correct for nutation. then for topocentric location
+ *   further correct for parallax and refraction.
+ */
+static void
+moon_fast (mjd, lam, bet, hp, msp, mdp)
+double mjd;
+double *lam, *bet, *hp;
+double *msp, *mdp;
+{
+	double t, t2;
+	double ld;
+	double ms;
+	double md;
+	double de;
+	double f;
+	double n;
+	double a, sa, sn, b, sb, c, sc, e, e2, l, g, w1, w2;
+	double m1, m2, m3, m4, m5, m6;
+
+	t = mjd/36525.;
+	t2 = t*t;
+
+	m1 = mjd/27.32158213;
+	m1 = 360.0*(m1-(long)m1);
+	m2 = mjd/365.2596407;
+	m2 = 360.0*(m2-(long)m2);
+	m3 = mjd/27.55455094;
+	m3 = 360.0*(m3-(long)m3);
+	m4 = mjd/29.53058868;
+	m4 = 360.0*(m4-(long)m4);
+	m5 = mjd/27.21222039;
+	m5 = 360.0*(m5-(long)m5);
+	m6 = mjd/6798.363307;
+	m6 = 360.0*(m6-(long)m6);
+
+	ld = 270.434164+m1-(.001133-.0000019*t)*t2;
+	ms = 358.475833+m2-(.00015+.0000033*t)*t2;
+	md = 296.104608+m3+(.009192+.0000144*t)*t2;
+	de = 350.737486+m4-(.001436-.0000019*t)*t2;
+	f = 11.250889+m5-(.003211+.0000003*t)*t2;
+	n = 259.183275-m6+(.002078+.000022*t)*t2;
+
+	a = degrad(51.2+20.2*t);
+	sa = sin(a);
+	sn = sin(degrad(n));
+	b = 346.56+(132.87-.0091731*t)*t;
+	sb = .003964*sin(degrad(b));
+	c = degrad(n+275.05-2.3*t);
+	sc = sin(c);
+	ld = ld+.000233*sa+sb+.001964*sn;
+	ms = ms-.001778*sa;
+	md = md+.000817*sa+sb+.002541*sn;
+	f = f+sb-.024691*sn-.004328*sc;
+	de = de+.002011*sa+sb+.001964*sn;
+	e = 1-(.002495+7.52e-06*t)*t;
+	e2 = e*e;
+
+	ld = degrad(ld);
+	ms = degrad(ms);
+	n = degrad(n);
+	de = degrad(de);
+	f = degrad(f);
+	md = degrad(md);
+
+	l = 6.28875*sin(md)+1.27402*sin(2*de-md)+.658309*sin(2*de)+
+	    .213616*sin(2*md)-e*.185596*sin(ms)-.114336*sin(2*f)+
+	    .058793*sin(2*(de-md))+.057212*e*sin(2*de-ms-md)+
+	    .05332*sin(2*de+md)+.045874*e*sin(2*de-ms)+.041024*e*sin(md-ms);
+	l = l-.034718*sin(de)-e*.030465*sin(ms+md)+.015326*sin(2*(de-f))-
+	    .012528*sin(2*f+md)-.01098*sin(2*f-md)+.010674*sin(4*de-md)+
+	    .010034*sin(3*md)+.008548*sin(4*de-2*md)-e*.00791*sin(ms-md+2*de)-
+	    e*.006783*sin(2*de+ms);
+	l = l+.005162*sin(md-de)+e*.005*sin(ms+de)+.003862*sin(4*de)+
+	    e*.004049*sin(md-ms+2*de)+.003996*sin(2*(md+de))+
+	    .003665*sin(2*de-3*md)+e*.002695*sin(2*md-ms)+
+	    .002602*sin(md-2*(f+de))+e*.002396*sin(2*(de-md)-ms)-
+	    .002349*sin(md+de);
+	l = l+e2*.002249*sin(2*(de-ms))-e*.002125*sin(2*md+ms)-
+	    e2*.002079*sin(2*ms)+e2*.002059*sin(2*(de-ms)-md)-
+	    .001773*sin(md+2*(de-f))-.001595*sin(2*(f+de))+
+	    e*.00122*sin(4*de-ms-md)-.00111*sin(2*(md+f))+.000892*sin(md-3*de);
+	l = l-e*.000811*sin(ms+md+2*de)+e*.000761*sin(4*de-ms-2*md)+
+	     e2*.000704*sin(md-2*(ms+de))+e*.000693*sin(ms-2*(md-de))+
+	     e*.000598*sin(2*(de-f)-ms)+.00055*sin(md+4*de)+.000538*sin(4*md)+
+	     e*.000521*sin(4*de-ms)+.000486*sin(2*md-de);
+	l = l+e2*.000717*sin(md-2*ms);
+	*lam = ld+degrad(l);
+	range (lam, 2*PI);
+
+	g = 5.12819*sin(f)+.280606*sin(md+f)+.277693*sin(md-f)+
+	    .173238*sin(2*de-f)+.055413*sin(2*de+f-md)+.046272*sin(2*de-f-md)+
+	    .032573*sin(2*de+f)+.017198*sin(2*md+f)+.009267*sin(2*de+md-f)+
+	    .008823*sin(2*md-f)+e*.008247*sin(2*de-ms-f);
+	g = g+.004323*sin(2*(de-md)-f)+.0042*sin(2*de+f+md)+
+	    e*.003372*sin(f-ms-2*de)+e*.002472*sin(2*de+f-ms-md)+
+	    e*.002222*sin(2*de+f-ms)+e*.002072*sin(2*de-f-ms-md)+
+	    e*.001877*sin(f-ms+md)+.001828*sin(4*de-f-md)-e*.001803*sin(f+ms)-
+	    .00175*sin(3*f);
+	g = g+e*.00157*sin(md-ms-f)-.001487*sin(f+de)-e*.001481*sin(f+ms+md)+
+	     e*.001417*sin(f-ms-md)+e*.00135*sin(f-ms)+.00133*sin(f-de)+
+	     .001106*sin(f+3*md)+.00102*sin(4*de-f)+.000833*sin(f+4*de-md)+
+	     .000781*sin(md-3*f)+.00067*sin(f+4*de-2*md);
+	g = g+.000606*sin(2*de-3*f)+.000597*sin(2*(de+md)-f)+
+	    e*.000492*sin(2*de+md-ms-f)+.00045*sin(2*(md-de)-f)+
+	    .000439*sin(3*md-f)+.000423*sin(f+2*(de+md))+
+	    .000422*sin(2*de-f-3*md)-e*.000367*sin(ms+f+2*de-md)-
+	    e*.000353*sin(ms+f+2*de)+.000331*sin(f+4*de);
+	g = g+e*.000317*sin(2*de+f-ms+md)+e2*.000306*sin(2*(de-ms)-f)-
+	    .000283*sin(md+3*f);
+	w1 = .0004664*cos(n);
+	w2 = .0000754*cos(c);
+	*bet = degrad(g)*(1-w1-w2);
+
+	*hp = .950724+.051818*cos(md)+.009531*cos(2*de-md)+.007843*cos(2*de)+
+	      .002824*cos(2*md)+.000857*cos(2*de+md)+e*.000533*cos(2*de-ms)+
+	      e*.000401*cos(2*de-md-ms)+e*.00032*cos(md-ms)-.000271*cos(de)-
+	      e*.000264*cos(ms+md)-.000198*cos(2*f-md);
+	*hp = *hp+.000173*cos(3*md)+.000167*cos(4*de-md)-e*.000111*cos(ms)+
+	     .000103*cos(4*de-2*md)-.000084*cos(2*md-2*de)-
+	     e*.000083*cos(2*de+ms)+.000079*cos(2*de+2*md)+.000072*cos(4*de)+
+	     e*.000064*cos(2*de-ms+md)-e*.000063*cos(2*de+ms-md)+
+	     e*.000041*cos(ms+de);
+	*hp = *hp+e*.000035*cos(2*md-ms)-.000033*cos(3*md-2*de)-
+	     .00003*cos(md+de)-.000029*cos(2*(f-de))-e*.000029*cos(2*md+ms)+
+	     e2*.000026*cos(2*(de-ms))-.000023*cos(2*(f-de)+md)+
+	     e*.000019*cos(4*de-ms-md);
+	*hp = degrad(*hp);
+
+	*msp = ms;
+	*mdp = md;
+}
+
+
+#define EarthRadius 6378.16             /* Kilometers           */
+
+/* moon() - front end rountine to get moon position; stern
+ *
+ * given the mjd, find the geocentric ecliptic longitude, lam, and latitude,
+ *   bet, and geocentric distance, rho in a.u. for the moon.  also return
+ *   the sun's mean anomaly, *msp, and the moon's mean anomaly, *mdp.
+ *
+ * now uses Stephen Moshier's expansion and code.
+ *
+ * TODO: - clarify lunar aberration for apparent places
+ * 
+ * still need to correct for nutation. then for topocentric location
+ *   further correct for parallax and refraction.
+ * NB:  Do NOT correct for aberration - the geocentric moon frame moves
+ *	along with the earth.
+ */
+void
+moon (mjd, lam, bet, rho, msp, mdp)
+double mjd;
+double *lam, *bet, *rho;
+double *msp, *mdp;
+{
+	double pobj[3], dt;
+	double hp;
+
+	if (mjd >= MOSHIER_BEGIN && mjd <= MOSHIER_END) {
+		/* retard for light time */
+		moon_fast (mjd, lam, bet, &hp, msp, mdp);
+		*rho = EarthRadius/AUKM/sin(hp);
+		dt = *rho * 5.7755183e-3;       /* speed of light in a.u/day */
+		gecmoon(mjd + MJD0 - dt, &moonlr, &moonlat, pobj);
+
+		*lam = pobj[0];
+		range (lam, 2*PI);
+		*bet = pobj[1];
+		*rho = pobj[2];
+		*msp = STR * Args[11];	/* don't need range correction here */
+		*mdp = STR * Args[12];
+	} else {
+		moon_fast (mjd, lam, bet, &hp, msp, mdp);
+		*rho = EarthRadius/AUKM/sin(hp);
+
+	}
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: moon.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/mooncolong.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/mooncolong.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/mooncolong.c	(revision 1457)
@@ -0,0 +1,264 @@
+/* code to compute lunar sunrise position and local sun angle.
+ */
+
+#include <stdio.h>
+#include <math.h>
+#if defined(__STDC__)
+#include <stdlib.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+
+static void Librations P_((double RAD, double LAMH, double BH, double OM,
+    double F, double L, double L1, double *L0, double *B0));
+static void Moon P_((double RAD, double T, double T2, double LAM0, double R,
+    double M, double *F, double *L1, double *OM, double *LAM, double *B,
+    double *DR, double *LAMH, double *BH));
+static void Sun P_((double RAD, double T, double T2, double *L, double *M,
+    double *R, double *LAM0));
+
+/* given a Julian date and a lunar location, find selenographic colongitude of
+ * rising sun, lunar latitude of subsolar point, illuminated fraction, and alt
+ * of sun at the given location. Any pointer may be 0 if not interested.
+ * From Bruning and Talcott, October 1995 _Astronomy_, page 76.
+ * N.B. lunar coordinates use +E, but selenograhic colongs are +W.
+ */
+void
+moon_colong (jd, lt, lg, cp, kp, ap, sp)
+double jd;	/* jd */
+double lt, lg;	/* lat/long of location on moon, rads +N +E */
+double *cp;	/* selenographic colongitude (-lng of rising sun), rads */
+double *kp;	/* illuminated fraction of surface from Earth */
+double *ap;	/* sun altitude at location, rads */
+double *sp;	/* lunar latitude of subsolar point, rads */
+{
+	double RAD = .0174533;
+	double T;
+	double T2;
+	double L, M, R, LAM0;
+	double F, L1, OM, LAM, B, DR, LAMH, BH;
+	double L0, B0;
+	double TEMP;
+	double C0;
+	double PSI;
+	double NUM, DEN;
+	double I, K;
+	double THETA, ETA;
+	double H;
+
+	T = (jd - 2451545)/36525.0;
+	T2 = T * T;
+
+	Sun(RAD, T, T2, &L, &M, &R, &LAM0);
+	Moon(RAD, T, T2, LAM0, R, M, &F, &L1, &OM, &LAM, &B, &DR, &LAMH, &BH);
+	Librations(RAD, LAMH, BH, OM, F, L, L1, &L0, &B0);
+	if (sp)
+	    *sp = B0;
+
+	TEMP = L0 / 360;
+	L0 = ((TEMP) - (int)(TEMP)) * 360;
+	if (L0 < 0) L0 = L0 + 360;
+	if (L0 <= 90) C0 = 90 - L0; else C0 = 450 - L0;
+	if (cp) {
+	    *cp = degrad(C0);
+	    range (cp, 2*PI);	/* prefer 0..360 +W */
+	}
+
+	if (kp) {
+	    TEMP = cos(B * RAD) * cos(LAM - LAM0 * RAD);
+	    PSI = acos(TEMP);
+	    NUM = R * sin(PSI);
+	    DEN = DR - R * TEMP;
+	    I = atan(NUM / DEN);
+	    if (NUM * DEN < 0) I = I + 3.14159;
+	    if (NUM < 0) I = I + 3.14159;
+	    K = (1 + cos(I)) / 2;
+	    *kp = K;
+	}
+
+	if (ap) {
+	    THETA = lt;
+	    ETA = lg;
+	    C0 = C0 * RAD;
+	    TEMP = sin(B0) * sin(THETA) + cos(B0) * cos(THETA) * sin(C0+ETA);
+	    H = asin(TEMP);
+	    *ap = H;
+	}
+}
+
+static void
+Librations (RAD, LAMH, BH, OM, F, L, L1, L0, B0)
+double RAD;
+double LAMH;
+double BH;
+double OM;
+double F;
+double L;
+double L1;
+double *L0;
+double *B0;
+{ 
+	double I, PSI, W, NUM, DEN, A, TEMP;
+
+	/* inclination of lunar equator */
+	I = 1.54242 * RAD;
+
+	/* nutation in longitude, in arcseconds */
+	PSI = -17.2 * sin(OM) - 1.32 * sin(2 * L) - .23 * sin(2 * L1) +
+							    .21 * sin(2 * OM);
+	PSI = PSI * RAD / 3600;
+
+	/* optical librations */
+	W = (LAMH - PSI) - OM;
+	NUM = sin(W) * cos(BH) * cos(I) - sin(BH) * sin(I);
+	DEN = cos(W) * cos(BH);
+	A = atan(NUM / DEN);
+	if (NUM * DEN < 0) A = A + 3.14159;
+	if (NUM < 0) A = A + 3.14159;
+	*L0 = (A - F) / RAD;
+	TEMP = -sin(W) * cos(BH) * sin(I) - sin(BH) * cos(I);
+	*B0 = asin(TEMP);
+}
+
+static void
+Moon (RAD, T, T2, LAM0, R, M, F, L1, OM, LAM, B, DR, LAMH, BH)
+double RAD;
+double T;
+double T2;
+double LAM0;
+double R;
+double M;
+double *F;
+double *L1;
+double *OM;
+double *LAM;
+double *B;
+double *DR;
+double *LAMH;
+double *BH;
+{
+	double T3, M1, D2, SUMR, SUML, DIST;
+
+	T3 = T * T2; 
+
+	/* argument of the latitude of the Moon */
+	*F = (93.2721 + 483202 * T - .003403 * T2 - T3 / 3526000) * RAD;
+
+	/* mean longitude of the Moon */
+	*L1 = (218.316 + 481268. * T) * RAD;
+	
+	/* longitude of the ascending node of Moon's mean orbit */
+	*OM = (125.045 - 1934.14 * T + .002071 * T2 + T3 / 450000) * RAD;
+	
+	/* Moon's mean anomaly */
+	M1 = (134.963 + 477199 * T + .008997 * T2 + T3 / 69700) * RAD;
+	
+	/* mean elongation of the Moon */
+	D2 = (297.85 + 445267 * T - .00163 * T2 + T3 / 545900) * 2 * RAD;
+
+	/* Lunar distance */
+	SUMR = -20954 * cos(M1) - 3699 * cos(D2 - M1) - 2956 * cos(D2);
+	*DR = 385000 + SUMR;
+	
+	/* geocentric latitude */
+	*B = 5.128 * sin(*F) + .2806 * sin(M1 + *F) + .2777 * sin(M1 - *F) +
+							.1732 * sin(D2 - *F);
+	SUML = 6.289 * sin(M1) + 1.274 * sin(D2 - M1) + .6583 * sin(D2) +
+		.2136 * sin(2 * M1) - .1851 * sin(M) - .1143 * sin(2 * *F);
+	*LAM = *L1 + SUML * RAD;
+	DIST = *DR / R;
+	*LAMH = (LAM0 + 180 + DIST * cos(*B) * sin(LAM0 * RAD - *LAM) / RAD)
+									* RAD;
+	*BH = DIST * *B * RAD;
+}
+
+static void
+Sun (RAD, T, T2, L, M, R, LAM0)
+double RAD;
+double T;
+double T2;
+double *L;
+double *M;
+double *R;
+double *LAM0;
+{
+	double T3, C, V, E, THETA, OM;
+
+	T3 = T2 * T;
+
+	/* mean longitude of the Sun */
+	*L = 280.466 + 36000.8 * T;
+
+	/* mean anomaly of the Sun */
+	*M = 357.529 + 35999 * T - .0001536 * T2 + T3 / 24490000;
+	*M = *M * RAD;
+
+	/* correction for Sun's elliptical orbit */
+	C = (1.915 - .004817 * T - .000014 * T2) * sin(*M) +
+		    (.01999 - .000101 * T) * sin(2 * *M) + .00029 * sin(3 * *M);
+
+	/* true anomaly of the Sun */
+	V = *M + C * RAD;
+
+	/* eccentricity of Earth's orbit */
+	E = .01671 - .00004204 * T - .0000001236 * T2;
+
+	/* Sun-Earth distance */
+	*R = .99972 / (1 + E * cos(V)) * 145980000;
+
+	/* true geometric longitude of the Sun */
+	THETA = *L + C;
+
+	/* apparent longitude of the Sun */
+	OM = 125.04 - 1934.1 * T;
+	*LAM0 = THETA - .00569 - .00478 * sin(OM * RAD);
+}
+
+#ifdef TESTCOLONG
+
+/* insure 0 <= *v < r.
+ */
+void
+range (v, r)
+double *v, r;
+{
+	*v -= r*floor(*v/r);
+}
+
+/* To be sure the program is functioning properly, try the test case
+ * 2449992.5 (1 Oct 1995): the colongitude should be 3.69 degrees.
+ */
+int
+main (int ac, char *av[])
+{
+	double jd, lt, lg;
+	double c, k, a;
+
+	if (ac != 2) {
+	    fprintf (stderr, "%s: JD\n", av[0]);
+	    exit (1);
+	}
+
+	jd = atof(av[1]);
+
+	printf ("Latitude of lunar feature: ");
+	fscanf (stdin, "%lf", &lt);
+	lt = degrad(lt);
+	printf ("Longitude:                 ");
+	fscanf (stdin, "%lf", &lg);
+	lg = degrad(lg);
+
+	moon_colong (jd, lt, lg, &c, &k, &a);
+
+	printf ("Selenographic colongitude is %g\n", raddeg(c));
+	printf ("The illuminated fraction of the Moon is %g\n", k);
+	printf ("Altitude of Sun above feature is %g\n", raddeg(a));
+
+	return (0);
+}
+
+#endif
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: mooncolong.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/nutation.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/nutation.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/nutation.c	(revision 1457)
@@ -0,0 +1,442 @@
+/* nutation (in IAU (1980) expression) and abberation; stern
+ * on an HP PA processor, this reproduces the Almanac nutation values
+ * (given to 0.001") EXACTLY over 750 days (1995 and 1996)
+ */
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+#define NUT_SCALE	1e4
+#define NUT_SERIES	106
+#define NUT_MAXMUL	4
+#define SECPERCIRC	(3600.*360.)
+
+/* Delaunay arguments, in arc seconds; they differ slightly from ELP82B */
+static double delaunay[5][4] = {
+    {485866.733,  1717915922.633, 31.310,  0.064}, /* M', moon mean anom */
+    {1287099.804, 129596581.224,  -0.577, -0.012}, /* M, sun mean anom */
+    {335778.877,  1739527263.137, -13.257, 0.011}, /* F, moon arg lat */
+    {1072261.307, 1602961601.328, -6.891,  0.019}, /* D, elong moon sun */
+    {450160.280,  -6962890.539,   7.455,   0.008}, /* Om, moon l asc node */
+};
+
+/* multipliers for Delaunay arguments */
+static short multarg[NUT_SERIES][5] = {
+	/* bounds:  -2..3, -2..2, -2/0/2/4, -4..4, 0..2 */
+    {0, 0, 0, 0, 1},
+    {0, 0, 0, 0, 2},
+    {-2, 0, 2, 0, 1},
+    {2, 0, -2, 0, 0},
+    {-2, 0, 2, 0, 2},
+    {1, -1, 0, -1, 0},
+    {0, -2, 2, -2, 1},
+    {2, 0, -2, 0, 1},
+    {0, 0, 2, -2, 2},
+    {0, 1, 0, 0, 0},
+    {0, 1, 2, -2, 2},
+    {0, -1, 2, -2, 2},
+    {0, 0, 2, -2, 1},
+    {2, 0, 0, -2, 0},
+    {0, 0, 2, -2, 0},
+    {0, 2, 0, 0, 0},
+    {0, 1, 0, 0, 1},
+    {0, 2, 2, -2, 2},
+    {0, -1, 0, 0, 1},
+    {-2, 0, 0, 2, 1},
+    {0, -1, 2, -2, 1},
+    {2, 0, 0, -2, 1},
+    {0, 1, 2, -2, 1},
+    {1, 0, 0, -1, 0},
+    {2, 1, 0, -2, 0},
+    {0, 0, -2, 2, 1},
+    {0, 1, -2, 2, 0},
+    {0, 1, 0, 0, 2},
+    {-1, 0, 0, 1, 1},
+    {0, 1, 2, -2, 0},
+    {0, 0, 2, 0, 2},
+    {1, 0, 0, 0, 0},
+    {0, 0, 2, 0, 1},
+    {1, 0, 2, 0, 2},
+    {1, 0, 0, -2, 0},
+    {-1, 0, 2, 0, 2},
+    {0, 0, 0, 2, 0},
+    {1, 0, 0, 0, 1},
+    {-1, 0, 0, 0, 1},
+    {-1, 0, 2, 2, 2},
+    {1, 0, 2, 0, 1},
+    {0, 0, 2, 2, 2},
+    {2, 0, 0, 0, 0},
+    {1, 0, 2, -2, 2},
+    {2, 0, 2, 0, 2},
+    {0, 0, 2, 0, 0},
+    {-1, 0, 2, 0, 1},
+    {-1, 0, 0, 2, 1},
+    {1, 0, 0, -2, 1},
+    {-1, 0, 2, 2, 1},
+    {1, 1, 0, -2, 0},
+    {0, 1, 2, 0, 2},
+    {0, -1, 2, 0, 2},
+    {1, 0, 2, 2, 2},
+    {1, 0, 0, 2, 0},
+    {2, 0, 2, -2, 2},
+    {0, 0, 0, 2, 1},
+    {0, 0, 2, 2, 1},
+    {1, 0, 2, -2, 1},
+    {0, 0, 0, -2, 1},
+    {1, -1, 0, 0, 0},
+    {2, 0, 2, 0, 1},
+    {0, 1, 0, -2, 0},
+    {1, 0, -2, 0, 0},
+    {0, 0, 0, 1, 0},
+    {1, 1, 0, 0, 0},
+    {1, 0, 2, 0, 0},
+    {1, -1, 2, 0, 2},
+    {-1, -1, 2, 2, 2},
+    {-2, 0, 0, 0, 1},
+    {3, 0, 2, 0, 2},
+    {0, -1, 2, 2, 2},
+    {1, 1, 2, 0, 2},
+    {-1, 0, 2, -2, 1},
+    {2, 0, 0, 0, 1},
+    {1, 0, 0, 0, 2},
+    {3, 0, 0, 0, 0},
+    {0, 0, 2, 1, 2},
+    {-1, 0, 0, 0, 2},
+    {1, 0, 0, -4, 0},
+    {-2, 0, 2, 2, 2},
+    {-1, 0, 2, 4, 2},
+    {2, 0, 0, -4, 0},
+    {1, 1, 2, -2, 2},
+    {1, 0, 2, 2, 1},
+    {-2, 0, 2, 4, 2},
+    {-1, 0, 4, 0, 2},
+    {1, -1, 0, -2, 0},
+    {2, 0, 2, -2, 1},
+    {2, 0, 2, 2, 2},
+    {1, 0, 0, 2, 1},
+    {0, 0, 4, -2, 2},
+    {3, 0, 2, -2, 2},
+    {1, 0, 2, -2, 0},
+    {0, 1, 2, 0, 1},
+    {-1, -1, 0, 2, 1},
+    {0, 0, -2, 0, 1},
+    {0, 0, 2, -1, 2},
+    {0, 1, 0, 2, 0},
+    {1, 0, -2, -2, 0},
+    {0, -1, 2, 0, 1},
+    {1, 1, 0, -2, 1},
+    {1, 0, -2, 2, 0},
+    {2, 0, 0, 2, 0},
+    {0, 0, 2, 4, 2},
+    {0, 1, 0, 1, 0}
+};
+
+/* amplitudes which  have secular terms; in 1/NUT_SCALE arc seconds
+ * {index, constant dPSI, T/10 in dPSI, constant in dEPS, T/10 in dEPS}
+ */
+static long ampsecul[][5] = {
+    {0  ,-171996 ,-1742 ,92025 ,89},
+    {1  ,2062    ,2     ,-895  ,5},
+    {8  ,-13187  ,-16   ,5736  ,-31},
+    {9  ,1426    ,-34   ,54    ,-1},
+    {10 ,-517    ,12    ,224   ,-6},
+    {11 ,217     ,-5    ,-95   ,3},
+    {12 ,129     ,1     ,-70   ,0},
+    {15 ,17      ,-1    ,0     ,0},
+    {17 ,-16     ,1     ,7     ,0},
+    {30 ,-2274   ,-2    ,977   ,-5},
+    {31 ,712     ,1     ,-7    ,0},
+    {32 ,-386    ,-4    ,200   ,0},
+    {33 ,-301    ,0     ,129   ,-1},
+    {37 ,63      ,1     ,-33   ,0},
+    {38 ,-58     ,-1    ,32    ,0},
+    /* termination */  { -1, }
+};
+
+/* amplitudes which only have constant terms; same unit as above
+ * {dPSI, dEPS}
+ * indexes which are already in ampsecul[][] are zeroed
+ */
+static short ampconst[NUT_SERIES][2] = {
+    {0,0},
+    {0,0},
+    {46,-24},
+    {11,0},
+    {-3,1},
+    {-3,0},
+    {-2,1},
+    {1,0},
+    {0,0},
+    {0,0},
+    {0,0},
+    {0,0},
+    {0,0},
+    {48,1},
+    {-22,0},
+    {0,0},
+    {-15,9},
+    {0,0},
+    {-12,6},
+    {-6,3},
+    {-5,3},
+    {4,-2},
+    {4,-2},
+    {-4,0},
+    {1,0},
+    {1,0},
+    {-1,0},
+    {1,0},
+    {1,0},
+    {-1,0},
+    {0,0},
+    {0,0},
+    {0,0},
+    {0,0},
+    {-158,-1},
+    {123,-53},
+    {63,-2},
+    {0,0},
+    {0,0},
+    {-59,26},
+    {-51,27},
+    {-38,16},
+    {29,-1},
+    {29,-12},
+    {-31,13},
+    {26,-1},
+    {21,-10},
+    {16,-8},
+    {-13,7},
+    {-10,5},
+    {-7,0},
+    {7,-3},
+    {-7,3},
+    {-8,3},
+    {6,0},
+    {6,-3},
+    {-6,3},
+    {-7,3},
+    {6,-3},
+    {-5,3},
+    {5,0},
+    {-5,3},
+    {-4,0},
+    {4,0},
+    {-4,0},
+    {-3,0},
+    {3,0},
+    {-3,1},
+    {-3,1},
+    {-2,1},
+    {-3,1},
+    {-3,1},
+    {2,-1},
+    {-2,1},
+    {2,-1},
+    {-2,1},
+    {2,0},
+    {2,-1},
+    {1,-1},
+    {-1,0},
+    {1,-1},
+    {-2,1},
+    {-1,0},
+    {1,-1},
+    {-1,1},
+    {-1,1},
+    {1,0},
+    {1,0},
+    {1,-1},
+    {-1,0},
+    {-1,0},
+    {1,0},
+    {1,0},
+    {-1,0},
+    {1,0},
+    {1,0},
+    {-1,0},
+    {-1,0},
+    {-1,0},
+    {-1,0},
+    {-1,0},
+    {-1,0},
+    {-1,0},
+    {1,0},
+    {-1,0},
+    {1,0}
+};
+
+/* given the modified JD, mjd, find the nutation in obliquity, *deps, and
+ * the nutation in longitude, *dpsi, each in radians.
+ */
+void
+nutation (mjd, deps, dpsi)
+double mjd;
+double *deps;	/* on input:  precision parameter in arc seconds */
+double *dpsi;
+{
+	static double lastmjd = -10000, lastdeps, lastdpsi;
+	double T, T2, T3, T10;			/* jul cent since J2000 */
+	double prec;				/* series precis in arc sec */
+	int i, isecul;				/* index in term table */
+	static double delcache[5][2*NUT_MAXMUL+1];
+			/* cache for multiples of delaunay args
+			 * [M',M,F,D,Om][-min*x, .. , 0, .., max*x]
+			 * make static to have unfilled fields cleared on init
+			 */
+
+	if (mjd == lastmjd) {
+	    *deps = lastdeps;
+	    *dpsi = lastdpsi;
+	    return;
+	}
+
+	prec = 0.0;
+
+#if 0	/* this is if deps should contain a precision value */
+	prec =* deps;
+	if (prec < 0.0 || prec > 1.0)	/* accept only sane value */
+		prec = 1.0;
+#endif
+
+	/* augment for abundance of small terms */
+	prec *= NUT_SCALE/10;
+
+	T = (mjd - J2000)/36525.;
+	T2 = T * T;
+	T3 = T2 * T;
+	T10 = T/10.;
+
+	/* calculate delaunay args and place in cache */
+	for (i = 0; i < 5; ++i) {
+	    double x;
+	    short j;
+
+	    x = delaunay[i][0] +
+		delaunay[i][1] * T +
+		delaunay[i][2] * T2 +
+		delaunay[i][3] * T3;
+
+	    /* convert to radians */
+	    x /= SECPERCIRC;
+	    x -= floor(x);
+	    x *= 2.*PI;
+
+	    /* fill cache table */
+	    for (j = 0; j <= 2*NUT_MAXMUL; ++j)
+		delcache[i][j] = (j - NUT_MAXMUL) * x;
+	}
+
+	/* find dpsi and deps */
+	lastdpsi = lastdeps = 0.;
+	for (i = isecul = 0; i < NUT_SERIES ; ++i) {
+	    double arg = 0., ampsin, ampcos;
+	    short j;
+
+	    if (ampconst[i][0] || ampconst[i][1]) {
+		/* take non-secular terms from simple array */
+		ampsin = ampconst[i][0];
+		ampcos = ampconst[i][1];
+	    } else {
+		/* secular terms from different array */
+		ampsin = ampsecul[isecul][1] + ampsecul[isecul][2] * T10;
+		ampcos = ampsecul[isecul][3] + ampsecul[isecul][4] * T10;
+		++isecul;
+	    }
+
+	    for (j = 0; j < 5; ++j)
+		arg += delcache[j][NUT_MAXMUL + multarg[i][j]];
+
+	    if (fabs(ampsin) >= prec)
+		lastdpsi += ampsin * sin(arg);
+
+	    if (fabs(ampcos) >= prec)
+		lastdeps += ampcos * cos(arg);
+
+	}
+
+	/* convert to radians.
+	 */
+	lastdpsi = degrad(lastdpsi/3600./NUT_SCALE);
+	lastdeps = degrad(lastdeps/3600./NUT_SCALE);
+
+	lastmjd = mjd;
+	*deps = lastdeps;
+	*dpsi = lastdpsi;
+}
+
+/* given the modified JD, mjd, correct, IN PLACE, the right ascension *ra
+ * and declination *dec (both in radians) for nutation.
+ */
+void
+nut_eq (mjd, ra, dec)
+double mjd, *ra, *dec;
+{
+	static double lastmjd = -10000;
+	static double a[3][3];		/* rotation matrix */
+	double xold, yold, zold, x, y, z;
+
+	if (mjd != lastmjd) {
+	    double epsilon, dpsi, deps;
+	    double se, ce, sp, cp, sede, cede;
+
+	    obliquity(mjd, &epsilon);
+	    nutation(mjd, &deps, &dpsi);
+
+	    /* the rotation matrix a applies the nutation correction to
+	     * a vector of equatoreal coordinates Xeq to Xeq' by 3 subsequent
+	     * rotations:  R1 - from equatoreal to ecliptic system by
+	     * rotation of angle epsilon about x, R2 - rotate ecliptic
+	     * system by -dpsi about its z, R3 - from ecliptic to equatoreal
+	     * by rotation of angle -(epsilon + deps)
+	     *
+	     *	Xeq' = A * Xeq = R3 * R2 * R1 * Xeq
+	     * 
+	     *		[ 1       0          0    ]
+	     * R1 =	[ 0   cos(eps)   sin(eps) ]
+	     *		[ 0  - sin(eps)  cos(eps) ]
+	     * 
+	     *		[ cos(dpsi)  - sin(dpsi)  0 ]
+	     * R2 =	[ sin(dpsi)   cos(dpsi)   0 ]
+	     *		[      0           0      1 ]
+	     * 
+	     *		[ 1         0                 0         ]
+	     * R3 =	[ 0  cos(eps + deps)  - sin(eps + deps) ]
+	     *		[ 0  sin(eps + deps)   cos(eps + deps)  ]
+	     * 
+	     * for efficiency, here is a explicitely:
+	     */
+	    
+	    se = sin(epsilon);
+	    ce = cos(epsilon);
+	    sp = sin(dpsi);
+	    cp = cos(dpsi);
+	    sede = sin(epsilon + deps);
+	    cede = cos(epsilon + deps);
+
+	    a[0][0] = cp;
+	    a[0][1] = -sp*ce;
+	    a[0][2] = -sp*se;
+
+	    a[1][0] = cede*sp;
+	    a[1][1] = cede*cp*ce+sede*se;
+	    a[1][2] = cede*cp*se-sede*ce;
+
+	    a[2][0] = sede*sp;
+	    a[2][1] = sede*cp*ce-cede*se;
+	    a[2][2] = sede*cp*se+cede*ce;
+
+	    lastmjd = mjd;
+	}
+
+	sphcart(*ra, *dec, 1.0, &xold, &yold, &zold);
+	x = a[0][0] * xold + a[0][1] * yold + a[0][2] * zold;
+	y = a[1][0] * xold + a[1][1] * yold + a[1][2] * zold;
+	z = a[2][0] * xold + a[2][1] * yold + a[2][2] * zold;
+	cartsph(x, y, z, ra, dec, &zold);	/* radius should be 1.0 */
+	if (*ra < 0.) *ra += 2.*PI;		/* make positive for display */
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: nutation.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/obliq.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/obliq.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/obliq.c	(revision 1457)
@@ -0,0 +1,30 @@
+#include <stdio.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* given the modified Julian date, mjd, find the mean obliquity of the
+ * ecliptic, *eps, in radians.
+ *
+ * IAU expression (see e.g. Astron. Almanac 1984); stern
+ */
+void
+obliquity (mjd, eps)
+double mjd;
+double *eps;
+{
+	static double lastmjd = -16347, lasteps;
+
+	if (mjd != lastmjd) {
+	    double t = (mjd - J2000)/36525.;	/* centuries from J2000 */
+	    lasteps = degrad(23.4392911 +	/* 23^ 26' 21".448 */
+			    t * (-46.8150 +
+			    t * ( -0.00059 +
+			    t * (  0.001813 )))/3600.0);
+	    lastmjd = mjd;
+	}
+	*eps = lasteps;
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: obliq.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/parallax.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/parallax.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/parallax.c	(revision 1457)
@@ -0,0 +1,44 @@
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+
+/* given true ha and dec, tha and tdec, the geographical latitude, phi, the
+ * height above sea-level (as a fraction of the earths radius, 6378.16km),
+ * ht, and the geocentric distance rho in Earth radii(!), find the apparent
+ * ha and dec, aha and adec allowing for parallax.
+ * all angles in radians. ehp is the angle subtended at the body by the
+ * earth's equator.
+ */
+void
+ta_par (tha, tdec, phi, ht, rho, aha, adec)
+double tha, tdec, phi, ht, *rho;
+double *aha, *adec;
+{
+	static double last_phi = 1000.0, last_ht = -1000.0, xobs, zobs;
+	double x, y, z;	/* obj cartesian coord, in Earth radii */
+
+	/* avoid calcs involving the same phi and ht */
+	if (phi != last_phi || ht != last_ht) {
+	    double cphi, sphi, robs, e2 = (2 - 1/298.257)/298.257;
+	    cphi = cos(phi);
+	    sphi = sin(phi);
+	    robs = 1/sqrt(1 - e2 * sphi * sphi);
+
+	    /* observer coordinates: x to meridian, y east, z north */
+	    xobs = (robs + ht) * cphi;
+	    zobs = (robs*(1-e2) + ht) * sphi;
+	    last_phi  =  phi;
+	    last_ht  =  ht;
+	}
+
+	sphcart(-tha, tdec, *rho, &x, &y, &z);
+	cartsph(x - xobs, y, z - zobs, aha, adec, rho);
+	*aha *= -1;
+	range (aha, 2*PI);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: parallax.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/plans.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/plans.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/plans.c	(revision 1457)
@@ -0,0 +1,209 @@
+/* rewritten for Bureau des Longitude theories by Bretagnon and Chapront
+ * Michael Sternberg <sternberg@physik.tu-chemnitz.de>
+ */
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+#include "vsop87.h"
+#include "chap95.h"
+
+static void pluto_ell P_((double mjd, double *ret));
+static void chap_trans P_((double mjd, double *ret));
+static void planpos P_((double mjd, int obj, double prec, double *ret));
+
+/* coordinate transformation
+ * from:
+ *	J2000.0 rectangular equatoreal			ret[{0,1,2}] = {x,y,z}
+ * to:
+ *	mean equinox of date spherical ecliptical	ret[{0,1,2}] = {l,b,r}
+ */
+static void
+chap_trans (mjd, ret)
+double mjd;	/* destination epoch */
+double *ret;	/* vector to be transformed _IN PLACE_ */
+{
+	double ra, dec, r, eps;
+	double sr, cr, sd, cd, se, ce;
+
+	cartsph(ret[0], ret[1], ret[2], &ra, &dec, &r);
+	precess(J2000, mjd, &ra, &dec);
+	obliquity(mjd, &eps);
+	sr = sin(ra); cr = cos(ra);
+	sd = sin(dec); cd = cos(dec);
+	se = sin(eps); ce = cos(eps);
+	ret[0] = atan2( sr * ce + sd/cd * se, cr);	/* long */
+	ret[1] = asin( sd * ce - cd * se * sr);		/* lat */
+	ret[2] = r;					/* radius */
+}
+
+/* low precision ecliptic coordinates of Pluto from mean orbit.
+ * Only for sake of completeness outside available perturbation theories.
+ */
+static void
+pluto_ell (mjd, ret)
+double mjd;	/* epoch */
+double *ret;	/* ecliptic coordinates {l,b,r} at equinox of date */
+{
+	/* mean orbital elements of Pluto.
+	 * The origin of these is somewhat obscure.
+	 */
+	double	a = 39.543,			/* semimajor axis, au */
+		e = 0.2490,			/* excentricity */
+		inc0 = 17.140,			/* inclination, deg */
+		Om0 = 110.307,			/* long asc node, deg */
+		omeg0 = 113.768,		/* arg of perihel, deg */
+		mjdp = 2448045.539 - MJD0,	/* epoch of perihel */
+		mjdeq = J2000,			/* equinox of elements */
+		n = 144.9600/36525.;            /* daily motion, deg */
+
+	double inc, Om, omeg;	/* orbital elements at epoch of date */
+	double ma, ea, nu;	/* mean, excentric and true anomaly */
+	double lo, slo, clo;	/* longitude in orbit from asc node */
+
+	reduce_elements(mjdeq, mjd, degrad(inc0), degrad(omeg0), degrad(Om0),
+				&inc, &omeg, &Om);
+	ma = degrad((mjd - mjdp) * n);
+	anomaly(ma, e, &nu, &ea);
+	ret[2] = a * (1.0 - e*cos(ea));			/* r */
+	lo = omeg + nu;
+	slo = sin(lo);
+	clo = cos(lo);
+	ret[1] = asin(slo * sin(inc));			/* b */
+	ret[0] = atan2(slo * cos(inc), clo) + Om;	/* l */
+}
+
+/*************************************************************/
+
+/* geometric heliocentric position of planet, mean ecliptic of date
+ * (not corrected for light-time)
+ */
+static void
+planpos (mjd, obj, prec, ret)
+double mjd;
+int obj;
+double prec;
+double *ret;
+{
+	if (mjd >= CHAP_BEGIN && mjd <= CHAP_END) {
+	    if (obj >= JUPITER) {		/* prefer Chapront */
+		chap95(mjd, obj, prec, ret);
+		chap_trans (mjd, ret);
+	    } else {				/* VSOP for inner planets */
+		vsop87(mjd, obj, prec, ret);
+	    }
+	} else {				/* outside Chapront time: */
+	    if (obj != PLUTO) {			/* VSOP for all but Pluto */
+		vsop87(mjd, obj, prec, ret);
+	    } else {				/* Pluto mean elliptic orbit */
+		pluto_ell(mjd, ret);
+	    }
+	}
+}
+
+/*************************************************************/
+
+/* visual elements of planets
+ * [planet][0] = angular size at 1 AU
+ * [planet][1] = magnitude at 1 AU from sun and earth and 0 deg phase angle
+ */
+static double vis_elements[8][2] = {
+	/* Mercury */	{ 6.74, -0.42, },
+	/* Venus */	{ 16.92, -4.34, },
+	/* Mars */	{ 9.36, -1.20, },
+	/* Jupiter */	{ 196.74, -9.4, },
+	/* Saturn */	{ 165.6, -8.88, },
+	/* Uranus */	{ 65.8, -7.19, },
+	/* Neptune */	{ 62.2, -6.87, },
+	/* Pluto */	{ 8.2, -1.0, }
+};
+
+/* given a modified Julian date, mjd, and a planet, p, find:
+ *   lpd0: heliocentric longitude, 
+ *   psi0: heliocentric latitude,
+ *   rp0:  distance from the sun to the planet, 
+ *   rho0: distance from the Earth to the planet,
+ *         none corrected for light time, ie, they are the true values for the
+ *         given instant.
+ *   lam:  geocentric ecliptic longitude, 
+ *   bet:  geocentric ecliptic latitude,
+ *         each corrected for light time, ie, they are the apparent values as
+ *	   seen from the center of the Earth for the given instant.
+ *   dia:  angular diameter in arcsec at 1 AU, 
+ *   mag:  visual magnitude when 1 AU from sun and earth at 0 phase angle.
+ *
+ * all angles are in radians, all distances in AU.
+ *
+ * corrections for nutation and abberation must be made by the caller. The RA 
+ *   and DEC calculated from the fully-corrected ecliptic coordinates are then
+ *   the apparent geocentric coordinates. Further corrections can be made, if
+ *   required, for atmospheric refraction and geocentric parallax.
+ */
+void
+plans (mjd, p, lpd0, psi0, rp0, rho0, lam, bet, dia, mag)
+double mjd;
+int p;
+double *lpd0, *psi0, *rp0, *rho0, *lam, *bet, *dia, *mag;
+{
+	static double lastmjd = -10000;
+	static double lsn, bsn, rsn;	/* geometric geocentric coords of sun */
+	static double xsn, ysn, zsn;
+	double lp, bp, rp;		/* heliocentric coords of planet */
+	double xp, yp, zp, rho;		/* rect. coords and geocentric dist. */
+	double dt;			/* light time */
+	int pass;
+
+	/* get sun cartesian; needed only once at mjd */
+	if (mjd != lastmjd) {
+	    sunpos (mjd, &lsn, &rsn, &bsn);
+	    sphcart (lsn, bsn, rsn, &xsn, &ysn, &zsn);
+            lastmjd = mjd;
+        }
+
+	/* first find the true position of the planet at mjd.
+	 * then repeat a second time for a slightly different time based
+	 * on the position found in the first pass to account for light-travel
+	 * time.
+	 */
+	dt = 0.0;
+	for (pass = 0; pass < 2; pass++) {
+	    double ret[6];
+
+	    /* get spherical coordinates of planet from precision routines,
+	     * retarded for light time in second pass;
+	     * alternative option:  vsop allows calculating rates.
+	     */
+	    planpos(mjd - dt, p, 0.0, ret);
+
+	    lp = ret[0];
+	    bp = ret[1];
+	    rp = ret[2];
+
+	    sphcart (lp, bp, rp, &xp, &yp, &zp);
+	    cartsph (xp + xsn, yp + ysn, zp + zsn, lam, bet, &rho);
+
+	    if (pass == 0) {
+		/* save heliocentric coordinates at first pass since, being
+		 * true, they are NOT to be corrected for light-travel time.
+		 */
+		*lpd0 = lp;
+		range (lpd0, 2.*PI);
+		*psi0 = bp;
+		*rp0 = rp;
+		*rho0 = rho;
+	    }
+
+	    /* when we view a planet we see it in the position it occupied
+	     * dt days ago, where rho is the distance between it and earth,
+	     * in AU. use this as the new time for the next pass.
+	     */
+	    dt = rho * 5.7755183e-3;
+	}
+
+	*dia = vis_elements[p][0];
+	*mag = vis_elements[p][1];
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: plans.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/precess.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/precess.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/precess.c	(revision 1457)
@@ -0,0 +1,148 @@
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+static void precess_hiprec P_((double mjd1, double mjd2, double *ra,
+    double *dec));
+
+
+#define	DCOS(x)		cos(degrad(x))
+#define	DSIN(x)		sin(degrad(x))
+#define	DASIN(x)	raddeg(asin(x))
+#define	DATAN2(y,x)	raddeg(atan2((y),(x)))
+
+/* corrects ra and dec, both in radians, for precession from epoch 1 to epoch 2.
+ * the epochs are given by their modified JDs, mjd1 and mjd2, respectively.
+ * N.B. ra and dec are modifed IN PLACE.
+ */
+void
+precess (mjd1, mjd2, ra, dec)
+double mjd1, mjd2;	/* initial and final epoch modified JDs */
+double *ra, *dec;	/* ra/dec for mjd1 in, for mjd2 out */
+{
+	precess_hiprec (mjd1, mjd2, ra, dec);
+}
+
+/*
+ * Copyright (c) 1990 by Craig Counterman. All rights reserved.
+ *
+ * This software may be redistributed freely, not sold.
+ * This copyright notice and disclaimer of warranty must remain
+ *    unchanged. 
+ *
+ * No representation is made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty, to the extent permitted by applicable law.
+ *
+ * Rigorous precession. From Astronomical Ephemeris 1989, p. B18
+ *
+ * 96-06-20 Hayo Hase <hase@wettzell.ifag.de>: theta_a corrected
+ */
+static void
+precess_hiprec (mjd1, mjd2, ra, dec)
+double mjd1, mjd2;	/* initial and final epoch modified JDs */
+double *ra, *dec;	/* ra/dec for mjd1 in, for mjd2 out */
+{
+	static double last_mjd1 = -213.432, last_from;
+	static double last_mjd2 = -213.432, last_to;
+	double zeta_A, z_A, theta_A;
+	double T;
+	double A, B, C;
+	double alpha, delta;
+	double alpha_in, delta_in;
+	double from_equinox, to_equinox;
+	double alpha2000, delta2000;
+
+	/* convert mjds to years;
+	 * avoid the remarkably expensive calls to mjd_year()
+	 */
+	if (last_mjd1 == mjd1)
+	    from_equinox = last_from;
+	else {
+	    mjd_year (mjd1, &from_equinox);
+	    last_mjd1 = mjd1;
+	    last_from = from_equinox;
+	}
+	if (last_mjd2 == mjd2)
+	    to_equinox = last_to;
+	else {
+	    mjd_year (mjd2, &to_equinox);
+	    last_mjd2 = mjd2;
+	    last_to = to_equinox;
+	}
+
+	/* convert coords in rads to degs */
+	alpha_in = raddeg(*ra);
+	delta_in = raddeg(*dec);
+
+	/* precession progresses about 1 arc second in .047 years */
+	/* From from_equinox to 2000.0 */
+	if (fabs (from_equinox-2000.0) > .02) {
+	    T = (from_equinox - 2000.0)/100.0;
+	    zeta_A  = 0.6406161* T + 0.0000839* T*T + 0.0000050* T*T*T;
+	    z_A     = 0.6406161* T + 0.0003041* T*T + 0.0000051* T*T*T;
+	    theta_A = 0.5567530* T - 0.0001185* T*T - 0.0000116* T*T*T;
+
+	    A = DSIN(alpha_in - z_A) * DCOS(delta_in);
+	    B = DCOS(alpha_in - z_A) * DCOS(theta_A) * DCOS(delta_in)
+	      + DSIN(theta_A) * DSIN(delta_in);
+	    C = -DCOS(alpha_in - z_A) * DSIN(theta_A) * DCOS(delta_in)
+	      + DCOS(theta_A) * DSIN(delta_in);
+
+	    alpha2000 = DATAN2(A,B) - zeta_A;
+	    range (&alpha2000, 360.0);
+	    delta2000 = DASIN(C);
+	} else {
+	    /* should get the same answer, but this could improve accruacy */
+	    alpha2000 = alpha_in;
+	    delta2000 = delta_in;
+	};
+
+
+	/* From 2000.0 to to_equinox */
+	if (fabs (to_equinox - 2000.0) > .02) {
+	    T = (to_equinox - 2000.0)/100.0;
+	    zeta_A  = 0.6406161* T + 0.0000839* T*T + 0.0000050* T*T*T;
+	    z_A     = 0.6406161* T + 0.0003041* T*T + 0.0000051* T*T*T;
+	    theta_A = 0.5567530* T - 0.0001185* T*T - 0.0000116* T*T*T;
+
+	    A = DSIN(alpha2000 + zeta_A) * DCOS(delta2000);
+	    B = DCOS(alpha2000 + zeta_A) * DCOS(theta_A) * DCOS(delta2000)
+	      - DSIN(theta_A) * DSIN(delta2000);
+	    C = DCOS(alpha2000 + zeta_A) * DSIN(theta_A) * DCOS(delta2000)
+	      + DCOS(theta_A) * DSIN(delta2000);
+
+	    alpha = DATAN2(A,B) + z_A;
+	    range(&alpha, 360.0);
+	    delta = DASIN(C);
+	} else {
+	    /* should get the same answer, but this could improve accruacy */
+	    alpha = alpha2000;
+	    delta = delta2000;
+	};
+
+	*ra = degrad(alpha);
+	*dec = degrad(delta);
+}
+
+#if 0
+static void
+precess_fast (mjd1, mjd2, ra, dec)
+double mjd1, mjd2;	/* initial and final epoch modified JDs */
+double *ra, *dec;	/* ra/dec for mjd1 in, for mjd2 out */
+{
+#define	N	degrad (20.0468/3600.0)
+#define	M	hrrad (3.07234/3600.0)
+	double nyrs;
+
+	nyrs = (mjd2 - mjd1)/365.2425;
+	*dec += N * cos(*ra) * nyrs;
+	*ra += (M + (N * sin(*ra) * tan(*dec))) * nyrs;
+	range (ra, 2.0*PI);
+}
+#endif
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: precess.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/preferences.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/preferences.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/preferences.h	(revision 1457)
@@ -0,0 +1,31 @@
+/* global info for the preferences facility.
+ * N.B. many of these enums are used as indexes -- don't change without
+ *   checking where they are used!
+ */
+#ifndef _PREFERENCES_H
+#define _PREFERENCES_H
+
+typedef enum {
+    PREF_EQUATORIAL, PREF_UNITS, PREF_DATE_FORMAT, PREF_ZONE,
+    PREF_DPYPREC, PREF_MSG_BELL, PREF_PRE_FILL, PREF_TIPS, PREF_CONFIRM,
+    NPREFS
+} Preferences;
+
+typedef enum {PREF_GEO, PREF_TOPO} PrefEquatorial;
+typedef enum {PREF_ENGLISH, PREF_METRIC} PrefUnits;
+typedef enum {PREF_MDY, PREF_YMD, PREF_DMY} PrefDateFormat;
+typedef enum {PREF_LOCALTZ, PREF_UTCTZ} PrefStampZone;
+typedef enum {PREF_LOPREC, PREF_HIPREC} PrefDpyPrec;
+typedef enum {PREF_NOMSGBELL, PREF_MSGBELL} PrefMsgBell;
+typedef enum {PREF_PREFILL, PREF_NOPREFILL} PrefPreFill;
+typedef enum {PREF_TIPSON, PREF_NOTIPS} PrefTips;
+typedef enum {PREF_CONFIRMON, PREF_NOCONFIRM} PrefConfirm;
+
+extern int pref_get P_((Preferences p));
+extern int pref_set P_((Preferences p, int new));
+
+#endif /* _PREFERENCES_H */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: preferences.h,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/reduce.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/reduce.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/reduce.c	(revision 1457)
@@ -0,0 +1,77 @@
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* convert those orbital elements that change from epoch mjd0 to epoch mjd.
+ */
+void
+reduce_elements (mjd0, mjd, inc0, ap0, om0, inc, ap, om)
+double mjd0;	/* initial epoch */
+double mjd;	/* desired epoch */
+double inc0;	/* initial inclination, rads */
+double ap0;	/* initial argument of perihelion, as an mjd */
+double om0;	/* initial long of ascending node, rads */
+double *inc;	/* desired inclination, rads */
+double *ap;	/* desired epoch of perihelion, as an mjd */
+double *om;	/* desired long of ascending node, rads */
+{
+	double t0, t1;
+	double tt, tt2, t02, tt3;
+	double eta, th, th0;
+	double a, b;
+	double dap;
+	double cinc, sinc;
+	double ot, sot, cot, ot1;
+	double seta, ceta;
+
+	if (fabs(mjd - mjd0) < 1e-5) {
+	    /* sin(eta) blows for inc < 10 degrees -- anyway, no need */
+	    *inc = inc0;
+	    *ap = ap0;
+	    *om = om0;
+	    return;
+	}
+
+	t0 = mjd0/365250.0;
+	t1 = mjd/365250.0;
+
+	tt = t1-t0;
+	tt2 = tt*tt;
+        t02 = t0*t0;
+	tt3 = tt*tt2;
+        eta = (471.07-6.75*t0+.57*t02)*tt+(.57*t0-3.37)*tt2+.05*tt3;
+        th0 = 32869.0*t0+56*t02-(8694+55*t0)*tt+3*tt2;
+        eta = degrad(eta/3600.0);
+        th0 = degrad((th0/3600.0)+173.950833);
+        th = (50256.41+222.29*t0+.26*t02)*tt+(111.15+.26*t0)*tt2+.1*tt3;
+        th = th0+degrad(th/3600.0);
+	cinc = cos(inc0);
+        sinc = sin(inc0);
+	ot = om0-th0;
+	sot = sin(ot);
+        cot = cos(ot);
+	seta = sin(eta);
+        ceta = cos(eta);
+	a = sinc*sot;
+        b = ceta*sinc*cot-seta*cinc;
+	ot1 = atan(a/b);
+        if (b<0) ot1 += PI;
+        b = sinc*ceta-cinc*seta*cot;
+        a = -1*seta*sot;
+	dap = atan(a/b);
+        if (b<0) dap += PI;
+
+        *ap = ap0+dap;
+	range (ap, 2*PI);
+        *om = ot1+th;
+	range (om, 2*PI);
+
+        if (inc0<.175)
+	    *inc = asin(a/sin(dap));
+	else
+	    *inc = 1.570796327-asin((cinc*ceta)+(sinc*seta*cot));
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: reduce.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/refract.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/refract.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/refract.c	(revision 1457)
@@ -0,0 +1,103 @@
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+static void unrefractLT15 P_((double pr, double tr, double aa, double *ta));
+static void unrefractGE15 P_((double pr, double tr, double aa, double *ta));
+
+void
+unrefract (pr, tr, aa, ta)
+double pr, tr;
+double aa;
+double *ta;
+{
+#define	LTLIM	14.5
+#define	GELIM	15.5
+
+	double aadeg = raddeg(aa);
+
+	if (aadeg < LTLIM)
+	    unrefractLT15 (pr, tr, aa, ta);
+	else if (aadeg >= GELIM)
+	    unrefractGE15 (pr, tr, aa, ta);
+	else {
+	    /* smooth blend -- important for inverse */
+	    double taLT, taGE, p;
+
+	    unrefractLT15 (pr, tr, aa, &taLT);
+	    unrefractGE15 (pr, tr, aa, &taGE);
+	    p = (aadeg - LTLIM)/(GELIM - LTLIM);
+	    *ta = taLT + (taGE - taLT)*p;
+	}
+	    
+}
+
+static void
+unrefractGE15 (pr, tr, aa, ta)
+double pr, tr;
+double aa;
+double *ta;
+{
+	double r;
+	
+	r = 7.888888e-5*pr/((273+tr)*tan(aa));
+	*ta  =  aa - r;
+}
+
+static void
+unrefractLT15 (pr, tr, aa, ta)
+double pr, tr;
+double aa;
+double *ta;
+{
+	double aadeg = raddeg(aa);
+	double r, a, b;
+
+	a = ((2e-5*aadeg+1.96e-2)*aadeg+1.594e-1)*pr;
+	b = (273+tr)*((8.45e-2*aadeg+5.05e-1)*aadeg+1);
+	r = degrad(a/b);
+
+	*ta  =  aa - r;
+}
+
+/* correct the true altitude, ta, for refraction to the apparent altitude, aa,
+ * each in radians, given the local atmospheric pressure, pr, in mbars, and
+ * the temperature, tr, in degrees C.
+ */
+void
+refract (pr, tr, ta, aa)
+double pr, tr;
+double ta;
+double *aa;
+{
+#define	MAXRERR	degrad(0.1/3600.)	/* desired accuracy, rads */
+
+	double d, t, t0, a;
+
+	/* first guess of error is to go backwards.
+	 * make use that we know delta-apparent is always < delta-true.
+	 */
+	unrefract (pr, tr, ta, &t);
+	d = 0.8*(ta - t);
+	t0 = t;
+	a = ta;
+
+	/* use secant method to discover a value that unrefracts to ta.
+	 * max=7 ave=2.4 loops in hundreds of test cases.
+	 */
+	do {
+	    a += d;
+	    unrefract (pr, tr, a, &t);
+	    d *= -(ta - t)/(t0 - t);
+	    t0 = t;
+	} while (fabs(ta-t) > MAXRERR);
+
+	*aa = a;
+
+#undef	MAXRERR
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: refract.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/riset.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/riset.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/riset.c	(revision 1457)
@@ -0,0 +1,105 @@
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+
+/* given the true geocentric ra and dec of an object, the observer's latitude,
+ *   lat, and a horizon displacement correction, dis, all in radians, find the
+ *   local sidereal times and azimuths of rising and setting, lstr/s
+ *   and azr/s, also all in radians, respectively.
+ * dis is the vertical displacement from the true position of the horizon. it
+ *   is positive if the apparent position is higher than the true position.
+ *   said another way, it is positive if the shift causes the object to spend
+ *   longer above the horizon. for example, atmospheric refraction is typically
+ *   assumed to produce a vertical shift of 34 arc minutes at the horizon; dis
+ *   would then take on the value +9.89e-3 (radians). On the other hand, if
+ *   your horizon has hills such that your apparent horizon is, say, 1 degree
+ *   above sea level, you would allow for this by setting dis to -1.75e-2
+ *   (radians).
+ *
+ * This version contributed by Konrad Bernloehr, Nov. 1996
+ *
+ * status: 0=normal; 1=never rises; -1=circumpolar.
+ * In case of non-zero status, all other returned variables are undefined.
+ */
+void
+riset (ra, dec, lat, dis, lstr, lsts, azr, azs, status)
+double ra, dec;
+double lat, dis;
+double *lstr, *lsts;
+double *azr, *azs;
+int *status;
+{
+#define	EPS	(1e-9)	/* math rounding fudge - always the way, eh? */
+	double h;		/* hour angle */
+	double cos_h;		/* cos h */
+	double z;		/* zenith angle */
+	double zmin, zmax;	/* Minimum and maximum zenith angles */
+	double xaz, yaz;	/* components of az */
+	int shemi;		/* flag for southern hemisphere reflection */
+
+	/* reflect lat and dec if in southern hemisphere, then az back later */
+	if ((shemi= (lat < 0.)) != 0) {
+	    lat = -lat;
+	    dec = -dec;
+	}
+
+	/* establish zenith angle, and its extrema */
+	z = (PI/2.) + dis;
+	zmin = fabs (dec - lat);
+	zmax = PI - fabs(dec + lat);
+
+	/* first consider special cases.
+	 * these also avoid any boundary problems in subsequent computations.
+	 */
+	if (zmax <= z + EPS) {
+	    *status = -1;	/* never sets */
+	    return;
+	}
+	if (zmin >= z - EPS) {
+	    *status = 1;	/* never rises */
+	    return;
+	}
+
+	/* compute rising hour angle -- beware found off */
+	cos_h = (cos(z)-sin(lat)*sin(dec))/(cos(lat)*cos(dec));
+	if (cos_h >= 1.)
+	    h =  0.;
+	else if (cos_h <= -1.)
+	    h = PI;
+	else
+	    h = acos (cos_h);
+
+	/* compute setting azimuth -- beware found off */
+	xaz = sin(dec)*cos(lat)-cos(dec)*cos(h)*sin(lat);
+	yaz = -1.*cos(dec)*sin(h);
+	if (xaz == 0.) {
+	    if (yaz > 0)
+		*azs = PI/2;
+	    else
+		*azs = -PI/2;
+	} else
+	    *azs = atan2 (yaz, xaz);
+
+	/* reflect az back if southern */
+	if (shemi)
+	    *azs = PI - *azs;
+	range(azs, 2.*PI);
+
+	/* rising is just the opposite side */
+	*azr = 2.*PI - *azs;
+	range(azr, 2.*PI);
+
+	/* rise and set are just ha either side of ra */
+	*lstr = radhr(ra-h);
+	range(lstr,24.0);
+	*lsts = radhr(ra+h);
+	range(lsts,24.0);
+
+	/* OK */
+	*status = 0;
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: riset.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/riset_cir.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/riset_cir.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/riset_cir.c	(revision 1457)
@@ -0,0 +1,387 @@
+/* find rise and set circumstances, ie, riset_cir() and related functions. */
+
+#include <stdio.h>
+#include <math.h>
+#if defined(__STDC__)
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#include "P_.h"
+#include "astro.h"
+#include "circum.h"
+
+#define	TMACC	(10./3600./24.0)	/* convergence accuracy, days */
+
+static void e_riset_cir P_((Now *np, Obj *op, double dis, RiseSet *rp));
+static int find_0alt P_((double dt, double dis, Now *np, Obj *op));
+static int find_transit P_((double dt, Now *np, Obj *op));
+static int find_max P_((Now *np, Obj *op, double tr, double ts, double *tp,
+    double *alp));
+
+/* find where and when an object, op, will rise and set and
+ *   it's transit circumstances. all times are utc mjd, angles rads e of n.
+ * dis is the angle down from an ideal horizon, in rads (see riset()).
+ * N.B. dis should NOT include refraction, we do that here.
+ */
+void
+riset_cir (np, op, dis, rp)
+Now *np;
+Obj *op;
+double dis;
+RiseSet *rp;
+{
+	double mjdn;	/* mjd of local noon */
+	double lstn;	/* lst at local noon */
+	double lr, ls;	/* lst rise/set times */
+	double ar, as;	/* az of rise/set */
+	double ran;	/* RA at noon */
+	Now n;		/* copy to move time around */
+	Obj o;		/* copy to get circumstances at n */
+	int rss;	/* temp status */
+
+	/* work with local copies so we can move the time around */
+	(void) memcpy ((void *)&n, (void *)np, sizeof(n));
+	(void) memcpy ((void *)&o, (void *)op, sizeof(o));
+
+	/* fast Earth satellites need a different approach.
+	 * "fast" here is pretty arbitrary -- just too fast to work with the
+	 * iterative approach based on refining the times for a "fixed" object.
+	 */
+	if (op->o_type == EARTHSAT && op->es_n > FAST_SAT_RPD) {
+	    e_riset_cir (&n, &o, dis, rp);
+	    return;
+	}
+
+	/* assume no problems initially */
+	rp->rs_flags = 0;
+
+	/* start the iteration at local noon */
+	mjdn = mjd_day(mjd - tz/24.0) + tz/24.0 + 0.5;
+	n.n_mjd = mjdn;
+	now_lst (&n, &lstn);
+
+	/* first approximation is to find rise/set times of a fixed object
+	 * at the current epoch in its position at local noon.
+	 * N.B. add typical refraction for initial go/no-go test. if it
+	 *   passes, real code does refraction rigorously.
+	 */
+	n.n_mjd = mjdn;
+	if (obj_cir (&n, &o) < 0) {
+	    rp->rs_flags = RS_ERROR;
+	    return;
+	}
+	ran = o.s_gaera;
+	riset (o.s_gaera, o.s_gaedec, lat, dis+.01, &lr, &ls, &ar, &as, &rss);
+	switch (rss) {
+	case  0:  break;
+	case  1: rp->rs_flags = RS_NEVERUP; return;
+	case -1: rp->rs_flags = RS_CIRCUMPOLAR; goto dotransit;
+	default: rp->rs_flags = RS_ERROR; return;
+	}
+
+	/* iterate to find better rise time */
+	n.n_mjd = mjdn;
+	switch (find_0alt ((lr - lstn)/SIDRATE, dis, &n, &o)) {
+	case 0: /* ok */
+	    rp->rs_risetm = n.n_mjd;
+	    rp->rs_riseaz = o.s_az;
+	    break;
+	case -1: /* obj_cir error */
+	    rp->rs_flags |= RS_RISERR;
+	    break;
+	case -2: /* converged but not today */ /* FALLTHRU */
+	case -3: /* probably never up */
+	    rp->rs_flags |= RS_NORISE;
+	    break;
+	}
+
+	/* iterate to find better set time */
+	n.n_mjd = mjdn;
+	switch (find_0alt ((ls - lstn)/SIDRATE, dis, &n, &o)) {
+	case 0: /* ok */
+	    rp->rs_settm = n.n_mjd;
+	    rp->rs_setaz = o.s_az;
+	    break;
+	case -1: /* obj_cir error */
+	    rp->rs_flags |= RS_SETERR;
+	    break;
+	case -2: /* converged but not today */ /* FALLTHRU */
+	case -3: /* probably circumpolar */
+	    rp->rs_flags |= RS_NOSET;
+	    break;
+	}
+
+	/* can try transit even if rise or set failed */
+    dotransit:
+	n.n_mjd = mjdn;
+	switch (find_transit ((radhr(ran) - lstn)/SIDRATE, &n, &o)) {
+	case 0: /* ok */
+	    rp->rs_trantm = n.n_mjd;
+	    rp->rs_tranalt = o.s_alt;
+	    break;
+	case -1: /* did not converge */
+	    rp->rs_flags |= RS_TRANSERR;
+	    break;
+	case -2: /* converged but not today */
+	    rp->rs_flags |= RS_NOTRANS;
+	    break;
+	}
+}
+
+/* find local times when sun is dis rads below horizon.
+ */
+void
+twilight_cir (np, dis, dawn, dusk, status)
+Now *np;
+double dis;
+double *dawn, *dusk;
+int *status;
+{
+	RiseSet rs;
+	Obj o;
+
+	o.o_type = PLANET;
+	o.pl.pl_code = SUN;
+	(void) strcpy (o.o_name, "Sun");
+	riset_cir (np, &o, dis, &rs);
+	*dawn = rs.rs_risetm;
+	*dusk = rs.rs_settm;
+	*status = rs.rs_flags;
+}
+
+/* find where and when a fast-moving Earth satellite, op, will rise and set and
+ *   it's transit circumstances. all times are mjd, angles rads e of n.
+ * dis is the angle down from the local topo horizon, in rads (see riset()).
+ * idea is to walk forward in time looking for alt+dis==0 crossings.
+ * initial time step is a few degrees (based on average daily motion).
+ * we stop as soon as we see both a rise and set.
+ * N.B. we assume *np and *op are working copies we can mess up.
+ */
+static void
+e_riset_cir (np, op, dis, rp)
+Now *np;
+Obj *op;
+double dis;
+RiseSet *rp;
+{
+#define	DEGSTEP	5		/* time step is about this many degrees */
+	int steps;		/* max number of time steps */
+	double dt;		/* time change per step, days */
+	double t0, t1;		/* current and next mjd values */
+	double a0, a1;		/* altitude at t0 and t1 */
+	int rise, set;		/* flags to check when we find these events */
+	int i;
+
+	dt = DEGSTEP * (1.0/360.0/op->es_n);
+	steps = (int)(1.0/dt);
+	rise = set = 0;
+	rp->rs_flags = 0;
+
+	if (obj_cir (np, op) < 0) {
+	    rp->rs_flags |= RS_ERROR;
+	    return;
+	}
+
+	t0 = mjd;
+	a0 = op->s_alt + dis;
+
+	for (i = 0; i < steps && (!rise || !set); i++) {
+	    mjd = t1 = t0 + dt;
+	    if (obj_cir (np, op) < 0) {
+		rp->rs_flags |= RS_ERROR;
+		return;
+	    }
+	    a1 = op->s_alt + dis;
+
+	    if (a0 < 0 && a1 > 0 && !rise) {
+		/* found a rise event -- interate to refine */
+		switch (find_0alt (0.0, dis, np, op)) {
+		case 0: /* ok */
+		    rp->rs_risetm = np->n_mjd;
+		    rp->rs_riseaz = op->s_az;
+		    rise = 1;
+		    break;
+		case -1: /* obj_cir error */
+		    rp->rs_flags |= RS_RISERR;
+		    return;
+		case -2: /* converged but not today */ /* FALLTHRU */
+		case -3: /* probably never up */
+		    rp->rs_flags |= RS_NORISE;
+		    return;
+		}
+	    } else if (a0 > 0 && a1 < 0 && !set) {
+		/* found a setting event -- interate to refine */
+		switch (find_0alt (0.0, dis, np, op)) {
+		case 0: /* ok */
+		    rp->rs_settm = np->n_mjd;
+		    rp->rs_setaz = op->s_az;
+		    set = 1;
+		    break;
+		case -1: /* obj_cir error */
+		    rp->rs_flags |= RS_SETERR;
+		    return;
+		case -2: /* converged but not today */ /* FALLTHRU */
+		case -3: /* probably circumpolar */
+		    rp->rs_flags |= RS_NOSET;
+		    return;
+		}
+	    }
+
+	    t0 = t1;
+	    a0 = a1;
+	}
+
+	/* instead of transit, for satellites we find time of maximum
+	 * altitude, if we know both the rise and set times and the former
+	 * occurs before the latter.
+	 */
+	if (rise && set && rp->rs_risetm < rp->rs_settm) {
+	    double tt, al;
+	    if (find_max (np, op, rp->rs_risetm, rp->rs_settm, &tt, &al) < 0) {
+		rp->rs_flags |= RS_TRANSERR;
+		return;
+	    }
+	    rp->rs_trantm = tt;
+	    rp->rs_tranalt = al;
+	} else
+	    rp->rs_flags |= RS_NOTRANS;
+
+	/* check for some bad conditions */
+	if (!rise) {
+	    if (a0 > 0)
+		rp->rs_flags |= RS_CIRCUMPOLAR;
+	    else
+		rp->rs_flags |= RS_NORISE;
+	}
+	if (!set) {
+	    if (a0 < 0)
+		rp->rs_flags |= RS_NEVERUP;
+	    else
+		rp->rs_flags |= RS_NOSET;
+	}
+}
+
+/* given a Now at noon and a dt from noon, in hours, for a first approximation
+ * to a rise or set event, refine the event by searching for when alt+dis = 0.
+ * return 0: if find one within 12 hours of noon with np and op set to the
+ *    better time and circumstances;
+ * return -1: if error from obj_cir;
+ * return -2: if converges but not today;
+ * return -3: if does not converge at all (probably circumpolar or never up);
+ */
+static int
+find_0alt (dt, dis, np, op)
+double dt;	/* hours from noon to first guess at event */
+double dis;	/* horizon displacement, rads */
+Now *np;	/* working Now -- starts with mjd is noon, returns as answer */
+Obj *op;	/* working object -- returns as answer */
+{
+#define	MAXPASSES	20		/* max iterations to try */
+#define	FIRSTSTEP	(1.0/60.0/24.0)	/* first time step, days */
+
+	double a0 = 0;
+	double mjdn = mjd;
+	int npasses;
+
+	/* insure initial guess is today -- if not, move by 24 hours */
+	if (dt < -12.0)
+	    dt += 24.0;
+	if (dt > 12.0)
+	    dt -= 24.0;
+	
+	/* convert dt to days for remainder of algorithm */
+	dt /= 24.0;
+
+	/* use secant method to look for s_alt + dis == 0 */
+	npasses = 0;
+	do {
+	    double a1;
+
+	    mjd += dt;
+	    if (obj_cir (np, op) < 0)
+		return (-1);
+	    a1 = op->s_alt;
+
+	    dt = (npasses == 0) ? FIRSTSTEP : (dis+a1)*dt/(a0-a1);
+	    a0 = a1;
+
+	} while (++npasses < MAXPASSES && fabs(dt) > TMACC);
+
+	/* return codes */
+	if (npasses == MAXPASSES)
+	    return (-3);
+	return (fabs(mjdn-mjd) < .5 ? 0 : -2);
+
+#undef	MAXPASSES
+#undef	FIRSTSTEP
+}
+
+/* find when the given object transits. start the search when LST matches the
+ *   object's RA at noon.
+ * if ok, return 0 with np and op set to the transit conditions; if can't
+ *   converge return -1; if converges ok but not today return -2.
+ * N.B. we assume np is passed set to local noon.
+ */
+static int
+find_transit (dt, np, op)
+double dt;
+Now *np;
+Obj *op;
+{
+#define	MAXLOOPS	10
+#define	MAXERR		(0.25/60.)		/* hours */
+	double mjdn = mjd;
+	double lst;
+	int i;
+
+	/* insure initial guess is today -- if not, move by 24 hours */
+	if (dt < -12.0)
+	    dt += 24.0;
+	if (dt > 12.0)
+	    dt -= 24.0;
+
+	i = 0;
+	do {
+	    mjd += dt/24.0;
+	    if (obj_cir (np, op) < 0)
+		return (-1);
+	    now_lst (np, &lst);
+	    dt = (radhr(op->s_gaera) - lst);
+	    if (dt < -12.0)
+		dt += 24.0;
+	    if (dt > 12.0)
+		dt -= 24.0;
+	} while (++i < MAXLOOPS && fabs(dt) > MAXERR);
+
+	/* return codes */
+	if (i == MAXLOOPS)
+	    return (-1);
+	return (fabs(mjd - mjdn) < 0.5 ? 0 : -2);
+
+#undef	MAXLOOPS
+#undef	MAXERR
+}
+
+/* find the mjd time of max altitude between the given rise and set times.
+ * N.B. we assume *np and *op are working copies we can mess up.
+ * N.B. we just assume max occurs at the center time.
+ * return 0 if ok, else -1.
+ */
+static int
+find_max (np, op, tr, ts, tp, alp)
+Now *np;
+Obj *op;
+double tr, ts;		/* times of rise and set */
+double *tp, *alp;	/* time of max altitude, and that altitude */
+{
+	mjd = (ts + tr)/2;
+	if (obj_cir (np, op) < 0)
+	    return (-1);
+	*tp = mjd;
+	*alp = op->s_alt;
+	return (0);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: riset_cir.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/satlib.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/satlib.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/satlib.h	(revision 1457)
@@ -0,0 +1,206 @@
+#ifndef __SATLIB_H
+#define __SATLIB_H
+
+/* $Id: satlib.h,v 1.1.1.1 2001-04-10 14:40:47 cmv Exp $ */
+
+typedef struct _SatElem {
+    float  se_XMO;
+    float  se_XNODEO;
+    float  se_OMEGAO;
+    float  se_EO;
+    float  se_XINCL;
+    float  se_XNDD60;
+    float  se_BSTAR;
+    float  pad1;
+    double se_XNO;
+    double se_XNDT20;
+    double se_EPOCH;
+    struct {
+	unsigned int catno	: 21;
+	unsigned int classif	: 5;
+	unsigned int elnum	: 10;
+	unsigned int year	: 14;
+	unsigned int launch	: 10;
+	unsigned int piece	: 15;
+	unsigned int ephtype	: 4;
+	unsigned int orbit	: 17;
+    } se_id;
+} SatElem;
+
+#if 0
+struct sat_loc {
+    double sl_X;
+    double sl_XDOT;
+    double sl_Y;
+    double sl_YDOT;
+    double sl_Z;
+    double sl_ZDOT;
+};
+#endif
+
+struct sgp4_data {
+    unsigned int sgp4_flags;
+    unsigned int pad;
+    double sgp4_AODP;
+    double sgp4_AYCOF;
+    double sgp4_C1;
+    double sgp4_C4;
+    double sgp4_C5;
+    double sgp4_COSIO;
+    double sgp4_D2;
+    double sgp4_D3;
+    double sgp4_D4;
+    double sgp4_DELMO;
+    double sgp4_ETA;
+    double sgp4_OMGCOF;
+    double sgp4_OMGDOT;
+    double sgp4_SINIO;
+    double sgp4_SINMO;
+    double sgp4_T2COF;
+    double sgp4_T3COF;
+    double sgp4_T4COF;
+    double sgp4_T5COF;
+    double sgp4_X1MTH2;
+    double sgp4_X3THM1;
+    double sgp4_X7THM1;
+    double sgp4_XLCOF;
+    double sgp4_XMCOF;
+    double sgp4_XMDOT;
+    double sgp4_XNODCF;
+    double sgp4_XNODOT;
+    double sgp4_XNODP;
+};
+
+struct deep_data {
+    struct {
+	unsigned int IRESFL : 1;
+	unsigned int ISYNFL : 1;
+    } deep_flags;
+    double deep_s_SINIQ;
+    double deep_s_COSIQ;
+    double deep_s_OMGDT;
+    double deep_ATIME;
+    double deep_D2201;
+    double deep_D2211;
+    double deep_D3210;
+    double deep_D3222;
+    double deep_D4410;
+    double deep_D4422;
+    double deep_D5220;
+    double deep_D5232;
+    double deep_D5421;
+    double deep_D5433;
+    double deep_DEL1;
+    double deep_DEL2;
+    double deep_DEL3;
+    double deep_E3;
+    double deep_EE2;
+    double deep_FASX2;
+    double deep_FASX4;
+    double deep_FASX6;
+    double deep_OMEGAQ;
+    double deep_PE;
+    double deep_PINC;
+    double deep_PL;
+    double deep_SAVTSN;
+    double deep_SE2;
+    double deep_SE3;
+    double deep_SGH2;
+    double deep_SGH3;
+    double deep_SGH4;
+    double deep_SGHL;
+    double deep_SGHS;
+    double deep_SH2;
+    double deep_SH3;
+    double deep_SHS;
+    double deep_SHL;
+    double deep_SI2;
+    double deep_SI3;
+    double deep_SL2;
+    double deep_SL3;
+    double deep_SL4;
+    double deep_SSE;
+    double deep_SSG;
+    double deep_SSH;
+    double deep_SSI;
+    double deep_SSL;
+    double deep_STEP2;
+    double deep_STEPN;
+    double deep_STEPP;
+    double deep_THGR;
+    double deep_XFACT;
+    double deep_XGH2;
+    double deep_XGH3;
+    double deep_XGH4;
+    double deep_XH2;
+    double deep_XH3;
+    double deep_XI2;
+    double deep_XI3;
+    double deep_XL2;
+    double deep_XL3;
+    double deep_XL4;
+    double deep_XLAMO;
+    double deep_XLI;
+    double deep_XNI;
+    double deep_XNQ;
+    double deep_XQNCL;
+    double deep_ZMOL;
+    double deep_ZMOS;
+};
+
+struct sdp4_data {
+    double sdp4_AODP;	/* dpa */
+    double sdp4_AYCOF;
+    double sdp4_BETAO;	/* dpa */
+    double sdp4_BETAO2;	/* dpa */
+    double sdp4_C1;
+    double sdp4_C4;
+    double sdp4_COSG;	/* dpa */
+    double sdp4_COSIO;	/* dpa */
+    double sdp4_EOSQ;	/* dpa */
+    double sdp4_OMGDOT;	/* dpa */
+    double sdp4_SING;	/* dpa */
+    double sdp4_SINIO;	/* dpa */
+    double sdp4_T2COF;
+    double sdp4_THETA2;	/* dpa */
+    double sdp4_X1MTH2;
+    double sdp4_X3THM1;
+    double sdp4_X7THM1;
+    double sdp4_XLCOF;
+    double sdp4_XMDOT;	/* dpa */
+    double sdp4_XNODCF;
+    double sdp4_XNODOT;	/* dpa */
+    double sdp4_XNODP;	/* dpa */
+
+    double sdp4_XMDF_seco;
+    double sdp4_OMGADF_seco;
+    double sdp4_XNODE_seco;
+    double sdp4_EM_seco;
+    double sdp4_XINC_seco;
+    double sdp4_XN_seco;
+
+    double sdp4_E_pero;
+    double sdp4_XINC_pero;
+    double sdp4_OMGADF_pero;
+    double sdp4_XNODE_pero;
+    double sdp4_XMAM_pero;
+};
+
+typedef struct _SatData {
+    struct _SatElem *elem;
+    union {
+	struct sgp4_data *sgp4;
+	struct sdp4_data *sdp4;
+    } prop;
+    struct deep_data *deep;
+} SatData;
+
+void sgp4(SatData *sat, Vec3 *pos, Vec3 *dpos, double t);
+
+void sdp4(SatData *sat, Vec3 *pos, Vec3 *dpos, double TSINCE);
+
+#endif /* __SATLIB_H */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: satlib.h,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/satspec.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/satspec.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/satspec.h	(revision 1457)
@@ -0,0 +1,43 @@
+#ifndef __SATSPEC_H
+#define __SATSPEC_H
+
+/* $Id: satspec.h,v 1.1.1.1 2001-04-10 14:40:47 cmv Exp $ */
+
+#include "sattypes.h"
+#include "satlib.h"
+
+#define SGP4_SIMPLE	0x00000001
+
+extern void init_deep(struct deep_data *deep);
+void init_sdp4(struct sdp4_data *sdp);
+char *tleerr(int);
+int readtle(char *, char *, SatElem *);
+
+double current_jd();
+
+double ut1_to_gha(double);
+
+void smallsleep(double t);
+
+double epoch_jd(double);
+
+double actan(double sinx, double cosx);
+
+double thetag(double EP, double *DS50);
+
+void dpinit(SatData *sat, double EQSQ, double SINIQ, double COSIQ,
+	    double RTEQSQ, double AO, double COSQ2, double SINOMO,
+	    double COSOMO, double BSQ, double XLLDOT, double OMGDT,
+	    double XNODOT, double XNODP);
+
+void dpsec(SatData *sat, double *XLL, double *OMGASM, double *XNODES,
+	   double *EM, double *XINC, double *XN, double T);
+
+void dpper(SatData *sat, double *EM, double *XINC, double *OMGASM,
+	   double *XNODES, double *XLL, double T);
+
+#endif /* __SATSPEC_H */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: satspec.h,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/sattypes.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/sattypes.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/sattypes.h	(revision 1457)
@@ -0,0 +1,28 @@
+#ifndef __SATTYPES_H
+#define __SATTYPES_H
+
+/* $Id: sattypes.h,v 1.1.1.1 2001-04-10 14:40:47 cmv Exp $ */
+
+typedef struct _Vec3 {
+    double x, y, z;
+} Vec3;
+
+
+typedef struct _LookAngle {
+    double az;
+    double el;
+    double r;
+} LookAngle;
+
+
+typedef struct _Geoloc {
+    double lt;
+    double ln;
+    double h;
+} GeoLoc;
+
+#endif /* __SATTYPES_H */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: sattypes.h,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/sdp4.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/sdp4.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/sdp4.c	(revision 1457)
@@ -0,0 +1,434 @@
+#include <stdlib.h>
+#include <math.h>
+#undef SING
+
+#include "sattypes.h"
+#include "vector.h"
+#include "satspec.h"
+
+/*      SDP4                                               3 NOV 80 */
+/*      SUBROUTINE SDP4(IFLAG,TSINCE)
+      COMMON/E1/XMO,XNODEO,OMEGAO,EO,XINCL,XNO,XNDT2O,
+     1           XNDD6O,BSTAR,X,Y,Z,XDOT,YDOT,ZDOT,EPOCH,DS50
+      COMMON/C1/CK2,CK4,E6A,QOMS2T,S,TOTHRD,
+     1           XJ3,XKE,XKMPER,XMNPDA,AE
+      DOUBLE PRECISION EPOCH, DS50
+      */
+
+#define XMO	(sat->elem->se_XMO)
+#define XNODEO	(sat->elem->se_XNODEO)
+#define OMEGAO	(sat->elem->se_OMEGAO)
+#define EO	(sat->elem->se_EO)
+#define XINCL	(sat->elem->se_XINCL)
+#define XNO	(sat->elem->se_XNO)
+#define XNDT20	(sat->elem->se_XNDT20)
+#define XNDD60	(sat->elem->se_XNDD60)
+#define BSTAR	(sat->elem->se_BSTAR)
+#define EPOCH	(sat->elem->se_EPOCH)
+
+#define CK2	(5.413080e-04)
+#define CK4	(6.209887e-07)
+#define QOMS2T	(1.880279e-09)
+#define S	(1.012229e+00)
+
+#define AE (1.0)
+#define DE2RA (.174532925E-1)
+#define E6A (1.E-6)
+#define PI (3.14159265)
+#define PIO2 (1.57079633)
+#define QO (120.0)
+#define SO (78.0)
+#define TOTHRD (.66666667)
+#define TWOPI (6.2831853)
+#define X3PIO2 (4.71238898)
+#define XJ2 (1.082616E-3)
+#define XJ3 (-.253881E-5)
+#define XJ4 (-1.65597E-6)
+#define XKE (.743669161E-1)
+#define XKMPER (6378.135)
+#define XMNPDA (1440.)
+
+/* int IFLAG; */
+
+#define X	(pos->sl_X)
+#define XDOT	(pos->sl_XDOT)
+#define Y	(pos->sl_Y)
+#define YDOT	(pos->sl_YDOT)
+#define Z	(pos->sl_Z)
+#define ZDOT	(pos->sl_ZDOT)
+
+/* sat->prop.sdp4-> */
+#define AODP	(sat->prop.sdp4->sdp4_AODP)
+#define AYCOF	(sat->prop.sdp4->sdp4_AYCOF)
+#define BETAO	(sat->prop.sdp4->sdp4_BETAO)
+#define BETAO2	(sat->prop.sdp4->sdp4_BETAO2)
+#define C1	(sat->prop.sdp4->sdp4_C1)
+#define C4	(sat->prop.sdp4->sdp4_C4)
+#define COSG	(sat->prop.sdp4->sdp4_COSG)
+#define COSIO	(sat->prop.sdp4->sdp4_COSIO)
+#define EOSQ	(sat->prop.sdp4->sdp4_EOSQ)
+#define OMGDOT	(sat->prop.sdp4->sdp4_OMGDOT)
+#define SING	(sat->prop.sdp4->sdp4_SING)
+#define SINIO	(sat->prop.sdp4->sdp4_SINIO)
+#define T2COF	(sat->prop.sdp4->sdp4_T2COF)
+#define THETA2	(sat->prop.sdp4->sdp4_THETA2)
+#define X1MTH2	(sat->prop.sdp4->sdp4_X1MTH2)
+#define X3THM1	(sat->prop.sdp4->sdp4_X3THM1)
+#define X7THM1	(sat->prop.sdp4->sdp4_X7THM1)
+#define XLCOF	(sat->prop.sdp4->sdp4_XLCOF)
+#define XMDOT	(sat->prop.sdp4->sdp4_XMDOT)
+#define XNODCF	(sat->prop.sdp4->sdp4_XNODCF)
+#define XNODOT	(sat->prop.sdp4->sdp4_XNODOT)
+#define XNODP	(sat->prop.sdp4->sdp4_XNODP)
+
+#define XMDF_seco   (sat->prop.sdp4->sdp4_XMDF_seco)
+#define OMGADF_seco (sat->prop.sdp4->sdp4_OMGADF_seco)
+#define XNODE_seco  (sat->prop.sdp4->sdp4_XNODE_seco)
+#define EM_seco     (sat->prop.sdp4->sdp4_EM_seco)
+#define XINC_seco   (sat->prop.sdp4->sdp4_XINC_seco)
+#define XN_seco     (sat->prop.sdp4->sdp4_XN_seco)
+
+#define E_pero      (sat->prop.sdp4->sdp4_E_pero)
+#define XINC_pero   (sat->prop.sdp4->sdp4_XINC_pero)
+#define OMGADF_pero (sat->prop.sdp4->sdp4_OMGADF_pero)
+#define XNODE_pero  (sat->prop.sdp4->sdp4_XNODE_pero)
+#define XMAM_pero   (sat->prop.sdp4->sdp4_XMAM_pero)
+
+void
+sdp4 (sat, pos, dpos, TSINCE)
+SatData *sat;
+Vec3 *pos;
+Vec3 *dpos;
+double TSINCE;
+{
+    int i;
+
+    /* private temporary variables used only in init section */
+    double A1,A3OVK2,AO,C2,COEF,COEF1,DEL1,DELO,EETA,ETA,
+	ETASQ,PERIGE,PINVSQ,PSISQ,QOMS24,S4,THETA4,TSI,X1M5TH,XHDOT1;
+
+    /* private temporary variables */
+    double A,AXN,AYN,AYNL,BETA,BETAL,CAPU,COS2U,COSEPW,
+	COSIK,COSNOK,COSU,COSUK,E,ECOSE,ELSQ,EM,EPW,ESINE,OMGADF,PL,
+	R,RDOT,RDOTK,RFDOT,RFDOTK,RK,SIN2U,SINEPW,SINIK,SINNOK,
+	SINU,SINUK,TEMP,TEMP1,TEMP2,TEMP3,TEMP4,TEMP5,TEMP6,TEMPA,
+	TEMPE,TEMPL,TSQ,U,UK,UX,UY,UZ,VX,VY,VZ,XINC,XINCK,XL,XLL,XLT,
+	XMAM,XMDF,XMX,XMY,XN,XNODDF,XNODE,XNODEK;
+
+#if 0
+    A1=A3OVK2=AO=C2=COEF=COEF1=DEL1=DELO=EETA=ETA = signaling_nan();
+    ETASQ=PERIGE=PINVSQ=PSISQ=QOMS24=S4=THETA4=TSI=X1M5TH=XHDOT1 = signaling_nan();
+
+     A=AXN=AYN=AYNL=BETA=BETAL=CAPU=COS2U=COSEPW = signaling_nan();
+     COSIK=COSNOK=COSU=COSUK=E=ECOSE=ELSQ=EM=EPW=ESINE=OMGADF=PL = signaling_nan();
+     R=RDOT=RDOTK=RFDOT=RFDOTK=RK=SIN2U=SINEPW=SINIK=SINNOK = signaling_nan();
+     SINU=SINUK=TEMP=TEMP1=TEMP2=TEMP3=TEMP4=TEMP5=TEMP6=TEMPA = signaling_nan();
+     TEMPE=TEMPL=TSQ=U=UK=UX=UY=UZ=VX=VY=VZ=XINC=XINCK=XL=XLL=XLT = signaling_nan();
+     XMAM=XMDF=XMX=XMY=XN=XNODDF=XNODE=XNODEK = signaling_nan();
+#endif
+
+    if(TSINCE != 0.0 && !sat->prop.sdp4) {
+	/*
+	 * Yes, this is a recursive call.
+	 */
+	sdp4(sat, pos, dpos, 0.0);
+    }
+
+/*      IF  (IFLAG .EQ. 0) GO TO 100 */
+/*    if(!IFLAG) */
+    if(!sat->prop.sdp4) {
+	sat->prop.sdp4 = (struct sdp4_data *) malloc(sizeof(struct sdp4_data));
+
+/*	init_sdp4(sat->prop.sdp4); */
+
+/*      RECOVER ORIGINAL MEAN MOTION (XNODP) AND SEMIMAJOR AXIS (AODP) */
+/*      FROM INPUT ELEMENTS */
+
+	A1=pow((XKE/XNO), TOTHRD);
+	COSIO=cos(XINCL);
+	THETA2=COSIO*COSIO;
+	X3THM1=3.0 * THETA2 - 1.0;
+	EOSQ = EO * EO;
+	BETAO2 = 1.0 - EOSQ;
+	BETAO = sqrt(BETAO2);
+	DEL1 = 1.5 * CK2 * X3THM1 / (A1 * A1 * BETAO * BETAO2);
+	AO = A1 * (1.0 - DEL1 * (0.5 * TOTHRD +
+				DEL1 * (1.0 + 134.0 / 81.0 * DEL1)));
+	DELO = 1.5 * CK2 * X3THM1 / (AO * AO * BETAO * BETAO2);
+	XNODP = XNO / (1.0 + DELO);
+	AODP = AO / (1.0 - DELO);
+
+/*      INITIALIZATION */
+
+/*      FOR PERIGEE BELOW 156 KM, THE VALUES OF
+*      S AND QOMS2T ARE ALTERED */
+
+	S4 = S;
+	QOMS24 = QOMS2T;
+	PERIGE = (AODP * (1.0 - EO) - AE) * XKMPER;
+
+/*      IF(PERIGE .GE. 156.) GO TO 10 */
+
+	if(PERIGE < 156.0) {
+	    S4 = PERIGE - 78.0;
+
+	    if(PERIGE <= 98.0)  { /* GO TO 9 */
+		S4 = 20.0;
+	    }
+
+	    QOMS24 = pow((120.0 - S4) * AE / XKMPER, 4.0); /* 9 */
+	    S4 = S4 / XKMPER + AE;
+	}
+	PINVSQ = 1.0 / (AODP * AODP * BETAO2 * BETAO2); /* 10 */
+	SING = sin(OMEGAO);
+	COSG = cos(OMEGAO);
+	TSI = 1.0 / (AODP - S4);
+	ETA = AODP * EO * TSI;
+	ETASQ = ETA * ETA;
+	EETA = EO * ETA;
+	PSISQ = fabs(1.0 - ETASQ);
+	COEF = QOMS24 * pow(TSI, 4.0);
+	COEF1 = COEF / pow(PSISQ, 3.5);
+	C2 = COEF1 * XNODP * (AODP * (1.0 + 1.5 * ETASQ +
+				      EETA * (4.0 + ETASQ)) +
+			      .75 * CK2 * TSI / PSISQ * X3THM1 *
+			      (8.0 + 3.0 * ETASQ * (8.0 + ETASQ)));
+	C1 = BSTAR * C2;
+	SINIO = sin(XINCL);
+	A3OVK2 = -XJ3 / CK2 * AE * AE * AE; /* A3OVK2=-XJ3/CK2*AE**3; */
+	X1MTH2 = 1.0 - THETA2;
+	C4 = 2.0 * XNODP * COEF1 * AODP * BETAO2 *
+	    (ETA * (2.0 + .5 * ETASQ) + EO * (.5 + 2.0 * ETASQ) -
+	     2.0 * CK2 * TSI / (AODP * PSISQ) *
+	     (-3.0 * X3THM1 * (1.0 - 2.0 * EETA + ETASQ *
+			       (1.5 - .5 * EETA)) +
+	      .75 * X1MTH2 * (2.0 * ETASQ - EETA *
+			      (1.0 + ETASQ)) * cos(2.0 * OMEGAO)));
+	THETA4 = THETA2 * THETA2;
+	TEMP1 = 3.0 * CK2 * PINVSQ * XNODP;
+	TEMP2 = TEMP1 * CK2 * PINVSQ;
+	TEMP3 = 1.25 * CK4 * PINVSQ * PINVSQ * XNODP;
+	XMDOT = XNODP + 0.5 * TEMP1 * BETAO * X3THM1 + .0625 * TEMP2 * BETAO *
+	    (13.0 - 78.0 * THETA2 + 137.0 * THETA4);
+	X1M5TH=1.0 - 5.0 * THETA2;
+	OMGDOT = -.5 * TEMP1 * X1M5TH + .0625 * TEMP2 * 
+	    (7.0 - 114.0 * THETA2 + 395.0 * THETA4) +
+	    TEMP3 * (3.0 - 36.0 * THETA2 + 49.0 * THETA4);
+	XHDOT1 = -TEMP1 * COSIO;
+	XNODOT = XHDOT1 + (.5 * TEMP2 * (4.0 - 19.0 * THETA2) +
+			   2.0 * TEMP3 * (3.0 - 7.0 * THETA2)) * COSIO;
+	XNODCF = 3.5 * BETAO2 * XHDOT1 * C1;
+	T2COF = 1.5 * C1;
+	XLCOF = .125 * A3OVK2 * SINIO * (3.0 + 5.0 * COSIO) / (1.0 + COSIO);
+	AYCOF = .25 * A3OVK2 * SINIO;
+	X7THM1 = 7.0 * THETA2 - 1.0;
+/*   90 IFLAG=0 */
+
+#ifdef SDP_DEEP_DEBUG
+	printf("calling dpinit\n");
+	printf("%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n",
+	       EOSQ,SINIO,COSIO,BETAO,AODP,THETA2,
+	       SING,COSG,BETAO2,XMDOT,OMGDOT,XNODOT,XNODP);
+#endif
+	dpinit(sat, EOSQ, SINIO, COSIO, BETAO, AODP, THETA2,
+	       SING, COSG, BETAO2, XMDOT, OMGDOT, XNODOT, XNODP);
+
+/*      CALL DPINIT(EOSQ,SINIO,COSIO,BETAO,AODP,THETA2,
+	1         SING,COSG,BETAO2,XMDOT,OMGDOT,XNODOT,XNODP) */
+
+/*      UPDATE FOR SECULAR GRAVITY AND ATMOSPHERIC DRAG */
+    }
+
+    XMDF = XMO + XMDOT * TSINCE; /* 100 */
+    OMGADF = OMEGAO + OMGDOT * TSINCE;
+    XNODDF = XNODEO + XNODOT * TSINCE;
+    TSQ = TSINCE * TSINCE;
+    XNODE = XNODDF + XNODCF * TSQ;
+    TEMPA = 1.0 - C1 * TSINCE;
+    TEMPE = BSTAR * C4 * TSINCE;
+    TEMPL = T2COF * TSQ;
+    XN = XNODP;
+
+    if(TSINCE == 0.0) {
+	XMDF_seco   = XMDF;
+	OMGADF_seco = OMGADF;
+	XNODE_seco  = XNODE;
+	EM_seco     = EM;
+	XINC_seco   = XINC;
+	XN_seco     = XN;
+    }
+
+    dpsec(sat, &XMDF, &OMGADF, &XNODE, &EM, &XINC, &XN, TSINCE);
+
+    if(TSINCE == 0.0) {
+	XMDF_seco   = XMDF - XMDF_seco;
+	OMGADF_seco = OMGADF - OMGADF_seco;
+	XNODE_seco  = XNODE - XNODE_seco;
+	EM_seco     = EM - EM_seco;
+	XINC_seco   = XINC - XINC_seco;
+	XN_seco     = XN - XN_seco;
+
+#if 0
+	printf("XMDF_seco   = %e\n", XMDF_seco);
+	printf("OMGADF_seco = %e\n", OMGADF_seco);
+	printf("XNODE_seco  = %e\n", XNODE_seco);
+	printf("EM_seco     = %e\n", EM_seco);
+	printf("XINC_seco   = %e\n", XINC_seco);
+	printf("XN_seco     = %e\n", XN_seco);
+#endif
+    }
+
+    /*
+    XMDF   -= XMDF_seco;
+    OMGADF -= OMGADF_seco;
+    XNODE  -= XNODE_seco;
+    EM     -= EM_seco;
+    XINC   -= XINC_seco;
+    XN     -= XN_seco;
+    */
+
+    A = pow(XKE/XN, TOTHRD) * TEMPA * TEMPA;
+    E = EM - TEMPE;
+#ifdef SDP_DEEP_DEBUG
+    printf("*** E = %f\n", E);
+#endif
+    XMAM = XMDF + XNODP * TEMPL;
+/*      CALL DPPER(E,XINC,OMGADF,XNODE,XMAM) */
+
+#ifdef SDP_DEEP_DEBUG
+    printf("%12s %12s %12s %12s %12s\n",
+	   "E", "XINC", "OMGADF", "XNODE", "XMAM");
+    printf("%12f %12f %12f %12f %12f\n",
+	   E, XINC, OMGADF, XNODE, XMAM);
+#endif
+
+    if(TSINCE == 0.0) {
+	E_pero      = E;
+	XINC_pero   = XINC;
+	OMGADF_pero = OMGADF;
+	XNODE_pero  = XNODE;
+	XMAM_pero   = XMAM;
+    }
+
+    dpper(sat, &E, &XINC, &OMGADF, &XNODE, &XMAM, TSINCE);
+
+    if(TSINCE == 0.0) {
+	E_pero      = E - E_pero;
+	XINC_pero   = XINC - XINC_pero;
+	OMGADF_pero = OMGADF - OMGADF_pero;
+	XNODE_pero  = XNODE - XNODE_pero;
+	XMAM_pero   = XMAM - XMAM_pero;
+
+#if 0
+	printf("E_pero      = %e\n", E_pero);
+	printf("XINC_pero   = %e\n", XINC_pero);
+	printf("OMGADF_pero = %e\n", OMGADF_pero);
+	printf("XNODE_pero  = %e\n", XNODE_pero);
+	printf("XMAM_pero   = %e\n\n", XMAM_pero);
+#endif
+    }
+
+    /*
+    E      -= E_pero;
+    XINC   -= XINC_pero;
+    OMGADF -= OMGADF_pero;
+    XNODE  -= XNODE_pero;
+    XMAM   -= XMAM_pero;
+    */
+    XL = XMAM + OMGADF + XNODE;
+    BETA = sqrt(1.0 - E * E);
+    XN = XKE / pow(A, 1.5);
+
+/*      LONG PERIOD PERIODICS */
+
+    AXN = E * cos(OMGADF);
+    TEMP=1./(A*BETA*BETA);
+    XLL=TEMP*XLCOF*AXN;
+    AYNL=TEMP*AYCOF;
+    XLT=XL+XLL;
+    AYN=E*sin(OMGADF)+AYNL;
+
+/*      SOLVE KEPLERS EQUATION */
+
+    CAPU=fmod(XLT-XNODE, TWOPI);
+    TEMP2=CAPU;
+/*      DO 130 I=1,10*/
+    for(i = 1; i < 10; i++) {
+	SINEPW=sin(TEMP2);
+      COSEPW=cos(TEMP2);
+      TEMP3=AXN*SINEPW;
+      TEMP4=AYN*COSEPW;
+      TEMP5=AXN*COSEPW;
+      TEMP6=AYN*SINEPW;
+      EPW=(CAPU-TEMP4+TEMP3-TEMP2)/(1.-TEMP5-TEMP6)+TEMP2;
+/*      IF(ABS(EPW-TEMP2) .LE. E6A) GO TO 140 */
+      if(fabs(EPW-TEMP2) <= E6A)
+	  break;
+      TEMP2=EPW; /* 130 */
+    }
+
+/*      SHORT PERIOD PRELIMINARY QUANTITIES */
+
+    ECOSE=TEMP5+TEMP6; /* 140  */
+    ESINE=TEMP3-TEMP4;
+    ELSQ=AXN*AXN+AYN*AYN;
+    TEMP=1.-ELSQ;
+    PL=A*TEMP;
+    R=A*(1.-ECOSE);
+    TEMP1=1./R;
+    RDOT=XKE*sqrt(A)*ESINE*TEMP1;
+    RFDOT=XKE*sqrt(PL)*TEMP1;
+    TEMP2=A*TEMP1;
+    BETAL=sqrt(TEMP);
+    TEMP3=1./(1.+BETAL);
+    COSU=TEMP2*(COSEPW-AXN+AYN*ESINE*TEMP3);
+    SINU=TEMP2*(SINEPW-AYN-AXN*ESINE*TEMP3);
+    U=actan(SINU,COSU);
+    SIN2U=2.*SINU*COSU;
+    COS2U=2.*COSU*COSU-1.0;
+    TEMP=1./PL;
+    TEMP1=CK2*TEMP;
+    TEMP2=TEMP1*TEMP;
+
+/*      UPDATE FOR SHORT PERIODICS */
+
+    RK=R*(1.-1.5*TEMP2*BETAL*X3THM1)+.5*TEMP1*X1MTH2*COS2U;
+    UK=U - .25 * TEMP2 * X7THM1 * SIN2U;
+    XNODEK=XNODE+1.5*TEMP2*COSIO*SIN2U;
+    XINCK=XINC+1.5*TEMP2*COSIO*SINIO*COS2U;
+    RDOTK=RDOT-XN*TEMP1*X1MTH2*SIN2U;
+    RFDOTK=RFDOT+XN*TEMP1*(X1MTH2*COS2U+1.5*X3THM1);
+
+/*      ORIENTATION VECTORS */
+    SINUK=sin(UK);
+    COSUK=cos(UK);
+    SINIK=sin(XINCK);
+    COSIK=cos(XINCK);
+    SINNOK=sin(XNODEK);
+    COSNOK=cos(XNODEK);
+    XMX=-SINNOK*COSIK;
+    XMY=COSNOK*COSIK;
+    UX=XMX*SINUK+COSNOK*COSUK;
+    UY=XMY*SINUK+SINNOK*COSUK;
+    UZ=SINIK*SINUK;
+    VX=XMX*COSUK-COSNOK*SINUK;
+    VY=XMY*COSUK-SINNOK*SINUK;
+    VZ=SINIK*COSUK;
+#if 0
+    printf("UX = %f VX = %f RK = %f RDOTK = %f RFDOTK = %f\n",
+	   UX, VX, RK, RDOTK, RFDOTK);
+#endif
+/*      POSITION AND VELOCITY */
+
+    pos->x = RK*UX;
+    pos->y = RK*UY;
+    pos->z = RK*UZ;
+    dpos->x = RDOTK*UX+RFDOTK*VX;
+    dpos->y = RDOTK*UY+RFDOTK*VY;
+    dpos->z = RDOTK*UZ+RFDOTK*VZ;
+/*      RETURN
+      END */
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sdp4.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/sgp4.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/sgp4.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/sgp4.c	(revision 1457)
@@ -0,0 +1,405 @@
+#include <stdlib.h>
+#include <math.h>
+
+#include "sattypes.h"
+#include "vector.h"
+#include "satspec.h"
+
+#define XMO (sat->elem->se_XMO)
+#define XNODEO (sat->elem->se_XNODEO)
+#define OMEGAO (sat->elem->se_OMEGAO)
+#define EO (sat->elem->se_EO)
+#define XINCL (sat->elem->se_XINCL)
+#define XNO (sat->elem->se_XNO)
+#define XNDT20 (sat->elem->se_XNDT20)
+#define XNDD60 (sat->elem->se_XNDD60)
+#define BSTAR (sat->elem->se_BSTAR)
+#define EPOCH (sat->elem->se_EPOCH)
+
+#define X (pos->sl_X)
+#define XDOT (pos->sl_XDOT)
+#define Y (pos->sl_Y)
+#define YDOT (pos->sl_YDOT)
+#define Z (pos->sl_Z)
+#define ZDOT (pos->sl_ZDOT)
+
+#define AODP (sat->prop.sgp4->sgp4_AODP)
+#define AYCOF (sat->prop.sgp4->sgp4_AYCOF)
+#define C1 (sat->prop.sgp4->sgp4_C1)
+#define C4 (sat->prop.sgp4->sgp4_C4)
+#define C5 (sat->prop.sgp4->sgp4_C5)
+#define COSIO (sat->prop.sgp4->sgp4_COSIO)
+#define D2 (sat->prop.sgp4->sgp4_D2)
+#define D3 (sat->prop.sgp4->sgp4_D3)
+#define D4 (sat->prop.sgp4->sgp4_D4)
+#define DELMO (sat->prop.sgp4->sgp4_DELMO)
+#define ETA (sat->prop.sgp4->sgp4_ETA)
+#define OMGCOF (sat->prop.sgp4->sgp4_OMGCOF)
+#define OMGDOT (sat->prop.sgp4->sgp4_OMGDOT)
+#define SINIO (sat->prop.sgp4->sgp4_SINIO)
+#define SINMO (sat->prop.sgp4->sgp4_SINMO)
+#define T2COF (sat->prop.sgp4->sgp4_T2COF)
+#define T3COF (sat->prop.sgp4->sgp4_T3COF)
+#define T4COF (sat->prop.sgp4->sgp4_T4COF)
+#define T5COF (sat->prop.sgp4->sgp4_T5COF)
+#define X1MTH2 (sat->prop.sgp4->sgp4_X1MTH2)
+#define X3THM1 (sat->prop.sgp4->sgp4_X3THM1)
+#define X7THM1 (sat->prop.sgp4->sgp4_X7THM1)
+#define XLCOF (sat->prop.sgp4->sgp4_XLCOF)
+#define XMCOF (sat->prop.sgp4->sgp4_XMCOF)
+#define XMDOT (sat->prop.sgp4->sgp4_XMDOT)
+#define XNODCF (sat->prop.sgp4->sgp4_XNODCF)
+#define XNODOT (sat->prop.sgp4->sgp4_XNODOT)
+#define XNODP (sat->prop.sgp4->sgp4_XNODP)
+
+#define CK2	 (5.413080e-04)
+#define CK4	 (6.209887e-07)
+#define QOMS2T	 (1.880279e-09)
+#define S	 (1.012229e+00)
+
+#define AE (1.0)
+#define DE2RA (.174532925E-1)
+#define E6A (1.E-6)
+#define PI (3.14159265)
+#define PIO2 (1.57079633)
+#define QO (120.0)
+#define SO (78.0)
+#define TOTHRD (.66666667)
+#define TWOPI (6.2831853)
+#define X3PIO2 (4.71238898)
+#define XJ2 (1.082616E-3)
+#define XJ3 (-.253881E-5)
+#define XJ4 (-1.65597E-6)
+#define XKE (.743669161E-1)
+#define XKMPER (6378.135)
+#define XMNPDA (1440.0)
+
+/* compute position and velocity vectors for the satellite defined in sat->elem
+ * at its epoch + TSINCE.
+ */
+void
+sgp4(sat, pos, dpos, TSINCE)
+SatData *sat;
+Vec3 *pos;
+Vec3 *dpos;
+double TSINCE;
+{
+    int i;
+
+    double A1, A3OVK2, AO, BETAO, BETAO2, C1SQ, C2, C3, COEF, COEF1,
+	DEL1, DELO, EETA, EOSQ, ETASQ, PERIGE, PINVSQ, PSISQ, QOMS24,
+	S4, TEMP, TEMP1, TEMP2, TEMP3, THETA2, THETA4, TSI, X1M5TH,
+	XHDOT1;
+
+    double A, AXN, AYN, AYNL, BETA, BETAL, CAPU, COS2U, COSEPW, COSIK,
+	COSNOK, COSU, COSUK, DELM, DELOMG, E, ECOSE, ELSQ, EPW, ESINE,
+	OMEGA, OMGADF, PL, R, RDOT, RDOTK, RFDOT, RFDOTK, RK, SIN2U,
+	SINEPW, SINIK, SINNOK, SINU, SINUK, TCUBE, TEMP4, TEMP5, TEMP6,
+	TEMPA, TEMPE, TEMPL, TFOUR, TSQ, U, UK, UX, UY, UZ, VX, VY, VZ,
+	XINCK, XL, XLL, XLT, XMDF, XMP, XMX, XMY, XN, XNODDF, XNODE,
+	XNODEK;
+
+#if 0
+    A1 = A3OVK2 = AO = BETAO = BETAO2 = C1SQ = C2 = C3 = COEF = COEF1 =
+	DEL1 = DELO = EETA = EOSQ = ETASQ = PERIGE = PINVSQ = PSISQ = QOMS24 =
+	S4 = TEMP = TEMP1 = TEMP2 = TEMP3 = THETA2 = THETA4 = TSI = X1M5TH =
+	XHDOT1 = signaling_nan();
+
+    A = AXN = AYN = AYNL = BETA = BETAL = CAPU = COS2U = COSEPW = COSIK =
+	COSNOK = COSU = COSUK = DELM = DELOMG = E = ECOSE = ELSQ = EPW =
+	ESINE =	OMEGA = OMGADF = PL = R = RDOT = RDOTK = RFDOT = RFDOTK =
+	RK = SIN2U = SINEPW = SINIK = SINNOK = SINU = SINUK = TCUBE = TEMP4 =
+	TEMP5 = TEMP6 =	TEMPA = TEMPE = TEMPL = TFOUR = TSQ = U = UK = UX =
+	UY = UZ = VX = VY = VZ = XINCK = XL = XLL = XLT = XMDF = XMP = XMX =
+	XMY = XN = XNODDF = XNODE = XNODEK = signaling_nan();
+#endif
+
+    if(!sat->prop.sgp4) {
+	sat->prop.sgp4 = (struct sgp4_data *) malloc(sizeof(struct sgp4_data));
+
+	/*
+	 * RECOVER ORIGINAL MEAN MOTION (XNODP) AND SEMIMAJOR AXIS (AODP)
+	 * FROM INPUT ELEMENTS
+	 */
+
+	A1 = pow((XKE/XNO), TOTHRD);
+	COSIO = cos(XINCL);
+	THETA2 = COSIO * COSIO;
+	X3THM1 = 3.0 * THETA2 - 1.0;
+	EOSQ = EO * EO;
+	BETAO2 = 1.0 - EOSQ;
+	BETAO = sqrt(BETAO2);
+	DEL1 = 1.5 * CK2 * X3THM1 / (A1 * A1 * BETAO * BETAO2);
+	AO = A1 * (1.0 - DEL1 * (.5 * TOTHRD +
+				 DEL1 * (1.0 + 134.0 /81.0 * DEL1)));
+	DELO = 1.5 * CK2 * X3THM1 / (AO * AO * BETAO * BETAO2);
+	XNODP = XNO / (1.0 + DELO);
+	AODP=AO / (1.0 - DELO);
+
+	/*
+	 * INITIALIZATION
+	 *
+	 * FOR PERIGEE LESS THAN 220 KILOMETERS, THE ISIMP FLAG IS SET AND
+	 * THE EQUATIONS ARE TRUNCATED TO LINEAR VARIATION IN SQRT A AND
+	 * QUADRATIC VARIATION IN MEAN ANOMALY.  ALSO, THE C3 TERM, THE
+	 * DELTA OMEGA TERM, AND THE DELTA M TERM ARE DROPPED.
+	 */
+
+	sat->prop.sgp4->sgp4_flags = 0;
+
+	/* IF((AODP*(1.-EO)/AE) .LT. (220./XKMPER+AE)) ISIMP=1 */
+
+	if((AODP * (1.0 - EO) / AE) < (220.0 / XKMPER + AE))
+	    sat->prop.sgp4->sgp4_flags |= SGP4_SIMPLE;
+
+	/*
+	 * FOR PERIGEE BELOW 156 KM, THE VALUES OF
+	 * S AND QOMS2T ARE ALTERED
+	 */
+
+	S4 = S;
+	QOMS24 = QOMS2T;
+	PERIGE = (AODP * (1.0 - EO) - AE) * XKMPER;
+
+	if(PERIGE < 156.0) {
+	    S4 = PERIGE - 78.0;
+
+	    if(PERIGE <= 98.0)
+		S4 = 20.0;
+
+	    QOMS24 = pow(((120.0 - S4) * AE / XKMPER), 4.0);
+	    S4 = S4 / XKMPER + AE;
+	}
+
+	PINVSQ=1.0 / (AODP * AODP * BETAO2 * BETAO2);
+	TSI = 1.0 / (AODP - S4);
+	ETA = AODP * EO * TSI;
+	ETASQ = ETA * ETA;
+	EETA = EO * ETA;
+
+	PSISQ = fabs(1.0 - ETASQ);
+
+	COEF = QOMS24 * pow(TSI, 4.0);
+	COEF1 = COEF / pow(PSISQ, 3.5);
+
+	C2 = COEF1 * XNODP * (AODP * (1.0 + 1.5 * ETASQ +
+				      EETA * (4.0 + ETASQ)) + .75 *
+			      CK2 * TSI /
+			      PSISQ * X3THM1 * (8.0 +
+						3.0 * ETASQ * (8.0 + ETASQ)));
+
+
+	C1 = BSTAR * C2;
+
+	SINIO = sin(XINCL);
+
+	A3OVK2 = -XJ3 / CK2 * pow(AE, 3.0);
+
+	C3 = COEF * TSI * A3OVK2 * XNODP * AE * SINIO / EO;
+
+	X1MTH2 = 1.0 - THETA2;
+	C4 = 2.0 * XNODP * COEF1 * AODP * BETAO2 *
+	    (ETA * (2.0 + .5 * ETASQ) + 
+	     EO * (.5 + 2.0 * ETASQ) -
+	     2.0 * CK2 * TSI / (AODP * PSISQ) *
+	     (-3.0 * X3THM1 * (1.0 - 2.0 * EETA + ETASQ * (1.5 - .5 * EETA)) +
+	      .75 * X1MTH2 * (2.0 * ETASQ - EETA * (1.0 + ETASQ)) * 
+	      cos(2.0 * OMEGAO)));
+
+	C5 = 2.0 * COEF1 * AODP * BETAO2 * (1.0 +
+					    2.75 * (ETASQ + EETA) +
+					    EETA * ETASQ);
+	THETA4 = THETA2 * THETA2;
+	TEMP1 = 3.0 * CK2 * PINVSQ * XNODP;
+	TEMP2 = TEMP1 * CK2 * PINVSQ;
+	TEMP3 = 1.25 * CK4 * PINVSQ * PINVSQ * XNODP;
+
+	XMDOT = XNODP +
+	    .5 * TEMP1 * BETAO * X3THM1 +
+	    .0625 * TEMP2 * BETAO * (13.0 - 78.0 * THETA2 + 137.0 * THETA4);
+
+	X1M5TH = 1.0 - 5.0 * THETA2;
+
+	OMGDOT = -.5 * TEMP1 * X1M5TH +
+	    .0625 * TEMP2 * (7.0 - 114.0 * THETA2 + 395.0 * THETA4) +
+	    TEMP3 * (3.0 - 36.0 * THETA2 + 49.0 * THETA4);
+
+	XHDOT1 = -TEMP1 * COSIO;
+
+	XNODOT = XHDOT1 + (.5 * TEMP2 * (4.0 - 19.0 * THETA2) +
+			   2.0 * TEMP3 * (3.0 - 7.0 * THETA2)) * COSIO;
+
+	OMGCOF = BSTAR * C3 * cos(OMEGAO);
+
+	XMCOF = -TOTHRD * COEF * BSTAR * AE / EETA;
+	XNODCF = 3.5 * BETAO2 * XHDOT1 * C1;
+	T2COF = 1.5 * C1;
+	XLCOF = .125 * A3OVK2 * SINIO * (3.0 + 5.0 *COSIO) / (1.0 + COSIO);
+
+	AYCOF = .25 * A3OVK2 * SINIO;
+	DELMO = pow(1.0 + ETA * cos(XMO), 3.0);
+	SINMO = sin(XMO);
+
+	X7THM1 = 7.0 * THETA2 - 1.0;
+
+/*      IF(ISIMP .EQ. 1) GO TO 90 */
+	if(!(sat->prop.sgp4->sgp4_flags & SGP4_SIMPLE)) {
+	    C1SQ = C1 * C1;
+	    D2 = 4.0 * AODP * TSI * C1SQ;
+	    TEMP = D2 * TSI * C1 / 3.0;
+	    D3 = (17.0 * AODP + S4) * TEMP;
+	    D4 = .5 * TEMP * AODP * TSI * (221.0 * AODP + 31.0 * S4) * C1;
+	    T3COF = D2 + 2.0 * C1SQ;
+	    T4COF = .25 * (3.0 * D3 + C1 * (12.0 * D2 + 10.0 * C1SQ));
+	    T5COF = .2 * (3.0 * D4 +
+			  12.0 * C1 * D3 +
+			  6.0 * D2 * D2 +
+			  15.0 * C1SQ * (2.0 * D2 + C1SQ));
+	}
+    }
+
+    /*
+     * UPDATE FOR SECULAR GRAVITY AND ATMOSPHERIC DRAG
+     */
+
+    XMDF = XMO + XMDOT * TSINCE;
+    OMGADF = OMEGAO + OMGDOT * TSINCE;
+    XNODDF = XNODEO + XNODOT * TSINCE;
+    OMEGA = OMGADF;
+    XMP = XMDF;
+    TSQ = TSINCE * TSINCE;
+    XNODE = XNODDF + XNODCF * TSQ;
+    TEMPA = 1.0 - C1 * TSINCE;
+    TEMPE = BSTAR * C4 * TSINCE;
+    TEMPL = T2COF * TSQ;
+    if(!(sat->prop.sgp4->sgp4_flags & SGP4_SIMPLE)) {
+	DELOMG = OMGCOF * TSINCE;
+	DELM = XMCOF * (pow(1.0 + ETA * cos(XMDF), 3) - DELMO);
+	TEMP = DELOMG + DELM;
+	XMP = XMDF + TEMP;
+	OMEGA = OMGADF - TEMP;
+	TCUBE = TSQ * TSINCE;
+	TFOUR = TSINCE * TCUBE;
+	TEMPA = TEMPA - D2 * TSQ - D3 * TCUBE - D4 * TFOUR;
+	TEMPE = TEMPE + BSTAR * C5 * (sin(XMP) - SINMO);
+	TEMPL = TEMPL + T3COF * TCUBE + TFOUR * (T4COF + TSINCE * T5COF);
+    }
+
+    A = AODP * TEMPA * TEMPA;
+    E = EO - TEMPE;
+    XL = XMP + OMEGA + XNODE + XNODP * TEMPL;
+    BETA = sqrt(1.0 - E * E);
+    XN = XKE / pow(A, 1.5);
+
+    /*
+     * LONG PERIOD PERIODICS
+     */
+
+    AXN = E * cos(OMEGA);
+    TEMP = 1.0 / (A * BETA * BETA);
+    XLL = TEMP * XLCOF * AXN;
+    AYNL = TEMP * AYCOF;
+    XLT = XL + XLL;
+    AYN = E * sin(OMEGA) + AYNL;
+
+    /*
+     * SOLVE KEPLERS EQUATION
+     */
+
+    CAPU = fmod(XLT - XNODE, TWOPI);
+    TEMP2 = CAPU;
+
+    for(i = 0; i < 10; i++) {
+	SINEPW = sin(TEMP2);
+	COSEPW = cos(TEMP2);
+	TEMP3 = AXN * SINEPW;
+	TEMP4 = AYN * COSEPW;
+	TEMP5 = AXN * COSEPW;
+	TEMP6 = AYN * SINEPW;
+	EPW = (CAPU - TEMP4 + TEMP3 - TEMP2) / (1.0 - TEMP5 - TEMP6) + TEMP2;
+
+	if(fabs(EPW - TEMP2) <= E6A)
+	    break;
+
+	TEMP2 = EPW;
+    }
+
+    /*
+     * SHORT PERIOD PRELIMINARY QUANTITIES
+     */
+
+    ECOSE = TEMP5 + TEMP6;
+    ESINE = TEMP3 - TEMP4;
+    ELSQ = AXN * AXN + AYN * AYN;
+    TEMP = 1.0 - ELSQ;
+    PL = A * TEMP;
+    R = A * (1.0 - ECOSE);
+
+    TEMP1 = 1.0 / R;
+    RDOT = XKE * sqrt(A) * ESINE * TEMP1;
+    RFDOT = XKE * sqrt(PL) * TEMP1;
+    TEMP2 = A * TEMP1;
+    BETAL = sqrt(TEMP);
+    TEMP3 = 1.0 / (1.0 + BETAL);
+
+    COSU = TEMP2 * (COSEPW - AXN + AYN * ESINE * TEMP3);
+    SINU = TEMP2 * (SINEPW - AYN - AXN * ESINE * TEMP3);
+
+    U = actan(SINU, COSU);
+
+    SIN2U = 2.0 * SINU * COSU;
+    COS2U = 2.0 * COSU * COSU - 1.0;
+
+    TEMP = 1.0 / PL;
+    TEMP1 = CK2 * TEMP;
+    TEMP2 = TEMP1 * TEMP;
+
+    /*
+     * UPDATE FOR SHORT PERIODICS
+     */
+
+    RK = R * (1.0 - 1.5 * TEMP2 * BETAL * X3THM1) +
+	.5 * TEMP1 * X1MTH2 * COS2U;
+
+    UK = U - .25 * TEMP2 * X7THM1 * SIN2U;
+ 
+   XNODEK = XNODE + 1.5 * TEMP2 * COSIO * SIN2U;
+   XINCK = XINCL + 1.5 * TEMP2 * COSIO * SINIO * COS2U;
+   RDOTK = RDOT - XN * TEMP1 * X1MTH2 * SIN2U;
+   RFDOTK = RFDOT + XN * TEMP1 * (X1MTH2 * COS2U + 1.5 * X3THM1);
+
+   /*
+    * ORIENTATION VECTORS
+    */
+
+   SINUK = sin(UK);
+   COSUK = cos(UK);
+   SINIK = sin(XINCK);
+   COSIK = cos(XINCK);
+   SINNOK = sin(XNODEK);
+   COSNOK = cos(XNODEK);
+
+   XMX = -SINNOK * COSIK;
+   XMY = COSNOK * COSIK;
+   UX = XMX * SINUK + COSNOK * COSUK;
+   UY = XMY * SINUK + SINNOK * COSUK;
+   UZ = SINIK * SINUK;
+   VX = XMX * COSUK - COSNOK * SINUK;
+   VY = XMY * COSUK - SINNOK * SINUK;
+   VZ = SINIK * COSUK;
+
+   /*
+    * POSITION AND VELOCITY
+    */
+
+   pos->x = RK * UX;
+   pos->y = RK * UY;
+   pos->z = RK * UZ;
+
+   dpos->x = RDOTK * UX + RFDOTK * VX;
+   dpos->y = RDOTK * UY + RFDOTK * VY;
+   dpos->z = RDOTK * UZ + RFDOTK * VZ;
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sgp4.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/sphcart.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/sphcart.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/sphcart.c	(revision 1457)
@@ -0,0 +1,42 @@
+#include <math.h>
+#include "P_.h"
+#include "astro.h"
+
+/* transformation from spherical to cartesian coordinates */
+void
+sphcart (l, b, r, x, y, z)
+double l, b, r;		/* source: spherical coordinates */
+double *x, *y, *z;	/* result: rectangular coordinates */
+{
+	double rcb = r * cos(b);
+
+	*x = rcb * cos(l);
+	*y = rcb * sin(l);
+	*z = r * sin(b);
+}
+
+/* transformation from cartesian to spherical coordinates */
+void
+cartsph (x, y, z, l, b, r)
+double x, y, z;		/* source: rectangular coordinates */
+double *l, *b, *r;	/* result: spherical coordinates */
+{
+	double rho = x*x + y*y;
+
+	if (rho > 1e-35) {	/* standard case: off axis */
+	    *l = atan2(y, x);
+	    range (l, 2*PI);
+	    *b = atan2(z, sqrt(rho));
+	    *r = sqrt(rho + z*z);
+	} else {		/* degenerate case; avoid math error */
+	    *l = 0.0;
+	    if (z == 0.0)
+		*b = 0.0;
+	    else
+		*b = (z > 0.0) ? PI/2. : -PI/2.;
+	    *r = fabs(z);
+	}
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sphcart.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/sun.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/sun.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/sun.c	(revision 1457)
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <math.h>
+
+#include "P_.h"
+#include "astro.h"
+#include "vsop87.h"
+
+/* given the modified JD, mjd, return the true geocentric ecliptic longitude
+ *   of the sun for the mean equinox of the date, *lsn, in radians, the
+ *   sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians
+ *   (since this is always <= 1.2 arcseconds, in can be neglected by
+ *   calling with bsn = NULL).
+ *
+ * if the APPARENT ecliptic longitude is required, correct the longitude for
+ *   nutation to the true equinox of date and for aberration (light travel time,
+ *   approximately  -9.27e7/186000/(3600*24*365)*2*pi = -9.93e-5 radians).
+ */
+void
+sunpos (mjd, lsn, rsn, bsn)
+double mjd;
+double *lsn, *rsn, *bsn;
+{
+	static double last_mjd = -3691, last_lsn, last_rsn, last_bsn;
+	double ret[6];
+
+	if (mjd == last_mjd) {
+	    *lsn = last_lsn;
+	    *rsn = last_rsn;
+	    if (bsn) *bsn = last_bsn;
+	    return;
+	}
+
+	vsop87(mjd, SUN, 0.0, ret);	/* full precision earth pos */
+
+	*lsn = ret[0] - PI;		/* revert to sun pos */
+	range (lsn, 2*PI);		/* normalise */
+
+	last_lsn = *lsn;		/* memorise */
+	last_rsn = *rsn = ret[2];
+	last_bsn = -ret[1];
+	last_mjd = mjd;
+
+	if (bsn) *bsn = last_bsn;	/* assign only if non-NULL pointer */
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sun.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/thetag.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/thetag.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/thetag.c	(revision 1457)
@@ -0,0 +1,90 @@
+#include <math.h>
+
+#include "deepconst.h"
+
+/* @(#) $Id: thetag.c,v 1.1.1.1 2001-04-10 14:40:47 cmv Exp $ */
+
+
+/*
+ *      FUNCTION THETAG(EP)
+ *      COMMON /E1/XMO,XNODEO,OMEGAO,EO,XINCL,XNO,XNDT2O,XNDD6O,BSTAR,
+ *     1 X,Y,Z,XDOT,YDOT,ZDOT,EPOCH,DS50
+ *      DOUBLE PRECISION EPOCH,D,THETA,TWOPI,YR,TEMP,EP,DS50
+ *      TWOPI=6.28318530717959D0
+ *      YR=(EP+2.D-7)*1.D-3
+ *      JY=YR
+ *      YR=JY
+ *      D=EP-YR*1.D3
+ *      IF(JY.LT.10) JY=JY+80
+ *      N=(JY-69)/4
+ *      IF(JY.LT.70) N=(JY-72)/4
+ *      DS50=7305.D0 + 365.D0*(JY-70) +N + D
+ *      THETA=1.72944494D0 + 6.3003880987D0*DS50
+ *      TEMP=THETA/TWOPI
+ *      I=TEMP
+ *      TEMP=I
+ *      THETAG=THETA-TEMP*TWOPI
+ *      IF(THETAG.LT.0.D0) THETAG=THETAG+TWOPI
+ *      RETURN
+ *      END
+ */
+
+/*       FUNCTION THETAG(EP) */
+double
+thetag(double EP, double *DS50)
+{
+    int JY, N, I;
+    double YR, D, THETA, TEMP, THETAG;
+
+    YR = (EP + 2.0E-7) * 1.0E-3;
+
+    JY = (int) YR;
+
+    YR = JY;
+
+    D = EP - YR * 1.0E3;
+
+    if(JY < 10)
+	JY += 80;
+
+    N = (JY - 69) / 4;
+
+    if(JY < 70)
+	N = (JY - 72) / 4;
+
+/*    printf("N = %d\n", N); */
+
+    *DS50 = 7305.0 + 365.0 * (JY-70) + N + D;
+
+/*    printf("DS50 = %f\n", *DS50); */
+
+    THETA = 1.72944494 + 6.3003880987 * *DS50;
+
+/*    printf("THETA = %f\n", THETA); */
+
+    TEMP = THETA / TWOPI;
+
+    I = (int)TEMP;
+    TEMP = I;
+
+    THETAG = THETA - TEMP * TWOPI;
+
+    if(THETAG < 0.0)
+	THETAG += TWOPI;
+
+    return THETAG;
+}
+
+#if 0
+void main(int argc, char **argv) {
+    double ds50, gwa;
+
+    if(argc >= 2) {
+	gwa = thetag(atof(argv[1]), &ds50);
+	printf("%f, %f\n", gwa, ds50);
+    }
+}
+#endif
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: thetag.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/utc_gst.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/utc_gst.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/utc_gst.c	(revision 1457)
@@ -0,0 +1,102 @@
+#include "P_.h"
+#include "astro.h"
+
+static double gmst0 P_((double mjd));
+
+/* given a modified julian date, mjd, and a universally coordinated time, utc,
+ * return greenwich mean siderial time, *gst.
+ * N.B. mjd must be at the beginning of the day.
+ */
+void
+utc_gst (mjd, utc, gst)
+double mjd;
+double utc;
+double *gst;
+{
+	static double lastmjd = -18981;
+	static double t0;
+
+	if (mjd != lastmjd) {
+	    t0 = gmst0(mjd);
+	    lastmjd = mjd;
+	}
+	*gst = (1.0/SIDRATE)*utc + t0;
+	range (gst, 24.0);
+}
+
+/* given a modified julian date, mjd, and a greenwich mean siderial time, gst,
+ * return universally coordinated time, *utc.
+ * N.B. mjd must be at the beginning of the day.
+ */
+void
+gst_utc (mjd, gst, utc)
+double mjd;
+double gst;
+double *utc;
+{
+	static double lastmjd = -10000;
+	static double t0;
+
+	if (mjd != lastmjd) {
+	    t0 = gmst0 (mjd);
+	    lastmjd = mjd;
+	}
+	*utc = gst - t0;
+	range (utc, 24.0);
+	*utc *= SIDRATE;
+}
+
+/* gmst0() - return Greenwich Mean Sidereal Time at 0h UT; stern
+ */
+static double
+gmst0 (mjd)
+double mjd;	/* date at 0h UT in julian days since MJD0 */
+{
+	double T, x;
+
+	T = ((int)(mjd - 0.5) + 0.5 - J2000)/36525.0;
+	x = 24110.54841 +
+		(8640184.812866 + (0.093104 - 6.2e-6 * T) * T) * T;
+	x /= 3600.0;
+	range(&x, 24.0);
+	return (x);
+}
+
+#ifdef TEST_GMST
+
+/* original routine by elwood; has a secular drift of 0.08s/cty */
+static double
+tnaught (mjd)
+double mjd;	/* julian days since 1900 jan 0.5 */
+{
+	double dmjd;
+	int m, y;
+	double d;
+	double t, t0;
+
+	mjd_cal (mjd, &m, &d, &y);
+	cal_mjd (1, 0., y, &dmjd);
+	t = dmjd/36525;
+	t0 = 6.57098e-2 * (mjd - dmjd) - 
+	     (24 - (6.6460656 + (5.1262e-2 + (t * 2.581e-5))*t) -
+		   (2400 * (t - (((double)y - 1900)/100))));
+	range(&t0, 24.0);
+	return (t0);
+}
+
+#include <stdlib.h>
+main(argc, argv)
+  int argc;
+  char *argv[];
+{
+	double mjd, gst;
+	while (scanf("%lf", &mjd) == 1) {
+		mjd -= MJD0;
+		gst = tnaught(mjd);
+		printf("%17.9f %10.7f %10.7f\n", mjd + MJD0, gst, gmst0(mjd));
+	}
+}
+#endif
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: utc_gst.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/vector.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/vector.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/vector.h	(revision 1457)
@@ -0,0 +1,19 @@
+#ifndef __SATVECTOR_H
+#define __SATVECTOR_H
+
+/* $Id: vector.h,v 1.1.1.1 2001-04-10 14:40:47 cmv Exp $ */
+
+#define dotp(A,B) ((A).x*(B).x+(A).y*(B).y+(A).z*(B).z)
+
+#define crossp(A,B,C) {(C).x=(A).y*(B).z-(A).z*(B).y;(C).y=(A).z*(B).x-(A).x*(B).z;(C).z=(A).x*(B).y-(A).y*(B).x;}
+
+#define vecabs(V) (sqrt((V).x*(V).x+(V).y*(V).y+(V).z*(V).z))
+#define vecsq(V) ((V).x*(V).x+(V).y*(V).y+(V).z*(V).z)
+#define vecsub(A,B,C) {(C).x=(A).x-(B).x;(C).y=(A).y-(B).y;(C).z=(A).z-(B).z;}
+#define vecscale(A,k) {(A).x*=(k);(A).y*=(k);(A).z*=(k);}
+
+#endif /* __SATVECTOR_H */
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: vector.h,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/vsop87.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/vsop87.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/vsop87.c	(revision 1457)
@@ -0,0 +1,213 @@
+/* VSOP87 planetary theory
+ *
+ * currently uses version VSOP87D:
+ * heliocentric spherical, mean ecliptic of date.
+ *
+ * calculation of rates (daily changes) is optional;
+ * see header file for the necessary #define's
+ *
+ * rough orientation on calculation time, miliseconds
+ * on an HP 715/75, all planets Mercury to Neptune, prec=0.0:
+ *
+ *      terms	with rates	without rates
+ * 	3598	11		7.1
+ *      31577	51		44
+ *
+ * with secular terms for JD 2232395.0  19/12/1399 0h TDB:
+ *
+ *	FULL PRECISION code (31577 terms), milliseconds
+ *	prec	terms	rates	no rates
+ *	1e-8	15086	62	36
+ *	1e-7	10105	44	25
+ *	1e-6	3725	20	13
+ *	1e-5	1324	11	7.8
+ *	1e-4	443	7.0	6.0
+ *	1e-3	139	6.0	5.0
+ *
+ *	REDUCED PRECISION code (3598 terms), milliseconds
+ *	prec	terms	rates	no rates
+ *	1e-7	2463	9.9	5.5
+ *	1e-6	1939	8.0	4.5
+ *	1e-5	1131	4.9	2.9
+ *	1e-4	443	2.2	1.5
+ *	1e-3	139	1.0	0.9
+ */
+
+#include <math.h>
+#include "P_.h"
+#include "astro.h"
+#include "vsop87.h"
+
+#define VSOP_A1000	365250.0	/* days per millenium */
+#define VSOP_MAXALPHA	5		/* max degree of time */
+
+/******************************************************************
+ * adapted from BdL FORTRAN Code; stern
+ *
+ *    Reference : Bureau des Longitudes - PBGF9502
+ *
+ *    Object :  calculate a VSOP87 position for a given time.
+ *
+ *    Input :
+ *
+ *    mjd      modified julian date, counted from J1900.0
+ *             time scale : dynamical time TDB.
+ *
+ *    obj	object number as in astro.h, NB: not for pluto
+ *
+ *    prec     relative precision
+ *
+ *             if prec is equal to 0 then the precision is the precision
+ *                p0 of the complete solution VSOP87.
+ *                Mercury    p0 =  0.6 10**-8
+ *                Venus      p0 =  2.5 10**-8
+ *                Earth      p0 =  2.5 10**-8
+ *                Mars       p0 = 10.0 10**-8
+ *                Jupiter    p0 = 35.0 10**-8
+ *                Saturn     p0 = 70.0 10**-8
+ *                Uranus     p0 =  8.0 10**-8
+ *                Neptune    p0 = 42.0 10**-8
+ *
+ *             if prec is not equal to 0, let us say in between p0 and
+ *             10**-3, the precision is :
+ *                for the positions :
+ *                - prec*a0 au for the distances.
+ *                - prec rad for the other variables.
+ *                for the velocities :
+ *                - prec*a0 au/day for the distances.
+ *                - prec rad/day for the other variables.
+ *                  a0 is the semi-major axis of the body.
+ *
+ *    Output :
+ *
+ *    ret[6]     array of the results (double).
+ *
+ *             for spherical coordinates :
+ *                 1: longitude (rd)
+ *                 2: latitude (rd)
+ *                 3: radius (au)
+ *		#if VSOP_GETRATE:
+ *                 4: longitude velocity (rad/day)
+ *                 5: latitude velocity (rad/day)
+ *                 6: radius velocity (au/day)
+ *
+ *    return:     error index (int)
+ *                 0: no error.
+ *		   2: object out of range [MERCURY .. NEPTUNE, SUN]
+ *		   3: precision out of range [0.0 .. 1e-3]
+ ******************************************************************/
+int
+vsop87 (mjd, obj, prec, ret)
+double mjd;
+int obj;
+double prec;
+double *ret;
+{
+    static double (*vx_map[])[3] = {		/* data tables */
+		vx_mercury, vx_venus, vx_mars, vx_jupiter,
+		vx_saturn, vx_uranus, vx_neptune, 0, vx_earth,
+	};
+    static int (*vn_map[])[3] = {		/* indexes */
+		vn_mercury, vn_venus, vn_mars, vn_jupiter,
+		vn_saturn, vn_uranus, vn_neptune, 0, vn_earth,
+	};
+    static double a0[] = {	/* semimajor axes; for precision ctrl only */
+	    0.39, 0.72, 1.5, 5.2, 9.6, 19.2, 30.1, 39.5, 1.0,
+	};
+    double (*vx_obj)[3] = vx_map[obj];		/* VSOP87 data and indexes */
+    int (*vn_obj)[3] = vn_map[obj];
+
+    double t[VSOP_MAXALPHA+1];			/* powers of time */
+    double t_abs[VSOP_MAXALPHA+1];		/* powers of abs(time) */
+    double q;					/* aux for precision control */
+    int i, cooidx, alpha;			/* misc indexes */
+
+    if (obj == PLUTO || obj > SUN)
+	return (2);
+
+    if (prec < 0.0 || prec > 1e-3)
+	return(3);
+
+    /* zero result array */
+    for (i = 0; i < 6; ++i) ret[i] = 0.0;
+
+    /* time and its powers */
+    t[0] = 1.0;
+    t[1] = (mjd - J2000)/VSOP_A1000;
+    for (i = 2; i <= VSOP_MAXALPHA; ++i) t[i] = t[i-1] * t[1];
+    t_abs[0] = 1.0;
+    for (i = 1; i <= VSOP_MAXALPHA; ++i) t_abs[i] = fabs(t[i]);
+
+    /* precision control */
+    q = -log10(prec + 1e-35) - 2;	/* decades below 1e-2 */
+    q = VSOP_ASCALE * prec / 10.0 / q;	/* reduce threshold progressively
+					 * for higher precision */
+
+    /* do the term summation; first the spatial dimensions */
+    for (cooidx = 0; cooidx < 3; ++cooidx) {
+
+	/* then the powers of time */
+	for (alpha = 0; vn_obj[alpha+1][cooidx] ; ++alpha) {
+	    double p, term, termdot;
+
+	    /* precision threshold */
+	    p = q/(t_abs[alpha] + alpha * t_abs[alpha-1] * 1e-4 + 1e-35);
+#if VSOP_SPHERICAL
+	    if (cooidx == 2)	/* scale by semimajor axis for radius */
+#endif
+		p *= a0[obj];
+
+	    term = termdot = 0.0;
+	    for (i = vn_obj[alpha][cooidx]; i < vn_obj[alpha+1][cooidx]; ++i) {
+		double a, b, c, arg;
+
+		a = vx_obj[i][0];
+		if (a < p) continue;	/* ignore small terms */
+
+		b = vx_obj[i][1];
+		c = vx_obj[i][2];
+
+		arg = b + c * t[1];
+		term += a * cos(arg);
+#if VSOP_GETRATE
+		termdot += -c * a * sin(arg);
+#endif
+	    }
+
+	    ret[cooidx] += t[alpha] * term;
+#if VSOP_GETRATE
+	    ret[cooidx + 3] += t[alpha] * termdot +
+		    ((alpha > 0) ? alpha * t[alpha - 1] * term : 0.0);
+#endif
+	} /* alpha */
+    } /* cooidx */
+
+    for (i = 0; i < 6; ++i) ret[i] /= VSOP_ASCALE;
+
+#if VSOP_SPHERICAL
+    /* reduce longitude to 0..2pi */
+    ret[0] -= floor(ret[0]/(2.*PI)) * (2.*PI);
+#endif
+
+#if VSOP_GETRATE
+    /* convert millenium rate to day rate */
+    for (i = 3; i < 6; ++i) ret[i] /= VSOP_A1000;
+#endif
+
+#if VSOP_SPHERICAL
+    /* reduction from dynamical equinox of VSOP87 to FK5;
+     */
+    if (prec < 5e-7) {		/* 5e-7 rad = 0.1 arc seconds */
+	double L1, c1, s1;
+	L1 = ret[0] - degrad(13.97 * t[1] - 0.031 * t[2]);
+	c1 = cos(L1); s1 = sin(L1);
+	ret[0] += degrad(-0.09033 + 0.03916 * (c1 + s1) * tan(ret[1]))/3600.0;
+	ret[1] += degrad(0.03916 * (c1 - s1))/3600.0;
+    }
+#endif
+
+    return (0);
+}
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: vsop87.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/vsop87.h
===================================================================
--- trunk/SophyaExt/XephemAstroLib/vsop87.h	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/vsop87.h	(revision 1457)
@@ -0,0 +1,93 @@
+/* Position of planets mercury to neptune; from:
+ftp://ftp.bdl.fr/pub/ephem/planets/vsop87/
+from README:
+
+==========================                         ===========================
+                              BUREAU DES LONGITUDES
+                            PLANETARY SOLUTION VSOP87
+                                  1996, January
+==========================                         ===========================
+
+These files and programs are associated to :
+
+Planetary Theories in rectangular and spherical variables: VSOP87 solution.
+    Bretagnon P., Francou G.
+    Astron. Astrophys. 202, 309 (1988).
+
+Theorie du mouvement de l'ensemble des planetes (VSOP82).
+    Bretagnon P.
+    Astron. Astrophys. 114, 278 (1982).
+
+==============================================================================
+
+Description:
+    The Planetary solutions VSOP87 (Variations Seculaires des Orbites
+    Planetaires) are analytical solutions of the motion of the planets in
+    different versions. The main version VSOP87 consists of the series in
+    elliptic elements as in the case of VSOP82 solution and the other
+    versions VSOP87 (A-B-C-D-E) are built in rectangular and spherical
+    variables.
+
+Authors' Address:
+    P. Bretagnon, G. Francou
+    Bureau des Longitudes, CNRS URA 707
+    77, Avenue Denfert-Rochereau
+    75014, Paris, France
+    Tel    : (33) 1 40 51 22 69  (33) 1 40 51 22 60
+    Fax    : (33) 1 46 33 28 34
+    E-mail : pierre@bdl.fr  francou@bdl.fr
+
+Contents:
+    The main version of VSOP87 is similar to the previous theory VSOP82.
+    In the both cases the constants of integration have been determined by
+    fitting to the numerical integration DE200 of the Jet Propulsion
+    Laboratory. The various versions of VSOP87 are different from one to
+    another in the type of coordinates and the reference frame.
+    VSOP87  : heliocentric elliptic    variables; equinox and ecliptic J2000.
+    VSOP87A : heliocentric rectangular variables; equinox and ecliptic J2000.
+    VSOP87B : heliocentric spherical   variables; equinox and ecliptic J2000.
+    VSOP87C : heliocentric rectangular variables; equinox and ecliptic of date.
+    VSOP87D : heliocentric spherical   variables; equinox and ecliptic of date.
+    VSOP87E : barycentric  rectangular variables; equinox and ecliptic J2000.
+...
+==============================================================================
+User feed-back is encouraged. Unless otherwise specified, send comments and bug
+reports to:                    E-mail     : comments@bdl.fr
+                               Fax        : (33) 1 46 33 28 34
+                               Postal mail: Bureau des longitudes
+                                            77 avenue Denfert Rochereau
+                                            F-75014 PARIS
+==============================================================================
+  implemented for C: stern
+*/
+
+#define VSOP_ASCALE	1e8	/* amplitude factor as stored */
+
+/* coding flags */
+#define VSOP_SPHERICAL	1	/* version in data.c uses spherical coords */
+#define VSOP_GETRATE	0	/* calculate time derivatives of coordinates */
+
+/* data tables */
+extern double vx_mercury[][3];
+extern int vn_mercury[][3];
+extern double vx_venus[][3];
+extern int vn_venus[][3];
+extern double vx_earth[][3];
+extern int vn_earth[][3];
+extern double vx_mars[][3];
+extern int vn_mars[][3];
+extern double vx_jupiter[][3];
+extern int vn_jupiter[][3];
+extern double vx_saturn[][3];
+extern int vn_saturn[][3];
+extern double vx_uranus[][3];
+extern int vn_uranus[][3];
+extern double vx_neptune[][3];
+extern int vn_neptune[][3];
+
+extern int vsop87 P_((double mjd, int obj, double prec, double *ret));
+
+
+/* For RCS Only -- Do Not Edit
+ * @(#) $RCSfile: vsop87.h,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $
+ */
Index: trunk/SophyaExt/XephemAstroLib/vsop87_data.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/vsop87_data.c	(revision 1457)
+++ trunk/SophyaExt/XephemAstroLib/vsop87_data.c	(revision 1457)
@@ -0,0 +1,6988 @@
+/*  data tables for planetary solution VSOP87
+ *
+ *  created by automatic conversion from original distribution files at
+ *  ftp://ftp.bdl.fr/pub/ephem/planets/vsop87/
+ *
+ *  Each coordinate is calculated as:
+ *
+ *	x = Sum{ T^alpha * A * cos( B + C*T ) }
+ * 
+ *  x is the coordinate in rad or a.u.
+ *  T is the VSOP time in Julian Millenia(!) since J2000.0
+ *  Note: the time argument in VSOP87 theory is equal to TAI + 32.184 s
+ *
+ *  A (scaled by VSOP_ASCALE), B, C given below for each x and alpha
+ *  run-of-the mill for each planet in one array vx_planet[][3].
+ *  The block-boundary indices for each spatial dimension are then listed
+ *  in a separate array vn_planet[][3].
+ *
+ *  Truncation errors given in comments are from the authors' empirical
+ *  formula:  2*sqrt(number of retained terms)*A[last retained]
+ */
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_earth[][3] = {
+	/* earth l, T^0 */
+	{ 175347045.7, 0, 0 },
+	{ 3341656.5, 4.66925680, 6283.07584999 },
+	{ 34894.3, 4.626102, 12566.151700 },
+	{ 3417.6, 2.82887, 3.52312 },
+	{ 3497.1, 2.74412, 5753.38488 },
+	{ 3135.9, 3.62767, 77713.77147 },
+	{ 2676.2, 4.41808, 7860.41939 },
+	{ 2342.7, 6.13516, 3930.20970 },
+	{ 1273.2, 2.03710, 529.69097 },
+	{ 1324.3, 0.74246, 11506.76977 },
+	{ 901.9, 2.0451, 26.2983 },
+	{ 1199.2, 1.10963, 1577.34354 },
+	{ 857.2, 3.5085, 398.1490 },
+	{ 779.8, 1.1788, 5223.6939 },
+	{ 990.2, 5.2327, 5884.9268 },
+	{ 753.1, 2.5334, 5507.5532 },
+	{ 505.3, 4.5829, 18849.2275 },
+	{ 492.4, 4.2051, 775.5226 },
+	{ 356.7, 2.9195, 0.0673 },
+	{ 284.1, 1.8987, 796.2980 },
+	{ 242.8, 0.3448, 5486.7778 },
+	{ 317.1, 5.8490, 11790.6291 },
+	{ 271.0, 0.3149, 10977.0788 },
+	{ 206.2, 4.8065, 2544.3144 },
+	{ 205.4, 1.8695, 5573.1428 },
+	{ 202.3, 2.4577, 6069.7768 },
+	{ 126.2, 1.0830, 20.7754 },
+	{ 155.5, 0.8331, 213.2991 },
+	{ 115.1, 0.6454, 0.9803 },
+	{ 102.9, 0.6360, 4694.0030 },
+	{ 101.7, 4.2668, 7.1135 },
+	{ 99.2, 6.210, 2146.165 },
+	{ 132.2, 3.4112, 2942.4634 },
+	{ 97.6, 0.681, 155.420 },
+	{ 85.1, 1.299, 6275.962 },
+	{ 74.7, 1.755, 5088.629 },
+	{ 101.9, 0.9757, 15720.8388 },
+	{ 84.7, 3.671, 71430.696 },
+	{ 73.5, 4.679, 801.821 },
+	{ 73.9, 3.503, 3154.687 },
+	{ 78.8, 3.037, 12036.461 },
+	{ 79.6, 1.808, 17260.155 },
+	{ 85.8, 5.983, 161000.686 },
+	{ 57.0, 2.784, 6286.599 },
+	{ 61.1, 1.818, 7084.897 },
+	{ 69.6, 0.833, 9437.763 },
+	{ 56.1, 4.387, 14143.495 },
+	{ 62.4, 3.978, 8827.390 },
+	{ 51.1, 0.283, 5856.478 },
+	{ 55.6, 3.470, 6279.553 },
+	{ 41.0, 5.368, 8429.241 },
+	{ 51.6, 1.333, 1748.016 },
+	{ 52.0, 0.189, 12139.554 },
+	{ 49.0, 0.487, 1194.447 },
+	{ 39.2, 6.168, 10447.388 },
+	{ 35.6, 1.776, 6812.767 },
+	{ 36.8, 6.041, 10213.286 },
+	{ 36.6, 2.570, 1059.382 },
+	{ 33.3, 0.593, 17789.846 },
+	{ 36.0, 1.709, 2352.866 },
+	{ 40.9, 2.399, 19651.048 },
+	{ 30.0, 2.740, 1349.867 },
+	{ 30.4, 0.443, 83996.847 },
+	{ 23.7, 0.485, 8031.092 },
+	{ 23.6, 2.065, 3340.612 },
+	{ 21.1, 4.148, 951.718 },
+	{ 24.7, 0.215, 3.590 },
+	{ 25.4, 3.165, 4690.480 },
+	{ 22.8, 5.222, 4705.732 },
+	{ 21.4, 1.426, 16730.464 },
+	{ 21.9, 5.556, 553.569 },
+	{ 17.5, 4.561, 135.065 },
+	{ 19.9, 5.222, 12168.003 },
+	{ 19.9, 5.775, 6309.374 },
+	{ 20.3, 0.371, 283.859 },
+	{ 14.4, 4.193, 242.729 },
+	{ 16.2, 5.988, 11769.854 },
+	{ 15.1, 4.196, 6256.778 },
+	{ 19.1, 3.822, 23581.258 },
+	{ 18.9, 5.386, 149854.400 },
+	{ 14.3, 3.724, 38.028 },
+	{ 17.9, 2.215, 13367.973 },
+	{ 12.1, 2.622, 955.600 },
+	{ 11.3, 0.177, 4164.312 },
+	{ 14.0, 4.401, 6681.225 },
+	{ 13.6, 1.889, 7632.943 },
+	{ 12.5, 1.131, 5.523 },
+	{ 10.5, 5.359, 1592.596 },
+	{ 9.8, 1.00, 11371.70 },
+	{ 9.2, 4.57, 4292.33 },
+	{ 10.3, 6.200, 6438.496 },
+	{ 12.0, 1.004, 632.784 },
+	{ 10.8, 0.327, 103.093 },
+	{ 8.4, 4.54, 25132.30 },
+	{ 10.0, 6.029, 5746.271 },
+	{ 8.4, 3.30, 7234.79 },
+	{ 8.0, 5.82, 28.45 },
+	{ 10.5, 0.939, 11926.254 },
+	{ 7.7, 3.12, 7238.68 },
+	{ 9.4, 2.62, 5760.50 },
+	{ 8.1, 6.11, 4732.03 },
+	{ 9.2, 0.48, 522.58 },
+	{ 9.8, 5.24, 27511.47 },
+	{ 7.9, 1.00, 5643.18 },
+	{ 8.1, 6.27, 426.60 },
+	{ 9.0, 5.34, 6386.17 },
+	{ 8.6, 4.17, 7058.60 },
+	{ 6.3, 4.72, 6836.65 },
+	{ 7.6, 3.97, 11499.66 },
+	{ 7.8, 2.96, 23013.54 },
+	{ 7.3, 0.61, 11513.88 },
+	{ 6.5, 5.79, 18073.70 },
+	{ 7.2, 4.00, 74.78 },
+	{ 7.3, 4.39, 316.39 },
+	{ 7.1, 0.32, 263.08 },
+	{ 6.6, 3.66, 17298.18 },
+	{ 6.8, 5.91, 90955.55 },
+	/* 117 terms retained, 442 terms dropped, error 0.3" */
+
+	/* earth l, T^1 */
+	{ 628331966747.5, 0, 0 },
+	{ 206058.9, 2.6782346, 6283.0758500 },
+	{ 4303.4, 2.63513, 12566.15170 },
+	{ 425.3, 1.5905, 3.5231 },
+	{ 109.0, 2.9662, 1577.3435 },
+	{ 93.5, 2.592, 18849.228 },
+	{ 119.3, 5.7956, 26.2983 },
+	{ 72.1, 1.138, 529.691 },
+	{ 67.8, 1.875, 398.149 },
+	{ 67.3, 4.409, 5507.553 },
+	{ 59.0, 2.888, 5223.694 },
+	{ 56.0, 2.175, 155.420 },
+	{ 45.4, 0.398, 796.298 },
+	{ 36.4, 0.466, 775.523 },
+	{ 29.0, 2.647, 7.114 },
+	{ 19.1, 1.846, 5486.778 },
+	{ 20.8, 5.341, 0.980 },
+	{ 18.5, 4.969, 213.299 },
+	{ 16.2, 0.032, 2544.314 },
+	{ 17.3, 2.991, 6275.962 },
+	{ 15.8, 1.430, 2146.165 },
+	{ 14.6, 1.205, 10977.079 },
+	{ 11.9, 3.258, 5088.629 },
+	{ 11.5, 2.075, 4694.003 },
+	{ 9.7, 4.24, 1349.87 },
+	{ 10.0, 1.303, 6286.599 },
+	{ 9.5, 2.70, 242.73 },
+	{ 12.5, 2.834, 1748.016 },
+	{ 11.8, 5.274, 1194.447 },
+	{ 8.6, 5.64, 951.72 },
+	{ 10.6, 0.766, 553.569 },
+	{ 7.6, 5.30, 2352.87 },
+	{ 5.8, 1.77, 1059.38 },
+	{ 6.4, 2.65, 9437.76 },
+	{ 5.2, 5.66, 71430.70 },
+	{ 5.3, 0.91, 3154.69 },
+	{ 6.1, 4.67, 4690.48 },
+	{ 4.3, 0.24, 6812.77 },
+	{ 5.0, 1.42, 6438.50 },
+	{ 4.3, 0.77, 10447.39 },
+	{ 5.2, 1.85, 801.82 },
+	{ 3.7, 2.00, 8031.09 },
+	{ 3.6, 2.43, 14143.50 },
+	{ 3.4, 3.86, 1592.60 },
+	{ 3.4, 0.89, 12036.46 },
+	{ 3.2, 3.19, 4705.73 },
+	{ 3.2, 0.62, 8429.24 },
+	{ 4.1, 5.24, 7084.90 },
+	{ 3.0, 6.07, 4292.33 },
+	{ 2.9, 2.32, 20.36 },
+	{ 3.5, 4.80, 6279.55 },
+	{ 2.9, 1.43, 5746.27 },
+	{ 2.7, 4.80, 7234.79 },
+	{ 2.5, 6.22, 6836.65 },
+	{ 2.7, 0.93, 5760.50 },
+	{ 3.2, 3.40, 7632.94 },
+	{ 2.3, 5.00, 17789.85 },
+	{ 2.1, 3.96, 10213.29 },
+	{ 2.1, 2.22, 5856.48 },
+	{ 2.3, 5.67, 11499.66 },
+	{ 2.1, 5.20, 11513.88 },
+	{ 1.9, 0.53, 3340.61 },
+	{ 1.9, 4.74, 83996.85 },
+	{ 2.1, 2.55, 25132.30 },
+	{ 1.8, 1.47, 4164.31 },
+	{ 1.8, 3.02, 5.52 },
+	{ 2.0, 0.91, 6256.78 },
+	{ 2.1, 2.27, 522.58 },
+	{ 1.8, 3.03, 5753.38 },
+	{ 1.6, 6.12, 5216.58 },
+	{ 1.6, 4.64, 3.29 },
+	/* 71 terms retained, 270 terms dropped, error 0.056"*T */
+
+	/* earth l, T^2 */
+	{ 52918.9, 0, 0 },
+	{ 8719.8, 1.07210, 6283.07585 },
+	{ 309.1, 0.8673, 12566.1517 },
+	{ 27.3, 0.053, 3.523 },
+	{ 16.3, 5.188, 26.298 },
+	{ 15.8, 3.685, 155.420 },
+	{ 9.5, 0.76, 18849.23 },
+	{ 8.9, 2.06, 77713.77 },
+	{ 7.0, 0.83, 775.52 },
+	{ 5.1, 4.66, 1577.34 },
+	{ 4.1, 1.03, 7.11 },
+	{ 3.5, 5.14, 796.30 },
+	{ 3.2, 6.05, 5507.55 },
+	{ 3.0, 1.19, 242.73 },
+	{ 2.9, 6.12, 529.69 },
+	{ 3.8, 3.44, 5573.14 },
+	{ 2.7, 0.31, 398.15 },
+	{ 2.4, 4.38, 5223.69 },
+	{ 2.5, 2.28, 553.57 },
+	{ 2.1, 3.75, 0.98 },
+	{ 1.7, 0.90, 951.72 },
+	{ 1.5, 5.76, 1349.87 },
+	{ 1.2, 2.97, 2146.17 },
+	{ 1.4, 4.36, 1748.02 },
+	{ 1.3, 3.72, 1194.45 },
+	{ 1.3, 2.95, 6438.50 },
+	{ 1.0, 5.99, 6286.60 },
+	{ 0.9, 4.80, 5088.63 },
+	{ 0.8, 3.31, 213.30 },
+	{ 1.1, 1.27, 161000.69 },
+	{ 0.8, 3.42, 5486.78 },
+	{ 1.0, 0.60, 3154.69 },
+	{ 0.9, 5.23, 7084.90 },
+	{ 0.6, 1.60, 2544.31 },
+	{ 0.7, 3.43, 4694.00 },
+	{ 0.6, 2.48, 10977.08 },
+	{ 0.7, 6.19, 4690.48 },
+	{ 0.6, 1.98, 801.82 },
+	{ 0.5, 1.44, 6836.65 },
+	{ 0.5, 2.34, 1592.60 },
+	{ 0.5, 1.31, 4292.33 },
+	{ 0.4, 0.04, 7234.79 },
+	{ 0.5, 3.81, 149854.40 },
+	{ 0.4, 4.94, 7632.94 },
+	/* 44 terms retained, 98 terms dropped, error 0.011"*T^2 */
+
+	/* earth l, T^3 */
+	{ 289.2, 5.8438, 6283.0758 },
+	{ 35.0, 0, 0 },
+	{ 16.8, 5.488, 12566.152 },
+	{ 3.0, 5.20, 155.42 },
+	{ 1.3, 4.72, 3.52 },
+	{ 0.6, 5.97, 242.73 },
+	{ 0.7, 5.30, 18849.23 },
+	{ 0.4, 3.79, 553.57 },
+	/* 8 terms retained, 14 terms dropped, error 0.005"*T^3 */
+
+	/* earth l, T^4 */
+	{ 114.1, 3.1416, 0 },
+	{ 7.7, 4.13, 6283.08 },
+	{ 0.8, 3.84, 12566.15 },
+	{ 0.4, 0.42, 155.42 },
+	/* 4 terms retained, 7 terms dropped, error 0.00032"*T^4 */
+
+	/* earth l, T^5 */
+	{ 0.9, 3.14, 0 },
+	{ 0.2, 2.77, 6283.08 },
+	{ 0.1, 2.01, 155.42 },
+	/* 3 terms retained, 2 terms dropped, error 0.00023"*T^5 */
+	/* end earth l */
+
+	/* earth b, T^0 */
+	{ 279.6, 3.1987, 84334.6616 },
+	{ 101.6, 5.4225, 5507.5532 },
+	{ 80.4, 3.880, 5223.694 },
+	{ 43.8, 3.704, 2352.866 },
+	{ 31.9, 4.000, 1577.344 },
+	{ 22.7, 3.985, 1047.747 },
+	{ 16.4, 3.565, 5856.478 },
+	{ 18.1, 4.984, 6283.076 },
+	{ 14.4, 3.703, 9437.763 },
+	{ 14.3, 3.411, 10213.286 },
+	{ 11.2, 4.828, 14143.495 },
+	{ 10.9, 2.086, 6812.767 },
+	{ 9.7, 3.47, 4694.00 },
+	{ 10.4, 4.057, 71092.881 },
+	{ 8.8, 4.44, 5753.38 },
+	{ 8.4, 4.99, 7084.90 },
+	{ 6.9, 4.33, 6275.96 },
+	{ 9.1, 1.14, 6620.89 },
+	{ 7.2, 3.60, 529.69 },
+	{ 7.7, 5.55, 167621.58 },
+	/* 20 terms retained, 164 terms dropped, error 0.15" */
+
+	/* earth b, T^1 */
+	{ 9.0, 3.90, 5507.55 },
+	{ 6.2, 1.73, 5223.69 },
+	{ 3.8, 5.24, 2352.87 },
+	{ 2.8, 2.47, 1577.34 },
+	{ 1.8, 0.42, 6283.08 },
+	/* 5 terms retained, 94 terms dropped, error 0.018"*T */
+
+	/* earth b, T^2 */
+	{ 1.7, 1.63, 84334.66 },
+	{ 0.5, 2.41, 1047.75 },
+	/* 2 terms retained, 47 terms dropped, error 0.0035"*T^2 */
+
+	/* earth b, T^3 */
+	/* 0 terms retained, 11 terms dropped, error 4.5e-05"*T^3 */
+
+	/* earth b, T^4 */
+	/* 0 terms retained, 5 terms dropped, error 1.7e-05"*T^4 */
+	/* end earth b */
+
+	/* earth r, T^0 */
+	{ 100013988.8, 0, 0 },
+	{ 1670699.6, 3.09846351, 6283.07584999 },
+	{ 13956.0, 3.055246, 12566.151700 },
+	{ 3083.7, 5.19847, 77713.77147 },
+	{ 1628.5, 1.17388, 5753.38488 },
+	{ 1575.6, 2.84685, 7860.41939 },
+	{ 924.8, 5.4529, 11506.7698 },
+	{ 542.4, 4.5641, 3930.2097 },
+	{ 472.1, 3.6610, 5884.9268 },
+	{ 328.8, 5.8998, 5223.6939 },
+	{ 346.0, 0.9637, 5507.5532 },
+	{ 306.8, 0.2987, 5573.1428 },
+	{ 174.8, 3.0119, 18849.2275 },
+	{ 243.2, 4.2735, 11790.6291 },
+	{ 211.8, 5.8471, 1577.3435 },
+	{ 185.8, 5.0219, 10977.0788 },
+	{ 109.8, 5.0551, 5486.7778 },
+	{ 98.3, 0.887, 6069.777 },
+	{ 86.5, 5.690, 15720.839 },
+	{ 85.8, 1.271, 161000.686 },
+	{ 62.9, 0.922, 529.691 },
+	{ 57.1, 2.014, 83996.847 },
+	{ 64.9, 0.273, 17260.155 },
+	{ 49.4, 3.245, 2544.314 },
+	{ 55.7, 5.242, 71430.696 },
+	{ 42.5, 6.011, 6275.962 },
+	{ 47.0, 2.578, 775.523 },
+	{ 39.0, 5.361, 4694.003 },
+	{ 44.7, 5.537, 9437.763 },
+	{ 35.7, 1.675, 12036.461 },
+	{ 31.9, 0.184, 5088.629 },
+	{ 31.8, 1.778, 398.149 },
+	{ 33.2, 0.244, 7084.897 },
+	{ 38.2, 2.393, 8827.390 },
+	{ 28.5, 1.213, 6286.599 },
+	{ 37.5, 0.830, 19651.048 },
+	{ 37.0, 4.901, 12139.554 },
+	{ 34.5, 1.843, 2942.463 },
+	{ 26.3, 4.589, 10447.388 },
+	{ 24.6, 3.787, 8429.241 },
+	{ 23.6, 0.269, 796.298 },
+	{ 27.8, 1.899, 6279.553 },
+	{ 23.9, 4.996, 5856.478 },
+	{ 20.3, 4.653, 2146.165 },
+	{ 23.3, 2.808, 14143.495 },
+	{ 22.1, 1.950, 3154.687 },
+	{ 19.5, 5.382, 2352.866 },
+	{ 18.0, 0.199, 6812.767 },
+	{ 17.2, 4.433, 10213.286 },
+	{ 16.2, 5.232, 17789.846 },
+	{ 17.3, 6.152, 16730.464 },
+	{ 13.8, 5.190, 8031.092 },
+	{ 18.8, 0.673, 149854.400 },
+	{ 18.3, 2.253, 23581.258 },
+	{ 13.6, 3.685, 4705.732 },
+	{ 13.1, 0.653, 13367.973 },
+	{ 10.4, 4.333, 11769.854 },
+	{ 10.0, 4.201, 6309.374 },
+	{ 10.2, 1.594, 4690.480 },
+	{ 7.6, 2.63, 6256.78 },
+	{ 9.7, 3.68, 27511.47 },
+	{ 6.7, 0.56, 3340.61 },
+	{ 8.7, 6.06, 1748.02 },
+	{ 7.8, 3.67, 12168.00 },
+	{ 6.6, 5.66, 11371.70 },
+	{ 7.7, 0.31, 7632.94 },
+	{ 6.6, 3.14, 801.82 },
+	{ 7.5, 5.65, 11926.25 },
+	{ 6.9, 2.92, 6681.22 },
+	{ 6.8, 1.42, 23013.54 },
+	{ 6.5, 2.65, 19804.83 },
+	/* 71 terms retained, 455 terms dropped, error 1.1e-06 a.u. */
+
+	/* earth r, T^1 */
+	{ 103018.6, 1.1074897, 6283.0758500 },
+	{ 1721.2, 1.06442, 12566.15170 },
+	{ 702.2, 3.1416, 0 },
+	{ 32.3, 1.022, 18849.228 },
+	{ 30.8, 2.844, 5507.553 },
+	{ 25.0, 1.319, 5223.694 },
+	{ 18.5, 1.424, 1577.344 },
+	{ 10.1, 5.914, 10977.079 },
+	{ 8.6, 0.27, 5486.78 },
+	{ 8.7, 1.42, 6275.96 },
+	{ 5.1, 1.69, 5088.63 },
+	{ 5.0, 6.01, 6286.60 },
+	{ 4.7, 5.99, 529.69 },
+	{ 4.4, 0.52, 4694.00 },
+	{ 3.9, 4.75, 2544.31 },
+	{ 3.8, 5.07, 796.30 },
+	{ 4.1, 1.08, 9437.76 },
+	{ 3.5, 0.02, 83996.85 },
+	{ 3.4, 0.95, 71430.70 },
+	{ 3.2, 6.16, 2146.17 },
+	{ 3.4, 5.41, 775.52 },
+	{ 2.9, 5.48, 10447.39 },
+	{ 2.5, 0.24, 398.15 },
+	{ 2.2, 4.95, 6812.77 },
+	{ 2.2, 0.42, 8031.09 },
+	{ 2.8, 3.42, 2352.87 },
+	{ 2.6, 6.13, 6438.50 },
+	{ 1.9, 5.31, 8429.24 },
+	{ 2.4, 3.09, 4690.48 },
+	{ 1.7, 1.54, 4705.73 },
+	{ 2.2, 3.69, 7084.90 },
+	{ 2.1, 1.28, 1748.02 },
+	{ 1.8, 3.23, 6279.55 },
+	{ 1.6, 4.10, 11499.66 },
+	{ 1.6, 5.54, 3154.69 },
+	{ 1.8, 1.82, 7632.94 },
+	/* 36 terms retained, 256 terms dropped, error 2.2e-07 a.u.*T */
+
+	/* earth r, T^2 */
+	{ 4359.4, 5.78455, 6283.07585 },
+	{ 123.6, 5.5793, 12566.1517 },
+	{ 12.3, 3.142, 0 },
+	{ 8.8, 3.63, 77713.77 },
+	{ 5.7, 1.87, 5573.14 },
+	{ 3.3, 5.47, 18849.23 },
+	{ 1.5, 4.48, 5507.55 },
+	{ 1.0, 2.81, 5223.69 },
+	{ 0.9, 3.11, 1577.34 },
+	{ 1.1, 2.84, 161000.69 },
+	{ 0.6, 5.47, 775.52 },
+	{ 0.6, 1.38, 6438.50 },
+	{ 0.5, 4.42, 6286.60 },
+	{ 0.4, 0.90, 10977.08 },
+	{ 0.4, 3.20, 5088.63 },
+	{ 0.5, 3.66, 7084.90 },
+	{ 0.5, 5.39, 149854.40 },
+	/* 17 terms retained, 122 terms dropped, error 3.9e-08 a.u.*T^2 */
+
+	/* earth r, T^3 */
+	{ 144.6, 4.2732, 6283.0758 },
+	{ 6.7, 3.92, 12566.15 },
+	{ 0.8, 0, 0 },
+	{ 0.2, 3.73, 18849.23 },
+	/* 4 terms retained, 23 terms dropped, error 1.1e-08 a.u.*T^3 */
+
+	/* earth r, T^4 */
+	{ 3.9, 2.56, 6283.08 },
+	{ 0.3, 2.27, 12566.15 },
+	{ 0.1, 3.44, 5573.14 },
+	/* 3 terms retained, 7 terms dropped, error 2.1e-09 a.u.*T^4 */
+
+	/* earth r, T^5 */
+	{ 0.1, 1.22, 6283.08 },
+	/* 1 terms retained, 2 terms dropped, error 2.4e-09 a.u.*T^5 */
+	/* end earth */
+};
+
+int vn_earth[][3] = {
+	/* addresses for earth l, b, r  */
+	/* T^0 */ { 0, 247, 274, },
+	/* T^1 */ { 117, 267, 345, },
+	/* T^2 */ { 188, 272, 381, },
+	/* T^3 */ { 232, 274, 398, },
+	/* T^4 */ { 240, 0, 402, },
+	/* T^5 */ { 244, 0, 405, },
+	/* end */ { 247, 0, 406, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_jupiter[][3] = {
+	/* jupiter l, T^0 */
+	{ 59954691.5, 0, 0 },
+	{ 9695898.7, 5.06191793, 529.69096509 },
+	{ 573610.1, 1.4440621, 7.1135470 },
+	{ 306389.2, 5.4173473, 1059.3819302 },
+	{ 97178.3, 4.142647, 632.783739 },
+	{ 72903.1, 3.640429, 522.577418 },
+	{ 64264.0, 3.411452, 103.092774 },
+	{ 39806.1, 2.293767, 419.484644 },
+	{ 38857.8, 1.272317, 316.391870 },
+	{ 27964.6, 1.784546, 536.804512 },
+	{ 13589.7, 5.774810, 1589.072895 },
+	{ 8246.4, 3.58228, 206.18555 },
+	{ 8768.7, 3.63000, 949.17561 },
+	{ 7368.1, 5.08101, 735.87651 },
+	{ 6263.2, 0.02498, 213.29910 },
+	{ 6114.0, 4.51320, 1162.47470 },
+	{ 4905.4, 1.32085, 110.20632 },
+	{ 5305.3, 1.30671, 14.22709 },
+	{ 5305.5, 4.18625, 1052.26838 },
+	{ 4647.2, 4.69958, 3.93215 },
+	{ 3045.0, 4.31676, 426.59819 },
+	{ 2610.0, 1.56668, 846.08283 },
+	{ 2028.2, 1.06377, 3.18139 },
+	{ 1764.8, 2.14148, 1066.49548 },
+	{ 1723.0, 3.88036, 1265.56748 },
+	{ 1921.0, 0.97169, 639.89729 },
+	{ 1633.2, 3.58201, 515.46387 },
+	{ 1432.0, 4.29684, 625.67019 },
+	{ 973.3, 4.0976, 95.9792 },
+	{ 884.4, 2.4370, 412.3711 },
+	{ 732.9, 6.0853, 838.9693 },
+	{ 731.1, 3.8059, 1581.9593 },
+	{ 691.9, 6.1337, 2118.7639 },
+	{ 709.2, 1.2927, 742.9901 },
+	{ 614.5, 4.1085, 1478.8666 },
+	{ 495.2, 3.7557, 323.5054 },
+	{ 581.9, 4.5397, 309.2783 },
+	{ 375.7, 4.7030, 1368.6603 },
+	{ 389.9, 4.8972, 1692.1657 },
+	{ 341.0, 5.7145, 533.6231 },
+	{ 330.5, 4.7405, 0.0482 },
+	{ 440.9, 2.9582, 454.9094 },
+	{ 417.3, 1.0355, 2.4477 },
+	{ 244.2, 5.2202, 728.7630 },
+	{ 261.5, 1.8765, 0.9632 },
+	{ 256.6, 3.7241, 199.0720 },
+	{ 261.0, 0.8205, 380.1278 },
+	{ 220.4, 1.6512, 543.9181 },
+	{ 202.0, 1.8068, 1375.7738 },
+	{ 207.3, 1.8546, 525.7588 },
+	{ 197.0, 5.2925, 1155.3612 },
+	{ 235.1, 1.2269, 909.8187 },
+	{ 174.8, 5.9097, 956.2892 },
+	{ 149.4, 4.3775, 1685.0521 },
+	{ 175.2, 3.2263, 1898.3512 },
+	{ 175.2, 3.7297, 942.0621 },
+	{ 157.9, 4.3648, 1795.2584 },
+	{ 137.9, 1.3180, 1169.5883 },
+	{ 117.5, 2.5002, 1596.1864 },
+	{ 150.5, 3.9063, 74.7816 },
+	{ 116.8, 3.3892, 0.5213 },
+	{ 105.9, 4.5544, 526.5096 },
+	{ 130.5, 4.1687, 1045.1548 },
+	{ 141.4, 3.1357, 491.5579 },
+	{ 99.5, 1.421, 532.872 },
+	{ 96.1, 1.182, 117.320 },
+	{ 91.8, 0.858, 1272.681 },
+	{ 87.7, 1.217, 453.425 },
+	{ 68.5, 2.352, 2.921 },
+	{ 66.1, 5.344, 1471.753 },
+	{ 77.4, 4.427, 39.357 },
+	{ 72.0, 4.238, 2111.650 },
+	{ 63.4, 4.977, 0.751 },
+	{ 59.4, 4.111, 2001.444 },
+	{ 62.5, 0.512, 220.413 },
+	{ 66.5, 2.989, 2214.743 },
+	{ 60.2, 4.126, 4.193 },
+	{ 56.0, 1.155, 21.341 },
+	{ 52.9, 0.912, 10.295 },
+	{ 70.3, 5.142, 835.037 },
+	{ 51.9, 4.100, 1258.454 },
+	{ 46.4, 4.665, 5.629 },
+	{ 58.2, 5.866, 5753.385 },
+	{ 40.1, 4.688, 0.160 },
+	{ 46.7, 4.794, 305.346 },
+	{ 39.3, 4.254, 853.196 },
+	{ 46.0, 5.110, 4.666 },
+	{ 54.5, 1.571, 983.116 },
+	{ 38.9, 6.076, 518.645 },
+	{ 38.4, 2.438, 433.712 },
+	{ 46.8, 3.546, 5.417 },
+	{ 41.8, 4.680, 302.165 },
+	{ 35.9, 2.451, 430.530 },
+	{ 37.9, 0.211, 2648.455 },
+	{ 39.2, 1.718, 11.046 },
+	{ 37.6, 6.195, 831.856 },
+	{ 35.8, 4.615, 2008.558 },
+	{ 43.4, 0.150, 528.206 },
+	{ 31.6, 5.141, 1788.145 },
+	{ 29.8, 5.344, 2221.857 },
+	{ 32.8, 5.289, 88.866 },
+	{ 27.7, 1.852, 0.212 },
+	{ 25.8, 3.859, 2317.836 },
+	{ 33.8, 1.006, 9683.595 },
+	{ 27.1, 2.808, 18.159 },
+	{ 26.8, 1.776, 532.139 },
+	{ 26.1, 2.744, 2531.135 },
+	{ 30.8, 0.423, 1.484 },
+	{ 30.5, 3.667, 508.350 },
+	/* 109 terms retained, 651 terms dropped, error 1.3" */
+
+	/* jupiter l, T^1 */
+	{ 52993480757.5, 0, 0 },
+	{ 489741.2, 4.2206669, 529.6909651 },
+	{ 228918.5, 6.0264746, 7.1135470 },
+	{ 27655.4, 4.572660, 1059.381930 },
+	{ 20720.9, 5.459389, 522.577418 },
+	{ 12105.7, 0.169858, 536.804512 },
+	{ 6068.1, 4.42420, 103.09277 },
+	{ 5433.9, 3.98478, 419.48464 },
+	{ 4237.8, 5.89009, 14.22709 },
+	{ 2211.9, 5.26771, 206.18555 },
+	{ 1295.8, 5.55133, 3.18139 },
+	{ 1745.9, 4.92669, 1589.07290 },
+	{ 1163.4, 0.51451, 3.93215 },
+	{ 1007.2, 0.46478, 735.87651 },
+	{ 1173.1, 5.85647, 1052.26838 },
+	{ 847.7, 5.7581, 110.2063 },
+	{ 827.3, 4.8031, 213.2991 },
+	{ 1003.6, 3.15040, 426.59819 },
+	{ 1098.7, 5.30705, 515.46387 },
+	{ 816.4, 0.5864, 1066.4955 },
+	{ 725.4, 5.5183, 639.8973 },
+	{ 567.8, 5.9887, 625.6702 },
+	{ 474.2, 4.1325, 412.3711 },
+	{ 412.9, 5.7365, 95.9792 },
+	{ 335.8, 3.7325, 1162.4747 },
+	{ 345.2, 4.2416, 632.7837 },
+	{ 234.1, 6.2430, 309.2783 },
+	{ 194.8, 2.2188, 323.5054 },
+	{ 234.3, 4.0347, 949.1756 },
+	{ 183.9, 6.2796, 543.9181 },
+	{ 198.5, 1.5046, 838.9693 },
+	{ 186.9, 6.0862, 742.9901 },
+	{ 171.4, 5.4166, 199.0720 },
+	{ 130.8, 0.6264, 728.7630 },
+	{ 107.6, 4.4928, 956.2892 },
+	{ 115.4, 0.6802, 846.0828 },
+	{ 115.0, 5.2864, 2118.7639 },
+	{ 66.8, 5.734, 21.341 },
+	{ 69.6, 5.973, 532.872 },
+	{ 64.9, 6.088, 1581.959 },
+	{ 79.7, 5.824, 1045.155 },
+	{ 57.9, 0.995, 1596.186 },
+	{ 65.6, 0.129, 526.510 },
+	{ 58.5, 0.586, 1155.361 },
+	{ 56.6, 1.412, 533.623 },
+	{ 71.6, 5.342, 942.062 },
+	{ 57.4, 5.969, 1169.588 },
+	{ 54.9, 5.428, 10.295 },
+	{ 52.0, 0.230, 1368.660 },
+	{ 52.3, 5.727, 117.320 },
+	{ 50.4, 6.081, 525.759 },
+	{ 47.4, 3.626, 1478.867 },
+	{ 39.9, 4.162, 1692.166 },
+	{ 46.7, 0.511, 1265.567 },
+	{ 32.8, 5.036, 220.413 },
+	{ 33.6, 0.099, 302.165 },
+	{ 29.4, 3.359, 4.666 },
+	{ 29.3, 0.759, 88.866 },
+	{ 32.4, 5.375, 508.350 },
+	{ 29.5, 5.422, 1272.681 },
+	{ 21.8, 6.151, 1685.052 },
+	{ 25.2, 1.607, 831.856 },
+	{ 21.1, 5.863, 1258.454 },
+	{ 19.7, 2.172, 316.392 },
+	{ 17.9, 0.828, 433.712 },
+	{ 17.7, 5.955, 5.417 },
+	{ 17.2, 2.764, 853.196 },
+	{ 17.5, 0.707, 1471.753 },
+	{ 17.5, 0.498, 1375.774 },
+	{ 14.4, 0.915, 18.159 },
+	{ 14.1, 0.630, 2.921 },
+	{ 11.6, 4.304, 405.258 },
+	{ 11.7, 1.764, 380.128 },
+	{ 11.1, 5.567, 1574.846 },
+	{ 10.4, 0.314, 1361.547 },
+	{ 9.8, 5.90, 519.40 },
+	{ 9.8, 0.39, 1073.61 },
+	{ 9.3, 3.22, 1795.26 },
+	{ 8.9, 0.54, 1788.14 },
+	{ 8.4, 5.88, 2001.44 },
+	{ 8.1, 5.10, 1485.98 },
+	{ 7.7, 5.65, 2648.45 },
+	{ 6.7, 2.41, 4.19 },
+	{ 7.3, 6.19, 11.05 },
+	{ 6.3, 1.36, 1148.25 },
+	/* 85 terms retained, 284 terms dropped, error 0.24"*T */
+
+	/* jupiter l, T^2 */
+	{ 47233.6, 4.321483, 7.113547 },
+	{ 30629.1, 2.930214, 529.690965 },
+	{ 38965.5, 0, 0 },
+	{ 3189.3, 1.05505, 522.57742 },
+	{ 2723.4, 3.41412, 1059.38193 },
+	{ 2729.3, 4.84545, 536.80451 },
+	{ 1721.1, 4.18734, 14.22709 },
+	{ 383.3, 5.7679, 419.4846 },
+	{ 367.5, 6.0551, 103.0928 },
+	{ 377.5, 0.7605, 515.4639 },
+	{ 337.4, 3.7864, 3.1814 },
+	{ 308.2, 0.6936, 206.1855 },
+	{ 218.4, 3.8139, 1589.0729 },
+	{ 198.9, 5.3400, 1066.4955 },
+	{ 197.4, 2.4836, 3.9322 },
+	{ 146.2, 3.8137, 639.8973 },
+	{ 155.9, 1.4064, 1052.2684 },
+	{ 129.6, 5.8374, 412.3711 },
+	{ 141.9, 1.6344, 426.5982 },
+	{ 117.3, 1.4144, 625.6702 },
+	{ 96.7, 4.034, 110.206 },
+	{ 90.8, 1.106, 95.979 },
+	{ 78.8, 4.637, 543.918 },
+	{ 72.4, 2.217, 735.877 },
+	{ 87.3, 2.522, 632.784 },
+	{ 56.9, 3.123, 213.299 },
+	{ 48.6, 1.673, 309.278 },
+	{ 58.5, 0.832, 199.072 },
+	{ 40.1, 4.025, 21.341 },
+	{ 39.8, 0.624, 323.505 },
+	{ 35.7, 2.326, 728.763 },
+	{ 25.6, 2.512, 1162.475 },
+	{ 29.3, 3.608, 10.295 },
+	{ 23.6, 3.005, 956.289 },
+	{ 27.8, 3.240, 838.969 },
+	{ 26.0, 4.501, 742.990 },
+	{ 25.2, 1.219, 1045.155 },
+	{ 19.5, 4.290, 532.872 },
+	{ 17.7, 0.810, 508.350 },
+	{ 15.4, 5.810, 1596.186 },
+	{ 17.1, 4.200, 2118.764 },
+	{ 17.0, 1.834, 526.510 },
+	{ 14.7, 4.000, 117.320 },
+	{ 13.6, 1.803, 302.165 },
+	{ 13.2, 2.519, 88.866 },
+	{ 12.8, 4.369, 1169.588 },
+	{ 15.3, 0.682, 942.062 },
+	{ 11.0, 4.436, 525.759 },
+	{ 13.9, 5.952, 316.392 },
+	{ 9.4, 2.18, 1155.36 },
+	{ 8.8, 3.29, 220.41 },
+	{ 7.8, 5.76, 846.08 },
+	{ 7.5, 2.71, 533.62 },
+	{ 9.7, 1.72, 1581.96 },
+	{ 8.7, 3.32, 831.86 },
+	{ 6.3, 0.50, 949.18 },
+	{ 6.7, 2.18, 1265.57 },
+	{ 5.4, 6.01, 405.26 },
+	{ 4.7, 1.41, 1258.45 },
+	{ 4.4, 3.02, 1692.17 },
+	{ 4.4, 5.48, 433.71 },
+	{ 4.3, 5.07, 1073.61 },
+	{ 4.2, 5.29, 18.16 },
+	{ 3.9, 1.27, 853.20 },
+	{ 5.4, 3.65, 1272.68 },
+	{ 4.4, 2.27, 1368.66 },
+	{ 3.5, 1.54, 519.40 },
+	{ 2.7, 2.10, 1478.87 },
+	{ 2.7, 1.06, 1574.85 },
+	{ 2.9, 2.05, 1361.55 },
+	{ 3.1, 0.99, 191.96 },
+	{ 2.5, 2.37, 1471.75 },
+	{ 2.2, 2.48, 721.65 },
+	{ 2.1, 3.71, 1485.98 },
+	{ 2.0, 1.88, 1685.05 },
+	{ 2.3, 3.03, 1148.25 },
+	{ 2.0, 6.17, 330.62 },
+	/* 77 terms retained, 114 terms dropped, error 0.074"*T^2 */
+
+	/* jupiter l, T^3 */
+	{ 6501.7, 2.59863, 7.11355 },
+	{ 1356.5, 1.34636, 529.69097 },
+	{ 470.7, 2.4750, 14.2271 },
+	{ 417.0, 3.2445, 536.8045 },
+	{ 352.9, 2.9736, 522.5774 },
+	{ 154.9, 2.0757, 1059.3819 },
+	{ 86.8, 2.514, 515.464 },
+	{ 33.5, 3.826, 1066.495 },
+	{ 44.4, 0, 0 },
+	{ 22.6, 2.982, 543.918 },
+	{ 23.7, 1.277, 412.371 },
+	{ 28.5, 2.448, 206.186 },
+	{ 19.8, 2.101, 639.897 },
+	{ 19.7, 1.403, 419.485 },
+	{ 18.8, 1.594, 103.093 },
+	{ 17.0, 2.302, 21.341 },
+	{ 16.8, 2.598, 1589.073 },
+	{ 16.2, 3.145, 625.670 },
+	{ 16.1, 3.360, 1052.268 },
+	{ 13.4, 2.760, 95.979 },
+	{ 13.2, 2.539, 199.072 },
+	{ 12.6, 6.266, 426.598 },
+	{ 8.6, 2.27, 110.21 },
+	{ 6.7, 3.43, 309.28 },
+	{ 8.7, 1.76, 10.29 },
+	{ 6.5, 4.04, 728.76 },
+	{ 5.4, 5.25, 323.51 },
+	{ 5.7, 2.52, 508.35 },
+	{ 5.4, 2.91, 1045.15 },
+	{ 4.0, 4.30, 88.87 },
+	{ 3.9, 3.52, 302.16 },
+	{ 3.8, 4.09, 735.88 },
+	{ 3.3, 1.43, 956.29 },
+	{ 2.8, 4.36, 1596.19 },
+	{ 2.7, 1.25, 213.30 },
+	{ 2.6, 2.24, 117.32 },
+	{ 2.4, 2.90, 742.99 },
+	{ 2.7, 5.02, 838.97 },
+	{ 1.9, 2.77, 1169.59 },
+	{ 2.3, 2.36, 942.06 },
+	{ 1.5, 1.61, 220.41 },
+	{ 1.5, 3.09, 2118.76 },
+	{ 1.9, 5.01, 831.86 },
+	{ 1.6, 1.40, 405.26 },
+	{ 1.3, 3.98, 1155.36 },
+	{ 1.2, 3.46, 1073.61 },
+	{ 1.0, 3.39, 532.87 },
+	{ 0.9, 2.70, 191.96 },
+	{ 0.8, 1.48, 632.78 },
+	{ 0.8, 1.11, 1162.47 },
+	{ 0.8, 3.30, 1258.45 },
+	{ 0.7, 5.90, 853.20 },
+	{ 0.8, 3.66, 1581.96 },
+	{ 0.7, 3.75, 433.71 },
+	{ 0.7, 2.93, 1574.85 },
+	{ 0.7, 3.53, 525.76 },
+	{ 0.6, 4.15, 721.65 },
+	{ 0.6, 4.69, 81.75 },
+	{ 0.7, 1.96, 1272.68 },
+	{ 0.5, 1.57, 949.18 },
+	{ 0.7, 2.02, 526.51 },
+	{ 0.5, 4.36, 1368.66 },
+	{ 0.5, 4.96, 1148.25 },
+	{ 0.5, 4.31, 330.62 },
+	{ 0.6, 2.28, 551.03 },
+	{ 0.5, 3.87, 1361.55 },
+	{ 0.4, 2.95, 1038.04 },
+	{ 0.4, 4.08, 1471.75 },
+	{ 0.4, 2.22, 539.99 },
+	{ 0.4, 4.53, 1464.64 },
+	/* 70 terms retained, 39 terms dropped, error 0.014"*T^3 */
+
+	/* jupiter l, T^4 */
+	{ 669.5, 0.8528, 7.1135 },
+	{ 100.0, 0.7426, 14.2271 },
+	{ 114.0, 3.1416, 0 },
+	{ 50.0, 1.653, 536.805 },
+	{ 43.6, 5.820, 529.691 },
+	{ 31.8, 4.858, 522.577 },
+	{ 14.7, 4.291, 515.464 },
+	{ 8.9, 0.71, 1059.38 },
+	{ 5.0, 1.30, 543.92 },
+	{ 4.5, 2.32, 1066.50 },
+	{ 4.3, 0.48, 21.34 },
+	{ 3.1, 3.00, 412.37 },
+	{ 2.1, 0.40, 639.90 },
+	{ 1.8, 4.91, 625.67 },
+	{ 1.9, 4.26, 199.07 },
+	{ 1.7, 4.26, 206.19 },
+	{ 1.4, 5.26, 1052.27 },
+	{ 1.2, 4.72, 95.98 },
+	{ 1.1, 1.29, 1589.07 },
+	{ 1.0, 4.78, 1045.15 },
+	{ 0.9, 6.06, 88.87 },
+	{ 0.9, 5.78, 728.76 },
+	{ 0.9, 4.55, 426.60 },
+	{ 0.8, 3.40, 419.48 },
+	{ 0.8, 3.55, 103.09 },
+	{ 0.7, 0.52, 110.21 },
+	{ 0.4, 5.23, 302.16 },
+	{ 0.4, 6.24, 956.29 },
+	{ 0.4, 5.25, 309.28 },
+	{ 0.4, 0.60, 117.32 },
+	{ 0.3, 4.78, 508.35 },
+	{ 0.3, 3.48, 323.51 },
+	{ 0.3, 2.96, 1596.19 },
+	{ 0.3, 4.33, 942.06 },
+	{ 0.3, 0.48, 831.86 },
+	{ 0.3, 1.80, 1073.61 },
+	{ 0.2, 0.44, 220.41 },
+	{ 0.2, 1.13, 1169.59 },
+	{ 0.2, 2.16, 1361.55 },
+	{ 0.2, 3.43, 1148.25 },
+	{ 0.2, 1.93, 2118.76 },
+	{ 0.2, 3.03, 1272.68 },
+	/* 42 terms retained, 3 terms dropped, error 0.0042"*T^4 */
+
+	/* jupiter l, T^5 */
+	{ 49.6, 5.257, 7.114 },
+	{ 15.8, 5.251, 14.227 },
+	{ 4.3, 0.01, 536.80 },
+	{ 1.5, 1.10, 522.58 },
+	{ 0.7, 5.86, 543.92 },
+	{ 0.7, 0.87, 515.46 },
+	{ 0.8, 3.14, 0 },
+	{ 0.5, 0.82, 1066.50 },
+	{ 0.3, 5.63, 1059.38 },
+	/* 9 terms retained, 1 terms dropped, error 0.0038"*T^5 */
+	/* end jupiter l */
+
+	/* jupiter b, T^0 */
+	{ 2268615.7, 3.55852607, 529.69096509 },
+	{ 109971.6, 3.9080935, 1059.3819302 },
+	{ 110090.4, 0, 0 },
+	{ 8101.4, 3.60510, 522.57742 },
+	{ 6044.0, 4.25883, 1589.07290 },
+	{ 6437.8, 0.30627, 536.80451 },
+	{ 1106.9, 2.98534, 1162.47470 },
+	{ 941.7, 2.9362, 1052.2684 },
+	{ 894.1, 1.7545, 7.1135 },
+	{ 767.3, 2.1547, 632.7837 },
+	{ 944.3, 1.6752, 426.5982 },
+	{ 684.2, 3.6781, 213.2991 },
+	{ 629.2, 0.6434, 1066.4955 },
+	{ 835.9, 5.1788, 103.0928 },
+	{ 531.7, 2.7031, 110.2063 },
+	{ 558.5, 0.0135, 846.0828 },
+	{ 464.4, 1.1734, 949.1756 },
+	{ 431.1, 2.6083, 419.4846 },
+	{ 351.4, 4.6106, 2118.7639 },
+	{ 123.1, 3.3497, 1692.1657 },
+	{ 115.0, 5.0489, 316.3919 },
+	{ 132.2, 4.7782, 742.9901 },
+	{ 103.4, 2.3188, 1478.8666 },
+	{ 116.4, 1.3869, 323.5054 },
+	{ 102.4, 3.1529, 1581.9593 },
+	{ 103.8, 3.7010, 515.4639 },
+	{ 78.7, 3.983, 1265.567 },
+	{ 69.9, 2.560, 956.289 },
+	{ 55.6, 0.375, 1375.774 },
+	{ 52.0, 0.990, 1596.186 },
+	{ 55.2, 0.402, 525.759 },
+	{ 63.5, 4.501, 735.877 },
+	{ 49.7, 0.186, 543.918 },
+	{ 48.8, 3.573, 533.623 },
+	{ 28.4, 1.535, 625.670 },
+	{ 29.2, 5.431, 206.186 },
+	/* 36 terms retained, 213 terms dropped, error 0.73" */
+
+	/* jupiter b, T^1 */
+	{ 177351.8, 5.7016649, 529.6909651 },
+	{ 3230.2, 5.77942, 1059.38193 },
+	{ 3081.4, 5.47464, 522.57742 },
+	{ 2211.9, 4.73477, 536.80451 },
+	{ 1694.2, 3.14159, 0 },
+	{ 346.4, 4.7460, 1052.2684 },
+	{ 234.3, 5.1886, 1066.4955 },
+	{ 196.2, 6.1855, 7.1135 },
+	{ 150.5, 3.9272, 1589.0729 },
+	{ 114.1, 3.4390, 632.7837 },
+	{ 96.7, 2.914, 949.176 },
+	{ 76.6, 2.505, 103.093 },
+	{ 81.7, 5.077, 1162.475 },
+	{ 76.6, 0.613, 419.485 },
+	{ 73.9, 5.500, 515.464 },
+	{ 49.9, 3.948, 735.877 },
+	{ 60.5, 5.447, 213.299 },
+	{ 36.6, 4.698, 543.918 },
+	{ 46.0, 0.539, 110.206 },
+	{ 45.1, 1.895, 846.083 },
+	{ 36.0, 6.110, 316.392 },
+	{ 32.0, 4.925, 1581.959 },
+	{ 21.0, 5.630, 1596.186 },
+	{ 23.2, 5.848, 323.505 },
+	{ 24.7, 3.941, 2118.764 },
+	{ 17.3, 5.653, 533.623 },
+	{ 16.5, 5.898, 526.510 },
+	{ 16.7, 5.667, 1265.567 },
+	{ 15.8, 4.433, 1045.155 },
+	{ 13.4, 4.302, 532.872 },
+	{ 11.7, 1.810, 956.289 },
+	{ 11.9, 4.301, 525.759 },
+	{ 9.5, 2.03, 206.19 },
+	{ 10.5, 6.155, 14.227 },
+	{ 8.4, 3.93, 1478.87 },
+	{ 8.1, 4.20, 1169.59 },
+	{ 7.7, 2.99, 942.06 },
+	{ 8.8, 1.56, 426.60 },
+	{ 8.9, 4.87, 1155.36 },
+	{ 7.8, 3.85, 625.67 },
+	/* 40 terms retained, 101 terms dropped, error 0.21"*T */
+
+	/* jupiter b, T^2 */
+	{ 8094.1, 1.46323, 529.69097 },
+	{ 742.4, 0.9569, 522.5774 },
+	{ 813.2, 3.1416, 0 },
+	{ 399.0, 2.8989, 536.8045 },
+	{ 342.2, 1.4468, 1059.3819 },
+	{ 73.9, 0.407, 1052.268 },
+	{ 46.2, 3.480, 1066.495 },
+	{ 29.3, 0.991, 515.464 },
+	{ 29.7, 1.925, 1589.073 },
+	{ 22.8, 4.271, 7.114 },
+	{ 13.9, 2.922, 543.918 },
+	{ 12.1, 5.222, 632.784 },
+	{ 10.7, 4.880, 949.176 },
+	{ 6.1, 6.21, 1045.15 },
+	{ 5.9, 0.53, 1581.96 },
+	{ 5.0, 1.43, 526.51 },
+	{ 4.6, 0.92, 1162.47 },
+	{ 4.5, 4.02, 1596.19 },
+	{ 5.1, 6.03, 735.88 },
+	{ 3.6, 4.54, 110.21 },
+	{ 3.4, 1.39, 533.62 },
+	{ 3.3, 4.40, 14.23 },
+	{ 3.4, 0.42, 419.48 },
+	{ 2.9, 2.06, 316.39 },
+	{ 2.5, 3.98, 323.51 },
+	{ 3.1, 2.48, 2118.76 },
+	{ 3.1, 2.40, 532.87 },
+	{ 2.2, 4.78, 942.06 },
+	{ 2.1, 3.89, 426.60 },
+	{ 2.3, 0.37, 1155.36 },
+	{ 2.0, 3.90, 846.08 },
+	{ 1.9, 1.20, 103.09 },
+	{ 1.7, 1.42, 1265.57 },
+	{ 2.3, 0.88, 213.30 },
+	{ 1.8, 5.80, 625.67 },
+	{ 1.7, 2.24, 525.76 },
+	/* 36 terms retained, 45 terms dropped, error 0.043"*T^2 */
+
+	/* jupiter b, T^3 */
+	{ 251.6, 3.3809, 529.6910 },
+	{ 121.7, 2.7331, 522.5774 },
+	{ 48.7, 1.037, 536.805 },
+	{ 11.0, 2.315, 1052.268 },
+	{ 8.1, 2.77, 515.46 },
+	{ 6.2, 1.78, 1066.50 },
+	{ 7.3, 4.25, 1059.38 },
+	{ 3.6, 1.13, 543.92 },
+	{ 2.8, 3.14, 0 },
+	{ 1.9, 2.29, 7.11 },
+	{ 1.6, 1.78, 1045.15 },
+	{ 0.9, 0.45, 632.78 },
+	{ 0.8, 0.31, 949.18 },
+	{ 0.7, 2.64, 14.23 },
+	{ 0.9, 0.33, 1589.07 },
+	{ 0.7, 2.37, 1581.96 },
+	{ 0.6, 2.48, 1596.19 },
+	{ 0.7, 1.53, 735.88 },
+	{ 0.5, 3.68, 419.48 },
+	{ 0.5, 0.27, 942.06 },
+	{ 0.5, 3.18, 526.51 },
+	{ 0.4, 2.88, 110.21 },
+	/* 22 terms retained, 20 terms dropped, error 0.0081"*T^3 */
+
+	/* jupiter b, T^4 */
+	{ 15.1, 4.530, 522.577 },
+	{ 5.4, 4.47, 529.69 },
+	{ 4.5, 5.44, 536.80 },
+	{ 3.4, 0, 0 },
+	{ 1.8, 4.52, 515.46 },
+	{ 1.3, 4.20, 1052.27 },
+	{ 0.8, 5.59, 543.92 },
+	{ 0.5, 0.06, 1066.50 },
+	{ 0.3, 3.67, 1059.38 },
+	{ 0.1, 3.56, 1045.15 },
+	{ 0.1, 5.70, 7.11 },
+	{ 0.1, 1.17, 14.23 },
+	/* 12 terms retained, 0 terms dropped, error 0.0017"*T^4 */
+
+	/* jupiter b, T^5 */
+	{ 1.4, 0.09, 522.58 },
+	{ 0.4, 0.01, 515.46 },
+	{ 0.3, 3.28, 536.80 },
+	{ 0.1, 0.34, 529.69 },
+	/* 4 terms retained, 1 terms dropped, error 0.0012"*T^5 */
+	/* end jupiter b */
+
+	/* jupiter r, T^0 */
+	{ 520887429.5, 0, 0 },
+	{ 25209327.0, 3.491086400, 529.690965095 },
+	{ 610599.9, 3.8411537, 1059.3819302 },
+	{ 282029.5, 2.5741988, 632.7837393 },
+	{ 187647.4, 2.0759038, 522.5774181 },
+	{ 86792.9, 0.710011, 419.484644 },
+	{ 72062.9, 0.214657, 536.804512 },
+	{ 65517.2, 5.979959, 316.391870 },
+	{ 29134.6, 1.677592, 103.092774 },
+	{ 30135.3, 2.161321, 949.175609 },
+	{ 23453.2, 3.540231, 735.876514 },
+	{ 22283.7, 4.193628, 1589.072895 },
+	{ 23947.3, 0.274579, 7.113547 },
+	{ 13032.6, 2.960431, 1162.474704 },
+	{ 9703.3, 1.90670, 206.18555 },
+	{ 12749.0, 2.715501, 1052.268383 },
+	{ 9161.4, 4.41353, 213.29910 },
+	{ 7894.5, 2.47908, 426.59819 },
+	{ 7058.0, 2.18185, 1265.56748 },
+	{ 6137.8, 6.26418, 846.08283 },
+	{ 5477.1, 5.65729, 639.89729 },
+	{ 3502.5, 0.56531, 1066.49548 },
+	{ 4136.9, 2.72220, 625.67019 },
+	{ 4170.0, 2.01605, 515.46387 },
+	{ 2500.0, 4.55182, 838.96929 },
+	{ 2617.0, 2.00994, 1581.95935 },
+	{ 1911.9, 0.85622, 412.37110 },
+	{ 2127.6, 6.12751, 742.99006 },
+	{ 1610.5, 3.08868, 1368.66025 },
+	{ 1479.5, 2.68026, 1478.86657 },
+	{ 1230.7, 1.89043, 323.50542 },
+	{ 1216.8, 1.80172, 110.20632 },
+	{ 961.1, 4.5488, 2118.7639 },
+	{ 885.7, 4.1479, 533.6231 },
+	{ 776.7, 3.6770, 728.7630 },
+	{ 998.6, 2.8721, 309.2783 },
+	{ 1015.0, 1.38673, 454.90937 },
+	{ 727.2, 3.9882, 1155.3612 },
+	{ 655.3, 2.7907, 1685.0521 },
+	{ 821.5, 1.5934, 1898.3512 },
+	{ 620.8, 4.8228, 956.2892 },
+	{ 654.0, 3.3815, 1692.1657 },
+	{ 812.0, 5.9409, 909.8187 },
+	{ 562.1, 0.0810, 543.9181 },
+	{ 542.2, 0.2836, 525.7588 },
+	{ 457.9, 0.1272, 1375.7738 },
+	{ 614.8, 2.2762, 942.0621 },
+	{ 435.8, 2.6027, 95.9792 },
+	{ 496.1, 5.5301, 380.1278 },
+	{ 470.0, 2.8190, 1795.2584 },
+	{ 445.0, 0.1462, 14.2271 },
+	{ 290.9, 3.8934, 1471.7530 },
+	{ 276.6, 2.5224, 2001.4440 },
+	{ 275.1, 2.9886, 526.5096 },
+	{ 293.9, 2.0494, 199.0720 },
+	{ 291.0, 6.0313, 1169.5883 },
+	{ 338.3, 2.7987, 1045.1548 },
+	{ 257.5, 6.1340, 532.8724 },
+	{ 319.0, 1.3480, 2214.7431 },
+	{ 309.4, 5.3686, 1272.6810 },
+	{ 345.8, 1.5640, 491.5579 },
+	{ 303.4, 1.1541, 5753.3849 },
+	{ 192.3, 0.9200, 1596.1864 },
+	{ 215.4, 2.6357, 2111.6503 },
+	{ 200.7, 2.3726, 1258.4539 },
+	{ 239.0, 3.5740, 835.0371 },
+	{ 197.1, 5.9286, 453.4249 },
+	{ 139.4, 3.6396, 1788.1449 },
+	{ 191.4, 6.2825, 983.1159 },
+	{ 176.6, 2.5767, 9683.5946 },
+	{ 123.6, 2.2616, 2317.8359 },
+	{ 128.2, 4.6659, 831.8557 },
+	{ 112.4, 0.8560, 433.7117 },
+	{ 128.8, 1.1057, 2531.1350 },
+	{ 99.4, 4.503, 518.645 },
+	{ 93.9, 2.726, 853.196 },
+	{ 106.5, 5.8146, 220.4126 },
+	{ 120.2, 2.9516, 3.9322 },
+	{ 104.0, 2.2222, 74.7816 },
+	{ 81.7, 3.235, 1361.547 },
+	{ 112.5, 4.8622, 528.2065 },
+	{ 79.5, 0.885, 430.530 },
+	{ 85.8, 2.115, 1574.846 },
+	{ 85.7, 2.338, 2428.042 },
+	{ 68.3, 3.357, 2104.537 },
+	{ 69.6, 3.042, 302.165 },
+	{ 69.8, 3.224, 305.346 },
+	{ 69.6, 0.205, 532.139 },
+	{ 57.0, 2.002, 2634.228 },
+	{ 77.1, 2.098, 508.350 },
+	{ 56.7, 3.917, 2221.857 },
+	{ 58.3, 5.724, 628.852 },
+	{ 52.5, 4.025, 527.243 },
+	{ 63.6, 1.100, 1364.728 },
+	{ 53.6, 0.874, 2847.527 },
+	{ 59.6, 0.958, 494.266 },
+	{ 58.0, 3.458, 2008.558 },
+	{ 41.5, 3.520, 529.739 },
+	{ 44.7, 1.623, 984.600 },
+	{ 44.9, 4.901, 2648.455 },
+	{ 53.2, 1.198, 760.256 },
+	{ 44.4, 4.426, 1063.314 },
+	{ 37.6, 2.930, 1677.939 },
+	{ 41.5, 0.322, 529.643 },
+	{ 42.9, 0.031, 1439.510 },
+	{ 46.0, 2.543, 636.716 },
+	{ 40.2, 4.394, 1148.248 },
+	{ 38.8, 4.317, 149.563 },
+	{ 40.3, 2.101, 2744.434 },
+	{ 48.9, 5.603, 2810.921 },
+	{ 37.1, 5.078, 1905.465 },
+	{ 43.9, 1.245, 621.738 },
+	{ 34.0, 3.094, 2420.929 },
+	{ 36.8, 0.842, 530.654 },
+	{ 31.1, 5.358, 1485.980 },
+	{ 39.3, 4.708, 569.048 },
+	{ 39.7, 2.462, 355.749 },
+	{ 31.5, 6.193, 3.181 },
+	{ 28.4, 2.485, 519.396 },
+	{ 32.4, 2.733, 604.473 },
+	{ 27.1, 3.923, 2324.949 },
+	{ 26.8, 1.750, 2950.620 },
+	{ 29.0, 1.835, 1891.238 },
+	{ 26.5, 0.604, 1055.450 },
+	{ 33.5, 0.761, 643.829 },
+	{ 26.6, 1.036, 405.258 },
+	{ 25.5, 3.463, 458.842 },
+	{ 32.9, 3.186, 528.728 },
+	{ 25.7, 0.524, 511.532 },
+	{ 26.0, 1.336, 330.619 },
+	/* 130 terms retained, 615 terms dropped, error 6e-06 a.u. */
+
+	/* jupiter r, T^1 */
+	{ 1271801.6, 2.64937511, 529.69096509 },
+	{ 61661.8, 3.000763, 1059.381930 },
+	{ 53443.6, 3.897176, 522.577418 },
+	{ 31185.2, 4.882767, 536.804512 },
+	{ 41390.3, 0, 0 },
+	{ 11847.2, 2.413296, 419.484644 },
+	{ 9166.4, 4.75979, 7.11355 },
+	{ 3175.8, 2.79298, 103.09277 },
+	{ 3203.4, 5.21083, 735.87651 },
+	{ 3403.6, 3.34689, 1589.07290 },
+	{ 2600.0, 3.63435, 206.18555 },
+	{ 2412.2, 1.46947, 426.59819 },
+	{ 2806.1, 3.74224, 515.46387 },
+	{ 2676.6, 4.33053, 1052.26838 },
+	{ 2100.5, 3.92763, 639.89729 },
+	{ 1646.2, 5.30954, 1066.49548 },
+	{ 1641.3, 4.41629, 625.67019 },
+	{ 1049.9, 3.16114, 213.29910 },
+	{ 1024.8, 2.55433, 412.37110 },
+	{ 741.0, 2.1709, 1162.4747 },
+	{ 806.4, 2.6775, 632.7837 },
+	{ 676.9, 6.2495, 838.9693 },
+	{ 468.9, 4.7097, 543.9181 },
+	{ 444.7, 0.4028, 323.5054 },
+	{ 567.1, 4.5766, 742.9901 },
+	{ 415.9, 5.3684, 728.7630 },
+	{ 484.7, 2.4688, 949.1756 },
+	{ 337.6, 3.1678, 956.2892 },
+	{ 401.7, 4.6053, 309.2783 },
+	{ 347.4, 4.6815, 14.2271 },
+	{ 260.8, 5.3429, 846.0828 },
+	{ 220.1, 4.8421, 1368.6603 },
+	{ 203.2, 5.6000, 1155.3612 },
+	{ 246.6, 3.9231, 942.0621 },
+	{ 183.5, 4.2653, 95.9792 },
+	{ 180.1, 4.4017, 532.8724 },
+	{ 197.1, 3.7055, 2118.7639 },
+	{ 196.0, 3.7588, 199.0720 },
+	{ 200.2, 4.4389, 1045.1548 },
+	{ 170.2, 4.8465, 526.5096 },
+	{ 146.3, 6.1296, 533.6231 },
+	{ 133.5, 1.3225, 110.2063 },
+	{ 132.1, 4.5119, 525.7588 },
+	{ 123.9, 2.0429, 1478.8666 },
+	{ 121.9, 4.4058, 1169.5883 },
+	{ 115.3, 4.4674, 1581.9593 },
+	{ 98.5, 5.728, 1596.186 },
+	{ 91.6, 4.530, 1685.052 },
+	{ 110.6, 3.6250, 1272.6810 },
+	{ 80.5, 4.113, 1258.454 },
+	{ 79.6, 2.719, 1692.166 },
+	{ 100.2, 5.2469, 1265.5675 },
+	{ 77.9, 5.567, 1471.753 },
+	{ 85.8, 0.079, 831.856 },
+	{ 82.1, 3.808, 508.350 },
+	{ 55.3, 0.352, 316.392 },
+	{ 52.3, 5.531, 433.712 },
+	{ 55.8, 4.751, 302.165 },
+	{ 50.6, 4.856, 1375.774 },
+	{ 43.6, 4.944, 1361.547 },
+	{ 42.2, 1.224, 853.196 },
+	{ 37.7, 4.268, 2001.444 },
+	{ 49.4, 4.014, 220.413 },
+	{ 38.3, 5.330, 1788.145 },
+	{ 35.6, 1.762, 1795.258 },
+	{ 36.3, 3.850, 1574.846 },
+	{ 29.3, 5.166, 3.932 },
+	{ 25.2, 4.338, 519.396 },
+	{ 24.8, 2.729, 405.258 },
+	{ 27.0, 6.097, 1148.248 },
+	{ 22.6, 0.192, 380.128 },
+	{ 20.5, 4.329, 3.181 },
+	{ 19.9, 4.630, 1677.939 },
+	{ 19.5, 5.106, 1073.609 },
+	{ 18.4, 3.765, 1485.980 },
+	{ 18.9, 5.053, 2104.537 },
+	{ 17.0, 4.018, 2317.836 },
+	{ 16.7, 5.429, 88.866 },
+	{ 15.3, 2.927, 2008.558 },
+	{ 14.5, 3.633, 628.852 },
+	{ 14.6, 5.508, 721.649 },
+	{ 13.7, 4.876, 629.602 },
+	{ 18.5, 6.030, 330.619 },
+	{ 13.5, 1.385, 518.645 },
+	{ 15.7, 2.930, 1905.465 },
+	{ 12.5, 1.586, 2111.650 },
+	{ 12.3, 3.377, 635.965 },
+	{ 11.8, 4.085, 2648.455 },
+	{ 11.2, 4.626, 636.716 },
+	{ 14.3, 2.742, 2221.857 },
+	{ 11.2, 3.553, 1891.238 },
+	{ 13.1, 5.838, 1464.639 },
+	{ 11.4, 2.576, 511.532 },
+	{ 10.5, 0.499, 453.425 },
+	{ 9.7, 4.39, 1994.33 },
+	{ 10.1, 2.764, 423.417 },
+	{ 8.6, 5.16, 1056.20 },
+	{ 9.0, 4.79, 2420.93 },
+	{ 8.1, 3.73, 2634.23 },
+	{ 8.1, 1.29, 2428.04 },
+	{ 8.9, 1.86, 750.10 },
+	{ 8.9, 4.81, 1062.56 },
+	{ 8.6, 4.54, 21.34 },
+	{ 9.5, 4.33, 1802.37 },
+	{ 6.9, 5.97, 540.74 },
+	{ 7.3, 4.98, 1699.28 },
+	{ 7.1, 4.99, 1055.45 },
+	{ 7.2, 4.98, 1898.35 },
+	{ 6.5, 1.39, 422.67 },
+	{ 6.8, 2.91, 2324.95 },
+	{ 6.5, 4.57, 1038.04 },
+	{ 7.3, 3.02, 416.30 },
+	{ 6.6, 5.55, 1781.03 },
+	/* 113 terms retained, 268 terms dropped, error 1.4e-06 a.u.*T */
+
+	/* jupiter r, T^2 */
+	{ 79644.8, 1.358659, 529.690965 },
+	{ 8251.6, 5.77774, 522.57742 },
+	{ 7029.9, 3.27477, 536.80451 },
+	{ 5314.0, 1.83835, 1059.38193 },
+	{ 1860.8, 2.97682, 7.11355 },
+	{ 836.3, 4.1989, 419.4846 },
+	{ 964.5, 5.4803, 515.4639 },
+	{ 406.5, 3.7825, 1066.4955 },
+	{ 426.6, 2.2275, 639.8973 },
+	{ 377.3, 2.2425, 1589.0729 },
+	{ 497.9, 3.1416, 0 },
+	{ 339.0, 6.1269, 625.6702 },
+	{ 362.9, 5.3676, 206.1855 },
+	{ 342.0, 6.0992, 1052.2684 },
+	{ 279.9, 4.2616, 412.3711 },
+	{ 332.6, 0.0033, 426.5982 },
+	{ 229.8, 0.7053, 735.8765 },
+	{ 200.8, 3.0685, 543.9181 },
+	{ 199.8, 4.4288, 103.0928 },
+	{ 257.3, 0.9630, 632.7837 },
+	{ 138.6, 2.9324, 14.2271 },
+	{ 113.5, 0.7871, 728.7630 },
+	{ 86.0, 5.144, 323.505 },
+	{ 94.6, 1.705, 838.969 },
+	{ 83.5, 0.058, 309.278 },
+	{ 75.2, 1.605, 956.289 },
+	{ 70.5, 1.510, 213.299 },
+	{ 80.3, 2.981, 742.990 },
+	{ 56.2, 0.955, 1162.475 },
+	{ 61.6, 6.101, 1045.155 },
+	{ 66.6, 5.473, 199.072 },
+	{ 50.1, 2.721, 532.872 },
+	{ 51.9, 5.584, 942.062 },
+	{ 39.8, 5.946, 95.979 },
+	{ 44.5, 5.524, 508.350 },
+	{ 44.3, 0.271, 526.510 },
+	{ 29.9, 0.936, 1155.361 },
+	{ 28.4, 2.878, 525.759 },
+	{ 26.3, 4.269, 1596.186 },
+	{ 27.0, 2.806, 1169.588 },
+	{ 27.5, 2.648, 2118.764 },
+	{ 22.7, 0.178, 302.165 },
+	{ 29.3, 1.786, 831.856 },
+	{ 20.0, 0.043, 949.176 },
+	{ 19.9, 1.161, 533.623 },
+	{ 21.7, 1.888, 1272.681 },
+	{ 17.6, 4.150, 846.083 },
+	{ 17.1, 5.892, 1258.454 },
+	{ 21.4, 4.355, 316.392 },
+	{ 21.3, 0.544, 1265.567 },
+	{ 19.9, 0.065, 1581.959 },
+	{ 17.0, 0.534, 1368.660 },
+	{ 12.8, 3.900, 433.712 },
+	{ 13.1, 0.795, 110.206 },
+	{ 11.9, 0.407, 1361.547 },
+	{ 11.7, 4.444, 405.258 },
+	{ 12.0, 2.229, 220.413 },
+	{ 9.6, 6.01, 853.20 },
+	{ 10.2, 0.995, 1471.753 },
+	{ 9.0, 1.60, 1692.17 },
+	{ 8.7, 3.52, 1073.61 },
+	{ 8.3, 5.60, 1574.85 },
+	{ 9.0, 6.27, 519.40 },
+	{ 7.8, 0.65, 1478.87 },
+	{ 7.8, 0.18, 1685.05 },
+	{ 7.5, 0.88, 88.87 },
+	{ 7.3, 0.89, 721.65 },
+	{ 9.1, 1.51, 1148.25 },
+	{ 6.1, 2.50, 3.18 },
+	{ 7.0, 4.44, 330.62 },
+	{ 5.2, 2.79, 21.34 },
+	{ 5.1, 2.98, 1375.77 },
+	{ 4.9, 0.05, 1677.94 },
+	{ 4.7, 2.28, 1485.98 },
+	{ 4.7, 0.86, 3.93 },
+	{ 5.3, 0.85, 1788.14 },
+	{ 4.2, 0.41, 629.60 },
+	{ 4.2, 1.61, 635.97 },
+	{ 3.6, 2.71, 551.03 },
+	{ 3.3, 0.55, 1795.26 },
+	{ 4.4, 1.28, 1464.64 },
+	{ 3.3, 1.19, 1905.46 },
+	{ 3.2, 6.19, 1038.04 },
+	{ 3.1, 6.23, 2001.44 },
+	{ 3.4, 2.45, 539.99 },
+	{ 3.2, 5.55, 191.96 },
+	{ 2.6, 3.24, 1062.56 },
+	{ 2.6, 0.55, 2104.54 },
+	{ 2.2, 5.33, 1891.24 },
+	{ 2.7, 4.82, 416.30 },
+	{ 2.2, 1.72, 628.85 },
+	{ 2.3, 6.19, 1994.33 },
+	{ 2.3, 4.28, 963.40 },
+	{ 2.6, 0.03, 1898.35 },
+	{ 2.1, 3.33, 1699.28 },
+	{ 2.5, 2.40, 227.53 },
+	{ 2.5, 0.07, 750.10 },
+	{ 2.0, 0.29, 636.72 },
+	{ 1.9, 0.32, 295.05 },
+	{ 1.9, 3.44, 647.01 },
+	{ 1.9, 0.29, 2111.65 },
+	{ 1.9, 3.14, 611.44 },
+	{ 2.3, 1.95, 824.74 },
+	{ 1.9, 4.72, 2125.88 },
+	{ 2.5, 1.24, 2221.86 },
+	{ 1.8, 1.60, 2008.56 },
+	{ 1.6, 5.83, 422.67 },
+	{ 1.7, 2.32, 440.83 },
+	{ 1.6, 0.37, 1056.20 },
+	{ 1.6, 2.42, 10.29 },
+	{ 1.6, 3.52, 1055.45 },
+	{ 1.6, 5.76, 117.32 },
+	{ 1.6, 5.89, 2317.84 },
+	{ 2.0, 4.62, 423.42 },
+	{ 2.1, 1.05, 1781.03 },
+	{ 1.9, 1.12, 618.56 },
+	{ 1.9, 2.79, 1802.37 },
+	{ 1.8, 3.01, 2648.45 },
+	/* 118 terms retained, 72 terms dropped, error 3.9e-07 a.u.*T^2 */
+
+	/* jupiter r, T^3 */
+	{ 3519.3, 6.05801, 529.69097 },
+	{ 1073.2, 1.67321, 536.80451 },
+	{ 915.7, 1.4133, 522.5774 },
+	{ 341.6, 0.5230, 1059.3819 },
+	{ 254.9, 1.1963, 7.1135 },
+	{ 221.5, 0.9523, 515.4639 },
+	{ 69.1, 2.269, 1066.495 },
+	{ 89.7, 3.142, 0 },
+	{ 57.8, 1.414, 543.918 },
+	{ 57.7, 0.526, 639.897 },
+	{ 51.1, 5.980, 412.371 },
+	{ 46.9, 1.579, 625.670 },
+	{ 42.8, 6.117, 419.485 },
+	{ 37.5, 1.183, 14.227 },
+	{ 33.8, 1.667, 1052.268 },
+	{ 31.2, 1.043, 1589.073 },
+	{ 30.0, 4.632, 426.598 },
+	{ 33.5, 0.848, 206.186 },
+	{ 20.8, 2.501, 728.763 },
+	{ 14.5, 0.960, 508.350 },
+	{ 13.0, 1.502, 1045.155 },
+	{ 11.7, 3.555, 323.505 },
+	{ 12.3, 2.610, 735.877 },
+	{ 15.0, 0.891, 199.072 },
+	{ 11.2, 1.790, 309.278 },
+	{ 10.6, 6.278, 956.289 },
+	{ 9.8, 6.26, 103.09 },
+	{ 9.3, 3.45, 838.97 },
+	{ 6.7, 1.87, 302.16 },
+	{ 7.4, 1.28, 742.99 },
+	{ 7.2, 0.92, 942.06 },
+	{ 5.6, 1.38, 95.98 },
+	{ 6.8, 3.45, 831.86 },
+	{ 4.6, 2.83, 1596.19 },
+	{ 4.0, 1.21, 1169.59 },
+	{ 3.9, 5.99, 213.30 },
+	{ 3.6, 6.11, 405.26 },
+	{ 2.9, 2.33, 1155.36 },
+	{ 2.4, 1.87, 532.87 },
+	{ 2.4, 0.43, 220.41 },
+	{ 2.3, 1.95, 1073.61 },
+	{ 2.3, 0.09, 632.78 },
+	{ 2.2, 1.59, 2118.76 },
+	{ 2.4, 5.97, 1162.47 },
+	{ 2.1, 1.07, 21.34 },
+	{ 2.1, 1.51, 1258.45 },
+	{ 2.5, 0.35, 1272.68 },
+	{ 2.0, 5.94, 110.21 },
+	{ 2.0, 2.55, 88.87 },
+	{ 2.0, 2.16, 433.71 },
+	{ 2.0, 2.70, 721.65 },
+	{ 1.7, 4.46, 853.20 },
+	{ 1.9, 2.26, 1361.55 },
+	{ 1.7, 1.98, 525.76 },
+	{ 1.5, 0.12, 949.18 },
+	{ 2.0, 3.17, 1148.25 },
+	{ 1.7, 2.71, 330.62 },
+	{ 1.6, 0.47, 526.51 },
+	{ 1.2, 3.02, 963.40 },
+	{ 1.7, 0.44, 533.62 },
+	{ 1.2, 1.16, 1574.85 },
+	{ 1.1, 2.55, 846.08 },
+	{ 1.4, 1.17, 1038.04 },
+	{ 1.0, 2.70, 519.40 },
+	{ 1.4, 0.67, 551.03 },
+	{ 1.0, 4.17, 2627.11 },
+	{ 1.1, 1.07, 227.53 },
+	{ 0.9, 2.93, 1368.66 },
+	{ 0.8, 4.87, 611.44 },
+	{ 1.1, 1.79, 1581.96 },
+	{ 0.9, 4.91, 1670.83 },
+	{ 0.9, 3.69, 824.74 },
+	{ 0.8, 3.23, 2125.88 },
+	{ 0.8, 2.39, 2317.84 },
+	{ 0.9, 0.60, 539.99 },
+	{ 0.9, 4.52, 750.10 },
+	{ 0.8, 0.21, 1141.13 },
+	{ 0.8, 0.94, 191.96 },
+	{ 0.8, 2.25, 2538.25 },
+	{ 0.7, 0.67, 440.83 },
+	{ 0.7, 5.80, 1485.98 },
+	{ 0.6, 2.48, 1265.57 },
+	{ 0.6, 6.14, 1279.79 },
+	{ 0.6, 5.51, 2413.82 },
+	{ 0.6, 4.41, 1382.89 },
+	{ 0.6, 2.18, 1062.56 },
+	{ 0.6, 1.93, 2634.23 },
+	{ 0.5, 2.05, 295.05 },
+	{ 0.5, 2.32, 1471.75 },
+	{ 0.7, 2.27, 1699.28 },
+	{ 0.5, 1.96, 1677.94 },
+	{ 0.5, 4.36, 1692.17 },
+	{ 0.5, 2.50, 2207.63 },
+	{ 0.5, 5.77, 1478.87 },
+	{ 0.4, 5.99, 934.95 },
+	{ 0.4, 2.80, 81.75 },
+	{ 0.4, 3.94, 316.39 },
+	{ 0.5, 0.19, 10.29 },
+	/* 98 terms retained, 0 terms dropped, error 1e-07 a.u.*T^3 */
+
+	/* jupiter r, T^4 */
+	{ 128.6, 0.0842, 536.8045 },
+	{ 113.5, 4.2486, 529.6910 },
+	{ 82.7, 3.298, 522.577 },
+	{ 37.9, 2.733, 515.464 },
+	{ 26.7, 5.691, 7.114 },
+	{ 17.6, 5.400, 1059.382 },
+	{ 12.6, 6.016, 543.918 },
+	{ 9.3, 0.77, 1066.50 },
+	{ 8.1, 5.68, 14.23 },
+	{ 6.3, 5.12, 639.90 },
+	{ 7.0, 1.43, 412.37 },
+	{ 5.4, 3.34, 625.67 },
+	{ 2.9, 3.40, 1052.27 },
+	{ 2.6, 4.16, 728.76 },
+	{ 2.6, 2.90, 426.60 },
+	{ 2.3, 6.22, 1589.07 },
+	{ 2.1, 3.12, 1045.15 },
+	{ 1.7, 2.81, 206.19 },
+	{ 1.8, 2.60, 199.07 },
+	{ 1.8, 1.89, 419.48 },
+	{ 1.5, 1.33, 1596.19 },
+	{ 1.7, 0, 0 },
+	{ 1.0, 4.42, 956.29 },
+	{ 1.2, 5.16, 831.86 },
+	{ 0.9, 3.17, 508.35 },
+	{ 0.9, 5.79, 1169.59 },
+	{ 0.9, 1.87, 1148.25 },
+	{ 1.0, 0.67, 1361.55 },
+	{ 0.8, 1.48, 1272.68 },
+	{ 1.0, 5.47, 220.41 },
+	{ 0.8, 2.42, 117.32 },
+	{ 0.7, 0.50, 1073.61 },
+	{ 0.7, 3.53, 302.16 },
+	{ 0.7, 2.85, 191.96 },
+	{ 0.8, 2.20, 942.06 },
+	{ 0.8, 5.31, 551.03 },
+	{ 0.7, 3.72, 88.87 },
+	{ 0.5, 1.83, 647.01 },
+	{ 0.6, 0.86, 330.62 },
+	{ 0.5, 5.26, 21.34 },
+	{ 0.6, 3.82, 618.56 },
+	{ 0.5, 4.44, 110.21 },
+	{ 0.6, 1.59, 3.18 },
+	{ 0.6, 1.84, 10.29 },
+	{ 0.5, 1.53, 405.26 },
+	{ 0.5, 0.24, 433.71 },
+	/* 46 terms retained, 0 terms dropped, error 7.1e-08 a.u.*T^4 */
+
+	/* jupiter r, T^5 */
+	{ 11.2, 4.752, 536.805 },
+	{ 4.3, 5.92, 522.58 },
+	{ 2.1, 5.57, 515.46 },
+	{ 1.9, 4.30, 543.92 },
+	{ 1.9, 3.69, 7.11 },
+	{ 1.6, 5.49, 1066.50 },
+	{ 1.6, 4.13, 1059.38 },
+	{ 1.2, 3.78, 14.23 },
+	{ 1.0, 4.51, 529.69 },
+	/* 9 terms retained, 0 terms dropped, error 6.5e-08 a.u.*T^5 */
+	/* end jupiter */
+};
+
+int vn_jupiter[][3] = {
+	/* addresses for jupiter l, b, r  */
+	/* T^0 */ { 0, 392, 542, },
+	/* T^1 */ { 109, 428, 672, },
+	/* T^2 */ { 194, 468, 785, },
+	/* T^3 */ { 271, 504, 903, },
+	/* T^4 */ { 341, 526, 1001, },
+	/* T^5 */ { 383, 538, 1047, },
+	/* end */ { 392, 542, 1056, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_mars[][3] = {
+	/* mars l, T^0 */
+	{ 620347711.6, 0, 0 },
+	{ 18656368.1, 5.050371003, 3340.612426700 },
+	{ 1108216.8, 5.40099837, 6681.22485340 },
+	{ 91798.4, 5.754787, 10021.837280 },
+	{ 27745.0, 5.970495, 3.523118 },
+	{ 10610.2, 2.939585, 2281.230497 },
+	{ 12315.9, 0.849561, 2810.921462 },
+	{ 8926.8, 4.15698, 0.01725 },
+	{ 8715.7, 6.11005, 13362.44971 },
+	{ 6797.6, 0.36462, 398.14900 },
+	{ 7774.9, 3.33969, 5621.84292 },
+	{ 3575.1, 1.66187, 2544.31442 },
+	{ 4161.1, 0.22815, 2942.46342 },
+	{ 3075.2, 0.85697, 191.44827 },
+	{ 2628.1, 0.64806, 3337.08931 },
+	{ 2937.5, 6.07894, 0.06731 },
+	{ 2389.4, 5.03896, 796.29801 },
+	{ 2579.8, 0.02997, 3344.13555 },
+	{ 1528.1, 1.14979, 6151.53389 },
+	{ 1798.8, 0.65634, 529.69097 },
+	{ 1264.4, 3.62275, 5092.15196 },
+	{ 1286.2, 3.06796, 2146.16542 },
+	{ 1546.4, 2.91580, 1751.53953 },
+	{ 1024.9, 3.69334, 8962.45535 },
+	{ 891.6, 0.1829, 16703.0621 },
+	{ 858.8, 2.4009, 2914.0142 },
+	{ 832.7, 2.4642, 3340.5952 },
+	{ 832.7, 4.4950, 3340.6297 },
+	{ 712.9, 3.6634, 1059.3819 },
+	{ 748.7, 3.8225, 155.4204 },
+	{ 723.9, 0.6750, 3738.7614 },
+	{ 635.6, 2.9218, 8432.7644 },
+	{ 655.2, 0.4886, 3127.3133 },
+	{ 550.5, 3.8100, 0.9803 },
+	{ 552.7, 4.4748, 1748.0164 },
+	{ 426.0, 0.5537, 6283.0758 },
+	{ 415.1, 0.4966, 213.2991 },
+	{ 472.2, 3.6255, 1194.4470 },
+	{ 306.6, 0.3805, 6684.7480 },
+	{ 312.1, 0.9985, 6677.7017 },
+	{ 293.2, 4.2213, 20.7754 },
+	{ 302.4, 4.4862, 3532.0607 },
+	{ 274.0, 0.5422, 3340.5451 },
+	{ 281.1, 5.8816, 1349.8674 },
+	{ 231.2, 1.2824, 3870.3034 },
+	{ 283.6, 5.7689, 3149.1642 },
+	{ 236.1, 5.7550, 3333.4989 },
+	{ 274.0, 0.1337, 3340.6797 },
+	{ 299.4, 2.7832, 6254.6267 },
+	{ 204.2, 2.8213, 1221.8486 },
+	{ 238.9, 5.3716, 4136.9104 },
+	{ 188.6, 1.4910, 9492.1463 },
+	{ 221.2, 3.5047, 382.8965 },
+	{ 179.2, 1.0056, 951.7184 },
+	{ 172.1, 0.4394, 5486.7778 },
+	{ 193.1, 3.3572, 3.5904 },
+	{ 144.3, 1.4187, 135.0651 },
+	{ 160.0, 3.9485, 4562.4610 },
+	{ 174.1, 2.4136, 553.5694 },
+	{ 131.0, 4.0449, 12303.0678 },
+	{ 138.2, 4.3015, 7.1135 },
+	{ 128.1, 1.8067, 5088.6288 },
+	{ 139.9, 3.3259, 2700.7151 },
+	{ 128.1, 2.2081, 1592.5960 },
+	{ 116.9, 3.1281, 7903.0734 },
+	{ 110.4, 1.0520, 242.7286 },
+	{ 113.5, 3.7007, 1589.0729 },
+	{ 100.1, 3.2434, 11773.3768 },
+	{ 95.6, 0.540, 20043.675 },
+	{ 98.9, 4.846, 6681.242 },
+	{ 104.5, 0.7854, 8827.3903 },
+	{ 84.2, 3.990, 4399.994 },
+	{ 86.9, 2.202, 11243.686 },
+	{ 71.4, 2.803, 3185.192 },
+	{ 72.1, 5.847, 5884.927 },
+	{ 73.5, 2.184, 8429.241 },
+	{ 98.9, 2.815, 6681.208 },
+	{ 68.4, 2.738, 2288.344 },
+	{ 86.8, 1.021, 7079.374 },
+	{ 65.3, 2.681, 28.449 },
+	{ 83.7, 3.203, 4690.480 },
+	{ 75.0, 0.766, 6467.926 },
+	{ 69.0, 3.764, 6041.328 },
+	{ 66.7, 0.736, 3723.509 },
+	{ 63.3, 4.528, 426.598 },
+	{ 61.7, 6.168, 2274.117 },
+	{ 52.3, 0.899, 9623.688 },
+	{ 55.5, 4.606, 4292.331 },
+	{ 51.3, 4.148, 3341.593 },
+	{ 56.6, 5.063, 15.252 },
+	{ 63.4, 0.913, 3553.912 },
+	{ 45.8, 0.788, 1990.745 },
+	{ 48.5, 3.957, 4535.059 },
+	{ 41.2, 6.020, 3894.182 },
+	{ 41.9, 3.583, 8031.092 },
+	{ 56.4, 1.687, 6872.673 },
+	{ 55.9, 3.463, 263.084 },
+	{ 51.7, 2.813, 3339.632 },
+	{ 40.7, 3.138, 9595.239 },
+	{ 38.1, 0.734, 10025.360 },
+	{ 39.5, 5.632, 3097.884 },
+	{ 44.2, 3.195, 5628.956 },
+	{ 36.7, 2.637, 692.158 },
+	{ 45.9, 0.287, 5614.729 },
+	{ 38.4, 5.829, 3191.049 },
+	{ 38.2, 2.348, 162.467 },
+	{ 32.6, 0.484, 6681.292 },
+	{ 37.1, 0.685, 2818.035 },
+	{ 31.2, 3.982, 20.355 },
+	{ 32.6, 0.893, 6681.158 },
+	{ 37.8, 4.155, 2803.808 },
+	{ 33.6, 6.120, 6489.777 },
+	{ 29.0, 2.427, 3319.837 },
+	{ 38.8, 1.352, 10018.314 },
+	{ 33.1, 1.140, 5.523 },
+	{ 27.6, 1.597, 7210.916 },
+	{ 28.7, 5.721, 7477.523 },
+	{ 34.0, 2.595, 11769.854 },
+	{ 25.4, 0.521, 10.637 },
+	{ 26.4, 1.345, 3496.033 },
+	{ 25.6, 0.250, 522.577 },
+	{ 27.3, 4.556, 3361.388 },
+	{ 27.5, 6.084, 6674.111 },
+	{ 25.5, 3.432, 3443.705 },
+	/* 124 terms retained, 1093 terms dropped, error 1.2" */
+
+	/* mars l, T^1 */
+	{ 334085627474.3, 0, 0 },
+	{ 1458227.1, 3.60426054, 3340.61242670 },
+	{ 164901.3, 3.9263125, 6681.2248534 },
+	{ 19963.3, 4.265941, 10021.837280 },
+	{ 3452.4, 4.73210, 3.52312 },
+	{ 2485.5, 4.61278, 13362.44971 },
+	{ 841.6, 4.4586, 2281.2305 },
+	{ 537.6, 5.0159, 398.1490 },
+	{ 521.0, 4.9942, 3344.1355 },
+	{ 432.6, 2.5607, 191.4483 },
+	{ 429.7, 5.3165, 155.4204 },
+	{ 381.7, 3.5388, 796.2980 },
+	{ 314.1, 4.9634, 16703.0621 },
+	{ 282.8, 3.1597, 2544.3144 },
+	{ 205.7, 4.5689, 2146.1654 },
+	{ 168.8, 1.3289, 3337.0893 },
+	{ 157.6, 4.1850, 1751.5395 },
+	{ 133.7, 2.2333, 0.9803 },
+	{ 116.6, 2.2135, 1059.3819 },
+	{ 117.6, 6.0241, 6151.5339 },
+	{ 113.6, 5.4280, 3738.7614 },
+	{ 133.6, 5.9742, 1748.0164 },
+	{ 91.1, 1.096, 1349.867 },
+	{ 83.3, 5.296, 6684.748 },
+	{ 113.9, 2.1287, 1194.4470 },
+	{ 80.8, 4.428, 529.691 },
+	{ 79.5, 2.249, 8962.455 },
+	{ 72.5, 5.842, 242.729 },
+	{ 72.9, 2.502, 951.718 },
+	{ 71.5, 3.856, 2914.014 },
+	{ 85.3, 3.909, 553.569 },
+	{ 67.6, 5.023, 382.897 },
+	{ 65.1, 1.018, 3340.595 },
+	{ 65.1, 3.049, 3340.630 },
+	{ 61.5, 4.152, 3149.164 },
+	{ 48.5, 4.874, 213.299 },
+	{ 46.6, 1.315, 3185.192 },
+	{ 56.5, 3.888, 4136.910 },
+	{ 47.6, 1.182, 3333.499 },
+	{ 41.3, 0.714, 1592.596 },
+	{ 40.1, 5.316, 20043.675 },
+	{ 40.3, 2.725, 7.114 },
+	{ 32.9, 5.411, 6283.076 },
+	{ 28.2, 0.045, 9492.146 },
+	{ 22.3, 5.885, 3870.303 },
+	{ 22.4, 5.466, 20.355 },
+	{ 22.6, 0.838, 3097.884 },
+	{ 21.4, 5.379, 3340.545 },
+	{ 23.3, 6.168, 3532.061 },
+	{ 26.6, 3.890, 1221.849 },
+	{ 22.8, 1.545, 2274.117 },
+	{ 20.4, 2.364, 1589.073 },
+	{ 20.2, 3.364, 5088.629 },
+	{ 26.6, 5.113, 2700.715 },
+	{ 19.7, 2.578, 12303.068 },
+	{ 19.5, 0.492, 6677.702 },
+	{ 21.1, 3.525, 15.252 },
+	{ 21.4, 4.971, 3340.680 },
+	{ 18.5, 5.579, 1990.745 },
+	{ 17.8, 6.125, 4292.331 },
+	{ 16.5, 2.603, 3341.593 },
+	{ 16.6, 1.255, 3894.182 },
+	{ 19.5, 2.531, 4399.994 },
+	{ 15.0, 1.035, 2288.344 },
+	{ 20.0, 4.731, 4690.480 },
+	{ 15.4, 2.470, 4535.059 },
+	{ 20.0, 5.787, 7079.374 },
+	{ 15.3, 2.265, 3723.509 },
+	{ 14.7, 3.370, 6681.242 },
+	{ 13.5, 2.123, 5486.778 },
+	{ 12.9, 5.619, 10025.360 },
+	{ 12.7, 2.950, 3496.033 },
+	{ 13.6, 1.977, 5614.729 },
+	{ 13.0, 1.514, 5628.956 },
+	{ 14.7, 1.339, 6681.208 },
+	{ 11.4, 6.234, 135.065 },
+	{ 13.3, 3.422, 5621.843 },
+	{ 10.9, 5.282, 2818.035 },
+	{ 11.8, 3.127, 426.598 },
+	{ 10.5, 2.736, 2787.043 },
+	{ 11.1, 5.842, 2803.808 },
+	{ 11.8, 2.586, 8432.764 },
+	{ 11.9, 5.476, 3553.912 },
+	{ 8.5, 1.91, 11773.38 },
+	{ 9.7, 4.53, 6489.78 },
+	{ 8.6, 3.16, 162.47 },
+	{ 11.0, 4.158, 2388.894 },
+	{ 8.1, 1.61, 2957.72 },
+	{ 8.8, 4.23, 7477.52 },
+	{ 8.0, 5.70, 6041.33 },
+	{ 8.3, 2.18, 23.88 },
+	{ 7.7, 5.72, 9623.69 },
+	{ 8.7, 4.44, 5092.15 },
+	{ 8.4, 3.16, 3347.73 },
+	{ 6.7, 5.08, 8031.09 },
+	{ 8.7, 4.33, 3339.63 },
+	{ 7.4, 6.18, 3583.34 },
+	{ 6.4, 2.12, 5884.93 },
+	/* 98 terms retained, 588 terms dropped, error 0.26"*T */
+
+	/* mars l, T^2 */
+	{ 58015.8, 2.049795, 3340.612427 },
+	{ 54187.6, 0, 0 },
+	{ 13908.4, 2.457424, 6681.224853 },
+	{ 2465.1, 2.80000, 10021.83728 },
+	{ 398.4, 3.1412, 13362.4497 },
+	{ 222.0, 3.1944, 3.5231 },
+	{ 121.0, 0.5433, 155.4204 },
+	{ 61.5, 3.485, 16703.062 },
+	{ 53.6, 3.542, 3344.136 },
+	{ 34.3, 6.002, 2281.230 },
+	{ 31.7, 4.140, 191.448 },
+	{ 29.8, 1.999, 796.298 },
+	{ 23.2, 4.334, 242.729 },
+	{ 21.7, 3.445, 398.149 },
+	{ 16.0, 6.110, 2146.165 },
+	{ 20.4, 5.422, 553.569 },
+	{ 14.9, 6.095, 3185.192 },
+	{ 16.2, 0.657, 0.980 },
+	{ 14.3, 2.619, 1349.867 },
+	{ 14.4, 4.019, 951.718 },
+	{ 11.9, 3.861, 6684.748 },
+	{ 15.6, 1.221, 1748.016 },
+	{ 11.3, 4.718, 2544.314 },
+	{ 13.4, 0.602, 1194.447 },
+	{ 10.4, 0.250, 382.897 },
+	{ 9.5, 0.68, 1059.38 },
+	{ 9.2, 3.83, 20043.67 },
+	{ 9.0, 3.88, 3738.76 },
+	{ 7.5, 5.46, 1751.54 },
+	{ 6.5, 5.48, 1592.60 },
+	{ 6.3, 2.34, 3097.88 },
+	{ 6.9, 2.58, 3149.16 },
+	{ 5.9, 1.15, 7.11 },
+	{ 6.7, 2.38, 4136.91 },
+	{ 4.6, 4.43, 6151.53 },
+	{ 4.2, 3.69, 5614.73 },
+	{ 4.8, 2.90, 3333.50 },
+	{ 4.0, 6.12, 5628.96 },
+	{ 3.7, 4.07, 1990.75 },
+	{ 3.6, 2.47, 529.69 },
+	{ 3.3, 0.68, 8962.46 },
+	{ 3.3, 2.80, 3894.18 },
+	{ 3.1, 4.57, 3496.03 },
+	{ 2.9, 5.41, 2914.01 },
+	{ 2.9, 1.23, 2787.04 },
+	{ 2.8, 1.39, 4292.33 },
+	{ 2.6, 1.04, 3341.59 },
+	{ 2.9, 3.41, 3337.09 },
+	{ 2.4, 0.96, 4535.06 },
+	{ 2.4, 4.85, 9492.15 },
+	{ 2.6, 5.75, 3340.60 },
+	{ 2.2, 3.26, 213.30 },
+	{ 2.6, 1.50, 3340.63 },
+	{ 2.3, 4.18, 10025.36 },
+	{ 2.6, 4.68, 3583.34 },
+	{ 2.6, 2.65, 2388.89 },
+	{ 1.8, 0.97, 1589.07 },
+	{ 2.4, 1.05, 4399.99 },
+	{ 2.4, 4.27, 7079.37 },
+	{ 2.2, 0.16, 6525.80 },
+	{ 2.3, 0.01, 4690.48 },
+	{ 1.6, 4.96, 5088.63 },
+	{ 1.6, 1.11, 12303.07 },
+	{ 2.1, 0.48, 2700.72 },
+	{ 1.6, 4.94, 1221.85 },
+	{ 1.8, 3.81, 3723.51 },
+	{ 1.8, 2.52, 2810.92 },
+	/* 67 terms retained, 243 terms dropped, error 0.06"*T^2 */
+
+	/* mars l, T^3 */
+	{ 1482.4, 0.44435, 3340.61243 },
+	{ 662.1, 0.8847, 6681.2249 },
+	{ 188.3, 1.2880, 10021.8373 },
+	{ 41.5, 1.649, 13362.450 },
+	{ 22.7, 2.053, 155.420 },
+	{ 26.0, 0, 0 },
+	{ 8.0, 2.00, 16703.06 },
+	{ 10.5, 1.580, 3.523 },
+	{ 4.9, 2.82, 242.73 },
+	{ 3.8, 2.02, 3344.14 },
+	{ 3.2, 4.59, 3185.19 },
+	{ 3.1, 0.65, 553.57 },
+	{ 1.7, 5.54, 951.72 },
+	{ 1.5, 5.72, 191.45 },
+	{ 1.4, 0.46, 796.30 },
+	{ 1.4, 2.34, 20043.67 },
+	{ 1.3, 5.36, 0.98 },
+	{ 1.2, 4.15, 1349.87 },
+	{ 1.1, 2.38, 6684.75 },
+	{ 1.0, 1.77, 382.90 },
+	{ 0.9, 5.34, 1194.45 },
+	{ 0.8, 2.75, 1748.02 },
+	{ 0.6, 6.11, 3496.03 },
+	{ 0.6, 1.85, 398.15 },
+	{ 0.6, 5.86, 7.11 },
+	{ 0.6, 3.18, 3583.34 },
+	{ 0.5, 5.98, 2787.04 },
+	{ 0.5, 1.01, 3149.16 },
+	{ 0.5, 4.93, 6525.80 },
+	{ 0.4, 1.27, 2281.23 },
+	{ 0.4, 2.33, 3738.76 },
+	{ 0.5, 0.84, 4136.91 },
+	/* 32 terms retained, 97 terms dropped, error 0.011"*T^3 */
+
+	/* mars l, T^4 */
+	{ 114.0, 3.1416, 0 },
+	{ 28.7, 5.637, 6681.225 },
+	{ 24.4, 5.139, 3340.612 },
+	{ 11.2, 6.032, 10021.837 },
+	{ 3.2, 3.56, 155.42 },
+	{ 3.3, 0.13, 13362.45 },
+	{ 0.8, 0.49, 16703.06 },
+	{ 0.8, 1.32, 242.73 },
+	{ 0.5, 3.06, 3185.19 },
+	{ 0.4, 2.16, 553.57 },
+	{ 0.3, 6.23, 3.52 },
+	{ 0.2, 0.44, 3344.14 },
+	{ 0.2, 0.82, 20043.67 },
+	{ 0.2, 3.74, 3496.03 },
+	{ 0.1, 1.67, 3583.34 },
+	/* 15 terms retained, 21 terms dropped, error 0.0019"*T^4 */
+
+	/* mars l, T^5 */
+	{ 0.7, 4.04, 6681.22 },
+	{ 0.9, 3.14, 0 },
+	{ 0.5, 4.49, 10021.84 },
+	{ 0.4, 5.07, 155.42 },
+	{ 0.2, 3.51, 3340.61 },
+	{ 0.2, 4.85, 13362.45 },
+	{ 0.1, 6.09, 242.73 },
+	/* 7 terms retained, 8 terms dropped, error 0.0012"*T^5 */
+	/* end mars l */
+
+	/* mars b, T^0 */
+	{ 3197135.0, 3.76832042, 3340.61242670 },
+	{ 298033.2, 4.1061700, 6681.2248534 },
+	{ 289104.7, 0, 0 },
+	{ 31365.5, 4.446511, 10021.837280 },
+	{ 3484.1, 4.78813, 13362.44971 },
+	{ 443.0, 5.6523, 3337.0893 },
+	{ 443.4, 5.0264, 3344.1355 },
+	{ 399.1, 5.1306, 16703.0621 },
+	{ 292.5, 3.7929, 2281.2305 },
+	{ 182.0, 6.1365, 6151.5339 },
+	{ 163.2, 4.2640, 529.6910 },
+	{ 159.7, 2.2319, 1059.3819 },
+	{ 139.3, 2.4180, 8962.4553 },
+	{ 149.3, 2.1650, 5621.8429 },
+	{ 142.7, 1.1822, 3340.5952 },
+	{ 142.7, 3.2129, 3340.6297 },
+	{ 82.5, 5.367, 6684.748 },
+	{ 73.6, 5.092, 398.149 },
+	{ 72.7, 5.538, 6283.076 },
+	{ 86.4, 5.744, 3738.761 },
+	{ 83.3, 5.989, 6677.702 },
+	{ 60.1, 3.680, 796.298 },
+	{ 63.1, 0.730, 5884.927 },
+	{ 62.3, 4.851, 2942.463 },
+	{ 47.0, 5.543, 3340.545 },
+	{ 47.0, 5.135, 3340.680 },
+	{ 46.6, 5.474, 20043.675 },
+	{ 45.6, 2.133, 2810.921 },
+	{ 41.3, 0.200, 9492.146 },
+	{ 47.2, 4.522, 3149.164 },
+	{ 38.5, 4.080, 4136.910 },
+	{ 33.1, 4.066, 1751.540 },
+	{ 29.7, 5.922, 3532.061 },
+	{ 32.7, 2.621, 2914.014 },
+	{ 29.5, 2.753, 12303.068 },
+	{ 28.2, 2.063, 5486.778 },
+	{ 28.6, 4.947, 3870.303 },
+	{ 26.6, 3.551, 6681.242 },
+	{ 26.6, 1.520, 6681.208 },
+	{ 26.1, 2.601, 4399.994 },
+	/* 40 terms retained, 401 terms dropped, error 0.69" */
+
+	/* mars b, T^1 */
+	{ 350068.8, 5.3684784, 3340.6124267 },
+	{ 14116.0, 3.141593, 0 },
+	{ 9670.8, 5.47878, 6681.22485 },
+	{ 1471.9, 3.20206, 10021.83728 },
+	{ 425.9, 3.4084, 13362.4497 },
+	{ 102.0, 0.7762, 3337.0893 },
+	{ 78.8, 3.718, 16703.062 },
+	{ 26.2, 2.483, 2281.230 },
+	{ 32.7, 3.458, 5621.843 },
+	{ 20.7, 1.441, 6151.534 },
+	{ 18.3, 6.031, 529.691 },
+	{ 15.7, 3.931, 8962.455 },
+	{ 17.0, 4.811, 3344.136 },
+	{ 13.1, 0.973, 6677.702 },
+	{ 15.6, 2.782, 3340.595 },
+	{ 15.6, 4.813, 3340.630 },
+	{ 13.8, 1.680, 3532.061 },
+	{ 12.7, 4.045, 20043.675 },
+	{ 14.3, 0.246, 2942.463 },
+	{ 12.5, 2.256, 5884.927 },
+	{ 8.8, 0.34, 398.15 },
+	{ 8.6, 1.75, 2544.31 },
+	{ 8.9, 5.95, 2810.92 },
+	{ 8.1, 0.84, 6283.08 },
+	{ 9.2, 4.35, 3496.03 },
+	{ 8.1, 4.30, 6684.75 },
+	/* 26 terms retained, 261 terms dropped, error 0.17"*T */
+
+	/* mars b, T^2 */
+	{ 16726.7, 0.602214, 3340.612427 },
+	{ 4986.8, 3.14159, 0 },
+	{ 302.1, 5.5587, 6681.2249 },
+	{ 25.8, 1.897, 13362.450 },
+	{ 21.5, 0.917, 10021.837 },
+	{ 11.8, 2.242, 3337.089 },
+	{ 8.0, 2.25, 16703.06 },
+	{ 3.0, 5.89, 3496.03 },
+	{ 2.4, 5.19, 5621.84 },
+	{ 1.8, 2.59, 20043.67 },
+	/* 10 terms retained, 120 terms dropped, error 0.024"*T^2 */
+
+	/* mars b, T^3 */
+	{ 606.5, 1.9805, 3340.6124 },
+	{ 42.6, 0, 0 },
+	{ 13.7, 1.796, 6681.225 },
+	{ 2.7, 3.45, 10021.84 },
+	{ 0.9, 3.75, 3337.09 },
+	{ 0.6, 0.11, 13362.45 },
+	{ 0.6, 1.14, 3496.03 },
+	{ 0.5, 0.71, 16703.06 },
+	/* 8 terms retained, 33 terms dropped, error 0.0059"*T^3 */
+
+	/* mars b, T^4 */
+	{ 11.3, 3.457, 3340.612 },
+	{ 13.4, 0, 0 },
+	{ 0.7, 0.50, 6681.22 },
+	{ 0.1, 1.05, 10021.84 },
+	{ 0.1, 2.66, 3496.03 },
+	/* 5 terms retained, 6 terms dropped, error 0.001"*T^4 */
+
+	/* mars b, T^5 */
+	{ 0.5, 4.87, 3340.61 },
+	/* 1 terms retained, 4 terms dropped, error 0.0027"*T^5 */
+	/* end mars b */
+
+	/* mars r, T^0 */
+	{ 153033488.3, 0, 0 },
+	{ 14184953.2, 3.479712835, 3340.612426700 },
+	{ 660776.4, 3.8178344, 6681.2248534 },
+	{ 46179.1, 4.155953, 10021.837280 },
+	{ 8109.7, 5.55958, 2810.92146 },
+	{ 7485.3, 1.77239, 5621.84292 },
+	{ 5523.2, 1.36436, 2281.23050 },
+	{ 3825.2, 4.49407, 13362.44971 },
+	{ 2306.5, 0.09082, 2544.31442 },
+	{ 1999.4, 5.36060, 3337.08931 },
+	{ 2484.4, 4.92546, 2942.46342 },
+	{ 1960.2, 4.74249, 3344.13555 },
+	{ 1167.1, 2.11262, 5092.15196 },
+	{ 1102.8, 5.00908, 398.14900 },
+	{ 899.1, 4.4079, 529.6910 },
+	{ 992.3, 5.8386, 6151.5339 },
+	{ 807.3, 2.1022, 1059.3819 },
+	{ 797.9, 3.4484, 796.2980 },
+	{ 741.0, 1.4991, 2146.1654 },
+	{ 692.3, 2.1338, 8962.4553 },
+	{ 633.1, 0.8935, 3340.5952 },
+	{ 725.6, 1.2452, 8432.7644 },
+	{ 633.1, 2.9243, 3340.6297 },
+	{ 574.4, 0.8290, 2914.0142 },
+	{ 526.2, 5.3829, 3738.7614 },
+	{ 630.0, 1.2874, 1751.5395 },
+	{ 472.8, 5.1985, 3127.3133 },
+	{ 348.1, 4.8322, 16703.0621 },
+	{ 283.7, 2.9069, 3532.0607 },
+	{ 279.6, 5.2575, 6283.0758 },
+	{ 233.8, 5.1055, 5486.7778 },
+	{ 219.4, 5.5834, 191.4483 },
+	{ 269.9, 3.7639, 5884.9268 },
+	{ 208.3, 5.2548, 3340.5451 },
+	{ 275.2, 2.9082, 1748.0164 },
+	{ 275.5, 1.2177, 6254.6267 },
+	{ 239.1, 2.0367, 1194.4470 },
+	{ 223.2, 4.1986, 3149.1642 },
+	{ 182.7, 5.0806, 6684.7480 },
+	{ 186.2, 5.6987, 6677.7017 },
+	{ 176.0, 5.9534, 3870.3034 },
+	{ 178.6, 4.1842, 3333.4989 },
+	{ 208.3, 4.8463, 3340.6797 },
+	{ 228.1, 3.2553, 6872.6731 },
+	{ 144.3, 0.2130, 5088.6288 },
+	{ 163.5, 3.7989, 4136.9104 },
+	{ 133.1, 1.5391, 7903.0734 },
+	{ 141.8, 2.4779, 4562.4610 },
+	{ 114.9, 4.3175, 1349.8674 },
+	{ 118.8, 2.1218, 1589.0729 },
+	{ 102.1, 6.1814, 9492.1463 },
+	{ 128.6, 5.4988, 8827.3903 },
+	{ 111.5, 0.5534, 11243.6858 },
+	{ 82.5, 1.622, 11773.377 },
+	{ 83.2, 0.616, 8429.241 },
+	{ 84.5, 0.623, 1592.596 },
+	{ 86.7, 1.750, 2700.715 },
+	{ 71.8, 2.475, 12303.068 },
+	{ 85.3, 1.616, 4690.480 },
+	{ 63.6, 2.673, 426.598 },
+	{ 68.6, 2.402, 4399.994 },
+	{ 58.6, 4.721, 213.299 },
+	{ 62.0, 1.101, 1221.849 },
+	{ 66.5, 2.213, 6041.328 },
+	{ 55.8, 1.233, 3185.192 },
+	{ 55.0, 5.727, 951.718 },
+	{ 52.4, 3.024, 4292.331 },
+	{ 55.7, 5.447, 3723.509 },
+	{ 59.0, 3.262, 6681.242 },
+	{ 44.6, 2.015, 8031.092 },
+	{ 59.0, 1.232, 6681.208 },
+	{ 42.4, 2.266, 155.420 },
+	{ 39.0, 2.578, 3341.593 },
+	{ 51.6, 5.723, 7079.374 },
+	{ 48.9, 5.616, 3553.912 },
+	{ 45.4, 5.433, 6467.926 },
+	{ 36.4, 4.439, 3894.182 },
+	{ 36.0, 1.160, 2288.344 },
+	{ 35.3, 5.490, 1990.745 },
+	{ 42.2, 1.633, 5628.956 },
+	{ 44.3, 5.003, 5614.729 },
+	{ 33.6, 5.170, 20043.675 },
+	{ 43.3, 1.037, 11769.854 },
+	{ 39.2, 1.242, 3339.632 },
+	{ 31.9, 4.593, 2274.117 },
+	{ 30.3, 2.442, 11371.705 },
+	{ 32.3, 2.382, 4535.059 },
+	{ 31.9, 4.375, 3.523 },
+	{ 29.3, 4.060, 3097.884 },
+	{ 32.0, 1.940, 382.897 },
+	{ 26.2, 5.585, 9623.688 },
+	{ 27.9, 4.258, 3191.049 },
+	{ 33.1, 0.855, 553.569 },
+	{ 27.5, 1.577, 9595.239 },
+	{ 25.2, 0.814, 10713.995 },
+	/* 95 terms retained, 1023 terms dropped, error 4.9e-06 a.u. */
+
+	/* mars r, T^1 */
+	{ 1107433.3, 2.03250525, 3340.61242670 },
+	{ 103175.9, 2.3707185, 6681.2248534 },
+	{ 12877.2, 0, 0 },
+	{ 10815.9, 2.708881, 10021.837280 },
+	{ 1194.5, 3.04702, 13362.44971 },
+	{ 438.6, 2.8884, 2281.2305 },
+	{ 395.7, 3.4232, 3344.1355 },
+	{ 182.6, 1.5843, 2544.3144 },
+	{ 135.8, 3.3851, 16703.0621 },
+	{ 128.2, 0.6299, 1059.3819 },
+	{ 127.1, 1.9539, 796.2980 },
+	{ 118.4, 2.9976, 2146.1654 },
+	{ 128.4, 6.0434, 3337.0893 },
+	{ 87.5, 3.421, 398.149 },
+	{ 83.0, 3.856, 3738.761 },
+	{ 75.6, 4.451, 6151.534 },
+	{ 72.0, 2.764, 529.691 },
+	{ 66.5, 2.549, 1751.540 },
+	{ 54.3, 0.678, 8962.455 },
+	{ 51.0, 3.726, 6684.748 },
+	{ 66.4, 4.406, 1748.016 },
+	{ 47.9, 2.285, 2914.014 },
+	{ 49.4, 5.730, 3340.595 },
+	{ 49.4, 1.477, 3340.630 },
+	{ 57.5, 0.544, 1194.447 },
+	{ 48.3, 2.581, 3149.164 },
+	{ 36.4, 6.027, 3185.192 },
+	{ 37.2, 5.814, 1349.867 },
+	{ 36.0, 5.895, 3333.499 },
+	{ 31.1, 0.978, 191.448 },
+	{ 39.0, 2.319, 4136.910 },
+	{ 27.2, 5.414, 1592.596 },
+	{ 24.3, 3.758, 155.420 },
+	{ 22.8, 1.748, 5088.629 },
+	{ 22.3, 0.939, 951.718 },
+	{ 21.7, 3.836, 6283.076 },
+	{ 21.3, 0.780, 1589.073 },
+	{ 21.6, 4.569, 3532.061 },
+	{ 18.0, 4.219, 3870.303 },
+	{ 18.2, 0.413, 5486.778 },
+	{ 16.3, 3.808, 3340.545 },
+	{ 16.8, 5.549, 3097.884 },
+	{ 16.9, 4.537, 4292.331 },
+	{ 15.8, 4.757, 9492.146 },
+	{ 15.7, 3.724, 20043.675 },
+	{ 20.4, 3.135, 4690.480 },
+	{ 14.7, 5.953, 3894.182 },
+	{ 16.3, 3.399, 3340.680 },
+	{ 14.3, 3.999, 1990.745 },
+	{ 16.5, 0.968, 4399.994 },
+	{ 13.0, 5.142, 6677.702 },
+	{ 12.5, 1.032, 3341.593 },
+	{ 16.5, 3.539, 2700.715 },
+	{ 16.2, 2.349, 553.569 },
+	{ 13.2, 0.415, 5614.729 },
+	{ 11.3, 1.024, 12303.068 },
+	{ 12.4, 6.231, 5628.956 },
+	{ 12.7, 0.690, 3723.509 },
+	{ 11.8, 6.253, 2274.117 },
+	{ 10.4, 1.233, 426.598 },
+	{ 11.2, 1.318, 3496.033 },
+	{ 10.3, 0.901, 4535.059 },
+	{ 12.2, 4.223, 7079.374 },
+	{ 9.8, 3.45, 382.90 },
+	{ 8.6, 1.16, 2787.04 },
+	{ 7.9, 5.74, 2288.34 },
+	{ 9.2, 1.82, 6681.24 },
+	{ 7.8, 4.15, 6041.33 },
+	{ 9.2, 6.07, 6681.21 },
+	{ 9.0, 2.58, 2388.89 },
+	{ 6.8, 0.24, 11773.38 },
+	{ 7.1, 3.51, 8031.09 },
+	{ 9.2, 3.90, 3553.91 },
+	{ 6.7, 4.26, 242.73 },
+	{ 7.2, 3.70, 2818.04 },
+	{ 6.5, 0.04, 2957.72 },
+	{ 8.8, 2.20, 1221.85 },
+	{ 6.5, 2.12, 8429.24 },
+	{ 6.8, 4.05, 10025.36 },
+	{ 7.3, 4.27, 2803.81 },
+	{ 7.7, 1.01, 8432.76 },
+	{ 6.3, 1.90, 5621.84 },
+	{ 6.3, 1.60, 3347.73 },
+	{ 6.5, 2.76, 3339.63 },
+	/* 84 terms retained, 512 terms dropped, error 1.2e-06 a.u.*T */
+
+	/* mars r, T^2 */
+	{ 44242.2, 0.479306, 3340.612427 },
+	{ 8138.0, 0.86998, 6681.22485 },
+	{ 1274.9, 1.22594, 10021.83728 },
+	{ 187.4, 1.5730, 13362.4497 },
+	{ 40.7, 1.971, 3344.136 },
+	{ 52.4, 3.142, 0 },
+	{ 26.6, 1.917, 16703.062 },
+	{ 17.8, 4.435, 2281.230 },
+	{ 11.7, 4.525, 3185.192 },
+	{ 10.2, 5.391, 1059.382 },
+	{ 9.9, 0.42, 796.30 },
+	{ 9.2, 4.54, 2146.17 },
+	{ 7.3, 3.14, 2544.31 },
+	{ 7.2, 2.29, 6684.75 },
+	{ 6.8, 5.27, 155.42 },
+	{ 6.5, 2.31, 3738.76 },
+	{ 7.8, 5.93, 1748.02 },
+	{ 5.8, 1.05, 1349.87 },
+	{ 6.7, 5.30, 1194.45 },
+	{ 4.7, 0.77, 3097.88 },
+	{ 5.4, 1.00, 3149.16 },
+	{ 4.4, 2.46, 951.72 },
+	{ 4.3, 3.90, 1592.60 },
+	{ 3.5, 1.85, 398.15 },
+	{ 3.7, 2.26, 20043.67 },
+	{ 3.4, 3.82, 1751.54 },
+	{ 4.6, 0.81, 4136.91 },
+	{ 3.2, 2.12, 5614.73 },
+	{ 3.6, 1.32, 3333.50 },
+	{ 2.9, 1.19, 529.69 },
+	{ 3.0, 2.86, 6151.53 },
+	{ 3.1, 4.55, 5628.96 },
+	{ 2.9, 1.20, 3894.18 },
+	{ 3.9, 3.86, 553.57 },
+	{ 2.8, 2.49, 1990.75 },
+	{ 2.7, 6.07, 4292.33 },
+	{ 2.7, 2.92, 3496.03 },
+	{ 2.4, 5.94, 2787.04 },
+	{ 2.3, 2.56, 191.45 },
+	{ 2.2, 5.37, 8962.46 },
+	{ 2.1, 2.75, 242.73 },
+	{ 2.2, 1.85, 3337.09 },
+	{ 2.0, 5.76, 3341.59 },
+	{ 2.0, 3.82, 2914.01 },
+	{ 1.8, 5.69, 1589.07 },
+	{ 1.8, 3.32, 5088.63 },
+	{ 2.4, 4.68, 4690.48 },
+	{ 2.0, 4.17, 3340.60 },
+	{ 2.0, 6.21, 3340.63 },
+	{ 1.6, 5.68, 4535.06 },
+	{ 2.2, 1.07, 2388.89 },
+	{ 2.0, 3.11, 3583.34 },
+	{ 2.0, 5.76, 4399.99 },
+	/* 53 terms retained, 260 terms dropped, error 2.9e-07 a.u.*T^2 */
+
+	/* mars r, T^3 */
+	{ 1113.1, 5.14987, 3340.61243 },
+	{ 424.4, 5.6134, 6681.2249 },
+	{ 100.0, 5.9973, 10021.8373 },
+	{ 19.6, 0.076, 13362.450 },
+	{ 3.5, 0.43, 16703.06 },
+	{ 4.7, 3.14, 0 },
+	{ 2.9, 0.45, 3344.14 },
+	{ 2.4, 3.02, 3185.19 },
+	{ 0.7, 0.81, 6684.75 },
+	{ 0.5, 3.87, 1059.38 },
+	{ 0.6, 0.78, 20043.67 },
+	{ 0.5, 4.52, 3496.03 },
+	{ 0.5, 1.61, 3583.34 },
+	{ 0.4, 5.72, 3149.16 },
+	/* 14 terms retained, 97 terms dropped, error 3.1e-08 a.u.*T^3 */
+
+	/* mars r, T^4 */
+	{ 19.6, 3.582, 3340.612 },
+	{ 16.3, 4.051, 6681.225 },
+	{ 5.8, 4.46, 10021.84 },
+	{ 1.5, 4.84, 13362.45 },
+	{ 0.4, 1.51, 3185.19 },
+	{ 0.3, 5.21, 16703.06 },
+	{ 0.2, 5.16, 3344.14 },
+	{ 0.1, 2.19, 3496.03 },
+	{ 0.1, 0, 0 },
+	/* 9 terms retained, 19 terms dropped, error 9.4e-09 a.u.*T^4 */
+
+	/* mars r, T^5 */
+	{ 0.5, 2.48, 6681.22 },
+	{ 0.3, 2.92, 10021.84 },
+	{ 0.1, 1.77, 3340.61 },
+	/* 3 terms retained, 6 terms dropped, error 4.6e-09 a.u.*T^5 */
+	/* end mars */
+};
+
+int vn_mars[][3] = {
+	/* addresses for mars l, b, r  */
+	/* T^0 */ { 0, 343, 433, },
+	/* T^1 */ { 124, 383, 528, },
+	/* T^2 */ { 222, 409, 612, },
+	/* T^3 */ { 289, 419, 665, },
+	/* T^4 */ { 321, 427, 679, },
+	/* T^5 */ { 336, 432, 688, },
+	/* end */ { 343, 433, 691, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_mercury[][3] = {
+	/* mercury l, T^0 */
+	{ 440250710.1, 0, 0 },
+	{ 40989415.0, 1.483020342, 26087.903141574 },
+	{ 5046294.2, 4.47785490, 52175.80628315 },
+	{ 855346.8, 1.1652032, 78263.7094247 },
+	{ 165590.4, 4.1196916, 104351.6125663 },
+	{ 34561.9, 0.779308, 130439.515708 },
+	{ 7583.5, 3.71348, 156527.41885 },
+	{ 3559.7, 1.51203, 1109.37855 },
+	{ 1726.0, 0.35832, 182615.32199 },
+	{ 1803.5, 4.10333, 5661.33205 },
+	{ 1364.7, 4.59918, 27197.28169 },
+	{ 1589.9, 2.99510, 25028.52121 },
+	{ 1017.3, 0.88031, 31749.23519 },
+	{ 714.2, 1.5414, 24978.5246 },
+	{ 643.8, 5.3027, 21535.9496 },
+	{ 404.2, 3.2823, 208703.2251 },
+	{ 352.4, 5.2416, 20426.5711 },
+	{ 343.3, 5.7653, 955.5997 },
+	{ 339.2, 5.8633, 25558.2122 },
+	{ 451.1, 6.0499, 51116.4244 },
+	{ 325.3, 1.3367, 53285.1848 },
+	{ 259.6, 0.9873, 4551.9535 },
+	{ 345.2, 2.7921, 15874.6176 },
+	{ 272.9, 2.4945, 529.6910 },
+	{ 234.8, 0.2667, 11322.6641 },
+	{ 238.8, 0.1134, 1059.3819 },
+	{ 264.3, 3.9171, 57837.1383 },
+	{ 216.6, 0.6599, 13521.7514 },
+	{ 183.4, 2.6288, 27043.5029 },
+	{ 176.0, 4.5364, 51066.4277 },
+	{ 181.6, 2.4341, 25661.3050 },
+	{ 209.0, 2.0918, 47623.8528 },
+	{ 172.6, 2.4520, 24498.8302 },
+	{ 142.3, 3.3600, 37410.5672 },
+	{ 137.9, 0.2910, 10213.2855 },
+	{ 118.2, 2.7815, 77204.3275 },
+	{ 96.9, 6.204, 234791.128 },
+	{ 125.2, 3.7208, 39609.6546 },
+	{ 86.8, 2.642, 51646.115 },
+	{ 86.7, 1.960, 46514.474 },
+	{ 88.3, 5.413, 26617.594 },
+	{ 106.4, 4.2057, 19804.8273 },
+	{ 90.0, 5.852, 41962.521 },
+	{ 85.0, 4.331, 79373.088 },
+	{ 69.2, 4.194, 19.670 },
+	{ 63.5, 3.147, 7238.676 },
+	{ 68.5, 0.634, 83925.041 },
+	{ 69.7, 3.572, 25132.303 },
+	{ 59.5, 2.747, 16983.996 },
+	{ 64.8, 0.048, 33326.579 },
+	{ 55.4, 4.053, 30639.857 },
+	{ 54.4, 3.143, 27147.285 },
+	{ 47.6, 5.497, 3.881 },
+	{ 49.6, 3.990, 6770.711 },
+	{ 56.5, 5.119, 73711.756 },
+	{ 41.8, 5.642, 53131.406 },
+	{ 51.5, 5.478, 50586.733 },
+	{ 44.7, 1.224, 77154.331 },
+	{ 41.9, 5.193, 6283.076 },
+	{ 38.0, 2.431, 12566.152 },
+	{ 35.6, 0.814, 32858.614 },
+	{ 48.0, 5.493, 51749.208 },
+	{ 35.4, 3.370, 36301.189 },
+	{ 34.0, 2.786, 14765.239 },
+	{ 30.6, 5.840, 43071.899 },
+	{ 36.0, 1.424, 2218.757 },
+	{ 34.0, 0.475, 65697.558 },
+	{ 30.8, 5.770, 103292.231 },
+	{ 28.5, 0.650, 426.598 },
+	{ 26.2, 5.242, 22645.328 },
+	{ 26.3, 0.648, 1589.073 },
+	{ 29.5, 0.698, 213.299 },
+	{ 27.5, 0.980, 45892.730 },
+	{ 26.8, 1.061, 3442.575 },
+	{ 27.1, 0.085, 63498.470 },
+	/* 75 terms retained, 1305 terms dropped, error 0.97" */
+
+	/* mercury l, T^1 */
+	{ 2608814706222.7, 0, 0 },
+	{ 1126007.8, 6.21703971, 26087.90314157 },
+	{ 303471.4, 3.0556547, 52175.8062831 },
+	{ 80538.5, 6.104547, 78263.709425 },
+	{ 21245.0, 2.835319, 104351.612566 },
+	{ 5592.1, 5.82676, 130439.51571 },
+	{ 1472.2, 2.51845, 156527.41885 },
+	{ 352.2, 3.0524, 1109.3786 },
+	{ 388.3, 5.4804, 182615.3220 },
+	{ 93.5, 6.118, 27197.282 },
+	{ 90.6, 0.000, 24978.525 },
+	{ 102.7, 2.1488, 208703.2251 },
+	{ 51.9, 5.621, 5661.332 },
+	{ 44.4, 4.573, 25028.521 },
+	{ 28.1, 3.042, 51066.428 },
+	{ 22.0, 0.865, 955.600 },
+	{ 27.3, 5.092, 234791.128 },
+	{ 20.4, 3.715, 20426.571 },
+	{ 20.2, 0.519, 21535.950 },
+	{ 17.5, 5.727, 4551.953 },
+	{ 16.7, 1.351, 529.691 },
+	{ 15.3, 1.792, 11322.664 },
+	{ 15.4, 5.743, 19.670 },
+	{ 14.0, 3.594, 24498.830 },
+	{ 12.8, 2.696, 53285.185 },
+	{ 12.6, 3.895, 3.881 },
+	{ 12.6, 4.705, 1059.382 },
+	{ 8.0, 4.18, 26617.59 },
+	{ 7.9, 0.50, 46514.47 },
+	{ 8.0, 3.93, 27043.50 },
+	{ 7.7, 2.48, 57837.14 },
+	{ 8.6, 6.06, 77154.33 },
+	{ 6.8, 2.77, 7.11 },
+	{ 6.6, 5.53, 6770.71 },
+	{ 7.3, 1.75, 260879.03 },
+	{ 7.2, 2.98, 2218.76 },
+	{ 6.4, 2.14, 25132.30 },
+	/* 37 terms retained, 802 terms dropped, error 0.16"*T */
+
+	/* mercury l, T^2 */
+	{ 53049.8, 0, 0 },
+	{ 16903.7, 4.690723, 26087.903142 },
+	{ 7396.7, 1.34736, 52175.80628 },
+	{ 3018.3, 4.45644, 78263.70942 },
+	{ 1107.4, 1.26227, 104351.61257 },
+	{ 378.2, 4.3200, 130439.5157 },
+	{ 123.0, 1.0687, 156527.4188 },
+	{ 38.7, 4.080, 182615.322 },
+	{ 14.9, 4.633, 1109.379 },
+	{ 11.9, 0.792, 208703.225 },
+	{ 5.2, 4.72, 24978.52 },
+	{ 3.6, 3.77, 234791.13 },
+	{ 2.6, 1.44, 27197.28 },
+	{ 2.0, 1.50, 51066.43 },
+	/* 14 terms retained, 381 terms dropped, error 0.033"*T^2 */
+
+	/* mercury l, T^3 */
+	{ 188.1, 0.0347, 52175.8063 },
+	{ 142.2, 3.1251, 26087.9031 },
+	{ 96.9, 3.004, 78263.709 },
+	{ 43.7, 6.019, 104351.613 },
+	{ 35.4, 0, 0 },
+	{ 18.0, 2.775, 130439.516 },
+	{ 7.0, 5.82, 156527.42 },
+	{ 2.6, 2.57, 182615.32 },
+	{ 0.9, 5.59, 208703.23 },
+	/* 9 terms retained, 144 terms dropped, error 0.012"*T^3 */
+
+	/* mercury l, T^4 */
+	{ 114.1, 3.1416, 0 },
+	{ 3.2, 2.03, 26087.90 },
+	{ 1.9, 1.42, 78263.71 },
+	{ 1.7, 4.50, 52175.81 },
+	{ 1.2, 4.50, 104351.61 },
+	{ 0.6, 1.27, 130439.52 },
+	{ 0.3, 4.31, 156527.42 },
+	{ 0.1, 1.06, 182615.32 },
+	/* 8 terms retained, 20 terms dropped, error 0.0016"*T^4 */
+
+	/* mercury l, T^5 */
+	{ 0.9, 3.14, 0 },
+	/* 1 terms retained, 12 terms dropped, error 0.0051"*T^5 */
+	/* end mercury l */
+
+	/* mercury b, T^0 */
+	{ 11737529.0, 1.983574988, 26087.903141574 },
+	{ 2388077.0, 5.03738960, 52175.80628315 },
+	{ 1222839.5, 3.14159265, 0 },
+	{ 543251.8, 1.7964436, 78263.7094247 },
+	{ 129778.8, 4.8323250, 104351.6125663 },
+	{ 31866.9, 1.580885, 130439.515708 },
+	{ 7963.3, 4.60972, 156527.41885 },
+	{ 2014.2, 1.35324, 182615.32199 },
+	{ 514.0, 4.3784, 208703.2251 },
+	{ 207.7, 4.9177, 27197.2817 },
+	{ 208.6, 2.0202, 24978.5246 },
+	{ 132.0, 1.1191, 234791.1283 },
+	{ 100.5, 5.6568, 20426.5711 },
+	{ 121.4, 1.8127, 53285.1848 },
+	{ 91.6, 2.282, 25028.521 },
+	{ 99.2, 0.094, 51116.424 },
+	{ 94.6, 1.242, 31749.235 },
+	{ 78.8, 4.407, 57837.138 },
+	{ 77.7, 0.526, 1059.382 },
+	{ 84.3, 5.085, 51066.428 },
+	{ 49.9, 3.498, 5661.332 },
+	{ 46.5, 3.237, 77204.327 },
+	{ 44.8, 4.878, 79373.088 },
+	{ 40.8, 2.466, 46514.474 },
+	{ 37.4, 4.458, 4551.953 },
+	{ 34.1, 4.142, 260879.031 },
+	{ 35.9, 1.091, 1109.379 },
+	{ 32.0, 1.185, 83925.041 },
+	{ 31.0, 3.503, 21535.950 },
+	{ 31.8, 2.415, 47623.853 },
+	{ 28.7, 1.848, 77154.331 },
+	{ 25.8, 2.776, 27043.503 },
+	{ 25.2, 3.591, 27147.285 },
+	/* 33 terms retained, 785 terms dropped, error 0.61" */
+
+	/* mercury b, T^1 */
+	{ 429151.4, 3.5016978, 26087.9031416 },
+	{ 146233.7, 3.1415927, 0 },
+	{ 22675.3, 0.015154, 52175.806283 },
+	{ 10895.0, 0.485402, 78263.709425 },
+	{ 6353.5, 3.42944, 104351.61257 },
+	{ 2495.7, 0.16051, 130439.51571 },
+	{ 859.6, 3.1845, 156527.4188 },
+	{ 277.5, 6.2102, 182615.3220 },
+	{ 86.2, 2.952, 208703.225 },
+	{ 26.1, 5.977, 234791.128 },
+	{ 27.7, 0.291, 27197.282 },
+	{ 12.8, 3.377, 53285.185 },
+	{ 12.7, 0.538, 24978.525 },
+	{ 7.8, 2.72, 260879.03 },
+	{ 7.5, 3.58, 51066.43 },
+	/* 15 terms retained, 479 terms dropped, error 0.12"*T */
+
+	/* mercury b, T^2 */
+	{ 11830.9, 4.790656, 26087.903142 },
+	{ 1913.5, 0, 0 },
+	{ 1044.8, 1.21217, 52175.80628 },
+	{ 266.2, 4.4342, 78263.7094 },
+	{ 170.3, 1.6226, 104351.6126 },
+	{ 96.3, 4.800, 130439.516 },
+	{ 44.7, 1.608, 156527.419 },
+	{ 18.3, 4.669, 182615.322 },
+	{ 6.9, 1.43, 208703.23 },
+	{ 2.5, 4.47, 234791.13 },
+	{ 1.7, 1.83, 27197.28 },
+	/* 11 terms retained, 219 terms dropped, error 0.025"*T^2 */
+
+	/* mercury b, T^3 */
+	{ 235.4, 0.3539, 26087.9031 },
+	{ 160.5, 0, 0 },
+	{ 18.9, 4.363, 52175.806 },
+	{ 6.4, 2.51, 78263.71 },
+	{ 4.6, 6.14, 104351.61 },
+	{ 3.1, 3.12, 130439.52 },
+	{ 1.7, 6.27, 156527.42 },
+	{ 0.9, 3.08, 182615.32 },
+	/* 8 terms retained, 45 terms dropped, error 0.011"*T^3 */
+
+	/* mercury b, T^4 */
+	{ 4.3, 1.75, 26087.90 },
+	{ 1.0, 3.14, 0 },
+	{ 0.4, 4.03, 52175.81 },
+	{ 0.3, 0.21, 78263.71 },
+	{ 0.1, 3.75, 104351.61 },
+	/* 5 terms retained, 10 terms dropped, error 0.0012"*T^4 */
+
+	/* mercury b, T^5 */
+	{ 0.1, 3.95, 26087.90 },
+	/* 1 terms retained, 9 terms dropped, error 0.00062"*T^5 */
+	/* end mercury b */
+
+	/* mercury r, T^0 */
+	{ 39528271.7, 0, 0 },
+	{ 7834131.8, 6.19233723, 26087.90314157 },
+	{ 795525.6, 2.9598969, 52175.8062831 },
+	{ 121281.8, 6.0106415, 78263.7094247 },
+	{ 21922.0, 2.778201, 104351.612566 },
+	{ 4354.1, 5.82895, 130439.51571 },
+	{ 918.2, 2.5965, 156527.4188 },
+	{ 260.0, 3.0282, 27197.2817 },
+	{ 290.0, 1.4244, 25028.5212 },
+	{ 201.9, 5.6473, 182615.3220 },
+	{ 201.5, 5.5923, 31749.2352 },
+	{ 142.0, 6.2526, 24978.5246 },
+	{ 100.1, 3.7344, 21535.9496 },
+	{ 77.6, 3.670, 20426.571 },
+	{ 63.3, 4.299, 25558.212 },
+	{ 63.0, 4.766, 1059.382 },
+	{ 66.8, 2.525, 5661.332 },
+	{ 75.5, 4.474, 51116.424 },
+	{ 48.3, 6.068, 53285.185 },
+	{ 45.7, 2.415, 208703.225 },
+	{ 35.2, 1.059, 27043.503 },
+	{ 40.8, 2.359, 57837.138 },
+	{ 44.2, 1.220, 15874.618 },
+	{ 33.9, 0.864, 25661.305 },
+	{ 37.2, 0.517, 47623.853 },
+	{ 30.1, 1.795, 37410.567 },
+	{ 28.4, 3.021, 51066.428 },
+	{ 30.9, 0.884, 24498.830 },
+	{ 26.1, 2.150, 39609.655 },
+	/* 29 terms retained, 1186 terms dropped, error 2.9e-06 a.u. */
+
+	/* mercury r, T^1 */
+	{ 217347.7, 4.6561716, 26087.9031416 },
+	{ 44141.8, 1.423855, 52175.806283 },
+	{ 10094.5, 4.474663, 78263.709425 },
+	{ 2432.8, 1.24226, 104351.61257 },
+	{ 1624.4, 0, 0 },
+	{ 604.0, 4.2930, 130439.5157 },
+	{ 152.9, 1.0606, 156527.4188 },
+	{ 39.2, 4.111, 182615.322 },
+	{ 17.8, 4.544, 27197.282 },
+	{ 18.0, 4.712, 24978.525 },
+	{ 10.2, 0.879, 208703.225 },
+	{ 8.1, 3.01, 25028.52 },
+	/* 12 terms retained, 699 terms dropped, error 5.8e-07 a.u.*T */
+
+	/* mercury r, T^2 */
+	{ 3117.9, 3.08232, 26087.90314 },
+	{ 1245.4, 6.15183, 52175.80628 },
+	{ 424.8, 2.9258, 78263.7094 },
+	{ 136.1, 5.9798, 104351.6126 },
+	{ 42.2, 2.749, 130439.516 },
+	{ 21.8, 3.142, 0 },
+	{ 12.8, 5.801, 156527.419 },
+	{ 3.8, 2.57, 182615.32 },
+	/* 8 terms retained, 318 terms dropped, error 2.3e-07 a.u.*T^2 */
+
+	/* mercury r, T^3 */
+	{ 32.7, 1.680, 26087.903 },
+	{ 24.2, 4.634, 52175.806 },
+	{ 12.1, 1.390, 78263.709 },
+	{ 5.1, 4.44, 104351.61 },
+	{ 2.0, 1.21, 130439.52 },
+	{ 1.5, 3.14, 0 },
+	{ 0.7, 4.26, 156527.42 },
+	/* 7 terms retained, 112 terms dropped, error 4.1e-08 a.u.*T^3 */
+
+	/* mercury r, T^4 */
+	{ 0.4, 0.37, 26087.90 },
+	{ 0.4, 3.19, 52175.81 },
+	{ 0.3, 6.17, 78263.71 },
+	{ 0.1, 2.92, 104351.61 },
+	/* 4 terms retained, 14 terms dropped, error 6.7e-09 a.u.*T^4 */
+
+	/* mercury r, T^5 */
+	/* 0 terms retained, 10 terms dropped, error 1.2e-10 a.u.*T^5 */
+	/* end mercury */
+};
+
+int vn_mercury[][3] = {
+	/* addresses for mercury l, b, r  */
+	/* T^0 */ { 0, 144, 217, },
+	/* T^1 */ { 75, 177, 246, },
+	/* T^2 */ { 112, 192, 258, },
+	/* T^3 */ { 126, 203, 266, },
+	/* T^4 */ { 135, 211, 273, },
+	/* T^5 */ { 143, 216, 277, },
+	/* end */ { 144, 217, 0, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_neptune[][3] = {
+	/* neptune l, T^0 */
+	{ 531188633.0, 0, 0 },
+	{ 1798475.5, 2.90101273, 38.13303564 },
+	{ 1019727.7, 0.48580924, 1.48447271 },
+	{ 124531.8, 4.8300809, 36.6485629 },
+	{ 42064.4, 5.410550, 2.968945 },
+	{ 37714.6, 6.092218, 35.164090 },
+	{ 33784.7, 1.244889, 76.266071 },
+	{ 16482.7, 0.000077, 491.557929 },
+	{ 9198.6, 4.93747, 39.61751 },
+	{ 8994.2, 0.27462, 175.16606 },
+	{ 4216.2, 1.98712, 73.29713 },
+	{ 3364.8, 1.03590, 33.67962 },
+	{ 2284.8, 4.20607, 4.45342 },
+	{ 1433.5, 2.78340, 74.78160 },
+	{ 900.2, 2.0761, 109.9457 },
+	{ 745.0, 3.1903, 71.8127 },
+	{ 506.2, 5.7479, 114.3991 },
+	{ 399.6, 0.3497, 1021.2489 },
+	{ 345.2, 3.4619, 41.1020 },
+	{ 306.3, 0.4968, 0.5213 },
+	{ 287.3, 4.5052, 0.0482 },
+	{ 323.0, 2.2482, 32.1951 },
+	{ 340.3, 3.3037, 77.7505 },
+	{ 266.6, 4.8893, 0.9632 },
+	{ 227.1, 1.7971, 453.4249 },
+	{ 244.7, 1.2469, 9.5612 },
+	{ 232.9, 2.5046, 137.0330 },
+	{ 282.2, 2.2457, 146.5943 },
+	{ 251.9, 5.7817, 388.4652 },
+	{ 150.2, 2.9971, 5.9379 },
+	{ 170.4, 3.3239, 108.4612 },
+	{ 151.4, 2.1915, 33.9402 },
+	{ 148.3, 0.8595, 111.4302 },
+	{ 118.7, 3.6771, 2.4477 },
+	{ 101.8, 5.7054, 0.1119 },
+	{ 97.9, 2.805, 8.077 },
+	{ 103.1, 4.4044, 70.3282 },
+	{ 103.3, 0.0408, 0.2606 },
+	{ 109.3, 2.4160, 183.2428 },
+	{ 73.9, 1.328, 529.691 },
+	{ 77.7, 4.164, 4.193 },
+	{ 86.4, 4.228, 490.073 },
+	{ 81.5, 5.199, 493.042 },
+	{ 71.5, 5.295, 350.332 },
+	{ 64.4, 3.545, 168.053 },
+	{ 62.6, 0.150, 182.280 },
+	{ 58.5, 3.501, 145.110 },
+	{ 48.3, 1.113, 112.915 },
+	{ 47.2, 4.574, 46.210 },
+	{ 39.1, 1.666, 213.299 },
+	{ 47.7, 0.129, 484.444 },
+	{ 46.9, 3.017, 498.671 },
+	{ 38.7, 2.387, 2.921 },
+	{ 47.0, 4.498, 173.682 },
+	{ 47.6, 2.584, 219.891 },
+	{ 44.7, 5.473, 176.651 },
+	{ 32.3, 3.458, 30.711 },
+	{ 28.2, 4.133, 6.592 },
+	/* 58 terms retained, 365 terms dropped, error 0.9" */
+
+	/* neptune l, T^1 */
+	{ 3837687716.7, 0, 0 },
+	{ 16604.2, 4.863191, 1.484473 },
+	{ 15807.1, 2.279235, 38.133036 },
+	{ 3334.7, 3.68200, 76.26607 },
+	{ 1305.8, 3.67321, 2.96895 },
+	{ 604.8, 1.5048, 35.1641 },
+	{ 178.6, 3.4532, 39.6175 },
+	{ 106.5, 2.4513, 4.4534 },
+	{ 105.7, 2.7548, 33.6796 },
+	{ 72.7, 5.487, 36.649 },
+	{ 57.1, 5.216, 0.521 },
+	{ 57.4, 1.858, 114.399 },
+	{ 35.4, 4.517, 74.782 },
+	{ 32.2, 5.904, 77.751 },
+	{ 29.9, 3.670, 388.465 },
+	{ 28.9, 5.169, 9.561 },
+	{ 28.7, 5.167, 2.448 },
+	{ 25.5, 5.245, 168.053 },
+	{ 24.9, 4.732, 182.280 },
+	{ 20.2, 5.789, 1021.249 },
+	{ 19.0, 1.830, 484.444 },
+	{ 18.7, 1.316, 498.671 },
+	{ 15.1, 4.950, 137.033 },
+	{ 15.1, 3.987, 32.195 },
+	{ 10.7, 2.441, 4.193 },
+	{ 11.7, 4.893, 71.813 },
+	{ 9.6, 1.23, 5.94 },
+	{ 9.6, 1.89, 41.10 },
+	{ 9.0, 0.02, 8.08 },
+	{ 9.9, 6.08, 7.11 },
+	{ 7.6, 5.51, 73.30 },
+	{ 7.0, 0.62, 2.92 },
+	/* 32 terms retained, 151 terms dropped, error 0.17"*T */
+
+	/* neptune l, T^2 */
+	{ 53892.6, 0, 0 },
+	{ 281.3, 1.1908, 38.1330 },
+	{ 295.7, 1.8552, 1.4845 },
+	{ 270.2, 5.7214, 76.2661 },
+	{ 23.0, 1.210, 2.969 },
+	{ 7.3, 0.54, 2.45 },
+	{ 9.1, 4.43, 35.16 },
+	{ 5.2, 0.67, 168.05 },
+	{ 5.2, 3.02, 182.28 },
+	{ 4.3, 3.84, 114.40 },
+	{ 3.9, 3.53, 484.44 },
+	{ 3.7, 5.90, 498.67 },
+	{ 3.0, 0.31, 4.45 },
+	{ 3.4, 0.56, 74.78 },
+	{ 3.3, 1.85, 175.17 },
+	{ 2.2, 1.89, 388.47 },
+	{ 2.2, 4.38, 7.11 },
+	{ 1.8, 3.49, 9.56 },
+	{ 2.5, 4.69, 491.56 },
+	{ 1.8, 5.12, 33.68 },
+	{ 2.2, 1.69, 77.75 },
+	{ 1.7, 2.56, 36.65 },
+	/* 22 terms retained, 35 terms dropped, error 0.033"*T^2 */
+
+	/* neptune l, T^3 */
+	{ 31.3, 0, 0 },
+	{ 12.5, 6.044, 1.484 },
+	{ 14.5, 1.353, 76.266 },
+	{ 11.5, 6.113, 38.133 },
+	{ 1.4, 4.94, 2.97 },
+	{ 0.7, 2.36, 168.05 },
+	{ 0.7, 1.27, 182.28 },
+	{ 0.5, 5.24, 484.44 },
+	{ 0.5, 4.17, 498.67 },
+	{ 0.7, 0.56, 31.02 },
+	/* 10 terms retained, 5 terms dropped, error 0.0091"*T^3 */
+
+	/* neptune l, T^4 */
+	{ 114.0, 3.1416, 0 },
+	{ 0.6, 3.18, 76.27 },
+	/* 2 terms retained, 0 terms dropped, error 0.0043"*T^4 */
+
+	/* neptune l, T^5 */
+	{ 0.9, 3.14, 0 },
+	/* 1 terms retained, 0 terms dropped, error 0.0051"*T^5 */
+	/* end neptune l */
+
+	/* neptune b, T^0 */
+	{ 3088622.9, 1.44104373, 38.13303564 },
+	{ 27780.1, 5.912719, 76.266071 },
+	{ 27623.6, 0, 0 },
+	{ 15355.5, 2.521238, 36.648563 },
+	{ 15448.1, 3.508771, 39.617508 },
+	{ 1999.9, 1.50999, 74.78160 },
+	{ 1967.5, 4.37778, 1.48447 },
+	{ 1015.1, 3.21561, 35.16409 },
+	{ 605.8, 2.8025, 73.2971 },
+	{ 594.9, 2.1289, 41.1020 },
+	{ 588.8, 3.1866, 2.9689 },
+	{ 401.8, 4.1688, 114.3991 },
+	{ 254.3, 3.2712, 453.4249 },
+	{ 261.6, 3.7672, 213.2991 },
+	{ 280.0, 1.6817, 77.7505 },
+	{ 205.6, 4.2565, 529.6910 },
+	{ 140.5, 3.5297, 137.0330 },
+	{ 98.5, 4.168, 33.680 },
+	{ 51.3, 1.951, 4.453 },
+	{ 68.0, 4.670, 71.813 },
+	{ 41.9, 5.418, 111.430 },
+	{ 41.8, 5.948, 112.915 },
+	{ 30.6, 0.936, 42.586 },
+	/* 23 terms retained, 149 terms dropped, error 0.62" */
+
+	/* neptune b, T^1 */
+	{ 227279.2, 3.8079309, 38.1330356 },
+	{ 1803.1, 1.97576, 76.26607 },
+	{ 1385.7, 4.82556, 36.64856 },
+	{ 1433.3, 3.14159, 0 },
+	{ 1073.3, 6.08054, 39.61751 },
+	{ 147.9, 3.8577, 74.7816 },
+	{ 136.4, 0.4776, 1.4845 },
+	{ 70.3, 6.188, 35.164 },
+	{ 51.9, 5.052, 73.297 },
+	{ 37.3, 4.895, 41.102 },
+	{ 42.6, 0.307, 114.399 },
+	{ 37.1, 5.760, 2.969 },
+	{ 26.4, 5.216, 213.299 },
+	{ 16.9, 4.265, 77.751 },
+	{ 18.7, 0.904, 453.425 },
+	{ 13.0, 6.177, 529.691 },
+	{ 10.5, 1.203, 137.033 },
+	/* 17 terms retained, 65 terms dropped, error 0.18"*T */
+
+	/* neptune b, T^2 */
+	{ 9690.8, 5.57124, 38.13304 },
+	{ 78.8, 3.627, 76.266 },
+	{ 71.5, 0.455, 36.649 },
+	{ 58.6, 3.142, 0 },
+	{ 29.9, 1.607, 39.618 },
+	{ 6.5, 5.61, 74.78 },
+	{ 5.8, 2.25, 1.48 },
+	{ 4.3, 1.68, 35.16 },
+	{ 3.5, 2.39, 114.40 },
+	{ 2.6, 0.65, 73.30 },
+	/* 10 terms retained, 15 terms dropped, error 0.036"*T^2 */
+
+	/* neptune b, T^3 */
+	{ 273.4, 1.0169, 38.1330 },
+	{ 2.3, 2.37, 36.65 },
+	{ 2.0, 5.33, 76.27 },
+	{ 2.4, 0, 0 },
+	{ 0.5, 3.22, 39.62 },
+	/* 5 terms retained, 4 terms dropped, error 0.0054"*T^3 */
+
+	/* neptune b, T^4 */
+	{ 5.7, 2.67, 38.13 },
+	/* 1 terms retained, 0 terms dropped, error 0.033"*T^4 */
+
+	/* neptune b, T^5 */
+	{ 0.1, 4.71, 38.13 },
+	/* 1 terms retained, 0 terms dropped, error 0.00066"*T^5 */
+	/* end neptune b */
+
+	/* neptune r, T^0 */
+	{ 3007013206.1, 0, 0 },
+	{ 27062259.5, 1.329994589, 38.133035638 },
+	{ 1691764.3, 3.25186139, 36.64856293 },
+	{ 807830.7, 5.1859284, 1.4844727 },
+	{ 537760.6, 4.5211390, 35.1640902 },
+	{ 495725.6, 1.5710565, 491.5579295 },
+	{ 274572.0, 1.8455226, 175.1660598 },
+	{ 135134.1, 3.3722061, 39.6175083 },
+	{ 121801.8, 5.7975444, 76.2660713 },
+	{ 100895.4, 0.3770275, 73.2971259 },
+	{ 69791.7, 3.796172, 2.968945 },
+	{ 46687.8, 5.749378, 33.679618 },
+	{ 24593.8, 0.508017, 109.945689 },
+	{ 16939.2, 1.594222, 71.812653 },
+	{ 14229.7, 1.077861, 74.781599 },
+	{ 12011.8, 1.920621, 1021.248895 },
+	{ 8394.7, 0.67817, 146.59425 },
+	{ 7571.8, 1.07149, 388.46516 },
+	{ 5720.9, 2.59060, 4.45342 },
+	{ 4839.7, 1.90686, 41.10198 },
+	{ 4483.5, 2.90573, 529.69097 },
+	{ 4270.2, 3.41344, 453.42489 },
+	{ 4353.8, 0.67986, 32.19514 },
+	{ 4420.8, 1.74994, 108.46122 },
+	{ 2881.1, 1.98600, 137.03302 },
+	{ 2635.5, 3.09756, 213.29910 },
+	{ 3380.9, 0.84811, 183.24281 },
+	{ 2878.9, 3.67416, 350.33212 },
+	{ 2306.3, 2.80963, 70.32818 },
+	{ 2530.1, 5.79840, 490.07346 },
+	{ 2523.1, 0.48631, 493.04240 },
+	{ 2087.3, 0.61858, 33.94025 },
+	{ 1976.5, 5.11703, 168.05251 },
+	{ 1905.3, 1.72186, 182.27961 },
+	{ 1654.0, 1.92783, 145.10978 },
+	{ 1435.1, 1.70005, 484.44438 },
+	{ 1403.0, 4.58914, 498.67148 },
+	{ 1499.2, 1.01623, 219.89138 },
+	{ 1398.9, 0.76220, 176.65053 },
+	{ 1403.4, 6.07659, 173.68159 },
+	{ 1128.6, 5.96661, 9.56123 },
+	{ 1228.3, 1.59881, 77.75054 },
+	{ 835.4, 3.9707, 114.3991 },
+	{ 811.2, 3.0026, 46.2098 },
+	{ 731.9, 2.1045, 181.7583 },
+	{ 615.8, 2.9787, 106.9767 },
+	{ 704.8, 1.1874, 256.5399 },
+	{ 502.0, 1.3866, 5.9379 },
+	{ 530.4, 4.2406, 111.4302 },
+	{ 437.1, 2.2703, 1550.9399 },
+	{ 400.2, 1.2561, 8.0768 },
+	{ 421.0, 1.8908, 30.7107 },
+	{ 382.5, 3.2997, 983.1159 },
+	{ 422.5, 5.5319, 525.4982 },
+	{ 355.4, 2.2785, 218.4069 },
+	{ 280.1, 1.5413, 98.9000 },
+	{ 314.5, 3.9593, 381.3516 },
+	{ 280.6, 4.5424, 44.7253 },
+	{ 267.7, 5.1332, 112.9146 },
+	{ 333.3, 5.7507, 39.0962 },
+	{ 291.6, 4.0240, 68.8437 },
+	{ 321.4, 1.5063, 454.9094 },
+	{ 309.2, 2.8545, 72.0733 },
+	{ 345.1, 1.3591, 293.1885 },
+	{ 307.4, 0.3196, 601.7643 },
+	{ 251.4, 3.5399, 312.1991 },
+	{ 248.2, 3.4108, 37.6118 },
+	{ 306.0, 2.7248, 6244.9428 },
+	{ 293.5, 4.8908, 528.2065 },
+	{ 234.5, 0.5923, 42.5865 },
+	{ 239.6, 3.1644, 143.6253 },
+	{ 214.5, 3.6248, 278.2588 },
+	{ 246.2, 1.0151, 141.2258 },
+	{ 174.1, 5.5501, 567.8240 },
+	{ 163.9, 2.1017, 2.4477 },
+	{ 162.9, 2.4895, 4.1928 },
+	{ 193.5, 1.5843, 138.5175 },
+	{ 155.3, 3.2843, 31.0195 },
+	{ 182.5, 2.4524, 255.0555 },
+	{ 177.8, 4.1477, 10175.1525 },
+	{ 174.4, 1.5304, 329.8371 },
+	{ 137.6, 3.3490, 0.9632 },
+	{ 161.0, 5.1666, 211.8146 },
+	{ 113.5, 4.9629, 148.0787 },
+	{ 128.8, 3.2552, 24.1184 },
+	{ 107.4, 3.2646, 1059.3819 },
+	{ 122.7, 5.3940, 62.2514 },
+	{ 120.5, 3.0805, 184.7273 },
+	{ 99.4, 1.929, 28.572 },
+	{ 97.7, 2.595, 6.592 },
+	{ 124.1, 3.1152, 221.3759 },
+	{ 124.7, 2.9704, 251.4321 },
+	{ 114.3, 0.2504, 594.6507 },
+	{ 111.0, 3.3428, 180.2739 },
+	{ 120.9, 1.9291, 25.6029 },
+	{ 104.7, 0.9488, 395.5787 },
+	{ 109.8, 5.4315, 494.5269 },
+	{ 96.9, 0.862, 1014.135 },
+	{ 98.7, 0.896, 488.589 },
+	{ 89.0, 4.781, 144.147 },
+	{ 107.9, 0.9870, 1124.3417 },
+	{ 97.1, 2.627, 291.704 },
+	{ 75.1, 5.889, 43.241 },
+	{ 93.7, 6.099, 526.722 },
+	{ 94.8, 0.207, 456.394 },
+	{ 70.0, 2.397, 426.598 },
+	{ 77.2, 4.211, 105.492 },
+	{ 89.9, 3.251, 258.024 },
+	{ 69.1, 4.930, 1028.362 },
+	{ 90.7, 1.695, 366.486 },
+	{ 74.2, 3.145, 82.858 },
+	{ 58.0, 0.862, 60.767 },
+	{ 78.7, 1.093, 700.664 },
+	{ 57.2, 0.813, 2.921 },
+	{ 63.4, 4.396, 149.563 },
+	{ 55.7, 3.890, 47.694 },
+	{ 56.4, 5.150, 0.521 },
+	{ 56.2, 5.430, 911.043 },
+	{ 61.7, 6.165, 1019.764 },
+	{ 70.5, 0.081, 40.581 },
+	{ 74.7, 4.859, 186.212 },
+	{ 61.9, 4.787, 11.046 },
+	{ 61.1, 0.837, 1022.733 },
+	{ 61.3, 5.702, 178.135 },
+	{ 52.9, 0.375, 27.087 },
+	{ 56.7, 3.523, 216.922 },
+	{ 48.8, 5.108, 64.960 },
+	{ 63.3, 4.394, 807.950 },
+	{ 64.1, 6.283, 7.114 },
+	{ 46.4, 1.347, 451.940 },
+	{ 60.5, 3.403, 294.673 },
+	{ 46.9, 0.170, 7.422 },
+	{ 56.8, 0.450, 140.002 },
+	{ 55.9, 1.068, 172.197 },
+	{ 53.8, 2.796, 328.353 },
+	{ 43.8, 6.047, 135.549 },
+	{ 49.5, 0.641, 41.054 },
+	{ 54.0, 2.918, 563.631 },
+	{ 43.0, 5.402, 487.365 },
+	{ 51.5, 0.091, 210.330 },
+	{ 41.9, 3.123, 29.226 },
+	{ 47.7, 3.907, 63.736 },
+	{ 41.6, 6.268, 32.716 },
+	{ 41.4, 4.455, 37.170 },
+	{ 40.7, 0.160, 79.235 },
+	{ 48.2, 1.842, 403.134 },
+	{ 36.9, 0.448, 30.056 },
+	{ 47.8, 0.881, 3302.479 },
+	{ 39.5, 3.506, 357.446 },
+	{ 42.1, 0.634, 343.219 },
+	{ 41.3, 1.364, 31.232 },
+	{ 42.6, 3.553, 38.654 },
+	{ 38.9, 5.267, 415.292 },
+	{ 39.0, 5.259, 386.981 },
+	{ 33.7, 5.244, 67.359 },
+	{ 40.9, 3.553, 331.322 },
+	{ 38.8, 1.123, 38.181 },
+	{ 37.5, 6.087, 35.425 },
+	{ 38.8, 4.679, 38.085 },
+	{ 38.2, 6.265, 389.950 },
+	{ 30.0, 4.458, 22.634 },
+	{ 31.4, 0.077, 12.530 },
+	{ 26.3, 4.596, 106.014 },
+	{ 27.5, 5.995, 206.186 },
+	{ 25.2, 4.499, 34.201 },
+	{ 29.0, 3.649, 253.571 },
+	{ 27.2, 4.379, 142.141 },
+	{ 30.6, 1.593, 348.848 },
+	{ 31.5, 1.051, 100.384 },
+	{ 26.3, 3.016, 365.001 },
+	{ 26.5, 3.614, 367.970 },
+	{ 25.5, 2.438, 351.817 },
+	{ 25.7, 2.005, 439.783 },
+	{ 25.4, 4.740, 1474.674 },
+	/* 174 terms retained, 433 terms dropped, error 6.7e-06 a.u. */
+
+	/* neptune r, T^1 */
+	{ 236338.5, 0.7049801, 38.1330356 },
+	{ 13220.3, 3.320155, 1.484473 },
+	{ 8621.9, 6.21629, 35.16409 },
+	{ 2701.7, 1.88141, 39.61751 },
+	{ 2153.2, 5.16874, 76.26607 },
+	{ 2154.7, 2.09431, 2.96895 },
+	{ 1463.9, 1.18417, 33.67962 },
+	{ 1603.2, 0, 0 },
+	{ 1135.8, 3.91891, 36.64856 },
+	{ 897.6, 5.2412, 388.4652 },
+	{ 789.9, 0.5332, 168.0525 },
+	{ 760.0, 0.0205, 182.2796 },
+	{ 607.2, 1.0771, 1021.2489 },
+	{ 571.6, 3.4006, 484.4444 },
+	{ 560.8, 2.8869, 498.6715 },
+	{ 490.2, 3.4683, 137.0330 },
+	{ 264.1, 0.8622, 4.4534 },
+	{ 270.5, 3.2736, 71.8127 },
+	{ 203.5, 2.4182, 32.1951 },
+	{ 155.4, 0.3654, 41.1020 },
+	{ 132.8, 3.6016, 9.5612 },
+	{ 93.6, 0.667, 46.210 },
+	{ 83.3, 3.260, 98.900 },
+	{ 72.2, 4.477, 601.764 },
+	{ 69.0, 1.463, 74.782 },
+	{ 87.0, 5.772, 381.352 },
+	{ 68.7, 4.526, 70.328 },
+	{ 64.7, 3.855, 73.297 },
+	{ 68.4, 3.395, 108.461 },
+	{ 53.4, 5.437, 395.579 },
+	{ 44.5, 3.614, 2.448 },
+	{ 41.2, 4.739, 8.077 },
+	{ 48.3, 1.986, 175.166 },
+	{ 41.7, 4.943, 31.019 },
+	{ 44.1, 1.417, 1550.940 },
+	{ 41.2, 1.420, 490.073 },
+	{ 41.1, 4.863, 493.042 },
+	{ 36.3, 5.308, 312.199 },
+	{ 36.3, 0.382, 77.751 },
+	{ 40.6, 2.272, 529.691 },
+	{ 32.4, 5.911, 5.938 },
+	{ 31.2, 2.705, 1014.135 },
+	{ 32.7, 5.221, 41.054 },
+	{ 36.1, 4.878, 491.558 },
+	{ 30.2, 3.633, 30.711 },
+	{ 30.0, 3.308, 1028.362 },
+	{ 27.0, 1.776, 44.725 },
+	{ 27.8, 4.556, 7.114 },
+	{ 27.5, 0.972, 33.940 },
+	{ 24.9, 3.101, 144.147 },
+	{ 26.0, 2.997, 60.767 },
+	{ 21.4, 4.713, 278.259 },
+	{ 21.3, 0.690, 251.432 },
+	{ 23.7, 5.120, 176.651 },
+	{ 21.4, 0.863, 4.193 },
+	{ 23.4, 1.650, 173.682 },
+	{ 24.2, 3.566, 145.110 },
+	{ 20.2, 5.615, 24.118 },
+	{ 27.0, 4.143, 453.425 },
+	{ 24.0, 1.007, 213.299 },
+	{ 18.3, 1.980, 72.073 },
+	{ 18.3, 6.173, 189.393 },
+	{ 19.2, 4.652, 106.977 },
+	{ 17.6, 1.603, 62.251 },
+	{ 16.5, 1.699, 357.446 },
+	{ 20.1, 3.295, 114.399 },
+	{ 15.4, 4.388, 25.603 },
+	{ 19.2, 2.200, 343.219 },
+	{ 15.1, 3.668, 0.521 },
+	{ 14.0, 0.553, 129.919 },
+	{ 13.4, 5.858, 68.844 },
+	{ 15.4, 4.207, 567.824 },
+	{ 12.7, 3.528, 477.331 },
+	{ 11.7, 5.576, 31.232 },
+	{ 11.5, 0.891, 594.651 },
+	{ 10.5, 4.356, 32.716 },
+	{ 10.8, 5.218, 26.827 },
+	{ 10.1, 1.981, 40.581 },
+	{ 10.5, 5.273, 2.921 },
+	{ 9.2, 0.50, 64.96 },
+	{ 9.2, 0.68, 160.94 },
+	{ 8.7, 5.81, 6.59 },
+	{ 10.1, 4.512, 28.572 },
+	{ 10.4, 5.189, 42.586 },
+	{ 9.9, 3.77, 181.76 },
+	{ 8.3, 2.82, 43.24 },
+	{ 9.8, 1.49, 47.69 },
+	{ 7.6, 4.08, 389.95 },
+	{ 8.0, 2.78, 505.79 },
+	{ 7.4, 2.36, 11.05 },
+	{ 7.3, 1.62, 135.55 },
+	{ 9.5, 0.27, 426.60 },
+	{ 7.2, 0.83, 911.04 },
+	{ 7.0, 1.87, 206.19 },
+	{ 6.9, 0.84, 82.86 },
+	{ 7.9, 1.87, 38.65 },
+	{ 6.7, 3.98, 12.53 },
+	{ 6.4, 0.90, 487.37 },
+	{ 6.7, 1.34, 220.41 },
+	{ 7.7, 5.13, 23.91 },
+	{ 7.1, 6.00, 639.90 },
+	{ 8.3, 3.86, 37.61 },
+	{ 6.4, 2.42, 1059.38 },
+	{ 6.8, 1.97, 45.25 },
+	{ 6.4, 4.08, 35.69 },
+	{ 6.4, 0.65, 350.33 },
+	/* 106 terms retained, 144 terms dropped, error 1.3e-06 a.u.*T */
+
+	/* neptune r, T^2 */
+	{ 4247.4, 5.89911, 38.13304 },
+	{ 217.6, 0.3458, 1.4845 },
+	{ 163.0, 2.2387, 168.0525 },
+	{ 156.3, 4.5941, 182.2796 },
+	{ 117.9, 5.1030, 484.4444 },
+	{ 112.4, 1.1900, 498.6715 },
+	{ 127.1, 2.8479, 35.1641 },
+	{ 99.5, 3.416, 175.166 },
+	{ 64.8, 3.462, 388.465 },
+	{ 77.3, 0.017, 491.558 },
+	{ 49.5, 4.070, 76.266 },
+	{ 39.3, 6.095, 1021.249 },
+	{ 36.5, 5.171, 137.033 },
+	{ 37.1, 5.973, 2.969 },
+	{ 30.5, 3.583, 33.680 },
+	{ 21.1, 0.768, 36.649 },
+	{ 13.9, 3.592, 395.579 },
+	{ 13.1, 5.093, 98.900 },
+	{ 11.4, 1.181, 381.352 },
+	{ 9.1, 2.35, 601.76 },
+	{ 8.5, 5.25, 2.45 },
+	{ 8.1, 4.96, 4.45 },
+	{ 7.4, 4.47, 189.39 },
+	{ 7.2, 1.92, 9.56 },
+	{ 7.3, 1.66, 1028.36 },
+	{ 8.1, 5.84, 220.41 },
+	{ 9.7, 0, 0 },
+	{ 6.6, 0.69, 144.15 },
+	{ 7.8, 1.14, 1059.38 },
+	{ 5.7, 6.25, 74.78 },
+	{ 5.6, 5.23, 46.21 },
+	{ 5.5, 4.59, 1014.14 },
+	{ 5.2, 5.23, 477.33 },
+	{ 5.5, 3.50, 183.76 },
+	{ 4.9, 3.53, 39.62 },
+	{ 4.8, 2.08, 41.10 },
+	{ 5.1, 0.20, 166.57 },
+	{ 4.8, 1.18, 169.54 },
+	{ 4.7, 1.51, 73.30 },
+	{ 6.1, 6.18, 71.81 },
+	{ 4.6, 3.92, 587.54 },
+	{ 5.8, 2.24, 176.65 },
+	{ 4.5, 2.84, 7.11 },
+	{ 4.3, 0.52, 446.31 },
+	{ 3.9, 0.26, 1550.94 },
+	{ 4.5, 3.01, 129.92 },
+	{ 3.7, 2.38, 160.94 },
+	{ 3.8, 3.79, 111.43 },
+	{ 4.1, 1.70, 983.12 },
+	{ 3.3, 1.08, 505.79 },
+	{ 4.0, 0.31, 494.74 },
+	{ 4.0, 5.97, 488.38 },
+	{ 3.9, 4.86, 60.77 },
+	{ 3.0, 2.02, 822.18 },
+	{ 4.0, 1.08, 374.24 },
+	{ 3.8, 5.23, 350.33 },
+	{ 2.8, 6.18, 704.86 },
+	{ 3.5, 0.79, 274.07 },
+	{ 2.8, 1.32, 386.98 },
+	{ 2.8, 5.37, 251.43 },
+	{ 3.1, 5.13, 426.60 },
+	{ 3.3, 5.61, 1124.34 },
+	{ 2.6, 0.68, 312.20 },
+	{ 2.6, 3.56, 567.82 },
+	{ 2.6, 1.46, 1035.48 },
+	{ 2.5, 5.19, 1227.43 },
+	{ 2.5, 4.12, 171.23 },
+	{ 2.5, 2.72, 179.10 },
+	{ 2.3, 0.96, 1019.76 },
+	{ 2.5, 0.70, 707.78 },
+	{ 2.5, 4.60, 693.55 },
+	{ 2.3, 0.74, 976.00 },
+	/* 72 terms retained, 0 terms dropped, error 3.8e-07 a.u.*T^2 */
+
+	/* neptune r, T^3 */
+	{ 166.3, 4.5524, 38.1330 },
+	{ 22.4, 3.948, 168.053 },
+	{ 21.3, 2.863, 182.280 },
+	{ 16.2, 0.542, 484.444 },
+	{ 15.6, 5.757, 498.671 },
+	{ 11.9, 4.403, 1.484 },
+	{ 6.4, 5.19, 31.02 },
+	{ 3.7, 5.91, 1007.02 },
+	{ 3.7, 1.63, 388.47 },
+	{ 3.2, 0.70, 1558.05 },
+	{ 3.2, 1.88, 522.58 },
+	{ 3.3, 2.94, 76.27 },
+	{ 2.7, 1.87, 402.69 },
+	{ 3.2, 0.79, 536.80 },
+	{ 2.6, 5.77, 343.22 },
+	{ 2.6, 4.65, 500.16 },
+	{ 2.5, 4.79, 482.96 },
+	{ 2.5, 1.73, 395.58 },
+	{ 2.7, 2.21, 446.31 },
+	{ 2.4, 5.77, 485.93 },
+	{ 2.9, 6.20, 815.06 },
+	{ 2.3, 3.67, 497.19 },
+	/* 22 terms retained, 0 terms dropped, error 2.2e-07 a.u.*T^3 */
+
+	/* neptune r, T^4 */
+	{ 4.2, 2.40, 477.33 },
+	{ 4.3, 0.10, 395.58 },
+	{ 3.5, 4.78, 1028.36 },
+	{ 3.2, 3.88, 505.79 },
+	{ 3.0, 1.04, 189.39 },
+	{ 2.3, 1.11, 182.28 },
+	{ 2.3, 5.68, 168.05 },
+	/* 7 terms retained, 0 terms dropped, error 1.3e-07 a.u.*T^4 */
+	/* end neptune */
+};
+
+int vn_neptune[][3] = {
+	/* addresses for neptune l, b, r  */
+	/* T^0 */ { 0, 125, 182, },
+	/* T^1 */ { 58, 148, 356, },
+	/* T^2 */ { 90, 165, 462, },
+	/* T^3 */ { 112, 175, 534, },
+	/* T^4 */ { 122, 180, 556, },
+	/* T^5 */ { 124, 181, 563, },
+	/* end */ { 125, 182, 0, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_saturn[][3] = {
+	/* saturn l, T^0 */
+	{ 87401354.0, 0, 0 },
+	{ 11107659.8, 3.962050902, 213.299095438 },
+	{ 1414151.0, 4.58581516, 7.11354700 },
+	{ 398379.4, 0.5211203, 206.1855484 },
+	{ 350769.2, 3.3032990, 426.5981909 },
+	{ 206816.3, 0.2465837, 103.0927742 },
+	{ 79271.3, 3.840071, 220.412642 },
+	{ 23990.3, 4.669769, 110.206321 },
+	{ 16573.6, 0.437191, 419.484644 },
+	{ 14907.0, 5.769033, 316.391870 },
+	{ 15820.3, 0.938090, 632.783739 },
+	{ 14609.6, 1.565186, 3.932153 },
+	{ 13160.3, 4.448912, 14.227094 },
+	{ 15053.5, 2.716700, 639.897286 },
+	{ 13005.3, 5.981191, 11.045700 },
+	{ 10725.1, 3.129396, 202.253395 },
+	{ 5863.2, 0.23657, 529.69097 },
+	{ 5227.8, 4.20783, 3.18139 },
+	{ 6126.3, 1.76328, 277.03499 },
+	{ 5019.7, 3.17788, 433.71174 },
+	{ 4592.5, 0.61976, 199.07200 },
+	{ 4005.9, 2.24480, 63.73590 },
+	{ 2953.8, 0.98280, 95.97923 },
+	{ 3873.7, 3.22283, 138.51750 },
+	{ 2461.2, 2.03164, 735.87651 },
+	{ 3269.5, 0.77492, 949.17561 },
+	{ 1758.1, 3.26581, 522.57742 },
+	{ 1640.2, 5.50505, 846.08283 },
+	{ 1391.3, 4.02332, 323.50542 },
+	{ 1580.6, 4.37266, 309.27832 },
+	{ 1123.5, 2.83727, 415.55249 },
+	{ 1017.3, 3.71698, 227.52619 },
+	{ 848.6, 3.1915, 209.3669 },
+	{ 1087.2, 4.18343, 2.44768 },
+	{ 956.8, 0.5074, 1265.5675 },
+	{ 789.2, 5.0075, 0.9632 },
+	{ 687.0, 1.7471, 1052.2684 },
+	{ 654.5, 1.5989, 0.0482 },
+	{ 748.8, 2.1440, 853.1964 },
+	{ 634.0, 2.2989, 412.3711 },
+	{ 743.6, 5.2528, 224.3448 },
+	{ 852.7, 3.4214, 175.1661 },
+	{ 579.9, 3.0926, 74.7816 },
+	{ 624.9, 0.9705, 210.1177 },
+	{ 529.9, 4.4494, 117.3199 },
+	{ 542.6, 1.5182, 9.5612 },
+	{ 474.3, 5.4753, 742.9901 },
+	{ 448.5, 1.2899, 127.4718 },
+	{ 546.4, 2.1268, 350.3321 },
+	{ 478.1, 2.9649, 137.0330 },
+	{ 354.9, 3.0129, 838.9693 },
+	{ 451.8, 1.0444, 490.3341 },
+	{ 347.4, 1.5393, 340.7709 },
+	{ 343.5, 0.2460, 0.5213 },
+	{ 309.0, 3.4949, 216.4805 },
+	{ 322.2, 0.9614, 203.7379 },
+	{ 372.3, 2.2782, 217.2312 },
+	{ 321.5, 2.5718, 647.0108 },
+	{ 330.2, 0.2472, 1581.9593 },
+	{ 249.1, 1.4701, 1368.6603 },
+	{ 286.7, 2.3704, 351.8166 },
+	{ 220.2, 4.2042, 200.7689 },
+	{ 277.8, 0.4002, 211.8146 },
+	{ 204.5, 6.0108, 265.9893 },
+	{ 207.7, 0.4835, 1162.4747 },
+	{ 208.7, 1.3452, 625.6702 },
+	{ 182.5, 5.4912, 2.9208 },
+	{ 226.6, 4.9100, 12.5302 },
+	{ 207.7, 1.2830, 39.3569 },
+	{ 173.9, 1.8631, 0.7508 },
+	{ 184.7, 3.5034, 149.5632 },
+	{ 183.5, 0.9725, 4.1928 },
+	{ 146.1, 6.2310, 195.1398 },
+	{ 164.5, 0.4401, 5.4166 },
+	{ 147.5, 1.5353, 5.6291 },
+	{ 139.7, 4.2945, 21.3406 },
+	{ 131.3, 4.0683, 10.2949 },
+	{ 117.3, 2.6792, 1155.3612 },
+	{ 149.3, 5.7359, 52.6902 },
+	{ 122.4, 1.9759, 4.6659 },
+	{ 113.7, 5.5943, 1059.3819 },
+	{ 102.7, 1.1975, 1685.0521 },
+	{ 118.2, 5.3407, 554.0700 },
+	{ 109.3, 3.4381, 536.8045 },
+	{ 110.4, 0.1660, 1.4845 },
+	{ 125.0, 6.2774, 1898.3512 },
+	{ 89.9, 5.804, 114.138 },
+	{ 104.0, 2.1921, 88.8657 },
+	{ 112.4, 1.1050, 191.2077 },
+	{ 106.6, 4.0116, 956.2892 },
+	{ 91.4, 1.875, 38.133 },
+	{ 83.8, 5.488, 0.112 },
+	{ 83.5, 2.290, 628.852 },
+	{ 97.0, 4.537, 302.165 },
+	{ 100.6, 4.9651, 269.9214 },
+	{ 75.5, 2.180, 728.763 },
+	{ 96.3, 2.833, 275.551 },
+	{ 82.4, 3.055, 440.825 },
+	{ 73.9, 5.089, 1375.774 },
+	{ 71.6, 5.109, 65.220 },
+	{ 70.4, 4.868, 0.212 },
+	{ 69.8, 3.710, 14.978 },
+	{ 88.8, 3.863, 278.519 },
+	{ 68.1, 0.734, 1478.867 },
+	{ 66.5, 0.027, 70.849 },
+	{ 65.7, 2.022, 142.450 },
+	{ 75.8, 1.614, 284.149 },
+	{ 63.2, 3.495, 479.288 },
+	{ 62.5, 2.587, 422.666 },
+	{ 69.3, 3.440, 515.464 },
+	{ 79.0, 4.452, 35.425 },
+	{ 63.7, 3.317, 62.251 },
+	{ 52.9, 5.514, 0.261 },
+	{ 53.0, 3.185, 8.077 },
+	{ 54.5, 2.457, 22.091 },
+	{ 50.5, 4.267, 99.161 },
+	{ 55.2, 0.968, 942.062 },
+	{ 49.3, 2.386, 1471.753 },
+	{ 47.2, 2.025, 312.199 },
+	{ 61.1, 1.503, 210.851 },
+	{ 45.1, 0.931, 2001.444 },
+	{ 60.6, 2.687, 388.465 },
+	{ 43.5, 2.526, 288.081 },
+	{ 42.5, 3.818, 330.619 },
+	{ 39.9, 5.714, 408.439 },
+	{ 50.1, 6.032, 2214.743 },
+	{ 45.9, 0.542, 212.336 },
+	{ 54.2, 0.782, 191.958 },
+	{ 47.0, 4.599, 437.644 },
+	{ 42.4, 1.901, 430.530 },
+	{ 39.7, 1.633, 1066.495 },
+	{ 36.3, 0.848, 213.347 },
+	{ 35.5, 4.186, 215.747 },
+	{ 36.3, 3.933, 213.251 },
+	{ 38.0, 0.313, 423.417 },
+	{ 44.7, 1.125, 6.150 },
+	{ 37.9, 1.198, 2.708 },
+	{ 43.4, 1.374, 563.631 },
+	{ 43.8, 3.930, 525.498 },
+	{ 34.8, 1.016, 203.004 },
+	{ 31.8, 1.693, 0.160 },
+	{ 30.9, 6.135, 417.037 },
+	{ 36.4, 6.006, 18.159 },
+	{ 29.0, 1.197, 404.507 },
+	{ 32.8, 0.536, 107.025 },
+	{ 30.4, 0.723, 222.860 },
+	{ 32.6, 0.812, 1795.258 },
+	{ 37.8, 3.697, 1272.681 },
+	{ 27.7, 1.457, 7.162 },
+	{ 27.2, 1.897, 1045.155 },
+	{ 37.7, 4.520, 24.379 },
+	{ 34.9, 4.461, 214.262 },
+	{ 32.6, 0.664, 692.587 },
+	{ 30.3, 5.304, 33.940 },
+	{ 27.5, 6.227, 1.272 },
+	{ 26.7, 4.567, 7.065 },
+	{ 31.7, 5.498, 56.622 },
+	{ 28.1, 5.644, 128.956 },
+	{ 32.0, 5.223, 92.047 },
+	{ 27.0, 0.067, 205.222 },
+	{ 31.8, 5.592, 6069.777 },
+	{ 31.0, 0.372, 703.633 },
+	{ 29.4, 0.147, 131.404 },
+	{ 26.2, 5.413, 140.002 },
+	{ 25.7, 4.360, 32.243 },
+	/* 165 terms retained, 987 terms dropped, error 1.4" */
+
+	/* saturn l, T^1 */
+	{ 21354295596.0, 0, 0 },
+	{ 1296855.0, 1.82820545, 213.29909544 },
+	{ 564347.6, 2.8850014, 7.1135470 },
+	{ 98323.0, 1.080701, 426.598191 },
+	{ 107678.8, 2.2776991, 206.1855484 },
+	{ 40254.6, 2.041283, 220.412642 },
+	{ 19941.7, 1.279547, 103.092774 },
+	{ 10511.7, 2.748804, 14.227094 },
+	{ 6939.2, 0.40493, 639.89729 },
+	{ 4803.3, 2.44194, 419.48464 },
+	{ 4056.3, 2.92167, 110.20632 },
+	{ 3768.6, 3.64966, 3.93215 },
+	{ 3384.7, 2.41694, 3.18139 },
+	{ 3302.2, 1.26256, 433.71174 },
+	{ 3071.4, 2.32739, 199.07200 },
+	{ 1953.0, 3.56395, 11.04570 },
+	{ 1249.3, 2.62804, 95.97923 },
+	{ 921.7, 1.9609, 227.5262 },
+	{ 705.6, 4.4169, 529.6910 },
+	{ 649.7, 6.1742, 202.2534 },
+	{ 627.6, 6.1109, 309.2783 },
+	{ 486.8, 6.0400, 853.1964 },
+	{ 468.4, 4.6171, 63.7359 },
+	{ 478.5, 4.9878, 522.5774 },
+	{ 417.0, 2.1171, 323.5054 },
+	{ 407.6, 1.2995, 209.3669 },
+	{ 343.8, 3.9585, 412.3711 },
+	{ 339.7, 3.6340, 316.3919 },
+	{ 335.9, 3.7717, 735.8765 },
+	{ 331.9, 2.8608, 210.1177 },
+	{ 352.5, 2.3171, 632.7837 },
+	{ 289.4, 2.7326, 117.3199 },
+	{ 265.8, 0.5434, 647.0108 },
+	{ 230.5, 1.6443, 216.4805 },
+	{ 280.9, 5.7440, 2.4477 },
+	{ 191.7, 2.9651, 224.3448 },
+	{ 172.9, 4.0770, 846.0828 },
+	{ 167.1, 2.5975, 21.3406 },
+	{ 136.3, 2.2858, 10.2949 },
+	{ 131.4, 3.4411, 742.9901 },
+	{ 127.8, 4.0953, 217.2312 },
+	{ 108.9, 6.1614, 415.5525 },
+	{ 93.9, 3.484, 1052.268 },
+	{ 92.5, 3.948, 88.866 },
+	{ 97.6, 4.728, 838.969 },
+	{ 86.6, 1.220, 440.825 },
+	{ 83.5, 3.113, 625.670 },
+	{ 77.6, 6.244, 302.165 },
+	{ 61.6, 1.828, 195.140 },
+	{ 61.9, 4.293, 127.472 },
+	{ 67.1, 0.290, 4.666 },
+	{ 56.9, 5.019, 137.033 },
+	{ 54.2, 5.126, 490.334 },
+	{ 54.6, 0.284, 74.782 },
+	{ 51.4, 1.458, 536.805 },
+	{ 65.8, 5.648, 9.561 },
+	{ 57.8, 2.476, 191.958 },
+	{ 44.4, 2.709, 5.417 },
+	{ 46.8, 1.177, 149.563 },
+	{ 40.4, 3.889, 728.763 },
+	{ 37.8, 2.534, 12.530 },
+	{ 46.6, 5.148, 515.464 },
+	{ 45.9, 2.232, 956.289 },
+	{ 40.4, 0.413, 269.921 },
+	{ 37.2, 3.782, 2.921 },
+	{ 33.8, 3.211, 1368.660 },
+	{ 38.0, 0.647, 422.666 },
+	{ 32.9, 0.301, 351.817 },
+	{ 33.0, 5.430, 1066.495 },
+	{ 30.3, 2.841, 203.004 },
+	{ 35.1, 6.084, 5.629 },
+	{ 29.7, 3.391, 1059.382 },
+	{ 33.2, 4.641, 277.035 },
+	{ 31.9, 4.386, 1155.361 },
+	{ 28.9, 2.026, 330.619 },
+	{ 28.3, 2.742, 265.989 },
+	{ 30.1, 6.187, 284.149 },
+	{ 31.3, 2.435, 52.690 },
+	{ 26.5, 4.512, 340.771 },
+	{ 22.0, 5.144, 4.193 },
+	{ 22.2, 1.965, 203.738 },
+	{ 20.8, 6.160, 860.310 },
+	{ 21.7, 2.676, 942.062 },
+	{ 22.6, 5.886, 210.851 },
+	{ 19.8, 2.313, 437.644 },
+	{ 19.4, 4.766, 70.849 },
+	{ 19.3, 4.102, 18.159 },
+	{ 22.7, 4.137, 191.208 },
+	{ 18.2, 0.903, 429.780 },
+	{ 17.7, 1.850, 234.640 },
+	{ 17.5, 2.447, 423.417 },
+	{ 15.4, 4.238, 1162.475 },
+	{ 14.6, 3.597, 1045.155 },
+	{ 14.1, 2.943, 1685.052 },
+	{ 16.3, 4.057, 949.176 },
+	{ 13.3, 6.245, 38.133 },
+	{ 15.9, 1.064, 56.622 },
+	{ 14.1, 1.435, 408.439 },
+	{ 13.1, 5.758, 138.517 },
+	{ 15.8, 5.594, 6.150 },
+	{ 15.0, 5.772, 22.091 },
+	{ 16.0, 1.939, 1272.681 },
+	{ 16.8, 5.967, 628.852 },
+	{ 12.8, 4.247, 405.258 },
+	{ 13.6, 4.099, 1471.753 },
+	{ 15.1, 0.741, 200.769 },
+	{ 11.0, 1.550, 223.594 },
+	{ 11.7, 1.812, 124.433 },
+	{ 10.3, 3.468, 1375.774 },
+	{ 12.1, 1.857, 131.404 },
+	{ 10.1, 2.382, 107.025 },
+	{ 9.9, 3.95, 430.53 },
+	{ 9.8, 2.55, 99.91 },
+	{ 10.6, 5.367, 215.747 },
+	{ 12.1, 4.845, 831.856 },
+	{ 10.2, 6.077, 32.243 },
+	{ 9.2, 3.65, 142.45 },
+	{ 9.0, 1.24, 106.27 },
+	{ 9.3, 5.81, 7.16 },
+	{ 9.7, 1.39, 145.63 },
+	{ 8.4, 4.42, 703.63 },
+	{ 8.4, 5.64, 62.25 },
+	{ 8.2, 2.42, 1258.45 },
+	{ 7.8, 0.53, 654.12 },
+	{ 7.6, 3.75, 312.20 },
+	{ 7.2, 0.28, 0.75 },
+	{ 8.2, 6.22, 14.98 },
+	{ 7.1, 0.53, 388.47 },
+	{ 6.6, 3.49, 35.42 },
+	{ 9.0, 4.95, 208.63 },
+	{ 9.0, 0.08, 288.08 },
+	{ 6.4, 3.33, 1361.55 },
+	{ 6.5, 2.89, 114.14 },
+	{ 6.7, 0.24, 8.08 },
+	{ 7.3, 4.85, 222.86 },
+	{ 6.3, 3.81, 1788.14 },
+	{ 6.9, 2.05, 99.16 },
+	{ 6.6, 5.83, 483.22 },
+	/* 138 terms retained, 504 terms dropped, error 0.32"*T */
+
+	/* saturn l, T^2 */
+	{ 116441.2, 1.1798785, 7.1135470 },
+	{ 91920.8, 0.074253, 213.299095 },
+	{ 90592.3, 0, 0 },
+	{ 15276.9, 4.064920, 206.185548 },
+	{ 10631.4, 0.257783, 220.412642 },
+	{ 10605.0, 5.409636, 426.598191 },
+	{ 4265.4, 1.04596, 14.22709 },
+	{ 1215.5, 2.91860, 103.09277 },
+	{ 1164.7, 4.60942, 639.89729 },
+	{ 1082.0, 5.69130, 433.71174 },
+	{ 1020.1, 0.63369, 3.18139 },
+	{ 1044.8, 4.04206, 199.07200 },
+	{ 633.6, 4.3883, 419.4846 },
+	{ 549.3, 5.5730, 3.9322 },
+	{ 456.9, 1.2684, 110.2063 },
+	{ 425.1, 0.2094, 227.5262 },
+	{ 273.7, 4.2884, 95.9792 },
+	{ 161.6, 1.3814, 11.0457 },
+	{ 129.5, 1.5659, 309.2783 },
+	{ 117.0, 3.8812, 853.1964 },
+	{ 105.4, 4.9000, 647.0108 },
+	{ 101.0, 0.8927, 21.3406 },
+	{ 95.2, 5.626, 412.371 },
+	{ 81.9, 1.025, 117.320 },
+	{ 74.9, 4.762, 210.118 },
+	{ 82.7, 6.050, 216.480 },
+	{ 95.7, 2.911, 316.392 },
+	{ 63.7, 0.352, 323.505 },
+	{ 84.9, 5.735, 209.367 },
+	{ 60.6, 4.875, 632.784 },
+	{ 66.5, 0.483, 10.295 },
+	{ 67.2, 0.456, 522.577 },
+	{ 53.3, 2.747, 529.691 },
+	{ 45.8, 5.693, 440.825 },
+	{ 45.3, 1.669, 202.253 },
+	{ 42.3, 5.708, 88.866 },
+	{ 32.1, 0.071, 63.736 },
+	{ 31.6, 1.672, 302.165 },
+	{ 31.1, 4.164, 191.958 },
+	{ 24.6, 5.656, 735.877 },
+	{ 26.6, 0.833, 224.345 },
+	{ 20.1, 5.944, 217.231 },
+	{ 17.5, 4.900, 625.670 },
+	{ 17.1, 1.626, 742.990 },
+	{ 13.7, 3.765, 195.140 },
+	{ 12.2, 4.718, 203.004 },
+	{ 11.9, 0.126, 234.640 },
+	{ 16.0, 0.579, 515.464 },
+	{ 11.2, 5.922, 536.805 },
+	{ 14.1, 0.207, 838.969 },
+	{ 11.0, 5.602, 728.763 },
+	{ 11.7, 3.121, 846.083 },
+	{ 10.0, 4.155, 860.310 },
+	{ 10.6, 3.203, 1066.495 },
+	{ 10.1, 0.257, 330.619 },
+	{ 9.5, 0.46, 956.29 },
+	{ 10.2, 4.987, 422.666 },
+	{ 8.3, 2.14, 269.92 },
+	{ 7.2, 5.40, 1052.27 },
+	{ 7.7, 5.25, 429.78 },
+	{ 6.4, 4.46, 284.15 },
+	{ 5.9, 5.41, 149.56 },
+	{ 7.5, 4.03, 9.56 },
+	{ 5.8, 4.29, 415.55 },
+	{ 6.1, 5.93, 405.26 },
+	{ 5.7, 0.02, 124.43 },
+	{ 5.7, 6.02, 223.59 },
+	{ 4.8, 4.93, 654.12 },
+	{ 4.7, 2.27, 18.16 },
+	{ 4.5, 4.41, 942.06 },
+	{ 5.6, 0.30, 127.47 },
+	{ 5.5, 5.54, 949.18 },
+	{ 4.1, 4.69, 74.78 },
+	{ 4.1, 5.31, 1045.15 },
+	{ 4.2, 2.89, 56.62 },
+	{ 4.9, 3.20, 277.03 },
+	{ 3.9, 3.30, 490.33 },
+	{ 3.9, 6.10, 81.75 },
+	{ 3.8, 4.93, 52.69 },
+	{ 4.6, 6.14, 1155.36 },
+	{ 3.7, 0.41, 137.03 },
+	{ 3.4, 4.29, 99.91 },
+	{ 3.6, 0.20, 1272.68 },
+	{ 3.9, 0.37, 12.53 },
+	{ 3.2, 1.57, 1059.38 },
+	{ 4.1, 0.29, 831.86 },
+	{ 3.7, 0.15, 437.64 },
+	{ 2.9, 3.13, 70.85 },
+	{ 2.8, 0.33, 191.21 },
+	{ 2.7, 1.88, 295.05 },
+	{ 3.5, 4.77, 423.42 },
+	{ 2.6, 5.15, 1368.66 },
+	{ 2.5, 3.90, 210.85 },
+	{ 2.5, 1.59, 32.24 },
+	{ 2.6, 3.59, 131.40 },
+	{ 2.3, 4.77, 351.82 },
+	{ 2.4, 5.83, 106.27 },
+	{ 2.2, 5.98, 6062.66 },
+	{ 2.2, 2.06, 6076.89 },
+	{ 2.2, 5.95, 145.63 },
+	{ 2.7, 3.38, 408.44 },
+	{ 2.3, 3.14, 22.09 },
+	{ 2.1, 1.12, 9992.87 },
+	{ 2.1, 3.48, 10007.10 },
+	{ 2.6, 5.12, 265.99 },
+	{ 1.8, 4.15, 1258.45 },
+	{ 1.8, 5.05, 1361.55 },
+	{ 1.8, 4.14, 107.02 },
+	{ 1.9, 4.52, 138.52 },
+	{ 1.7, 1.36, 231.46 },
+	{ 2.0, 5.87, 1471.75 },
+	{ 2.1, 5.23, 1265.57 },
+	{ 1.6, 5.62, 447.94 },
+	{ 1.6, 3.75, 628.85 },
+	{ 1.7, 6.24, 1148.25 },
+	/* 115 terms retained, 206 terms dropped, error 0.074"*T^2 */
+
+	/* saturn l, T^3 */
+	{ 16038.7, 5.739454, 7.113547 },
+	{ 4249.8, 4.58540, 213.29910 },
+	{ 1906.5, 4.76082, 220.41264 },
+	{ 1465.7, 5.91327, 206.18555 },
+	{ 1162.0, 5.61973, 14.22709 },
+	{ 1066.6, 3.60817, 426.59819 },
+	{ 239.4, 3.8609, 433.7117 },
+	{ 237.0, 5.7683, 199.0720 },
+	{ 165.6, 5.1164, 3.1814 },
+	{ 131.4, 4.7433, 227.5262 },
+	{ 151.4, 2.7359, 639.8973 },
+	{ 61.6, 4.743, 103.093 },
+	{ 63.4, 0.229, 419.485 },
+	{ 40.4, 5.473, 21.341 },
+	{ 40.2, 5.964, 95.979 },
+	{ 38.7, 5.834, 110.206 },
+	{ 28.0, 3.012, 647.011 },
+	{ 25.0, 0.988, 3.932 },
+	{ 18.1, 1.025, 412.371 },
+	{ 17.9, 3.319, 309.278 },
+	{ 16.2, 3.898, 440.825 },
+	{ 15.8, 5.617, 117.320 },
+	{ 19.0, 1.916, 853.196 },
+	{ 18.3, 4.967, 10.295 },
+	{ 12.9, 1.181, 88.866 },
+	{ 17.9, 4.204, 216.480 },
+	{ 11.5, 5.575, 11.046 },
+	{ 10.5, 5.929, 191.958 },
+	{ 10.4, 3.948, 209.367 },
+	{ 8.7, 3.39, 302.16 },
+	{ 7.6, 4.88, 323.51 },
+	{ 6.7, 0.38, 632.78 },
+	{ 5.9, 1.06, 210.12 },
+	{ 5.4, 4.64, 234.64 },
+	{ 6.3, 2.25, 522.58 },
+	{ 3.6, 2.31, 515.46 },
+	{ 3.2, 2.20, 860.31 },
+	{ 3.7, 3.14, 0 },
+	{ 2.6, 4.93, 224.34 },
+	{ 2.5, 0.42, 625.67 },
+	{ 2.2, 3.20, 202.25 },
+	{ 2.4, 4.77, 330.62 },
+	{ 2.9, 0.59, 529.69 },
+	{ 2.0, 4.40, 124.43 },
+	{ 2.2, 1.35, 405.26 },
+	{ 2.3, 3.35, 429.78 },
+	{ 2.0, 3.07, 654.12 },
+	{ 2.0, 1.03, 728.76 },
+	{ 1.9, 3.09, 422.67 },
+	{ 1.8, 4.15, 536.80 },
+	{ 2.2, 1.19, 1066.50 },
+	{ 2.1, 4.16, 223.59 },
+	{ 1.5, 0.38, 316.39 },
+	{ 1.7, 5.83, 195.14 },
+	{ 1.5, 1.58, 81.75 },
+	{ 1.6, 6.04, 742.99 },
+	{ 1.3, 1.66, 63.74 },
+	{ 1.3, 5.02, 956.29 },
+	{ 1.4, 2.11, 838.97 },
+	{ 1.2, 3.88, 269.92 },
+	{ 1.0, 3.73, 295.05 },
+	{ 1.3, 1.38, 735.88 },
+	{ 1.3, 2.33, 217.23 },
+	{ 0.9, 2.76, 284.15 },
+	{ 0.9, 0.71, 846.08 },
+	{ 0.9, 3.84, 447.94 },
+	{ 0.9, 3.31, 18.16 },
+	{ 0.8, 4.71, 56.62 },
+	{ 0.9, 2.02, 831.86 },
+	{ 0.8, 0.80, 1045.15 },
+	{ 0.7, 4.27, 437.64 },
+	{ 0.7, 6.18, 942.06 },
+	{ 0.8, 2.41, 203.00 },
+	{ 0.7, 1.65, 423.42 },
+	{ 0.5, 2.86, 184.84 },
+	{ 0.5, 6.26, 1059.38 },
+	{ 0.5, 3.43, 149.56 },
+	{ 0.5, 4.88, 1272.68 },
+	{ 0.4, 5.40, 408.44 },
+	{ 0.4, 4.06, 543.92 },
+	{ 0.4, 1.69, 1155.36 },
+	{ 0.4, 1.22, 1052.27 },
+	/* 82 terms retained, 66 terms dropped, error 0.015"*T^3 */
+
+	/* saturn l, T^4 */
+	{ 1661.9, 3.99826, 7.11355 },
+	{ 257.1, 2.9844, 220.4126 },
+	{ 236.3, 3.9024, 14.2271 },
+	{ 149.4, 2.7411, 213.2991 },
+	{ 109.6, 1.5152, 206.1855 },
+	{ 114.0, 3.1416, 0 },
+	{ 68.4, 1.721, 426.598 },
+	{ 37.7, 1.238, 199.072 },
+	{ 40.1, 2.046, 433.712 },
+	{ 31.2, 3.011, 227.526 },
+	{ 15.1, 0.829, 639.897 },
+	{ 9.4, 3.71, 21.34 },
+	{ 5.7, 2.42, 419.48 },
+	{ 4.5, 1.45, 95.98 },
+	{ 5.6, 1.16, 647.01 },
+	{ 4.5, 2.12, 440.83 },
+	{ 3.2, 4.09, 110.21 },
+	{ 2.9, 2.77, 412.37 },
+	{ 2.8, 3.01, 88.87 },
+	{ 2.6, 0.00, 853.20 },
+	{ 2.6, 0.39, 103.09 },
+	{ 1.9, 5.08, 309.28 },
+	{ 2.2, 3.78, 117.32 },
+	{ 1.8, 5.19, 302.16 },
+	{ 1.9, 2.83, 234.64 },
+	{ 1.8, 2.24, 216.48 },
+	{ 1.2, 1.55, 191.96 },
+	{ 0.8, 3.45, 323.51 },
+	{ 0.8, 4.83, 210.12 },
+	{ 0.6, 4.19, 515.46 },
+	{ 0.6, 2.29, 209.37 },
+	{ 0.6, 4.03, 522.58 },
+	{ 0.6, 2.38, 632.78 },
+	{ 0.6, 0.30, 860.31 },
+	{ 0.6, 2.17, 124.43 },
+	{ 0.4, 2.24, 447.94 },
+	{ 0.4, 5.45, 1066.50 },
+	{ 0.5, 1.27, 654.12 },
+	{ 0.5, 3.20, 405.26 },
+	{ 0.4, 3.12, 330.62 },
+	{ 0.4, 3.39, 81.75 },
+	{ 0.3, 4.12, 838.97 },
+	{ 0.3, 3.18, 529.69 },
+	{ 0.3, 1.41, 429.78 },
+	{ 0.3, 3.19, 1464.64 },
+	{ 0.3, 2.94, 728.76 },
+	{ 0.2, 3.67, 1148.25 },
+	{ 0.3, 2.58, 1045.15 },
+	{ 0.2, 3.58, 1155.36 },
+	{ 0.3, 2.05, 1677.94 },
+	{ 0.2, 2.62, 536.80 },
+	{ 0.3, 2.48, 625.67 },
+	{ 0.2, 4.39, 1574.85 },
+	{ 0.2, 1.26, 422.67 },
+	{ 0.2, 2.33, 223.59 },
+	{ 0.2, 1.09, 742.99 },
+	{ 0.2, 0.70, 824.74 },
+	{ 0.2, 5.03, 203.00 },
+	{ 0.2, 0.40, 867.42 },
+	{ 0.2, 3.68, 831.86 },
+	{ 0.2, 5.75, 1073.61 },
+	{ 0.2, 3.02, 1781.03 },
+	{ 0.1, 2.28, 295.05 },
+	{ 0.1, 3.48, 956.29 },
+	{ 0.2, 1.91, 942.06 },
+	{ 0.1, 6.17, 316.39 },
+	/* 66 terms retained, 2 terms dropped, error 0.0049"*T^4 */
+
+	/* saturn l, T^5 */
+	{ 123.6, 2.2592, 7.1135 },
+	{ 34.2, 2.163, 14.227 },
+	{ 27.5, 1.199, 220.413 },
+	{ 5.8, 1.22, 227.53 },
+	{ 5.3, 0.24, 433.71 },
+	{ 3.7, 6.23, 426.60 },
+	{ 3.1, 2.97, 199.07 },
+	{ 2.9, 4.29, 206.19 },
+	{ 1.6, 6.25, 213.30 },
+	{ 1.3, 5.28, 639.90 },
+	{ 0.9, 5.57, 647.01 },
+	{ 0.8, 6.18, 191.96 },
+	{ 0.8, 0.69, 302.16 },
+	{ 1.0, 0.24, 440.83 },
+	{ 1.0, 3.14, 0 },
+	{ 0.5, 4.88, 88.87 },
+	{ 0.5, 4.78, 419.48 },
+	{ 0.3, 4.32, 853.20 },
+	{ 0.4, 5.70, 654.12 },
+	{ 0.2, 2.05, 323.51 },
+	{ 0.3, 1.11, 234.64 },
+	{ 0.2, 0.89, 309.28 },
+	{ 0.3, 5.10, 95.98 },
+	{ 0.2, 2.40, 515.46 },
+	{ 0.2, 4.70, 860.31 },
+	{ 0.1, 0.49, 117.32 },
+	/* 26 terms retained, 1 terms dropped, error 0.0022"*T^5 */
+	/* end saturn l */
+
+	/* saturn b, T^0 */
+	{ 4330678.0, 3.60284428, 213.29909544 },
+	{ 240348.3, 2.8523849, 426.5981909 },
+	{ 84745.9, 0, 0 },
+	{ 30863.4, 3.484415, 220.412642 },
+	{ 34116.1, 0.572973, 206.185548 },
+	{ 14734.1, 2.118466, 639.897286 },
+	{ 9916.7, 5.79003, 419.48464 },
+	{ 6993.6, 4.73605, 7.11355 },
+	{ 4807.6, 5.43305, 316.39187 },
+	{ 4788.4, 4.96513, 110.20632 },
+	{ 3432.1, 2.73256, 433.71174 },
+	{ 1506.1, 6.01305, 103.09277 },
+	{ 1060.3, 5.63099, 529.69097 },
+	{ 969.1, 5.2043, 632.7837 },
+	{ 942.1, 1.3965, 853.1964 },
+	{ 707.6, 3.8030, 323.5054 },
+	{ 552.3, 5.1315, 202.2534 },
+	{ 399.7, 3.3589, 227.5262 },
+	{ 316.1, 1.9972, 647.0108 },
+	{ 319.4, 3.6257, 209.3669 },
+	{ 284.5, 4.8865, 224.3448 },
+	{ 314.2, 0.4651, 217.2312 },
+	{ 236.4, 2.1389, 11.0457 },
+	{ 215.4, 5.9498, 846.0828 },
+	{ 208.5, 2.1200, 415.5525 },
+	{ 179.0, 2.9536, 63.7359 },
+	{ 207.2, 0.7302, 199.0720 },
+	{ 139.1, 1.9982, 735.8765 },
+	{ 134.9, 5.2450, 742.9901 },
+	{ 140.6, 0.6442, 490.3341 },
+	{ 121.7, 3.1154, 522.5774 },
+	{ 139.2, 4.5954, 14.2271 },
+	{ 115.5, 3.1089, 216.4805 },
+	{ 114.2, 0.9626, 210.1177 },
+	{ 96.4, 4.482, 117.320 },
+	{ 80.6, 1.317, 277.035 },
+	{ 73.0, 3.060, 536.805 },
+	{ 69.3, 4.924, 309.278 },
+	{ 74.3, 2.894, 149.563 },
+	{ 68.0, 2.180, 351.817 },
+	{ 61.7, 0.677, 1066.495 },
+	{ 56.6, 2.610, 440.825 },
+	{ 48.9, 5.787, 95.979 },
+	{ 48.2, 2.182, 74.782 },
+	{ 38.3, 5.292, 1059.382 },
+	{ 36.3, 1.633, 628.852 },
+	{ 35.1, 1.713, 1052.268 },
+	{ 34.3, 2.457, 422.666 },
+	{ 34.3, 5.980, 412.371 },
+	{ 33.8, 1.141, 949.176 },
+	{ 31.6, 4.147, 437.644 },
+	{ 36.8, 6.278, 1162.475 },
+	{ 27.0, 1.272, 860.310 },
+	/* 53 terms retained, 447 terms dropped, error 0.82" */
+
+	/* saturn b, T^1 */
+	{ 397555.0, 5.3328999, 213.2990954 },
+	{ 49478.6, 3.141593, 0 },
+	{ 18571.6, 6.099192, 426.598191 },
+	{ 14800.6, 2.305861, 206.185548 },
+	{ 9644.0, 1.69675, 220.41264 },
+	{ 3757.2, 1.25430, 419.48464 },
+	{ 2716.6, 5.91167, 639.89729 },
+	{ 1455.3, 0.85162, 433.71174 },
+	{ 1290.6, 2.91771, 7.11355 },
+	{ 852.6, 0.4357, 316.3919 },
+	{ 284.4, 1.6188, 227.5262 },
+	{ 292.2, 5.3157, 853.1964 },
+	{ 275.1, 3.8886, 103.0928 },
+	{ 297.7, 0.9191, 632.7837 },
+	{ 172.4, 0.0522, 647.0108 },
+	{ 127.7, 1.2071, 529.6910 },
+	{ 166.2, 2.4435, 199.0720 },
+	{ 158.2, 5.2085, 110.2063 },
+	{ 109.8, 2.4570, 217.2312 },
+	{ 81.8, 2.758, 210.118 },
+	{ 81.0, 2.860, 14.227 },
+	{ 68.7, 1.655, 202.253 },
+	{ 59.3, 1.824, 323.505 },
+	{ 65.2, 1.255, 216.480 },
+	{ 61.0, 1.253, 209.367 },
+	{ 46.4, 0.815, 440.825 },
+	{ 36.2, 1.819, 224.345 },
+	{ 34.0, 2.840, 117.320 },
+	{ 32.2, 1.187, 846.083 },
+	{ 33.1, 1.306, 412.371 },
+	{ 27.3, 4.647, 1066.495 },
+	{ 22.8, 4.129, 415.552 },
+	{ 27.1, 4.442, 11.046 },
+	{ 18.1, 5.564, 860.310 },
+	{ 20.9, 1.410, 309.278 },
+	{ 14.9, 1.343, 95.979 },
+	{ 15.3, 1.224, 63.736 },
+	{ 14.6, 1.008, 536.805 },
+	{ 12.8, 2.271, 742.990 },
+	{ 12.8, 4.889, 522.577 },
+	{ 13.1, 2.460, 490.334 },
+	{ 11.9, 1.873, 423.417 },
+	{ 13.0, 3.217, 277.035 },
+	{ 9.9, 3.12, 625.67 },
+	{ 12.7, 0.295, 422.666 },
+	{ 9.6, 1.75, 330.62 },
+	{ 8.1, 2.42, 430.53 },
+	{ 8.2, 4.68, 215.75 },
+	{ 9.0, 0.46, 429.78 },
+	{ 6.5, 3.01, 949.18 },
+	{ 7.3, 5.97, 149.56 },
+	{ 6.6, 3.91, 351.82 },
+	{ 6.8, 1.52, 437.64 },
+	/* 53 terms retained, 207 terms dropped, error 0.21"*T */
+
+	/* saturn b, T^2 */
+	{ 20630.0, 0.504824, 213.299095 },
+	{ 3719.6, 3.99833, 206.18555 },
+	{ 1627.2, 6.18190, 220.41264 },
+	{ 1346.1, 0, 0 },
+	{ 705.8, 3.0391, 419.4846 },
+	{ 365.0, 5.0993, 426.5982 },
+	{ 329.6, 5.2790, 433.7117 },
+	{ 219.3, 3.8284, 639.8973 },
+	{ 139.4, 1.0427, 7.1135 },
+	{ 104.0, 6.1573, 227.5262 },
+	{ 93.0, 1.980, 316.392 },
+	{ 71.2, 4.148, 199.072 },
+	{ 51.9, 2.884, 632.784 },
+	{ 49.0, 4.434, 647.011 },
+	{ 41.4, 3.159, 853.196 },
+	{ 28.6, 4.530, 210.118 },
+	{ 24.0, 1.116, 14.227 },
+	{ 20.5, 4.351, 217.231 },
+	{ 19.5, 5.308, 440.825 },
+	{ 18.3, 0.854, 110.206 },
+	{ 15.7, 4.258, 103.093 },
+	{ 16.8, 5.681, 216.480 },
+	{ 13.6, 2.999, 412.371 },
+	{ 11.6, 2.527, 529.691 },
+	{ 8.0, 3.32, 202.25 },
+	{ 6.6, 0.29, 323.51 },
+	{ 6.3, 1.16, 117.32 },
+	{ 5.9, 3.58, 309.28 },
+	{ 6.6, 5.56, 209.37 },
+	{ 5.6, 2.48, 1066.50 },
+	{ 6.2, 3.61, 860.31 },
+	{ 4.2, 3.02, 846.08 },
+	{ 3.6, 4.80, 625.67 },
+	{ 3.4, 3.77, 423.42 },
+	{ 3.4, 6.04, 234.64 },
+	{ 2.6, 5.64, 735.88 },
+	{ 2.8, 4.82, 429.78 },
+	{ 2.8, 4.48, 654.12 },
+	{ 2.6, 0.22, 522.58 },
+	{ 2.6, 3.29, 95.98 },
+	{ 2.4, 0.03, 415.55 },
+	{ 2.1, 4.56, 422.67 },
+	{ 2.3, 6.25, 330.62 },
+	{ 1.8, 5.53, 536.80 },
+	{ 1.8, 5.06, 277.03 },
+	{ 1.6, 5.54, 224.34 },
+	/* 46 terms retained, 65 terms dropped, error 0.045"*T^2 */
+
+	/* saturn b, T^3 */
+	{ 666.3, 1.9901, 213.2991 },
+	{ 632.4, 5.6978, 206.1855 },
+	{ 398.1, 0, 0 },
+	{ 187.8, 4.3378, 220.4126 },
+	{ 91.9, 4.841, 419.485 },
+	{ 42.4, 2.381, 426.598 },
+	{ 51.5, 3.421, 433.712 },
+	{ 25.7, 4.402, 227.526 },
+	{ 20.6, 5.853, 199.072 },
+	{ 18.1, 1.993, 639.897 },
+	{ 10.9, 5.373, 7.114 },
+	{ 9.6, 2.55, 647.01 },
+	{ 7.1, 3.46, 316.39 },
+	{ 6.0, 4.80, 632.78 },
+	{ 5.8, 0.02, 210.12 },
+	{ 4.9, 5.64, 14.23 },
+	{ 4.5, 1.22, 853.20 },
+	{ 5.5, 3.52, 440.83 },
+	{ 3.5, 4.71, 412.37 },
+	{ 2.9, 0.63, 103.09 },
+	{ 2.2, 3.72, 216.48 },
+	{ 2.0, 6.11, 217.23 },
+	{ 1.4, 1.69, 860.31 },
+	{ 1.2, 4.31, 234.64 },
+	{ 1.2, 5.75, 309.28 },
+	{ 0.8, 5.69, 117.32 },
+	{ 0.7, 0.60, 1066.50 },
+	{ 0.7, 0.22, 625.67 },
+	{ 0.8, 5.48, 202.25 },
+	{ 0.9, 2.66, 654.12 },
+	{ 0.5, 2.86, 429.78 },
+	{ 0.5, 4.18, 529.69 },
+	{ 0.5, 4.52, 323.51 },
+	/* 33 terms retained, 25 terms dropped, error 0.012"*T^3 */
+
+	/* saturn b, T^4 */
+	{ 80.4, 1.119, 206.186 },
+	{ 31.7, 3.122, 213.299 },
+	{ 17.1, 2.481, 220.413 },
+	{ 11.8, 3.142, 0 },
+	{ 9.0, 0.38, 419.48 },
+	{ 6.2, 1.56, 433.71 },
+	{ 4.7, 1.28, 199.07 },
+	{ 4.8, 2.63, 227.53 },
+	{ 1.5, 1.43, 426.60 },
+	{ 1.4, 0.67, 647.01 },
+	{ 1.1, 6.18, 639.90 },
+	{ 1.1, 1.72, 440.83 },
+	{ 0.7, 3.85, 14.23 },
+	{ 0.7, 3.49, 7.11 },
+	{ 0.5, 0.47, 632.78 },
+	{ 0.5, 0.31, 412.37 },
+	{ 0.3, 5.86, 853.20 },
+	{ 0.3, 2.50, 234.64 },
+	{ 0.2, 5.39, 316.39 },
+	{ 0.2, 2.11, 210.12 },
+	{ 0.2, 6.10, 860.31 },
+	{ 0.2, 5.95, 216.48 },
+	{ 0.1, 1.99, 625.67 },
+	{ 0.1, 0.86, 654.12 },
+	{ 0.1, 5.04, 117.32 },
+	{ 0.1, 0.45, 110.21 },
+	/* 26 terms retained, 0 terms dropped, error 0.0025"*T^4 */
+
+	/* saturn b, T^5 */
+	{ 7.9, 2.82, 206.19 },
+	{ 1.0, 0.51, 220.41 },
+	{ 0.8, 2.99, 199.07 },
+	{ 1.0, 3.14, 0 },
+	{ 0.6, 5.96, 433.71 },
+	{ 0.6, 0.78, 227.53 },
+	{ 0.4, 2.39, 419.48 },
+	{ 0.1, 5.11, 647.01 },
+	/* 8 terms retained, 3 terms dropped, error 0.0012"*T^5 */
+	/* end saturn b */
+
+	/* saturn r, T^0 */
+	{ 955758135.8, 0, 0 },
+	{ 52921382.5, 2.392262197, 213.299095438 },
+	{ 1873679.9, 5.23549605, 206.18554844 },
+	{ 1464664.0, 1.64763045, 426.59819088 },
+	{ 821891.1, 5.9352003, 316.3918697 },
+	{ 547506.9, 5.0153263, 103.0927742 },
+	{ 371684.4, 2.2711483, 220.4126424 },
+	{ 361778.4, 3.1390430, 7.1135470 },
+	{ 140617.5, 5.7040665, 632.7837393 },
+	{ 108974.7, 3.2931360, 110.2063212 },
+	{ 69007.0, 5.940996, 419.484644 },
+	{ 61053.3, 0.940378, 639.897286 },
+	{ 48913.0, 1.557334, 202.253395 },
+	{ 34143.8, 0.195186, 277.034994 },
+	{ 32401.7, 5.470846, 949.175609 },
+	{ 20936.6, 0.463492, 735.876514 },
+	{ 20839.1, 1.521026, 433.711738 },
+	{ 20746.7, 5.332557, 199.072001 },
+	{ 15298.5, 3.059437, 529.690965 },
+	{ 14296.5, 2.604335, 323.505417 },
+	{ 11993.3, 5.980514, 846.082835 },
+	{ 11380.3, 1.731057, 522.577418 },
+	{ 12884.1, 1.648923, 138.517497 },
+	{ 7752.8, 5.85191, 95.97923 },
+	{ 9796.1, 5.20476, 1265.56748 },
+	{ 6466.0, 0.17733, 1052.26838 },
+	{ 6770.6, 3.00433, 14.22709 },
+	{ 5850.4, 1.45520, 415.55249 },
+	{ 5307.5, 0.59738, 63.73590 },
+	{ 4695.7, 2.14919, 227.52619 },
+	{ 4044.0, 1.64010, 209.36694 },
+	{ 3688.1, 0.78016, 412.37110 },
+	{ 3376.5, 3.69528, 224.34480 },
+	{ 2885.3, 1.38764, 838.96929 },
+	{ 2976.0, 5.68468, 210.11770 },
+	{ 3419.6, 4.94549, 1581.95935 },
+	{ 3460.9, 1.85089, 175.16606 },
+	{ 3400.6, 0.55387, 350.33212 },
+	{ 2507.6, 3.53852, 742.99006 },
+	{ 2448.3, 6.18412, 1368.66025 },
+	{ 2406.1, 2.96559, 117.31987 },
+	{ 2881.2, 0.17961, 853.19638 },
+	{ 2174.0, 0.01509, 340.77089 },
+	{ 2024.5, 5.05411, 11.04570 },
+	{ 1740.3, 2.34657, 309.27832 },
+	{ 1861.4, 5.93362, 625.67019 },
+	{ 1888.4, 0.02968, 3.93215 },
+	{ 1610.9, 1.17302, 74.78160 },
+	{ 1462.6, 1.92588, 216.48049 },
+	{ 1474.5, 5.67670, 203.73787 },
+	{ 1395.1, 5.93669, 127.47180 },
+	{ 1781.2, 0.76314, 217.23125 },
+	{ 1817.2, 5.77713, 490.33409 },
+	{ 1472.4, 1.40065, 137.03302 },
+	{ 1304.1, 0.77236, 647.01083 },
+	{ 1149.8, 5.74021, 1162.47470 },
+	{ 1126.7, 4.46708, 265.98929 },
+	{ 1277.5, 2.98413, 1059.38193 },
+	{ 1207.1, 0.75286, 351.81659 },
+	{ 1071.4, 1.13567, 1155.36116 },
+	{ 1020.9, 5.91234, 1685.05212 },
+	{ 1315.0, 5.11203, 211.81462 },
+	{ 1295.6, 4.69184, 1898.35122 },
+	{ 1099.0, 1.81765, 149.56320 },
+	{ 998.5, 2.6313, 200.7689 },
+	{ 985.9, 2.2599, 956.2892 },
+	{ 932.4, 3.6698, 554.0700 },
+	{ 664.5, 0.6030, 728.7630 },
+	{ 659.8, 4.6664, 195.1398 },
+	{ 617.7, 5.6209, 942.0621 },
+	{ 626.4, 5.9421, 1478.8666 },
+	{ 482.2, 1.8407, 479.2884 },
+	{ 487.7, 2.7937, 3.1814 },
+	{ 470.1, 0.8385, 1471.7530 },
+	{ 451.8, 5.6447, 2001.4440 },
+	{ 553.1, 3.4109, 269.9214 },
+	{ 534.4, 1.2644, 275.5505 },
+	{ 472.6, 1.8820, 515.4639 },
+	{ 405.4, 1.6400, 536.8045 },
+	{ 517.2, 4.4431, 2214.7431 },
+	{ 452.8, 3.0035, 302.1648 },
+	{ 494.3, 2.2863, 278.5195 },
+	{ 489.8, 5.8063, 191.2077 },
+	{ 427.5, 0.0574, 284.1485 },
+	{ 339.8, 1.4020, 440.8253 },
+	{ 340.6, 0.8909, 628.8516 },
+	{ 386.0, 1.9970, 1272.6810 },
+	{ 288.3, 1.1216, 422.6660 },
+	{ 294.4, 0.4258, 312.1991 },
+	{ 262.5, 0.3175, 1045.1548 },
+	{ 295.3, 0.6714, 88.8657 },
+	{ 343.0, 5.8560, 1795.2584 },
+	{ 341.1, 2.3759, 525.4982 },
+	{ 234.0, 4.2276, 114.1385 },
+	{ 223.7, 2.2813, 330.6190 },
+	{ 275.8, 0.4783, 38.1330 },
+	{ 224.6, 0.5475, 1788.1449 },
+	{ 303.3, 0.8795, 6069.7768 },
+	{ 292.1, 6.2142, 210.8514 },
+	{ 226.1, 0.3750, 142.4497 },
+	{ 277.3, 5.3192, 692.5875 },
+	{ 242.9, 5.3719, 1258.4539 },
+	{ 205.6, 0.9576, 288.0807 },
+	{ 207.6, 5.3813, 2317.8359 },
+	{ 186.8, 6.0359, 404.5068 },
+	{ 218.5, 5.2561, 212.3359 },
+	{ 222.2, 5.9459, 39.3569 },
+	{ 179.7, 4.4105, 408.4389 },
+	{ 241.4, 1.1253, 388.4652 },
+	{ 197.1, 3.9014, 52.6902 },
+	{ 236.6, 0.9080, 1375.7738 },
+	{ 171.9, 5.5632, 213.3473 },
+	{ 169.9, 2.8567, 99.1606 },
+	{ 214.4, 4.2025, 2531.1350 },
+	{ 172.0, 2.3654, 213.2509 },
+	{ 165.7, 2.6368, 215.7468 },
+	{ 230.9, 5.4946, 191.9585 },
+	{ 177.6, 0.3816, 430.5303 },
+	{ 191.5, 2.9591, 437.6439 },
+	{ 163.2, 3.4583, 617.8059 },
+	{ 162.3, 5.7305, 203.0042 },
+	{ 175.1, 5.7140, 1066.4955 },
+	{ 183.0, 5.6685, 2111.6503 },
+	{ 150.1, 4.4066, 417.0370 },
+	{ 187.9, 6.0792, 563.6312 },
+	{ 145.1, 5.0818, 423.4168 },
+	{ 137.5, 5.4391, 222.8603 },
+	{ 172.8, 1.8492, 1589.0729 },
+	{ 165.5, 2.8913, 214.2623 },
+	{ 145.7, 1.5657, 831.8557 },
+	{ 176.9, 2.3032, 9999.9865 },
+	{ 128.9, 2.5534, 414.0680 },
+	{ 120.1, 0.0433, 1361.5467 },
+	{ 143.4, 0.9982, 76.2661 },
+	{ 108.7, 2.0928, 207.6700 },
+	{ 132.1, 2.8590, 312.4597 },
+	{ 112.2, 0.2622, 2104.5368 },
+	{ 125.2, 4.7835, 205.2223 },
+	{ 104.4, 3.6367, 65.2204 },
+	{ 107.4, 3.6706, 212.7778 },
+	{ 108.6, 2.8549, 21.3406 },
+	{ 97.7, 5.122, 2634.228 },
+	{ 109.1, 1.6323, 208.6332 },
+	{ 96.9, 4.199, 305.346 },
+	{ 96.5, 2.560, 1692.166 },
+	{ 85.8, 4.545, 210.378 },
+	{ 99.2, 5.138, 1574.846 },
+	{ 112.5, 5.0311, 703.6332 },
+	{ 84.0, 1.183, 429.780 },
+	{ 89.0, 5.388, 107.025 },
+	{ 110.2, 2.4366, 355.7487 },
+	{ 90.7, 4.209, 213.820 },
+	{ 95.9, 5.446, 2428.042 },
+	{ 94.1, 2.398, 483.221 },
+	{ 85.6, 0.034, 860.310 },
+	{ 88.8, 4.058, 128.956 },
+	{ 82.0, 1.665, 62.251 },
+	{ 91.2, 3.969, 2847.527 },
+	{ 84.0, 4.608, 177.874 },
+	{ 88.4, 3.868, 140.002 },
+	{ 93.3, 0.738, 831.105 },
+	{ 91.9, 2.950, 35.425 },
+	{ 87.1, 1.334, 1905.465 },
+	{ 96.6, 4.844, 131.404 },
+	{ 71.0, 0.993, 405.258 },
+	{ 95.3, 2.515, 2.448 },
+	{ 72.5, 4.632, 245.542 },
+	{ 82.6, 1.528, 145.631 },
+	{ 76.7, 3.152, 767.369 },
+	{ 70.3, 4.043, 173.942 },
+	{ 86.0, 2.301, 85.827 },
+	{ 66.5, 4.751, 70.849 },
+	{ 65.8, 2.469, 280.967 },
+	{ 64.8, 0.093, 9.561 },
+	{ 71.6, 0.012, 565.116 },
+	{ 66.5, 1.080, 339.286 },
+	{ 63.5, 2.017, 234.640 },
+	{ 60.8, 5.120, 756.323 },
+	{ 58.1, 6.057, 1677.939 },
+	{ 64.2, 1.286, 1148.248 },
+	{ 73.1, 4.378, 425.114 },
+	{ 55.0, 3.859, 342.255 },
+	{ 57.1, 6.267, 2420.929 },
+	{ 64.1, 4.099, 327.438 },
+	{ 55.3, 1.605, 543.024 },
+	{ 58.0, 5.473, 347.884 },
+	{ 73.6, 3.723, 92.047 },
+	{ 73.8, 3.570, 1.484 },
+	{ 64.9, 2.447, 267.474 },
+	{ 54.4, 3.715, 344.703 },
+	{ 49.8, 3.935, 192.692 },
+	{ 49.5, 3.228, 333.657 },
+	{ 47.5, 3.929, 199.284 },
+	{ 49.4, 4.903, 217.492 },
+	{ 62.7, 4.401, 214.784 },
+	{ 46.4, 2.094, 212.548 },
+	{ 46.3, 2.640, 10.295 },
+	{ 54.3, 1.072, 362.862 },
+	{ 58.7, 2.623, 225.829 },
+	{ 48.5, 3.152, 216.220 },
+	{ 46.3, 4.862, 2950.620 },
+	{ 46.0, 4.973, 198.321 },
+	{ 46.7, 2.450, 207.149 },
+	{ 44.9, 1.776, 223.594 },
+	{ 44.5, 5.560, 264.505 },
+	{ 55.9, 4.295, 329.725 },
+	{ 49.6, 5.208, 2744.434 },
+	{ 58.8, 4.231, 700.664 },
+	{ 52.6, 3.792, 343.219 },
+	{ 41.5, 0.745, 125.987 },
+	{ 47.8, 2.393, 207.882 },
+	{ 56.2, 2.072, 124.433 },
+	{ 43.3, 1.837, 106.274 },
+	{ 39.8, 4.009, 12.530 },
+	{ 53.9, 4.979, 134.585 },
+	{ 50.1, 5.759, 320.324 },
+	{ 45.0, 5.357, 218.928 },
+	{ 41.1, 4.923, 1891.238 },
+	{ 46.5, 2.066, 2008.558 },
+	{ 42.9, 0.399, 357.446 },
+	{ 38.0, 2.065, 247.239 },
+	{ 48.7, 5.328, 3127.313 },
+	{ 34.6, 5.626, 99.911 },
+	{ 41.1, 2.473, 237.678 },
+	{ 40.8, 4.084, 621.738 },
+	{ 34.2, 0.731, 750.104 },
+	{ 34.0, 5.313, 206.234 },
+	{ 36.5, 1.688, 22.091 },
+	{ 39.4, 3.457, 241.610 },
+	{ 34.8, 2.248, 487.365 },
+	{ 33.0, 4.866, 209.106 },
+	{ 32.6, 2.227, 319.573 },
+	{ 39.0, 3.739, 3163.919 },
+	{ 32.7, 1.066, 252.656 },
+	{ 38.7, 4.396, 18.159 },
+	{ 34.5, 1.826, 380.128 },
+	{ 41.5, 0.081, 210.330 },
+	{ 33.5, 5.805, 251.432 },
+	{ 31.2, 1.965, 244.319 },
+	{ 30.5, 2.269, 1169.588 },
+	{ 34.8, 5.963, 217.965 },
+	{ 38.5, 4.437, 160.609 },
+	{ 36.0, 3.833, 56.622 },
+	{ 31.0, 4.899, 144.147 },
+	{ 32.3, 3.582, 231.458 },
+	{ 28.8, 5.801, 1994.330 },
+	{ 32.2, 2.132, 206.137 },
+	{ 32.6, 1.931, 98.900 },
+	{ 34.9, 5.653, 497.448 },
+	{ 28.9, 2.217, 14.978 },
+	{ 31.6, 3.818, 73.297 },
+	{ 32.2, 0.998, 1464.639 },
+	{ 29.2, 5.984, 2737.321 },
+	{ 36.7, 4.755, 348.848 },
+	{ 28.7, 1.687, 78.714 },
+	{ 27.5, 6.121, 214.050 },
+	{ 28.8, 0.044, 5.629 },
+	{ 27.2, 0.246, 313.210 },
+	{ 32.4, 3.779, 33.940 },
+	{ 27.1, 5.203, 148.079 },
+	{ 35.0, 3.439, 273.103 },
+	{ 33.1, 2.447, 969.622 },
+	{ 27.7, 1.446, 258.876 },
+	{ 27.2, 4.259, 179.359 },
+	{ 27.9, 0.788, 546.956 },
+	{ 29.1, 4.839, 905.887 },
+	{ 27.4, 2.449, 254.944 },
+	{ 34.3, 6.009, 166.829 },
+	{ 28.9, 6.029, 188.920 },
+	{ 26.0, 0.650, 654.124 },
+	{ 33.6, 1.237, 2221.857 },
+	{ 27.8, 5.178, 5.417 },
+	{ 25.6, 3.359, 0.963 },
+	{ 28.8, 0.755, 488.850 },
+	{ 31.2, 2.053, 282.452 },
+	{ 25.4, 5.290, 636.716 },
+	{ 25.3, 4.970, 3060.826 },
+	{ 29.6, 3.927, 206.707 },
+	{ 28.3, 2.721, 32.243 },
+	{ 26.9, 2.863, 24.379 },
+	{ 28.3, 4.731, 552.586 },
+	{ 25.3, 5.120, 168.053 },
+	{ 26.4, 1.593, 491.819 },
+	{ 27.1, 5.537, 555.554 },
+	{ 27.3, 3.579, 561.184 },
+	{ 25.2, 1.781, 182.280 },
+	{ 25.6, 1.621, 2324.949 },
+	{ 25.6, 2.099, 248.724 },
+	/* 288 terms retained, 917 terms dropped, error 8.7e-06 a.u. */
+
+	/* saturn r, T^1 */
+	{ 6182981.3, 0.25843515, 213.29909544 },
+	{ 506577.6, 0.7111465, 206.1855484 },
+	{ 341394.1, 5.7963577, 426.5981909 },
+	{ 188491.4, 0.4721572, 220.4126424 },
+	{ 186261.5, 3.1415927, 0 },
+	{ 143891.2, 1.4074486, 7.1135470 },
+	{ 49621.1, 6.017445, 103.092774 },
+	{ 20928.2, 5.092457, 639.897286 },
+	{ 19952.6, 1.175601, 419.484644 },
+	{ 18839.6, 1.608196, 110.206321 },
+	{ 12892.8, 5.943303, 433.711738 },
+	{ 13876.6, 0.758862, 199.072001 },
+	{ 5396.7, 1.28852, 14.22709 },
+	{ 4869.3, 0.86794, 323.50542 },
+	{ 4247.5, 0.39299, 227.52619 },
+	{ 3252.1, 1.25853, 95.97923 },
+	{ 2856.0, 2.16731, 735.87651 },
+	{ 2909.4, 4.60679, 202.25340 },
+	{ 3081.4, 3.43663, 522.57742 },
+	{ 1987.7, 2.45054, 412.37110 },
+	{ 1941.3, 6.02393, 209.36694 },
+	{ 1581.4, 1.29192, 210.11770 },
+	{ 1339.5, 4.30802, 853.19638 },
+	{ 1315.6, 1.25296, 117.31987 },
+	{ 1203.1, 1.86655, 316.39187 },
+	{ 1091.1, 0.07527, 216.48049 },
+	{ 954.4, 5.1517, 647.0108 },
+	{ 966.0, 0.4799, 632.7837 },
+	{ 881.8, 1.8847, 1052.2684 },
+	{ 874.2, 1.4022, 224.3448 },
+	{ 897.5, 0.9834, 529.6910 },
+	{ 784.9, 3.0638, 838.9693 },
+	{ 739.9, 1.3823, 625.6702 },
+	{ 613.0, 3.0331, 63.7359 },
+	{ 658.2, 4.1436, 309.2783 },
+	{ 649.6, 1.7249, 742.9901 },
+	{ 599.2, 2.5492, 217.2312 },
+	{ 502.9, 2.1296, 3.9322 },
+	{ 413.0, 4.5933, 415.5525 },
+	{ 356.1, 2.3031, 728.7630 },
+	{ 344.8, 5.8879, 440.8253 },
+	{ 395.0, 0.5335, 956.2892 },
+	{ 335.5, 1.6161, 1368.6603 },
+	{ 362.8, 4.7069, 302.1648 },
+	{ 321.6, 0.9793, 3.1814 },
+	{ 277.8, 0.2601, 195.1398 },
+	{ 291.2, 2.8313, 1155.3612 },
+	{ 265.0, 2.4267, 88.8657 },
+	{ 264.9, 5.8286, 149.5632 },
+	{ 316.8, 3.5840, 515.4639 },
+	{ 294.3, 2.8163, 11.0457 },
+	{ 244.9, 1.0449, 942.0621 },
+	{ 215.4, 3.5654, 490.3341 },
+	{ 264.0, 1.2855, 1059.3819 },
+	{ 246.2, 0.9073, 191.9585 },
+	{ 222.1, 5.1319, 269.9214 },
+	{ 195.0, 4.5667, 846.0828 },
+	{ 182.8, 2.6791, 127.4718 },
+	{ 181.6, 4.9343, 74.7816 },
+	{ 174.7, 3.4456, 137.0330 },
+	{ 165.5, 5.9978, 536.8045 },
+	{ 154.8, 1.1972, 265.9893 },
+	{ 169.7, 4.6346, 284.1485 },
+	{ 151.5, 0.5293, 330.6190 },
+	{ 152.5, 5.4389, 422.6660 },
+	{ 157.7, 2.9956, 340.7709 },
+	{ 140.6, 2.0207, 1045.1548 },
+	{ 139.8, 1.3528, 1685.0521 },
+	{ 141.0, 1.2710, 203.0042 },
+	{ 136.0, 5.0168, 351.8166 },
+	{ 153.4, 0.2697, 1272.6810 },
+	{ 129.5, 1.1434, 21.3406 },
+	{ 127.8, 2.5388, 1471.7530 },
+	{ 126.5, 3.0031, 277.0350 },
+	{ 100.3, 3.6136, 1066.4955 },
+	{ 103.2, 0.3818, 203.7379 },
+	{ 107.5, 4.3187, 210.8514 },
+	{ 95.9, 0.795, 1258.454 },
+	{ 82.7, 0.282, 234.640 },
+	{ 98.0, 2.561, 191.208 },
+	{ 97.4, 3.262, 831.856 },
+	{ 72.2, 4.380, 860.310 },
+	{ 70.6, 0.732, 437.644 },
+	{ 70.4, 0.877, 423.417 },
+	{ 72.1, 5.580, 429.780 },
+	{ 73.3, 0.625, 1375.774 },
+	{ 66.4, 2.684, 405.258 },
+	{ 63.8, 1.751, 1361.547 },
+	{ 61.6, 1.093, 2001.444 },
+	{ 67.0, 0.069, 408.439 },
+	{ 68.9, 2.471, 949.176 },
+	{ 60.5, 2.251, 1788.145 },
+	{ 67.1, 5.454, 200.769 },
+	{ 65.6, 0.055, 1589.073 },
+	{ 49.3, 4.172, 138.517 },
+	{ 50.6, 6.269, 223.594 },
+	{ 55.2, 4.595, 628.852 },
+	{ 47.9, 0.839, 10.295 },
+	{ 46.7, 2.173, 312.199 },
+	{ 54.2, 0.284, 124.433 },
+	{ 49.5, 3.800, 215.747 },
+	{ 40.1, 5.182, 1478.867 },
+	{ 39.3, 0.563, 1574.846 },
+	{ 35.0, 4.685, 38.133 },
+	{ 42.8, 2.986, 1148.248 },
+	{ 36.5, 0.635, 52.690 },
+	{ 39.8, 0.284, 131.404 },
+	{ 31.8, 5.190, 76.266 },
+	{ 33.0, 1.980, 142.450 },
+	{ 42.1, 4.830, 288.081 },
+	{ 30.8, 1.479, 1677.939 },
+	{ 42.8, 3.382, 208.633 },
+	{ 29.2, 5.099, 654.124 },
+	{ 29.2, 4.957, 1795.258 },
+	{ 29.1, 2.747, 404.507 },
+	{ 32.7, 6.121, 145.631 },
+	{ 28.0, 0.832, 2317.836 },
+	{ 27.7, 2.244, 430.530 },
+	{ 29.9, 1.964, 2104.537 },
+	{ 33.0, 3.282, 222.860 },
+	{ 31.8, 6.025, 1905.465 },
+	{ 27.0, 5.243, 388.465 },
+	{ 26.5, 0.996, 107.025 },
+	{ 25.4, 2.873, 703.633 },
+	{ 24.9, 1.077, 99.911 },
+	{ 25.0, 6.240, 106.274 },
+	{ 24.9, 0.810, 312.460 },
+	{ 24.3, 0.549, 214.262 },
+	{ 28.4, 0.826, 1692.166 },
+	{ 23.2, 5.080, 479.288 },
+	{ 24.4, 3.106, 212.336 },
+	{ 22.0, 6.067, 85.827 },
+	{ 22.0, 3.899, 563.631 },
+	{ 22.6, 4.867, 295.051 },
+	{ 21.3, 5.108, 333.657 },
+	{ 26.0, 2.208, 1265.567 },
+	{ 20.9, 3.289, 70.849 },
+	{ 21.5, 3.795, 347.884 },
+	{ 22.1, 4.227, 217.965 },
+	{ 20.6, 1.687, 231.458 },
+	{ 21.4, 3.089, 554.070 },
+	{ 21.3, 0.389, 319.573 },
+	{ 20.5, 2.457, 18.159 },
+	{ 26.1, 4.276, 483.221 },
+	{ 20.7, 5.121, 362.862 },
+	{ 22.0, 5.512, 343.219 },
+	{ 19.4, 2.024, 313.210 },
+	{ 20.2, 5.085, 750.104 },
+	{ 20.1, 3.430, 213.347 },
+	{ 24.2, 0.648, 207.882 },
+	{ 22.0, 0.729, 99.161 },
+	{ 21.1, 2.693, 1464.639 },
+	{ 17.2, 4.715, 2111.650 },
+	{ 18.5, 0.048, 245.542 },
+	{ 17.5, 3.837, 497.448 },
+	{ 16.1, 4.224, 565.116 },
+	{ 21.6, 4.166, 2.448 },
+	{ 16.0, 0.274, 225.829 },
+	{ 16.8, 1.411, 114.138 },
+	{ 15.6, 2.828, 81.752 },
+	{ 15.5, 1.206, 1994.330 },
+	{ 15.2, 3.846, 1162.475 },
+	{ 16.4, 3.048, 134.585 },
+	{ 15.9, 0.330, 1891.238 },
+	{ 20.4, 0.232, 213.251 },
+	{ 16.3, 1.706, 2420.929 },
+	{ 16.3, 4.942, 357.446 },
+	{ 18.1, 5.695, 56.622 },
+	{ 13.7, 0.572, 2634.228 },
+	{ 17.4, 3.553, 218.928 },
+	{ 13.7, 5.705, 92.047 },
+	{ 15.3, 1.313, 216.220 },
+	{ 12.5, 5.192, 635.965 },
+	{ 12.8, 1.602, 320.324 },
+	{ 13.0, 0.451, 1169.588 },
+	{ 12.0, 5.949, 543.918 },
+	{ 11.8, 2.803, 217.492 },
+	{ 14.7, 5.565, 344.703 },
+	{ 12.8, 1.636, 273.103 },
+	{ 11.9, 2.462, 721.649 },
+	{ 13.3, 5.756, 2221.857 },
+	{ 14.5, 0.453, 2008.558 },
+	{ 11.8, 1.757, 160.609 },
+	{ 12.4, 1.015, 329.725 },
+	{ 10.7, 1.581, 212.778 },
+	{ 12.8, 1.920, 1581.959 },
+	{ 11.9, 4.447, 32.243 },
+	{ 11.9, 5.107, 4.666 },
+	{ 11.9, 4.308, 618.557 },
+	{ 10.0, 0.487, 305.346 },
+	{ 12.8, 3.744, 508.350 },
+	{ 10.7, 0.766, 218.716 },
+	{ 11.4, 3.000, 198.321 },
+	{ 10.2, 2.409, 546.956 },
+	{ 10.0, 2.639, 416.303 },
+	{ 9.3, 5.46, 414.07 },
+	{ 9.3, 4.46, 2428.04 },
+	{ 9.9, 4.05, 62.25 },
+	{ 12.8, 3.433, 258.876 },
+	{ 9.7, 1.61, 327.44 },
+	{ 11.2, 2.407, 1781.031 },
+	{ 10.6, 2.075, 213.820 },
+	{ 9.1, 2.92, 1279.79 },
+	{ 9.5, 1.10, 113.39 },
+	{ 9.8, 3.28, 275.55 },
+	{ 11.3, 1.894, 561.184 },
+	{ 8.6, 2.18, 425.11 },
+	{ 8.6, 1.95, 35.42 },
+	{ 10.2, 0.090, 182.280 },
+	{ 11.8, 3.713, 350.332 },
+	{ 8.6, 1.83, 629.60 },
+	{ 8.4, 3.77, 251.43 },
+	{ 8.5, 0.36, 617.81 },
+	{ 8.2, 5.31, 65.22 },
+	{ 8.3, 1.38, 1.48 },
+	{ 8.0, 5.14, 22.09 },
+	{ 8.4, 0.92, 1485.98 },
+	{ 8.0, 0.94, 2310.72 },
+	{ 8.9, 0.54, 168.05 },
+	{ 8.2, 3.46, 424.15 },
+	{ 8.0, 3.38, 144.15 },
+	{ 7.9, 5.14, 358.93 },
+	{ 8.9, 6.14, 621.74 },
+	{ 7.5, 5.75, 447.94 },
+	{ 7.5, 2.19, 264.50 },
+	{ 8.1, 1.43, 2737.32 },
+	{ 8.2, 0.96, 767.37 },
+	{ 8.2, 0.35, 278.52 },
+	{ 8.2, 5.44, 254.94 },
+	{ 6.8, 1.20, 5.42 },
+	{ 8.9, 4.88, 120.36 },
+	{ 7.8, 4.56, 280.97 },
+	{ 6.6, 3.50, 9.56 },
+	{ 6.4, 0.33, 2950.62 },
+	{ 6.9, 3.39, 98.90 },
+	{ 7.4, 4.52, 5.63 },
+	{ 8.0, 0.94, 636.72 },
+	{ 7.2, 3.85, 214.05 },
+	{ 6.4, 2.12, 274.07 },
+	{ 6.5, 5.31, 6076.89 },
+	{ 6.4, 0.45, 10007.10 },
+	{ 6.3, 3.21, 219.45 },
+	{ 6.7, 1.65, 1898.35 },
+	{ 7.6, 0.10, 2324.95 },
+	{ 6.3, 0.76, 210.38 },
+	{ 6.6, 1.79, 12.53 },
+	/* 246 terms retained, 393 terms dropped, error 2.1e-06 a.u.*T */
+
+	/* saturn r, T^2 */
+	{ 436902.5, 4.7867167, 213.2990954 },
+	{ 71922.8, 2.500700, 206.185548 },
+	{ 49766.8, 4.971682, 220.412642 },
+	{ 43220.9, 3.869404, 426.598191 },
+	{ 29645.6, 5.963103, 7.113547 },
+	{ 4141.6, 4.10671, 433.71174 },
+	{ 4720.9, 2.47528, 199.07200 },
+	{ 3789.4, 3.09771, 639.89729 },
+	{ 2964.0, 1.37206, 103.09277 },
+	{ 2556.4, 2.85066, 419.48464 },
+	{ 2208.5, 6.27589, 110.20632 },
+	{ 2187.6, 5.85546, 14.22709 },
+	{ 1956.9, 4.92449, 227.52619 },
+	{ 2326.8, 0, 0 },
+	{ 923.8, 5.4639, 323.5054 },
+	{ 705.9, 2.9708, 95.9792 },
+	{ 546.1, 4.1285, 412.3711 },
+	{ 373.8, 5.8344, 117.3199 },
+	{ 360.9, 3.2770, 647.0108 },
+	{ 356.3, 3.1915, 210.1177 },
+	{ 390.6, 4.4811, 216.4805 },
+	{ 431.5, 5.1783, 522.5774 },
+	{ 325.6, 2.2687, 853.1964 },
+	{ 405.0, 4.1729, 209.3669 },
+	{ 204.5, 0.0877, 202.2534 },
+	{ 206.9, 4.0219, 735.8765 },
+	{ 178.5, 4.0972, 440.8253 },
+	{ 180.1, 3.5970, 632.7837 },
+	{ 153.7, 3.1347, 625.6702 },
+	{ 147.8, 0.1361, 302.1648 },
+	{ 123.2, 4.1890, 88.8657 },
+	{ 133.1, 2.5935, 191.9585 },
+	{ 100.4, 5.4606, 3.1814 },
+	{ 132.0, 5.9329, 309.2783 },
+	{ 97.2, 4.018, 728.763 },
+	{ 110.7, 4.7785, 838.9693 },
+	{ 119.1, 5.5539, 224.3448 },
+	{ 93.9, 4.384, 217.231 },
+	{ 108.7, 5.2931, 515.4639 },
+	{ 78.6, 5.725, 21.341 },
+	{ 81.5, 5.109, 956.289 },
+	{ 96.4, 6.259, 742.990 },
+	{ 69.2, 4.049, 3.932 },
+	{ 65.2, 3.777, 1052.268 },
+	{ 64.1, 5.812, 529.691 },
+	{ 62.5, 2.184, 195.140 },
+	{ 57.0, 3.147, 203.004 },
+	{ 56.0, 4.841, 234.640 },
+	{ 52.9, 5.078, 330.619 },
+	{ 50.6, 2.773, 942.062 },
+	{ 41.6, 4.790, 63.736 },
+	{ 44.9, 0.565, 269.921 },
+	{ 41.4, 3.735, 316.392 },
+	{ 52.8, 3.926, 949.176 },
+	{ 38.4, 3.740, 1045.155 },
+	{ 37.6, 4.189, 536.805 },
+	{ 35.3, 2.908, 284.149 },
+	{ 33.6, 3.805, 149.563 },
+	{ 41.1, 4.579, 1155.361 },
+	{ 30.4, 2.481, 860.310 },
+	{ 31.4, 4.841, 1272.681 },
+	{ 30.2, 4.352, 405.258 },
+	{ 39.4, 3.509, 422.666 },
+	{ 29.7, 1.589, 1066.495 },
+	{ 35.2, 5.945, 1059.382 },
+	{ 25.8, 3.549, 1368.660 },
+	{ 26.3, 4.816, 124.433 },
+	{ 30.0, 3.663, 429.780 },
+	{ 33.0, 4.969, 831.856 },
+	{ 24.3, 5.311, 10.295 },
+	{ 26.3, 4.453, 223.594 },
+	{ 22.1, 2.761, 415.552 },
+	{ 27.2, 1.663, 277.035 },
+	{ 21.6, 1.038, 11.046 },
+	{ 19.7, 2.522, 1258.454 },
+	{ 17.1, 3.277, 654.124 },
+	{ 17.3, 3.494, 1361.547 },
+	{ 16.1, 1.734, 490.334 },
+	{ 21.1, 3.621, 1265.567 },
+	{ 17.7, 4.311, 1471.753 },
+	{ 13.5, 0.323, 295.051 },
+	{ 12.6, 3.138, 74.782 },
+	{ 12.0, 2.329, 210.851 },
+	{ 15.1, 3.596, 265.989 },
+	{ 13.0, 4.624, 1589.073 },
+	{ 15.4, 5.013, 127.472 },
+	{ 11.2, 4.550, 81.752 },
+	{ 13.4, 4.887, 437.644 },
+	{ 10.7, 5.052, 191.208 },
+	{ 14.0, 3.050, 423.417 },
+	{ 10.6, 5.028, 137.033 },
+	{ 14.4, 4.687, 1148.248 },
+	{ 13.5, 1.903, 408.439 },
+	{ 10.1, 5.204, 340.771 },
+	{ 10.3, 3.345, 1685.052 },
+	{ 9.6, 3.17, 351.82 },
+	{ 11.3, 5.478, 1375.774 },
+	{ 8.6, 2.81, 99.91 },
+	{ 8.5, 3.23, 1677.94 },
+	{ 7.9, 2.36, 1574.85 },
+	{ 7.6, 6.08, 231.46 },
+	{ 9.2, 3.40, 1581.96 },
+	{ 7.3, 2.00, 131.40 },
+	{ 8.2, 4.04, 1788.14 },
+	{ 7.6, 3.68, 846.08 },
+	{ 6.7, 4.37, 145.63 },
+	{ 7.5, 3.29, 750.10 },
+	{ 6.4, 4.00, 447.94 },
+	{ 6.2, 4.56, 106.27 },
+	{ 6.5, 1.34, 215.75 },
+	{ 6.5, 3.78, 313.21 },
+	{ 6.0, 0.55, 18.16 },
+	{ 6.2, 2.85, 138.52 },
+	{ 6.8, 4.83, 319.57 },
+	{ 6.7, 5.43, 508.35 },
+	{ 7.2, 4.38, 1464.64 },
+	{ 5.8, 4.14, 543.92 },
+	{ 5.7, 4.35, 1905.46 },
+	{ 5.1, 2.64, 288.08 },
+	{ 5.3, 3.63, 6076.89 },
+	{ 5.5, 4.20, 721.65 },
+	{ 5.1, 5.05, 10007.10 },
+	{ 5.5, 1.13, 56.62 },
+	{ 4.8, 3.30, 76.27 },
+	{ 4.9, 6.18, 483.22 },
+	{ 5.0, 2.45, 628.85 },
+	{ 4.5, 1.20, 200.77 },
+	{ 4.8, 3.12, 2001.44 },
+	{ 4.7, 1.27, 6062.66 },
+	{ 4.8, 5.78, 184.84 },
+	{ 4.8, 0.76, 333.66 },
+	{ 4.5, 0.95, 343.22 },
+	{ 4.5, 2.69, 9992.87 },
+	{ 4.4, 0.80, 222.86 },
+	{ 4.9, 5.92, 618.56 },
+	{ 4.1, 1.92, 497.45 },
+	{ 5.1, 4.50, 416.30 },
+	{ 4.1, 1.98, 347.88 },
+	{ 4.0, 2.88, 38.13 },
+	{ 4.1, 2.90, 107.02 },
+	{ 4.0, 2.93, 1994.33 },
+	{ 4.9, 3.12, 1898.35 },
+	{ 3.7, 3.25, 362.86 },
+	{ 3.8, 0.88, 703.63 },
+	{ 3.6, 3.48, 388.47 },
+	{ 3.6, 4.08, 430.53 },
+	{ 3.6, 0.05, 32.24 },
+	{ 3.6, 5.46, 6283.08 },
+	{ 3.5, 1.82, 70.85 },
+	{ 3.8, 3.12, 635.97 },
+	{ 3.4, 0.55, 10213.29 },
+	{ 3.4, 3.52, 629.60 },
+	{ 3.4, 3.28, 357.45 },
+	{ 3.3, 1.98, 203.74 },
+	{ 3.1, 2.18, 1891.24 },
+	{ 3.2, 1.26, 134.59 },
+	{ 4.0, 5.45, 1692.17 },
+	{ 3.2, 2.46, 867.42 },
+	{ 3.4, 4.21, 337.73 },
+	{ 3.0, 2.19, 217.96 },
+	{ 3.6, 5.55, 113.39 },
+	{ 3.7, 3.79, 2104.54 },
+	{ 3.1, 4.09, 1478.87 },
+	{ 2.9, 3.91, 312.20 },
+	{ 3.2, 3.92, 1038.04 },
+	{ 4.0, 5.18, 404.51 },
+	{ 3.9, 4.12, 1781.03 },
+	{ 3.1, 1.61, 1073.61 },
+	{ 3.1, 5.01, 312.46 },
+	{ 3.0, 5.46, 258.88 },
+	{ 2.9, 2.38, 181.06 },
+	{ 3.0, 0.89, 1279.79 },
+	{ 2.7, 0.01, 195.89 },
+	{ 3.1, 5.60, 216.22 },
+	{ 2.6, 6.13, 273.10 },
+	{ 2.7, 2.32, 565.12 },
+	{ 3.2, 3.88, 85.83 },
+	{ 2.7, 5.74, 160.61 },
+	{ 2.9, 4.75, 213.25 },
+	{ 2.5, 5.30, 444.76 },
+	{ 2.8, 5.09, 1169.59 },
+	{ 2.9, 1.67, 213.35 },
+	{ 2.9, 4.21, 650.94 },
+	{ 3.0, 2.55, 6069.78 },
+	{ 3.1, 2.67, 52.69 },
+	{ 2.4, 0.90, 121.25 },
+	{ 3.0, 3.97, 9999.99 },
+	{ 3.1, 0.41, 561.18 },
+	{ 2.4, 4.74, 218.72 },
+	{ 2.6, 1.13, 344.70 },
+	{ 2.3, 4.08, 131.55 },
+	{ 2.2, 3.38, 22.09 },
+	{ 2.1, 3.32, 358.93 },
+	{ 2.7, 1.69, 208.63 },
+	{ 2.6, 5.10, 824.74 },
+	{ 2.2, 2.60, 305.35 },
+	{ 2.1, 3.37, 320.32 },
+	{ 2.7, 3.62, 436.89 },
+	{ 2.5, 2.96, 2214.74 },
+	{ 2.7, 2.88, 643.08 },
+	{ 2.1, 1.61, 218.93 },
+	{ 2.0, 4.63, 188.03 },
+	{ 2.4, 3.46, 6275.96 },
+	{ 2.0, 2.29, 2627.11 },
+	{ 1.9, 5.67, 28.45 },
+	{ 1.9, 4.26, 546.96 },
+	{ 2.5, 3.58, 2420.93 },
+	{ 1.9, 1.31, 212.34 },
+	{ 1.9, 1.59, 424.15 },
+	{ 1.9, 3.58, 329.73 },
+	{ 2.1, 3.95, 1795.26 },
+	{ 2.2, 4.22, 2221.86 },
+	{ 1.9, 1.69, 350.33 },
+	{ 1.8, 2.07, 144.15 },
+	{ 1.9, 4.61, 182.28 },
+	{ 2.2, 5.18, 99.16 },
+	{ 1.8, 2.73, 291.26 },
+	{ 2.2, 5.43, 207.88 },
+	{ 1.8, 2.24, 168.05 },
+	{ 1.7, 1.32, 219.45 },
+	{ 1.7, 5.56, 92.80 },
+	{ 1.7, 1.95, 129.92 },
+	{ 2.1, 4.85, 1141.13 },
+	{ 1.8, 5.05, 214.26 },
+	{ 1.8, 2.86, 636.72 },
+	{ 1.9, 2.90, 2310.72 },
+	{ 1.8, 5.35, 45.58 },
+	{ 1.7, 6.14, 554.07 },
+	{ 1.6, 4.51, 210.38 },
+	{ 1.7, 3.55, 1354.43 },
+	{ 1.9, 3.01, 2317.84 },
+	{ 1.6, 1.16, 235.39 },
+	{ 1.9, 4.13, 225.83 },
+	{ 1.6, 3.30, 1670.83 },
+	{ 1.9, 0.18, 12.53 },
+	{ 1.6, 5.73, 1485.98 },
+	{ 1.7, 3.44, 2428.04 },
+	{ 1.8, 2.70, 12.74 },
+	{ 1.7, 4.98, 2008.56 },
+	/* 239 terms retained, 103 terms dropped, error 5.2e-07 a.u.*T^2 */
+
+	/* saturn r, T^3 */
+	{ 20315.0, 3.021866, 213.299095 },
+	{ 8923.6, 3.19144, 220.41264 },
+	{ 6908.7, 4.35175, 206.18555 },
+	{ 4087.1, 4.22407, 7.11355 },
+	{ 3879.0, 2.01056, 426.59819 },
+	{ 1070.8, 4.20360, 199.07200 },
+	{ 907.3, 2.2834, 433.7117 },
+	{ 606.1, 3.1746, 227.5262 },
+	{ 596.6, 4.1346, 14.2271 },
+	{ 483.2, 1.1735, 639.8973 },
+	{ 393.2, 0, 0 },
+	{ 229.5, 4.6984, 419.4846 },
+	{ 188.2, 4.5900, 110.2063 },
+	{ 149.5, 3.2020, 103.0928 },
+	{ 121.4, 3.7683, 323.5054 },
+	{ 101.2, 5.8188, 412.3711 },
+	{ 102.1, 4.7097, 95.9792 },
+	{ 93.1, 1.435, 647.011 },
+	{ 72.6, 4.154, 117.320 },
+	{ 84.3, 2.635, 216.480 },
+	{ 62.2, 2.312, 440.825 },
+	{ 45.1, 4.373, 191.958 },
+	{ 49.5, 2.389, 209.367 },
+	{ 54.8, 0.305, 853.196 },
+	{ 40.5, 1.838, 302.165 },
+	{ 38.1, 5.945, 88.866 },
+	{ 32.2, 4.011, 21.341 },
+	{ 40.7, 0.688, 522.577 },
+	{ 28.2, 5.772, 210.118 },
+	{ 25.0, 3.062, 234.640 },
+	{ 20.8, 4.926, 625.670 },
+	{ 25.1, 0.731, 515.464 },
+	{ 17.5, 5.731, 728.763 },
+	{ 18.0, 1.456, 309.278 },
+	{ 16.9, 3.528, 3.181 },
+	{ 13.4, 3.365, 330.619 },
+	{ 11.1, 3.372, 224.345 },
+	{ 11.1, 3.417, 956.289 },
+	{ 10.0, 1.588, 202.253 },
+	{ 11.6, 5.991, 735.877 },
+	{ 10.5, 6.069, 405.258 },
+	{ 9.1, 2.94, 124.43 },
+	{ 8.7, 4.65, 632.78 },
+	{ 10.0, 0.582, 860.310 },
+	{ 7.5, 4.51, 942.06 },
+	{ 10.1, 0.283, 838.969 },
+	{ 9.2, 2.57, 223.59 },
+	{ 8.7, 1.76, 429.78 },
+	{ 7.6, 1.46, 654.12 },
+	{ 7.1, 5.47, 1045.15 },
+	{ 7.0, 1.52, 422.67 },
+	{ 8.1, 4.48, 742.99 },
+	{ 6.8, 4.83, 316.39 },
+	{ 7.7, 0.44, 831.86 },
+	{ 7.9, 4.20, 195.14 },
+	{ 6.1, 2.34, 269.92 },
+	{ 5.6, 1.15, 284.15 },
+	{ 5.6, 4.18, 529.69 },
+	{ 5.0, 2.12, 295.05 },
+	{ 6.6, 3.42, 10.29 },
+	{ 5.5, 2.47, 536.80 },
+	{ 6.2, 6.01, 1066.50 },
+	{ 5.6, 0.83, 217.23 },
+	{ 4.3, 3.23, 1272.68 },
+	{ 4.5, 0.92, 203.00 },
+	{ 3.3, 4.33, 1258.45 },
+	{ 3.7, 0.06, 81.75 },
+	{ 4.0, 0.11, 1155.36 },
+	{ 3.8, 6.01, 1052.27 },
+	{ 2.9, 5.64, 3.93 },
+	{ 3.0, 2.19, 447.94 },
+	{ 3.0, 1.89, 149.56 },
+	{ 3.1, 0.19, 1148.25 },
+	{ 2.8, 0.92, 508.35 },
+	{ 2.8, 4.97, 1677.94 },
+	{ 2.6, 3.00, 1589.07 },
+	{ 2.9, 5.41, 1361.55 },
+	{ 2.3, 1.30, 184.84 },
+	{ 2.5, 3.71, 408.44 },
+	{ 2.5, 3.22, 319.57 },
+	{ 2.6, 2.31, 543.92 },
+	{ 2.3, 5.88, 721.65 },
+	{ 2.0, 0.52, 416.30 },
+	{ 2.5, 4.24, 1059.38 },
+	{ 1.9, 2.41, 337.73 },
+	{ 1.9, 0.54, 635.97 },
+	{ 1.9, 5.62, 11.05 },
+	{ 2.4, 5.73, 313.21 },
+	{ 1.9, 2.41, 131.55 },
+	{ 1.7, 4.58, 1994.33 },
+	{ 1.9, 5.17, 2854.64 },
+	{ 1.9, 6.23, 1471.75 },
+	{ 2.0, 6.18, 1464.64 },
+	{ 1.8, 5.59, 1038.04 },
+	{ 1.5, 0.61, 210.85 },
+	{ 1.6, 1.75, 195.89 },
+	{ 1.6, 0.56, 2324.95 },
+	{ 1.5, 0.27, 497.45 },
+	{ 1.7, 2.58, 2090.31 },
+	{ 1.8, 1.82, 436.89 },
+	{ 1.6, 6.15, 490.33 },
+	{ 1.8, 6.12, 1073.61 },
+	{ 1.5, 0.85, 415.55 },
+	{ 1.6, 2.95, 437.64 },
+	{ 1.4, 4.12, 1574.85 },
+	{ 1.6, 5.97, 1781.03 },
+	{ 1.5, 3.85, 1251.34 },
+	{ 1.4, 5.33, 2538.25 },
+	{ 1.8, 1.51, 750.10 },
+	{ 1.5, 3.29, 1884.12 },
+	{ 1.5, 0.99, 643.08 },
+	{ 1.3, 3.79, 1567.73 },
+	{ 1.7, 0.03, 423.42 },
+	{ 1.5, 5.35, 1354.43 },
+	{ 1.4, 0.70, 867.42 },
+	{ 1.1, 1.80, 618.56 },
+	{ 1.1, 4.70, 113.39 },
+	{ 1.1, 3.96, 1891.24 },
+	{ 1.5, 1.50, 430.53 },
+	{ 1.1, 5.13, 25.27 },
+	{ 1.2, 2.97, 241.75 },
+	{ 1.3, 2.29, 2420.93 },
+	{ 1.1, 0.05, 63.74 },
+	{ 1.4, 5.58, 1382.89 },
+	{ 1.1, 3.11, 2200.52 },
+	{ 1.1, 0.79, 127.47 },
+	{ 1.0, 5.85, 215.75 },
+	{ 1.1, 3.73, 131.40 },
+	{ 1.2, 0.48, 824.74 },
+	{ 1.1, 3.78, 1375.77 },
+	{ 1.0, 5.91, 265.99 },
+	{ 1.2, 1.41, 2634.23 },
+	{ 1.1, 4.80, 1987.22 },
+	{ 0.9, 6.26, 2015.67 },
+	{ 1.0, 1.09, 362.86 },
+	{ 1.1, 5.42, 1279.79 },
+	{ 0.9, 1.92, 483.22 },
+	{ 0.9, 2.97, 934.95 },
+	{ 0.9, 2.66, 145.63 },
+	{ 0.9, 6.26, 2.45 },
+	{ 1.1, 4.48, 2214.74 },
+	{ 1.0, 0.74, 16.67 },
+	{ 1.0, 4.06, 231.46 },
+	{ 0.9, 0.09, 628.85 },
+	{ 0.9, 5.99, 2524.02 },
+	{ 0.9, 3.16, 2207.63 },
+	{ 0.8, 1.24, 74.78 },
+	{ 0.8, 2.90, 2008.56 },
+	{ 0.8, 2.28, 1478.87 },
+	{ 1.0, 5.33, 2428.04 },
+	{ 0.8, 2.38, 2228.97 },
+	{ 0.8, 4.70, 1670.83 },
+	{ 1.0, 4.23, 1802.37 },
+	{ 0.8, 5.87, 1368.66 },
+	{ 0.7, 5.92, 1685.05 },
+	{ 0.8, 1.16, 3053.71 },
+	{ 0.7, 3.13, 56.62 },
+	/* 157 terms retained, 0 terms dropped, error 1.7e-07 a.u.*T^3 */
+
+	/* saturn r, T^4 */
+	{ 1202.0, 1.41499, 220.41264 },
+	{ 707.8, 1.1615, 213.2991 },
+	{ 516.1, 6.2397, 206.1855 },
+	{ 426.7, 2.4692, 7.1135 },
+	{ 267.7, 0.1866, 426.5982 },
+	{ 170.2, 5.9593, 199.0720 },
+	{ 145.1, 1.4421, 227.5262 },
+	{ 150.3, 0.4797, 433.7117 },
+	{ 121.0, 2.4053, 14.2271 },
+	{ 47.3, 5.569, 639.897 },
+	{ 15.7, 2.901, 110.206 },
+	{ 16.7, 0.529, 440.825 },
+	{ 19.0, 5.856, 647.011 },
+	{ 14.1, 1.303, 412.371 },
+	{ 12.7, 2.093, 323.505 },
+	{ 14.7, 0.299, 419.485 },
+	{ 11.1, 2.463, 117.320 },
+	{ 11.3, 0.218, 95.979 },
+	{ 9.2, 2.28, 21.34 },
+	{ 9.2, 1.56, 88.87 },
+	{ 9.0, 0.68, 216.48 },
+	{ 7.7, 3.59, 302.16 },
+	{ 7.8, 4.49, 853.20 },
+	{ 8.4, 1.27, 234.64 },
+	{ 9.6, 3.14, 0 },
+	{ 4.8, 2.59, 515.46 },
+	{ 6.1, 5.17, 103.09 },
+	{ 4.4, 0.02, 191.96 },
+	{ 4.4, 1.60, 330.62 },
+	{ 3.7, 3.30, 210.12 },
+	{ 4.4, 5.97, 654.12 },
+	{ 4.4, 4.97, 860.31 },
+	{ 3.2, 2.73, 522.58 },
+	{ 4.0, 1.60, 405.26 },
+	{ 3.1, 0.75, 209.37 },
+	{ 2.5, 1.19, 124.43 },
+	{ 3.1, 1.32, 728.76 },
+	{ 2.2, 3.28, 203.00 },
+	{ 2.1, 6.15, 429.78 },
+	{ 2.1, 0.75, 295.05 },
+	{ 2.0, 3.89, 1066.50 },
+	{ 2.2, 0.49, 447.94 },
+	{ 2.2, 0.73, 625.67 },
+	{ 1.8, 0.09, 942.06 },
+	{ 1.7, 1.40, 224.34 },
+	{ 1.6, 3.02, 184.84 },
+	{ 1.8, 0.82, 223.59 },
+	{ 1.9, 2.00, 831.86 },
+	{ 1.6, 5.41, 824.74 },
+	{ 1.5, 5.96, 422.67 },
+	{ 1.1, 1.12, 838.97 },
+	{ 1.2, 1.90, 956.29 },
+	{ 1.5, 2.12, 529.69 },
+	{ 1.4, 0.72, 536.80 },
+	{ 1.1, 0.89, 721.65 },
+	{ 1.3, 1.65, 17.41 },
+	{ 1.2, 5.97, 195.14 },
+	{ 1.0, 5.36, 316.39 },
+	{ 1.0, 3.06, 1574.85 },
+	{ 1.1, 1.59, 735.88 },
+	{ 0.8, 4.93, 56.62 },
+	{ 0.8, 2.72, 508.35 },
+	{ 1.0, 1.01, 1045.15 },
+	{ 0.7, 1.11, 1169.59 },
+	/* 64 terms retained, 0 terms dropped, error 1.2e-07 a.u.*T^4 */
+
+	/* saturn r, T^5 */
+	{ 128.6, 5.9128, 220.4126 },
+	{ 32.3, 0.693, 7.114 },
+	{ 26.7, 5.914, 227.526 },
+	{ 19.9, 0.674, 14.227 },
+	{ 20.2, 4.951, 433.712 },
+	{ 13.5, 1.457, 199.072 },
+	{ 14.1, 2.671, 206.186 },
+	{ 13.4, 4.588, 426.598 },
+	{ 7.3, 4.63, 213.30 },
+	{ 4.9, 3.61, 639.90 },
+	{ 3.1, 4.66, 191.96 },
+	{ 2.9, 0.49, 323.51 },
+	{ 3.8, 4.90, 440.83 },
+	{ 3.3, 4.07, 647.01 },
+	{ 2.9, 3.18, 419.48 },
+	{ 2.3, 3.70, 88.87 },
+	{ 1.9, 5.33, 302.16 },
+	{ 2.1, 3.32, 95.98 },
+	{ 1.6, 2.67, 853.20 },
+	{ 2.0, 0.56, 117.32 },
+	{ 1.6, 0.86, 515.46 },
+	{ 1.7, 0, 0 },
+	{ 1.1, 5.98, 3.18 },
+	{ 1.3, 5.83, 234.64 },
+	{ 0.9, 5.23, 216.48 },
+	{ 1.1, 0.16, 412.37 },
+	{ 0.8, 0.37, 28.45 },
+	{ 0.8, 5.05, 124.43 },
+	/* 28 terms retained, 0 terms dropped, error 9e-08 a.u.*T^5 */
+	/* end saturn */
+};
+
+int vn_saturn[][3] = {
+	/* addresses for saturn l, b, r  */
+	/* T^0 */ { 0, 592, 811, },
+	/* T^1 */ { 165, 645, 1099, },
+	/* T^2 */ { 303, 698, 1345, },
+	/* T^3 */ { 418, 744, 1584, },
+	/* T^4 */ { 500, 777, 1741, },
+	/* T^5 */ { 566, 803, 1805, },
+	/* end */ { 592, 811, 1833, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_uranus[][3] = {
+	/* uranus l, T^0 */
+	{ 548129294.3, 0, 0 },
+	{ 9260408.3, 0.89106422, 74.78159857 },
+	{ 1504247.8, 3.62719262, 1.48447271 },
+	{ 365981.7, 1.8996219, 73.2971259 },
+	{ 272328.1, 3.3582371, 149.5631971 },
+	{ 70328.5, 5.392544, 63.735898 },
+	{ 68892.6, 6.092925, 76.266071 },
+	{ 61998.6, 2.269520, 2.968945 },
+	{ 61950.7, 2.850989, 11.045700 },
+	{ 26468.9, 3.141521, 71.812653 },
+	{ 25710.5, 6.113798, 454.909367 },
+	{ 21078.9, 4.360595, 148.078724 },
+	{ 17818.7, 1.744370, 36.648563 },
+	{ 14613.5, 4.737320, 3.932153 },
+	{ 11162.5, 5.826820, 224.344796 },
+	{ 10997.9, 0.488655, 138.517497 },
+	{ 9527.5, 2.95517, 35.16409 },
+	{ 7545.5, 5.23626, 109.94569 },
+	{ 4220.2, 3.23329, 70.84945 },
+	{ 4051.9, 2.27754, 151.04767 },
+	{ 3354.6, 1.06549, 4.45342 },
+	{ 2926.7, 4.62904, 9.56123 },
+	{ 3490.4, 5.48306, 146.59425 },
+	{ 3144.1, 4.75199, 77.75054 },
+	{ 2922.4, 5.35237, 85.82730 },
+	{ 2272.8, 4.36601, 70.32818 },
+	{ 2051.2, 1.51774, 0.11187 },
+	{ 2148.6, 0.60746, 38.13304 },
+	{ 1991.7, 4.92437, 277.03499 },
+	{ 1376.2, 2.04281, 65.22037 },
+	{ 1666.9, 3.62745, 380.12777 },
+	{ 1284.2, 3.11346, 202.25340 },
+	{ 1150.4, 0.93344, 3.18139 },
+	{ 1533.2, 2.58593, 52.69020 },
+	{ 1281.6, 0.54270, 222.86032 },
+	{ 1372.1, 4.19642, 111.43016 },
+	{ 1221.0, 0.19901, 108.46122 },
+	{ 946.2, 1.1925, 127.4718 },
+	{ 1151.0, 4.17898, 33.67962 },
+	{ 1244.3, 0.91613, 2.44768 },
+	{ 1072.0, 0.23565, 62.25143 },
+	{ 1090.5, 1.77502, 12.53017 },
+	{ 707.9, 5.1829, 213.2991 },
+	{ 653.4, 0.9659, 78.7138 },
+	{ 627.6, 0.1821, 984.6003 },
+	{ 524.5, 2.0128, 299.1264 },
+	{ 559.4, 3.3578, 0.5213 },
+	{ 606.8, 5.4321, 529.6910 },
+	{ 404.9, 5.9869, 8.0768 },
+	{ 467.2, 0.4148, 145.1098 },
+	{ 471.3, 1.4066, 184.7273 },
+	{ 483.2, 2.1055, 0.9632 },
+	{ 395.6, 5.8704, 351.8166 },
+	{ 433.5, 5.5214, 183.2428 },
+	{ 309.9, 5.8330, 145.6310 },
+	{ 378.6, 2.3498, 56.6224 },
+	{ 399.0, 0.3381, 415.5525 },
+	{ 300.4, 5.6435, 22.0914 },
+	{ 249.2, 4.7462, 225.8293 },
+	{ 239.3, 2.3505, 137.0330 },
+	{ 294.2, 5.8392, 39.6175 },
+	{ 216.5, 4.7785, 340.7709 },
+	{ 251.8, 1.6370, 221.3759 },
+	{ 219.6, 1.9221, 67.6681 },
+	{ 202.0, 1.2969, 0.0482 },
+	{ 224.1, 0.5157, 84.3428 },
+	{ 216.5, 6.1421, 5.9379 },
+	{ 222.6, 2.8431, 0.2606 },
+	{ 207.8, 5.5802, 68.8437 },
+	{ 187.5, 1.3192, 0.1601 },
+	{ 158.0, 0.7381, 54.1747 },
+	{ 199.1, 0.9563, 152.5321 },
+	{ 168.6, 5.8787, 18.1592 },
+	{ 170.3, 3.6772, 5.4166 },
+	{ 193.7, 1.8880, 456.3938 },
+	{ 193.0, 0.9162, 453.4249 },
+	{ 181.9, 3.5362, 79.2350 },
+	{ 173.1, 1.5386, 160.6089 },
+	{ 164.6, 1.4238, 106.9767 },
+	{ 172.0, 5.6795, 219.8914 },
+	{ 162.8, 3.0503, 112.9146 },
+	{ 146.7, 1.2630, 59.8037 },
+	{ 139.5, 5.3860, 32.1951 },
+	{ 138.6, 4.2599, 909.8187 },
+	{ 143.1, 1.3000, 35.4247 },
+	{ 123.8, 1.3736, 7.1135 },
+	{ 104.4, 5.0282, 0.7508 },
+	{ 103.3, 0.6810, 14.9779 },
+	{ 94.7, 0.907, 74.670 },
+	{ 83.0, 2.928, 265.989 },
+	{ 110.2, 2.0269, 554.0700 },
+	{ 94.2, 3.943, 74.893 },
+	{ 79.9, 1.014, 6.592 },
+	{ 109.4, 5.7058, 77.9630 },
+	{ 85.9, 1.706, 82.858 },
+	{ 103.6, 1.4577, 24.3790 },
+	{ 74.7, 4.632, 69.365 },
+	{ 79.9, 3.010, 297.642 },
+	{ 84.5, 0.369, 186.212 },
+	{ 88.8, 0.525, 181.758 },
+	{ 70.3, 1.190, 66.705 },
+	{ 70.0, 0.875, 305.346 },
+	{ 69.9, 3.761, 131.404 },
+	{ 84.6, 5.887, 256.540 },
+	{ 74.3, 6.243, 447.796 },
+	{ 62.3, 0.169, 479.288 },
+	{ 72.7, 2.849, 462.023 },
+	{ 69.1, 4.439, 39.357 },
+	{ 76.6, 4.587, 6.220 },
+	{ 73.4, 4.276, 87.312 },
+	{ 55.3, 1.496, 71.600 },
+	{ 57.3, 1.630, 143.625 },
+	{ 61.7, 3.186, 77.229 },
+	{ 57.6, 3.672, 51.206 },
+	{ 50.3, 1.123, 20.607 },
+	{ 53.7, 5.519, 128.956 },
+	{ 57.9, 2.669, 381.612 },
+	{ 58.1, 1.586, 60.767 },
+	{ 45.4, 0.481, 14.015 },
+	{ 37.6, 6.068, 211.815 },
+	{ 38.6, 3.436, 153.495 },
+	{ 46.1, 4.362, 75.745 },
+	{ 40.1, 4.573, 46.210 },
+	{ 34.2, 2.940, 140.002 },
+	{ 38.7, 5.589, 99.161 },
+	{ 34.8, 1.028, 203.738 },
+	{ 40.0, 0.699, 218.407 },
+	{ 32.5, 4.216, 200.769 },
+	{ 31.9, 5.510, 72.334 },
+	{ 41.7, 3.824, 81.001 },
+	{ 34.8, 0.394, 1.373 },
+	{ 39.8, 6.056, 293.189 },
+	{ 27.6, 2.183, 125.987 },
+	{ 36.3, 1.666, 258.024 },
+	{ 35.4, 1.967, 835.037 },
+	{ 35.4, 3.723, 692.587 },
+	{ 27.3, 2.102, 209.367 },
+	{ 26.5, 4.483, 373.908 },
+	{ 34.5, 1.079, 191.208 },
+	{ 29.9, 3.874, 259.509 },
+	{ 26.2, 3.632, 490.334 },
+	{ 25.8, 0.545, 41.644 },
+	{ 27.0, 6.277, 28.572 },
+	{ 26.4, 5.811, 75.303 },
+	{ 34.2, 6.056, 275.551 },
+	{ 29.9, 1.888, 269.921 },
+	{ 26.2, 6.201, 134.585 },
+	{ 25.2, 5.425, 116.426 },
+	{ 26.5, 4.772, 284.149 },
+	{ 27.0, 4.753, 41.102 },
+	{ 28.9, 0.171, 528.206 },
+	{ 25.8, 0.746, 278.519 },
+	/* 152 terms retained, 795 terms dropped, error 1.3" */
+
+	/* uranus l, T^1 */
+	{ 7502543121.6, 0, 0 },
+	{ 154458.2, 5.2420166, 74.7815986 },
+	{ 24456.4, 1.712557, 1.484473 },
+	{ 9257.8, 0.42845, 11.04570 },
+	{ 8266.0, 1.50220, 63.73590 },
+	{ 7841.7, 1.31984, 149.56320 },
+	{ 3899.1, 0.46484, 3.93215 },
+	{ 2283.8, 4.17368, 76.26607 },
+	{ 1926.6, 0.53013, 2.96895 },
+	{ 1232.7, 1.58634, 70.84945 },
+	{ 791.2, 5.4364, 3.1814 },
+	{ 767.0, 1.9956, 73.2971 },
+	{ 481.7, 2.9840, 85.8273 },
+	{ 449.8, 4.1383, 138.5175 },
+	{ 445.6, 3.7230, 224.3448 },
+	{ 426.6, 4.7313, 71.8127 },
+	{ 347.7, 2.4537, 9.5612 },
+	{ 353.8, 2.5832, 148.0787 },
+	{ 317.1, 5.5786, 52.6902 },
+	{ 179.9, 5.6837, 12.5302 },
+	{ 171.1, 3.0006, 78.7138 },
+	{ 205.6, 2.3626, 2.4477 },
+	{ 158.0, 2.9093, 0.9632 },
+	{ 189.1, 4.2024, 56.6224 },
+	{ 154.7, 5.5908, 4.4534 },
+	{ 183.8, 0.2837, 151.0477 },
+	{ 143.5, 2.5905, 62.2514 },
+	{ 152.0, 2.9422, 77.7505 },
+	{ 153.5, 4.6519, 35.1641 },
+	{ 121.5, 4.1484, 127.4718 },
+	{ 115.5, 3.7322, 65.2204 },
+	{ 102.0, 4.1875, 145.6310 },
+	{ 101.7, 6.0339, 0.1119 },
+	{ 88.2, 3.990, 18.159 },
+	{ 87.5, 6.155, 202.253 },
+	{ 80.5, 2.641, 22.091 },
+	{ 72.0, 6.045, 70.328 },
+	{ 68.6, 4.051, 77.963 },
+	{ 59.2, 3.704, 67.668 },
+	{ 47.3, 3.543, 351.817 },
+	{ 42.5, 5.724, 5.417 },
+	{ 44.3, 5.909, 7.114 },
+	{ 35.6, 3.292, 8.077 },
+	{ 35.5, 3.328, 71.600 },
+	{ 36.1, 5.900, 33.680 },
+	{ 30.6, 5.464, 160.609 },
+	{ 31.5, 5.620, 984.600 },
+	{ 38.5, 4.915, 222.860 },
+	{ 35.0, 5.080, 38.133 },
+	{ 30.8, 5.496, 59.804 },
+	{ 28.9, 4.519, 84.343 },
+	{ 26.6, 5.541, 131.404 },
+	{ 29.9, 1.660, 447.796 },
+	{ 29.2, 1.147, 462.023 },
+	{ 25.8, 4.994, 137.033 },
+	{ 25.4, 5.736, 380.128 },
+	{ 21.7, 2.806, 69.365 },
+	{ 26.6, 6.146, 299.126 },
+	{ 23.0, 2.249, 111.430 },
+	{ 19.2, 3.556, 54.175 },
+	{ 21.8, 0.933, 213.299 },
+	{ 19.3, 1.862, 108.461 },
+	{ 16.2, 3.102, 14.978 },
+	{ 13.1, 1.954, 87.312 },
+	{ 13.9, 1.541, 340.771 },
+	{ 13.5, 4.385, 5.938 },
+	{ 13.1, 5.883, 6.220 },
+	{ 11.8, 0.326, 35.425 },
+	{ 11.0, 1.692, 45.577 },
+	{ 12.4, 0.328, 51.206 },
+	{ 10.9, 5.971, 265.989 },
+	{ 11.4, 3.378, 72.334 },
+	{ 12.0, 3.604, 269.921 },
+	{ 11.7, 1.745, 79.235 },
+	{ 13.8, 2.690, 225.829 },
+	{ 12.0, 5.344, 152.532 },
+	{ 9.9, 5.50, 153.50 },
+	{ 10.4, 4.169, 24.379 },
+	{ 10.6, 3.069, 284.149 },
+	{ 9.6, 0.50, 209.37 },
+	{ 9.3, 3.54, 41.64 },
+	{ 9.5, 5.60, 82.86 },
+	{ 9.7, 1.01, 68.84 },
+	{ 9.2, 4.49, 20.61 },
+	{ 10.2, 3.518, 529.691 },
+	{ 8.6, 3.89, 60.77 },
+	{ 10.0, 4.648, 77.229 },
+	{ 8.7, 1.97, 195.14 },
+	{ 8.4, 4.41, 134.59 },
+	{ 9.3, 3.93, 39.62 },
+	{ 7.8, 5.36, 75.74 },
+	{ 7.7, 5.77, 73.82 },
+	{ 7.7, 4.44, 14.01 },
+	{ 8.4, 2.44, 146.59 },
+	{ 8.0, 5.73, 184.73 },
+	{ 7.5, 2.19, 145.11 },
+	{ 6.4, 0.85, 32.20 },
+	{ 6.3, 2.17, 74.89 },
+	{ 7.9, 0.17, 120.36 },
+	{ 7.0, 4.12, 191.21 },
+	{ 6.9, 2.13, 116.43 },
+	/* 101 terms retained, 325 terms dropped, error 0.29"*T */
+
+	/* uranus l, T^2 */
+	{ 53033.3, 0, 0 },
+	{ 2357.6, 2.26015, 74.78160 },
+	{ 769.1, 4.5256, 11.0457 },
+	{ 551.5, 3.2581, 63.7359 },
+	{ 541.5, 2.2757, 3.9322 },
+	{ 529.5, 4.9235, 1.4845 },
+	{ 257.5, 3.6906, 3.1814 },
+	{ 238.8, 5.8581, 149.5632 },
+	{ 181.9, 6.2176, 70.8494 },
+	{ 49.4, 6.031, 56.622 },
+	{ 53.5, 1.442, 76.266 },
+	{ 38.2, 1.785, 52.690 },
+	{ 44.8, 3.909, 2.448 },
+	{ 44.5, 0.812, 85.827 },
+	{ 37.4, 4.462, 2.969 },
+	{ 33.0, 0.864, 9.561 },
+	{ 24.3, 2.107, 18.159 },
+	{ 29.4, 5.098, 73.297 },
+	{ 22.1, 4.817, 78.714 },
+	{ 22.5, 5.993, 138.517 },
+	{ 17.2, 2.535, 145.631 },
+	{ 21.4, 2.399, 77.963 },
+	{ 20.6, 2.169, 224.345 },
+	{ 16.8, 3.466, 12.530 },
+	{ 12.0, 0.019, 22.091 },
+	{ 10.5, 4.456, 62.251 },
+	{ 11.0, 0.085, 127.472 },
+	{ 8.7, 4.26, 7.11 },
+	{ 10.5, 5.165, 71.600 },
+	{ 7.2, 1.25, 5.42 },
+	{ 8.4, 5.50, 67.67 },
+	{ 6.1, 5.45, 65.22 },
+	{ 6.0, 4.52, 151.05 },
+	{ 5.7, 1.83, 202.25 },
+	{ 6.1, 3.36, 447.80 },
+	{ 6.0, 5.73, 462.02 },
+	{ 5.1, 3.52, 59.80 },
+	{ 5.2, 1.06, 131.40 },
+	{ 6.0, 5.61, 148.08 },
+	{ 5.1, 3.36, 4.45 },
+	{ 4.8, 1.20, 71.81 },
+	{ 4.0, 0.68, 77.75 },
+	{ 3.7, 1.76, 351.82 },
+	{ 3.1, 3.84, 45.58 },
+	{ 3.0, 3.32, 160.61 },
+	{ 3.0, 6.15, 77.23 },
+	{ 3.6, 4.57, 454.91 },
+	{ 2.7, 5.36, 269.92 },
+	{ 2.5, 1.05, 69.36 },
+	{ 2.3, 2.69, 84.34 },
+	{ 2.2, 5.08, 14.98 },
+	{ 2.2, 1.39, 284.15 },
+	{ 2.1, 4.35, 984.60 },
+	{ 2.1, 2.32, 120.36 },
+	{ 1.9, 5.70, 54.17 },
+	{ 2.0, 3.87, 195.14 },
+	{ 1.6, 5.08, 209.37 },
+	{ 1.6, 0.49, 137.03 },
+	{ 1.6, 2.91, 51.21 },
+	{ 1.7, 6.26, 41.64 },
+	{ 2.1, 1.24, 35.16 },
+	{ 1.7, 6.28, 277.03 },
+	/* 62 terms retained, 89 terms dropped, error 0.055"*T^2 */
+
+	/* uranus l, T^3 */
+	{ 120.9, 0.0242, 74.7816 },
+	{ 68.1, 4.121, 3.932 },
+	{ 52.8, 2.390, 11.046 },
+	{ 43.8, 2.960, 1.484 },
+	{ 45.3, 2.044, 3.181 },
+	{ 45.8, 0, 0 },
+	{ 25.0, 4.887, 63.736 },
+	{ 21.1, 4.545, 70.849 },
+	{ 19.9, 2.313, 149.563 },
+	{ 8.9, 1.58, 56.62 },
+	{ 4.3, 0.23, 18.16 },
+	{ 3.6, 5.39, 76.27 },
+	{ 3.5, 4.98, 85.83 },
+	{ 3.5, 4.13, 52.69 },
+	{ 3.6, 0.95, 77.96 },
+	{ 2.3, 0.86, 145.63 },
+	{ 2.7, 0.37, 78.71 },
+	{ 1.9, 2.68, 7.11 },
+	{ 2.2, 5.66, 9.56 },
+	{ 1.4, 4.87, 224.34 },
+	{ 1.3, 1.25, 12.53 },
+	{ 1.6, 0.49, 71.60 },
+	{ 1.5, 5.20, 73.30 },
+	{ 1.2, 3.93, 22.09 },
+	{ 0.9, 2.19, 127.47 },
+	{ 0.8, 3.98, 462.02 },
+	{ 0.8, 5.06, 447.80 },
+	{ 0.7, 0.35, 5.63 },
+	{ 0.7, 1.06, 138.52 },
+	{ 0.7, 2.94, 131.40 },
+	{ 0.5, 1.59, 151.05 },
+	{ 0.4, 4.33, 120.36 },
+	/* 32 terms retained, 14 terms dropped, error 0.0098"*T^3 */
+
+	/* uranus l, T^4 */
+	{ 113.9, 3.1416, 0 },
+	{ 5.6, 4.58, 74.78 },
+	{ 3.2, 0.35, 11.05 },
+	{ 1.2, 3.42, 56.62 },
+	{ 0.6, 4.66, 18.16 },
+	{ 0.2, 3.80, 149.56 },
+	{ 0.1, 4.36, 63.74 },
+	/* 7 terms retained, 0 terms dropped, error 0.0016"*T^4 */
+
+	/* uranus l, T^5 */
+	{ 0.9, 3.14, 0 },
+	/* 1 terms retained, 0 terms dropped, error 0.0051"*T^5 */
+	/* end uranus l */
+
+	/* uranus b, T^0 */
+	{ 1346277.6, 2.61877811, 74.78159857 },
+	{ 62341.4, 5.081112, 149.563197 },
+	{ 61601.2, 3.141593, 0 },
+	{ 9963.7, 1.61604, 76.26607 },
+	{ 9926.2, 0.57630, 73.29713 },
+	{ 3259.5, 1.26119, 224.34480 },
+	{ 2972.3, 2.24367, 1.48447 },
+	{ 2010.3, 6.05550, 148.07872 },
+	{ 1522.2, 0.27960, 63.73590 },
+	{ 924.1, 4.0382, 151.0477 },
+	{ 760.6, 6.1400, 71.8127 },
+	{ 420.3, 5.2128, 11.0457 },
+	{ 430.7, 3.5545, 213.2991 },
+	{ 436.8, 3.3808, 529.6910 },
+	{ 522.3, 3.3209, 138.5175 },
+	{ 434.6, 0.3407, 77.7505 },
+	{ 462.6, 0.7426, 85.8273 },
+	{ 232.6, 2.2572, 222.8603 },
+	{ 215.8, 1.5912, 38.1330 },
+	{ 244.7, 0.7880, 2.9689 },
+	{ 179.9, 3.7249, 299.1264 },
+	{ 174.9, 1.2355, 146.5943 },
+	{ 173.7, 1.9365, 380.1278 },
+	{ 160.4, 5.3364, 111.4302 },
+	{ 144.1, 5.9624, 35.1641 },
+	{ 102.0, 2.6188, 78.7138 },
+	{ 116.4, 5.7388, 70.8494 },
+	{ 106.4, 0.9410, 70.3282 },
+	{ 86.2, 0.703, 39.618 },
+	{ 72.6, 0.206, 225.829 },
+	{ 71.2, 0.833, 109.946 },
+	{ 57.5, 2.670, 108.461 },
+	{ 54.3, 3.352, 184.727 },
+	{ 44.5, 2.744, 152.532 },
+	{ 38.6, 5.174, 202.253 },
+	{ 39.2, 2.171, 351.817 },
+	{ 41.3, 3.221, 160.609 },
+	{ 35.1, 4.001, 112.915 },
+	{ 33.1, 3.614, 221.376 },
+	{ 31.3, 2.720, 145.110 },
+	{ 37.3, 4.021, 52.690 },
+	{ 32.0, 1.292, 145.631 },
+	{ 27.6, 3.701, 36.649 },
+	/* 43 terms retained, 240 terms dropped, error 0.75" */
+
+	/* uranus b, T^1 */
+	{ 206366.2, 4.1239431, 74.7815986 },
+	{ 8563.2, 0.33820, 149.56320 },
+	{ 1725.7, 2.12193, 73.29713 },
+	{ 1368.9, 3.06862, 76.26607 },
+	{ 1374.4, 0, 0 },
+	{ 399.8, 2.8477, 224.3448 },
+	{ 450.6, 3.7766, 1.4845 },
+	{ 307.2, 1.2546, 148.0787 },
+	{ 154.3, 3.7858, 63.7359 },
+	{ 110.9, 5.3289, 138.5175 },
+	{ 112.4, 5.5730, 151.0477 },
+	{ 83.5, 3.592, 71.813 },
+	{ 55.6, 3.401, 85.827 },
+	{ 41.4, 4.455, 78.714 },
+	{ 53.7, 1.705, 77.751 },
+	{ 41.9, 1.215, 11.046 },
+	{ 32.0, 3.774, 222.860 },
+	{ 30.3, 2.564, 2.969 },
+	{ 27.0, 5.337, 213.299 },
+	{ 26.2, 0.416, 380.128 },
+	{ 20.1, 5.931, 529.691 },
+	{ 23.0, 2.489, 146.594 },
+	{ 19.6, 5.372, 299.126 },
+	{ 20.4, 3.702, 70.849 },
+	{ 19.1, 1.092, 111.430 },
+	{ 19.4, 3.830, 38.133 },
+	{ 10.8, 2.663, 3.932 },
+	{ 10.2, 2.313, 109.946 },
+	{ 9.4, 2.77, 39.62 },
+	{ 7.7, 1.81, 225.83 },
+	{ 8.1, 4.69, 184.73 },
+	{ 6.6, 5.50, 35.16 },
+	{ 7.4, 1.18, 65.22 },
+	{ 6.5, 4.98, 71.60 },
+	/* 34 terms retained, 120 terms dropped, error 0.16"*T */
+
+	/* uranus b, T^2 */
+	{ 9211.7, 5.80044, 74.78160 },
+	{ 556.9, 0, 0 },
+	{ 286.3, 2.1773, 149.5632 },
+	{ 95.0, 3.842, 73.297 },
+	{ 45.4, 4.878, 76.266 },
+	{ 20.1, 5.463, 1.484 },
+	{ 14.8, 0.880, 138.517 },
+	{ 14.0, 5.072, 63.736 },
+	{ 14.3, 2.845, 148.079 },
+	{ 10.1, 5.003, 224.345 },
+	{ 8.3, 6.27, 78.71 },
+	{ 4.7, 5.16, 71.81 },
+	{ 3.8, 6.28, 85.83 },
+	{ 3.5, 3.53, 11.05 },
+	{ 2.6, 1.44, 151.05 },
+	{ 2.4, 4.23, 3.93 },
+	{ 2.6, 0.41, 71.60 },
+	/* 17 terms retained, 43 terms dropped, error 0.045"*T^2 */
+
+	/* uranus b, T^3 */
+	{ 267.8, 1.2510, 74.7816 },
+	{ 11.0, 3.142, 0 },
+	{ 6.2, 4.01, 149.56 },
+	{ 3.4, 5.78, 73.30 },
+	{ 1.6, 1.06, 63.74 },
+	{ 1.3, 1.67, 78.71 },
+	{ 1.2, 2.59, 138.52 },
+	{ 1.1, 0.29, 76.27 },
+	{ 0.6, 1.87, 71.60 },
+	{ 0.6, 0.80, 1.48 },
+	{ 0.5, 4.43, 148.08 },
+	/* 11 terms retained, 5 terms dropped, error 0.0067"*T^3 */
+
+	/* uranus b, T^4 */
+	{ 5.7, 2.85, 74.78 },
+	{ 0.3, 3.14, 0 },
+	/* 2 terms retained, 0 terms dropped, error 0.0021"*T^4 */
+	/* end uranus b */
+
+	/* uranus r, T^0 */
+	{ 1921264847.9, 0, 0 },
+	{ 88784984.1, 5.603775270, 74.781598567 },
+	{ 3440835.5, 0.32836099, 73.29712586 },
+	{ 2055653.5, 1.78295170, 149.56319713 },
+	{ 649321.9, 4.5224730, 76.2660713 },
+	{ 602248.1, 3.8600382, 63.7358983 },
+	{ 496404.2, 1.4013993, 454.9093665 },
+	{ 338525.5, 1.5800268, 138.5174969 },
+	{ 243508.2, 1.5708660, 71.8126532 },
+	{ 190521.9, 1.9980936, 1.4844727 },
+	{ 161858.3, 2.7913786, 148.0787244 },
+	{ 143705.9, 1.3836857, 11.0457003 },
+	{ 93192.4, 0.174372, 36.648563 },
+	{ 71424.3, 4.245093, 224.344796 },
+	{ 89805.8, 3.661054, 109.945689 },
+	{ 39009.6, 1.669711, 70.849445 },
+	{ 46677.3, 1.399766, 35.164090 },
+	{ 39025.7, 3.362347, 277.034994 },
+	{ 36755.2, 3.886489, 146.594252 },
+	{ 30348.9, 0.701004, 151.047670 },
+	{ 29156.3, 3.180562, 77.750544 },
+	{ 20471.6, 1.555890, 202.253395 },
+	{ 25620.4, 5.256563, 380.127768 },
+	{ 25785.8, 3.785377, 85.827299 },
+	{ 22637.2, 0.725191, 529.690965 },
+	{ 20473.2, 2.796398, 70.328180 },
+	{ 17900.6, 0.554555, 2.968945 },
+	{ 12328.2, 5.960392, 127.471797 },
+	{ 14701.6, 4.904344, 108.461216 },
+	{ 11494.7, 0.437740, 65.220371 },
+	{ 15502.8, 5.354050, 38.133036 },
+	{ 10792.7, 1.421049, 213.299095 },
+	{ 11696.1, 3.298256, 3.932153 },
+	{ 11959.4, 1.750441, 984.600332 },
+	{ 12896.5, 2.621540, 111.430161 },
+	{ 11853.0, 0.993428, 52.690198 },
+	{ 9111.4, 4.99639, 62.25143 },
+	{ 8420.6, 5.25351, 222.86032 },
+	{ 7449.1, 0.79492, 351.81659 },
+	{ 8402.1, 5.03878, 415.55249 },
+	{ 6046.4, 5.67961, 78.71375 },
+	{ 5524.1, 3.11499, 9.56123 },
+	{ 7329.5, 3.97278, 183.24281 },
+	{ 5444.9, 5.10576, 145.10978 },
+	{ 5238.1, 2.62960, 33.67962 },
+	{ 4079.2, 3.22065, 340.77089 },
+	{ 3801.6, 6.10986, 184.72729 },
+	{ 3919.5, 4.25015, 39.61751 },
+	{ 2940.5, 2.14637, 137.03302 },
+	{ 3781.2, 3.45840, 456.39384 },
+	{ 2942.2, 0.42394, 299.12639 },
+	{ 3686.8, 2.48718, 453.42489 },
+	{ 3101.7, 4.14031, 219.89138 },
+	{ 2962.6, 0.82978, 56.62235 },
+	{ 2937.8, 3.67657, 140.00197 },
+	{ 2865.1, 0.30997, 12.53017 },
+	{ 2538.0, 4.85458, 131.40395 },
+	{ 1962.5, 5.24342, 84.34283 },
+	{ 2363.6, 0.44253, 554.06999 },
+	{ 1979.4, 6.12836, 106.97674 },
+	{ 2182.6, 2.94040, 305.34617 },
+	{ 1963.0, 0.04115, 221.37585 },
+	{ 1829.6, 4.01106, 68.84371 },
+	{ 1642.9, 0.35564, 67.66805 },
+	{ 1584.8, 3.16267, 225.82927 },
+	{ 1848.7, 2.91112, 909.81873 },
+	{ 1632.4, 4.23062, 22.09140 },
+	{ 1401.4, 1.39084, 265.98929 },
+	{ 1403.7, 5.63564, 4.45342 },
+	{ 1655.9, 1.96431, 79.23502 },
+	{ 1249.0, 5.44027, 54.17467 },
+	{ 1563.4, 1.47918, 112.91463 },
+	{ 1248.1, 4.88984, 479.28839 },
+	{ 1197.4, 2.52186, 145.63104 },
+	{ 1507.0, 5.24186, 181.75834 },
+	{ 1481.7, 5.66203, 152.53214 },
+	{ 1438.8, 1.53046, 447.79582 },
+	{ 1408.5, 4.41922, 462.02291 },
+	{ 1477.1, 4.32215, 256.53994 },
+	{ 1228.3, 5.97703, 59.80375 },
+	{ 1250.0, 6.24485, 160.60890 },
+	{ 906.5, 5.6203, 74.6697 },
+	{ 1090.7, 4.15394, 77.96299 },
+	{ 844.9, 0.1294, 82.8584 },
+	{ 900.4, 2.3732, 74.8935 },
+	{ 1072.0, 1.74287, 528.20649 },
+	{ 689.7, 3.0810, 69.3650 },
+	{ 593.8, 4.5007, 8.0768 },
+	{ 718.6, 4.0005, 128.9563 },
+	{ 699.6, 0.0399, 143.6253 },
+	{ 575.7, 5.8955, 66.7048 },
+	{ 759.0, 2.1370, 692.5875 },
+	{ 710.4, 5.4161, 218.4069 },
+	{ 548.7, 5.6281, 3.1814 },
+	{ 651.6, 4.4234, 18.1592 },
+	{ 539.8, 6.2079, 71.6002 },
+	{ 544.5, 5.6938, 203.7379 },
+	{ 710.3, 4.2197, 381.6122 },
+	{ 593.8, 3.8381, 32.1951 },
+	{ 710.1, 4.4897, 293.1885 },
+	{ 705.5, 0.4552, 835.0371 },
+	{ 588.0, 5.0825, 186.2118 },
+	{ 598.2, 0.3582, 269.9214 },
+	{ 641.9, 2.7113, 87.3118 },
+	{ 495.6, 2.6509, 200.7689 },
+	{ 630.3, 4.4615, 275.5505 },
+	{ 575.2, 5.5786, 2.4477 },
+	{ 569.9, 1.6393, 77.2293 },
+	{ 556.7, 1.0723, 1059.3819 },
+	{ 449.4, 0.2798, 617.8059 },
+	{ 463.6, 1.4345, 297.6419 },
+	{ 436.5, 0.5280, 209.3669 },
+	{ 463.9, 2.3544, 211.8146 },
+	{ 435.9, 2.1008, 1514.2913 },
+	{ 515.5, 3.2327, 284.1485 },
+	{ 454.9, 4.0836, 99.1606 },
+	{ 477.4, 2.8940, 39.3569 },
+	{ 542.3, 5.3948, 278.5195 },
+	{ 410.1, 3.0497, 404.5068 },
+	{ 367.8, 0.7116, 125.9873 },
+	{ 503.1, 5.8393, 191.2077 },
+	{ 487.5, 0.0640, 60.7670 },
+	{ 455.0, 2.5932, 490.3341 },
+	{ 436.3, 2.0818, 51.2057 },
+	{ 435.8, 2.7945, 75.7448 },
+	{ 323.5, 4.8290, 195.1398 },
+	{ 359.4, 0.0087, 35.4247 },
+	{ 429.3, 3.0803, 41.1020 },
+	{ 320.0, 5.4863, 14.9779 },
+	{ 414.3, 0.0901, 258.0244 },
+	{ 379.7, 0.0583, 378.6433 },
+	{ 420.1, 2.2539, 81.0014 },
+	{ 357.7, 4.7141, 173.9422 },
+	{ 358.9, 0.3521, 426.5982 },
+	{ 405.4, 6.1226, 24.3790 },
+	{ 365.2, 5.5948, 255.0555 },
+	{ 308.1, 3.9236, 116.4261 },
+	{ 325.7, 4.7200, 134.5853 },
+	{ 292.8, 3.9952, 72.3339 },
+	{ 386.5, 0.6862, 230.5646 },
+	{ 305.7, 3.7611, 344.7030 },
+	{ 287.0, 1.8499, 153.4954 },
+	{ 353.6, 4.6572, 329.8371 },
+	{ 302.1, 0.1319, 565.1157 },
+	{ 241.1, 1.6045, 81.3739 },
+	{ 249.8, 4.2421, 75.3029 },
+	{ 245.1, 5.9491, 20.6069 },
+	{ 248.3, 1.0628, 105.4923 },
+	{ 305.4, 2.5553, 6208.2943 },
+	{ 296.3, 4.2110, 1364.7281 },
+	{ 219.9, 2.9612, 120.3582 },
+	{ 233.6, 2.9707, 46.2098 },
+	{ 262.4, 3.8365, 831.1050 },
+	{ 233.5, 4.4812, 628.8516 },
+	{ 187.4, 3.0353, 135.5486 },
+	{ 216.8, 3.4291, 241.6103 },
+	{ 255.8, 1.1671, 177.8744 },
+	{ 220.5, 0.1963, 180.2739 },
+	{ 224.5, 0.4068, 114.3991 },
+	{ 205.4, 2.3038, 259.5089 },
+	{ 211.1, 4.9308, 103.0928 },
+	{ 175.8, 5.5082, 7.1135 },
+	{ 188.5, 2.2359, 5.4166 },
+	{ 171.7, 5.2173, 41.6445 },
+	{ 176.1, 1.9596, 756.3234 },
+	{ 170.4, 4.9498, 206.1855 },
+	{ 169.5, 4.0432, 55.6591 },
+	{ 219.0, 0.2479, 294.6730 },
+	{ 187.8, 2.0454, 408.4389 },
+	{ 182.3, 0.7073, 391.1735 },
+	{ 192.1, 5.7672, 291.7040 },
+	{ 153.7, 4.7066, 543.0243 },
+	{ 170.0, 4.5100, 288.0807 },
+	{ 164.1, 5.2253, 67.3592 },
+	{ 194.3, 6.1169, 414.0680 },
+	{ 168.0, 5.2581, 518.6453 },
+	{ 156.6, 0.6630, 220.4126 },
+	{ 182.3, 0.7838, 417.0370 },
+	{ 167.5, 4.9224, 422.6660 },
+	{ 170.8, 2.3093, 98.9000 },
+	{ 161.7, 3.2726, 443.8637 },
+	{ 132.8, 2.8888, 373.9080 },
+	{ 161.1, 3.8234, 451.9404 },
+	{ 179.3, 4.8241, 366.4856 },
+	{ 178.2, 3.9803, 10138.5039 },
+	{ 141.9, 1.2697, 159.1244 },
+	{ 153.8, 4.2785, 45.5767 },
+	{ 161.5, 4.9955, 73.8184 },
+	{ 146.3, 2.6566, 465.9551 },
+	{ 124.9, 4.3047, 339.2864 },
+	{ 154.6, 4.3205, 760.2555 },
+	{ 142.9, 2.0777, 457.8783 },
+	{ 152.4, 4.6474, 155.7830 },
+	{ 116.4, 4.4351, 5.9379 },
+	{ 113.4, 4.6535, 80.1982 },
+	{ 107.6, 3.7729, 142.4497 },
+	{ 133.7, 5.3089, 14.0146 },
+	{ 116.1, 2.5118, 296.1574 },
+	{ 129.1, 0.3628, 96.8730 },
+	{ 122.8, 2.3834, 141.4864 },
+	{ 101.4, 1.0574, 92.3077 },
+	{ 114.7, 6.2486, 767.3691 },
+	{ 113.3, 0.8305, 100.3845 },
+	{ 107.2, 2.3937, 347.8844 },
+	{ 95.4, 0.801, 342.255 },
+	{ 110.8, 0.3865, 216.9224 },
+	{ 127.0, 0.4236, 331.3215 },
+	{ 112.6, 0.0811, 558.0021 },
+	{ 103.2, 0.6979, 358.9301 },
+	{ 111.5, 0.7502, 80.7195 },
+	{ 90.9, 5.165, 144.147 },
+	{ 90.7, 0.220, 333.657 },
+	{ 98.6, 4.332, 74.521 },
+	{ 89.3, 2.189, 74.830 },
+	{ 117.2, 3.9497, 74.2603 },
+	{ 89.1, 5.878, 74.733 },
+	{ 97.3, 0.694, 977.487 },
+	{ 116.6, 1.8368, 1289.9465 },
+	{ 85.4, 5.803, 6.592 },
+	{ 86.8, 5.620, 300.611 },
+	{ 105.2, 5.9451, 328.3526 },
+	{ 112.1, 1.2117, 329.7252 },
+	{ 83.0, 2.208, 74.942 },
+	{ 94.3, 4.539, 28.572 },
+	{ 106.8, 1.8207, 306.8306 },
+	{ 103.6, 2.9937, 6.2198 },
+	{ 106.4, 0.8158, 1087.6931 },
+	{ 77.7, 2.734, 110.206 },
+	{ 98.4, 3.735, 75.042 },
+	{ 86.2, 2.833, 983.116 },
+	{ 89.0, 4.738, 604.473 },
+	{ 83.0, 1.883, 387.241 },
+	{ 90.2, 3.804, 986.085 },
+	{ 84.6, 1.258, 142.141 },
+	{ 74.7, 1.351, 350.332 },
+	{ 95.8, 5.548, 969.622 },
+	{ 90.3, 0.368, 0.963 },
+	{ 82.7, 5.856, 74.622 },
+	{ 75.8, 2.780, 88.115 },
+	{ 83.8, 1.844, 227.314 },
+	{ 70.7, 4.656, 44.725 },
+	{ 71.3, 3.650, 894.841 },
+	{ 94.1, 4.988, 403.134 },
+	{ 89.0, 4.439, 154.017 },
+	{ 79.4, 5.667, 267.474 },
+	{ 75.6, 5.410, 50.403 },
+	{ 68.6, 4.767, 991.714 },
+	{ 65.3, 0.693, 152.745 },
+	{ 63.0, 2.899, 79.889 },
+	{ 63.9, 0.098, 681.542 },
+	{ 80.1, 2.975, 526.722 },
+	{ 69.7, 3.953, 187.696 },
+	{ 59.5, 3.596, 58.107 },
+	{ 59.3, 0.509, 28.311 },
+	{ 68.6, 2.419, 235.390 },
+	{ 66.0, 5.046, 30.711 },
+	{ 70.2, 3.736, 546.956 },
+	{ 66.8, 0.855, 522.577 },
+	{ 63.0, 0.293, 119.507 },
+	{ 62.0, 2.316, 74.031 },
+	{ 71.4, 3.170, 23.576 },
+	{ 74.8, 5.368, 373.014 },
+	{ 64.2, 2.368, 157.640 },
+	{ 70.7, 0.558, 92.941 },
+	{ 55.8, 5.270, 874.394 },
+	{ 75.6, 4.663, 101.869 },
+	{ 73.7, 6.206, 312.460 },
+	{ 72.9, 0.584, 367.970 },
+	{ 53.2, 2.247, 17.526 },
+	{ 63.1, 4.596, 67.880 },
+	{ 60.5, 0.576, 253.571 },
+	{ 52.9, 2.459, 264.505 },
+	{ 70.2, 1.519, 552.586 },
+	{ 68.6, 2.445, 555.554 },
+	{ 62.8, 0.338, 561.184 },
+	{ 49.0, 1.092, 19.122 },
+	{ 64.6, 5.275, 68.189 },
+	{ 63.0, 5.359, 92.047 },
+	{ 47.7, 3.909, 192.692 },
+	{ 65.3, 4.236, 771.301 },
+	{ 65.2, 3.739, 536.805 },
+	{ 59.5, 6.106, 365.001 },
+	{ 52.2, 1.717, 905.887 },
+	{ 46.0, 3.871, 210.330 },
+	{ 46.4, 5.974, 477.804 },
+	{ 62.1, 2.675, 130.441 },
+	{ 46.0, 3.894, 48.758 },
+	{ 42.7, 3.815, 61.288 },
+	{ 53.9, 2.865, 353.301 },
+	{ 46.9, 1.000, 166.829 },
+	{ 42.2, 2.617, 90.823 },
+	{ 43.3, 4.158, 173.682 },
+	{ 41.3, 1.799, 149.451 },
+	{ 45.0, 1.766, 0.521 },
+	{ 51.9, 2.978, 383.097 },
+	{ 42.9, 1.574, 120.991 },
+	{ 49.6, 4.034, 303.862 },
+	{ 45.3, 3.584, 97.416 },
+	{ 38.7, 2.394, 31.493 },
+	{ 38.1, 5.795, 75.532 },
+	{ 50.1, 4.764, 911.303 },
+	{ 50.9, 5.155, 439.783 },
+	{ 43.1, 0.850, 58.319 },
+	{ 42.7, 5.173, 162.093 },
+	{ 50.3, 5.816, 66.917 },
+	{ 35.6, 1.874, 472.175 },
+	{ 50.0, 1.889, 42.586 },
+	{ 40.0, 1.743, 89.759 },
+	{ 45.3, 1.925, 55.138 },
+	{ 44.9, 1.484, 450.977 },
+	{ 34.3, 5.203, 316.392 },
+	{ 46.4, 0.339, 273.103 },
+	{ 37.2, 2.038, 117.911 },
+	{ 46.1, 5.623, 1819.637 },
+	{ 39.4, 4.194, 486.402 },
+	{ 41.0, 4.830, 149.675 },
+	{ 45.0, 0.727, 3265.831 },
+	{ 43.6, 0.753, 404.619 },
+	{ 31.8, 3.848, 20.447 },
+	{ 44.2, 4.368, 418.261 },
+	{ 37.9, 3.029, 167.089 },
+	{ 43.7, 1.573, 491.558 },
+	{ 34.0, 1.263, 260.993 },
+	{ 31.3, 4.161, 13.333 },
+	{ 40.0, 2.866, 468.243 },
+	{ 36.5, 2.588, 68.562 },
+	{ 32.4, 3.116, 103.353 },
+	{ 33.9, 0.156, 24.118 },
+	{ 35.9, 1.368, 59.282 },
+	{ 33.6, 0.755, 290.220 },
+	{ 29.8, 5.332, 1033.358 },
+	{ 32.0, 4.675, 205.222 },
+	{ 31.0, 4.628, 258.876 },
+	{ 35.3, 1.007, 1108.140 },
+	{ 33.4, 3.407, 43.129 },
+	{ 32.6, 5.255, 114.138 },
+	{ 29.8, 5.642, 254.944 },
+	{ 31.6, 3.782, 152.011 },
+	{ 31.0, 2.267, 104.008 },
+	{ 34.6, 5.173, 25.603 },
+	{ 28.4, 1.769, 820.059 },
+	{ 28.0, 3.925, 199.284 },
+	{ 29.0, 2.582, 76.479 },
+	{ 33.8, 5.794, 274.066 },
+	{ 29.4, 5.936, 280.967 },
+	{ 31.1, 1.394, 178.789 },
+	{ 30.1, 0.444, 27.087 },
+	{ 33.8, 6.262, 401.650 },
+	{ 27.5, 2.152, 480.773 },
+	{ 26.9, 2.513, 123.540 },
+	{ 26.1, 0.220, 286.596 },
+	{ 26.5, 3.882, 372.424 },
+	{ 34.0, 1.446, 88.796 },
+	{ 30.1, 0.827, 100.645 },
+	{ 27.7, 4.648, 198.321 },
+	{ 33.7, 1.143, 82.486 },
+	{ 26.5, 1.979, 95.389 },
+	{ 26.6, 0.399, 106.014 },
+	{ 27.0, 2.102, 1057.897 },
+	{ 31.0, 5.340, 476.431 },
+	{ 27.0, 0.713, 248.724 },
+	{ 29.1, 3.992, 908.334 },
+	{ 28.0, 3.465, 1439.510 },
+	{ 27.8, 4.124, 694.072 },
+	{ 25.5, 5.496, 115.884 },
+	{ 27.2, 5.761, 1215.165 },
+	{ 26.3, 2.775, 490.073 },
+	{ 26.4, 3.371, 49.721 },
+	{ 26.9, 3.260, 691.103 },
+	{ 25.0, 3.650, 73.409 },
+	/* 370 terms retained, 754 terms dropped, error 9.6e-06 a.u. */
+
+	/* uranus r, T^1 */
+	{ 1479896.4, 3.67205705, 74.78159857 },
+	{ 71212.1, 6.226010, 63.735898 },
+	{ 68627.0, 6.134113, 149.563197 },
+	{ 20857.3, 5.246255, 11.045700 },
+	{ 21468.2, 2.601767, 76.266071 },
+	{ 24059.6, 3.141593, 0 },
+	{ 11405.3, 0.018485, 70.849445 },
+	{ 7496.8, 0.42360, 73.29713 },
+	{ 4243.8, 1.41692, 85.82730 },
+	{ 3505.9, 2.58354, 138.51750 },
+	{ 3228.8, 5.25500, 3.93215 },
+	{ 3926.7, 3.15514, 71.81265 },
+	{ 3060.0, 0.15322, 1.48447 },
+	{ 3578.4, 2.31161, 224.34480 },
+	{ 2564.3, 0.98077, 148.07872 },
+	{ 2429.4, 3.99440, 52.69020 },
+	{ 1644.7, 2.65349, 127.47180 },
+	{ 1583.8, 1.43046, 78.71375 },
+	{ 1413.1, 4.57462, 202.25340 },
+	{ 1489.5, 2.67559, 56.62235 },
+	{ 1403.2, 1.36985, 77.75054 },
+	{ 1228.2, 1.04704, 62.25143 },
+	{ 1508.0, 5.05996, 151.04767 },
+	{ 992.1, 2.1717, 65.2204 },
+	{ 1032.7, 0.26459, 131.40395 },
+	{ 861.9, 5.0553, 351.8166 },
+	{ 744.4, 3.0764, 35.1641 },
+	{ 604.4, 0.9072, 984.6003 },
+	{ 646.9, 4.4729, 70.3282 },
+	{ 574.7, 3.2307, 447.7958 },
+	{ 687.5, 2.4991, 77.9630 },
+	{ 623.6, 0.8625, 9.5612 },
+	{ 527.8, 5.1514, 2.9689 },
+	{ 561.8, 2.7178, 462.0229 },
+	{ 530.4, 5.9166, 213.2991 },
+	{ 460.1, 4.2230, 12.5302 },
+	{ 494.3, 0.4629, 145.6310 },
+	{ 487.3, 0.7061, 380.1278 },
+	{ 380.9, 3.8509, 3.1814 },
+	{ 444.4, 2.1556, 67.6681 },
+	{ 338.8, 2.5382, 18.1592 },
+	{ 372.9, 5.0514, 529.6910 },
+	{ 348.3, 1.7487, 71.6002 },
+	{ 405.9, 1.2296, 22.0914 },
+	{ 268.9, 6.2407, 340.7709 },
+	{ 255.6, 2.9570, 84.3428 },
+	{ 259.5, 3.9205, 59.8037 },
+	{ 224.7, 3.9096, 160.6089 },
+	{ 221.7, 3.6473, 137.0330 },
+	{ 254.6, 3.5041, 38.1330 },
+	{ 238.3, 2.0488, 269.9214 },
+	{ 272.4, 3.3836, 222.8603 },
+	{ 200.6, 1.2486, 69.3650 },
+	{ 234.2, 0.2783, 108.4612 },
+	{ 188.5, 4.4131, 265.9893 },
+	{ 211.7, 0.6803, 111.4302 },
+	{ 205.9, 1.5338, 284.1485 },
+	{ 196.2, 4.7715, 299.1264 },
+	{ 153.1, 5.2176, 209.3669 },
+	{ 162.6, 4.3405, 33.6796 },
+	{ 150.6, 1.9897, 54.1747 },
+	{ 137.0, 0.4032, 195.1398 },
+	{ 117.2, 0.3965, 87.3118 },
+	{ 127.9, 2.4033, 39.6175 },
+	{ 104.2, 2.9215, 134.5853 },
+	{ 103.9, 1.8162, 72.3339 },
+	{ 105.7, 0.1707, 79.2350 },
+	{ 106.4, 0.6980, 2.4477 },
+	{ 95.3, 4.029, 82.858 },
+	{ 104.8, 4.4362, 305.3462 },
+	{ 93.8, 5.018, 51.206 },
+	{ 103.7, 2.5755, 191.2077 },
+	{ 106.7, 1.2300, 225.8293 },
+	{ 93.5, 3.093, 77.229 },
+	{ 97.4, 3.814, 152.532 },
+	{ 84.6, 5.725, 68.844 },
+	{ 77.4, 0.083, 45.577 },
+	{ 76.2, 4.204, 73.818 },
+	{ 86.2, 0.531, 145.110 },
+	{ 75.8, 3.786, 75.745 },
+	{ 77.6, 1.636, 479.288 },
+	{ 84.6, 0.617, 116.426 },
+	{ 100.2, 4.9408, 120.3582 },
+	{ 72.1, 4.305, 565.116 },
+	{ 70.7, 2.385, 60.767 },
+	{ 71.6, 3.939, 153.495 },
+	{ 84.6, 5.560, 344.703 },
+	{ 63.6, 1.937, 41.644 },
+	{ 71.6, 3.712, 408.439 },
+	{ 61.6, 3.900, 4.453 },
+	{ 65.0, 1.558, 106.977 },
+	{ 59.9, 0.601, 74.893 },
+	{ 62.0, 4.394, 453.425 },
+	{ 63.4, 4.192, 184.727 },
+	{ 62.3, 3.238, 422.666 },
+	{ 54.4, 3.725, 7.114 },
+	{ 52.5, 6.086, 404.507 },
+	{ 59.1, 1.556, 456.394 },
+	{ 52.6, 3.505, 125.987 },
+	{ 52.8, 5.201, 358.930 },
+	{ 58.1, 5.335, 220.413 },
+	{ 52.9, 4.448, 426.598 },
+	{ 50.9, 0.526, 490.334 },
+	{ 55.0, 1.601, 14.978 },
+	{ 49.5, 4.255, 5.417 },
+	{ 51.3, 0.368, 206.186 },
+	{ 51.8, 1.758, 8.077 },
+	{ 57.0, 0.841, 146.594 },
+	{ 49.1, 0.941, 99.161 },
+	{ 46.4, 5.351, 152.745 },
+	{ 48.0, 1.972, 288.081 },
+	{ 43.8, 3.037, 20.607 },
+	{ 49.5, 5.846, 112.915 },
+	{ 42.0, 0.046, 128.956 },
+	{ 48.6, 3.628, 81.001 },
+	{ 41.5, 2.337, 277.035 },
+	{ 40.0, 5.095, 35.425 },
+	{ 41.9, 2.511, 24.379 },
+	{ 38.3, 3.619, 173.942 },
+	{ 38.4, 2.060, 333.657 },
+	{ 42.6, 1.261, 1514.291 },
+	{ 38.9, 0.742, 347.884 },
+	{ 38.5, 4.951, 92.941 },
+	{ 33.2, 1.384, 74.670 },
+	{ 33.8, 3.684, 66.917 },
+	{ 39.0, 5.492, 200.769 },
+	{ 31.9, 0.540, 203.738 },
+	{ 33.3, 6.260, 1059.382 },
+	{ 30.8, 2.538, 977.487 },
+	{ 29.2, 5.431, 58.107 },
+	{ 30.1, 0.195, 387.241 },
+	{ 29.0, 3.105, 991.714 },
+	{ 35.6, 3.729, 96.873 },
+	{ 27.6, 0.371, 80.198 },
+	{ 32.5, 4.384, 221.376 },
+	{ 27.0, 1.356, 0.963 },
+	{ 31.3, 0.796, 373.014 },
+	{ 31.1, 2.054, 230.565 },
+	{ 25.9, 3.468, 144.147 },
+	{ 30.2, 0.714, 109.946 },
+	{ 24.7, 3.042, 14.015 },
+	{ 27.9, 4.766, 415.552 },
+	{ 25.1, 5.124, 81.374 },
+	{ 25.6, 2.569, 522.577 },
+	{ 24.4, 2.203, 628.852 },
+	{ 25.5, 1.795, 143.625 },
+	{ 24.2, 5.672, 443.864 },
+	{ 25.7, 5.432, 546.956 },
+	{ 24.2, 5.600, 32.195 },
+	{ 24.4, 3.303, 617.806 },
+	{ 23.5, 0.658, 46.210 },
+	{ 22.4, 4.821, 135.549 },
+	{ 27.2, 2.027, 536.805 },
+	{ 22.2, 4.617, 391.173 },
+	{ 22.0, 4.592, 241.610 },
+	{ 20.8, 0.244, 465.955 },
+	{ 27.3, 2.152, 140.002 },
+	{ 21.4, 5.272, 159.124 },
+	{ 23.6, 4.950, 561.184 },
+	{ 24.9, 0.546, 181.758 },
+	{ 23.0, 3.806, 55.138 },
+	{ 19.8, 1.303, 518.645 },
+	{ 19.3, 1.314, 543.024 },
+	{ 19.7, 4.909, 909.819 },
+	{ 20.8, 0.912, 76.479 },
+	{ 19.9, 0.665, 66.705 },
+	{ 19.0, 4.680, 98.900 },
+	{ 25.9, 4.529, 454.909 },
+	{ 21.9, 1.234, 41.102 },
+	{ 18.7, 6.096, 103.093 },
+	{ 18.2, 0.973, 55.659 },
+	{ 21.2, 4.194, 329.725 },
+	{ 19.4, 4.315, 6.220 },
+	{ 18.5, 5.786, 142.450 },
+	{ 22.6, 5.846, 297.642 },
+	{ 16.8, 6.091, 211.815 },
+	{ 16.4, 2.500, 61.288 },
+	{ 20.4, 3.161, 186.212 },
+	{ 16.0, 2.983, 81.895 },
+	{ 19.0, 6.012, 155.783 },
+	{ 17.7, 4.826, 273.103 },
+	{ 15.1, 3.656, 472.175 },
+	{ 18.4, 3.476, 36.649 },
+	{ 16.3, 0.131, 554.070 },
+	{ 18.6, 0.239, 23.576 },
+	{ 14.4, 2.694, 70.116 },
+	{ 15.2, 2.438, 486.402 },
+	{ 14.0, 5.124, 29.205 },
+	{ 15.8, 4.249, 146.382 },
+	{ 14.1, 1.557, 110.206 },
+	{ 17.5, 1.945, 835.037 },
+	{ 13.7, 1.638, 92.047 },
+	{ 13.8, 0.137, 235.390 },
+	{ 13.6, 2.854, 49.509 },
+	{ 12.6, 3.209, 100.384 },
+	{ 12.4, 2.886, 60.555 },
+	{ 15.0, 0.326, 259.509 },
+	{ 12.9, 2.776, 105.492 },
+	{ 12.3, 3.364, 440.682 },
+	{ 15.2, 0.256, 258.876 },
+	{ 12.1, 0.109, 157.640 },
+	{ 12.9, 0.307, 124.290 },
+	{ 10.9, 3.429, 33.137 },
+	{ 11.2, 4.988, 604.473 },
+	{ 10.8, 3.863, 767.369 },
+	{ 11.6, 2.605, 166.829 },
+	{ 10.2, 5.278, 264.505 },
+	{ 10.9, 0.641, 558.002 },
+	{ 12.3, 4.340, 16.675 },
+	{ 9.9, 0.67, 31.49 },
+	{ 12.6, 4.832, 114.399 },
+	{ 10.5, 0.204, 275.551 },
+	{ 11.3, 0.961, 373.908 },
+	{ 12.1, 1.917, 378.643 },
+	{ 12.2, 0.705, 218.407 },
+	{ 10.8, 5.745, 88.115 },
+	{ 9.5, 0.66, 353.30 },
+	{ 11.0, 2.630, 154.017 },
+	{ 9.1, 2.99, 681.54 },
+	{ 10.4, 2.331, 132.888 },
+	{ 9.2, 4.79, 216.48 },
+	{ 9.3, 0.76, 129.92 },
+	{ 8.9, 0.78, 67.36 },
+	{ 8.8, 6.13, 150.53 },
+	{ 9.6, 2.89, 67.88 },
+	{ 10.5, 0.369, 699.701 },
+	{ 9.3, 1.50, 19.64 },
+	{ 9.4, 5.26, 80.72 },
+	{ 10.1, 3.565, 278.519 },
+	{ 9.5, 3.06, 149.68 },
+	{ 9.2, 3.03, 162.09 },
+	{ 8.4, 2.18, 342.26 },
+	{ 9.2, 5.33, 152.01 },
+	{ 9.8, 2.44, 75.30 },
+	{ 10.0, 0.819, 339.286 },
+	{ 9.4, 1.94, 147.12 },
+	{ 7.9, 4.72, 106.01 },
+	{ 8.8, 0.02, 42.59 },
+	{ 7.8, 0.61, 135.34 },
+	{ 8.2, 2.60, 469.14 },
+	{ 10.1, 2.586, 50.403 },
+	{ 8.6, 5.69, 760.26 },
+	{ 7.5, 2.65, 5.94 },
+	{ 8.7, 0.54, 66.18 },
+	{ 8.0, 1.94, 180.27 },
+	{ 7.5, 5.95, 97.42 },
+	{ 7.6, 5.80, 450.98 },
+	{ 8.7, 3.70, 300.61 },
+	{ 7.7, 1.47, 32.24 },
+	{ 8.2, 2.31, 254.94 },
+	{ 8.5, 1.28, 39.36 },
+	{ 7.0, 0.68, 874.39 },
+	{ 8.9, 0.16, 43.13 },
+	{ 7.2, 4.98, 117.91 },
+	{ 7.4, 4.09, 92.31 },
+	{ 7.3, 5.04, 756.32 },
+	{ 8.5, 1.22, 79.45 },
+	{ 6.9, 6.04, 350.33 },
+	{ 8.8, 1.33, 48.76 },
+	{ 7.3, 3.33, 68.19 },
+	{ 6.8, 4.78, 142.66 },
+	{ 6.8, 3.90, 480.77 },
+	{ 7.1, 1.28, 68.56 },
+	{ 7.9, 4.30, 624.92 },
+	{ 6.7, 5.43, 610.69 },
+	{ 6.5, 5.44, 88.80 },
+	{ 7.6, 4.81, 312.46 },
+	{ 7.2, 3.18, 268.44 },
+	{ 8.1, 1.99, 692.59 },
+	{ 6.5, 1.05, 685.47 },
+	{ 6.6, 1.38, 291.26 },
+	{ 6.9, 2.59, 282.66 },
+	{ 7.1, 5.80, 468.24 },
+	{ 6.3, 2.58, 458.09 },
+	{ 7.6, 0.49, 296.16 },
+	{ 8.5, 0.01, 227.31 },
+	{ 6.5, 3.99, 42.54 },
+	{ 6.4, 1.04, 365.90 },
+	{ 8.2, 1.13, 69.15 },
+	{ 6.4, 0.16, 228.28 },
+	{ 8.0, 4.04, 183.24 },
+	{ 6.3, 3.52, 285.63 },
+	{ 6.9, 3.32, 306.83 },
+	{ 6.9, 1.34, 7.86 },
+	{ 6.5, 0.46, 106.27 },
+	{ 6.6, 5.25, 58.32 },
+	{ 6.4, 0.35, 411.62 },
+	{ 6.4, 5.19, 120.99 },
+	{ 7.0, 4.86, 419.48 },
+	{ 6.4, 2.78, 198.32 },
+	/* 290 terms retained, 224 terms dropped, error 2.2e-06 a.u.*T */
+
+	/* uranus r, T^2 */
+	{ 22439.9, 0.699531, 74.781599 },
+	{ 4727.0, 1.69902, 63.73590 },
+	{ 1681.9, 4.64834, 70.84945 },
+	{ 1433.8, 3.52120, 149.56320 },
+	{ 1649.6, 3.09660, 11.04570 },
+	{ 770.2, 0, 0 },
+	{ 461.0, 0.7668, 3.9322 },
+	{ 500.4, 6.1723, 76.2661 },
+	{ 390.4, 4.4961, 56.6224 },
+	{ 389.9, 5.5267, 85.8273 },
+	{ 292.1, 0.2039, 52.6902 },
+	{ 272.9, 3.8471, 138.5175 },
+	{ 286.6, 3.5336, 73.2971 },
+	{ 205.4, 3.2476, 78.7138 },
+	{ 219.7, 1.9642, 131.4039 },
+	{ 215.8, 0.8481, 77.9630 },
+	{ 128.8, 2.0815, 3.1814 },
+	{ 148.6, 4.8984, 127.4718 },
+	{ 117.5, 4.9341, 447.7958 },
+	{ 112.7, 1.0136, 462.0229 },
+	{ 98.9, 6.158, 224.345 },
+	{ 91.4, 0.680, 18.159 },
+	{ 89.2, 0.234, 202.253 },
+	{ 88.2, 2.931, 62.251 },
+	{ 114.1, 4.7874, 145.6310 },
+	{ 103.9, 3.5856, 71.6002 },
+	{ 61.8, 3.300, 351.817 },
+	{ 57.8, 4.907, 22.091 },
+	{ 64.4, 3.390, 1.484 },
+	{ 71.1, 6.105, 454.909 },
+	{ 51.0, 3.867, 65.220 },
+	{ 63.5, 3.962, 67.668 },
+	{ 59.0, 5.555, 9.561 },
+	{ 48.7, 3.747, 269.921 },
+	{ 43.6, 1.926, 59.804 },
+	{ 42.2, 2.617, 151.048 },
+	{ 42.4, 6.136, 284.149 },
+	{ 44.3, 5.900, 71.813 },
+	{ 37.3, 5.913, 984.600 },
+	{ 36.2, 5.403, 77.751 },
+	{ 42.0, 2.091, 12.530 },
+	{ 31.4, 4.592, 148.079 },
+	{ 31.3, 2.267, 195.140 },
+	{ 27.2, 3.532, 209.367 },
+	{ 28.2, 4.578, 77.229 },
+	{ 26.1, 0.660, 120.358 },
+	{ 24.4, 5.867, 69.365 },
+	{ 23.0, 1.038, 84.343 },
+	{ 22.7, 1.714, 160.609 },
+	{ 27.7, 4.915, 277.035 },
+	{ 20.8, 2.196, 45.577 },
+	{ 20.0, 2.321, 2.448 },
+	{ 16.6, 4.775, 213.299 },
+	{ 16.6, 1.856, 340.771 },
+	{ 17.2, 4.369, 54.175 },
+	{ 16.1, 3.646, 152.745 },
+	{ 14.8, 5.438, 408.439 },
+	{ 13.9, 3.385, 358.930 },
+	{ 13.3, 5.252, 137.033 },
+	{ 13.3, 1.263, 134.585 },
+	{ 12.9, 3.033, 92.941 },
+	{ 12.5, 1.332, 51.206 },
+	{ 13.4, 1.532, 422.666 },
+	{ 16.4, 0.402, 265.989 },
+	{ 12.0, 5.104, 191.208 },
+	{ 12.9, 4.432, 87.312 },
+	{ 11.4, 2.026, 7.114 },
+	{ 11.8, 4.656, 41.644 },
+	{ 12.0, 3.239, 116.426 },
+	{ 11.7, 3.733, 220.413 },
+	{ 11.6, 4.165, 60.555 },
+	{ 10.2, 0.329, 70.328 },
+	{ 11.3, 1.076, 72.334 },
+	{ 9.7, 3.06, 2.97 },
+	{ 9.3, 2.44, 565.12 },
+	{ 9.0, 5.19, 225.83 },
+	{ 10.3, 1.186, 344.703 },
+	{ 8.8, 6.01, 5.42 },
+	{ 8.5, 5.25, 347.88 },
+	{ 8.3, 3.72, 14.98 },
+	{ 8.3, 2.27, 299.13 },
+	{ 8.1, 5.72, 55.14 },
+	{ 7.8, 0.90, 222.86 },
+	{ 8.3, 4.49, 70.12 },
+	{ 8.8, 5.82, 153.50 },
+	{ 8.5, 3.91, 333.66 },
+	{ 9.9, 5.97, 35.16 },
+	{ 9.6, 0.39, 415.55 },
+	{ 7.1, 1.51, 991.71 },
+	{ 6.6, 1.18, 96.87 },
+	{ 8.1, 2.26, 206.19 },
+	{ 6.5, 2.99, 380.13 },
+	{ 9.0, 6.05, 146.38 },
+	{ 6.1, 0.06, 99.16 },
+	{ 5.8, 0.82, 142.45 },
+	{ 5.8, 4.63, 49.51 },
+	{ 5.6, 0.66, 58.11 },
+	{ 6.0, 2.49, 373.01 },
+	{ 5.7, 2.24, 80.20 },
+	{ 5.3, 5.07, 440.68 },
+	{ 5.2, 4.36, 977.49 },
+	{ 5.4, 0.85, 546.96 },
+	{ 5.8, 0.34, 536.80 },
+	{ 5.9, 5.48, 76.48 },
+	{ 5.3, 3.73, 23.58 },
+	{ 5.2, 4.14, 132.89 },
+	{ 5.3, 6.14, 39.62 },
+	{ 5.8, 3.40, 458.09 },
+	{ 5.0, 4.26, 522.58 },
+	{ 5.0, 4.79, 387.24 },
+	{ 5.2, 3.26, 561.18 },
+	{ 4.6, 1.69, 152.53 },
+	{ 5.3, 1.84, 124.29 },
+	{ 5.0, 0.37, 60.77 },
+	{ 4.5, 2.30, 312.46 },
+	{ 4.5, 0.46, 33.14 },
+	{ 5.7, 0.90, 81.90 },
+	{ 5.8, 0.92, 20.61 },
+	{ 5.7, 0.66, 38.13 },
+	{ 4.3, 3.55, 479.29 },
+	{ 4.2, 4.38, 79.24 },
+	{ 4.2, 1.65, 128.96 },
+	{ 5.1, 1.41, 144.15 },
+	{ 4.0, 6.07, 19.64 },
+	{ 4.0, 5.77, 288.08 },
+	{ 5.0, 3.00, 29.20 },
+	{ 3.8, 2.60, 426.60 },
+	{ 3.9, 3.20, 159.12 },
+	{ 3.9, 4.44, 141.70 },
+	{ 5.3, 4.08, 111.43 },
+	{ 4.6, 0.01, 298.23 },
+	{ 3.7, 5.28, 353.30 },
+	{ 3.9, 5.27, 521.09 },
+	{ 3.7, 5.15, 490.33 },
+	{ 4.0, 0.61, 152.01 },
+	{ 3.9, 1.34, 535.32 },
+	{ 4.4, 0.62, 827.17 },
+	{ 3.6, 4.72, 6.90 },
+	{ 3.6, 3.25, 230.56 },
+	{ 3.5, 0.79, 983.12 },
+	{ 4.5, 2.87, 129.92 },
+	{ 3.6, 5.59, 774.48 },
+	{ 3.5, 4.50, 376.20 },
+	{ 3.4, 2.56, 258.88 },
+	{ 4.4, 2.10, 404.51 },
+	{ 3.3, 0.90, 469.14 },
+	{ 3.3, 3.86, 42.54 },
+	{ 3.2, 2.76, 248.72 },
+	{ 3.2, 0.08, 1514.29 },
+	{ 3.8, 5.30, 369.08 },
+	{ 3.3, 2.25, 73.82 },
+	{ 3.1, 2.60, 433.71 },
+	{ 3.1, 4.55, 980.67 },
+	{ 3.1, 1.27, 200.77 },
+	{ 3.1, 1.71, 639.90 },
+	{ 3.1, 3.63, 16.67 },
+	{ 3.5, 4.94, 411.62 },
+	{ 3.5, 4.49, 881.51 },
+	{ 3.3, 5.59, 472.17 },
+	{ 3.0, 6.03, 291.26 },
+	{ 3.5, 2.17, 554.07 },
+	{ 3.1, 0.52, 1094.81 },
+	{ 3.3, 2.49, 451.73 },
+	{ 2.9, 0.50, 305.35 },
+	{ 3.1, 4.20, 146.59 },
+	{ 2.9, 2.45, 135.34 },
+	{ 3.0, 0.39, 25.27 },
+	{ 2.8, 2.53, 867.28 },
+	{ 2.7, 5.29, 125.99 },
+	{ 2.9, 4.71, 218.93 },
+	{ 2.8, 4.28, 350.33 },
+	{ 2.7, 1.99, 82.86 },
+	{ 2.9, 3.09, 216.48 },
+	{ 3.4, 3.68, 661.09 },
+	{ 2.9, 1.44, 381.61 },
+	{ 2.8, 0.39, 33.68 },
+	{ 2.8, 4.63, 1357.61 },
+	{ 3.4, 2.13, 685.47 },
+	{ 2.6, 5.93, 89.76 },
+	{ 2.7, 0.76, 486.40 },
+	{ 2.7, 4.16, 235.39 },
+	{ 2.6, 3.82, 550.89 },
+	{ 3.4, 3.17, 108.46 },
+	{ 2.6, 5.68, 24.38 },
+	{ 2.7, 1.87, 529.69 },
+	{ 2.6, 4.37, 1080.58 },
+	{ 2.4, 3.07, 391.17 },
+	{ 2.4, 5.74, 535.91 },
+	{ 2.3, 5.19, 1059.38 },
+	{ 2.6, 1.10, 913.00 },
+	{ 2.2, 6.10, 140.00 },
+	{ 3.1, 5.35, 681.54 },
+	/* 192 terms retained, 0 terms dropped, error 8.5e-07 a.u.*T^2 */
+
+	/* uranus r, T^3 */
+	{ 1164.4, 4.73453, 74.78160 },
+	{ 212.4, 3.3426, 63.7359 },
+	{ 196.4, 2.9800, 70.8494 },
+	{ 104.5, 0.9581, 11.0457 },
+	{ 71.7, 0.025, 56.622 },
+	{ 72.5, 0.997, 149.563 },
+	{ 54.9, 2.594, 3.932 },
+	{ 34.0, 3.816, 76.266 },
+	{ 32.1, 3.598, 131.404 },
+	{ 29.6, 3.441, 85.827 },
+	{ 36.4, 5.650, 77.963 },
+	{ 27.7, 0.428, 3.181 },
+	{ 27.5, 2.551, 52.690 },
+	{ 24.6, 5.140, 78.714 },
+	{ 19.4, 5.135, 18.159 },
+	{ 15.8, 0.371, 447.796 },
+	{ 15.4, 5.573, 462.023 },
+	{ 15.2, 3.860, 73.297 },
+	{ 15.5, 2.975, 145.631 },
+	{ 18.0, 0, 0 },
+	{ 16.0, 5.199, 71.600 },
+	{ 11.1, 6.032, 138.517 },
+	{ 10.5, 3.583, 224.345 },
+	{ 7.6, 1.45, 1.48 },
+	{ 8.1, 2.62, 22.09 },
+	{ 7.1, 5.44, 269.92 },
+	{ 6.5, 4.37, 284.15 },
+	{ 6.8, 0.01, 151.05 },
+	{ 8.1, 0.30, 127.47 },
+	{ 5.8, 4.23, 373.01 },
+	{ 5.0, 1.84, 202.25 },
+	{ 4.7, 2.78, 120.36 },
+	{ 5.1, 0.78, 62.25 },
+	{ 4.2, 1.84, 72.33 },
+	{ 3.9, 1.89, 209.37 },
+	{ 5.2, 4.16, 195.14 },
+	{ 3.6, 2.00, 65.22 },
+	{ 3.6, 3.93, 124.29 },
+	{ 3.8, 1.05, 92.94 },
+	{ 4.2, 3.96, 9.56 },
+	{ 3.5, 1.54, 148.08 },
+	{ 3.2, 2.99, 387.24 },
+	{ 4.0, 1.86, 152.74 },
+	{ 3.3, 1.41, 351.82 },
+	{ 3.6, 1.17, 153.50 },
+	{ 2.9, 6.04, 12.53 },
+	{ 2.7, 5.65, 134.59 },
+	{ 2.8, 0.79, 572.23 },
+	{ 3.1, 5.84, 160.61 },
+	{ 2.7, 1.99, 450.98 },
+	{ 2.7, 2.77, 213.30 },
+	{ 2.3, 1.68, 358.93 },
+	{ 2.3, 5.77, 84.34 },
+	{ 2.3, 4.81, 536.80 },
+	{ 2.2, 2.20, 465.96 },
+	/* 55 terms retained, 0 terms dropped, error 3.3e-07 a.u.*T^3 */
+
+	/* uranus r, T^4 */
+	{ 53.0, 3.008, 74.782 },
+	{ 9.9, 1.91, 56.62 },
+	{ 7.0, 5.09, 11.05 },
+	{ 6.7, 5.43, 149.56 },
+	{ 3.7, 5.23, 131.40 },
+	{ 3.4, 1.30, 85.83 },
+	{ 2.7, 0.44, 63.74 },
+	{ 2.3, 0.92, 145.63 },
+	{ 2.4, 6.21, 358.93 },
+	{ 2.3, 2.23, 440.68 },
+	{ 3.1, 3.14, 0 },
+	/* 11 terms retained, 0 terms dropped, error 2.1e-07 a.u.*T^4 */
+	/* end uranus */
+};
+
+int vn_uranus[][3] = {
+	/* addresses for uranus l, b, r  */
+	/* T^0 */ { 0, 355, 462, },
+	/* T^1 */ { 152, 398, 832, },
+	/* T^2 */ { 253, 432, 1122, },
+	/* T^3 */ { 315, 449, 1314, },
+	/* T^4 */ { 347, 460, 1369, },
+	/* T^5 */ { 354, 462, 1380, },
+	/* end */ { 355, 0, 0, },
+	/* termination */ { 0, }
+};
+
+/*  version d4 (lbr)       
+ *  heliocentric dynamical ecliptic and equinox of the date
+ */
+
+double vx_venus[][3] = {
+	/* venus l, T^0 */
+	{ 317614666.8, 0, 0 },
+	{ 1353968.4, 5.59313320, 10213.28554621 },
+	{ 89891.6, 5.306500, 20426.571092 },
+	{ 5477.2, 4.41631, 7860.41939 },
+	{ 3455.7, 2.69964, 11790.62909 },
+	{ 2372.1, 2.99378, 3930.20970 },
+	{ 1317.1, 5.18668, 26.29832 },
+	{ 1664.1, 4.25019, 1577.34354 },
+	{ 1438.3, 4.15745, 9683.59458 },
+	{ 1200.5, 6.15357, 30639.85664 },
+	{ 761.4, 1.9501, 529.6910 },
+	{ 707.7, 1.0647, 775.5226 },
+	{ 584.8, 3.9984, 191.4483 },
+	{ 769.3, 0.8163, 9437.7629 },
+	{ 499.9, 4.1234, 15720.8388 },
+	{ 326.2, 4.5906, 10404.7338 },
+	{ 429.5, 3.5864, 19367.1892 },
+	{ 327.0, 5.6774, 5507.5532 },
+	{ 231.9, 3.1625, 9153.9036 },
+	{ 179.7, 4.6534, 1109.3786 },
+	{ 128.3, 4.2260, 20.7754 },
+	{ 155.5, 5.5704, 19651.0485 },
+	{ 127.9, 0.9621, 5661.3320 },
+	{ 105.5, 1.5372, 801.8209 },
+	{ 85.7, 0.356, 3154.687 },
+	{ 99.1, 0.833, 213.299 },
+	{ 98.8, 5.394, 13367.973 },
+	{ 82.1, 3.216, 18837.498 },
+	{ 88.0, 3.889, 9999.986 },
+	{ 71.6, 0.111, 11015.106 },
+	{ 56.1, 4.240, 7.114 },
+	{ 70.2, 0.675, 23581.258 },
+	{ 50.8, 0.245, 11322.664 },
+	{ 46.1, 5.316, 18073.705 },
+	{ 44.6, 6.063, 40853.142 },
+	{ 42.6, 5.329, 2352.866 },
+	{ 42.6, 1.800, 7084.897 },
+	{ 41.2, 0.362, 382.897 },
+	{ 35.7, 2.704, 10206.172 },
+	{ 33.9, 2.023, 6283.076 },
+	{ 29.1, 3.592, 22003.915 },
+	{ 28.5, 2.224, 1059.382 },
+	{ 29.8, 4.022, 10239.584 },
+	{ 33.3, 2.100, 27511.468 },
+	{ 30.2, 4.942, 13745.346 },
+	{ 29.3, 3.514, 283.859 },
+	{ 26.3, 0.541, 17298.182 },
+	/* 47 terms retained, 320 terms dropped, error 0.75" */
+
+	/* venus l, T^1 */
+	{ 1021352943052.9, 0, 0 },
+	{ 95707.7, 2.464244, 10213.285546 },
+	{ 14445.0, 0.516246, 20426.571092 },
+	{ 213.4, 1.7955, 30639.8566 },
+	{ 151.7, 6.1064, 1577.3435 },
+	{ 173.9, 2.6554, 26.2983 },
+	{ 82.2, 5.702, 191.448 },
+	{ 69.7, 2.681, 9437.763 },
+	{ 52.4, 3.600, 775.523 },
+	{ 38.3, 1.034, 529.691 },
+	{ 29.6, 1.251, 5507.553 },
+	{ 25.1, 6.107, 10404.734 },
+	{ 17.8, 6.194, 1109.379 },
+	{ 16.5, 2.643, 7.114 },
+	{ 14.2, 5.451, 9153.904 },
+	{ 12.6, 1.245, 40853.142 },
+	{ 11.6, 4.976, 213.299 },
+	{ 12.6, 1.881, 382.897 },
+	{ 8.9, 0.95, 13367.97 },
+	{ 7.4, 4.39, 10206.17 },
+	{ 6.6, 2.28, 2352.87 },
+	{ 6.3, 4.08, 3154.69 },
+	{ 6.7, 5.06, 801.82 },
+	/* 23 terms retained, 192 terms dropped, error 0.14"*T */
+
+	/* venus l, T^2 */
+	{ 54127.1, 0, 0 },
+	{ 3891.5, 0.34514, 10213.28555 },
+	{ 1337.9, 2.02011, 20426.57109 },
+	{ 23.8, 2.046, 26.298 },
+	{ 19.3, 3.535, 30639.857 },
+	{ 10.0, 3.971, 775.523 },
+	{ 7.0, 1.52, 1577.34 },
+	{ 6.0, 1.00, 191.45 },
+	{ 3.2, 4.36, 9437.76 },
+	{ 2.1, 2.66, 40853.14 },
+	{ 1.9, 3.39, 382.90 },
+	/* 11 terms retained, 59 terms dropped, error 0.028"*T^2 */
+
+	/* venus l, T^3 */
+	{ 135.7, 4.8039, 10213.2855 },
+	{ 77.8, 3.669, 20426.571 },
+	{ 26.0, 0, 0 },
+	{ 1.2, 5.32, 30639.86 },
+	/* 4 terms retained, 5 terms dropped, error 0.011"*T^3 */
+
+	/* venus l, T^4 */
+	{ 114.0, 3.1416, 0 },
+	{ 3.2, 5.21, 20426.57 },
+	{ 1.7, 2.51, 10213.29 },
+	/* 3 terms retained, 2 terms dropped, error 0.014"*T^4 */
+
+	/* venus l, T^5 */
+	{ 0.9, 3.14, 0 },
+	{ 0.1, 0.55, 20426.57 },
+	{ 0.1, 1.91, 10213.29 },
+	/* 3 terms retained, 2 terms dropped, error 0.00097"*T^5 */
+	/* end venus l */
+
+	/* venus b, T^0 */
+	{ 5923638.5, 0.26702776, 10213.28554621 },
+	{ 40108.0, 1.147372, 20426.571092 },
+	{ 32814.9, 3.141593, 0 },
+	{ 1011.4, 1.08946, 30639.85664 },
+	{ 149.5, 6.2539, 18073.7049 },
+	{ 137.8, 0.8602, 1577.3435 },
+	{ 130.0, 3.6715, 9437.7629 },
+	{ 119.5, 3.7047, 2352.8662 },
+	{ 108.0, 4.5390, 22003.9146 },
+	{ 92.0, 1.540, 9153.904 },
+	{ 53.0, 2.281, 5507.553 },
+	{ 45.6, 0.723, 10239.584 },
+	{ 38.9, 2.934, 10186.987 },
+	{ 43.5, 6.140, 11790.629 },
+	{ 41.7, 5.991, 19896.880 },
+	{ 39.6, 3.868, 8635.942 },
+	{ 39.2, 3.950, 529.691 },
+	{ 33.3, 4.832, 14143.495 },
+	/* 18 terms retained, 192 terms dropped, error 0.6" */
+
+	/* venus b, T^1 */
+	{ 513347.6, 1.8036431, 10213.2855462 },
+	{ 4380.1, 3.38616, 20426.57109 },
+	{ 196.6, 2.5300, 30639.8566 },
+	{ 199.2, 0, 0 },
+	{ 14.0, 2.271, 9437.763 },
+	{ 13.0, 1.507, 18073.705 },
+	{ 11.9, 5.605, 1577.344 },
+	{ 10.3, 5.242, 2352.866 },
+	{ 9.3, 6.08, 22003.91 },
+	{ 7.4, 1.50, 11790.63 },
+	{ 8.0, 0.29, 9153.90 },
+	{ 7.5, 5.08, 10186.99 },
+	/* 12 terms retained, 121 terms dropped, error 0.11"*T */
+
+	/* venus b, T^2 */
+	{ 22377.7, 3.385091, 10213.285546 },
+	{ 281.7, 0, 0 },
+	{ 173.2, 5.2556, 20426.5711 },
+	{ 26.9, 3.870, 30639.857 },
+	/* 4 terms retained, 55 terms dropped, error 0.25"*T^2 */
+
+	/* venus b, T^3 */
+	{ 646.7, 4.9917, 10213.2855 },
+	{ 20.0, 3.142, 0 },
+	{ 5.5, 0.77, 20426.57 },
+	{ 2.5, 5.44, 30639.86 },
+	/* 4 terms retained, 11 terms dropped, error 0.023"*T^3 */
+
+	/* venus b, T^4 */
+	{ 14.1, 0.315, 10213.286 },
+	{ 0.2, 2.35, 20426.57 },
+	{ 0.2, 0.74, 30639.86 },
+	{ 0.2, 3.14, 0 },
+	/* 4 terms retained, 1 terms dropped, error 0.002"*T^4 */
+
+	/* venus b, T^5 */
+	{ 0.2, 2.05, 10213.29 },
+	/* 1 terms retained, 3 terms dropped, error 0.0014"*T^5 */
+	/* end venus b */
+
+	/* venus r, T^0 */
+	{ 72334820.9, 0, 0 },
+	{ 489824.2, 4.0215183, 10213.2855462 },
+	{ 1658.1, 4.90207, 20426.57109 },
+	{ 1632.1, 2.84549, 7860.41939 },
+	{ 1378.0, 1.12847, 11790.62909 },
+	{ 498.4, 2.5868, 9683.5946 },
+	{ 374.0, 1.4231, 3930.2097 },
+	{ 263.6, 5.5294, 9437.7629 },
+	{ 237.5, 2.5514, 15720.8388 },
+	{ 222.0, 2.0135, 19367.1892 },
+	{ 119.5, 3.0198, 10404.7338 },
+	{ 125.9, 2.7277, 1577.3435 },
+	{ 76.2, 1.596, 9153.904 },
+	{ 85.3, 3.986, 19651.048 },
+	{ 74.3, 4.120, 5507.553 },
+	{ 41.9, 1.643, 18837.498 },
+	{ 42.5, 3.819, 13367.973 },
+	{ 39.4, 5.390, 23581.258 },
+	{ 29.0, 5.677, 5661.332 },
+	{ 27.6, 5.724, 775.523 },
+	{ 27.3, 4.822, 11015.106 },
+	{ 31.3, 2.318, 9999.986 },
+	/* 22 terms retained, 308 terms dropped, error 3e-06 a.u. */
+
+	/* venus r, T^1 */
+	{ 34551.0, 0.891987, 10213.285546 },
+	{ 234.2, 1.7722, 20426.5711 },
+	{ 234.0, 3.1416, 0 },
+	{ 23.9, 1.113, 9437.763 },
+	{ 10.6, 4.592, 1577.344 },
+	{ 9.1, 4.54, 10404.73 },
+	{ 6.6, 5.98, 5507.55 },
+	/* 7 terms retained, 173 terms dropped, error 3.7e-07 a.u.*T */
+
+	/* venus r, T^2 */
+	{ 1406.6, 5.06366, 10213.28555 },
+	{ 15.5, 5.473, 20426.571 },
+	{ 13.1, 0, 0 },
+	/* 3 terms retained, 60 terms dropped, error 5.2e-07 a.u.*T^2 */
+
+	/* venus r, T^3 */
+	{ 49.6, 3.223, 10213.286 },
+	{ 0.8, 3.21, 20426.57 },
+	/* 2 terms retained, 5 terms dropped, error 2.9e-08 a.u.*T^3 */
+
+	/* venus r, T^4 */
+	{ 0.6, 0.92, 10213.29 },
+	/* 1 terms retained, 2 terms dropped, error 1.6e-08 a.u.*T^4 */
+
+	/* venus r, T^5 */
+	/* 0 terms retained, 2 terms dropped, error 9e-10 a.u.*T^5 */
+	/* end venus */
+};
+
+int vn_venus[][3] = {
+	/* addresses for venus l, b, r  */
+	/* T^0 */ { 0, 91, 134, },
+	/* T^1 */ { 47, 109, 156, },
+	/* T^2 */ { 70, 121, 163, },
+	/* T^3 */ { 81, 125, 166, },
+	/* T^4 */ { 85, 129, 168, },
+	/* T^5 */ { 88, 133, 169, },
+	/* end */ { 91, 134, 0, },
+	/* termination */ { 0, }
+};
+
+
+/* For RCS Only -- Do Not Edit */
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: vsop87_data.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
