[][src]Struct codenano::geometry::Vector

#[repr(C)]pub struct Vector<F: Float> {
    pub x: F,
    pub y: F,
    pub z: F,
}

Represents the difference between two Points

Fields

x: F

x coordinate

y: F

y coordinate

z: F

z coordinate

Implementations

impl<F: Float> Vector<F>[src]

pub fn zero() -> Self[src]

Return a Vector with null coordinates

pub fn from_coord(coord: [F; 3]) -> Self[src]

Convert an array of 3 floats into a Vector

pub fn norm(&self) -> F[src]

Returns the Euclidian norm of self.

pub fn norm2(&self) -> F[src]

Returns the square of the Euclidian norm of self.

pub fn cross_product(&self, other: &Vector<F>) -> Self[src]

Return the cross product of self and other

pub fn dot(&self, other: &Vector<F>) -> F[src]

Return the dot product of self and other

Trait Implementations

impl<F: Float> Add<Vector<F>> for Point<F>[src]

type Output = Point<F>

The resulting type after applying the + operator.

impl<F: Float> Add<Vector<F>> for Vector<F>[src]

type Output = Vector<F>

The resulting type after applying the + operator.

impl<F: Float> AddAssign<Vector<F>> for Point<F>[src]

impl<F: Float> AddAssign<Vector<F>> for Vector<F>[src]

impl<F: Clone + Float> Clone for Vector<F>[src]

impl<F: Copy + Float> Copy for Vector<F>[src]

impl<F: Debug + Float> Debug for Vector<F>[src]

impl<'de, F: Float> Deserialize<'de> for Vector<F> where
    F: Deserialize<'de>, 
[src]

impl<F: Float> Div<F> for Vector<F>[src]

type Output = Vector<F>

The resulting type after applying the / operator.

impl<F: Float> Index<usize> for Vector<F>[src]

type Output = F

The returned type after indexing.

impl<F: Float> IndexMut<usize> for Vector<F>[src]

impl<F: Float> Mul<F> for Vector<F>[src]

type Output = Vector<F>

The resulting type after applying the * operator.

impl<F: Float> Mul<Vector<F>> for f32[src]

type Output = Vector<F>

The resulting type after applying the * operator.

impl<F: Float> Mul<Vector<F>> for f64[src]

type Output = Vector<F>

The resulting type after applying the * operator.

impl<F: Float> Neg for Vector<F>[src]

type Output = Vector<F>

The resulting type after applying the - operator.

impl<F: Float> Serialize for Vector<F> where
    F: Serialize
[src]

impl<F: Float> Sub<Vector<F>> for Vector<F>[src]

type Output = Vector<F>

The resulting type after applying the - operator.

impl<F: Float> SubAssign<Vector<F>> for Vector<F>[src]

Auto Trait Implementations

impl<F> RefUnwindSafe for Vector<F> where
    F: RefUnwindSafe

impl<F> Send for Vector<F> where
    F: Send

impl<F> Sync for Vector<F> where
    F: Sync

impl<F> Unpin for Vector<F> where
    F: Unpin

impl<F> UnwindSafe for Vector<F> where
    F: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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