diff --git a/include/keplerian_toolbox/core_functions/convert_anomalies.hpp b/include/keplerian_toolbox/core_functions/convert_anomalies.hpp index 1694f315..4b398985 100644 --- a/include/keplerian_toolbox/core_functions/convert_anomalies.hpp +++ b/include/keplerian_toolbox/core_functions/convert_anomalies.hpp @@ -39,7 +39,7 @@ namespace kep_toolbox // mean to eccentric inline double m2e(const double &M, const double &e) { - double E = M + e * cos(M); + double E = M + e * sin(M); newton_raphson(E, boost::bind(kepE, _1, M, e), boost::bind(d_kepE, _1, e), 100, ASTRO_TOLERANCE); return (E); } diff --git a/include/keplerian_toolbox/sims_flanagan/leg.hpp b/include/keplerian_toolbox/sims_flanagan/leg.hpp index be937f09..84559b11 100644 --- a/include/keplerian_toolbox/sims_flanagan/leg.hpp +++ b/include/keplerian_toolbox/sims_flanagan/leg.hpp @@ -481,10 +481,10 @@ class KEP_TOOLBOX_DLL_PUBLIC leg for (decltype(n_seg_fwd) i = 0u; i < n_seg_fwd; ++i) { double thrust_duration = (throttles[i].get_end().mjd2000() - throttles[i].get_start().mjd2000()) * ASTRO_DAY2SEC; - double manouver_time + double maneuver_time = (throttles[i].get_start().mjd2000() + throttles[i].get_end().mjd2000()) / 2. * ASTRO_DAY2SEC; - propagate_lagrangian(rfwd, vfwd, manouver_time - current_time_fwd, m_mu); - current_time_fwd = manouver_time; + propagate_lagrangian(rfwd, vfwd, maneuver_time - current_time_fwd, m_mu); + current_time_fwd = maneuver_time; for (unsigned j = 0u; j < 3; j++) { dv[j] = max_thrust / mfwd * thrust_duration * throttles[i].get_value()[j]; @@ -508,12 +508,12 @@ class KEP_TOOLBOX_DLL_PUBLIC leg double thrust_duration = (throttles[throttles.size() - i - 1].get_end().mjd2000() - throttles[throttles.size() - i - 1].get_start().mjd2000()) * ASTRO_DAY2SEC; - double manouver_time = (throttles[throttles.size() - i - 1].get_start().mjd2000() + double maneuver_time = (throttles[throttles.size() - i - 1].get_start().mjd2000() + throttles[throttles.size() - i - 1].get_end().mjd2000()) / 2. * ASTRO_DAY2SEC; - // manouver_time - current_time_back is negative, so this should propagate backwards - propagate_lagrangian(rback, vback, manouver_time - current_time_back, m_mu); - current_time_back = manouver_time; + // maneuver_time - current_time_back is negative, so this should propagate backwards + propagate_lagrangian(rback, vback, maneuver_time - current_time_back, m_mu); + current_time_back = maneuver_time; for (int j = 0; j < 3; j++) { dv[j] = -max_thrust / mback * thrust_duration * throttles[throttles.size() - i - 1].get_value()[j];