10 double factorial(
unsigned n)
13 for(
unsigned i=2; i<=n; ++i) result*=i;
43 return (deriv_order%2 ? 1 : -1) * m1 * m2 * factorial(deriv_order)
45 (2.0 * std::pow(semimajor, static_cast<int>(deriv_order + 1)))
62 semimajor*(1.0 - std::pow(eccentricity, 2)) / (m1 + m2)
double orbital_angular_velocity(double m1, double m2, double semimajor, bool deriv)
Returns the orbital angular velocity of the given orbit in rad/day.
double orbital_energy(double m1, double m2, double semimajor, unsigned deriv_order)
The energy of the orbit (assuming 0 gravitational potential at infinity) in .
LIB_PUBLIC double semimajor_from_period(double m1, double m2, double period)
Return the semiamjor axis in solar radii required to have the given masses orbit with the given perio...
const double solar_radius
Radius of the sun [m].
double orbital_angular_momentum(double m1, double m2, double semimajor, double eccentricity)
The angular momentum of the orbit in .
A collection of functions which calculate various quantities for two body orbits. ...
const double solar_mass
Mass of the sun [kg].
const double G
Gravitational constant in SI.