|
| 1 | +//! Magnetic permeability (base unit henry per meter, m · kg · s⁻² · A⁻²). |
| 2 | +
|
| 3 | +quantity! { |
| 4 | + /// Magnetic permeability (base unit henry per meter, m · kg · s⁻² · A⁻²). |
| 5 | + quantity: MagneticPermeability; "magnetic permeability"; |
| 6 | + /// Dimension of magnetic permeability, LMT⁻²I⁻² (base unit henry per meter, |
| 7 | + /// m · kg · s⁻² · A⁻²). |
| 8 | + dimension: ISQ< |
| 9 | + P1, // length |
| 10 | + P1, // mass |
| 11 | + N2, // time |
| 12 | + N2, // electric current |
| 13 | + Z0, // thermodynamic temperature |
| 14 | + Z0, // amount of substance |
| 15 | + Z0>; // luminous intensity |
| 16 | + units { |
| 17 | + @henry_per_meter: prefix!(none); "H/m", "henry per meter", "henrys per meter"; |
| 18 | + @vacuum_magnetic_permeability: 1.256_637_062_12_E-6; "µ₀", "vacuum magnetic permeability", |
| 19 | + "vacuum magnetic permeability"; |
| 20 | + } |
| 21 | +} |
| 22 | + |
| 23 | +#[cfg(test)] |
| 24 | +mod test { |
| 25 | + storage_types! { |
| 26 | + use crate::num::One; |
| 27 | + use crate::si::inductance as ind; |
| 28 | + use crate::si::magnetic_permeability as mp; |
| 29 | + use crate::si::length as l; |
| 30 | + use crate::si::quantities::*; |
| 31 | + use crate::tests::Test; |
| 32 | + |
| 33 | + #[test] |
| 34 | + fn check_dimension() { |
| 35 | + let _: MagneticPermeability<V> = Inductance::new::<ind::henry>(V::one()) |
| 36 | + / Length::new::<l::meter>(V::one()); |
| 37 | + } |
| 38 | + |
| 39 | + #[test] |
| 40 | + fn check_units() { |
| 41 | + test::<mp::henry_per_meter, ind::henry, l::meter>(); |
| 42 | + |
| 43 | + fn test<MP: mp::Conversion<V>, IND: ind::Conversion<V>, L: l::Conversion<V>>() { |
| 44 | + Test::assert_approx_eq(&MagneticPermeability::new::<MP>(V::one()), |
| 45 | + &(Inductance::new::<IND>(V::one()) |
| 46 | + / Length::new::<L>(V::one()))); |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments