[−][src]Struct pointy::Line64
2-dimensional line with f64
values.
use pointy::{Line64, Pt64}; let line = Line64::new(Pt64(10.0, 15.0), Pt64(0.0, 2.0));
Implementations
impl Line64
[src]
pub fn new<P0, P1>(a: P0, b: P1) -> Self where
P0: Into<Pt64>,
P1: Into<Pt64>,
[src]
P0: Into<Pt64>,
P1: Into<Pt64>,
Create a new line
pub fn distance<P: Into<Pt64>>(self, pt: P) -> f64
[src]
Get the distance from the line to a point
pub fn segment_distance<P: Into<Pt64>>(self, pt: P) -> f64
[src]
Get the distance from the line (as a segment) to a point
pub fn intersection(self, rhs: Self) -> Option<Pt64>
[src]
Get the point where two lines intersect
pub fn project<P: Into<Pt64>>(self, pt: P) -> Pt64
[src]
Project a point onto the line.
Returns the point on the line nearest to the given point.
Trait Implementations
impl Clone for Line64
[src]
impl Copy for Line64
[src]
impl Debug for Line64
[src]
impl Default for Line64
[src]
impl PartialEq<Line64> for Line64
[src]
impl StructuralPartialEq for Line64
[src]
Auto Trait Implementations
impl RefUnwindSafe for Line64
impl Send for Line64
impl Sync for Line64
impl Unpin for Line64
impl UnwindSafe for Line64
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,