Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Similarly always do at least one iteration in ephemeris EA calc.

  • Loading branch information...
commit d88b1f3cb0ac2639a6627664fea8ecd3637b2bd7 1 parent d5c464d
@fnoble authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/ephemeris.c
View
6 src/ephemeris.c
@@ -81,14 +81,12 @@ int calc_sat_pos(double pos[3], double vel[3],
// Iteratively solve for the Eccentric Anomaly (from Keith Alter and David Johnston)
ea = ma; // Starting value for E
- ea_old = ea + 1;
- while (fabs (ea - ea_old) > 1.0E-14)
- {
+ do {
ea_old = ea;
tempd1 = 1.0 - ephemeris->ecc * cos (ea_old);
ea = ea + (ma - ea_old + ephemeris->ecc * sin (ea_old)) / tempd1;
- }
+ } while (fabs (ea - ea_old) > 1.0E-14);
ea_dot = ma_dot / tempd1;
// Relativistic correction term
Please sign in to comment.
Something went wrong with that request. Please try again.