diff --git a/src/si/angular_momentum.rs b/src/si/angular_momentum.rs index 1282b708..72571728 100644 --- a/src/si/angular_momentum.rs +++ b/src/si/angular_momentum.rs @@ -15,50 +15,92 @@ quantity! { kind: dyn (crate::si::marker::AngleKind); units { /// Derived unit of angular velocity. - @kilogram_square_meter_per_second: prefix!(kilo) / prefix!(kilo); "kg · m²/s", "kilogram square meter per second", "kilogram square meters per second"; + @kilogram_square_meter_per_second: prefix!(kilo) / prefix!(kilo); "kg · m²/s", + "kilogram square meter per second", "kilogram square meters per second"; - @yottanewton_meter_second: prefix!(yotta); "YN · m · s", "yottanewton meter second", "yottanewton meter seconds"; - @zettanewton_meter_second: prefix!(zetta); "ZN · m · s", "zettanewton meter second", "zettanewton meter seconds"; - @exanewton_meter_second: prefix!(exa); "EN · m · s", "exanewton meter second", "exanewton meter seconds"; - @petanewton_meter_second: prefix!(peta); "PN · m · s", "petanewton meter second", "petanewton meter seconds"; - @teranewton_meter_second: prefix!(tera); "TN · m · s", "teranewton meter second", "teranewton meter seconds"; - @giganewton_meter_second: prefix!(giga); "GN · m · s", "giganewton meter second", "giganewton meter seconds"; - @meganewton_meter_second: prefix!(mega); "MN · m · s", "meganewton meter second", "meganewton meter seconds"; - @kilonewton_meter_second: prefix!(kilo); "kN · m · s", "kilonewton meter second", "kilonewton meter seconds"; - @hectonewton_meter_second: prefix!(hecto); "hN · m · s", "hectonewton meter second", "hectonewton meter seconds"; - @decanewton_meter_second: prefix!(deca); "daN · m · s", "decanewton meter second", "decanewton meter seconds"; - @newton_meter_second: prefix!(none); "N · m · s", "newton meter second", "newton meter seconds"; - @decinewton_meter_second: prefix!(deci); "dN · m · s", "decinewton meter second", "decinewton meter seconds"; - @centinewton_meter_second: prefix!(centi); "cN · m · s", "centinewton meter second", "centinewton meter seconds"; - @millinewton_meter_second: prefix!(milli); "mN · m · s", "millinewton meter second", "millinewton meter seconds"; - @micronewton_meter_second: prefix!(micro); "µN · m · s", "micronewton meter second", "micronewton meter seconds"; - @nanonewton_meter_second: prefix!(nano); "nN · m · s", "nanonewton meter second", "nanonewton meter seconds"; - @piconewton_meter_second: prefix!(pico); "pN · m · s", "piconewton meter second", "piconewton meter seconds"; - @femtonewton_meter_second: prefix!(femto); "fN · m · s", "femtonewton meter second", "femtonewton meter seconds"; - @attonewton_meter_second: prefix!(atto); "aN · m · s", "attonewton meter second", "attonewton meter seconds"; - @zeptonewton_meter_second: prefix!(zepto); "zN · m · s", "zeptonewton meter second", "zeptonewton meter seconds"; - @yoctonewton_meter_second: prefix!(yocto); "yN · m · s", "yoctonewton meter second", "yoctonewton meter seconds"; + @yottanewton_meter_second: prefix!(yotta); "YN · m · s", "yottanewton meter second", + "yottanewton meter seconds"; + @zettanewton_meter_second: prefix!(zetta); "ZN · m · s", "zettanewton meter second", + "zettanewton meter seconds"; + @exanewton_meter_second: prefix!(exa); "EN · m · s", "exanewton meter second", + "exanewton meter seconds"; + @petanewton_meter_second: prefix!(peta); "PN · m · s", "petanewton meter second", + "petanewton meter seconds"; + @teranewton_meter_second: prefix!(tera); "TN · m · s", "teranewton meter second", + "teranewton meter seconds"; + @giganewton_meter_second: prefix!(giga); "GN · m · s", "giganewton meter second", + "giganewton meter seconds"; + @meganewton_meter_second: prefix!(mega); "MN · m · s", "meganewton meter second", + "meganewton meter seconds"; + @kilonewton_meter_second: prefix!(kilo); "kN · m · s", "kilonewton meter second", + "kilonewton meter seconds"; + @hectonewton_meter_second: prefix!(hecto); "hN · m · s", "hectonewton meter second", + "hectonewton meter seconds"; + @decanewton_meter_second: prefix!(deca); "daN · m · s", "decanewton meter second", + "decanewton meter seconds"; + @newton_meter_second: prefix!(none); "N · m · s", "newton meter second", + "newton meter seconds"; + @decinewton_meter_second: prefix!(deci); "dN · m · s", "decinewton meter second", + "decinewton meter seconds"; + @centinewton_meter_second: prefix!(centi); "cN · m · s", "centinewton meter second", + "centinewton meter seconds"; + @millinewton_meter_second: prefix!(milli); "mN · m · s", "millinewton meter second", + "millinewton meter seconds"; + @micronewton_meter_second: prefix!(micro); "µN · m · s", "micronewton meter second", + "micronewton meter seconds"; + @nanonewton_meter_second: prefix!(nano); "nN · m · s", "nanonewton meter second", + "nanonewton meter seconds"; + @piconewton_meter_second: prefix!(pico); "pN · m · s", "piconewton meter second", + "piconewton meter seconds"; + @femtonewton_meter_second: prefix!(femto); "fN · m · s", "femtonewton meter second", + "femtonewton meter seconds"; + @attonewton_meter_second: prefix!(atto); "aN · m · s", "attonewton meter second", + "attonewton meter seconds"; + @zeptonewton_meter_second: prefix!(zepto); "zN · m · s", "zeptonewton meter second", + "zeptonewton meter seconds"; + @yoctonewton_meter_second: prefix!(yocto); "yN · m · s", "yoctonewton meter second", + "yoctonewton meter seconds"; - @newton_yottameter_second: prefix!(yotta); "N · Ym · s", "newton yottameter second second", "newton yottameter second seconds"; - @newton_zettameter_second: prefix!(zetta); "N · Zm · s", "newton zettameter second", "newton zettameter seconds"; - @newton_exameter_second: prefix!(exa); "N · Em · s", "newton exameter second", "newton exameter seconds"; - @newton_petameter_second: prefix!(peta); "N · Pm · s", "newton petameter second", "newton petameter seconds"; - @newton_terameter_second: prefix!(tera); "N · Tm · s", "newton terameter second", "newton terameter seconds"; - @newton_gigameter_second: prefix!(giga); "N · Gm · s", "newton gigameter second", "newton gigameter seconds"; - @newton_megameter_second: prefix!(mega); "N · Mm · s", "newton megameter second", "newton megameter seconds"; - @newton_kilometer_second: prefix!(kilo); "N · km · s", "newton kilometer second", "newton kilometer seconds"; - @newton_hectometer_second: prefix!(hecto); "N · hm · s", "newton hectometer second", "newton hectometer seconds"; - @newton_decameter_second: prefix!(deca); "N · dam · s", "newton decameter second", "newton decameter seconds"; - @newton_decimeter_second: prefix!(deci); "N · dm · s", "newton decimeter second", "newton decimeter seconds"; - @newton_centimeter_second: prefix!(centi); "N · cm · s", "newton centimeter second", "newton centimeter seconds"; - @newton_millimeter_second: prefix!(milli); "N · mm · s", "newton millimeter second", "newton millimeter seconds"; - @newton_micrometer_second: prefix!(micro); "N · µm · s", "newton micrometer second", "newton micrometer seconds"; - @newton_nanometer_second: prefix!(nano); "N · nm · s", "newton nanometer second", "newton nanometer seconds"; - @newton_picometer_second: prefix!(pico); "N · pm · s", "newton picometer second", "newton picometer seconds"; - @newton_femtometer_second: prefix!(femto); "N · fm · s", "newton femtometer second", "newton femtometer seconds"; - @newton_attometer_second: prefix!(atto); "N · am · s", "newton attometer second", "newton attometer seconds"; - @newton_zeptometer_second: prefix!(zepto); "N · zm · s", "newton zeptometer second", "newton zeptometer seconds"; - @newton_yoctometer_second: prefix!(yocto); "N · ym · s", "newton yoctometer second", "newton yoctometer seconds"; + @newton_yottameter_second: prefix!(yotta); "N · Ym · s", "newton yottameter second", + "newton yottameter seconds"; + @newton_zettameter_second: prefix!(zetta); "N · Zm · s", "newton zettameter second", + "newton zettameter seconds"; + @newton_exameter_second: prefix!(exa); "N · Em · s", "newton exameter second", + "newton exameter seconds"; + @newton_petameter_second: prefix!(peta); "N · Pm · s", "newton petameter second", + "newton petameter seconds"; + @newton_terameter_second: prefix!(tera); "N · Tm · s", "newton terameter second", + "newton terameter seconds"; + @newton_gigameter_second: prefix!(giga); "N · Gm · s", "newton gigameter second", + "newton gigameter seconds"; + @newton_megameter_second: prefix!(mega); "N · Mm · s", "newton megameter second", + "newton megameter seconds"; + @newton_kilometer_second: prefix!(kilo); "N · km · s", "newton kilometer second", + "newton kilometer seconds"; + @newton_hectometer_second: prefix!(hecto); "N · hm · s", "newton hectometer second", + "newton hectometer seconds"; + @newton_decameter_second: prefix!(deca); "N · dam · s", "newton decameter second", + "newton decameter seconds"; + @newton_decimeter_second: prefix!(deci); "N · dm · s", "newton decimeter second", + "newton decimeter seconds"; + @newton_centimeter_second: prefix!(centi); "N · cm · s", "newton centimeter second", + "newton centimeter seconds"; + @newton_millimeter_second: prefix!(milli); "N · mm · s", "newton millimeter second", + "newton millimeter seconds"; + @newton_micrometer_second: prefix!(micro); "N · µm · s", "newton micrometer second", + "newton micrometer seconds"; + @newton_nanometer_second: prefix!(nano); "N · nm · s", "newton nanometer second", + "newton nanometer seconds"; + @newton_picometer_second: prefix!(pico); "N · pm · s", "newton picometer second", + "newton picometer seconds"; + @newton_femtometer_second: prefix!(femto); "N · fm · s", "newton femtometer second", + "newton femtometer seconds"; + @newton_attometer_second: prefix!(atto); "N · am · s", "newton attometer second", + "newton attometer seconds"; + @newton_zeptometer_second: prefix!(zepto); "N · zm · s", "newton zeptometer second", + "newton zeptometer seconds"; + @newton_yoctometer_second: prefix!(yocto); "N · ym · s", "newton yoctometer second", + "newton yoctometer seconds"; } } @@ -88,14 +130,22 @@ mod tests { } #[test] - fn check_units() { - Test::assert_approx_eq( - &AngularMomentum::new::(V::one()), - &(Mass::new::(V::one()) * Area::new::(V::one()) - / Time::new::(V::one())) - .into(), - ); + fn check_units_mass_area() { + test::(); + fn test, A: a::Conversion, AM: am::Conversion>() { + Test::assert_approx_eq( + &AngularMomentum::new::(V::one()), + &(Mass::new::(V::one()) + * Area::new::(V::one()) + / Time::new::(V::one())) + .into(), + ); + } + } + + #[test] + fn check_units_force_length() { test::(); test::(); test::(); @@ -139,9 +189,9 @@ mod tests { test::(); test::(); - fn test, L: l::Conversion, A: am::Conversion>() { + fn test, L: l::Conversion, AM: am::Conversion>() { Test::assert_approx_eq( - &AngularMomentum::new::(V::one()), + &AngularMomentum::new::(V::one()), &(Force::new::(V::one()) * Length::new::(V::one()) * Time::new::(V::one()))