cross: add Real::c_inv()

This commit is contained in:
2022-08-28 02:00:18 -07:00
parent 19f08fce9f
commit 5dc619ebc9

View File

@@ -138,6 +138,7 @@ pub trait Real:
/// Speed of light in a vacuum; m/s. /// Speed of light in a vacuum; m/s.
/// Also equal to 1/sqrt(epsilon_0 mu_0) /// Also equal to 1/sqrt(epsilon_0 mu_0)
fn c() -> Self; fn c() -> Self;
fn c_inv() -> Self;
/// Vaccum Permittivity /// Vaccum Permittivity
fn eps0() -> Self; fn eps0() -> Self;
fn eps0_inv() -> Self; fn eps0_inv() -> Self;
@@ -189,6 +190,9 @@ macro_rules! decl_consts {
fn c() -> Self { fn c() -> Self {
$wrap(299792458.0) $wrap(299792458.0)
} }
fn c_inv() -> Self {
$wrap(3.3356409519815204e-09)
}
/// Vaccum Permittivity /// Vaccum Permittivity
fn eps0() -> Self { fn eps0() -> Self {
$wrap(8.854187812813e-12) // F/m $wrap(8.854187812813e-12) // F/m
@@ -501,6 +505,9 @@ impl<T: Real> Real for Finite<T> {
fn c() -> Self { fn c() -> Self {
Self::from_primitive(T::c()) Self::from_primitive(T::c())
} }
fn c_inv() -> Self {
Self::from_primitive(T::c_inv())
}
fn eps0() -> Self { fn eps0() -> Self {
Self::from_primitive(T::eps0()) Self::from_primitive(T::eps0())
} }