20 #ifndef ANTKEEPER_PHYSICS_ORBIT_ELEMENTS_HPP
21 #define ANTKEEPER_PHYSICS_ORBIT_ELEMENTS_HPP
132 return math::two_pi<T> *
std::sqrt((a * a * a) / gm);
144 return math::two_pi<T> / t;
168 return a * (T(1) - ec * ec);
vector< T, N > sqrt(const vector< T, N > &x)
Takes the square root of each element.
T period(T a, T gm)
Calculates the period of an elliptical orbit according to Kepler's third law.
T semilatus_rectum(T a, T ec)
Derives the semi-latus rectum (l) of an orbit, given the semimajor axis (a) and eccentricity (e).
T argument_periapsis(T om, T lp)
Derives the argument of the periapsis (omega) of an orbit, given the longitude of periapsis (pomega) ...
T semiminor_axis(T a, T ec)
Derives the semiminor axis (b) of an orbit, given the semimajor axis (a) and eccentricity (e).
T longitude_periapsis(T om, T w)
Derives the longitude of the periapsis (pomega) of an orbit, given the argument of periapsis (omega) ...
T mean_motion(T a, T gm)
Calculates the mean motion (n) of an orbit.
Set of six Keplerian elements required to uniquely identify an orbit.
scalar_type ec
Eccentricity (e).
scalar_type ma
Mean anomaly (M) at epoch, in radians.
scalar_type a
Semimajor axis (a).
T scalar_type
Scalar type.
scalar_type om
Right ascension of the ascending node (OMEGA), in radians.
scalar_type w
Argument of periapsis (omega), in radians.
scalar_type in
Inclination (i), in radians.