Struct makepad_vector::geometry::Vector
source · [−]Expand description
A vector 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: f64
y: f64
Implementations
Trait Implementations
sourceimpl AddAssign<Vector> for Point
impl AddAssign<Vector> for Point
sourcefn add_assign(&mut self, vector: Vector)
fn add_assign(&mut self, vector: Vector)
Performs the
+=
operation. Read moresourceimpl AddAssign<Vector> for Vector
impl AddAssign<Vector> for Vector
sourcefn add_assign(&mut self, other: Vector)
fn add_assign(&mut self, other: Vector)
Performs the
+=
operation. Read moresourceimpl DivAssign<f64> for Vector
impl DivAssign<f64> for Vector
sourcefn div_assign(&mut self, k: f64)
fn div_assign(&mut self, k: f64)
Performs the
/=
operation. Read moresourceimpl MulAssign<f64> for Vector
impl MulAssign<f64> for Vector
sourcefn mul_assign(&mut self, k: f64)
fn mul_assign(&mut self, k: f64)
Performs the
*=
operation. Read moresourceimpl PartialOrd<Vector> for Vector
impl PartialOrd<Vector> for Vector
sourcefn partial_cmp(&self, other: &Vector) -> Option<Ordering>
fn partial_cmp(&self, other: &Vector) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl SubAssign<Vector> for Point
impl SubAssign<Vector> for Point
sourcefn sub_assign(&mut self, vector: Vector)
fn sub_assign(&mut self, vector: Vector)
Performs the
-=
operation. Read moresourceimpl SubAssign<Vector> for Vector
impl SubAssign<Vector> for Vector
sourcefn sub_assign(&mut self, other: Vector)
fn sub_assign(&mut self, other: Vector)
Performs the
-=
operation. Read moresourceimpl Transform for Vector
impl Transform for Vector
fn transform<T>(self, t: &T) -> Vectorwhere
T: Transformation,
fn transform_mut<T>(&mut self, t: &T)where
T: Transformation,
impl Copy for Vector
impl StructuralPartialEq for Vector
Auto Trait Implementations
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnwindSafe for Vector
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more