pub fn make_orthonormal_basis(x: &Vector3, y: &Vector3) -> Result<Basis, String> {
    let mut i = x.clone();
    i.normalize();

    let mut k = i.cross_product(y);
    if k.magnitude() == 0.0 {
        return Err(String::from("Vectors x and y must be non-parallel"));
    }
    k.normalize();

    Ok(Basis{i, j: k.cross_product(&i), k})
}
// Constructs orthonormal basis in right-handed system
Constructs orthonormal basis in right-handed system
Constructs orthonormal basis in right - handed system
pub fn make_orthonormal_basis(x: &Vector3, y: &Vector3) -> Result<Basis, String> {
    let mut i = x.clone();
    i.normalize();
    let mut k = i.cross_product(y);
    if k.magnitude() == 0.0 {
        return Err(String::from("Vectors x and y must be non-parallel"));
    }
    k.normalize();
    Ok(Basis{i, j: k.cross_product(&i), k})
}
pub fn make_orthonormal_basis ( x : & Vector3 , y : & Vector3 ) -> Result < Basis , String > { let mut i = x . clone ( ) ; i . normalize ( ) ; let mut k = i . cross_product ( y ) ; if k . magnitude ( ) == 0.0 { return Err ( String :: from ( " " ) ) ; } k . normalize ( ) ; Ok ( Basis { i , j : k . cross_product ( & i ) , k } ) }
Constructs orthonormal basis in right-handed system
Constructs orthonormal basis in right - handed system
x
&Vector3
y
&Vector3