[][src]Struct vector3d::Vector3d

pub struct Vector3d<T> {
    pub x: T,
    pub y: T,
    pub z: T,
}

A 3D vector.

Fields

x: T

The x component of the vector.

y: T

The y component of the vector.

z: T

The z component of the vector.

Methods

impl<T> Vector3d<T>[src]

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

Create a new Vector3d.

pub fn dot<U: Mul<T, Output = X>, X: Add<Output = X>>(
    self,
    rhs: Vector3d<U>
) -> X
[src]

The dot product of two vectors. Note that we assume that the vector components have commutative multiplication.

impl<T: Clone> Vector3d<T>[src]

pub fn cross<U: Clone + Mul<T, Output = X>, X: Add<Output = X> + Sub<Output = X>>(
    self,
    rhs: Vector3d<U>
) -> Vector3d<X>
[src]

The cross product of two vectors. Note that we assume that the components of both vector types have commutative multiplication.

impl<T: Clone + Mul<T, Output = X>, X: Add<Output = X>> Vector3d<T>[src]

pub fn norm2(self) -> X[src]

The square of the vector.

Trait Implementations

impl<T: Clone> Clone for Vector3d<T>[src]

impl<T: Default> Default for Vector3d<T>[src]

impl<T: Copy> Copy for Vector3d<T>[src]

impl<T: PartialEq> PartialEq<Vector3d<T>> for Vector3d<T>[src]

impl<T: Debug> Debug for Vector3d<T>[src]

impl<T: Display> Display for Vector3d<T>[src]

impl<T: Sub<T, Output = T>> Sub<Vector3d<T>> for Vector3d<T>[src]

type Output = Vector3d<T>

The resulting type after applying the - operator.

impl<S: Clone, X, T: Div<S, Output = X>> Div<S> for Vector3d<T>[src]

type Output = Vector3d<X>

The resulting type after applying the / operator.

impl<T: Add<T, Output = T>> Add<Vector3d<T>> for Vector3d<T>[src]

type Output = Vector3d<T>

The resulting type after applying the + operator.

impl<S: Clone, X, T: Mul<S, Output = X>> Mul<S> for Vector3d<T>[src]

type Output = Vector3d<X>

The resulting type after applying the * operator.

impl<T: Neg<Output = T>> Neg for Vector3d<T>[src]

type Output = Vector3d<T>

The resulting type after applying the - operator.

impl<T> Index<usize> for Vector3d<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<usize> for Vector3d<T>[src]

impl<T: Add<T, Output = T> + Sum<T>> Sum<Vector3d<T>> for Vector3d<T>[src]

impl<'a, T: 'a + Add<T, Output = T> + Sum<T> + Clone> Sum<&'a Vector3d<T>> for Vector3d<T>[src]

impl<T: ClapMe> ClapMe for Vector3d<T>[src]

impl<T> Serialize for Vector3d<T> where
    T: Serialize
[src]

impl<'de, T> Deserialize<'de> for Vector3d<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> Send for Vector3d<T> where
    T: Send

impl<T> Sync for Vector3d<T> where
    T: Sync

impl<T> Unpin for Vector3d<T> where
    T: Unpin

impl<T> RefUnwindSafe for Vector3d<T> where
    T: RefUnwindSafe

impl<T> UnwindSafe for Vector3d<T> where
    T: UnwindSafe

Blanket Implementations

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> ToString for T where
    T: Display + ?Sized
[src]

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.

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]