Astro-PAL
view release on metacpan or search on metacpan
erfasrc/src/plan94.c view on Meta::CPAN
**
** Mercury 7 1 500 0.7
** Venus 7 1 1100 0.9
** EMB 9 1 1300 1.0
** Mars 26 1 9000 2.5
** Jupiter 78 6 82000 8.2
** Saturn 87 14 263000 24.6
** Uranus 86 7 661000 27.4
** Neptune 11 2 248000 21.4
**
** 6) The present ERFA re-implementation of the original Simon et al.
** Fortran code differs from the original in the following respects:
**
** * C instead of Fortran.
**
** * The date is supplied in two parts.
**
** * The result is returned only in equatorial Cartesian form;
** the ecliptic longitude, latitude and radius vector are not
** returned.
**
** * The result is in the J2000.0 equatorial frame, not ecliptic.
**
** * More is done in-line: there are fewer calls to subroutines.
**
** * Different error/warning status values are used.
**
** * A different Kepler's-equation-solver is used (avoiding
** use of double precision complex).
**
** * Polynomials in t are nested to minimize rounding errors.
**
** * Explicit double constants are used to avoid mixed-mode
** expressions.
**
** None of the above changes affects the result significantly.
**
** 7) The returned status indicates the most serious condition
** encountered during execution of the function. Illegal np is
** considered the most serious, overriding failure to converge,
** which in turn takes precedence over the remote date warning.
**
** Called:
** eraAnp normalize angle into range 0 to 2pi
**
** Reference: Simon, J.L, Bretagnon, P., Chapront, J.,
** Chapront-Touze, M., Francou, G., and Laskar, J.,
** Astron.Astrophys., 282, 663 (1994).
**
** Copyright (C) 2013-2020, NumFOCUS Foundation.
** Derived, with permission, from the SOFA library. See notes at end of file.
*/
{
/* Gaussian constant */
static const double GK = 0.017202098950;
/* Sin and cos of J2000.0 mean obliquity (IAU 1976) */
static const double SINEPS = 0.3977771559319137;
static const double COSEPS = 0.9174820620691818;
/* Maximum number of iterations allowed to solve Kepler's equation */
static const int KMAX = 10;
int jstat, i, k;
double t, da, dl, de, dp, di, dom, dmu, arga, argl, am,
ae, dae, ae2, at, r, v, si2, xq, xp, tl, xsw,
xcw, xm2, xf, ci2, xms, xmc, xpxq2, x, y, z;
/* Planetary inverse masses */
static const double amas[] = { 6023600.0, /* Mercury */
408523.5, /* Venus */
328900.5, /* EMB */
3098710.0, /* Mars */
1047.355, /* Jupiter */
3498.5, /* Saturn */
22869.0, /* Uranus */
19314.0 }; /* Neptune */
/*
** Tables giving the mean Keplerian elements, limited to t^2 terms:
**
** a semi-major axis (au)
** dlm mean longitude (degree and arcsecond)
** e eccentricity
** pi longitude of the perihelion (degree and arcsecond)
** dinc inclination (degree and arcsecond)
** omega longitude of the ascending node (degree and arcsecond)
*/
static const double a[][3] = {
{ 0.3870983098, 0.0, 0.0 }, /* Mercury */
{ 0.7233298200, 0.0, 0.0 }, /* Venus */
{ 1.0000010178, 0.0, 0.0 }, /* EMB */
{ 1.5236793419, 3e-10, 0.0 }, /* Mars */
{ 5.2026032092, 19132e-10, -39e-10 }, /* Jupiter */
{ 9.5549091915, -0.0000213896, 444e-10 }, /* Saturn */
{ 19.2184460618, -3716e-10, 979e-10 }, /* Uranus */
{ 30.1103868694, -16635e-10, 686e-10 } /* Neptune */
};
static const double dlm[][3] = {
{ 252.25090552, 5381016286.88982, -1.92789 },
{ 181.97980085, 2106641364.33548, 0.59381 },
{ 100.46645683, 1295977422.83429, -2.04411 },
{ 355.43299958, 689050774.93988, 0.94264 },
{ 34.35151874, 109256603.77991, -30.60378 },
{ 50.07744430, 43996098.55732, 75.61614 },
{ 314.05500511, 15424811.93933, -1.75083 },
{ 304.34866548, 7865503.20744, 0.21103 }
};
static const double e[][3] = {
{ 0.2056317526, 0.0002040653, -28349e-10 },
{ 0.0067719164, -0.0004776521, 98127e-10 },
{ 0.0167086342, -0.0004203654, -0.0000126734 },
{ 0.0934006477, 0.0009048438, -80641e-10 },
{ 0.0484979255, 0.0016322542, -0.0000471366 },
{ 0.0555481426, -0.0034664062, -0.0000643639 },
{ 0.0463812221, -0.0002729293, 0.0000078913 },
{ 0.0094557470, 0.0000603263, 0.0 }
};
( run in 0.377 second using v1.01-cache-2.11-cpan-96521ef73a4 )