From bffc316f87f43efb07767947ea9f3e8bd77b611b Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Fri, 25 Mar 2022 19:14:51 -0500 Subject: [PATCH] removed some unnecessary code --- src/geometry/rotation_interpolation.rs | 56 +------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/src/geometry/rotation_interpolation.rs b/src/geometry/rotation_interpolation.rs index 4b5b4a95..fb3927a0 100644 --- a/src/geometry/rotation_interpolation.rs +++ b/src/geometry/rotation_interpolation.rs @@ -118,7 +118,8 @@ impl Rotation where pub fn general_pow(self, t:T) -> Self { if D<=1 { return self; } - // println!("r:{}", self); + println!("r:{}", self); + println!("{}", self.clone().into_inner().hessenberg().unpack_h()); //taking the (real) schur form is guaranteed to produce a block-diagonal matrix //where each block is either a 1 (if there's no rotation in that axis) or a 2x2 @@ -165,56 +166,3 @@ impl Rotation where } } - -#[cfg(test)] -mod tests { - - use super::*; - use std::f64::consts::PI; - - const EPS: f64 = 2E-10; - - #[test] - fn rot_pow() { - - let r1 = Rotation2::new(0.0); - let r2 = Rotation2::new(PI/4.0); - let r3 = Rotation2::new(PI/2.0); - - assert_relative_eq!(r1.general_pow(0.5), r1, epsilon=EPS); - assert_relative_eq!(r3.general_pow(0.5), r2, epsilon=EPS); - - } - - #[test] - fn basis_rot() { - - const D:usize = 4; - - let basis_blades = |n| (0..n).flat_map( - move |i| (i..n).map(move |j| (i,j)) - ).filter(|(i,j)| i!=j); - - for (i1,j1) in basis_blades(D) { - - for (i2,j2) in basis_blades(D) { - - if i1==i2 || j1==j2 || i1==j2 || j1==i2 { continue; } - - let r1 = Rotation::<_,D>::basis_rot(i1,j1,PI/4.0) * - Rotation::<_,D>::basis_rot(i2,j2,PI/4.0); - let r2 = Rotation::<_,D>::basis_rot(i1,j1,PI/2.0) * - Rotation::<_,D>::basis_rot(i2,j2,PI/2.0); - - println!("{}{}",r1,r2); - - assert_relative_eq!(r2.general_pow(0.5), r1, epsilon=EPS); - - } - - } - - } - - -}