cargo fmt

This commit is contained in:
Tim Taubner 2022-07-27 11:44:42 +02:00
parent 7aadbcf21d
commit 0c2d9deac7
2 changed files with 9 additions and 12 deletions

View File

@ -760,9 +760,14 @@ where
// Perturb until the new norm is significantly different // Perturb until the new norm is significantly different
loop { loop {
perturbed *= Rotation3::from_axis_angle(&perturbation_axes, eps_disturbance.clone()); perturbed *=
Rotation3::from_axis_angle(&perturbation_axes, eps_disturbance.clone());
new_norm_squared = (m - &perturbed).norm_squared(); new_norm_squared = (m - &perturbed).norm_squared();
if abs_diff_ne!(norm_squared, new_norm_squared, epsilon = T::default_epsilon()) { if abs_diff_ne!(
norm_squared,
new_norm_squared,
epsilon = T::default_epsilon()
) {
break; break;
} }
} }

View File

@ -34,11 +34,7 @@ fn from_rotation_matrix() {
); );
// Test that issue 627 is fixed // Test that issue 627 is fixed
let m_627 = Matrix3::<f64>::new(-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0); let m_627 = Matrix3::<f64>::new(-1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0);
assert_relative_ne!( assert_relative_ne!(identity, Rotation3::from_matrix(&m_627), epsilon = 0.01);
identity,
Rotation3::from_matrix(&m_627),
epsilon = 0.01
);
assert_relative_eq!( assert_relative_eq!(
Rotation3::from_matrix_unchecked(m_627.clone()), Rotation3::from_matrix_unchecked(m_627.clone()),
Rotation3::from_matrix(&m_627), Rotation3::from_matrix(&m_627),
@ -46,11 +42,7 @@ fn from_rotation_matrix() {
); );
// Test that issue 1078 is fixed // Test that issue 1078 is fixed
let m_1078 = Matrix3::<f64>::new(0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, 0.0, 0.0); let m_1078 = Matrix3::<f64>::new(0.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, 0.0, 0.0);
assert_relative_ne!( assert_relative_ne!(identity, Rotation3::from_matrix(&m_1078), epsilon = 0.01);
identity,
Rotation3::from_matrix(&m_1078),
epsilon = 0.01
);
assert_relative_eq!( assert_relative_eq!(
Rotation3::from_matrix_unchecked(m_1078.clone()), Rotation3::from_matrix_unchecked(m_1078.clone()),
Rotation3::from_matrix(&m_1078), Rotation3::from_matrix(&m_1078),