ВНИМАНИЕ! На форуме началось голосование в конкурсе - астрофотография месяца АПРЕЛЬ!
0 Пользователей и 1 Гость просматривают эту тему.
#include <iostream>#include "calceph.h"using namespace std;int main(){ int res; double jd0=2451624; double dt=0; double PV[6]; /* open the ephemeris file */ res = calceph_sopen("/home/icar/Ephemeris/EPHEM/EPM/epm/EPM2017/SPICE/epm2017.bsp"); /* the heliocentric coordinates of Mars */ calceph_scompute(jd0, dt, 4, 11, PV); cout.precision(10); cout << " Heliocentric coordinates of Mars" << endl; cout << " PV[0] = " << PV[0] << endl; cout << " PV[1] = " << PV[1] << endl; cout << " PV[2] = " << PV[2] << endl; cout << " PV[3] = " << PV[3] << endl; cout << " PV[4] = " << PV[4] << endl; cout << " PV[5] = " << PV[5] << endl; /* close the ephemeris file */ calceph_sclose(); return 0;}
./a.out CALCEPH ERROR : Astronomical unit is not available in the ephemeris file Heliocentric coordinates of Mars PV[0] = inf PV[1] = inf PV[2] = inf PV[3] = -inf PV[4] = inf PV[5] = inf
./a.out CALCEPH ERROR : Can't find time 2.4516240000000000E+06 in the ephemeris file Heliocentric coordinates of Mars PV[0] = 0 PV[1] = 2.12202817e-314 PV[2] = 6.952805446e-310 PV[3] = 4.645527104e-310 PV[4] = 9.881312917e-324 PV[5] = 4.645527107e-310
./a.out Heliocentric coordinates of Mars PV[0] = 1.004743374 PV[1] = 0.9791716539 PV[2] = 0.4219471524 PV[3] = -0.009650821934 PV[4] = 0.009715034305 PV[5] = 0.004716897185
#include <iostream>#include "calceph.h"using namespace std;int main(){ const char *filear[2] = {"epm2017.bsp", "epm2017.tpc"}; calcephbin *res; double jd0 = 2451624.0; double dt = 0; double PV[6]; /* open the ephemeris file */ res = calceph_open_array(2, filear); if (!res) { cout << " Error " << endl; return -1; } /* the heliocentric coordinates of Mars */ calceph_compute(res, jd0, dt, 4, 11, PV); cout.precision(10); cout << " Heliocentric coordinates of Mars" << endl; cout << " PV[0] = " << PV[0] << endl; cout << " PV[1] = " << PV[1] << endl; cout << " PV[2] = " << PV[2] << endl; cout << " PV[3] = " << PV[3] << endl; cout << " PV[4] = " << PV[4] << endl; cout << " PV[5] = " << PV[5] << endl; /* close the ephemeris file */ calceph_close(res); return 0;}