pub struct PointProjection<S> { /* private fields */ }
Expand description
Indicates a point’s projected position relative to an edge.
This struct is usually the result of calling DirectedEdgeHandle::project_point, refer to its documentation for more information.
Implementations§
Source§impl<S: SpadeNum> PointProjection<S>
impl<S: SpadeNum> PointProjection<S>
Sourcepub fn is_before_edge(&self) -> bool
pub fn is_before_edge(&self) -> bool
Returns true
if a point’s projection is located before an edge.
See DirectedEdgeHandle::project_point for more information
Sourcepub fn is_behind_edge(&self) -> bool
pub fn is_behind_edge(&self) -> bool
Returns true
if a point’s projection is located behind an edge.
See DirectedEdgeHandle::project_point for more information
Sourcepub fn is_on_edge(&self) -> bool
pub fn is_on_edge(&self) -> bool
Returns true
if a point’s projection is located on an edge.
See DirectedEdgeHandle::project_point for more information
Sourcepub fn reversed(&self) -> Self
pub fn reversed(&self) -> Self
Returns the inverse of this point projection.
The inverse projection projects the same point on the reversed edge used by the original projection.
This method can return an incorrect projection due to rounding issues if the projected point is close to one of the original edge’s vertices.
Source§impl<S: SpadeNum + Float> PointProjection<S>
impl<S: SpadeNum + Float> PointProjection<S>
Sourcepub fn relative_position(&self) -> S
pub fn relative_position(&self) -> S
Returns the relative position of the point used to create this projection relative to the edge used when creating this projection.
This method will return a value between 0.0 and 1.0 (linearly interpolated) if the projected
point lies between self.from
and self.to
, a value close to zero (due to rounding errors)
if the projected point is equal to self.from
and a value smaller than zero if the projected
point lies “before” self.from
. Analogously, a value close to 1. or greater than 1. is
returned if the projected point is equal to or lies behind self.to
.
Trait Implementations§
Source§impl<S: Clone> Clone for PointProjection<S>
impl<S: Clone> Clone for PointProjection<S>
Source§fn clone(&self) -> PointProjection<S>
fn clone(&self) -> PointProjection<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<S: Debug> Debug for PointProjection<S>
impl<S: Debug> Debug for PointProjection<S>
Source§impl<S: Hash> Hash for PointProjection<S>
impl<S: Hash> Hash for PointProjection<S>
Source§impl<S: Ord> Ord for PointProjection<S>
impl<S: Ord> Ord for PointProjection<S>
Source§fn cmp(&self, other: &PointProjection<S>) -> Ordering
fn cmp(&self, other: &PointProjection<S>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<S: PartialEq> PartialEq for PointProjection<S>
impl<S: PartialEq> PartialEq for PointProjection<S>
Source§impl<S: PartialOrd> PartialOrd for PointProjection<S>
impl<S: PartialOrd> PartialOrd for PointProjection<S>
impl<S: Copy> Copy for PointProjection<S>
impl<S: Eq> Eq for PointProjection<S>
impl<S> StructuralPartialEq for PointProjection<S>
Auto Trait Implementations§
impl<S> Freeze for PointProjection<S>where
S: Freeze,
impl<S> RefUnwindSafe for PointProjection<S>where
S: RefUnwindSafe,
impl<S> Send for PointProjection<S>where
S: Send,
impl<S> Sync for PointProjection<S>where
S: Sync,
impl<S> Unpin for PointProjection<S>where
S: Unpin,
impl<S> UnwindSafe for PointProjection<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.