pub fn rotate_to_lower_triangular(&self) -> Lattice {
        // https://lammps.sandia.gov/doc/Howto_triclinic.html
        let &[a, b, c] = self.vectors();

        // The formulas are tuned for a right-handed matrix.
        //
        // For a left-handed matrix, we simply negate the first vector, solve the problem for the
        // resulting right-handed basis, then negate the first vector again to get the answer for
        // our matrix.
        let sign = self.matrix().det().signum();
        let a = a * sign;

        let a_unit = a.unit();
        let m00 = a.norm();
        let m10 = b.dot(&a_unit);
        let m20 = c.dot(&a_unit);
        let m11 = f64::sqrt(b.sqnorm() - m10*m10);
        let m21 = (b.dot(&c) - m10*m20) / m11;
        let m22 = f64::sqrt(c.sqnorm() - m20*m20 - m21*m21);

        Lattice::from([
            [sign * m00, 0.0, 0.0],
            [m10, m11, 0.0],
            [m20, m21, m22],
        ])
    }
/// Rotate into a form where the first vector points entirely along x, and the
/// second vector is in the xy-plane.
///
/// This is the form required by LAMMPS and `V_Sim`.  This form makes the lattice
/// matrix lower triangular in RSP2's convention.
///
/// If the input cell is left-handed, the output will also be left-handed; however
/// it is not specified which of the 3 diagonal elements will be negative.
Rotate into a form where the first vector points entirely along x, and the
second vector is in the xy-plane.

This is the form required by LAMMPS and `V_Sim`.  This form makes the lattice
matrix lower triangular in RSP2's convention.

If the input cell is left-handed, the output will also be left-handed; however
it is not specified which of the 3 diagonal elements will be negative.
Rotate into a form where the first vector points entirely along x and the second vector is in the xy - plane . This is the form required by LAMMPS and ` V_Sim ` . This form makes the lattice matrix lower triangular in RSP2 ' s convention . If the input cell is left - handed the output will also be left - handed ; however it is not specified which of the 3 diagonal elements will be negative .
pub fn rotate_to_lower_triangular(&self) -> Lattice {
        // https://lammps.sandia.gov/doc/Howto_triclinic.html
        let &[a, b, c] = self.vectors();
        // The formulas are tuned for a right-handed matrix.
        //
        // For a left-handed matrix, we simply negate the first vector, solve the problem for the
        // resulting right-handed basis, then negate the first vector again to get the answer for
        // our matrix.
        let sign = self.matrix().det().signum();
        let a = a * sign;
        let a_unit = a.unit();
        let m00 = a.norm();
        let m10 = b.dot(&a_unit);
        let m20 = c.dot(&a_unit);
        let m11 = f64::sqrt(b.sqnorm() - m10*m10);
        let m21 = (b.dot(&c) - m10*m20) / m11;
        let m22 = f64::sqrt(c.sqnorm() - m20*m20 - m21*m21);
        Lattice::from([
            [sign * m00, 0.0, 0.0],
            [m10, m11, 0.0],
            [m20, m21, m22],
        ])
    }
pub fn rotate_to_lower_triangular ( & self ) -> Lattice { // https://lammps.sandia.gov/doc/Howto_triclinic.html let & [ a , b , c ] = self . vectors ( ) ; // The formulas are tuned for a right-handed matrix. // // For a left-handed matrix, we simply negate the first vector, solve the problem for the // resulting right-handed basis, then negate the first vector again to get the answer for // our matrix. let sign = self . matrix ( ) . det ( ) . signum ( ) ; let a = a * sign ; let a_unit = a . unit ( ) ; let m00 = a . norm ( ) ; let m10 = b . dot ( & a_unit ) ; let m20 = c . dot ( & a_unit ) ; let m11 = f64 :: sqrt ( b . sqnorm ( ) - m10 * m10 ) ; let m21 = ( b . dot ( & c ) - m10 * m20 ) / m11 ; let m22 = f64 :: sqrt ( c . sqnorm ( ) - m20 * m20 - m21 * m21 ) ; Lattice :: from ( [ [ sign * m00 , 0.0 , 0.0 ] , [ m10 , m11 , 0.0 ] , [ m20 , m21 , m22 ] , ] ) }
Rotate into a form where the first vector points entirely along x, and the
second vector is in the xy-plane.
Rotate into a form where the first vector points entirely along x and the second vector is in the xy - plane .
&self
&self