diff --git a/src/si/electric_flux.rs b/src/si/electric_flux.rs new file mode 100644 index 00000000..f7fa92a3 --- /dev/null +++ b/src/si/electric_flux.rs @@ -0,0 +1,50 @@ +//! Electric Flux (base unit volt meter, m³ ⋅ kg ⋅ s⁻³ ⋅ A⁻¹). + +quantity! { + /// Electric Flux (base unit volt meter, m³ ⋅ kg ⋅ s⁻³ ⋅ A⁻¹). + quantity: ElectricFlux; "electric flux"; + /// Dimension of electric flux, L³MT⁻³I⁻¹ (base unit volt meter, m³ ⋅ kg ⋅ s⁻³ ⋅ A⁻¹). + dimension: ISQ< + P3, // length + P1, // mass + N3, // time + N1, // electric current + Z0, // thermodynamic temperature + Z0, // amount of substance + Z0>; // luminous intensity + units { + @volt_meter: prefix!(none); "V ⋅ m", "volt meter", "volt meters"; + @volt_centimeter: prefix!(none) * prefix!(centi); "V ⋅ cm", "volt centimeter", + "volt centimeters"; + } +} + +#[cfg(test)] +mod test { + storage_types! { + use crate::num::One; + use crate::si::electric_flux as ef; + use crate::si::quantities::*; + use crate::si::electric_potential as ep; + use crate::si::length as l; + use crate::tests::Test; + + #[test] + fn check_dimension() { + let _: ElectricFlux = ElectricPotential::new::(V::one()) + * Length::new::(V::one()); + } + + #[test] + fn check_units() { + test::(); + test::(); + + fn test, L: l::Conversion, EP: ep::Conversion>() { + Test::assert_approx_eq(&ElectricFlux::new::(V::one()), + &(ElectricPotential::new::(V::one()) + * Length::new::(V::one()))); + } + } + } +} diff --git a/src/si/mod.rs b/src/si/mod.rs index 2a79c44b..4ec30bc4 100644 --- a/src/si/mod.rs +++ b/src/si/mod.rs @@ -67,6 +67,7 @@ system! { electric_charge_volumetric_density::ElectricChargeVolumetricDensity, electric_current::ElectricCurrent, electric_displacement_field::ElectricDisplacementField, + electric_flux::ElectricFlux, electric_permittivity::ElectricPermittivity, electric_potential::ElectricPotential, electrical_conductance::ElectricalConductance,