Struct nannou::geom::vector::Vector4[][src]

#[repr(C)]
pub struct Vector4<S = Default> { pub x: S, pub y: S, pub z: S, pub w: S, }

A 4-dimensional vector.

Fields

Methods

impl<S> Vector4<S>
[src]

Construct a new vector, using the provided values.

Construct a vector using the given value for each field.

The length of the vector.

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

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

Test whether or not the vector is infinite.

Component-wise casting to another type.

A zeroed vector.

Whether or not the vector is zeroed.

A vector with 1 for each element.

Whether or not each element in the vector is equal to 1.

Tests whether or not any of the vector's elements is NaN.

Sum the fields of the vector.

The product of the fields of the vector.

Return a vector whose magnitude is limited to the given value.

Return a vector with the given magnitude.

Return a normalized vector.

If self is_zero, this returns self.

The dot product of self and the given vector.

impl<S> Vector4<S>
[src]

A unit vector in the x direction.

A unit vector in the y direction.

A unit vector in the z direction.

A unit vector in the w direction.

Create a Vector3, dropping the w value.

Create a Vector3, dropping the nth element.

Trait Implementations

impl<S> From<Vector4<S>> for Vector4<S>
[src]

Performs the conversion.

impl<S> Into<Vector4<S>> for Vector4<S>
[src]

Performs the conversion.

impl<S> VectorSpace for Vector4<S> where
    S: BaseNum
[src]

The associated scalar.

impl<S> MetricSpace for Vector4<S> where
    S: BaseFloat
[src]

The metric to be returned by the distance function.

Returns the squared distance. Read more

The distance between two values.

impl<S> ApproxEq for Vector4<S> where
    S: ApproxEq,
    S::Epsilon: Copy
[src]

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

The default relative tolerance for testing values that are far-apart. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

impl<S> ElementWise<S> for Vector4<S> where
    S: BaseNum
[src]

impl<S> ElementWise for Vector4<S> where
    S: BaseFloat
[src]

impl<S> Array for Vector4<S> where
    S: Copy
[src]

Get the number of elements in the array type Read more

Construct a vector from a single value, replicating it. Read more

The sum of the elements of the array.

The product of the elements of the array.

Get the pointer to the first element of the array.

Get a mutable pointer to the first element of the array.

Swap the elements at indices i and j in-place.

impl<S> EuclideanSpace for Vector4<S> where
    S: BaseNum
[src]

The associated scalar over which the space is defined. Read more

The associated space of displacement vectors.

The point at the origin of the Euclidean space.

Convert a displacement vector to a point. Read more

Convert a point to a displacement vector. Read more

This is a weird one, but its useful for plane calculations.

Returns the middle point between two other points. Read more

Returns the average position of all points in the slice. Read more

impl<S> InnerSpace for Vector4<S> where
    S: BaseFloat
[src]

Vector dot (or inner) product.

Returns true if the vector is perpendicular (at right angles) to the other vector. Read more

Returns the squared magnitude. Read more

The distance from the tail to the tip of the vector.

Returns the angle between two vectors in radians.

Returns a vector with the same direction, but with a magnitude of 1.

Returns a vector with the same direction and a given magnitude.

Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other by the specified amount. Read more

Returns the vector projection of the current inner space projected onto the supplied argument. Read more

impl<S: Default> Default for Vector4<S>
[src]

Returns the "default value" for a type. Read more

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

Formats the value using the given formatter. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Feeds this value into the given [Hasher]. Read more

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

impl<S> Sum<Vector4<S>> for Vector4<S> where
    S: Zero + Add<Output = S>, 
[src]

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

impl<'a, S: 'a> Sum<&'a Vector4<S>> for Vector4<S> where
    S: 'a + Clone + Zero + Add<Output = S>, 
[src]

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

