Function rs_math3d::queries::basis_from_unit

source ·
pub fn basis_from_unit<T: FloatScalar>(unit: &Vector3<T>) -> [Vector3<T>; 3]
Expand description

Building an Orthonormal Basis from a Unit Vector John. F. Hughes & Thomas Moller Journal of Graphics Tools, 4:4, 33-35 (DOI: 10.1080/10867651.1999.10487513)

The original implementation has issues around edge cases (any of x,y,z = 0) I attempt to fix using the following without proof TODO: do the proof one day!