[][src]Struct cgmath::Vector3

#[repr(C)]
pub struct Vector3<S> {
    pub x: S,
    pub y: S,
    pub z: S,
}

A 3-dimensional vector.

This type is marked as #[repr(C)].

Fields

x: S

The x component of the vector.

y: S

The y component of the vector.

z: S

The z component of the vector.

Methods

impl<S> Vector3<S>[src]

pub const fn new(x: S, y: S, z: S) -> Vector3<S>[src]

Construct a new vector, using the provided values.

pub fn map<U, F>(self, f: F) -> Vector3<U> where
    F: FnMut(S) -> U, 
[src]

Perform the given operation on each field in the vector, returning a new point constructed from the operations.

impl<S: NumCast + Copy> Vector3<S>[src]

pub fn cast<T: NumCast>(&self) -> Option<Vector3<T>>[src]

Component-wise casting to another type.

impl<S: BaseNum> Vector3<S>[src]

pub fn unit_x() -> Vector3<S>[src]

A unit vector in the x direction.

pub fn unit_y() -> Vector3<S>[src]

A unit vector in the y direction.

pub fn unit_z() -> Vector3<S>[src]

A unit vector in the z direction.

pub fn cross(self, other: Vector3<S>) -> Vector3<S>[src]

Returns the cross product of the vector and other.

pub fn extend(self, w: S) -> Vector4<S>[src]

Create a Vector4, using the x, y and z values from this vector, and the provided w.

pub fn truncate(self) -> Vector2<S>[src]

Create a Vector2, dropping the z value.

Trait Implementations

impl<S: Copy> Array for Vector3<S>[src]

type Element = S

impl<S: BaseNum> ElementWise<Vector3<S>> for Vector3<S>[src]

impl<S: BaseNum> ElementWise<S> for Vector3<S>[src]

impl<S: BaseNum> VectorSpace for Vector3<S>[src]

type Scalar = S

The associated scalar.

impl<S: BaseFloat> MetricSpace for Vector3<S>[src]

type Metric = S

The metric to be returned by the distance function.

impl<S: BaseFloat> InnerSpace for Vector3<S>[src]

impl<S> Into<[S; 3]> for Vector3<S>[src]

impl<S> Into<(S, S, S)> for Vector3<S>[src]

impl<S: Eq> Eq for Vector3<S>[src]

impl<S> AsMut<[S; 3]> for Vector3<S>[src]

impl<S> AsMut<(S, S, S)> for Vector3<S>[src]

impl<S: Clone> Clone for Vector3<S>[src]

impl<S> AsRef<[S; 3]> for Vector3<S>[src]

impl<S> AsRef<(S, S, S)> for Vector3<S>[src]

impl<S: PartialEq> PartialEq<Vector3<S>> for Vector3<S>[src]

impl<S: Clone> From<[S; 3]> for Vector3<S>[src]

impl<'a, S> From<&'a [S; 3]> for &'a Vector3<S>[src]

impl<'a, S> From<&'a mut [S; 3]> for &'a mut Vector3<S>[src]

impl<S> From<(S, S, S)> for Vector3<S>[src]

impl<'a, S> From<&'a (S, S, S)> for &'a Vector3<S>[src]

impl<'a, S> From<&'a mut (S, S, S)> for &'a mut Vector3<S>[src]

impl<S: Copy> Copy for Vector3<S>[src]

impl<S: Hash> Hash for Vector3<S>[src]

impl<S: BaseNum> Add<Vector3<S>> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the + operator.

impl<'a, S: BaseNum> Add<&'a Vector3<S>> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the + operator.

impl<'a, S: BaseNum> Add<Vector3<S>> for &'a Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the + operator.

impl<'a, 'b, S: BaseNum> Add<&'a Vector3<S>> for &'b Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the + operator.

impl<S: BaseNum> Add<Vector3<S>> for Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the + operator.

impl<'a, S: BaseNum> Add<&'a Vector3<S>> for Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the + operator.

