pub struct LineSegment<T: FloatIsh> {
pub start: Point<T>,
pub end: Point<T>,
}Fields§
§start: Point<T>§end: Point<T>Implementations§
Source§impl<T: FloatIsh> LineSegment<T>
impl<T: FloatIsh> LineSegment<T>
pub fn slope(&self) -> Option<T>
pub fn intercept(&self) -> T
pub fn intersect(&self, other: &Self) -> Option<Point<T>>
pub fn is_clockwise(&self, point: &Point<T>) -> bool
pub fn length(&self) -> T
pub fn point_along_length(&self, pct: T) -> Point<T>
pub fn distance_to(&self, point: &Point<T>) -> T
Trait Implementations§
Source§impl<T: Clone + FloatIsh> Clone for LineSegment<T>
impl<T: Clone + FloatIsh> Clone for LineSegment<T>
Source§fn clone(&self) -> LineSegment<T>
fn clone(&self) -> LineSegment<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Default + FloatIsh> Default for LineSegment<T>
impl<T: Default + FloatIsh> Default for LineSegment<T>
Source§fn default() -> LineSegment<T>
fn default() -> LineSegment<T>
Returns the “default value” for a type. Read more
Source§impl<T: FloatIsh> Geometry<T> for LineSegment<T>
impl<T: FloatIsh> Geometry<T> for LineSegment<T>
Source§impl<T: PartialOrd + FloatIsh> PartialOrd for LineSegment<T>
impl<T: PartialOrd + FloatIsh> PartialOrd for LineSegment<T>
impl<T: Copy + FloatIsh> Copy for LineSegment<T>
impl<T: FloatIsh> StructuralPartialEq for LineSegment<T>
Auto Trait Implementations§
impl<T> Freeze for LineSegment<T>where
T: Freeze,
impl<T> RefUnwindSafe for LineSegment<T>where
T: RefUnwindSafe,
impl<T> Send for LineSegment<T>where
T: Send,
impl<T> Sync for LineSegment<T>where
T: Sync,
impl<T> Unpin for LineSegment<T>where
T: Unpin,
impl<T> UnwindSafe for LineSegment<T>where
T: 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
Mutably borrows from an owned value. Read more