Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/sun.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/sun.c
r1719 r2551 2 2 #include <math.h> 3 3 4 #include "P_.h"5 4 #include "astro.h" 6 5 #include "vsop87.h" 7 6 8 /* given the modified JD, mj d, return the true geocentric ecliptic longitude7 /* given the modified JD, mj, return the true geocentric ecliptic longitude 9 8 * of the sun for the mean equinox of the date, *lsn, in radians, the 10 9 * sun-earth distance, *rsn, in AU, and the latitude *bsn, in radians … … 17 16 */ 18 17 void 19 sunpos (mjd, lsn, rsn, bsn) 20 double mjd; 21 double *lsn, *rsn, *bsn; 18 sunpos (double mj, double *lsn, double *rsn, double *bsn) 22 19 { 23 static double last_mj d= -3691, last_lsn, last_rsn, last_bsn;20 static double last_mj = -3691, last_lsn, last_rsn, last_bsn; 24 21 double ret[6]; 25 22 26 if (mj d == last_mjd) {23 if (mj == last_mj) { 27 24 *lsn = last_lsn; 28 25 *rsn = last_rsn; … … 31 28 } 32 29 33 vsop87(mj d, SUN, 0.0, ret); /* full precision earth pos */30 vsop87(mj, SUN, 0.0, ret); /* full precision earth pos */ 34 31 35 32 *lsn = ret[0] - PI; /* revert to sun pos */ … … 39 36 last_rsn = *rsn = ret[2]; 40 37 last_bsn = -ret[1]; 41 last_mj d = mjd;38 last_mj = mj; 42 39 43 40 if (bsn) *bsn = last_bsn; /* assign only if non-NULL pointer */ … … 45 42 46 43 /* For RCS Only -- Do Not Edit */ 47 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: sun.c,v $ $Date: 200 1-10-22 12:08:28 $ $Revision: 1.2$ $Name: not supported by cvs2svn $"};44 static 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.