pub struct Line<S> {
pub point: Point<S>,
pub vector: Vector<S>,
}
Expand description
An infinite line defined by a point and a vector.
Fields§
§point: Point<S>
§vector: Vector<S>
Implementations§
source§impl<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
pub fn to_f32(&self) -> Line<f32>
pub fn to_f64(&self) -> Line<f64>
Trait Implementations§
impl<S: Copy> Copy for Line<S>
Auto Trait Implementations§
impl<S> Freeze for Line<S>where
S: Freeze,
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)