/// Returns an upper triangular matrix whose columns are unit normal vectors
/// for the hyperplanes described by the Coxeter matrix.
Returns an upper triangular matrix whose columns are unit normal vectors
for the hyperplanes described by the Coxeter matrix.
Returns an upper triangular matrix whose columns are unit normal vectors for the hyperplanes described by the Coxeter matrix .
pub fn normals(&self) -> Option<Matrix<T>> {
        let dim = self.dim();
        let mut mat = Matrix::zeros(dim, dim);
        // Builds each column from the top down, so that each of the succesive
        // dot products we check match the values in the Coxeter matrix.
        for i in 0..dim {
            let (prev_gens, mut n_i) = mat.columns_range_pair_mut(0..i, i);
            for (j, n_j) in prev_gens.column_iter().enumerate() {
                // All other entries in the dot product between columns are zero.
                let dot = n_i.rows_range(0..=j).dot(&n_j.rows_range(0..=j));
                n_i[j] = ((T::PI / self[(i, j)]).fcos() - dot) / n_j[j];
            }
            // If the vector doesn't fit in spherical space.
            let norm_sq = n_i.norm_squared();
            if norm_sq >= T::ONE - T::EPS {
                return None;
            } else {
                n_i[i] = (T::ONE - norm_sq).fsqrt();
            }
        }
        Some(mat)
    }
pub fn normals ( & self ) -> Option < Matrix < T > > { let dim = self . dim ( ) ; let mut mat = Matrix :: zeros ( dim , dim ) ; // Builds each column from the top down, so that each of the succesive // dot products we check match the values in the Coxeter matrix. for i in 0 .. dim { let ( prev_gens , mut n_i ) = mat . columns_range_pair_mut ( 0 .. i , i ) ; for ( j , n_j ) in prev_gens . column_iter ( ) . enumerate ( ) { // All other entries in the dot product between columns are zero. let dot = n_i . rows_range ( 0 ..= j ) . dot ( & n_j . rows_range ( 0 ..= j ) ) ; n_i [ j ] = ( ( T :: PI / self [ ( i , j ) ] ) . fcos ( ) - dot ) / n_j [ j ] ; } // If the vector doesn't fit in spherical space. let norm_sq = n_i . norm_squared ( ) ; if norm_sq >= T :: ONE - T :: EPS { return None ; } else { n_i [ i ] = ( T :: ONE - norm_sq ) . fsqrt ( ) ; } } Some ( mat ) }
Returns an upper triangular matrix whose columns are unit normal vectors
for the hyperplanes described by the Coxeter matrix.
Returns an upper triangular matrix whose columns are unit normal vectors for the hyperplanes described by the Coxeter matrix .
&self