pub struct Point<T> {
pub x: T,
pub y: T,
}
Expand description
A 2D points.
Fields§
§x: T
The x-coordinate of the point
y: T
The y-coordinate of the point
Implementations§
Trait Implementations§
Source§impl<T> EuclideanDistance<T> for Point<T>where
T: Real,
impl<T> EuclideanDistance<T> for Point<T>where
T: Real,
Source§fn euclidean_distance(&self, c: &Point<T>) -> T
fn euclidean_distance(&self, c: &Point<T>) -> T
Minimum distance between two Coord
s
Source§fn euclidean_squared(&self, rhs: &Point<T>) -> T
fn euclidean_squared(&self, rhs: &Point<T>) -> T
It is especially suitable when only the length needs to be compared Read more
Source§impl<T> EuclideanDistance<T, Circle<T>> for Point<T>where
T: Float,
impl<T> EuclideanDistance<T, Circle<T>> for Point<T>where
T: Float,
fn euclidean_distance(&self, rhs: &Circle<T>) -> T
Source§fn euclidean_squared(&self, rhs: &Circle<T>) -> T
fn euclidean_squared(&self, rhs: &Circle<T>) -> T
It is especially suitable when only the length needs to be compared Read more
Source§impl<T> EuclideanDistance<T, Line<T>> for Point<T>where
T: Float,
impl<T> EuclideanDistance<T, Line<T>> for Point<T>where
T: Float,
fn euclidean_distance(&self, rhs: &Line<T>) -> T
Source§fn euclidean_squared(&self, rhs: &Line<T>) -> T
fn euclidean_squared(&self, rhs: &Line<T>) -> T
It is especially suitable when only the length needs to be compared Read more
Source§impl<T> EuclideanDistance<T, PointSet<T>> for Point<T>where
T: Float + PartialOrd,
impl<T> EuclideanDistance<T, PointSet<T>> for Point<T>where
T: Float + PartialOrd,
Source§fn euclidean_squared(&self, rhs: &PointSet<T>) -> T
fn euclidean_squared(&self, rhs: &PointSet<T>) -> T
适合单次查询最近的点
fn euclidean_distance(&self, rhs: &PointSet<T>) -> T
Source§impl<T> EuclideanDistance<T, Triangle<T>> for Point<T>where
T: Float,
impl<T> EuclideanDistance<T, Triangle<T>> for Point<T>where
T: Float,
fn euclidean_distance(&self, rhs: &Triangle<T>) -> T
Source§fn euclidean_squared(&self, rhs: &Triangle<T>) -> T
fn euclidean_squared(&self, rhs: &Triangle<T>) -> T
It is especially suitable when only the length needs to be compared Read more
Source§impl<T> ManhattanDistance<T> for Point<T>
impl<T> ManhattanDistance<T> for Point<T>
fn manhattan_distance(&self, rhs: &Point<T>) -> T
Source§impl<T> Projective<T> for Point<T>where
T: Real,
impl<T> Projective<T> for Point<T>where
T: Real,
impl<T> Copy for Point<T>where
T: Copy,
impl<T> Eq for Point<T>where
T: Eq,
impl<T> StructuralPartialEq for Point<T>
Auto Trait Implementations§
impl<T> Freeze for Point<T>where
T: Freeze,
impl<T> RefUnwindSafe for Point<T>where
T: RefUnwindSafe,
impl<T> Send for Point<T>where
T: Send,
impl<T> Sync for Point<T>where
T: Sync,
impl<T> Unpin for Point<T>where
T: Unpin,
impl<T> UnwindSafe for Point<T>where
T: 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