Struct cgmath::Vector4

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

A 4-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.

§`w: S`

The w component of the vector.

Implementations§

source§

impl<S> Vector4<S>

source

pub fn new(x: S, y: S, z: S, w: S) -> Vector4<S>

Construct a new vector, using the provided values.

source§

impl<S: NumCast + Copy> Vector4<S>

source

pub fn cast<T: NumCast>(&self) -> Vector4<T>

Component-wise casting to another type.

source§

impl<S: BaseNum> Vector4<S>

source

pub fn unit_x() -> Vector4<S>

A unit vector in the `x` direction.

source

pub fn unit_y() -> Vector4<S>

A unit vector in the `y` direction.

source

pub fn unit_z() -> Vector4<S>

A unit vector in the `z` direction.

source

pub fn unit_w() -> Vector4<S>

A unit vector in the `w` direction.

source

pub fn truncate(self) -> Vector3<S>

Create a `Vector3`, dropping the `w` value.

source

pub fn truncate_n(&self, n: isize) -> Vector3<S>

Create a `Vector3`, dropping the nth element.

Trait Implementations§

source§

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

§

type Output = Vector4<S>

The resulting type after applying the `+` operator.
source§

fn add(self, other: &'a Vector4<S>) -> Vector4<S>

Performs the `+` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `+` operator.
source§

fn add(self, other: &'a Vector4<S>) -> Vector4<S>

Performs the `+` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `+` operator.
source§

fn add(self, other: Vector4<S>) -> Vector4<S>

Performs the `+` operation. Read more
source§

impl<S: BaseNum> Add<Vector4<S>> for Vector4<S>

§

type Output = Vector4<S>

The resulting type after applying the `+` operator.
source§

fn add(self, other: Vector4<S>) -> Vector4<S>

Performs the `+` operation. Read more
source§

impl<S: BaseNum + AddAssign<S>> AddAssign<Vector4<S>> for Vector4<S>

source§

fn add_assign(&mut self, other: Vector4<S>)

Performs the `+=` operation. Read more
source§

impl<S: BaseFloat> ApproxEq for Vector4<S>

§

type Epsilon = <S as ApproxEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> S::Epsilon

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

fn default_max_relative() -> S::Epsilon

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

fn default_max_ulps() -> u32

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

fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon ) -> bool

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

fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool

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

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of `ApproxEq::relative_eq`.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of `ApproxEq::ulps_eq`.
source§

impl<S: Copy> Array for Vector4<S>

§

source§

fn from_value(scalar: S) -> Vector4<S>

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

fn sum(self) -> Swhere S: Add<Output = S>,

The sum of the elements of the array.
source§

fn product(self) -> Swhere S: Mul<Output = S>,

The product of the elements of the array.
source§

fn as_ptr(&self) -> *const Self::Element

Get the pointer to the first element of the array.
source§

fn as_mut_ptr(&mut self) -> *mut Self::Element

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

fn swap_elements(&mut self, i: usize, j: usize)

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

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

source§

fn as_mut(&mut self) -> &mut [S; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<S> AsMut<(S, S, S, S)> for Vector4<S>

source§

fn as_mut(&mut self) -> &mut (S, S, S, S)

Converts this type into a mutable reference of the (usually inferred) input type.
source§

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

source§

fn as_ref(&self) -> &[S; 4]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S> AsRef<(S, S, S, S)> for Vector4<S>

source§

fn as_ref(&self) -> &(S, S, S, S)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Clone> Clone for Vector4<S>

source§

fn clone(&self) -> Vector4<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from `source`. Read more
source§

impl<S: Debug> Debug for Vector4<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Div<&'a Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<f32>) -> Vector4<f32>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<f64>) -> Vector4<f64>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<i16>> for i16

§

type Output = Vector4<i16>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<i16>) -> Vector4<i16>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<i32>) -> Vector4<i32>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<i64>) -> Vector4<i64>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<i8>> for i8

§

type Output = Vector4<i8>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<i8>) -> Vector4<i8>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<isize>> for isize

