/// Returns the bin number pointed by direction `dir`
Returns the bin number pointed by direction `dir`
Returns the bin number pointed by direction ` dir `
pub fn dir_to_bin(&self, dir: Vector3D) -> usize {
        // Check that this is normalized in debug mode
        debug_assert!((1. - dir.length()).abs() < 1e-5);
        // Pointing the ground.
        if dir.z < 0. {
            return 0;
        }
        // Get row
        let row = self.sin_altitude_to_row(dir.z);        
        if row == self.n_rows - 1 {
            return self.n_bins - 1;
        }
        let previous_bins = self.raccum(row);
        // Get current bin within row
        let bin = self.xy_to_bin(row, dir.x, dir.y);
        // Return (count the ground.)
        bin + previous_bins + 1
    }
pub fn dir_to_bin ( & self , dir : Vector3D ) -> usize { // Check that this is normalized in debug mode debug_assert ! ( ( 1. dir length ( ) ) abs ( ) 1e-5 ) ; // Pointing the ground. if dir . z < 0. { return 0 ; } // Get row let row = self . sin_altitude_to_row ( dir . z ) ; if row == self . n_rows - 1 { return self . n_bins - 1 ; } let previous_bins = self . raccum ( row ) ; // Get current bin within row let bin = self . xy_to_bin ( row , dir . x , dir . y ) ; // Return (count the ground.) bin + previous_bins + 1 }
Returns the bin number pointed by direction `dir`
Returns the bin number pointed by direction ` dir `
&self
dir
Vector3D