impl<'a, S: BaseNum> Add<Vector3<S>> for &'a Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the + operator.

impl<'a, 'b, S: BaseNum> Add<&'a Vector3<S>> for &'b Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the + operator.

impl<S: BaseNum> Sub<Vector3<S>> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the - operator.

impl<'a, S: BaseNum> Sub<&'a Vector3<S>> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the - operator.

impl<'a, S: BaseNum> Sub<Vector3<S>> for &'a Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the - operator.

impl<'a, 'b, S: BaseNum> Sub<&'a Vector3<S>> for &'b Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the - operator.

impl<S: BaseNum> Sub<Vector3<S>> for Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the - operator.

impl<'a, S: BaseNum> Sub<&'a Vector3<S>> for Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the - operator.

impl<'a, S: BaseNum> Sub<Vector3<S>> for &'a Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the - operator.

impl<'a, 'b, S: BaseNum> Sub<&'a Vector3<S>> for &'b Point3<S>[src]

type Output = Point3<S>

The resulting type after applying the - operator.

impl<S: BaseFloat> Mul<Vector3<S>> for Matrix3<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, S: BaseFloat> Mul<&'a Vector3<S>> for Matrix3<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, S: BaseFloat> Mul<Vector3<S>> for &'a Matrix3<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, 'b, S: BaseFloat> Mul<&'a Vector3<S>> for &'b Matrix3<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<S: BaseFloat> Mul<Vector3<S>> for Quaternion<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, S: BaseFloat> Mul<&'a Vector3<S>> for Quaternion<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, S: BaseFloat> Mul<Vector3<S>> for &'a Quaternion<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, 'b, S: BaseFloat> Mul<&'a Vector3<S>> for &'b Quaternion<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<S: BaseNum> Mul<S> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl<'a, S: BaseNum> Mul<S> for &'a Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the * operator.

impl Mul<Vector3<usize>> for usize[src]

type Output = Vector3<usize>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<usize>> for usize[src]

type Output = Vector3<usize>

The resulting type after applying the * operator.

impl Mul<Vector3<u8>> for u8[src]

type Output = Vector3<u8>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<u8>> for u8[src]

type Output = Vector3<u8>

The resulting type after applying the * operator.

impl Mul<Vector3<u16>> for u16[src]

type Output = Vector3<u16>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<u16>> for u16[src]

type Output = Vector3<u16>

The resulting type after applying the * operator.

impl Mul<Vector3<u32>> for u32[src]

type Output = Vector3<u32>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<u32>> for u32[src]

type Output = Vector3<u32>

The resulting type after applying the * operator.

impl Mul<Vector3<u64>> for u64[src]

type Output = Vector3<u64>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<u64>> for u64[src]

type Output = Vector3<u64>

The resulting type after applying the * operator.

impl Mul<Vector3<isize>> for isize[src]

type Output = Vector3<isize>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<isize>> for isize[src]

type Output = Vector3<isize>

The resulting type after applying the * operator.

impl Mul<Vector3<i8>> for i8[src]

type Output = Vector3<i8>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<i8>> for i8[src]

type Output = Vector3<i8>

The resulting type after applying the * operator.

impl Mul<Vector3<i16>> for i16[src]

type Output = Vector3<i16>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<i16>> for i16[src]

type Output = Vector3<i16>

The resulting type after applying the * operator.

impl Mul<Vector3<i32>> for i32[src]

type Output = Vector3<i32>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<i32>> for i32[src]

type Output = Vector3<i32>

The resulting type after applying the * operator.

impl Mul<Vector3<i64>> for i64[src]

type Output = Vector3<i64>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<i64>> for i64[src]

type Output = Vector3<i64>

The resulting type after applying the * operator.

impl Mul<Vector3<f32>> for f32[src]

type Output = Vector3<f32>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<f32>> for f32[src]

type Output = Vector3<f32>

The resulting type after applying the * operator.

impl Mul<Vector3<f64>> for f64[src]

type Output = Vector3<f64>

The resulting type after applying the * operator.

