pub struct Point {
pub x: f64,
pub y: f64,
}Expand description
Defines a point.
Fields§
§x: f64The X position.
y: f64The Y position.
Implementations§
Source§impl Point
impl Point
Sourcepub fn distance(value1: Point, value2: Point) -> f64
pub fn distance(value1: Point, value2: Point) -> f64
Computes the Euclidean distance between the two given points.
Sourcepub fn equals(&self, other: Point) -> bool
pub fn equals(&self, other: Point) -> bool
Returns a boolean indicating whether the point is equal to the other given
point (bitwise equality of the coordinates is not required: this is ==).
Sourcepub fn nearly_equals(&self, other: Point) -> bool
pub fn nearly_equals(&self, other: Point) -> bool
Returns a boolean indicating whether the point is equal to the other given point (numerically, within a relative epsilon).
Sourcepub const fn with_x(&self, x: f64) -> Point
pub const fn with_x(&self, x: f64) -> Point
Returns a new point with the specified X coordinate.
Sourcepub const fn with_y(&self, y: f64) -> Point
pub const fn with_y(&self, y: f64) -> Point
Returns a new point with the specified Y coordinate.
Sourcepub const fn deconstruct(&self) -> (f64, f64)
pub const fn deconstruct(&self) -> (f64, f64)
Deconstructs the point into its X and Y coordinates.
Trait Implementations§
Source§impl AddAssign for Point
impl AddAssign for Point
Source§fn add_assign(&mut self, b: Point)
fn add_assign(&mut self, b: Point)
Performs the
+= operation. Read moreSource§impl AddAssign<Vector> for Point
impl AddAssign<Vector> for Point
Source§fn add_assign(&mut self, b: Vector)
fn add_assign(&mut self, b: Vector)
Performs the
+= operation. Read moreSource§impl BatchValue for Point
impl BatchValue for Point
impl Copy for Point
Source§impl DivAssign<f64> for Point
impl DivAssign<f64> for Point
Source§fn div_assign(&mut self, k: f64)
fn div_assign(&mut self, k: f64)
Performs the
/= operation. Read moreSource§impl FromIterator<Point> for Points
impl FromIterator<Point> for Points
Source§impl MarkupTyped for Point
impl MarkupTyped for Point
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
The markup metadata of the type.
Source§impl MulAssign<Matrix> for Point
impl MulAssign<Matrix> for Point
Source§fn mul_assign(&mut self, matrix: Matrix)
fn mul_assign(&mut self, matrix: Matrix)
Performs the
*= operation. Read moreSource§impl MulAssign<f64> for Point
impl MulAssign<f64> for Point
Source§fn mul_assign(&mut self, k: f64)
fn mul_assign(&mut self, k: f64)
Performs the
*= operation. Read moreimpl StructuralPartialEq for Point
Source§impl SubAssign for Point
impl SubAssign for Point
Source§fn sub_assign(&mut self, b: Point)
fn sub_assign(&mut self, b: Point)
Performs the
-= operation. Read moreSource§impl SubAssign<Vector> for Point
impl SubAssign<Vector> for Point
Source§fn sub_assign(&mut self, b: Vector)
fn sub_assign(&mut self, b: Vector)
Performs the
-= operation. Read moreSource§impl Transition<Point> for PointTransition
impl Transition<Point> for PointTransition
Source§fn do_transition(
this: &Self,
progress: Rc<dyn IObservable<f64>>,
old_value: Point,
new_value: Point,
) -> Rc<dyn IObservable<Point>>
fn do_transition( this: &Self, progress: Rc<dyn IObservable<f64>>, old_value: Point, new_value: Point, ) -> Rc<dyn IObservable<Point>>
Creates the observable of the values of the transition from
old_value to new_value, driven by progress (from 0 to 1).Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnsafeUnpin for Point
impl UnwindSafe for Point
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more