Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/nutation.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/nutation.c
r1719 r2551 3 3 * (given to 0.001") EXACTLY over 750 days (1995 and 1996) 4 4 */ 5 #include <stdio.h> 5 6 #include <math.h> 6 7 7 #include "P_.h"8 8 #include "astro.h" 9 9 … … 268 268 }; 269 269 270 /* given the modified JD, mj d, find the nutation in obliquity, *deps, and270 /* given the modified JD, mj, find the nutation in obliquity, *deps, and 271 271 * the nutation in longitude, *dpsi, each in radians. 272 272 */ 273 273 void 274 nutation ( mjd, deps, dpsi)275 double mj d;276 double *deps ;/* on input: precision parameter in arc seconds */277 double *dpsi ;274 nutation ( 275 double mj, 276 double *deps, /* on input: precision parameter in arc seconds */ 277 double *dpsi) 278 278 { 279 static double lastmj d= -10000, lastdeps, lastdpsi;279 static double lastmj = -10000, lastdeps, lastdpsi; 280 280 double T, T2, T3, T10; /* jul cent since J2000 */ 281 281 double prec; /* series precis in arc sec */ … … 287 287 */ 288 288 289 if (mj d == lastmjd) {289 if (mj == lastmj) { 290 290 *deps = lastdeps; 291 291 *dpsi = lastdpsi; … … 304 304 prec *= NUT_SCALE/10; 305 305 306 T = (mj d- J2000)/36525.;306 T = (mj - J2000)/36525.; 307 307 T2 = T * T; 308 308 T3 = T2 * T; … … 362 362 lastdeps = degrad(lastdeps/3600./NUT_SCALE); 363 363 364 lastmj d = mjd;364 lastmj = mj; 365 365 *deps = lastdeps; 366 366 *dpsi = lastdpsi; 367 367 } 368 368 369 /* given the modified JD, mj d, correct, IN PLACE, the right ascension *ra369 /* given the modified JD, mj, correct, IN PLACE, the right ascension *ra 370 370 * and declination *dec (both in radians) for nutation. 371 371 */ 372 372 void 373 nut_eq (mjd, ra, dec) 374 double mjd, *ra, *dec; 373 nut_eq (double mj, double *ra, double *dec) 375 374 { 376 static double lastmj d= -10000;375 static double lastmj = -10000; 377 376 static double a[3][3]; /* rotation matrix */ 378 377 double xold, yold, zold, x, y, z; 379 378 380 if (mj d != lastmjd) {379 if (mj != lastmj) { 381 380 double epsilon, dpsi, deps; 382 381 double se, ce, sp, cp, sede, cede; 383 382 384 obliquity(mj d, &epsilon);385 nutation(mj d, &deps, &dpsi);383 obliquity(mj, &epsilon); 384 nutation(mj, &deps, &dpsi); 386 385 387 386 /* the rotation matrix a applies the nutation correction to … … 428 427 a[2][2] = sede*cp*se+cede*ce; 429 428 430 lastmj d = mjd;429 lastmj = mj; 431 430 } 432 431 … … 440 439 441 440 /* For RCS Only -- Do Not Edit */ 442 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: nutation.c,v $ $Date: 200 1-10-22 12:08:27 $ $Revision: 1.2$ $Name: not supported by cvs2svn $"};441 static 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.