pub struct Point {
pub x: f64,
pub y: f64,
}Expand description
A position in two-dimensional design coordinates, without implicit narrowing.
Fields§
§x: f64Horizontal position, increasing toward the right.
y: f64Vertical position, increasing downward.
Implementations§
Source§impl Point
impl Point
Sourcepub const fn new(horizontal: f64, vertical: f64) -> Self
pub const fn new(horizontal: f64, vertical: f64) -> Self
Preserves the supplied coordinates; validation belongs to the consumer.
Sourcepub fn distance(self, other: Self) -> f64
pub fn distance(self, other: Self) -> f64
Returns Euclidean distance using deterministic pure-Rust math.
Sourcepub fn interpolate(&self, target: &Self, progress: f64) -> Self
pub fn interpolate(&self, target: &Self, progress: f64) -> Self
Linearly interpolates or extrapolates with double-precision progress.
Trait Implementations§
impl Copy for Point
Source§impl Interpolate for Point
impl Interpolate for Point
Source§fn interpolate(&self, target: &Self, progress: f64) -> Self
fn interpolate(&self, target: &Self, progress: f64) -> Self
Blends toward
target with nominal progress zero at self and one at target. Read moreimpl StructuralPartialEq for Point
Auto Trait Implementations§
impl Forget for Point
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> 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