pub struct Point2<W = Generic> {
pub x: f64,
pub y: f64,
/* private fields */
}Expand description
A representation of a point in 2D space (float).
Fields§
§x: f64Horizontal coordinate.
y: f64Vertical coordinate.
Implementations§
Source§impl<W> Point2<W>where
W: Space,
impl<W> Point2<W>where
W: Space,
Sourcepub fn cast_space<WNew>(self) -> Point2<WNew>where
WNew: Space,
pub fn cast_space<WNew>(self) -> Point2<WNew>where
WNew: Space,
Casts this point into another phantom coordinate space.
Sourcepub fn midpoint_towards(self, other: Point2<W>) -> Point2<W>
pub fn midpoint_towards(self, other: Point2<W>) -> Point2<W>
Returns the midpoint between this point and other.
Sourcepub fn lerp_towards(self, other: Point2<W>, l: f64) -> Point2<W>
pub fn lerp_towards(self, other: Point2<W>, l: f64) -> Point2<W>
Linearly interpolates toward other by l.
Trait Implementations§
impl<W> Copy for Point2<W>where
W: Space,
Source§impl<W> Interpolatable for Point2<W>where
W: Space,
impl<W> Interpolatable for Point2<W>where
W: Space,
Source§fn interpolate(&self, _other: &Self, _t: f64) -> Self
fn interpolate(&self, _other: &Self, _t: f64) -> Self
Source§impl<F, T> Mul<Point2<F>> for Transform2<F, T>
impl<F, T> Mul<Point2<F>> for Transform2<F, T>
Auto Trait Implementations§
impl<W> Freeze for Point2<W>where
PhantomData<W>: Freeze,
impl<W> RefUnwindSafe for Point2<W>where
PhantomData<W>: RefUnwindSafe,
impl<W> Send for Point2<W>where
PhantomData<W>: Send,
impl<W> Sync for Point2<W>where
PhantomData<W>: Sync,
impl<W> Unpin for Point2<W>where
PhantomData<W>: Unpin,
impl<W> UnsafeUnpin for Point2<W>where
PhantomData<W>: UnsafeUnpin,
impl<W> UnwindSafe for Point2<W>where
PhantomData<W>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> PropertyValue for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.