use na::{Real, DefaultAllocator, U2, U3}; use traits::{Number, Dimension, Alloc}; use aliases::Vec; pub fn are_collinear(v0: &Vec, v1: &Vec, epsilon: N) -> bool { is_null(&v0.cross(v1), epsilon) } pub fn are_collinear2(v0: &Vec, v1: &Vec, epsilon: N) -> bool { abs_diff_eq!(v0.perp(v1), N::zero(), epsilon = epsilon) } pub fn are_orthogonal(v0: &Vec, v1: &Vec, epsilon: N) -> bool where DefaultAllocator: Alloc { abs_diff_eq!(v0.dot(v1), N::zero(), epsilon = epsilon) } pub fn are_orthonormal(v0: &Vec, v1: &Vec, epsilon: N) -> bool where DefaultAllocator: Alloc { unimplemented!() } pub fn is_comp_null(v: &Vec, epsilon: N) -> Vec where DefaultAllocator: Alloc { v.map(|x| abs_diff_eq!(x, N::zero(), epsilon = epsilon)) } pub fn is_normalized(v: &Vec, epsilon: N) -> bool where DefaultAllocator: Alloc { abs_diff_eq!(v.norm_squared(), N::one(), epsilon = epsilon * epsilon) } pub fn is_null(v: &Vec, epsilon: N) -> bool where DefaultAllocator: Alloc { abs_diff_eq!(*v, Vec::::zeros(), epsilon = epsilon) }