source: Sophya/trunk/SophyaExt/XephemAstroLib/testxephem.c@ 2844

Last change on this file since 2844 was 2551, checked in by cmv, 21 years ago

nouvelle version de xephem/libastro (3.6) cmv 15/6/04

File size: 1.2 KB
Line 
1/* Pour faire des tests de Xephem Librairie */
2#include <stdio.h>
3#include <stdlib.h>
4#include <math.h>
5#include <unistd.h>
6/* include "P_.h" */
7#include "astro.h"
8
9#define R2D (180./PI)
10
11int main(int narg,char** arg)
12{
13 int year=1989,month=7,day=21; /* UTC*/
14 double hour=12.5;
15 int npnum=8, pnum[8]={MERCURY,VENUS,MARS,JUPITER,SATURN,URANUS,NEPTUNE,PLUTO};
16 int i;
17 double mymjd,sunecl,sunecb,sundist,geodist,geoecl,geoecb,diamang,mag,msp,mdp;
18
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
22 /* Soleil */
23 sunpos(mymjd,&geoecl,&geodist,&geoecb);
24 printf("Sun: geo ecl=%g ecb=%g dist=%g\n",geoecl*R2D,geoecb*R2D,geodist);
25
26 /* Lune */
27 moon(mymjd,&geoecl,&geoecb,&geodist,&msp,&mdp);
28 printf("Moon: geo ecl=%g ecb=%g dist=%g\n",geoecl*R2D,geoecb*R2D,geodist);
29
30 /* Planete */
31 printf("--- Planets\n");
32 for(i=0;i<npnum;i++) {
33 plans(mymjd,pnum[i],&sunecl,&sunecb,&sundist,&geodist,&geoecl,&geoecb,&diamang,&mag);
34 printf("pnum=%d: sun ecl=%g ecb=%g dist=%g,",pnum[i],sunecl*R2D,sunecb*R2D,sundist);
35 printf(" geo ecl=%g ecb=%g dist=%g,",geoecl*R2D,geoecb*R2D,geodist);
36 printf(" diamang=%g\"/1UA mag=%g\n",diamang,mag);
37 }
38
39 exit(0);
40}
Note: See TracBrowser for help on using the repository browser.