uom/si/
angular_jerk.rs

1//! Angular jerk (base unit radian per second cubed, s⁻³).
2
3quantity! {
4    /// Angular jerk (base unit radian per second cubed, s⁻³).
5    quantity: AngularJerk; "angular jerk";
6    /// Dimension of angular jerk, T⁻³ (base unit radian per second cubed, s⁻³).
7    dimension: ISQ<
8        Z0,     // length
9        Z0,     // mass
10        N3,     // time
11        Z0,     // electric current
12        Z0,     // thermodynamic temperature
13        Z0,     // amount of substance
14        Z0>;    // luminous intensity
15    kind: dyn (crate::si::marker::AngleKind);
16    units {
17        /// Derived unit of angular jerk.
18        @radian_per_second_cubed: 1.0; "rad/s³", "radian per second cubed",
19            "radians per second cubed";
20        @degree_per_second_cubed: 1.745_329_251_994_329_5_E-2; "°/s³",
21            "degree per second cubed", "degrees per second cubed";
22    }
23}
24
25#[cfg(test)]
26mod tests {
27    storage_types! {
28        use crate::num::One;
29        use crate::si::angle as a;
30        use crate::si::angular_jerk as aj;
31        use crate::si::quantities::*;
32        use crate::si::time as t;
33        use crate::tests::Test;
34
35        #[test]
36        fn check_units() {
37            test::<a::radian, t::second, aj::radian_per_second_cubed>();
38            test::<a::degree, t::second, aj::degree_per_second_cubed>();
39
40            fn test<A: a::Conversion<V>, T: t::Conversion<V>, R: aj::Conversion<V>>() {
41                let cubic_second = Time::new::<T>(V::one()) *
42                                   Time::new::<T>(V::one()) *
43                                   Time::new::<T>(V::one());
44
45                Test::assert_approx_eq(&AngularJerk::new::<R>(V::one()),
46                    &(Angle::new::<A>(V::one()) / cubic_second).into());
47            }
48        }
49    }
50}