§

type Output = Vector4<isize>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<isize>) -> Vector4<isize>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<u16>> for u16

§

type Output = Vector4<u16>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<u16>) -> Vector4<u16>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<u32>> for u32

§

type Output = Vector4<u32>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<u32>) -> Vector4<u32>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<u64>> for u64

§

type Output = Vector4<u64>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<u64>) -> Vector4<u64>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<u8>> for u8

§

type Output = Vector4<u8>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<u8>) -> Vector4<u8>

Performs the `/` operation. Read more
source§

impl<'a> Div<&'a Vector4<usize>> for usize

§

type Output = Vector4<usize>

The resulting type after applying the `/` operator.
source§

fn div(self, other: &'a Vector4<usize>) -> Vector4<usize>

Performs the `/` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `/` operator.
source§

fn div(self, other: S) -> Vector4<S>

Performs the `/` operation. Read more
source§

impl<S: BaseNum> Div<S> for Vector4<S>

§

type Output = Vector4<S>

The resulting type after applying the `/` operator.
source§

fn div(self, other: S) -> Vector4<S>

Performs the `/` operation. Read more
source§

impl Div<Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<f32>) -> Vector4<f32>

Performs the `/` operation. Read more
source§

impl Div<Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<f64>) -> Vector4<f64>

Performs the `/` operation. Read more
source§

impl Div<Vector4<i16>> for i16

§

type Output = Vector4<i16>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<i16>) -> Vector4<i16>

Performs the `/` operation. Read more
source§

impl Div<Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<i32>) -> Vector4<i32>

Performs the `/` operation. Read more
source§

impl Div<Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<i64>) -> Vector4<i64>

Performs the `/` operation. Read more
source§

impl Div<Vector4<i8>> for i8

§

type Output = Vector4<i8>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<i8>) -> Vector4<i8>

Performs the `/` operation. Read more
source§

impl Div<Vector4<isize>> for isize

§

type Output = Vector4<isize>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<isize>) -> Vector4<isize>

Performs the `/` operation. Read more
source§

impl Div<Vector4<u16>> for u16

§

type Output = Vector4<u16>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<u16>) -> Vector4<u16>

Performs the `/` operation. Read more
source§

impl Div<Vector4<u32>> for u32

§

type Output = Vector4<u32>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<u32>) -> Vector4<u32>

Performs the `/` operation. Read more
source§

impl Div<Vector4<u64>> for u64

§

type Output = Vector4<u64>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<u64>) -> Vector4<u64>

Performs the `/` operation. Read more
source§

impl Div<Vector4<u8>> for u8

§

type Output = Vector4<u8>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<u8>) -> Vector4<u8>

Performs the `/` operation. Read more
source§

impl Div<Vector4<usize>> for usize

§

type Output = Vector4<usize>

The resulting type after applying the `/` operator.
source§

fn div(self, other: Vector4<usize>) -> Vector4<usize>

Performs the `/` operation. Read more
source§

impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Vector4<S>

source§

fn div_assign(&mut self, scalar: S)

Performs the `/=` operation. Read more
source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

source§

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

source§

fn from(v: &'a [S; 4]) -> &'a Vector4<S>

Converts to this type from the input type.
source§

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

source§

fn from(v: &'a (S, S, S, S)) -> &'a Vector4<S>

Converts to this type from the input type.
source§

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

source§

fn from(v: &'a mut [S; 4]) -> &'a mut Vector4<S>

Converts to this type from the input type.
source§

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

source§

fn from(v: &'a mut (S, S, S, S)) -> &'a mut Vector4<S>

Converts to this type from the input type.
source§

impl<S: Clone> From<[S; 4]> for Vector4<S>

source§

fn from(v: [S; 4]) -> Vector4<S>

Converts to this type from the input type.
source§

impl<S> From<(S, S, S, S)> for Vector4<S>

source§

fn from(v: (S, S, S, S)) -> Vector4<S>

Converts to this type from the input type.
source§

impl<S: Hash> Hash for Vector4<S>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given `Hasher`. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given `Hasher`. Read more
source§

impl<S> Index<Range<usize>> for Vector4<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: Range<usize>) -> &'a [S]

Performs the indexing (`container[index]`) operation. Read more
source§

impl<S> Index<RangeFrom<usize>> for Vector4<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeFrom<usize>) -> &'a [S]

Performs the indexing (`container[index]`) operation. Read more
source§

impl<S> Index<RangeFull> for Vector4<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeFull) -> &'a [S]

Performs the indexing (`container[index]`) operation. Read more
source§

impl<S> Index<RangeTo<usize>> for Vector4<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeTo<usize>) -> &'a [S]

