Skip to content
Snippets Groups Projects
Commit b68f9666 authored by cmv's avatar cmv
Browse files

tests directs de xephem lib cmv 31/05/2003

parent d2fae0d2
No related branches found
No related tags found
Loading
......@@ -4,7 +4,7 @@ all: libxastro.a
clean:
rm -f libxastro.a
rm -f *.o
rm -f *.o testxephem
install:
if [ ! -d $(EXTINCPATH)/XAstro ] ; then mkdir $(EXTINCPATH)/XAstro ; fi
......@@ -21,3 +21,6 @@ libxastro.a : $(OBJASTRO)
%.o: %.c
$(COMPILE.c) -o $@ $<
testxephem: testxephem.o
$(LINK.c) -o $@ $^ -L$(EXTLIBPATH) -lxastro -lc -lm
/* Pour faire des tests de Xephem Librairie */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
#include "P_.h"
#include "astro.h"
#define R2D (180./PI)
int main(int narg,char** arg)
{
int year=1989,month=7,day=21; /* UTC*/
double hour=12.5;
int npnum=8, pnum[8]={MERCURY,VENUS,MARS,JUPITER,SATURN,URANUS,NEPTUNE,PLUTO};
int i;
double mjd,sunecl,sunecb,sundist,geodist,geoecl,geoecb,diamang,mag,msp,mdp;
cal_mjd(month,day+hour/24.,year,&mjd);
printf("date %d/%d/%d %gh -> mjd=%f\n",day,month,year,hour,mjd);
/* Soleil */
sunpos(mjd,&geoecl,&geodist,&geoecb);
printf("Sun: geo ecl=%g ecb=%g dist=%g\n",geoecl*R2D,geoecb*R2D,geodist);
/* Lune */
moon(mjd,&geoecl,&geoecb,&geodist,&msp,&mdp);
printf("Moon: geo ecl=%g ecb=%g dist=%g\n",geoecl*R2D,geoecb*R2D,geodist);
/* Planete */
printf("--- Planets\n");
for(i=0;i<npnum;i++) {
plans(mjd,pnum[i],&sunecl,&sunecb,&sundist,&geodist,&geoecl,&geoecb,&diamang,&mag);
printf("pnum=%d: sun ecl=%g ecb=%g dist=%g,",pnum[i],sunecl*R2D,sunecb*R2D,sundist);
printf(" geo ecl=%g ecb=%g dist=%g,",geoecl*R2D,geoecb*R2D,geodist);
printf(" diamang=%g\"/1UA mag=%g\n",diamang,mag);
}
exit(0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment