Merge pull request #964 from dimforge/unit_complex_axis_angle

Fix wrong sign in UnitComplex::axis_angle
This commit is contained in:
Sébastien Crozet 2021-08-08 13:33:14 +02:00 committed by GitHub
commit dd4df88a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,10 +144,10 @@ where
if ang.is_zero() {
None
} else if ang.is_sign_negative() {
Some((Unit::new_unchecked(Vector1::x()), -ang.clone()))
} else if ang.is_sign_positive() {
Some((Unit::new_unchecked(Vector1::x()), ang))
} else {
Some((Unit::new_unchecked(-Vector1::<T>::x()), ang))
Some((Unit::new_unchecked(-Vector1::<T>::x()), -ang))
}
}