[][src]Struct makepad_geometry::Point

pub struct Point {
    pub x: f32,
    pub y: f32,
}

A point in 2-dimensional Euclidian space.

A point represents a position, whereas a vector represents a displacement. That is, the result of subtracting two points is a vector. Moreover, the result of adding/subtracting a vector to/from a point is another point. However, adding two points is not defined. Similarly, whereas a point can be scaled, rotated, and translated, a vector can only be scaled and rotated.

Fields

x: f32y: f32

Methods

impl Point[src]

pub fn new(x: f32, y: f32) -> Point[src]

Creates a new point with the given coordinates.

pub fn origin() -> Point[src]

Returns the point at the origin.

pub fn to_vector(self) -> Vector[src]

Converts self to a vector.

This is equivalent to subtracting self from the origin.

pub fn lerp(self, other: Point, t: f32) -> Point[src]

Linearly interpolate between self and other with parameter t.

Trait Implementations

impl Transform for Point[src]

impl Clone for Point[src]

impl Copy for Point[src]

impl Default for Point[src]

impl PartialEq<Point> for Point[src]

impl PartialOrd<Point> for Point[src]

impl Debug for Point[src]

impl Sub<Point> for Point[src]

type Output = Vector

The resulting type after applying the - operator.

impl Sub<Vector> for Point[src]

type Output = Point

The resulting type after applying the - operator.

impl Add<Vector> for Point[src]

type Output = Point

The resulting type after applying the + operator.

impl AddAssign<Vector> for Point[src]

impl SubAssign<Vector> for Point[src]

impl StructuralPartialEq for Point[src]

Auto Trait Implementations

impl Send for Point

impl Sync for Point

impl Unpin for Point

impl UnwindSafe for Point

impl RefUnwindSafe for Point

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]