//! WGS-84 / SGP4 orbital constants.
//!
//! All values from Vallado, Crawford, Hujsak, Kelso (2006),
//! "Revisiting Spacetrack Report Number 3."

use core::f64::consts::PI;

/// Earth equatorial radius in kilometers.
pub const EARTH_RADIUS_KM: f64 = 6378.135;

/// Gravitational parameter `ke` in (earth-radii^{3/2}) / min.
/// ke = sqrt(GM) where GM = 398600.8 km^3/s^2, converted to earth-radii and minutes.
pub const KE: f64 = 0.074_366_916_133_173_55;

/// Un-normalized second zonal harmonic (J2).
pub const J2: f64 = 1.082_616e-3;

/// Un-normalized third zonal harmonic (J3).
pub const J3: f64 = -2.53881e-6;

/// Un-normalized fourth zonal harmonic (J4).
pub const J4: f64 = -1.65597e-6;

/// `k2 = 0.5 * J2 * ae^2` where `ae = 1.0` (earth radii).
pub const K2: f64 = 5.413_08e-4;

/// `k4 = -0.375 * J4 * ae^4`.
pub const K4: f64 = 0.621_987_5e-6;

/// `a30 = -J3 * ae^3`.
pub const A30: f64 = 2.538_81e-6;

/// `qo` parameter: `(qo - so)^4` where `qo = 120 km + ae` in earth radii.
pub const QO: f64 = 120.0 / EARTH_RADIUS_KM + 1.0;

/// `so` parameter: reference atmospheric density altitude in earth radii.
pub const SO: f64 = 78.0 / EARTH_RADIUS_KM + 1.0;

/// `(qo - so)^4` precomputed.
pub const QOMS2T: f64 = 1.880_279_159_015_27e-9;

/// Minutes per day.
pub const MINUTES_PER_DAY: f64 = 1440.0;

/// Two pi.
pub const TWO_PI: f64 = 2.0 * PI;

/// Radians per revolution.
pub const RADS_PER_REV: f64 = TWO_PI;

/// Two-thirds.
pub const TWO_THIRDS: f64 = 2.0 / 3.0;

/// x2o3 = 2/3.
pub const X2O3: f64 = TWO_THIRDS;
