[−][src]Struct makepad_geometry::Point
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: f32
y: 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]
fn transform<T>(self, t: &T) -> Point where
T: Transformation,
[src]
T: Transformation,
fn transform_mut<T>(&mut self, t: &T) where
T: Transformation,
[src]
T: Transformation,
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]
fn partial_cmp(&self, other: &Point) -> Option<Ordering>
[src]
fn lt(&self, other: &Point) -> bool
[src]
fn le(&self, other: &Point) -> bool
[src]
fn gt(&self, other: &Point) -> bool
[src]
fn ge(&self, other: &Point) -> bool
[src]
impl Debug for Point
[src]
impl Sub<Point> for Point
[src]
type Output = Vector
The resulting type after applying the -
operator.
fn sub(self, other: Point) -> Vector
[src]
impl Sub<Vector> for Point
[src]
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, v: Vector) -> Point
[src]
impl Add<Vector> for Point
[src]
type Output = Point
The resulting type after applying the +
operator.
fn add(self, v: Vector) -> Point
[src]
impl AddAssign<Vector> for Point
[src]
fn add_assign(&mut self, vector: Vector)
[src]
impl SubAssign<Vector> for Point
[src]
fn sub_assign(&mut self, vector: Vector)
[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]
U: From<T>,
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, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,