/* Get arbitrary planetary barycenter position. Get the velocity (in AU/YR) too, if desired. */ void bodycenter_ssbary(double jd, double *xyz, int body, double *vxyz) { double posn[3], vel[3]; static int init=0; int i; if (!init) { if (Initialize_Ephemeris()) exit(1); init = 1; } if (vxyz==NULL) { Interpolate_Position(jd, body, posn); } else { Interpolate_State(jd, body, posn, vel); } for (i=0; i<3; i++) { xyz[i] = posn[i] / R1.AU; } if (vxyz!=NULL) /* convert km/s to AU/YR: */ for (i=0; i<3; i++) { vxyz[i] = vel[i] * (86400. * 365.25) / R1.AU ; } return; }
int dele::init(const char *jpl_name) { strcpy(this->fileName, jpl_name); int res = Initialize_Ephemeris(fileName); GetParams(H1, H2, R1); return res; }
/* Give the Earth geocenter wrt SSBary in AU. */ void geocenter_ssbary(double jd, double *xyz) { double embary[3],moon[3]; static int init=0; int i; if (!init) { if (Initialize_Ephemeris()) exit(1); init = 1; } Interpolate_Position(jd, EARTH, embary); Interpolate_Position(jd, MOON, moon); for (i=0; i<3; i++) { xyz[i] = (embary[i] - moon[i]/(1.+R1.EMRAT)) / R1.AU; } return; }