add Real::eps0_inv() convenience method

This commit is contained in:
2022-08-27 02:38:32 -07:00
parent 529ad943ac
commit deaaefc3e7

View File

@@ -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⋅m1
$wrap(8.854187812813e-12) // F/m
}
fn eps0_inv() -> Self {
$wrap(112940906737.1361) // m/F
}
fn twice_eps0() -> Self {
$wrap(1.7708375625626e-11) // F⋅m1
$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())
}