impl<'a> Mul<&'a Vector3<f64>> for f64[src]

type Output = Vector3<f64>

The resulting type after applying the * operator.

impl<S: BaseNum> Div<S> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the / operator.

impl<'a, S: BaseNum> Div<S> for &'a Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the / operator.

impl Div<Vector3<usize>> for usize[src]

type Output = Vector3<usize>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<usize>> for usize[src]

type Output = Vector3<usize>

The resulting type after applying the / operator.

impl Div<Vector3<u8>> for u8[src]

type Output = Vector3<u8>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<u8>> for u8[src]

type Output = Vector3<u8>

The resulting type after applying the / operator.

impl Div<Vector3<u16>> for u16[src]

type Output = Vector3<u16>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<u16>> for u16[src]

type Output = Vector3<u16>

The resulting type after applying the / operator.

impl Div<Vector3<u32>> for u32[src]

type Output = Vector3<u32>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<u32>> for u32[src]

type Output = Vector3<u32>

The resulting type after applying the / operator.

impl Div<Vector3<u64>> for u64[src]

type Output = Vector3<u64>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<u64>> for u64[src]

type Output = Vector3<u64>

The resulting type after applying the / operator.

impl Div<Vector3<isize>> for isize[src]

type Output = Vector3<isize>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<isize>> for isize[src]

type Output = Vector3<isize>

The resulting type after applying the / operator.

impl Div<Vector3<i8>> for i8[src]

type Output = Vector3<i8>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<i8>> for i8[src]

type Output = Vector3<i8>

The resulting type after applying the / operator.

impl Div<Vector3<i16>> for i16[src]

type Output = Vector3<i16>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<i16>> for i16[src]

type Output = Vector3<i16>

The resulting type after applying the / operator.

impl Div<Vector3<i32>> for i32[src]

type Output = Vector3<i32>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<i32>> for i32[src]

type Output = Vector3<i32>

The resulting type after applying the / operator.

impl Div<Vector3<i64>> for i64[src]

type Output = Vector3<i64>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<i64>> for i64[src]

type Output = Vector3<i64>

The resulting type after applying the / operator.

impl Div<Vector3<f32>> for f32[src]

type Output = Vector3<f32>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<f32>> for f32[src]

type Output = Vector3<f32>

The resulting type after applying the / operator.

impl Div<Vector3<f64>> for f64[src]

type Output = Vector3<f64>

The resulting type after applying the / operator.

impl<'a> Div<&'a Vector3<f64>> for f64[src]

type Output = Vector3<f64>

The resulting type after applying the / operator.

impl<S: BaseNum> Rem<S> for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the % operator.

impl<'a, S: BaseNum> Rem<S> for &'a Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the % operator.

impl Rem<Vector3<usize>> for usize[src]

type Output = Vector3<usize>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<usize>> for usize[src]

type Output = Vector3<usize>

The resulting type after applying the % operator.

impl Rem<Vector3<u8>> for u8[src]

type Output = Vector3<u8>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<u8>> for u8[src]

type Output = Vector3<u8>

The resulting type after applying the % operator.

impl Rem<Vector3<u16>> for u16[src]

type Output = Vector3<u16>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<u16>> for u16[src]

type Output = Vector3<u16>

The resulting type after applying the % operator.

impl Rem<Vector3<u32>> for u32[src]

type Output = Vector3<u32>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<u32>> for u32[src]

type Output = Vector3<u32>

The resulting type after applying the % operator.

impl Rem<Vector3<u64>> for u64[src]

type Output = Vector3<u64>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<u64>> for u64[src]

type Output = Vector3<u64>

The resulting type after applying the % operator.

impl Rem<Vector3<isize>> for isize[src]

type Output = Vector3<isize>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<isize>> for isize[src]

type Output = Vector3<isize>

The resulting type after applying the % operator.

impl Rem<Vector3<i8>> for i8[src]

type Output = Vector3<i8>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<i8>> for i8[src]

type Output = Vector3<i8>

The resulting type after applying the % operator.

