pub struct Vector<const N: usize, T, A: Alignment>(/* private fields */)
where
T: Scalar,
Length<N>: SupportedLength;Expand description
A generic vector type.
This type is the generic form of these type aliases:
This type is generic over:
N: Length (2, 3, or 4).T: Scalar type.A: Alignment (seeAlignment).
§Memory Layout
| Type | Size | Alignment |
|---|---|---|
Vec2<T> | size_of::<T>() * 2 | See below |
Vec3<T> | See below | See below |
Vec4<T> | size_of::<T>() * 4 | See below |
Vec2U<T> | size_of::<T>() * 2 | align_of::<T>() |
Vec3U<T> | size_of::<T>() * 3 | align_of::<T>() |
Vec4U<T> | size_of::<T>() * 4 | align_of::<T>() |
The alignment of aligned vectors can be anything from the alignment of T
to the size of the vector.
The size of Vec3<T> can either be size_of::<T>() * 3 or
size_of::<T>() * 4. If its size is times 4, the padding is guaranteed to
be an initialized value of T.
The specific representation of each vector type is controlled by the
ScalarBackend trait.
Implementations§
Source§impl<const N: usize, T, A: Alignment> Vector<N, T, A>
impl<const N: usize, T, A: Alignment> Vector<N, T, A>
Sourcepub const fn from_array(array: [T; N]) -> Self
pub const fn from_array(array: [T; N]) -> Self
Creates a vector from an array.
Sourcepub const fn splat(value: T) -> Self
pub const fn splat(value: T) -> Self
Creates a vector with all elements set to the given value.
Sourcepub fn from_fn(f: impl FnMut(usize) -> T) -> Self
pub fn from_fn(f: impl FnMut(usize) -> T) -> Self
Creates a vector by calling function f for each element index.
Equivalent to (f(0), f(1), f(2), ...).
Sourcepub const fn to_alignment<A2: Alignment>(self) -> Vector<N, T, A2>
pub const fn to_alignment<A2: Alignment>(self) -> Vector<N, T, A2>
Converts the vector to the specified alignment.
Sourcepub const fn align(self) -> Vector<N, T, Aligned>
pub const fn align(self) -> Vector<N, T, Aligned>
Converts the alignment of the vector to Aligned.
Sourcepub const fn unalign(self) -> Vector<N, T, Unaligned>
pub const fn unalign(self) -> Vector<N, T, Unaligned>
Converts the alignment of the vector to Unaligned.
Sourcepub const fn as_array_ref(&self) -> &[T; N]
pub const fn as_array_ref(&self) -> &[T; N]
Returns a reference to the vector’s elements.
Sourcepub const fn as_array_mut(&mut self) -> &mut [T; N]
pub const fn as_array_mut(&mut self) -> &mut [T; N]
Returns a mutable reference to the vector’s elements.
Sourcepub fn iter(self) -> IntoIter<T, N>
pub fn iter(self) -> IntoIter<T, N>
Returns an iterator over the vector’s elements.
This method returns an iterator over T and not &T. to iterate over
references use vec.as_array_ref().iter().
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
Returns an iterator over mutable references to the vector’s elements.
Sourcepub fn map<T2: Scalar>(self, f: impl Fn(T) -> T2) -> Vector<N, T2, A>
pub fn map<T2: Scalar>(self, f: impl Fn(T) -> T2) -> Vector<N, T2, A>
Calls function f for each element of the vector and returns the
result.
Sourcepub const fn get(self, index: usize) -> Option<T>
pub const fn get(self, index: usize) -> Option<T>
Returns the element at the given index, or None if the index is out of
bounds.
Sourcepub const fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub const fn get_mut(&mut self, index: usize) -> Option<&mut T>
Returns a mutable reference to the element at the given index, or None
if the index is out of bounds.
Sourcepub fn repr(self) -> <T as ScalarBackend<N, A>>::VectorReprwhere
T: ScalarBackend<N, A>,
pub fn repr(self) -> <T as ScalarBackend<N, A>>::VectorReprwhere
T: ScalarBackend<N, A>,
Returns the internal representation of the vector.
The internal representation is controlled by the implementation for the
ScalarBackend trait.
This function should not be used outside the implementation for
ScalarBackend because the internal representation could change
silently and cause compile errors.
Sourcepub unsafe fn from_repr(repr: <T as ScalarBackend<N, A>>::VectorRepr) -> Selfwhere
T: ScalarBackend<N, A>,
pub unsafe fn from_repr(repr: <T as ScalarBackend<N, A>>::VectorRepr) -> Selfwhere
T: ScalarBackend<N, A>,
Creates a vector from its internal representation.
The internal representation is controlled by the implementation for the
ScalarBackend trait.
This function should not be used outside the implementation for
ScalarBackend because the internal representation could change
silently and cause compile errors.
§Safety
The provided value must be valid for this vector type, because the
internal type may have less memory safety requirements than T.
§impl<const N: usize, A: Alignment> Vector<N, f32, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, f32, A>where
Length<N>: SupportedLength,
pub fn recip(self) -> Self
pub fn recip(self) -> Self
Computes 1.0 / self.
pub fn element_sum(self) -> f32
pub fn element_sum(self) -> f32
Computes the sum of the vector’s elements.
The order of addition is unspecified and may differ between target architectures.
pub fn element_product(self) -> f32
pub fn element_product(self) -> f32
Computes the product of the vector’s elements.
The order of multiplication is unspecified and may differ between target architectures.
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
Clamps the components of self between the components of min and
max.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN or
if min > max.
pub fn max_element(self) -> f32
pub fn max_element(self) -> f32
Returns the maximum component of the vector.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn min_element(self) -> f32
pub fn min_element(self) -> f32
Returns the minimum component of the vector.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
1.0if the component is positive or+0.0.-1.0if the component is negative or-0.0.NaNif the component is NaN.
pub fn copysign(self, sign: Self) -> Self
pub fn copysign(self, sign: Self) -> Self
Returns a vector with the magnitudes of self and the signs of sign.
pub fn length_squared(self) -> f32
pub fn length_squared(self) -> f32
Computes the squared length/magnitude of self.
pub fn distance_squared(self, other: Self) -> f32
pub fn distance_squared(self, other: Self) -> f32
Computes the squared euclidean distance between self and other.
pub fn lerp(self, other: Self, t: f32) -> Self
pub fn lerp(self, other: Self, t: f32) -> Self
Computes the linear interpolation between self and other based on
the value t.
When t is 0.0, the result is self. When t is 1.0, the result
is rhs. When t is outside of the range [0.0, 1.0], the result is
linearly extrapolated.
pub fn midpoint(self, other: Self) -> Self
pub fn midpoint(self, other: Self) -> Self
Computes the midpoint between self and other.
This function is equivalent to self.lerp(other, 0.5) but is cheaper to
compute.
This function may return a slightly different value than lerp.
pub fn is_normalized(self) -> bool
pub fn is_normalized(self) -> bool
Returns whether self has the length 1.0 or not.
This function uses a precision threshold of approximately 1e-4.
pub fn project_onto(self, other: Self) -> Self
pub fn project_onto(self, other: Self) -> Self
Returns the vector projection of self onto other.
other must not be a zero vector.
§Panics
When assertions are enabled, this function panics if other is a zero
vector.
pub fn project_onto_normalized(self, other: Self) -> Self
pub fn project_onto_normalized(self, other: Self) -> Self
Returns the vector projection of self onto other.
other must be normalized.
§Panics
When assertions are enabled, this function panics if other is not
normalized.
pub fn reject_from(self, other: Self) -> Self
pub fn reject_from(self, other: Self) -> Self
Returns the vector rejection of self from other.
Vector rejection is the vector pointing from the projection to the
original vector. Basically: self - self.project_onto(other).
other must not be a zero vector.
§Panics
When assertions are enabled, this function panics if other is a zero
vector.
pub fn reject_from_normalized(self, other: Self) -> Self
pub fn reject_from_normalized(self, other: Self) -> Self
Returns the vector rejection of self from other.
Vector rejection is the vector pointing from the projection to the
original vector. Basically: self - self.project_onto(other).
other must be normalized.
§Panics
When assertions are enabled, this function panics if other is not
normalized.
§impl<A: Alignment> Vector<3, f32, A>
impl<A: Alignment> Vector<3, f32, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
pub fn any_orthogonal_vector(self) -> Self
pub fn any_orthogonal_vector(self) -> Self
Returns some vector that is orthogonal to self.
self must be finite and not a zero vector.
The output vector is not necessarily normalized. For that use
Self::any_orthonormal_vector() instead.
pub fn any_orthonormal_vector(self) -> Self
pub fn any_orthonormal_vector(self) -> Self
Returns some unit vector that is orthogonal to self.
self must normalized.
§Panics
When assertions are enabled, this function panics if self is not
normalized.
pub fn any_orthonormal_pair(self) -> (Self, Self)
pub fn any_orthonormal_pair(self) -> (Self, Self)
Returns two unit vectors that are orthogonal to self and to each
other.
Together with self, they form an orthonormal basis where the three
vectors are orthogonal to each other and are normalized.
§Panics
When assertions are enabled, this function panics if self is not
normalized.
§impl<const N: usize, A: Alignment> Vector<N, f32, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, f32, A>where
Length<N>: SupportedLength,
pub fn floor(self) -> Self
pub fn floor(self) -> Self
Rounds the components of self down.
pub fn ceil(self) -> Self
pub fn ceil(self) -> Self
Rounds the components of self up.
pub fn round(self) -> Self
pub fn round(self) -> Self
Rounds the components of self to the nearest integer.
pub fn trunc(self) -> Self
pub fn trunc(self) -> Self
Rounds the components of self towards zero.
pub fn fract(self) -> Self
pub fn fract(self) -> Self
Returns the fractional part of self.
This function is equivalent to self - self.trunc().
pub fn mul_add(self, a: Self, b: Self) -> Self
pub fn mul_add(self, a: Self, b: Self) -> Self
Fused Multiply Add. Computes self * a + b with only one rounding error
instead of two.
This is slower than an unfused multiply add for most target architectures.
This function is guaranteed to return the exact same value as the standard library.
pub fn div_euclid(self, rhs: Self) -> Self
pub fn div_euclid(self, rhs: Self) -> Self
Euclidiean Division.
This function is guaranteed to return the exact same value as the standard library.
pub fn rem_euclid(self, rhs: Self) -> Self
pub fn rem_euclid(self, rhs: Self) -> Self
Euclidiean Remainder.
This function is guaranteed to return the exact same value as the standard library.
pub fn sqrt(self) -> Self
pub fn sqrt(self) -> Self
Computes the square root of the components of self.
This function is guaranteed to return the exact same value as the standard library.
pub fn sin(self) -> Self
pub fn sin(self) -> Self
Computes the sine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn cos(self) -> Self
pub fn cos(self) -> Self
Computes the cosine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn tan(self) -> Self
pub fn tan(self) -> Self
Computes the tangent of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn asin(self) -> Self
pub fn asin(self) -> Self
Computes the arc sine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn acos(self) -> Self
pub fn acos(self) -> Self
Computes the arc cosine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn atan(self) -> Self
pub fn atan(self) -> Self
Computes the arc tangent of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn sin_cos(self) -> (Self, Self)
pub fn sin_cos(self) -> (Self, Self)
Simultaneously computes the sine and cosine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn move_towards(self, other: Self, max_delta: f32) -> Self
pub fn move_towards(self, other: Self, max_delta: f32) -> Self
Moves self towards other by the value max_delta.
When max_delta is 0.0, the result is self. When max_delta is
equal to or greater than self.distance(other), the result is other.
pub fn normalize(self) -> Self
pub fn normalize(self) -> Self
Returns a vector with the direction of self and length 1.0.
§Panics
When assertions are enabled, this function panics if the input is zero or if the result is non finite or zero.
pub fn try_normalize(self) -> Option<Self>
pub fn try_normalize(self) -> Option<Self>
Computes self.normalize or returns None if the
input is zero or if the result is non finite or zero.
pub fn normalize_or(self, fallback: Self) -> Self
pub fn normalize_or(self, fallback: Self) -> Self
Computes self.normalize or returns fallback if
the input is zero or if the result is non finite or zero.
pub fn normalize_or_zero(self) -> Self
pub fn normalize_or_zero(self) -> Self
Computes self.normalize or returns a zero vector if
the input is zero or if the result is non finite or zero.
pub fn normalize_and_length(self) -> (Self, f32)
pub fn normalize_and_length(self) -> (Self, f32)
Computes self.normalize() and
self.length().
If self is a zero vector, the function returns
(Self::ZERO, 0.0).
pub fn with_max_length(self, max: f32) -> Self
pub fn with_max_length(self, max: f32) -> Self
Returns self with a length of no more than max.
§Panics
When assertions are enabled, this function panics if max is negative.
pub fn with_min_length(self, min: f32) -> Self
pub fn with_min_length(self, min: f32) -> Self
Returns self with a length of no less than min.
§Panics
When assertions are enabled, this function panics if min is negative.
pub fn clamp_length(self, min: f32, max: f32) -> Self
pub fn clamp_length(self, min: f32, max: f32) -> Self
Returns self with a length of no less than min and no more than
max.
§Panics
When assertions are enabled, this function panics if min is greater
than max, or if either min or max are negative.
pub fn angle_between(self, other: Self) -> f32
pub fn angle_between(self, other: Self) -> f32
Computes the angle (in radians) between two vectors in the range
[0, +π].
The vectors do not need to be unit vectors but they do need to be non-zero.
This function has unspecified precision.
pub fn exp(self) -> Self
pub fn exp(self) -> Self
Computes the exponential function e^self for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn exp2(self) -> Self
pub fn exp2(self) -> Self
Computes 2^self for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn ln(self) -> Self
pub fn ln(self) -> Self
Computes the natural logarithm for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn log2(self) -> Self
pub fn log2(self) -> Self
Computes the base 2 logarithm for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn powf(self, n: f32) -> Self
pub fn powf(self, n: f32) -> Self
Computes self^n for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn refract(self, normal: Self, eta: f32) -> Self
pub fn refract(self, normal: Self, eta: f32) -> Self
Returns the vector refraction of self through normal and eta.
eta is the incident index divided by the transmitted index.
When total internal reflection occurs, this function returns a zero vector.
self and normal must be normalized.
§Panics
When assertions are enabled, this function panics if self or normal
are not normalized.
§impl<A: Alignment> Vector<3, f32, A>
impl<A: Alignment> Vector<3, f32, A>
§impl<const N: usize, A: Alignment> Vector<N, f64, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, f64, A>where
Length<N>: SupportedLength,
pub fn recip(self) -> Self
pub fn recip(self) -> Self
Computes 1.0 / self.
pub fn element_sum(self) -> f64
pub fn element_sum(self) -> f64
Computes the sum of the vector’s elements.
The order of addition is unspecified and may differ between target architectures.
pub fn element_product(self) -> f64
pub fn element_product(self) -> f64
Computes the product of the vector’s elements.
The order of multiplication is unspecified and may differ between target architectures.
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
Clamps the components of self between the components of min and
max.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN or
if min > max.
pub fn max_element(self) -> f64
pub fn max_element(self) -> f64
Returns the maximum component of the vector.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn min_element(self) -> f64
pub fn min_element(self) -> f64
Returns the minimum component of the vector.
This function is not consistent with IEEE semantics in regards to NaN
propagation and handling of -0.0.
§Panics
When assertions are enabled, this function panics if any input is NaN.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
1.0if the component is positive or+0.0.-1.0if the component is negative or-0.0.NaNif the component is NaN.
pub fn copysign(self, sign: Self) -> Self
pub fn copysign(self, sign: Self) -> Self
Returns a vector with the magnitudes of self and the signs of sign.
pub fn length_squared(self) -> f64
pub fn length_squared(self) -> f64
Computes the squared length/magnitude of self.
pub fn distance_squared(self, other: Self) -> f64
pub fn distance_squared(self, other: Self) -> f64
Computes the squared euclidean distance between self and other.
pub fn lerp(self, other: Self, t: f64) -> Self
pub fn lerp(self, other: Self, t: f64) -> Self
Computes the linear interpolation between self and other based on
the value t.
When t is 0.0, the result is self. When t is 1.0, the result
is rhs. When t is outside of the range [0.0, 1.0], the result is
linearly extrapolated.
pub fn midpoint(self, other: Self) -> Self
pub fn midpoint(self, other: Self) -> Self
Computes the midpoint between self and other.
This function is equivalent to self.lerp(other, 0.5) but is cheaper to
compute.
This function may return a slightly different value than lerp.
pub fn is_normalized(self) -> bool
pub fn is_normalized(self) -> bool
Returns whether self has the length 1.0 or not.
This function uses a precision threshold of approximately 1e-4.
pub fn project_onto(self, other: Self) -> Self
pub fn project_onto(self, other: Self) -> Self
Returns the vector projection of self onto other.
other must not be a zero vector.
§Panics
When assertions are enabled, this function panics if other is a zero
vector.
pub fn project_onto_normalized(self, other: Self) -> Self
pub fn project_onto_normalized(self, other: Self) -> Self
Returns the vector projection of self onto other.
other must be normalized.
§Panics
When assertions are enabled, this function panics if other is not
normalized.
pub fn reject_from(self, other: Self) -> Self
pub fn reject_from(self, other: Self) -> Self
Returns the vector rejection of self from other.
Vector rejection is the vector pointing from the projection to the
original vector. Basically: self - self.project_onto(other).
other must not be a zero vector.
§Panics
When assertions are enabled, this function panics if other is a zero
vector.
pub fn reject_from_normalized(self, other: Self) -> Self
pub fn reject_from_normalized(self, other: Self) -> Self
Returns the vector rejection of self from other.
Vector rejection is the vector pointing from the projection to the
original vector. Basically: self - self.project_onto(other).
other must be normalized.
§Panics
When assertions are enabled, this function panics if other is not
normalized.
§impl<A: Alignment> Vector<3, f64, A>
impl<A: Alignment> Vector<3, f64, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
pub fn any_orthogonal_vector(self) -> Self
pub fn any_orthogonal_vector(self) -> Self
Returns some vector that is orthogonal to self.
self must be finite and not a zero vector.
The output vector is not necessarily normalized. For that use
Self::any_orthonormal_vector() instead.
pub fn any_orthonormal_vector(self) -> Self
pub fn any_orthonormal_vector(self) -> Self
Returns some unit vector that is orthogonal to self.
self must normalized.
§Panics
When assertions are enabled, this function panics if self is not
normalized.
pub fn any_orthonormal_pair(self) -> (Self, Self)
pub fn any_orthonormal_pair(self) -> (Self, Self)
Returns two unit vectors that are orthogonal to self and to each
other.
Together with self, they form an orthonormal basis where the three
vectors are orthogonal to each other and are normalized.
§Panics
When assertions are enabled, this function panics if self is not
normalized.
§impl<const N: usize, A: Alignment> Vector<N, f64, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, f64, A>where
Length<N>: SupportedLength,
pub fn floor(self) -> Self
pub fn floor(self) -> Self
Rounds the components of self down.
pub fn ceil(self) -> Self
pub fn ceil(self) -> Self
Rounds the components of self up.
pub fn round(self) -> Self
pub fn round(self) -> Self
Rounds the components of self to the nearest integer.
pub fn trunc(self) -> Self
pub fn trunc(self) -> Self
Rounds the components of self towards zero.
pub fn fract(self) -> Self
pub fn fract(self) -> Self
Returns the fractional part of self.
This function is equivalent to self - self.trunc().
pub fn mul_add(self, a: Self, b: Self) -> Self
pub fn mul_add(self, a: Self, b: Self) -> Self
Fused Multiply Add. Computes self * a + b with only one rounding error
instead of two.
This is slower than an unfused multiply add for most target architectures.
This function is guaranteed to return the exact same value as the standard library.
pub fn div_euclid(self, rhs: Self) -> Self
pub fn div_euclid(self, rhs: Self) -> Self
Euclidiean Division.
This function is guaranteed to return the exact same value as the standard library.
pub fn rem_euclid(self, rhs: Self) -> Self
pub fn rem_euclid(self, rhs: Self) -> Self
Euclidiean Remainder.
This function is guaranteed to return the exact same value as the standard library.
pub fn sqrt(self) -> Self
pub fn sqrt(self) -> Self
Computes the square root of the components of self.
This function is guaranteed to return the exact same value as the standard library.
pub fn sin(self) -> Self
pub fn sin(self) -> Self
Computes the sine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn cos(self) -> Self
pub fn cos(self) -> Self
Computes the cosine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn tan(self) -> Self
pub fn tan(self) -> Self
Computes the tangent of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn asin(self) -> Self
pub fn asin(self) -> Self
Computes the arc sine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn acos(self) -> Self
pub fn acos(self) -> Self
Computes the arc cosine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn atan(self) -> Self
pub fn atan(self) -> Self
Computes the arc tangent of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn sin_cos(self) -> (Self, Self)
pub fn sin_cos(self) -> (Self, Self)
Simultaneously computes the sine and cosine of the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn move_towards(self, other: Self, max_delta: f64) -> Self
pub fn move_towards(self, other: Self, max_delta: f64) -> Self
Moves self towards other by the value max_delta.
When max_delta is 0.0, the result is self. When max_delta is
equal to or greater than self.distance(other), the result is other.
pub fn normalize(self) -> Self
pub fn normalize(self) -> Self
Returns a vector with the direction of self and length 1.0.
§Panics
When assertions are enabled, this function panics if the input is zero or if the result is non finite or zero.
pub fn try_normalize(self) -> Option<Self>
pub fn try_normalize(self) -> Option<Self>
Computes self.normalize or returns None if the
input is zero or if the result is non finite or zero.
pub fn normalize_or(self, fallback: Self) -> Self
pub fn normalize_or(self, fallback: Self) -> Self
Computes self.normalize or returns fallback if
the input is zero or if the result is non finite or zero.
pub fn normalize_or_zero(self) -> Self
pub fn normalize_or_zero(self) -> Self
Computes self.normalize or returns a zero vector if
the input is zero or if the result is non finite or zero.
pub fn normalize_and_length(self) -> (Self, f64)
pub fn normalize_and_length(self) -> (Self, f64)
Computes self.normalize() and
self.length().
If self is a zero vector, the function returns
(Self::ZERO, 0.0).
pub fn with_max_length(self, max: f64) -> Self
pub fn with_max_length(self, max: f64) -> Self
Returns self with a length of no more than max.
§Panics
When assertions are enabled, this function panics if max is negative.
pub fn with_min_length(self, min: f64) -> Self
pub fn with_min_length(self, min: f64) -> Self
Returns self with a length of no less than min.
§Panics
When assertions are enabled, this function panics if min is negative.
pub fn clamp_length(self, min: f64, max: f64) -> Self
pub fn clamp_length(self, min: f64, max: f64) -> Self
Returns self with a length of no less than min and no more than
max.
§Panics
When assertions are enabled, this function panics if min is greater
than max, or if either min or max are negative.
pub fn angle_between(self, other: Self) -> f64
pub fn angle_between(self, other: Self) -> f64
Computes the angle (in radians) between two vectors in the range
[0, +π].
The vectors do not need to be unit vectors but they do need to be non-zero.
This function has unspecified precision.
pub fn exp(self) -> Self
pub fn exp(self) -> Self
Computes the exponential function e^self for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn exp2(self) -> Self
pub fn exp2(self) -> Self
Computes 2^self for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn ln(self) -> Self
pub fn ln(self) -> Self
Computes the natural logarithm for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn log2(self) -> Self
pub fn log2(self) -> Self
Computes the base 2 logarithm for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn powf(self, n: f64) -> Self
pub fn powf(self, n: f64) -> Self
Computes self^n for the components of self.
This function has unspecified precision and may return a different value than the standard library.
pub fn refract(self, normal: Self, eta: f64) -> Self
pub fn refract(self, normal: Self, eta: f64) -> Self
Returns the vector refraction of self through normal and eta.
eta is the incident index divided by the transmitted index.
When total internal reflection occurs, this function returns a zero vector.
self and normal must be normalized.
§Panics
When assertions are enabled, this function panics if self or normal
are not normalized.
§impl<A: Alignment> Vector<3, f64, A>
impl<A: Alignment> Vector<3, f64, A>
§impl<const N: usize, A: Alignment> Vector<N, i8, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, i8, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> i8
pub fn element_sum(self) -> i8
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> i8
pub fn element_product(self) -> i8
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> i8
pub fn max_element(self) -> i8
Returns the maximum out of the elements of self.
pub fn min_element(self) -> i8
pub fn min_element(self) -> i8
Returns the minimum out of the elements of self.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
§Panics
When assertions or overflow checks are enabled, this function panics if
any input is T::MIN.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
0if the component is zero1if the component is positive-1if the component is negative
pub fn dot(self, rhs: Self) -> i8
pub fn dot(self, rhs: Self) -> i8
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> i8
pub fn length_squared(self) -> i8
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn distance_squared(self, other: Self) -> i8
pub fn distance_squared(self, other: Self) -> i8
Computes the squared euclidean distance between self and other.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero or overflow
occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero or overflow
occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Computes self / rhs, saturating at the numeric bounds instead of
overflowing.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
pub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Computes self / rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Computes self % rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
§impl<A: Alignment> Vector<3, i8, A>
impl<A: Alignment> Vector<3, i8, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
§impl<const N: usize, A: Alignment> Vector<N, i16, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, i16, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> i16
pub fn element_sum(self) -> i16
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> i16
pub fn element_product(self) -> i16
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> i16
pub fn max_element(self) -> i16
Returns the maximum out of the elements of self.
pub fn min_element(self) -> i16
pub fn min_element(self) -> i16
Returns the minimum out of the elements of self.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
§Panics
When assertions or overflow checks are enabled, this function panics if
any input is T::MIN.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
0if the component is zero1if the component is positive-1if the component is negative
pub fn dot(self, rhs: Self) -> i16
pub fn dot(self, rhs: Self) -> i16
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> i16
pub fn length_squared(self) -> i16
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn distance_squared(self, other: Self) -> i16
pub fn distance_squared(self, other: Self) -> i16
Computes the squared euclidean distance between self and other.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero or overflow
occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero or overflow
occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Computes self / rhs, saturating at the numeric bounds instead of
overflowing.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
pub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Computes self / rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Computes self % rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
§impl<A: Alignment> Vector<3, i16, A>
impl<A: Alignment> Vector<3, i16, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
§impl<const N: usize, A: Alignment> Vector<N, i32, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, i32, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> i32
pub fn element_sum(self) -> i32
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> i32
pub fn element_product(self) -> i32
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> i32
pub fn max_element(self) -> i32
Returns the maximum out of the elements of self.
pub fn min_element(self) -> i32
pub fn min_element(self) -> i32
Returns the minimum out of the elements of self.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
§Panics
When assertions or overflow checks are enabled, this function panics if
any input is T::MIN.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
0if the component is zero1if the component is positive-1if the component is negative
pub fn dot(self, rhs: Self) -> i32
pub fn dot(self, rhs: Self) -> i32
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> i32
pub fn length_squared(self) -> i32
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn distance_squared(self, other: Self) -> i32
pub fn distance_squared(self, other: Self) -> i32
Computes the squared euclidean distance between self and other.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero or overflow
occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero or overflow
occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Computes self / rhs, saturating at the numeric bounds instead of
overflowing.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
pub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Computes self / rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Computes self % rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
§impl<A: Alignment> Vector<3, i32, A>
impl<A: Alignment> Vector<3, i32, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
§impl<const N: usize, A: Alignment> Vector<N, i64, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, i64, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> i64
pub fn element_sum(self) -> i64
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> i64
pub fn element_product(self) -> i64
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> i64
pub fn max_element(self) -> i64
Returns the maximum out of the elements of self.
pub fn min_element(self) -> i64
pub fn min_element(self) -> i64
Returns the minimum out of the elements of self.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
§Panics
When assertions or overflow checks are enabled, this function panics if
any input is T::MIN.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
0if the component is zero1if the component is positive-1if the component is negative
pub fn dot(self, rhs: Self) -> i64
pub fn dot(self, rhs: Self) -> i64
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> i64
pub fn length_squared(self) -> i64
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn distance_squared(self, other: Self) -> i64
pub fn distance_squared(self, other: Self) -> i64
Computes the squared euclidean distance between self and other.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero or overflow
occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero or overflow
occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Computes self / rhs, saturating at the numeric bounds instead of
overflowing.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
pub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Computes self / rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Computes self % rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
§impl<A: Alignment> Vector<3, i64, A>
impl<A: Alignment> Vector<3, i64, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
§impl<const N: usize, A: Alignment> Vector<N, i128, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, i128, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> i128
pub fn element_sum(self) -> i128
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> i128
pub fn element_product(self) -> i128
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> i128
pub fn max_element(self) -> i128
Returns the maximum out of the elements of self.
pub fn min_element(self) -> i128
pub fn min_element(self) -> i128
Returns the minimum out of the elements of self.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
§Panics
When assertions or overflow checks are enabled, this function panics if
any input is T::MIN.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
0if the component is zero1if the component is positive-1if the component is negative
pub fn dot(self, rhs: Self) -> i128
pub fn dot(self, rhs: Self) -> i128
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> i128
pub fn length_squared(self) -> i128
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn distance_squared(self, other: Self) -> i128
pub fn distance_squared(self, other: Self) -> i128
Computes the squared euclidean distance between self and other.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero or overflow
occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero or overflow
occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Computes self / rhs, saturating at the numeric bounds instead of
overflowing.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
pub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Computes self / rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Computes self % rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
§impl<A: Alignment> Vector<3, i128, A>
impl<A: Alignment> Vector<3, i128, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
§impl<const N: usize, A: Alignment> Vector<N, isize, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, isize, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> isize
pub fn element_sum(self) -> isize
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> isize
pub fn element_product(self) -> isize
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> isize
pub fn max_element(self) -> isize
Returns the maximum out of the elements of self.
pub fn min_element(self) -> isize
pub fn min_element(self) -> isize
Returns the minimum out of the elements of self.
pub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns the absolute values of the components of self.
§Panics
When assertions or overflow checks are enabled, this function panics if
any input is T::MIN.
pub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns the signum of the components of self.
For each component:
0if the component is zero1if the component is positive-1if the component is negative
pub fn dot(self, rhs: Self) -> isize
pub fn dot(self, rhs: Self) -> isize
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> isize
pub fn length_squared(self) -> isize
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn distance_squared(self, other: Self) -> isize
pub fn distance_squared(self, other: Self) -> isize
Computes the squared euclidean distance between self and other.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero or overflow
occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero or overflow
occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Computes self / rhs, saturating at the numeric bounds instead of
overflowing.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
pub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Computes self / rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
pub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Computes self % rhs, wrapping around at the boundary of the type.
§Panics
This function will panic if rhs is zero.
§impl<A: Alignment> Vector<3, isize, A>
impl<A: Alignment> Vector<3, isize, A>
pub fn cross(self, rhs: Self) -> Self
pub fn cross(self, rhs: Self) -> Self
Computes the cross product of self and rhs.
§impl<const N: usize, A: Alignment> Vector<N, u8, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, u8, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> u8
pub fn element_sum(self) -> u8
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> u8
pub fn element_product(self) -> u8
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> u8
pub fn max_element(self) -> u8
Returns the maximum out of the elements of self.
pub fn min_element(self) -> u8
pub fn min_element(self) -> u8
Returns the minimum out of the elements of self.
pub fn dot(self, rhs: Self) -> u8
pub fn dot(self, rhs: Self) -> u8
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> u8
pub fn length_squared(self) -> u8
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
§impl<const N: usize, A: Alignment> Vector<N, u16, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, u16, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> u16
pub fn element_sum(self) -> u16
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> u16
pub fn element_product(self) -> u16
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> u16
pub fn max_element(self) -> u16
Returns the maximum out of the elements of self.
pub fn min_element(self) -> u16
pub fn min_element(self) -> u16
Returns the minimum out of the elements of self.
pub fn dot(self, rhs: Self) -> u16
pub fn dot(self, rhs: Self) -> u16
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> u16
pub fn length_squared(self) -> u16
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
§impl<const N: usize, A: Alignment> Vector<N, u32, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, u32, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> u32
pub fn element_sum(self) -> u32
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> u32
pub fn element_product(self) -> u32
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> u32
pub fn max_element(self) -> u32
Returns the maximum out of the elements of self.
pub fn min_element(self) -> u32
pub fn min_element(self) -> u32
Returns the minimum out of the elements of self.
pub fn dot(self, rhs: Self) -> u32
pub fn dot(self, rhs: Self) -> u32
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> u32
pub fn length_squared(self) -> u32
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
§impl<const N: usize, A: Alignment> Vector<N, u64, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, u64, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> u64
pub fn element_sum(self) -> u64
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> u64
pub fn element_product(self) -> u64
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> u64
pub fn max_element(self) -> u64
Returns the maximum out of the elements of self.
pub fn min_element(self) -> u64
pub fn min_element(self) -> u64
Returns the minimum out of the elements of self.
pub fn dot(self, rhs: Self) -> u64
pub fn dot(self, rhs: Self) -> u64
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> u64
pub fn length_squared(self) -> u64
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
§impl<const N: usize, A: Alignment> Vector<N, u128, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, u128, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> u128
pub fn element_sum(self) -> u128
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> u128
pub fn element_product(self) -> u128
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> u128
pub fn max_element(self) -> u128
Returns the maximum out of the elements of self.
pub fn min_element(self) -> u128
pub fn min_element(self) -> u128
Returns the minimum out of the elements of self.
pub fn dot(self, rhs: Self) -> u128
pub fn dot(self, rhs: Self) -> u128
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> u128
pub fn length_squared(self) -> u128
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
§impl<const N: usize, A: Alignment> Vector<N, usize, A>where
Length<N>: SupportedLength,
impl<const N: usize, A: Alignment> Vector<N, usize, A>where
Length<N>: SupportedLength,
pub fn element_sum(self) -> usize
pub fn element_sum(self) -> usize
Computes the sum of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any addition overflows (addition is performed in order).
pub fn element_product(self) -> usize
pub fn element_product(self) -> usize
Computes the product of the vector’s elements.
§Panics
When assertions are enabled, this function panics if any multiplication overflows (multiplication is performed in order).
pub fn max(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
Returns the maximum between the components of self and other.
pub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum between the components of self and other.
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn max_element(self) -> usize
pub fn max_element(self) -> usize
Returns the maximum out of the elements of self.
pub fn min_element(self) -> usize
pub fn min_element(self) -> usize
Returns the minimum out of the elements of self.
pub fn dot(self, rhs: Self) -> usize
pub fn dot(self, rhs: Self) -> usize
Computes the dot product of self and rhs.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn length_squared(self) -> usize
pub fn length_squared(self) -> usize
Computes the squared length/magnitude of self.
§Panics
When assertions or overflow checks are enabled, this function panics if an overflow occurs.
pub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Computes self + rhs, returning None if overflow occured.
pub fn checked_sub(self, rhs: Self) -> Option<Self>
pub fn checked_sub(self, rhs: Self) -> Option<Self>
Computes self - rhs, returning None if overflow occured.
pub fn checked_mul(self, rhs: Self) -> Option<Self>
pub fn checked_mul(self, rhs: Self) -> Option<Self>
Computes self * rhs, returning None if overflow occured.
pub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Computes self / rhs, returning None if division by zero occured.
pub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Computes self % rhs, returning None if division by zero occurred.
pub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Computes self + rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Computes self - rhs, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
pub fn saturating_mul(self, rhs: Self) -> Self
Computes self * rhs, saturating at the numeric bounds instead of
overflowing.
pub fn wrapping_add(self, rhs: Self) -> Self
pub fn wrapping_add(self, rhs: Self) -> Self
Computes self + rhs, wrapping around at the boundary of the type.
pub fn wrapping_sub(self, rhs: Self) -> Self
pub fn wrapping_sub(self, rhs: Self) -> Self
Computes self - rhs, wrapping around at the boundary of the type.
pub fn wrapping_mul(self, rhs: Self) -> Self
pub fn wrapping_mul(self, rhs: Self) -> Self
Computes self * rhs, wrapping around at the boundary of the type.
Source§impl<const N: usize, T, A: Alignment> Vector<N, T, A>
impl<const N: usize, T, A: Alignment> Vector<N, T, A>
Sourcepub const NEG_INFINITY: Self
pub const NEG_INFINITY: Self
All elements set to Negative Infinity (-∞).
Source§impl<T, A: Alignment> Vector<2, T, A>where
T: Scalar,
impl<T, A: Alignment> Vector<2, T, A>where
T: Scalar,
Sourcepub fn with_x(self, value: T) -> Self
pub fn with_x(self, value: T) -> Self
Returns the vector with the x component set to the given value.
Sourcepub fn with_y(self, value: T) -> Self
pub fn with_y(self, value: T) -> Self
Returns the vector with the y component set to the given value.
Source§impl<T, A: Alignment> Vector<3, T, A>where
T: Scalar,
impl<T, A: Alignment> Vector<3, T, A>where
T: Scalar,
Sourcepub fn with_x(self, value: T) -> Self
pub fn with_x(self, value: T) -> Self
Returns the vector with the x component set to the given value.
Sourcepub fn with_y(self, value: T) -> Self
pub fn with_y(self, value: T) -> Self
Returns the vector with the y component set to the given value.
Sourcepub fn with_z(self, value: T) -> Self
pub fn with_z(self, value: T) -> Self
Returns the vector with the z component set to the given value.
Sourcepub fn with_xy(self, value: Vector<2, T, A>) -> Self
pub fn with_xy(self, value: Vector<2, T, A>) -> Self
Returns the vector with the x and y components set to the given values.
Sourcepub fn with_xz(self, value: Vector<2, T, A>) -> Self
pub fn with_xz(self, value: Vector<2, T, A>) -> Self
Returns the vector with the x and z components set to the given values.
Sourcepub fn with_yx(self, value: Vector<2, T, A>) -> Self
pub fn with_yx(self, value: Vector<2, T, A>) -> Self
Returns the vector with the y and x components set to the given values.
Sourcepub fn with_yz(self, value: Vector<2, T, A>) -> Self
pub fn with_yz(self, value: Vector<2, T, A>) -> Self
Returns the vector with the y and z components set to the given values.
Sourcepub fn with_zx(self, value: Vector<2, T, A>) -> Self
pub fn with_zx(self, value: Vector<2, T, A>) -> Self
Returns the vector with the z and x components set to the given values.
Sourcepub fn with_zy(self, value: Vector<2, T, A>) -> Self
pub fn with_zy(self, value: Vector<2, T, A>) -> Self
Returns the vector with the z and y components set to the given values.
Sourcepub fn with_xyz(self, value: Vector<3, T, A>) -> Self
pub fn with_xyz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, y and z components set to the given values.
Sourcepub fn with_xzy(self, value: Vector<3, T, A>) -> Self
pub fn with_xzy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, z and y components set to the given values.
Sourcepub fn with_yxz(self, value: Vector<3, T, A>) -> Self
pub fn with_yxz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, x and z components set to the given values.
Sourcepub fn with_yzx(self, value: Vector<3, T, A>) -> Self
pub fn with_yzx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, z and x components set to the given values.
Source§impl<T, A: Alignment> Vector<4, T, A>where
T: Scalar,
impl<T, A: Alignment> Vector<4, T, A>where
T: Scalar,
Sourcepub fn with_x(self, value: T) -> Self
pub fn with_x(self, value: T) -> Self
Returns the vector with the x component set to the given value.
Sourcepub fn with_y(self, value: T) -> Self
pub fn with_y(self, value: T) -> Self
Returns the vector with the y component set to the given value.
Sourcepub fn with_z(self, value: T) -> Self
pub fn with_z(self, value: T) -> Self
Returns the vector with the z component set to the given value.
Sourcepub fn with_w(self, value: T) -> Self
pub fn with_w(self, value: T) -> Self
Returns the vector with the w component set to the given value.
Sourcepub fn with_xy(self, value: Vector<2, T, A>) -> Self
pub fn with_xy(self, value: Vector<2, T, A>) -> Self
Returns the vector with the x and y components set to the given values.
Sourcepub fn with_xz(self, value: Vector<2, T, A>) -> Self
pub fn with_xz(self, value: Vector<2, T, A>) -> Self
Returns the vector with the x and z components set to the given values.
Sourcepub fn with_xw(self, value: Vector<2, T, A>) -> Self
pub fn with_xw(self, value: Vector<2, T, A>) -> Self
Returns the vector with the x and w components set to the given values.
Sourcepub fn with_yx(self, value: Vector<2, T, A>) -> Self
pub fn with_yx(self, value: Vector<2, T, A>) -> Self
Returns the vector with the y and x components set to the given values.
Sourcepub fn with_yz(self, value: Vector<2, T, A>) -> Self
pub fn with_yz(self, value: Vector<2, T, A>) -> Self
Returns the vector with the y and z components set to the given values.
Sourcepub fn with_yw(self, value: Vector<2, T, A>) -> Self
pub fn with_yw(self, value: Vector<2, T, A>) -> Self
Returns the vector with the y and w components set to the given values.
Sourcepub fn with_zx(self, value: Vector<2, T, A>) -> Self
pub fn with_zx(self, value: Vector<2, T, A>) -> Self
Returns the vector with the z and x components set to the given values.
Sourcepub fn with_zy(self, value: Vector<2, T, A>) -> Self
pub fn with_zy(self, value: Vector<2, T, A>) -> Self
Returns the vector with the z and y components set to the given values.
Sourcepub fn with_zw(self, value: Vector<2, T, A>) -> Self
pub fn with_zw(self, value: Vector<2, T, A>) -> Self
Returns the vector with the z and w components set to the given values.
Sourcepub fn with_wx(self, value: Vector<2, T, A>) -> Self
pub fn with_wx(self, value: Vector<2, T, A>) -> Self
Returns the vector with the w and x components set to the given values.
Sourcepub fn with_wy(self, value: Vector<2, T, A>) -> Self
pub fn with_wy(self, value: Vector<2, T, A>) -> Self
Returns the vector with the w and y components set to the given values.
Sourcepub fn with_wz(self, value: Vector<2, T, A>) -> Self
pub fn with_wz(self, value: Vector<2, T, A>) -> Self
Returns the vector with the w and z components set to the given values.
Sourcepub fn with_xyz(self, value: Vector<3, T, A>) -> Self
pub fn with_xyz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, y and z components set to the given values.
Sourcepub fn with_xyw(self, value: Vector<3, T, A>) -> Self
pub fn with_xyw(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, y and w components set to the given values.
Sourcepub fn with_xzy(self, value: Vector<3, T, A>) -> Self
pub fn with_xzy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, z and y components set to the given values.
Sourcepub fn with_xzw(self, value: Vector<3, T, A>) -> Self
pub fn with_xzw(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, z and w components set to the given values.
Sourcepub fn with_xwy(self, value: Vector<3, T, A>) -> Self
pub fn with_xwy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, w and y components set to the given values.
Sourcepub fn with_xwz(self, value: Vector<3, T, A>) -> Self
pub fn with_xwz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the x, w and z components set to the given values.
Sourcepub fn with_yxz(self, value: Vector<3, T, A>) -> Self
pub fn with_yxz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, x and z components set to the given values.
Sourcepub fn with_yxw(self, value: Vector<3, T, A>) -> Self
pub fn with_yxw(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, x and w components set to the given values.
Sourcepub fn with_yzx(self, value: Vector<3, T, A>) -> Self
pub fn with_yzx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, z and x components set to the given values.
Sourcepub fn with_yzw(self, value: Vector<3, T, A>) -> Self
pub fn with_yzw(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, z and w components set to the given values.
Sourcepub fn with_ywx(self, value: Vector<3, T, A>) -> Self
pub fn with_ywx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, w and x components set to the given values.
Sourcepub fn with_ywz(self, value: Vector<3, T, A>) -> Self
pub fn with_ywz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the y, w and z components set to the given values.
Sourcepub fn with_zxy(self, value: Vector<3, T, A>) -> Self
pub fn with_zxy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the z, x and y components set to the given values.
Sourcepub fn with_zxw(self, value: Vector<3, T, A>) -> Self
pub fn with_zxw(self, value: Vector<3, T, A>) -> Self
Returns the vector with the z, x and w components set to the given values.
Sourcepub fn with_zyx(self, value: Vector<3, T, A>) -> Self
pub fn with_zyx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the z, y and x components set to the given values.
Sourcepub fn with_zyw(self, value: Vector<3, T, A>) -> Self
pub fn with_zyw(self, value: Vector<3, T, A>) -> Self
Returns the vector with the z, y and w components set to the given values.
Sourcepub fn with_zwx(self, value: Vector<3, T, A>) -> Self
pub fn with_zwx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the z, w and x components set to the given values.
Sourcepub fn with_zwy(self, value: Vector<3, T, A>) -> Self
pub fn with_zwy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the z, w and y components set to the given values.
Sourcepub fn with_wxy(self, value: Vector<3, T, A>) -> Self
pub fn with_wxy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the w, x and y components set to the given values.
Sourcepub fn with_wxz(self, value: Vector<3, T, A>) -> Self
pub fn with_wxz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the w, x and z components set to the given values.
Sourcepub fn with_wyx(self, value: Vector<3, T, A>) -> Self
pub fn with_wyx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the w, y and x components set to the given values.
Sourcepub fn with_wyz(self, value: Vector<3, T, A>) -> Self
pub fn with_wyz(self, value: Vector<3, T, A>) -> Self
Returns the vector with the w, y and z components set to the given values.
Sourcepub fn with_wzx(self, value: Vector<3, T, A>) -> Self
pub fn with_wzx(self, value: Vector<3, T, A>) -> Self
Returns the vector with the w, z and x components set to the given values.
Sourcepub fn with_wzy(self, value: Vector<3, T, A>) -> Self
pub fn with_wzy(self, value: Vector<3, T, A>) -> Self
Returns the vector with the w, z and y components set to the given values.
Sourcepub fn with_xyzw(self, value: Vector<4, T, A>) -> Self
pub fn with_xyzw(self, value: Vector<4, T, A>) -> Self
Returns the vector with the x, y, z and w components set to the given values.
Sourcepub fn with_xywz(self, value: Vector<4, T, A>) -> Self
pub fn with_xywz(self, value: Vector<4, T, A>) -> Self
Returns the vector with the x, y, w and z components set to the given values.
Sourcepub fn with_xzyw(self, value: Vector<4, T, A>) -> Self
pub fn with_xzyw(self, value: Vector<4, T, A>) -> Self
Returns the vector with the x, z, y and w components set to the given values.
Sourcepub fn with_xzwy(self, value: Vector<4, T, A>) -> Self
pub fn with_xzwy(self, value: Vector<4, T, A>) -> Self
Returns the vector with the x, z, w and y components set to the given values.
Sourcepub fn with_xwyz(self, value: Vector<4, T, A>) -> Self
pub fn with_xwyz(self, value: Vector<4, T, A>) -> Self
Returns the vector with the x, w, y and z components set to the given values.
Sourcepub fn with_xwzy(self, value: Vector<4, T, A>) -> Self
pub fn with_xwzy(self, value: Vector<4, T, A>) -> Self
Returns the vector with the x, w, z and y components set to the given values.
Sourcepub fn with_yxzw(self, value: Vector<4, T, A>) -> Self
pub fn with_yxzw(self, value: Vector<4, T, A>) -> Self
Returns the vector with the y, x, z and w components set to the given values.
Sourcepub fn with_yxwz(self, value: Vector<4, T, A>) -> Self
pub fn with_yxwz(self, value: Vector<4, T, A>) -> Self
Returns the vector with the y, x, w and z components set to the given values.
Sourcepub fn with_yzxw(self, value: Vector<4, T, A>) -> Self
pub fn with_yzxw(self, value: Vector<4, T, A>) -> Self
Returns the vector with the y, z, x and w components set to the given values.
Sourcepub fn with_yzwx(self, value: Vector<4, T, A>) -> Self
pub fn with_yzwx(self, value: Vector<4, T, A>) -> Self
Returns the vector with the y, z, w and x components set to the given values.
Sourcepub fn with_ywxz(self, value: Vector<4, T, A>) -> Self
pub fn with_ywxz(self, value: Vector<4, T, A>) -> Self
Returns the vector with the y, w, x and z components set to the given values.
Sourcepub fn with_ywzx(self, value: Vector<4, T, A>) -> Self
pub fn with_ywzx(self, value: Vector<4, T, A>) -> Self
Returns the vector with the y, w, z and x components set to the given values.
Sourcepub fn with_zxyw(self, value: Vector<4, T, A>) -> Self
pub fn with_zxyw(self, value: Vector<4, T, A>) -> Self
Returns the vector with the z, x, y and w components set to the given values.
Sourcepub fn with_zxwy(self, value: Vector<4, T, A>) -> Self
pub fn with_zxwy(self, value: Vector<4, T, A>) -> Self
Returns the vector with the z, x, w and y components set to the given values.
Sourcepub fn with_zyxw(self, value: Vector<4, T, A>) -> Self
pub fn with_zyxw(self, value: Vector<4, T, A>) -> Self
Returns the vector with the z, y, x and w components set to the given values.
Sourcepub fn with_zywx(self, value: Vector<4, T, A>) -> Self
pub fn with_zywx(self, value: Vector<4, T, A>) -> Self
Returns the vector with the z, y, w and x components set to the given values.
Sourcepub fn with_zwxy(self, value: Vector<4, T, A>) -> Self
pub fn with_zwxy(self, value: Vector<4, T, A>) -> Self
Returns the vector with the z, w, x and y components set to the given values.
Sourcepub fn with_zwyx(self, value: Vector<4, T, A>) -> Self
pub fn with_zwyx(self, value: Vector<4, T, A>) -> Self
Returns the vector with the z, w, y and x components set to the given values.
Sourcepub fn with_wxyz(self, value: Vector<4, T, A>) -> Self
pub fn with_wxyz(self, value: Vector<4, T, A>) -> Self
Returns the vector with the w, x, y and z components set to the given values.
Sourcepub fn with_wxzy(self, value: Vector<4, T, A>) -> Self
pub fn with_wxzy(self, value: Vector<4, T, A>) -> Self
Returns the vector with the w, x, z and y components set to the given values.
Sourcepub fn with_wyxz(self, value: Vector<4, T, A>) -> Self
pub fn with_wyxz(self, value: Vector<4, T, A>) -> Self
Returns the vector with the w, y, x and z components set to the given values.
Sourcepub fn with_wyzx(self, value: Vector<4, T, A>) -> Self
pub fn with_wyzx(self, value: Vector<4, T, A>) -> Self
Returns the vector with the w, y, z and x components set to the given values.
Trait Implementations§
Source§impl<const N: usize, T, A: Alignment> AddAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> AddAssign<T> for Vector<N, T, A>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+= operation. Read moreSource§impl<const N: usize, T, A: Alignment> AddAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> AddAssign for Vector<N, T, A>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<const N: usize, T, A: Alignment> BitAndAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> BitAndAssign<T> for Vector<N, T, A>
Source§fn bitand_assign(&mut self, rhs: T)
fn bitand_assign(&mut self, rhs: T)
&= operation. Read moreSource§impl<const N: usize, T, A: Alignment> BitAndAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> BitAndAssign for Vector<N, T, A>
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl<const N: usize, T, A: Alignment> BitOrAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> BitOrAssign<T> for Vector<N, T, A>
Source§fn bitor_assign(&mut self, rhs: T)
fn bitor_assign(&mut self, rhs: T)
|= operation. Read moreSource§impl<const N: usize, T, A: Alignment> BitOrAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> BitOrAssign for Vector<N, T, A>
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl<const N: usize, T, A: Alignment> BitXorAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> BitXorAssign<T> for Vector<N, T, A>
Source§fn bitxor_assign(&mut self, rhs: T)
fn bitxor_assign(&mut self, rhs: T)
^= operation. Read moreSource§impl<const N: usize, T, A: Alignment> BitXorAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> BitXorAssign for Vector<N, T, A>
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl<const N: usize, T, A: Alignment> DivAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> DivAssign<T> for Vector<N, T, A>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
/= operation. Read moreSource§impl<const N: usize, T, A: Alignment> DivAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> DivAssign for Vector<N, T, A>
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<T, A: Alignment> From<(T, T, T, T)> for Vector<4, T, A>where
T: Scalar,
impl<T, A: Alignment> From<(T, T, T, T)> for Vector<4, T, A>where
T: Scalar,
Source§fn from(value: (T, T, T, T)) -> Self
fn from(value: (T, T, T, T)) -> Self
Source§impl<T, A: Alignment> From<(Vector<2, T, A>, Vector<2, T, A>)> for Vector<4, T, A>where
T: Scalar,
impl<T, A: Alignment> From<(Vector<2, T, A>, Vector<2, T, A>)> for Vector<4, T, A>where
T: Scalar,
Source§impl<const N: usize, T, A: Alignment> MulAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> MulAssign<T> for Vector<N, T, A>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*= operation. Read moreSource§impl<const N: usize, T, A: Alignment> MulAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> MulAssign for Vector<N, T, A>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<const N: usize, T, A: Alignment> RemAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> RemAssign<T> for Vector<N, T, A>
Source§fn rem_assign(&mut self, rhs: T)
fn rem_assign(&mut self, rhs: T)
%= operation. Read moreSource§impl<const N: usize, T, A: Alignment> RemAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> RemAssign for Vector<N, T, A>
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%= operation. Read moreSource§impl<const N: usize, T, A: Alignment> ShlAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> ShlAssign<T> for Vector<N, T, A>
Source§fn shl_assign(&mut self, rhs: T)
fn shl_assign(&mut self, rhs: T)
<<= operation. Read moreSource§impl<const N: usize, T, A: Alignment> ShlAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> ShlAssign for Vector<N, T, A>
Source§fn shl_assign(&mut self, rhs: Self)
fn shl_assign(&mut self, rhs: Self)
<<= operation. Read moreSource§impl<const N: usize, T, A: Alignment> ShrAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> ShrAssign<T> for Vector<N, T, A>
Source§fn shr_assign(&mut self, rhs: T)
fn shr_assign(&mut self, rhs: T)
>>= operation. Read moreSource§impl<const N: usize, T, A: Alignment> ShrAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> ShrAssign for Vector<N, T, A>
Source§fn shr_assign(&mut self, rhs: Self)
fn shr_assign(&mut self, rhs: Self)
>>= operation. Read moreSource§impl<const N: usize, T, A: Alignment> SubAssign<T> for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> SubAssign<T> for Vector<N, T, A>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
-= operation. Read moreSource§impl<const N: usize, T, A: Alignment> SubAssign for Vector<N, T, A>
impl<const N: usize, T, A: Alignment> SubAssign for Vector<N, T, A>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read more