use super::Velocity;
use crate::units::length::{AstronomicalUnit, LightYear, Meter};
pub(crate) const SPEED_OF_LIGHT_M_PER_S: f64 = 299_792_458.0;
use crate::units::time::{Day, JulianYear, Second};
use crate::Unit;
pub const C: Velocity<Meter, Second> = Velocity::<Meter, Second>::new(SPEED_OF_LIGHT_M_PER_S);
pub const AU_PER_DAY_C: Velocity<AstronomicalUnit, Day> =
Velocity::new(LightYear::RATIO / AstronomicalUnit::RATIO / (JulianYear::RATIO / Day::RATIO));
#[cfg(all(test, feature = "std"))]
mod tests {
use super::*;
use crate::units::length::{Au, Kilometer};
use crate::units::time::Second;
use approx::assert_relative_eq;
#[test]
fn au_per_day_to_km_per_s() {
let v: Velocity<Au, Day> = Velocity::new(1.0);
let v_kps: Velocity<Kilometer, Second> = v.to();
assert_relative_eq!(v_kps.value(), 1731.5, max_relative = 1e-3);
}
}