[−][src]Struct vek::geom::repr_c::LineSegment2
2D Line segment, represented by two points, start
and end
.
Fields
start: Vec2<T>
end: Vec2<T>
Methods
impl<T> LineSegment2<T>
[src]
pub fn into_range(self) -> Range<Vec2<T>>
[src]
Converts this line segment into a range of points.
pub fn projected_point(self, p: Vec2<T>) -> Vec2<T> where
T: Real + Sum + ApproxEq,
[src]
T: Real + Sum + ApproxEq,
Project the given point onto the line segment (equivalent to 'snapping' the point to the closest point on the line segment).
pub fn distance_to_point(self, p: Vec2<T>) -> T where
T: Real + Sum + ApproxEq,
[src]
T: Real + Sum + ApproxEq,
Get the smallest distance between the line segment and a point.
Trait Implementations
impl<T: Clone> Clone for LineSegment2<T>
[src]
fn clone(&self) -> LineSegment2<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for LineSegment2<T>
[src]
impl<T: Debug> Debug for LineSegment2<T>
[src]
impl<T: Default> Default for LineSegment2<T>
[src]
fn default() -> LineSegment2<T>
[src]
impl<T: Eq> Eq for LineSegment2<T>
[src]
impl<T: Real> From<LineSegment2<T>> for QuadraticBezier2<T>
[src]
fn from(line_segment: LineSegment2<T>) -> Self
[src]
impl<T: Real + Lerp<T, Output = T>> From<LineSegment2<T>> for CubicBezier2<T>
[src]
fn from(line_segment: LineSegment2<T>) -> Self
[src]
impl<T> From<Range<Vec2<T>>> for LineSegment2<T>
[src]
impl<T: Hash> Hash for LineSegment2<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<LineSegment2<T>> for LineSegment2<T>
[src]
fn eq(&self, other: &LineSegment2<T>) -> bool
[src]
fn ne(&self, other: &LineSegment2<T>) -> bool
[src]
impl<T> StructuralEq for LineSegment2<T>
[src]
impl<T> StructuralPartialEq for LineSegment2<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for LineSegment2<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for LineSegment2<T> where
T: Send,
T: Send,
impl<T> Sync for LineSegment2<T> where
T: Sync,
T: Sync,
impl<T> Unpin for LineSegment2<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for LineSegment2<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,