Hi, I have a question regarding the function c_rv_from_elements in twobody.c. The function is defined as follows:
void c_rv_from_elements(double *t, double *rv, int N_t, double P, double K, double e, double omega, double M0, double t0, double tol, int maxiter) { /* Compute the RV of the primary w.r.t. the system barycenter */ double M, E, f; for (int n=0; n < N_t; n++) { M = 2 * M_PI * (t[n] - t0) / P - M0; E = c_eccentric_anomaly_from_mean_anomaly_Newton1(M, e, tol, maxiter); f = c_true_anomaly_from_eccentric_anomaly(E, e); rv[n] = K * (cos(omega + f) + e * cos(omega)); } }
Could you please explain why the formula M =2𝜋/P *(t-t0) -M0 is used instead of M =2𝜋/P *(t-t0) +M0 ?
Thank you very much for your help!
Hi, I have a question regarding the function c_rv_from_elements in twobody.c. The function is defined as follows:
void c_rv_from_elements(double *t, double *rv, int N_t, double P, double K, double e, double omega, double M0, double t0, double tol, int maxiter) { /* Compute the RV of the primary w.r.t. the system barycenter */ double M, E, f; for (int n=0; n < N_t; n++) { M = 2 * M_PI * (t[n] - t0) / P - M0; E = c_eccentric_anomaly_from_mean_anomaly_Newton1(M, e, tol, maxiter); f = c_true_anomaly_from_eccentric_anomaly(E, e); rv[n] = K * (cos(omega + f) + e * cos(omega)); } }Could you please explain why the formula M =2𝜋/P *(t-t0) -M0 is used instead of M =2𝜋/P *(t-t0) +M0 ?
Thank you very much for your help!