Point
struct · ferroui-base · v0.5.0
struct Point
Defines a point.
Members
x
x: f64
The X position.
y
y: f64
The Y position.
new
const fn new(x: f64, y: f64) -> Self
Initializes a new instance of the Point structure.
distance
fn distance(value1: Point, value2: Point) -> f64
Computes the Euclidean distance between the two given points.
parse
fn parse(s: &str) -> Result<Self, FormatError>
Parses a Point string ("x, y" or "x y").
equals
fn equals(self: &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 ==).
nearly_equals
fn nearly_equals(self: &Self, other: Point) -> bool
Returns a boolean indicating whether the point is equal to the other given point (numerically, within a relative epsilon).
transform
fn transform(self: &Self, transform: Matrix) -> Point
Transforms the point by a matrix.
with_x
const fn with_x(self: &Self, x: f64) -> Point
Returns a new point with the specified X coordinate.
with_y
const fn with_y(self: &Self, y: f64) -> Point
Returns a new point with the specified Y coordinate.
deconstruct
const fn deconstruct(self: &Self) -> (f64, f64)
Deconstructs the point into its X and Y coordinates.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringErasedDestructorIntoEitherTransition<Point>From<Point>FromIterator<Point>BatchValueMarkupTypedValueTypeRegistrationCloneCopyDebugStructuralPartialEqPartialEqDefaultNegAddAdd<Vector>SubSub<Vector>Mul<f64>Mul<Point>Div<f64>Mul<Matrix>AddAssignAddAssign<Vector>SubAssignSubAssign<Vector>MulAssign<f64>DivAssign<f64>MulAssign<Matrix>FromStrDisplayFrom<Vector>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.