[][src]Struct euclid::HomogeneousVector

#[repr(C)]
pub struct HomogeneousVector<T, U> {
    pub x: T,
    pub y: T,
    pub z: T,
    pub w: T,
    // some fields omitted
}

Homogeneous vector in 3D space.

Fields

x: Ty: Tz: Tw: T

Methods

impl<T, U> HomogeneousVector<T, U>[src]

pub fn new(x: T, y: T, z: T, w: T) -> Self[src]

Constructor taking scalar values directly.

impl<T: Copy + Div<T, Output = T> + Zero + PartialOrd, U> HomogeneousVector<T, U>[src]

pub fn to_point2d(&self) -> Option<TypedPoint2D<T, U>>[src]

Convert into Cartesian 2D point.

Returns None if the point is on or behind the W=0 hemisphere.

pub fn to_point3d(&self) -> Option<TypedPoint3D<T, U>>[src]

Convert into Cartesian 3D point.

Returns None if the point is on or behind the W=0 hemisphere.

Trait Implementations

impl<T, U> PartialEq<HomogeneousVector<T, U>> for HomogeneousVector<T, U> where
    T: PartialEq
[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T, U> Eq for HomogeneousVector<T, U> where
    T: Eq
[src]

impl<T, U> Hash for HomogeneousVector<T, U> where
    T: Hash
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Display, U> Display for HomogeneousVector<T, U>[src]

impl<T: Debug, U> Debug for HomogeneousVector<T, U>[src]

impl<T, U> Copy for HomogeneousVector<T, U> where
    T: Copy
[src]

impl<T: Zero, U> From<TypedVector2D<T, U>> for HomogeneousVector<T, U>[src]

impl<T: Zero, U> From<TypedVector3D<T, U>> for HomogeneousVector<T, U>[src]

impl<T: Zero + One, U> From<TypedPoint2D<T, U>> for HomogeneousVector<T, U>[src]

impl<T: One, U> From<TypedPoint3D<T, U>> for HomogeneousVector<T, U>[src]

impl<T, U> Clone for HomogeneousVector<T, U> where
    T: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T, U> Unpin for HomogeneousVector<T, U> where
    T: Unpin,
    U: Unpin

impl<T, U> Send for HomogeneousVector<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for HomogeneousVector<T, U> where
    T: Sync,
    U: Sync

impl<T, U> UnwindSafe for HomogeneousVector<T, U> where
    T: UnwindSafe,
    U: UnwindSafe

impl<T, U> RefUnwindSafe for HomogeneousVector<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]