pub struct Point {
pub x: Float,
pub y: Float,
}
Expand description
Represents a point in 2D space.
Fields§
§x: Float
X value.
y: Float
Y value.
Implementations§
Source§impl Point
impl Point
Sourcepub fn distance_to_point(&self, other: &Point) -> Float
pub fn distance_to_point(&self, other: &Point) -> Float
Computes distance from given point to other
Sourcepub fn distance_to_line(&self, a: &Point, b: &Point) -> Float
pub fn distance_to_line(&self, a: &Point, b: &Point) -> Float
Computes distance from line, drawn by points a and b, to the point.
Sourcepub fn distance_to_segment(&self, a: &Point, b: &Point) -> Float
pub fn distance_to_segment(&self, a: &Point, b: &Point) -> Float
Computes distance from segment to the point.
Trait Implementations§
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§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