Struct vek::geom::repr_c::LineSegment2 [−][src]
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]
T: Real + Add<T, Output = T> + RelativeEq,
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]
T: Real + Add<T, Output = T> + RelativeEq,
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]
T: AsPrimitive<D>,
D: 'static + Copy,
Converts this line to a line of another type, using the as
conversion.
Trait Implementations
impl<T: Clone> Clone for LineSegment2<T>
[src]
fn clone(&self) -> LineSegment2<T>
[src]
pub 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<'de, T> Deserialize<'de> for LineSegment2<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
pub 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> Serialize for LineSegment2<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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,
[src]
T: RefUnwindSafe,
impl<T> Send for LineSegment2<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for LineSegment2<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for LineSegment2<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for LineSegment2<T> where
T: UnwindSafe,
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,