Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added AngularAcceleration #136

Closed
wants to merge 1 commit into from
Closed

added AngularAcceleration #136

wants to merge 1 commit into from

Conversation

dunmatt
Copy link

@dunmatt dunmatt commented May 10, 2019

No description provided.

@iliekturtles
Copy link
Owner

  • Essentially same review as angular velocity. Squash commits / change message to be in imperative: "Add AngularAcceleration."
  • Changes in diff below. Removal of first assert_eq recommended but not required.
diff --git a/src/si/angular_acceleration.rs b/src/si/angular_acceleration.rs
index a953fe7..47dbd95 100644
--- a/src/si/angular_acceleration.rs
+++ b/src/si/angular_acceleration.rs
@@ -1,9 +1,9 @@
-//! Angular Acceleration (base unit radian per second squared, s⁻²).
+//! Angular acceleration (base unit radian per second squared, s⁻²).

 quantity! {
     /// Angular acceleration (base unit radian per second squared, s⁻²).
     quantity: AngularAcceleration; "angular acceleration";
-    /// Dimension of angular acceleration (base unit radian per second squared, s⁻²).
+    /// Dimension of angular acceleration, T⁻² (base unit radian per second squared, s⁻²).
     dimension: ISQ<
         Z0,     // length
         Z0,     // mass
@@ -26,8 +26,7 @@ quantity! {
 mod tests {
     storage_types! {
         use ::lib::f64::consts::PI;
-        use num::One;
-        use num_traits::FromPrimitive;
+        use num::{FromPrimitive, One};
         use si::angle as a;
         use si::angular_acceleration as aa;
         use si::quantities::*;
@@ -36,20 +35,12 @@ mod tests {

         #[test]
         fn check_units() {
-            Test::assert_eq(
-                &AngularAcceleration::new::<aa::radian_per_second_squared>(
-                    V::from_f64(2.0 * PI).unwrap()
-                ),
-                &AngularAcceleration::new::<aa::degree_per_second_squared>(
-                    V::from_f64(360.0).unwrap()
-                )
-            );
-
             test::<a::radian, t::second, aa::radian_per_second_squared>();
             test::<a::degree, t::second, aa::degree_per_second_squared>();

             fn test<A: a::Conversion<V>, T: t::Conversion<V>, R: aa::Conversion<V>>() {
                 let square_second = Time::new::<T>(V::one()) * Time::new::<T>(V::one());
+
                 Test::assert_approx_eq(&AngularAcceleration::new::<R>(V::one()),
                     &(Angle::new::<A>(V::one()) / square_second).into());
             }

iliekturtles added a commit that referenced this pull request May 12, 2019
Add `AngularAcceleration`.
@iliekturtles
Copy link
Owner

Manually merged. Thanks again for the PR!

@dunmatt dunmatt deleted the aa branch May 12, 2019 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants