Browse Source

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
main
cinnaboot 5 months ago
parent
commit
ec064a28d6
  1. 18
      src/orbital_mechanics.cpp
  2. 1
      src/orbital_mechanics.h

18
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

1
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);

Loading…
Cancel
Save