pub struct Point2D {
pub x: f64,
pub y: f64,
}
Expand description
Point2D, a point / position within 2D space
Fields§
§x: f64
§y: f64
Implementations§
Trait Implementations§
Source§impl Is2D for Point2D
impl Is2D for Point2D
Source§fn abs(&self) -> NonNegative
fn abs(&self) -> NonNegative
The absolute / length of this position
Source§impl IsBuildable2D for Point2D
impl IsBuildable2D for Point2D
Source§impl IsBuildableND for Point2D
impl IsBuildableND for Point2D
Source§impl IsEditable2D for Point2D
impl IsEditable2D for Point2D
Source§fn increase_distance_to_by<P>(&mut self, other: &P, factor: Positive)where
P: Is2D,
fn increase_distance_to_by<P>(&mut self, other: &P, factor: Positive)where
P: Is2D,
Increases distance towards other by factor
Source§fn add<P>(&mut self, other: &P)where
P: Is2D,
fn add<P>(&mut self, other: &P)where
P: Is2D,
Adds the coordinates of other onto this. x = x + other.x …
Source§impl IsEditableND for Point2D
impl IsEditableND for Point2D
Source§impl IsMatrix3Transformable for Point2D
impl IsMatrix3Transformable for Point2D
Source§impl IsMovable2D for Point2D
impl IsMovable2D for Point2D
Source§impl IsND for Point2D
impl IsND for Point2D
Source§fn n_dimensions() -> usize
fn n_dimensions() -> usize
Should return the number of dimensions. E.g. 2 for points in 2D space, 3 for points in 3D space etc.
Source§impl IsTransFormableTo3D for Point2D
impl IsTransFormableTo3D for Point2D
Source§fn transform_to_3d<P>(&self, z: f64) -> Pwhere
P: IsBuildable3D,
fn transform_to_3d<P>(&self, z: f64) -> Pwhere
P: IsBuildable3D,
Should create representation of self within the 3D space with a given z-coordinate
Source§impl Ord for Point2D
impl Ord for Point2D
Source§impl PartialOrd for Point2D
impl PartialOrd for Point2D
impl Eq for Point2D
impl StructuralPartialEq for Point2D
Auto Trait Implementations§
impl Freeze for Point2D
impl RefUnwindSafe for Point2D
impl Send for Point2D
impl Sync for Point2D
impl Unpin for Point2D
impl UnwindSafe for Point2D
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more