nalgebra/nalgebra-glm/src/ext/quaternion_relational.rs

23 lines
890 B
Rust
Raw Normal View History

2019-03-23 21:29:07 +08:00
use crate::aliases::{Qua, TVec};
2021-08-08 18:59:40 +08:00
use crate::RealNumber;
2018-09-22 19:21:02 +08:00
/// Component-wise equality comparison between two quaternions.
2021-08-08 18:59:40 +08:00
pub fn quat_equal<T: RealNumber>(x: &Qua<T>, y: &Qua<T>) -> TVec<bool, 4> {
2019-03-23 21:29:07 +08:00
crate::equal(&x.coords, &y.coords)
}
2018-09-22 19:21:02 +08:00
/// Component-wise approximate equality comparison between two quaternions.
2021-08-08 18:59:40 +08:00
pub fn quat_equal_eps<T: RealNumber>(x: &Qua<T>, y: &Qua<T>, epsilon: T) -> TVec<bool, 4> {
2019-03-23 21:29:07 +08:00
crate::equal_eps(&x.coords, &y.coords, epsilon)
}
2018-09-22 19:21:02 +08:00
/// Component-wise non-equality comparison between two quaternions.
2021-08-08 18:59:40 +08:00
pub fn quat_not_equal<T: RealNumber>(x: &Qua<T>, y: &Qua<T>) -> TVec<bool, 4> {
2019-03-23 21:29:07 +08:00
crate::not_equal(&x.coords, &y.coords)
}
2018-09-22 19:21:02 +08:00
/// Component-wise approximate non-equality comparison between two quaternions.
2021-08-08 18:59:40 +08:00
pub fn quat_not_equal_eps<T: RealNumber>(x: &Qua<T>, y: &Qua<T>, epsilon: T) -> TVec<bool, 4> {
2019-03-23 21:29:07 +08:00
crate::not_equal_eps(&x.coords, &y.coords, epsilon)
}