From 257d95b3d34b07a1f322076e4e2ff8298679bc92 Mon Sep 17 00:00:00 2001 From: Tim Taubner Date: Thu, 31 Mar 2022 18:03:59 +0200 Subject: [PATCH] Add test case for issue 1078 --- tests/geometry/rotation.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/geometry/rotation.rs b/tests/geometry/rotation.rs index 61af83d9..369b5454 100644 --- a/tests/geometry/rotation.rs +++ b/tests/geometry/rotation.rs @@ -28,6 +28,10 @@ fn from_rotation_matrix() { 1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, -1.0, )); assert_relative_eq!(rotated_z, &Rotation3::from_axis_angle(&UnitVector3::new_unchecked(Vector3::new(1.0, 0.0, 0.0)), PI), epsilon = 0.001); + // Test that issue 1078 is fixed + let m = nalgebra::Matrix3::::new(0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, 0.0, 0.0); + assert_relative_ne!(identity, nalgebra::Rotation3::from_matrix(&m)); + assert_relative_eq!(nalgebra::Rotation3::from_matrix_unchecked(m.clone()), nalgebra::Rotation3::from_matrix(&m)); } #[test]