63 std::cout <<
"\nTesting CEPlanet:\n";
84 test_string(test1.
Name(),
"undefined", __func__, __LINE__);
90 test_string(test2.Name(),
"DefaultPlanet", __func__, __LINE__);
91 test_double(test2.XCoord().Deg(), 123.45, __func__, __LINE__);
92 test_double(test2.YCoord().Deg(), 67.89, __func__, __LINE__);
97 test_string(test3.Name(), test2.Name(), __func__, __LINE__);
98 test_double(test3.XCoord().Deg(), test2.XCoord().Deg(), __func__, __LINE__);
99 test_double(test3.YCoord().Deg(), test2.YCoord().Deg(), __func__, __LINE__);
100 test_int(
int(test3.GetCoordSystem()),
int(test2.GetCoordSystem()), __func__, __LINE__);
104 test_string(test4.
Name(), test2.Name(), __func__, __LINE__);
105 test_double(test4.
XCoordinate_Deg(), test2.XCoordinate_Deg(), __func__, __LINE__);
106 test_double(test4.
YCoordinate_Deg(), test2.YCoordinate_Deg(), __func__, __LINE__);
107 test_int(
int(test4.
GetCoordSystem()),
int(test2.GetCoordSystem()), __func__, __LINE__);
133 {-0.13721236, -0.4032437, -0.20141521},
134 {0.02137206, -0.00493223, -0.00485005});
160 {-0.72543765, -0.04893718, 0.02371176},
161 {0.00080326, -0.01849847, -0.00837267});
187 {-0.18428431, 0.88477935, 0.383819},
188 {-0.01720221, -0.00290513, -0.00125952});
214 {1.38356924, -0.0011989, -0.0378561},
215 {0.00067763, 0.01380768, 0.00631503});
220 test_double(mars.
GetXICRS(), pos[0], __func__, __LINE__);
221 test_double(mars.
GetYICRS(), pos[1], __func__, __LINE__);
222 test_double(mars.
GetZICRS(), pos[2], __func__, __LINE__);
223 test_double(mars.
GetVxICRS(), vel[0], __func__, __LINE__);
224 test_double(mars.
GetVyICRS(), vel[1], __func__, __LINE__);
225 test_double(mars.
GetVzICRS(), vel[2], __func__, __LINE__);
234 test_lessthan(angsep.
Deg(), 0.1, __func__, __LINE__);
260 {3.99442023, 2.7334608, 1.07451899},
261 {-0.00455544, 0.00587705, 0.00263009});
287 {6.39746262, 6.17262105, 2.2735304},
288 {-0.00429156, 0.00350834, 0.00163369});
314 {14.42492523, -12.50957402, -5.6830779},
315 {0.00269067, 0.00244776, 0.00103396});
341 {16.80489053, -22.98266171, -9.82533257},
342 {0.00258607, 0.00165554, 0.00061312});
360 const std::vector<double>& true_pos,
361 const std::vector<double>& true_vel)
364 std::string func_name = std::string(__func__) +
" (" +
test_planet.Name() +
")";
370 if (!test(icrs_coords == true_icrs, func_name, __LINE__)) {
372 std::printf(
" %s %s", icrs_coords.print().c_str(), true_icrs.
print().c_str());
373 std::printf(
" X-diff: %f arcsec\n", (icrs_coords.XCoord().Deg()-true_icrs.
XCoord().
Deg())*3600.0);
374 std::printf(
" Y-diff: %f arcsec\n", (icrs_coords.YCoord().Deg()-true_icrs.
YCoord().
Deg())*3600.0);
376 std::printf(
" AngSep ICRS: %e arcsec\n", icrs_coords.AngularSeparation(true_icrs).Deg()*3600.0);
382 if (!test(obs_coords == true_obs, func_name, __LINE__)) {
384 std::printf(
" %s %s", obs_coords.
print().c_str(), true_obs.
print().c_str());
385 std::printf(
" X-diff: %f arcsec\n", (obs_coords.
XCoord().
Deg()-true_obs.
XCoord().
Deg())*3600.0);
386 std::printf(
" Y-diff: %f arcsec\n", (obs_coords.
YCoord().
Deg()-true_obs.
YCoord().
Deg())*3600.0);
391 double tol_old = DblTol();
395 std::vector<double> test_pos =
test_planet.PositionICRS();
396 if (!test_vect(test_pos, true_pos, func_name, __LINE__)) {
398 for (
int i=0; i<test_pos.size(); i++) {
399 double offset = (test_pos[i]-true_pos[i]);
400 std::printf(
" test: %f AU | expected: %f AU (rel. diff: %e AU)\n",
401 test_pos[i], true_pos[i], offset/true_pos[i]);
402 dist += (offset * offset);
404 std::printf(
" Offset: %e AU\n", std::sqrt(dist));
408 std::vector<double> test_vel =
test_planet.VelocityICRS();
409 if (!test_vect(test_vel, true_vel, func_name, __LINE__)) {
411 for (
int i=0; i<test_vel.size(); i++) {
412 double offset = (test_vel[i]-true_vel[i]);
413 std::printf(
" test: %e AU/day | expected: %e AU/day (rel. diff: %e AU/day)\n",
414 test_vel[i], true_vel[i], offset/true_vel[i]);
415 dist += (offset * offset);
417 std::printf(
" Offset: %e AU/day\n", std::sqrt(dist));
450 int main(
int argc,
char** argv)