pub struct Bounds {
pub min: [f64; 2],
pub max: [f64; 2],
}Expand description
An axis-aligned bounding box in the plane.
Mirrors the minimum bounding rectangle stored at every node of a Boost rtree.
Fields§
§min: [f64; 2]Lower corner [x_min, y_min].
max: [f64; 2]Upper corner [x_max, y_max].
Implementations§
Source§impl Bounds
impl Bounds
Sourcepub fn half_perimeter(&self) -> f64
pub fn half_perimeter(&self) -> f64
Half the perimeter — Boost’s “margin”, used by the R* split.
Sourcepub fn enlargement(&self, other: &Bounds) -> f64
pub fn enlargement(&self, other: &Bounds) -> f64
How much self’s area would grow to also contain other —
Boost’s enlargement metric for choose_next_node.
Sourcepub fn intersects(&self, other: &Bounds) -> bool
pub fn intersects(&self, other: &Bounds) -> bool
Whether the two boxes share any point (closed boxes, so touching counts).
Sourcepub fn min_distance_to(&self, p: [f64; 2]) -> f64
pub fn min_distance_to(&self, p: [f64; 2]) -> f64
The minimum distance from a query point to this box (0 inside). Used by nearest-neighbour pruning.
Sourcepub fn comparable_min_distance_to(&self, p: [f64; 2]) -> f64
pub fn comparable_min_distance_to(&self, p: [f64; 2]) -> f64
The SQUARED minimum distance from a query point to this box —
same ordering as min_distance_to
without the square root, for hot comparison paths. The analogue
of boost::geometry::comparable_distance.
Trait Implementations§
impl Copy for Bounds
impl StructuralPartialEq for Bounds
Auto Trait Implementations§
impl Freeze for Bounds
impl RefUnwindSafe for Bounds
impl Send for Bounds
impl Sync for Bounds
impl Unpin for Bounds
impl UnsafeUnpin for Bounds
impl UnwindSafe for Bounds
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more