#[repr(C)]pub struct Line<T, V>{
pub p: V,
pub d: V,
/* private fields */
}
Expand description
An infinite line in 2D or 3D space.
Defined by a point on the line and a direction vector.
Fields§
§p: V
§d: V
Implementations§
Source§impl<T, V> Line<T, V>
impl<T, V> Line<T, V>
Sourcepub fn from_start_end(s: &V, e: &V) -> Line<T, V>
pub fn from_start_end(s: &V, e: &V) -> Line<T, V>
Creates a line from two points.
The line passes through both points, with direction from s to e.
Sourcepub fn closest_point_on_line(&self, p: &V) -> (T, V)
pub fn closest_point_on_line(&self, p: &V) -> (T, V)
Finds the closest point on the line to a given point.
Returns:
t
: Parameter value where the closest point occurs- Point: The closest point on the line
Source§impl<T, V> Line<T, V>where
T: FloatScalar,
V: FloatVector<T>,
impl<T, V> Line<T, V>where
T: FloatScalar,
V: FloatVector<T>,
Trait Implementations§
impl<T, V> Copy for Line<T, V>
Auto Trait Implementations§
impl<T, V> Freeze for Line<T, V>where
V: Freeze,
impl<T, V> RefUnwindSafe for Line<T, V>where
V: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, V> Send for Line<T, V>
impl<T, V> Sync for Line<T, V>
impl<T, V> Unpin for Line<T, V>
impl<T, V> UnwindSafe for Line<T, V>where
V: UnwindSafe,
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