Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/eq_ecl.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/eq_ecl.c
r1719 r2551 2 2 #include <math.h> 3 3 4 #include "P_.h"5 4 #include "astro.h" 6 5 7 static void ecleq_aux P_((int sw, double mjd, double x, double y,8 double *p, double *q) );6 static void ecleq_aux (int sw, double mj, double x, double y, 7 double *p, double *q); 9 8 10 9 #define EQtoECL 1 … … 12 11 13 12 14 /* given the modified Julian date, mj d, and an equitorial ra and dec, each in15 * radians, find the corresponding geocentric ecliptic latitude, *l at, and16 * longititude, *l ng, 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. 17 16 * correction for the effect on the angle of the obliquity due to nutation is 18 17 * not included. 19 18 */ 20 19 void 21 eq_ecl (mjd, ra, dec, lat, lng) 22 double mjd; 23 double ra, dec; 24 double *lat, *lng; 20 eq_ecl (double mj, double ra, double dec, double *lt, double *lg) 25 21 { 26 ecleq_aux (EQtoECL, mj d, ra, dec, lng, lat);22 ecleq_aux (EQtoECL, mj, ra, dec, lg, lt); 27 23 } 28 24 29 /* given the modified Julian date, mj d, and a geocentric ecliptic latitude,30 * *l at, and longititude, *lng, each in radians, find the corresponding25 /* given the modified Julian date, mj, and a geocentric ecliptic latitude, 26 * *lt, and longititude, *lg, each in radians, find the corresponding 31 27 * equitorial ra and dec, also each in radians. 32 28 * correction for the effect on the angle of the obliquity due to nutation is … … 34 30 */ 35 31 void 36 ecl_eq (mjd, lat, lng, ra, dec) 37 double mjd; 38 double lat, lng; 39 double *ra, *dec; 32 ecl_eq (double mj, double lt, double lg, double *ra, double *dec) 40 33 { 41 ecleq_aux (ECLtoEQ, mj d, lng, lat, ra, dec);34 ecleq_aux (ECLtoEQ, mj, lg, lt, ra, dec); 42 35 } 43 36 44 37 static void 45 ecleq_aux ( sw, mjd, x, y, p, q)46 int sw ;/* +1 for eq to ecliptic, -1 for vv. */47 double mj d;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. */38 ecleq_aux ( 39 int sw, /* +1 for eq to ecliptic, -1 for vv. */ 40 double mj, 41 double x, double y, /* sw==1: x==ra, y==dec. sw==-1: x==lg, y==lt. */ 42 double *p, double *q) /* sw==1: p==lg, q==lt. sw==-1: p==ra, q==dec. */ 50 43 { 51 static double lastmj d = -10000; /* last mjdcalculated */44 static double lastmj = -10000; /* last mj calculated */ 52 45 static double seps, ceps; /* sin and cos of mean obliquity */ 53 46 double sx, cx, sy, cy, ty, sq; 54 47 55 if (mj d != lastmjd) {48 if (mj != lastmj) { 56 49 double eps; 57 obliquity (mj d, &eps); /* mean obliquity for date */50 obliquity (mj, &eps); /* mean obliquity for date */ 58 51 seps = sin(eps); 59 52 ceps = cos(eps); 60 lastmj d = mjd;53 lastmj = mj; 61 54 } 62 55 … … 77 70 78 71 /* For RCS Only -- Do Not Edit */ 79 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: eq_ecl.c,v $ $Date: 200 1-10-22 12:08:27 $ $Revision: 1.2$ $Name: not supported by cvs2svn $"};72 static 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.