Performs the indexing (`container[index]`) operation. Read more
source§

impl<S> Index<usize> for Vector4<S>

§

type Output = S

The returned type after indexing.
source§

fn index<'a>(&'a self, i: usize) -> &'a S

Performs the indexing (`container[index]`) operation. Read more
source§

impl<S> IndexMut<Range<usize>> for Vector4<S>

source§

fn index_mut<'a>(&'a mut self, i: Range<usize>) -> &'a mut [S]

Performs the mutable indexing (`container[index]`) operation. Read more
source§

impl<S> IndexMut<RangeFrom<usize>> for Vector4<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]

Performs the mutable indexing (`container[index]`) operation. Read more
source§

impl<S> IndexMut<RangeFull> for Vector4<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeFull) -> &'a mut [S]

Performs the mutable indexing (`container[index]`) operation. Read more
source§

impl<S> IndexMut<RangeTo<usize>> for Vector4<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]

Performs the mutable indexing (`container[index]`) operation. Read more
source§

impl<S> IndexMut<usize> for Vector4<S>

source§

fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut S

Performs the mutable indexing (`container[index]`) operation. Read more
source§

impl<S: BaseFloat> InnerSpace for Vector4<S>

source§

fn dot(self, other: Vector4<S>) -> S

Vector dot (or inner) product.
source§

fn is_perpendicular(self, other: Self) -> bool

Returns `true` if the vector is perpendicular (at right angles) to the other vector.
source§

fn magnitude2(self) -> Self::Scalar

Returns the squared magnitude. Read more
source§

fn magnitude(self) -> Self::Scalar

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

fn angle(self, other: Self) -> Rad<Self::Scalar>

Returns the angle between two vectors in radians.
source§

fn normalize(self) -> Self

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

fn normalize_to(self, magnitude: Self::Scalar) -> Self

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

fn lerp(self, other: Self, amount: Self::Scalar) -> Self

Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of `other` by the specified amount.
source§

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

source§

fn into(self) -> [S; 4]

Converts this type into the (usually inferred) input type.
source§

impl<S> Into<(S, S, S, S)> for Vector4<S>

source§

fn into(self) -> (S, S, S, S)

Converts this type into the (usually inferred) input type.
source§

impl<S: BaseFloat> MetricSpace for Vector4<S>

§

type Metric = S

The metric to be returned by the `distance` function.
source§

fn distance2(self, other: Self) -> S

Returns the squared distance. Read more
source§

fn distance(self, other: Self) -> Self::Metric

The distance between two values.
source§

impl<'a, 'b, S: BaseFloat> Mul<&'a Vector4<S>> for &'b Matrix4<S>

§

type Output = Vector4<S>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<S>) -> Vector4<S>

Performs the `*` operation. Read more
source§

impl<'a, S: BaseFloat> Mul<&'a Vector4<S>> for Matrix4<S>

§

type Output = Vector4<S>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<S>) -> Vector4<S>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<f32>) -> Vector4<f32>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<f64>) -> Vector4<f64>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<i16>> for i16

§

type Output = Vector4<i16>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<i16>) -> Vector4<i16>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<i32>) -> Vector4<i32>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<i64>) -> Vector4<i64>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<i8>> for i8

§

type Output = Vector4<i8>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<i8>) -> Vector4<i8>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<isize>> for isize

§

