Struct tree_layout::Point
source · 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>where
T: Clone + Sub<Output = T> + Add<Output = T> + PartialOrd,
impl<T> ManhattanDistance<T> for Point<T>where T: Clone + Sub<Output = T> + Add<Output = T> + PartialOrd,
fn manhattan_distance(&self, rhs: &Point<T>) -> T
source§impl<T> PartialEq for Point<T>where
T: PartialEq,
impl<T> PartialEq for Point<T>where T: PartialEq,
source§impl<T> Projective<T> for Point<T>where
T: Real,
impl<T> Projective<T> for Point<T>where T: Real,
§fn translate_x(&mut self, x: &T)
fn translate_x(&mut self, x: &T)
Transform by length $\delta x$. Read more
§fn translate_y(&mut self, y: &T)
fn translate_y(&mut self, y: &T)
Transform by length $\delta y$. Read more
impl<T> Copy for Point<T>where T: Copy,
impl<T> Eq for Point<T>where T: Eq,
impl<T> StructuralEq for Point<T>
impl<T> StructuralPartialEq for Point<T>
Auto Trait Implementations§
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