pub struct Line<S> where
S: EuclideanSpace, {
pub origin: S,
pub direction: Unit<Vector<S>>,
}
Expand description
Line.
Describes a line containing an origin point and a direction. Lines
extend infinitely from their origin along their direction $\hat{u}$. Unlike
Ray
, the direction component of Line
extends in both the positive and
negative.
This representation is typically known as the vector form $P_0 + t\hat{u}$ where $t$ is some non-zero time of impact.
Fields
origin: S
The origin or contained point of the line.
direction: Unit<Vector<S>>
The unit direction(s) in which the line extends from its origin.
Implementations
sourceimpl<S> Line<S> where
S: EuclideanSpace,
impl<S> Line<S> where
S: EuclideanSpace,
sourceimpl<S> Line<S> where
S: EuclideanSpace + FiniteDimensional<N = U2>,
impl<S> Line<S> where
S: EuclideanSpace + FiniteDimensional<N = U2>,
Trait Implementations
sourceimpl<S: Clone> Clone for Line<S> where
S: EuclideanSpace,
impl<S: Clone> Clone for Line<S> where
S: EuclideanSpace,
sourceimpl<S> Default for Line<S> where
S: EuclideanSpace,
impl<S> Default for Line<S> where
S: EuclideanSpace,
sourceimpl<S> Intersection<Line<S>> for Line<S> where
S: EuclideanSpace + FiniteDimensional<N = U2>,
impl<S> Intersection<Line<S>> for Line<S> where
S: EuclideanSpace + FiniteDimensional<N = U2>,
Intersection of lines in two dimensions.
sourceimpl<S> Intersection<Line<S>> for Plane<S> where
S: EuclideanSpace,
Line<S>: Intersection<Plane<S>>,
impl<S> Intersection<Line<S>> for Plane<S> where
S: EuclideanSpace,
Line<S>: Intersection<Plane<S>>,
Symmetrical intersection.
type Output = <Line<S> as Intersection<Plane<S>>>::Output
fn intersection(&self, other: &Line<S>) -> Option<Self::Output>
sourceimpl<S> Intersection<Plane<S>> for Line<S> where
S: EuclideanSpace + FiniteDimensional,
<S as FiniteDimensional>::N: Cmp<U2, Output = Greater>,
impl<S> Intersection<Plane<S>> for Line<S> where
S: EuclideanSpace + FiniteDimensional,
<S as FiniteDimensional>::N: Cmp<U2, Output = Greater>,
Intersection of a line and a plane.
type Output = LinePlane<S>
type Output = LinePlane<S>
The time of impact of a point intersection or the line if it lies within the plane.
The time of impact $t$ describes the distance from the line’s origin point at which the intersection occurs.
sourcefn intersection(&self, plane: &Plane<S>) -> Option<Self::Output>
fn intersection(&self, plane: &Plane<S>) -> Option<Self::Output>
Determines if a line intersects a plane at a point or lies within the
plane. Computes the time of impact of a Line
for a point
intersection.
Given a line formed from an origin $P_0$ and a unit direction $\hat{u}$, the point of intersection with the plane is $P_0 + t\hat{u}$.
impl<S: Copy> Copy for Line<S> where
S: EuclideanSpace,
impl<S> StructuralPartialEq for Line<S> where
S: EuclideanSpace,
Auto Trait Implementations
impl<S> RefUnwindSafe for Line<S> where
S: RefUnwindSafe,
<S as EuclideanSpace>::CoordinateSpace: RefUnwindSafe,
impl<S> Send for Line<S> where
S: Send,
<S as EuclideanSpace>::CoordinateSpace: Send,
impl<S> Sync for Line<S> where
S: Sync,
<S as EuclideanSpace>::CoordinateSpace: Sync,
impl<S> Unpin for Line<S> where
S: Unpin,
<S as EuclideanSpace>::CoordinateSpace: Unpin,
impl<S> UnwindSafe for Line<S> where
S: UnwindSafe,
<S as EuclideanSpace>::CoordinateSpace: 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
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.