impl Rem<Vector3<i16>> for i16[src]

type Output = Vector3<i16>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<i16>> for i16[src]

type Output = Vector3<i16>

The resulting type after applying the % operator.

impl Rem<Vector3<i32>> for i32[src]

type Output = Vector3<i32>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<i32>> for i32[src]

type Output = Vector3<i32>

The resulting type after applying the % operator.

impl Rem<Vector3<i64>> for i64[src]

type Output = Vector3<i64>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<i64>> for i64[src]

type Output = Vector3<i64>

The resulting type after applying the % operator.

impl Rem<Vector3<f32>> for f32[src]

type Output = Vector3<f32>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<f32>> for f32[src]

type Output = Vector3<f32>

The resulting type after applying the % operator.

impl Rem<Vector3<f64>> for f64[src]

type Output = Vector3<f64>

The resulting type after applying the % operator.

impl<'a> Rem<&'a Vector3<f64>> for f64[src]

type Output = Vector3<f64>

The resulting type after applying the % operator.

impl<S: Neg<Output = S>> Neg for Vector3<S>[src]

type Output = Vector3<S>

The resulting type after applying the - operator.

impl<S: BaseNum + AddAssign<S>> AddAssign<Vector3<S>> for Vector3<S>[src]

impl<S: BaseNum + AddAssign<S>> AddAssign<Vector3<S>> for Point3<S>[src]

impl<S: BaseNum + SubAssign<S>> SubAssign<Vector3<S>> for Vector3<S>[src]

impl<S: BaseNum + SubAssign<S>> SubAssign<Vector3<S>> for Point3<S>[src]

impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Vector3<S>[src]

impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Vector3<S>[src]

impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Vector3<S>[src]

impl<S> Index<usize> for Vector3<S>[src]

type Output = S

The returned type after indexing.

impl<S> Index<Range<usize>> for Vector3<S>[src]

type Output = [S]

The returned type after indexing.

impl<S> Index<RangeTo<usize>> for Vector3<S>[src]

type Output = [S]

The returned type after indexing.

impl<S> Index<RangeFrom<usize>> for Vector3<S>[src]

type Output = [S]

The returned type after indexing.

impl<S> Index<RangeFull> for Vector3<S>[src]

type Output = [S]

The returned type after indexing.

impl<S> IndexMut<usize> for Vector3<S>[src]

impl<S> IndexMut<Range<usize>> for Vector3<S>[src]

impl<S> IndexMut<RangeTo<usize>> for Vector3<S>[src]

impl<S> IndexMut<RangeFrom<usize>> for Vector3<S>[src]

impl<S> IndexMut<RangeFull> for Vector3<S>[src]

impl<S: Debug> Debug for Vector3<S>[src]

impl<S: BaseNum> Sum<Vector3<S>> for Vector3<S>[src]

impl<'a, S: 'a + BaseNum> Sum<&'a Vector3<S>> for Vector3<S>[src]

impl<S: BaseFloat> AbsDiffEq<Vector3<S>> for Vector3<S>[src]

type Epsilon = S::Epsilon

Used for specifying relative comparisons.

impl<S: BaseFloat> RelativeEq<Vector3<S>> for Vector3<S>[src]

impl<S: BaseFloat> UlpsEq<Vector3<S>> for Vector3<S>[src]

impl<S: Bounded> Bounded for Vector3<S>[src]

impl<S: BaseNum> Zero for Vector3<S>[src]

impl<S> Distribution<Vector3<S>> for Standard where
    Standard: Distribution<S>,
    S: BaseFloat
[src]

Auto Trait Implementations

impl<S> Send for Vector3<S> where
    S: Send

impl<S> Unpin for Vector3<S> where
    S: Unpin

impl<S> Sync for Vector3<S> where
    S: Sync

impl<S> UnwindSafe for Vector3<S> where
    S: UnwindSafe

impl<S> RefUnwindSafe for Vector3<S> where
    S: RefUnwindSafe

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for T[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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]