type Output = Vector4<isize>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<isize>) -> Vector4<isize>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<u16>> for u16

§

type Output = Vector4<u16>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<u16>) -> Vector4<u16>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<u32>> for u32

§

type Output = Vector4<u32>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<u32>) -> Vector4<u32>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<u64>> for u64

§

type Output = Vector4<u64>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<u64>) -> Vector4<u64>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<u8>> for u8

§

type Output = Vector4<u8>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<u8>) -> Vector4<u8>

Performs the `*` operation. Read more
source§

impl<'a> Mul<&'a Vector4<usize>> for usize

§

type Output = Vector4<usize>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: &'a Vector4<usize>) -> Vector4<usize>

Performs the `*` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: S) -> Vector4<S>

Performs the `*` operation. Read more
source§

impl<S: BaseNum> Mul<S> for Vector4<S>

§

type Output = Vector4<S>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: S) -> Vector4<S>

Performs the `*` operation. Read more
source§

impl<'a, S: BaseFloat> Mul<Vector4<S>> for &'a Matrix4<S>

§

type Output = Vector4<S>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<S>) -> Vector4<S>

Performs the `*` operation. Read more
source§

impl<S: BaseFloat> Mul<Vector4<S>> for Matrix4<S>

§

type Output = Vector4<S>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<S>) -> Vector4<S>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<f32>) -> Vector4<f32>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<f64>) -> Vector4<f64>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<i16>> for i16

§

type Output = Vector4<i16>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<i16>) -> Vector4<i16>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<i32>) -> Vector4<i32>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<i64>) -> Vector4<i64>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<i8>> for i8

§

type Output = Vector4<i8>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<i8>) -> Vector4<i8>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<isize>> for isize

§

type Output = Vector4<isize>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<isize>) -> Vector4<isize>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<u16>> for u16

§

type Output = Vector4<u16>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<u16>) -> Vector4<u16>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<u32>> for u32

§

type Output = Vector4<u32>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<u32>) -> Vector4<u32>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<u64>> for u64

§

type Output = Vector4<u64>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<u64>) -> Vector4<u64>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<u8>> for u8

§

type Output = Vector4<u8>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<u8>) -> Vector4<u8>

Performs the `*` operation. Read more
source§

impl Mul<Vector4<usize>> for usize

§

type Output = Vector4<usize>

The resulting type after applying the `*` operator.
source§

fn mul(self, other: Vector4<usize>) -> Vector4<usize>

Performs the `*` operation. Read more
source§

impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Vector4<S>

source§

fn mul_assign(&mut self, scalar: S)

Performs the `*=` operation. Read more
source§

impl<S: Neg<Output = S>> Neg for Vector4<S>

§

type Output = Vector4<S>

The resulting type after applying the `-` operator.
source§

fn neg(self) -> Vector4<S>

Performs the unary `-` operation. Read more
source§

impl<S: PartialEq> PartialEq<Vector4<S>> for Vector4<S>

source§

fn eq(&self, other: &Vector4<S>) -> bool

This method tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: BaseFloat + Rand> Rand for Vector4<S>

source§

fn rand<R: Rng>(rng: &mut R) -> Vector4<S>

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

impl<'a> Rem<&'a Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<f32>) -> Vector4<f32>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<f64>) -> Vector4<f64>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<i16>> for i16

§

type Output = Vector4<i16>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<i16>) -> Vector4<i16>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<i32>) -> Vector4<i32>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<i64>) -> Vector4<i64>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<i8>> for i8

§

type Output = Vector4<i8>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<i8>) -> Vector4<i8>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<isize>> for isize

§

type Output = Vector4<isize>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<isize>) -> Vector4<isize>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<u16>> for u16

§

type Output = Vector4<u16>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<u16>) -> Vector4<u16>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<u32>> for u32

§

type Output = Vector4<u32>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<u32>) -> Vector4<u32>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<u64>> for u64

§

type Output = Vector4<u64>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<u64>) -> Vector4<u64>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<u8>> for u8

§

type Output = Vector4<u8>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<u8>) -> Vector4<u8>

