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.