[][src]Struct pointy::Line64

pub struct 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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.