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/eq_ecl.c

    r1719 r2551  
    22#include <math.h>
    33
    4 #include "P_.h"
    54#include "astro.h"
    65
    7 static void ecleq_aux P_((int sw, double mjd, double x, double y,
    8     double *p, double *q));
     6static void ecleq_aux (int sw, double mj, double x, double y,
     7    double *p, double *q);
    98
    109#define EQtoECL 1
     
    1211
    1312
    14 /* given the modified Julian date, mjd, and an equitorial ra and dec, each in
    15  * radians, find the corresponding geocentric ecliptic latitude, *lat, and
    16  * longititude, *lng, also each in radians.
     13/* given the modified Julian date, mj, and an equitorial ra and dec, each in
     14 * radians, find the corresponding geocentric ecliptic latitude, *lt, and
     15 * longititude, *lg, also each in radians.
    1716 * correction for the effect on the angle of the obliquity due to nutation is
    1817 * not included.
    1918 */
    2019void
    21 eq_ecl (mjd, ra, dec, lat, lng)
    22 double mjd;
    23 double ra, dec;
    24 double *lat, *lng;
     20eq_ecl (double mj, double ra, double dec, double *lt, double *lg)
    2521{
    26         ecleq_aux (EQtoECL, mjd, ra, dec, lng, lat);
     22        ecleq_aux (EQtoECL, mj, ra, dec, lg, lt);
    2723}
    2824
    29 /* given the modified Julian date, mjd, and a geocentric ecliptic latitude,
    30  * *lat, and longititude, *lng, each in radians, find the corresponding
     25/* given the modified Julian date, mj, and a geocentric ecliptic latitude,
     26 * *lt, and longititude, *lg, each in radians, find the corresponding
    3127 * equitorial ra and dec, also each in radians.
    3228 * correction for the effect on the angle of the obliquity due to nutation is
     
    3430 */
    3531void
    36 ecl_eq (mjd, lat, lng, ra, dec)
    37 double mjd;
    38 double lat, lng;
    39 double *ra, *dec;
     32ecl_eq (double mj, double lt, double lg, double *ra, double *dec)
    4033{
    41         ecleq_aux (ECLtoEQ, mjd, lng, lat, ra, dec);
     34        ecleq_aux (ECLtoEQ, mj, lg, lt, ra, dec);
    4235}
    4336
    4437static void
    45 ecleq_aux (sw, mjd, x, y, p, q)
    46 int sw;                 /* +1 for eq to ecliptic, -1 for vv. */
    47 double mjd;
    48 double x, y;            /* sw==1: x==ra, y==dec.  sw==-1: x==lng, y==lat. */
    49 double *p, *q;          /* sw==1: p==lng, q==lat. sw==-1: p==ra, q==dec. */
     38ecleq_aux (
     39int sw,                 /* +1 for eq to ecliptic, -1 for vv. */
     40double mj,
     41double x, double y,     /* sw==1: x==ra, y==dec.  sw==-1: x==lg, y==lt. */
     42double *p, double *q)   /* sw==1: p==lg, q==lt. sw==-1: p==ra, q==dec. */
    5043{
    51         static double lastmjd = -10000; /* last mjd calculated */
     44        static double lastmj = -10000;  /* last mj calculated */
    5245        static double seps, ceps;       /* sin and cos of mean obliquity */
    5346        double sx, cx, sy, cy, ty, sq;
    5447
    55         if (mjd != lastmjd) {
     48        if (mj != lastmj) {
    5649            double eps;
    57             obliquity (mjd, &eps);              /* mean obliquity for date */
     50            obliquity (mj, &eps);               /* mean obliquity for date */
    5851            seps = sin(eps);
    5952            ceps = cos(eps);
    60             lastmjd = mjd;
     53            lastmj = mj;
    6154        }
    6255
     
    7770
    7871/* For RCS Only -- Do Not Edit */
    79 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: eq_ecl.c,v $ $Date: 2001-10-22 12:08:27 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     72static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: eq_ecl.c,v $ $Date: 2004-06-15 16:52:38 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.