Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/testxephem.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/testxephem.c
r2395 r2551 4 4 #include <math.h> 5 5 #include <unistd.h> 6 #include "P_.h" 6 /* include "P_.h" */ 7 7 #include "astro.h" 8 8 … … 11 11 int main(int narg,char** arg) 12 12 { 13 13 int year=1989,month=7,day=21; /* UTC*/ 14 14 double hour=12.5; 15 15 int npnum=8, pnum[8]={MERCURY,VENUS,MARS,JUPITER,SATURN,URANUS,NEPTUNE,PLUTO}; 16 16 int i; 17 double m jd,sunecl,sunecb,sundist,geodist,geoecl,geoecb,diamang,mag,msp,mdp;17 double mymjd,sunecl,sunecb,sundist,geodist,geoecl,geoecb,diamang,mag,msp,mdp; 18 18 19 cal_mjd(month,day+hour/24.,year,&m jd);20 printf("date %d/%d/%d %gh -> mjd=%f\n",day,month,year,hour,m jd);19 cal_mjd(month,day+hour/24.,year,&mymjd); 20 printf("date %d/%d/%d %gh -> mjd=%f\n",day,month,year,hour,mymjd); 21 21 22 22 /* Soleil */ 23 sunpos(m jd,&geoecl,&geodist,&geoecb);23 sunpos(mymjd,&geoecl,&geodist,&geoecb); 24 24 printf("Sun: geo ecl=%g ecb=%g dist=%g\n",geoecl*R2D,geoecb*R2D,geodist); 25 25 26 26 /* Lune */ 27 moon(m jd,&geoecl,&geoecb,&geodist,&msp,&mdp);27 moon(mymjd,&geoecl,&geoecb,&geodist,&msp,&mdp); 28 28 printf("Moon: geo ecl=%g ecb=%g dist=%g\n",geoecl*R2D,geoecb*R2D,geodist); 29 29 … … 31 31 printf("--- Planets\n"); 32 32 for(i=0;i<npnum;i++) { 33 plans(m jd,pnum[i],&sunecl,&sunecb,&sundist,&geodist,&geoecl,&geoecb,&diamang,&mag);33 plans(mymjd,pnum[i],&sunecl,&sunecb,&sundist,&geodist,&geoecl,&geoecb,&diamang,&mag); 34 34 printf("pnum=%d: sun ecl=%g ecb=%g dist=%g,",pnum[i],sunecl*R2D,sunecb*R2D,sundist); 35 35 printf(" geo ecl=%g ecb=%g dist=%g,",geoecl*R2D,geoecb*R2D,geodist);
Note:
See TracChangeset
for help on using the changeset viewer.