[][src]Struct vek::geom::repr_simd::LineSegment2

pub struct LineSegment2<T> {
    pub start: Vec2<T>,
    pub end: Vec2<T>,
}

2D Line segment, represented by two points, start and end.

Fields

start: Vec2<T>end: Vec2<T>

Implementations

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 + Add<T, Output = T> + RelativeEq
[src]

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 + Add<T, Output = T> + RelativeEq
[src]

Get the smallest distance between the line segment and a point.

pub fn as_<D>(self) -> LineSegment2<D> where
    T: AsPrimitive<D>,
    D: 'static + Copy
[src]

Converts this line to a line of another type, using the as conversion.

Trait Implementations

impl<T: Clone> Clone for LineSegment2<T>[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]

impl<'de, T> Deserialize<'de> for LineSegment2<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Eq> Eq for LineSegment2<T>[src]

impl<T> From<Range<Vec2<T>>> for LineSegment2<T>[src]

impl<T: Hash> Hash for LineSegment2<T>[src]

impl<T: PartialEq> PartialEq<LineSegment2<T>> for LineSegment2<T>[src]

impl<T> Serialize for LineSegment2<T> where
    T: Serialize
[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

impl<T> Send for LineSegment2<T> where
    T: Send

impl<T> Sync for LineSegment2<T> where
    T: Sync

impl<T> Unpin for LineSegment2<T> where
    T: Unpin

impl<T> UnwindSafe for LineSegment2<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.