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
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more