From d8fcbd12f4f45ad06f92dd986811276311dfe4f4 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Mon, 28 Mar 2022 16:46:48 -0500 Subject: [PATCH] added more 180 rotation tests --- tests/geometry/rotation.rs | 101 +++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 43 deletions(-) diff --git a/tests/geometry/rotation.rs b/tests/geometry/rotation.rs index a823418d..7c0834cb 100644 --- a/tests/geometry/rotation.rs +++ b/tests/geometry/rotation.rs @@ -102,6 +102,53 @@ mod proptest_tests { }; } + macro_rules! gen_powf_180deg_rotation_test { + ($( + fn $powf_rot_n:ident($($v:ident in $vec:ident()),*); + )*) => {$( + proptest! { + + #[test] + fn $powf_rot_n($($v in $vec(),)*) { + + use nalgebra::*; + use num_traits::Zero; + use std::f64::consts::PI; + + //an array of tuples with the unit plane and angle + let plane_angles = gen_rotation_planes!($($v),*).iter().map( + |b| Unit::try_new_and_get(*b,0.0).map_or_else( + || (Matrix::zero(), 0.0), + |(b,a)| (b.into_inner(), a) + ) + ).collect::>(); + + //loop over every choice of between the original angle and swapping to 180 deg + let n = plane_angles.len(); + for mask in 0..(1<