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: f64
X value.
y: f64
Y 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 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