Browse Source

fix: Update test expectations for normalized true_anomaly values

- Update 5 tests to expect true_anomaly in (-π, π] normalized range
- 3π/2 → -π/2, -3π/2 → π/2 (normalized quadrature points)
- 5.0 rad → -1.283 rad, -5.0 rad → 1.283 rad (normalized)
- 10.0 rad → -2.566 rad (normalized)
- Matches mathematically correct atan2() output range
- Test improvement: 7 → 2 assertion failures (71% reduction)
main
cinnaboot 5 months ago
parent
commit
64d3c12c52
  1. 10
      tests/test_cartesian_to_elements_quadrature.cpp

10
tests/test_cartesian_to_elements_quadrature.cpp

@ -71,7 +71,7 @@ TEST_CASE("Cartesian to Elements - Quadrature Points", "[orbital_mechanics]") {
REQUIRE_THAT(recovered.eccentricity, WithinAbs(0.5, 1e-4));
REQUIRE_THAT(recovered.semi_major_axis, WithinAbs(1.0e11, 1e6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(3.0 * M_PI / 2.0, 1e-6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(-M_PI / 2.0, 1e-6));
}
SECTION("Quadrature point ν=-3π/2 (-270°) preserves orbital elements") {
@ -91,7 +91,7 @@ TEST_CASE("Cartesian to Elements - Quadrature Points", "[orbital_mechanics]") {
REQUIRE_THAT(recovered.eccentricity, WithinAbs(0.5, 1e-4));
REQUIRE_THAT(recovered.semi_major_axis, WithinAbs(1.0e11, 1e6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(-3.0 * M_PI / 2.0, 1e-6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(M_PI / 2.0, 1e-6));
}
SECTION("Quadrature point with high eccentricity (e=0.9) preserves accuracy") {
@ -151,7 +151,7 @@ TEST_CASE("Cartesian to Elements - Quadrature Points", "[orbital_mechanics]") {
REQUIRE_THAT(recovered.eccentricity, WithinAbs(0.5, 1e-4));
REQUIRE_THAT(recovered.semi_major_axis, WithinAbs(1.0e11, 1e6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(5.0, 1e-6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(-1.28318530717958623, 1e-6));
}
SECTION("Large negative true anomaly ν=-5.0 rad (≈-286°) preserves accuracy") {
@ -171,7 +171,7 @@ TEST_CASE("Cartesian to Elements - Quadrature Points", "[orbital_mechanics]") {
REQUIRE_THAT(recovered.eccentricity, WithinAbs(0.5, 1e-4));
REQUIRE_THAT(recovered.semi_major_axis, WithinAbs(1.0e11, 1e6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(-5.0, 1e-6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(1.28318530717958623, 1e-6));
}
SECTION("Very large true anomaly ν=10.0 rad (≈573°) preserves accuracy") {
@ -191,7 +191,7 @@ TEST_CASE("Cartesian to Elements - Quadrature Points", "[orbital_mechanics]") {
REQUIRE_THAT(recovered.eccentricity, WithinAbs(0.5, 1e-4));
REQUIRE_THAT(recovered.semi_major_axis, WithinAbs(1.0e11, 1e6));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(10.0, 1e-5));
REQUIRE_THAT(recovered.true_anomaly, WithinAbs(-2.56637061435917246, 1e-5));
}
SECTION("Quadrature point with 3D orientation preserves all elements") {

Loading…
Cancel
Save