diff --git a/tests/test_extreme_eccentricity.cpp b/tests/test_extreme_eccentricity.cpp index 159a257..c505b5e 100644 --- a/tests/test_extreme_eccentricity.cpp +++ b/tests/test_extreme_eccentricity.cpp @@ -158,6 +158,17 @@ TEST_CASE("Velocity magnitude accuracy for extreme eccentricities", "[extreme][e for (int j = 0; j < 4; j++) { double nu = true_anomalies[j]; + + // For hyperbolic orbits (e > 1), skip invalid true anomalies + // Valid range: |ν| < arccos(-1/e) + if (craft->orbit.eccentricity > 1.0) { + double max_nu = acos(-1.0 / craft->orbit.eccentricity); + if (fabs(nu) >= max_nu) { + INFO(" ν=" << nu << " rad: skipped (exceeds hyperbolic limit ±" << max_nu << " rad)"); + continue; + } + } + craft->orbit.true_anomaly = nu; Vec3 pos; diff --git a/tests/test_extreme_eccentricity.toml b/tests/test_extreme_eccentricity.toml index e2c14ec..cf2de16 100644 --- a/tests/test_extreme_eccentricity.toml +++ b/tests/test_extreme_eccentricity.toml @@ -31,8 +31,8 @@ name = "Near_Parabolic" mass = 1000.0 parent_index = 0 orbit = { - semi_major_axis = 1.0e9, - eccentricity = 0.95, + semi_major_axis = 7.0e8, + eccentricity = 0.99, true_anomaly = 0.0, inclination = 0.0, longitude_of_ascending_node = 0.0, @@ -44,8 +44,8 @@ name = "Slightly_Hyperbolic" mass = 1000.0 parent_index = 0 orbit = { - semi_major_axis = -1.0e7, - eccentricity = 1.5, + semi_major_axis = -1.3e8, + eccentricity = 1.05, true_anomaly = 0.0, inclination = 0.0, longitude_of_ascending_node = 0.0,