add Real::eps0_inv()
convenience method
This commit is contained in:
@@ -140,6 +140,7 @@ pub trait Real:
|
||||
fn c() -> Self;
|
||||
/// Vaccum Permittivity
|
||||
fn eps0() -> Self;
|
||||
fn eps0_inv() -> Self;
|
||||
fn twice_eps0() -> Self;
|
||||
/// Vacuum Permeability
|
||||
fn mu0() -> Self;
|
||||
@@ -190,10 +191,13 @@ macro_rules! decl_consts {
|
||||
}
|
||||
/// Vaccum Permittivity
|
||||
fn eps0() -> Self {
|
||||
$wrap(8.854187812813e-12) // F⋅m−1
|
||||
$wrap(8.854187812813e-12) // F/m
|
||||
}
|
||||
fn eps0_inv() -> Self {
|
||||
$wrap(112940906737.1361) // m/F
|
||||
}
|
||||
fn twice_eps0() -> Self {
|
||||
$wrap(1.7708375625626e-11) // F⋅m−1
|
||||
$wrap(1.7708375625626e-11) // F/m
|
||||
}
|
||||
/// Vacuum Permeability
|
||||
fn mu0() -> Self {
|
||||
@@ -500,6 +504,9 @@ impl<T: Real> Real for Finite<T> {
|
||||
fn eps0() -> Self {
|
||||
Self::from_primitive(T::eps0())
|
||||
}
|
||||
fn eps0_inv() -> Self {
|
||||
Self::from_primitive(T::eps0_inv())
|
||||
}
|
||||
fn twice_eps0() -> Self {
|
||||
Self::from_primitive(T::twice_eps0())
|
||||
}
|
||||
|
Reference in New Issue
Block a user