Performs the `%` operation. Read more
source§

impl<'a> Rem<&'a Vector4<usize>> for usize

§

type Output = Vector4<usize>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: &'a Vector4<usize>) -> Vector4<usize>

Performs the `%` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: S) -> Vector4<S>

Performs the `%` operation. Read more
source§

impl<S: BaseNum> Rem<S> for Vector4<S>

§

type Output = Vector4<S>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: S) -> Vector4<S>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<f32>> for f32

§

type Output = Vector4<f32>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<f32>) -> Vector4<f32>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<f64>> for f64

§

type Output = Vector4<f64>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<f64>) -> Vector4<f64>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<i16>> for i16

§

type Output = Vector4<i16>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<i16>) -> Vector4<i16>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<i32>> for i32

§

type Output = Vector4<i32>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<i32>) -> Vector4<i32>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<i64>> for i64

§

type Output = Vector4<i64>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<i64>) -> Vector4<i64>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<i8>> for i8

§

type Output = Vector4<i8>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<i8>) -> Vector4<i8>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<isize>> for isize

§

type Output = Vector4<isize>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<isize>) -> Vector4<isize>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<u16>> for u16

§

type Output = Vector4<u16>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<u16>) -> Vector4<u16>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<u32>> for u32

§

type Output = Vector4<u32>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<u32>) -> Vector4<u32>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<u64>> for u64

§

type Output = Vector4<u64>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<u64>) -> Vector4<u64>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<u8>> for u8

§

type Output = Vector4<u8>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<u8>) -> Vector4<u8>

Performs the `%` operation. Read more
source§

impl Rem<Vector4<usize>> for usize

§

type Output = Vector4<usize>

The resulting type after applying the `%` operator.
source§

fn rem(self, other: Vector4<usize>) -> Vector4<usize>

Performs the `%` operation. Read more
source§

impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Vector4<S>

source§

fn rem_assign(&mut self, scalar: S)

Performs the `%=` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `-` operator.
source§

fn sub(self, other: &'a Vector4<S>) -> Vector4<S>

Performs the `-` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `-` operator.
source§

fn sub(self, other: &'a Vector4<S>) -> Vector4<S>

Performs the `-` operation. Read more
source§

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

§

type Output = Vector4<S>

The resulting type after applying the `-` operator.
source§

fn sub(self, other: Vector4<S>) -> Vector4<S>

Performs the `-` operation. Read more
source§

impl<S: BaseNum> Sub<Vector4<S>> for Vector4<S>

§

type Output = Vector4<S>

The resulting type after applying the `-` operator.
source§

fn sub(self, other: Vector4<S>) -> Vector4<S>

Performs the `-` operation. Read more
source§

impl<S: BaseNum + SubAssign<S>> SubAssign<Vector4<S>> for Vector4<S>

source§

fn sub_assign(&mut self, other: Vector4<S>)

Performs the `-=` operation. Read more
source§

impl<'a, S: 'a + BaseNum> Sum<&'a Vector4<S>> for Vector4<S>

source§

fn sum<I: Iterator<Item = &'a Vector4<S>>>(iter: I) -> Vector4<S>

Method which takes an iterator and generates `Self` from the elements by “summing up” the items.
source§

impl<S: BaseNum> Sum<Vector4<S>> for Vector4<S>

source§

fn sum<I: Iterator<Item = Vector4<S>>>(iter: I) -> Vector4<S>

Method which takes an iterator and generates `Self` from the elements by “summing up” the items.
source§

impl<S: BaseNum> VectorSpace for Vector4<S>

§

type Scalar = S

The associated scalar.
source§

impl<S: BaseNum> Zero for Vector4<S>

source§

fn zero() -> Vector4<S>

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

fn is_zero(&self) -> bool

Returns `true` if `self` is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets `self` to the additive identity element of `Self`, `0`.
source§

source§

source§

source§

§

§

§

§

§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls `U::from(self)`.

That is, this conversion is whatever the implementation of `From<T> for U` chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

source§