FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Point

    struct · ferroui-base · v0.5.0

    struct Point
    

    Defines a point.

    View source

    Members

    x

    x: f64
    

    The X position.

    Source

    y

    y: f64
    

    The Y position.

    Source

    new

    const fn new(x: f64, y: f64) -> Self
    

    Initializes a new instance of the Point structure.

    Source

    distance

    fn distance(value1: Point, value2: Point) -> f64
    

    Computes the Euclidean distance between the two given points.

    Source

    parse

    fn parse(s: &str) -> Result<Self, FormatError>
    

    Parses a Point string ("x, y" or "x y").

    Source

    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 ==).

    Source

    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).

    Source

    transform

    fn transform(self: &Self, transform: Matrix) -> Point
    

    Transforms the point by a matrix.

    Source

    with_x

    const fn with_x(self: &Self, x: f64) -> Point
    

    Returns a new point with the specified X coordinate.

    Source

    with_y

    const fn with_y(self: &Self, y: f64) -> Point
    

    Returns a new point with the specified Y coordinate.

    Source

    deconstruct

    const fn deconstruct(self: &Self) -> (f64, f64)
    

    Deconstructs the point into its X and Y coordinates.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Transition<Point>
    • From<Point>
    • FromIterator<Point>
    • BatchValue
    • MarkupTyped
    • ValueTypeRegistration
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • Neg
    • Add
    • Add<Vector>
    • Sub
    • Sub<Vector>
    • Mul<f64>
    • Mul<Point>
    • Div<f64>
    • Mul<Matrix>
    • AddAssign
    • AddAssign<Vector>
    • SubAssign
    • SubAssign<Vector>
    • MulAssign<f64>
    • DivAssign<f64>
    • MulAssign<Matrix>
    • FromStr
    • Display
    • From<Vector>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.