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

    r1719 r2551  
    33 * (given to 0.001") EXACTLY over 750 days (1995 and 1996)
    44 */
     5#include <stdio.h>
    56#include <math.h>
    67
    7 #include "P_.h"
    88#include "astro.h"
    99
     
    268268};
    269269
    270 /* given the modified JD, mjd, find the nutation in obliquity, *deps, and
     270/* given the modified JD, mj, find the nutation in obliquity, *deps, and
    271271 * the nutation in longitude, *dpsi, each in radians.
    272272 */
    273273void
    274 nutation (mjd, deps, dpsi)
    275 double mjd;
    276 double *deps;   /* on input:  precision parameter in arc seconds */
    277 double *dpsi;
     274nutation (
     275double mj,
     276double *deps,   /* on input:  precision parameter in arc seconds */
     277double *dpsi)
    278278{
    279         static double lastmjd = -10000, lastdeps, lastdpsi;
     279        static double lastmj = -10000, lastdeps, lastdpsi;
    280280        double T, T2, T3, T10;                  /* jul cent since J2000 */
    281281        double prec;                            /* series precis in arc sec */
     
    287287                         */
    288288
    289         if (mjd == lastmjd) {
     289        if (mj == lastmj) {
    290290            *deps = lastdeps;
    291291            *dpsi = lastdpsi;
     
    304304        prec *= NUT_SCALE/10;
    305305
    306         T = (mjd - J2000)/36525.;
     306        T = (mj - J2000)/36525.;
    307307        T2 = T * T;
    308308        T3 = T2 * T;
     
    362362        lastdeps = degrad(lastdeps/3600./NUT_SCALE);
    363363
    364         lastmjd = mjd;
     364        lastmj = mj;
    365365        *deps = lastdeps;
    366366        *dpsi = lastdpsi;
    367367}
    368368
    369 /* given the modified JD, mjd, correct, IN PLACE, the right ascension *ra
     369/* given the modified JD, mj, correct, IN PLACE, the right ascension *ra
    370370 * and declination *dec (both in radians) for nutation.
    371371 */
    372372void
    373 nut_eq (mjd, ra, dec)
    374 double mjd, *ra, *dec;
     373nut_eq (double mj, double *ra, double *dec)
    375374{
    376         static double lastmjd = -10000;
     375        static double lastmj = -10000;
    377376        static double a[3][3];          /* rotation matrix */
    378377        double xold, yold, zold, x, y, z;
    379378
    380         if (mjd != lastmjd) {
     379        if (mj != lastmj) {
    381380            double epsilon, dpsi, deps;
    382381            double se, ce, sp, cp, sede, cede;
    383382
    384             obliquity(mjd, &epsilon);
    385             nutation(mjd, &deps, &dpsi);
     383            obliquity(mj, &epsilon);
     384            nutation(mj, &deps, &dpsi);
    386385
    387386            /* the rotation matrix a applies the nutation correction to
     
    428427            a[2][2] = sede*cp*se+cede*ce;
    429428
    430             lastmjd = mjd;
     429            lastmj = mj;
    431430        }
    432431
     
    440439
    441440/* For RCS Only -- Do Not Edit */
    442 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: nutation.c,v $ $Date: 2001-10-22 12:08:27 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     441static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: nutation.c,v $ $Date: 2004-06-15 16:52:39 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.