Struct vek::geom::repr_simd::LineSegment2 [−][src]
Expand description
2D Line segment, represented by two points, start
and end
.
Fields
start: Vec2<T>
end: Vec2<T>
Implementations
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,
pub fn projected_point(self, p: Vec2<T>) -> Vec2<T> where
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,
pub fn distance_to_point(self, p: Vec2<T>) -> T where
T: Real + Add<T, Output = T> + RelativeEq,
Get the smallest distance between the line segment and a point.
Converts this line to a line of another type, using the as
conversion.
Trait Implementations
Returns the “default value” for a type. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Mutably borrows from an owned value. Read more