Expand description
An infinite line defined by a point and a vector.
Fields
point: Point<S>
vector: Vector<S>
Implementations
sourceimpl<S: Scalar> Line<S>
impl<S: Scalar> Line<S>
pub fn intersection(&self, other: &Self) -> Option<Point<S>>
pub fn distance_to_point(&self, p: &Point<S>) -> S
pub fn signed_distance_to_point(&self, p: &Point<S>) -> S
sourcepub fn square_distance_to_point(&self, p: Point<S>) -> S
pub fn square_distance_to_point(&self, p: Point<S>) -> S
Returned the squared distance to a point.
Can be useful to avoid a square root when comparing against a distance that can be squared instead.
pub fn equation(&self) -> LineEquation<S>
pub fn intersects_box(&self, rect: &Box2D<S>) -> bool
Trait Implementations
impl<S: Copy> Copy for Line<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for Line<S> where
S: RefUnwindSafe,
impl<S> Send for Line<S> where
S: Send,
impl<S> Sync for Line<S> where
S: Sync,
impl<S> Unpin for Line<S> where
S: Unpin,
impl<S> UnwindSafe for Line<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more