Struct acgmath::Vector4 [] [src]

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

A 4-dimensional vector.

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

Fields

The x component of the vector.

The y component of the vector.

The z component of the vector.

The w component of the vector.

Methods

impl<S> Vector4<S>
[src]

Construct a new vector, using the provided values.

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

Component-wise casting to another type

impl<S: BaseNum> 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

impl Vector4<f32>
[src]

Compute and return the square root of each element.

Compute and return the reciprocal of the square root of each element.

Compute and return the reciprocal of each element.

Trait Implementations

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: BaseFloat> MetricSpace for Vector4<S>
[src]

The metric to be returned by the distance function.

Returns the squared distance. Read more

The distance between two values.

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

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.

The minimum element of the array.

The maximum element 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: BaseNum> Zero for Vector4<S>
[src]

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

Returns true if self is equal to the additive identity.

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

The associated scalar.

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

The resulting type after applying the - operator

The method for the unary - operator

impl<S: BaseFloat> ApproxEq for Vector4<S>
[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: BaseFloat + Rand> Rand for Vector4<S>
[src]

Generates a random instance of this type using the specified source of randomness. Read more

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

The resulting type after applying the + operator

The method for the + operator

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

The resulting type after applying the + operator

The method for the + operator

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

The resulting type after applying the + operator

The method for the + operator

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

The resulting type after applying the + operator

The method for the + operator

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

The method for the += operator

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

The resulting type after applying the - operator

The method for the - operator

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

The resulting type after applying the - operator

The method for the - operator

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

The resulting type after applying the - operator

The method for the - operator

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

The resulting type after applying the - operator

The method for the - operator

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

The method for the -= operator

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

The resulting type after applying the * operator

The method for the * operator

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

The resulting type after applying the * operator

The method for the * operator

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

The method for the *= operator

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

The resulting type after applying the / operator

The method for the / operator

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

The resulting type after applying the / operator

The method for the / operator

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

The method for the /= operator

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

The resulting type after applying the % operator

The method for the % operator

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

The resulting type after applying the % operator

The method for the % operator

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

The method for the %= operator

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

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

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The method for the mutable indexing (container[index]) operation

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The method for the mutable indexing (container[index]) operation

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The method for the mutable indexing (container[index]) operation

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The method for the mutable indexing (container[index]) operation

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The method for the mutable indexing (container[index]) operation

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: Clone> From<[S; 4]> for Vector4<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a [S; 4]> for &'a Vector4<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a mut [S; 4]> for &'a mut Vector4<S>
[src]

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

impl<S: BaseFloat> InnerSpace for Vector4<S>
[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

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

Formats the value using the given formatter.

impl From<Simdf32x4> for Vector4<f32>
[src]

Performs the conversion.

impl Into<Simdf32x4> for Vector4<f32>
[src]

Performs the conversion.

impl Sub<Vector4<f32>> for Vector4<f32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a> Sub<&'a Vector4<f32>> for Vector4<f32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a> Sub<Vector4<f32>> for &'a Vector4<f32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a, 'b> Sub<&'a Vector4<f32>> for &'b Vector4<f32>
[src]

The method for the - operator

The resulting type after applying the - operator

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

The method for the * operator

The resulting type after applying the * operator

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

The method for the * operator

The resulting type after applying the * operator

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

The method for the / operator

The resulting type after applying the / operator

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

The method for the / operator

The resulting type after applying the / operator

impl Neg for Vector4<f32>
[src]

The method for the unary - operator

The resulting type after applying the - operator

impl AddAssign for Vector4<f32>
[src]

The method for the += operator

impl SubAssign for Vector4<f32>
[src]

The method for the -= operator

impl MulAssign<f32> for Vector4<f32>
[src]

The method for the *= operator

impl DivAssign<f32> for Vector4<f32>
[src]

The method for the /= operator

impl ElementWise for Vector4<f32>
[src]

impl ElementWise<f32> for Vector4<f32>
[src]

impl From<Simdi32x4> for Vector4<i32>
[src]

Performs the conversion.

impl Into<Simdi32x4> for Vector4<i32>
[src]

Performs the conversion.

impl Add<Vector4<i32>> for Vector4<i32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a> Add<&'a Vector4<i32>> for Vector4<i32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a> Add<Vector4<i32>> for &'a Vector4<i32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a, 'b> Add<&'a Vector4<i32>> for &'b Vector4<i32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl Sub<Vector4<i32>> for Vector4<i32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a> Sub<&'a Vector4<i32>> for Vector4<i32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a> Sub<Vector4<i32>> for &'a Vector4<i32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a, 'b> Sub<&'a Vector4<i32>> for &'b Vector4<i32>
[src]

The method for the - operator

The resulting type after applying the - operator

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

The method for the * operator

The resulting type after applying the * operator

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

The method for the * operator

The resulting type after applying the * operator

impl Neg for Vector4<i32>
[src]

The method for the unary - operator

The resulting type after applying the - operator

impl AddAssign for Vector4<i32>
[src]

The method for the += operator

impl SubAssign for Vector4<i32>
[src]

The method for the -= operator

impl MulAssign<i32> for Vector4<i32>
[src]

The method for the *= operator

impl From<Simdu32x4> for Vector4<u32>
[src]

Performs the conversion.

impl Into<Simdu32x4> for Vector4<u32>
[src]

Performs the conversion.

impl Add<Vector4<u32>> for Vector4<u32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a> Add<&'a Vector4<u32>> for Vector4<u32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a> Add<Vector4<u32>> for &'a Vector4<u32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a, 'b> Add<&'a Vector4<u32>> for &'b Vector4<u32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl Add<Vector4<f32>> for Vector4<f32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a> Add<&'a Vector4<f32>> for Vector4<f32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a> Add<Vector4<f32>> for &'a Vector4<f32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl<'a, 'b> Add<&'a Vector4<f32>> for &'b Vector4<f32>
[src]

The method for the + operator

The resulting type after applying the + operator

impl Sub<Vector4<u32>> for Vector4<u32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a> Sub<&'a Vector4<u32>> for Vector4<u32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a> Sub<Vector4<u32>> for &'a Vector4<u32>
[src]

The method for the - operator

The resulting type after applying the - operator

impl<'a, 'b> Sub<&'a Vector4<u32>> for &'b Vector4<u32>
[src]

The method for the - operator

The resulting type after applying the - operator

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

The method for the * operator

The resulting type after applying the * operator

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

The method for the * operator

The resulting type after applying the * operator

impl AddAssign for Vector4<u32>
[src]

The method for the += operator

impl SubAssign for Vector4<u32>
[src]

The method for the -= operator

impl MulAssign<u32> for Vector4<u32>
[src]

The method for the *= operator