pub fn wrap_vector(&self, vect: &mut Vector3D) {
        match self.shape {
            CellShape::Infinite => (),
            CellShape::Orthorhombic => {
                vect[0] -= f64::floor(vect[0] / self.a()) * self.a();
                vect[1] -= f64::floor(vect[1] / self.b()) * self.b();
                vect[2] -= f64::floor(vect[2] / self.c()) * self.c();
            }
            CellShape::Triclinic => {
                let mut fractional = self.fractional(vect);
                fractional[0] -= f64::floor(fractional[0]);
                fractional[1] -= f64::floor(fractional[1]);
                fractional[2] -= f64::floor(fractional[2]);
                *vect = self.cartesian(&fractional);
            }
        }
    }
/// Wrap a vector in the unit cell, obeying the periodic boundary conditions.
/// For a cubic cell of side length `L`, this produce a vector with all
/// components in `[0, L)`.
Wrap a vector in the unit cell, obeying the periodic boundary conditions.
For a cubic cell of side length `L`, this produce a vector with all
components in `[0, L)`.
Wrap a vector in the unit cell obeying the periodic boundary conditions . For a cubic cell of side length ` L ` this produce a vector with all components in ` [ 0 L ) ` .
pub fn wrap_vector(&self, vect: &mut Vector3D) {
        match self.shape {
            CellShape::Infinite => (),
            CellShape::Orthorhombic => {
                vect[0] -= f64::floor(vect[0] / self.a()) * self.a();
                vect[1] -= f64::floor(vect[1] / self.b()) * self.b();
                vect[2] -= f64::floor(vect[2] / self.c()) * self.c();
            }
            CellShape::Triclinic => {
                let mut fractional = self.fractional(vect);
                fractional[0] -= f64::floor(fractional[0]);
                fractional[1] -= f64::floor(fractional[1]);
                fractional[2] -= f64::floor(fractional[2]);
                *vect = self.cartesian(&fractional);
            }
        }
    }
pub fn wrap_vector ( & self , vect : & mut Vector3D ) { match self . shape { CellShape :: Infinite => ( ) , CellShape :: Orthorhombic => { vect [ 0 ] -= f64 :: floor ( vect [ 0 ] / self . a ( ) ) * self . a ( ) ; vect [ 1 ] -= f64 :: floor ( vect [ 1 ] / self . b ( ) ) * self . b ( ) ; vect [ 2 ] -= f64 :: floor ( vect [ 2 ] / self . c ( ) ) * self . c ( ) ; } CellShape :: Triclinic => { let mut fractional = self . fractional ( vect ) ; fractional [ 0 ] -= f64 :: floor ( fractional [ 0 ] ) ; fractional [ 1 ] -= f64 :: floor ( fractional [ 1 ] ) ; fractional [ 2 ] -= f64 :: floor ( fractional [ 2 ] ) ; * vect = self . cartesian ( & fractional ) ; } } }
Wrap a vector in the unit cell, obeying the periodic boundary conditions.
Wrap a vector in the unit cell obeying the periodic boundary conditions .
&self
vect
&mut Vector3D