pub struct LineSegment<P: FP, const DIM: usize> {
pub x: Point<P, DIM>,
pub y: Point<P, DIM>,
}
Expand description
An n-dimensional line segment
Fields§
§x: Point<P, DIM>
§y: Point<P, DIM>
Implementations§
Source§impl<P: FP, const DIM: usize> LineSegment<P, DIM>
impl<P: FP, const DIM: usize> LineSegment<P, DIM>
Sourcepub fn new(x: [P; DIM], y: [P; DIM]) -> LineSegment<P, DIM>
pub fn new(x: [P; DIM], y: [P; DIM]) -> LineSegment<P, DIM>
New LineSegment from two GenericArrays representing either end
Sourcepub fn from_slices(x: &[P], y: &[P]) -> LineSegment<P, DIM>
pub fn from_slices(x: &[P], y: &[P]) -> LineSegment<P, DIM>
New LineSegment from two slices representing either end
Trait Implementations§
Source§impl<P: Clone + FP, const DIM: usize> Clone for LineSegment<P, DIM>
impl<P: Clone + FP, const DIM: usize> Clone for LineSegment<P, DIM>
Source§fn clone(&self) -> LineSegment<P, DIM>
fn clone(&self) -> LineSegment<P, DIM>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P: FP, const DIM: usize> MbrLeafGeometry<P, DIM> for LineSegment<P, DIM>
impl<P: FP, const DIM: usize> MbrLeafGeometry<P, DIM> for LineSegment<P, DIM>
Source§fn min_for_axis(&self, dim: usize) -> P
fn min_for_axis(&self, dim: usize) -> P
the minimum extent for a given axis
Source§fn max_for_axis(&self, dim: usize) -> P
fn max_for_axis(&self, dim: usize) -> P
the maximum extent for a given axis
Source§fn expand_mbr_to_fit(&self, mbr: &mut Rect<P, DIM>)
fn expand_mbr_to_fit(&self, mbr: &mut Rect<P, DIM>)
Expand the mbr to minimally fit the leaf
Source§fn distance_from_mbr_center(&self, mbr: &Rect<P, DIM>) -> P
fn distance_from_mbr_center(&self, mbr: &Rect<P, DIM>) -> P
Determine the distance from the mbr’s center
Source§fn contained_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
fn contained_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf is completely contained in the mbr
Source§fn overlapped_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
fn overlapped_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf overlaps the mbr
Source§fn area_overlapped_with_mbr(&self, mbr: &Rect<P, DIM>) -> P
fn area_overlapped_with_mbr(&self, mbr: &Rect<P, DIM>) -> P
Determines the leaf area shared with the rectangle.
In cases where the leaf and mbr overlap, but the leaf has no area (point or a line, for example), return 0
Auto Trait Implementations§
impl<P, const DIM: usize> Freeze for LineSegment<P, DIM>where
P: Freeze,
impl<P, const DIM: usize> RefUnwindSafe for LineSegment<P, DIM>where
P: RefUnwindSafe,
impl<P, const DIM: usize> Send for LineSegment<P, DIM>where
P: Send,
impl<P, const DIM: usize> Sync for LineSegment<P, DIM>where
P: Sync,
impl<P, const DIM: usize> Unpin for LineSegment<P, DIM>where
P: Unpin,
impl<P, const DIM: usize> UnwindSafe for LineSegment<P, DIM>where
P: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more