pub struct Point {
pub x: f64,
pub y: f64,
pub z: f64,
}Expand description
A position in space.
Fields§
§x: f64X coordinate.
y: f64Y coordinate.
z: f64Z coordinate.
Implementations§
Source§impl Point
impl Point
Sourcepub const fn from_array([x, y, z]: [f64; 3]) -> Self
pub const fn from_array([x, y, z]: [f64; 3]) -> Self
A point from an array.
Sourcepub const fn from_vector(v: Vector) -> Self
pub const fn from_vector(v: Vector) -> Self
The point at the tip of v placed at the origin.
Sourcepub fn square_distance(self, other: Self) -> f64
pub fn square_distance(self, other: Self) -> f64
Squared distance to other. Prefer this when comparing distances.
Sourcepub fn is_equal(self, other: Self, tol: Tolerances) -> bool
pub fn is_equal(self, other: Self, tol: Tolerances) -> bool
Whether two points coincide within tol.confusion().
Sourcepub fn is_within(self, other: Self, distance: f64) -> bool
pub fn is_within(self, other: Self, distance: f64) -> bool
Whether two points coincide within an explicit distance.
Trait Implementations§
Source§impl AddAssign<Vector> for Point
impl AddAssign<Vector> for Point
Source§fn add_assign(&mut self, v: Vector)
fn add_assign(&mut self, v: Vector)
Performs the
+= operation. Read moreimpl Copy for Point
Source§impl FromIterator<Point> for Aabb
impl FromIterator<Point> for Aabb
impl StructuralPartialEq for Point
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> 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,
impl<T, Right> ClosedAdd<Right> for T
impl<T, Right> ClosedAddAssign<Right> for Twhere
T: ClosedAdd<Right> + AddAssign<Right>,
impl<T, Right> ClosedSub<Right> for T
impl<T, Right> ClosedSubAssign<Right> for Twhere
T: ClosedSub<Right> + SubAssign<Right>,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.