From ec064a28d6485584e43badb348f8cc1a53248eba Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Wed, 4 Feb 2026 10:50:14 -0500 Subject: [PATCH] Remove unused solve_kepler_hyperbolic_with_prev() function - Function was never called anywhere in the codebase - Functionality now handled by propagate_orbital_elements() with proper Newton-Raphson iteration - Removes dead code and simplifies the API --- src/orbital_mechanics.cpp | 18 ------------------ src/orbital_mechanics.h | 1 - 2 files changed, 19 deletions(-) diff --git a/src/orbital_mechanics.cpp b/src/orbital_mechanics.cpp index 41280ed..5258eec 100644 --- a/src/orbital_mechanics.cpp +++ b/src/orbital_mechanics.cpp @@ -88,24 +88,6 @@ double solve_kepler_hyperbolic(double mean_anomaly, double eccentricity) { return H; } -double solve_kepler_hyperbolic_with_prev(double mean_anomaly, double eccentricity, double H_prev_guess) { - // Solve hyperbolic Kepler equation with a hint from previous H value - double H = H_prev_guess; - - double H_iter = H + 2.0 * KEPLER_TOLERANCE; - int iterations = 0; - - while (fabs(H - H_iter) > KEPLER_TOLERANCE && iterations < KEPLER_MAX_ITERATIONS) { - H_iter = H; - double sinh_H = sinh(H); - double cosh_H = cosh(H); - H = H - (H - eccentricity * sinh_H - mean_anomaly) / (1.0 - eccentricity * cosh(H)); - iterations++; - } - - return H; -} - double eccentric_to_true_anomaly(double eccentric_anomaly, double eccentricity) { if (fabs(1.0 - eccentricity) < 0.01) { // Near-parabolic: use cos/sin formulation to avoid numeric instability diff --git a/src/orbital_mechanics.h b/src/orbital_mechanics.h index 4405c63..fb191ce 100644 --- a/src/orbital_mechanics.h +++ b/src/orbital_mechanics.h @@ -30,7 +30,6 @@ double solve_kepler_elliptical(double mean_anomaly, double eccentricity); // Hyperbolic Kepler equation solver: H - e·sinh(H) = M double solve_kepler_hyperbolic(double mean_anomaly, double eccentricity); -double solve_kepler_hyperbolic_with_prev(double mean_anomaly, double eccentricity, double H_prev_guess); // Conversions between anomaly types double eccentric_to_true_anomaly(double eccentric_anomaly, double eccentricity);