Struct vrp_core::algorithms::geometry::Point
source · pub struct Point {
pub x: f64,
pub y: f64,
}Expand description
Represents a point in 2D space.
Fields§
§x: f64X value.
y: f64Y value.
Implementations§
source§impl Point
impl Point
sourcepub fn distance_to_point(&self, other: &Point) -> f64
pub fn distance_to_point(&self, other: &Point) -> f64
Computes distance from given point to other
sourcepub fn distance_to_line(&self, a: &Point, b: &Point) -> f64
pub fn distance_to_line(&self, a: &Point, b: &Point) -> f64
Computes distance from line, drawn by points a and b, to the point.
sourcepub fn distance_to_segment(&self, a: &Point, b: &Point) -> f64
pub fn distance_to_segment(&self, a: &Point, b: &Point) -> f64
Computes distance from segment to the point.
Trait Implementations§
source§impl PartialEq for Point
impl PartialEq for Point
impl Eq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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