Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/sun.c


Ignore:
Timestamp:
Jun 15, 2004, 6:54:12 PM (21 years ago)
Author:
cmv
Message:

nouvelle version de xephem/libastro (3.6) cmv 15/6/04

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/XephemAstroLib/sun.c

    r1719 r2551  
    22#include <math.h>
    33
    4 #include "P_.h"
    54#include "astro.h"
    65#include "vsop87.h"
    76
    8 /* given the modified JD, mjd, return the true geocentric ecliptic longitude
     7/* given the modified JD, mj, return the true geocentric ecliptic longitude
    98 *   of the sun for the mean equinox of the date, *lsn, in radians, the
    109 *   sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians
     
    1716 */
    1817void
    19 sunpos (mjd, lsn, rsn, bsn)
    20 double mjd;
    21 double *lsn, *rsn, *bsn;
     18sunpos (double mj, double *lsn, double *rsn, double *bsn)
    2219{
    23         static double last_mjd = -3691, last_lsn, last_rsn, last_bsn;
     20        static double last_mj = -3691, last_lsn, last_rsn, last_bsn;
    2421        double ret[6];
    2522
    26         if (mjd == last_mjd) {
     23        if (mj == last_mj) {
    2724            *lsn = last_lsn;
    2825            *rsn = last_rsn;
     
    3128        }
    3229
    33         vsop87(mjd, SUN, 0.0, ret);     /* full precision earth pos */
     30        vsop87(mj, SUN, 0.0, ret);      /* full precision earth pos */
    3431
    3532        *lsn = ret[0] - PI;             /* revert to sun pos */
     
    3936        last_rsn = *rsn = ret[2];
    4037        last_bsn = -ret[1];
    41         last_mjd = mjd;
     38        last_mj = mj;
    4239
    4340        if (bsn) *bsn = last_bsn;       /* assign only if non-NULL pointer */
     
    4542
    4643/* For RCS Only -- Do Not Edit */
    47 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sun.c,v $ $Date: 2001-10-22 12:08:28 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     44static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sun.c,v $ $Date: 2004-06-15 16:52:40 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.