keplerjs
Version:
Kepler solver to compute a celestial body position over the surface of the earth.
31 lines (24 loc) • 471 B
JavaScript
/**
* Astrodynamics | Kepler Solver
* Author: Edgar Gago Carrillo
* Date 16/03/2021
*
* Description
* Computation of the true anomally
*
* Inputs
* ibt: orbital elements {}
* E: eccentric anomaly [rad]
*
* Ouputs
* theta: true anomaly [rad]
*
*/
exports.trueanom = (obt, E) => {
const e = obt.e;
let c1 = (1 - e) / (1 + e);
c1 = Math.sqrt(c1);
let c2 = Math.tan(E / 2);
let theta = 2 * Math.atan(c2 / c1);
return theta;
}