[−]Struct piet_common::kurbo::Point
A 2d point.
Fields
x: f64The x coordinate.
y: f64The y coordinate.
Methods
impl Point
pub const ZERO: Point
The point (0, 0).
pub const ORIGIN: Point
The point at the origin; (0, 0).
pub const fn new(x: f64, y: f64) -> Point
Create a new Point with the provided x and y coordinates.
pub fn to_vec2(self) -> Vec2
Convert this point into a Vec2.
pub fn lerp(self, other: Point, t: f64) -> Point
Linearly interpolate between two points.
pub fn midpoint(self, other: Point) -> Point
Determine the midpoint of two points.
pub fn distance(self, other: Point) -> f64
Euclidean distance.
Trait Implementations
impl Default for Point
impl Copy for Point
impl SubAssign<Vec2> for Point
fn sub_assign(&mut self, other: Vec2)
impl Sub<Point> for Point
type Output = Vec2
The resulting type after applying the - operator.
fn sub(self, other: Point) -> Vec2
impl Sub<Vec2> for Point
type Output = Point
The resulting type after applying the - operator.
fn sub(self, other: Vec2) -> Point
impl Mul<Point> for Affine
type Output = Point
The resulting type after applying the * operator.
fn mul(self, other: Point) -> Point
impl AddAssign<Vec2> for Point
fn add_assign(&mut self, other: Vec2)
impl Clone for Point
fn clone(&self) -> Point
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for Point
impl Add<Vec2> for Point
type Output = Point
The resulting type after applying the + operator.
fn add(self, other: Vec2) -> Point
impl PartialEq<Point> for Point
impl From<(f64, f64)> for Point
impl Display for Point
Auto Trait Implementations
impl Send for Point
impl Unpin for Point
impl Sync for Point
impl UnwindSafe for Point
impl RefUnwindSafe for Point
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> RoundFrom<T> for T[src]
fn round_from(x: T) -> T[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>, [src]
U: RoundFrom<T>,