impl<S> Neg for Vector4<S> where
    S: Neg<Output = S>, 
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<S> Add for Vector4<S> where
    S: Add<Output = S>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<S> Sub for Vector4<S> where
    S: Sub<Output = S>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<S> Mul for Vector4<S> where
    S: Mul<Output = S>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<S> Div for Vector4<S> where
    S: Div<Output = S>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<S> Rem for Vector4<S> where
    S: Rem<Output = S>, 
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl<S> AddAssign for Vector4<S> where
    S: AddAssign
[src]

Performs the += operation.

impl<S> SubAssign for Vector4<S> where
    S: SubAssign
[src]

Performs the -= operation.

impl<S> DivAssign for Vector4<S> where
    S: Copy + DivAssign
[src]

Performs the /= operation.

impl<S> MulAssign for Vector4<S> where
    S: Copy + MulAssign
[src]

Performs the *= operation.

impl<S> RemAssign for Vector4<S> where
    S: Copy + RemAssign
[src]

Performs the %= operation.

impl<S> Rem<S> for Vector4<S> where
    S: Copy + Rem<Output = S>, 
[src]

The resulting type after applying the % operator.

Performs the % operation.

impl<S> Div<S> for Vector4<S> where
    S: Copy + Div<Output = S>, 
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<S> Mul<S> for Vector4<S> where
    S: Copy + Mul<Output = S>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<S> RemAssign<S> for Vector4<S> where
    S: Copy + RemAssign
[src]

Performs the %= operation.

impl<S> DivAssign<S> for Vector4<S> where
    S: Copy + DivAssign
[src]

Performs the /= operation.

impl<S> MulAssign<S> for Vector4<S> where
    S: Copy + MulAssign
[src]

Performs the *= operation.

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

The returned type after indexing.

Important traits for &'a mut R

Performs the indexing (container[index]) operation.

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

Important traits for &'a mut R

Performs the mutable indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a [u8]

Performs the indexing (container[index]) operation.

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

Important traits for &'a [u8]

Performs the mutable indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a [u8]

Performs the indexing (container[index]) operation.

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

Important traits for &'a [u8]

Performs the mutable indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a [u8]

Performs the indexing (container[index]) operation.

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

Important traits for &'a [u8]

Performs the mutable indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a [u8]

Performs the indexing (container[index]) operation.

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

Important traits for &'a [u8]

Performs the mutable indexing (container[index]) operation.

impl<S> From<[S; 4]> for Vector4<S> where
    S: Copy
[src]

Performs the conversion.

impl<S> Into<[S; 4]> for Vector4<S>
[src]

Performs the conversion.

impl<S> AsRef<[S; 4]> for Vector4<S>
[src]

Performs the conversion.

impl<S> AsMut<[S; 4]> for Vector4<S>
[src]

Performs the conversion.

impl<S> Deref for Vector4<S>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<S> DerefMut for Vector4<S>
[src]

Mutably dereferences the value.

impl<S> Bounded for Vector4<S> where
    S: Bounded
[src]

returns the smallest finite number this type can represent

returns the largest finite number this type can represent

impl<S> Zero for Vector4<S> where
    S: PartialEq + Zero
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

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

Generate a random value of T, using rng as the source of randomness.

Important traits for DistIter<'a, D, R, T>

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

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

Performs the conversion.

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

Performs the conversion.

impl<S> From<(S, S)> for Vector4<S> where
    S: Zero
[src]

Performs the conversion.

impl<S> From<(S, S, S)> for Vector4<S> where
    S: Zero
[src]

Performs the conversion.

impl<S> From<[S; 2]> for Vector4<S> where
    S: Zero
[src]

Performs the conversion.

impl<S> From<[S; 3]> for Vector4<S> where
    S: Zero
[src]

Performs the conversion.

impl<S> From<Vector2<S>> for Vector4<S> where
    S: Zero
[src]

Performs the conversion.

impl<S> From<Vector3<S>> for Vector4<S> where
    S: Zero
[src]

Performs the conversion.

Auto Trait Implementations

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

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