cross: add Real::c_inv()
This commit is contained in:
@@ -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())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user