Struct spatial::geometry::LineSegment
[−]
[src]
pub struct LineSegment<P, DIM> where DIM: ArrayLength<P> + ArrayLength<(P, P)> { pub x: Point<P, DIM>, pub y: Point<P, DIM>, }
An n-dimensional line segment
Fields
x: Point<P, DIM>
y: Point<P, DIM>
Methods
impl<P, DIM> LineSegment<P, DIM> where P: Float + Signed + Bounded + MulAssign + AddAssign + ToPrimitive + FromPrimitive + Copy + Debug, DIM: ArrayLength<P> + ArrayLength<(P, P)>
[src]
fn new(x: GenericArray<P, DIM>, y: GenericArray<P, DIM>) -> LineSegment<P, DIM>
New LineSegment from two GenericArrays representing either end
fn from_slices(x: &[P], y: &[P]) -> LineSegment<P, DIM>
New LineSegment from two slices representing either end
Trait Implementations
impl<P: Clone, DIM: Clone> Clone for LineSegment<P, DIM> where DIM: ArrayLength<P> + ArrayLength<(P, P)>
[src]
fn clone(&self) -> LineSegment<P, DIM>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<P: Debug, DIM: Debug> Debug for LineSegment<P, DIM> where DIM: ArrayLength<P> + ArrayLength<(P, P)>
[src]
impl<P, DIM> MbrLeafGeometry<P, DIM> for LineSegment<P, DIM> where P: Float + Signed + Bounded + MulAssign + AddAssign + ToPrimitive + FromPrimitive + Copy + Debug, DIM: ArrayLength<P> + ArrayLength<(P, P)>
[src]
fn dim(&self) -> usize
The geometry's dimension count
fn area(&self) -> P
Determine the area of the geometry
fn min_for_axis(&self, dim: usize) -> P
the minimum extent for a given axis
fn max_for_axis(&self, dim: usize) -> P
the maximum extent for a given axis
fn expand_mbr_to_fit(&self, mbr: &mut Rect<P, DIM>)
Expand the mbr to minimally fit the leaf
fn distance_from_mbr_center(&self, mbr: &Rect<P, DIM>) -> P
Determine the distance from the mbr's center
fn contained_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf is completely contained in the mbr
fn overlapped_by_mbr(&self, mbr: &Rect<P, DIM>) -> bool
Determine if the leaf overlaps the mbr
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 Read more