Expand description
Represents a point in 2D space.
Fields
x: f64X value.
y: f64Y value.
Implementations
sourceimpl 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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more