pub struct Vec2D<T: Unit> {
pub x: T,
pub y: T,
}
Expand description
A 2D (unitless) vector
Fields
x: T
y: T
Implementations
Returns the area of the parallelogram defined by the two vectors.
The area is signed
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Vec2D<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Vec2D<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns the squared euclidean distance between an object to a point.
pub fn contains_point(
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point
) -> bool
pub fn contains_point(
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point
) -> bool
Returns true
if a point is contained within this object. Read more
pub fn distance_2_if_less_or_equal(
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point,
max_distance_2: <<<P as RTreeObject>::Envelope as Envelope>::Point as Point>::Scalar
) -> Option<<P as Point>::Scalar>
pub fn distance_2_if_less_or_equal(
&self,
point: &<<P as RTreeObject>::Envelope as Envelope>::Point,
max_distance_2: <<<P as RTreeObject>::Envelope as Envelope>::Point as Point>::Scalar
) -> Option<<P as Point>::Scalar>
Returns the squared distance to this object, or None
if the distance
is larger than a given maximum value. Read more