fn add_quad(
    mpq: &mut BinaryHeap<Qcell>,
    cell: &Qcell,
    new_height: f64,
    polygon: &Polygon,
) {
    let two = 2.0_f64;
    let centroid_x = cell.centroid.x;
    let centroid_y = cell.centroid.y;
    for combo in &[
        (centroid_x - new_height, centroid_y - new_height),
        (centroid_x + new_height, centroid_y - new_height),
        (centroid_x - new_height, centroid_y + new_height),
        (centroid_x + new_height, centroid_y + new_height),
    ] {
        let mut new_dist = signed_distance(combo.0, combo.1, polygon);
        mpq.push(Qcell::new(
            combo.0,
            combo.1,
            new_height,
            new_dist,
            new_dist + new_height * two.sqrt(),
        ));
    }
}
/// Add a new Quadtree node made up of four `Qcell`s to the binary heap
Add a new Quadtree node made up of four `Qcell`s to the binary heap
Add a new Quadtree node made up of four ` Qcell ` s to the binary heap
fn add_quad(
    mpq: &mut BinaryHeap<Qcell>,
    cell: &Qcell,
    new_height: f64,
    polygon: &Polygon,
) {
    let two = 2.0_f64;
    let centroid_x = cell.centroid.x;
    let centroid_y = cell.centroid.y;
    for combo in &[
        (centroid_x - new_height, centroid_y - new_height),
        (centroid_x + new_height, centroid_y - new_height),
        (centroid_x - new_height, centroid_y + new_height),
        (centroid_x + new_height, centroid_y + new_height),
    ] {
        let mut new_dist = signed_distance(combo.0, combo.1, polygon);
        mpq.push(Qcell::new(
            combo.0,
            combo.1,
            new_height,
            new_dist,
            new_dist + new_height * two.sqrt(),
        ));
    }
}
fn add_quad ( mpq : & mut BinaryHeap < Qcell > , cell : & Qcell , new_height : f64 , polygon : & Polygon , ) { let two = 2.0_f64 ; let centroid_x = cell . centroid . x ; let centroid_y = cell . centroid . y ; for combo in & [ ( centroid_x - new_height , centroid_y - new_height ) , ( centroid_x + new_height , centroid_y - new_height ) , ( centroid_x - new_height , centroid_y + new_height ) , ( centroid_x + new_height , centroid_y + new_height ) , ] { let mut new_dist = signed_distance ( combo . 0 , combo . 1 , polygon ) ; mpq . push ( Qcell :: new ( combo . 0 , combo . 1 , new_height , new_dist , new_dist + new_height * two . sqrt ( ) , ) ) ; } }
Add a new Quadtree node made up of four `Qcell`s to the binary heap
Add a new Quadtree node made up of four ` Qcell ` s to the binary heap
mpq
&mut BinaryHeap<Qcell>
cell
&Qcell
new_height
f64
polygon
&Polygon
mpq
&mut BinaryHeap<Qcell>
cell
&Qcell
new_height
f64
polygon
&Polygon