fn neighbors_by_direction(&self, reference_point: &Coord) -> Vec<Coord> {
        let mut neighbors = self.neighbors();
        neighbors.sort_by(|a, b| {
            let dist_a = a.min_distance(&reference_point);
            let dist_b = b.min_distance(&reference_point);

            dist_a.partial_cmp(&dist_b).unwrap()
        });

        neighbors
    }
// neighbors sorted by their min_distance to reference_point (the direction)
neighbors sorted by their min_distance to reference_point (the direction)
neighbors sorted by their min_distance to reference_point ( the direction )
fn neighbors_by_direction(&self, reference_point: &Coord) -> Vec<Coord> {
        let mut neighbors = self.neighbors();
        neighbors.sort_by(|a, b| {
            let dist_a = a.min_distance(&reference_point);
            let dist_b = b.min_distance(&reference_point);
            dist_a.partial_cmp(&dist_b).unwrap()
        });
        neighbors
    }
fn neighbors_by_direction ( & self , reference_point : & Coord ) -> Vec < Coord > { let mut neighbors = self . neighbors ( ) ; neighbors . sort_by ( | a , b | { let dist_a = a . min_distance ( & reference_point ) ; let dist_b = b . min_distance ( & reference_point ) ; dist_a . partial_cmp ( & dist_b ) . unwrap ( ) } ) ; neighbors }
neighbors sorted by their min_distance to reference_point (the direction)
neighbors sorted by their min_distance to reference_point ( the direction )
&self
reference_point
&Coord
&self
reference_point
&Coord