Skip to main content

Vector

Struct Vector 

Source
pub struct Vector<const N: usize, T, A: Alignment>(/* private fields */)
where
    Length<N>: SupportedLength,
    T: Scalar;
Expand description

A generic vector type.

Vector is the generic form of:

Vector is generic over:

  • N: Length (2, 3, or 4)
  • T: Scalar type (see Scalar)
  • A: Alignment (see Alignment)

To initialize vectors, use the macros vec2, vec3, vec4. To initialize a vector of an unknown length, use Vector::from_array.

§Guarantees

Vector<N, T, A> represents N consecutive values of T followed by optional padding due to alignment.

Padding bytes are initialized and accept any bit-pattern. It is sound to store any bit-pattern in padding, and it is unsound to assume that padding contains valid values of T unless T accepts all bit-patterns.

  • Vector<N, T, Unaligned>: has no padding, has no additional alignment.

  • Vector<2, T, Aligned>: has no padding, may have additional alignment.

  • Vector<3, T, Aligned>: may have one padding element, may have additional alignment.

  • Vector<4, T, Aligned>: has no padding, may have additional alignment.

Vectors of scalar types with the same Scalar::Repr are guaranteed to have compatible memory layouts, unless Repr = (). They are guaranteed to have the same size and element positions, but their alignment may differ.

Types containing Vector are not guaranteed to have the same memory layout as types containing equivalent arrays. For example, even though Vec2U<T> and [T; 2] have the same memory layout, Option<Vec2U<T>> and Option<[T; 2]> may not.

Implementations§

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const fn from_array(array: [T; N]) -> Self

Creates a vector from an array.

The preferable way to create vectors is using the macros vec2, vec3, vec4.

Vector::from_array should only be used when the length of the vector is unknown or when directly converting from an array.

Source

pub const fn splat(value: T) -> Self

Creates a vector with all components set to the given value.

Source

pub fn from_fn<F>(f: F) -> Self
where F: FnMut(usize) -> T,

Creates a vector by calling function f for each component index.

Equivalent to (f(0), f(1), f(2), ...).

Source

pub const fn to_alignment<A2: Alignment>(self) -> Vector<N, T, A2>

Converts the vector to the specified alignment.

See Alignment for more information.

Source

pub const fn align(self) -> Vector<N, T, Aligned>

Converts the vector to Aligned alignment.

See Alignment for more information.

Source

pub const fn unalign(self) -> Vector<N, T, Unaligned>

Converts the vector to Unaligned alignment.

See Alignment for more information.

Source

pub const fn to_array(self) -> [T; N]

Converts the vector to an array.

Source

pub const fn as_array_ref(&self) -> &[T; N]

Returns a reference to the vector’s components.

Source

pub const fn as_array_mut(&mut self) -> &mut [T; N]

Returns a mutable reference to the vector’s components.

Source

pub fn iter(self) -> IntoIter<T, N>

Returns an iterator over the vector’s components.

This method returns an iterator over T and not &T. to iterate over references use vec.as_array_ref().iter().

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator over mutable references to the vector’s components.

Source

pub fn map<T2, F>(self, f: F) -> Vector<N, T2, A>
where T2: Scalar, F: Fn(T) -> T2,

Creates a vector by calling function f for each component of the input vector.

Equivalent to (f(vec.x), f(vec.y), f(vec.z), ...).

§Example
use ggmath::{Vec3, vec3};

let vec: Vec3<f32> = vec3!(1.0, 2.0, 3.0);

assert_eq!(vec.map(|x| x * 2.0), vec3!(2.0, 4.0, 6.0));

assert_eq!(vec.map(|x| x.is_sign_negative()), vec3!(false, false, false));
Source

pub fn reverse(self) -> Self

Returns the vector’s components in reverse order.

§Example
use ggmath::{Vec3, vec3};

let vec: Vec3<f32> = vec3!(1.0, 2.0, 3.0);

assert_eq!(vec.reverse(), vec3!(3.0, 2.0, 1.0));
Source

pub fn eq_mask(self, other: Self) -> Mask<N, T, A>
where T: PartialEq,

Returns a mask where each component is true if the corresponding components of self and other are equal.

Equivalent to (self.x == other.x, self.y == other.y, ...).

Source

pub fn ne_mask(self, other: Self) -> Mask<N, T, A>
where T: PartialEq,

Returns a mask where each component is true if the corresponding components of self and other are not equal.

Equivalent to (self.x != other.x, self.y != other.y, ...).

Source

pub fn lt_mask(self, other: Self) -> Mask<N, T, A>
where T: PartialOrd,

Returns a mask where each component is true if the corresponding component of self is less than the corresponding component of other.

Equivalent to (self.x < other.x, self.y < other.y, ...).

Source

pub fn gt_mask(self, other: Self) -> Mask<N, T, A>
where T: PartialOrd,

Returns a mask where each component is true if the corresponding component of self is greater than the corresponding component of other.

Equivalent to (self.x > other.x, self.y > other.y, ...).

Source

pub fn le_mask(self, other: Self) -> Mask<N, T, A>
where T: PartialOrd,

Returns a mask where each component is true if the corresponding component of self is less than or equal to the corresponding component of other.

Equivalent to (self.x <= other.x, self.y <= other.y, ...).

Source

pub fn ge_mask(self, other: Self) -> Mask<N, T, A>
where T: PartialOrd,

Returns a mask where each component is true if the corresponding component of self is greater than or equal to the corresponding component of other.

Equivalent to (self.x >= other.x, self.y >= other.y, ...).

Source

pub const unsafe fn to_repr<T2>(self) -> Vector<N, T2, A>
where T2: Scalar<Repr = T::Repr>, T::Repr: SignedInteger,

Reinterprets the bits of the vector to a different scalar type.

The two scalar types must have compatible memory layouts. This is enforced via trait bounds in this function’s signature.

This function is used to make SIMD optimizations in implementations of Scalar.

§Safety

The components of the input must be valid for the output vector type.

For example, when converting vectors from u8 to bool the input components must be either 0 or 1.

The optional padding does not need to be a valid value of T2.

Source§

impl<const N: usize, A: Alignment> Vector<N, f32, A>

Source

pub fn is_nan(self) -> bool

Returns true if any of the vector’s components are NaN.

Source

pub fn nan_mask(self) -> Mask<N, f32, A>

Returns a mask where each component is true if the corresponding component of self is NaN (Not a Number).

Equivalent to (self.x.is_nan(), self.y.is_nan(), ...).

Source

pub fn is_finite(self) -> bool

Returns true if all of the vector’s components are finite.

Finite corresponds to not NaN and not positive/negative infinity.

Source

pub fn finite_mask(self) -> Mask<N, f32, A>

Returns a mask where each component is true if the corresponding component of self is finite.

Finite corresponds to not NaN and not positive/negative infinity.

Equivalent to (self.x.is_finite(), self.y.is_finite(), ...).

Source

pub fn sign_positive_mask(self) -> Mask<N, f32, A>

Returns a mask where each component is true if the corresponding component of self has a positive sign.

Equivalent to (self.x.is_sign_positive(), self.y.is_sign_positive(), ...).

Source

pub fn sign_negative_mask(self) -> Mask<N, f32, A>

Returns a mask where each component is true if the corresponding component of self has a negative sign.

Equivalent to (self.x.is_sign_negative(), self.y.is_sign_negative(), ...).

Source

pub fn recip(self) -> Self

Computes 1.0 / self.

Source

pub fn element_sum(self) -> f32

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

The order of addition is unspecified and may differ between target architectures.

Source

pub fn element_product(self) -> f32

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

The order of multiplication is unspecified and may differ between target architectures.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN, or if min > max.

Source

pub fn max_element(self) -> f32

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn min_element(self) -> f32

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 1.0 if the component is positive, +0.0 or INFINITY
  • -1.0 if the component is negative, -0.0 or NEG_INFINITY
  • NaN if the component is NaN
Source

pub fn copysign(self, sign: Self) -> Self

Returns a vector with the magnitudes of self and the signs of sign.

Equivalent to (self.x.copysign(sign.x), self.y.copysign(sign.y), ...).

Source

pub fn dot(self, rhs: Self) -> f32

Computes the dot product of self and rhs.

Source

pub fn length_squared(self) -> f32

Computes the squared length/magnitude of the vector.

Source

pub fn distance_squared(self, other: Self) -> f32

Computes the squared Euclidean distance between self and other.

Source

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.

Source

pub fn midpoint(self, other: Self) -> Self

Computes the middle point between self and other.

Equivalent to self.lerp(other, 0.5) but is cheaper to compute and may return a slightly different value.

Source

pub fn is_normalized(self) -> bool

Returns whether the vector has the length 1.0 or not.

This function uses a precision threshold of approximately 1e-4.

Source

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 (see the crate documentation):

Panics if other is a zero vector.

Source

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 (see the crate documentation):

Panics if other is not normalized.

Source

pub fn reject_from(self, other: Self) -> Self

Returns the vector rejection of self from other.

Corresponds to a vector pointing at self from the projection of self onto other, or simply self - self.project_onto(other).

other must not be a zero vector.

§Panics

When assertions are enabled (see the crate documentation):

Panics if other is a zero vector.

Source

pub fn reject_from_normalized(self, other: Self) -> Self

Returns the vector rejection of self from other.

Corresponds to a vector pointing at self from the projection of self onto other, or simply self - self.project_onto(other).

other must be normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if other is not normalized.

Source

pub fn reflect(self, normal: Self) -> Self

Returns the reflection of self through normal.

normal must be normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if normal is not normalized.

§Example
use ggmath::{Vec2, vec2};

let vec: Vec2<f32> = vec2!(1.0, 2.0);

assert_eq!(vec.reflect(Vec2::X), vec2!(-1.0, 2.0));
Source§

impl<A: Alignment> Vector<3, f32, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source

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 result is not necessarily normalized. For that use Self::any_orthonormal_vector() instead.

Source

pub fn any_orthonormal_vector(self) -> Self

Returns some unit vector that is orthogonal to self.

self must normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if self is not normalized.

Source

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 all orthogonal to each other and are normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if self is not normalized.

Source§

impl<const N: usize, A: Alignment> Vector<N, f32, A>

Source

pub fn floor(self) -> Self

Rounds the vector’s components down.

Source

pub fn ceil(self) -> Self

Rounds the vector’s components up.

Source

pub fn round(self) -> Self

Rounds the vector’s components to the nearest integer.

Source

pub fn trunc(self) -> Self

Rounds the vector’s components towards zero.

Source

pub fn fract(self) -> Self

Returns the fractional part of the vector.

Equivalent to self - self.trunc().

Source

pub fn mul_add(self, a: Self, b: Self) -> Self

Fused multiply-add. Computes (self * a) + b with only one rounding error, yielding a more accurate result than an unfused multiply-add.

Using mul_add is slower than an unfused multiply-add on most target architectures.

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result. It is specified by IEEE 754 as fusedMultiplyAdd and guaranteed not to change.

Source

pub fn div_euclid(self, rhs: Self) -> Self

Euclidiean Division.

Equivalent to (self.x.div_euclid(rhs.x), self.y.div_euclid(rhs.y), ...).

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result.

Source

pub fn rem_euclid(self, rhs: Self) -> Self

Euclidiean Remainder.

Equivalent to (self.x.rem_euclid(rhs.x), self.y.rem_euclid(rhs.y), ...).

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result.

Source

pub fn sqrt(self) -> Self

Returns the square root of the vector’s components.

Equivalent to (self.x.sqrt(), self.y.sqrt(), ...).

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result. It is specified by IEEE 754 as squareRoot and guaranteed not to change.

Source

pub fn sin(self) -> Self

Computes the sine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn cos(self) -> Self

Computes the cosine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn tan(self) -> Self

Computes the tangent of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn asin(self) -> Self

Computes the arcsine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn acos(self) -> Self

Computes the arccosine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn atan(self) -> Self

Computes the arctangent of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn sin_cos(self) -> (Self, Self)

Simultaneously computes the sine and cosine of the vector’s components.

Equivalent to (self.sin(), self.cos()) but may be more performant and might return a slightly different value.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn length(self) -> f32

Returns the length/magnitude of the vector.

Source

pub fn distance(self, other: Self) -> f32

Computes the Euclidean distance between self and other.

Source

pub fn move_towards(self, other: Self, max_delta: f32) -> Self

Moves self towards other by at most 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.

Source

pub fn normalize(self) -> Self

Returns a vector with the direction of self and length 1.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if the input is a zero vector, or if the result is non finite or zero.

Source

pub fn try_normalize(self) -> Option<Self>

Returns Self::normalize, or None if the input is zero or if the result is non finite or zero.

Source

pub fn normalize_or(self, fallback: Self) -> Self

Returns Self::normalize, or fallback if the input is zero or if the result is non finite or zero.

Source

pub fn normalize_or_zero(self) -> Self

Returns Self::normalize, or a zero vector if the input is zero or if the result is non finite.

Source

pub fn normalize_and_length(self) -> (Self, f32)

Simultaneously computes Self::normalize and Self::length.

If self is a zero vector, the result is (Self::ZERO, 0.0).

Source

pub fn with_max_length(self, max: f32) -> Self

Returns the input vector but with a length of no more than max.

§Panics

When assertions are enabled (see the crate documentation):

Panics if max is negative.

Source

pub fn with_min_length(self, min: f32) -> Self

Returns the input vector but with a length of no less than min.

§Panics

When assertions are enabled (see the crate documentation):

Panics if min is negative.

Source

pub fn clamp_length(self, min: f32, max: f32) -> Self

Returns the input vector buth with a length of no less than min and no more than max.

§Panics

When assertions are enabled (see the crate documentation):

Panics if min > max, or if min or max are negative.

Source

pub fn angle_between(self, other: Self) -> f32

Returns the angle (in radians) between self and other in the range [0, +π].

The vectors do not need to be unit vectors but they do need to be non-zero.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn exp(self) -> Self

Computes the exponential function e^self for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn exp2(self) -> Self

Computes 2^self for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn ln(self) -> Self

Computes the natural logarithm for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn log2(self) -> Self

Computes the base 2 logarithm for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn powf(self, n: f32) -> Self

Computes self^n for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn refract(self, normal: Self, eta: f32) -> Self

Returns the vector refraction of self through normal and eta.

eta is the incident refraction-index divided by the transmitted refraction-index.

When total internal reflection occurs, the result is a zero vector.

self and normal must be normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if self or normal are not normalized.

Source§

impl<A: Alignment> Vector<2, f32, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source

pub fn rotate(self, angle: f32) -> Self

Rotates self by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source§

impl<A: Alignment> Vector<3, f32, A>

Source

pub fn rotate_x(self, angle: f32) -> Self

Rotates self around the x axis by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn rotate_y(self, angle: f32) -> Self

Rotates self around the y axis by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn rotate_z(self, angle: f32) -> Self

Rotates self around the z axis by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source§

impl<const N: usize, A: Alignment> Vector<N, f64, A>

Source

pub fn is_nan(self) -> bool

Returns true if any of the vector’s components are NaN.

Source

pub fn nan_mask(self) -> Mask<N, f64, A>

Returns a mask where each component is true if the corresponding component of self is NaN (Not a Number).

Equivalent to (self.x.is_nan(), self.y.is_nan(), ...).

Source

pub fn is_finite(self) -> bool

Returns true if all of the vector’s components are finite.

Finite corresponds to not NaN and not positive/negative infinity.

Source

pub fn finite_mask(self) -> Mask<N, f64, A>

Returns a mask where each component is true if the corresponding component of self is finite.

Finite corresponds to not NaN and not positive/negative infinity.

Equivalent to (self.x.is_finite(), self.y.is_finite(), ...).

Source

pub fn sign_positive_mask(self) -> Mask<N, f64, A>

Returns a mask where each component is true if the corresponding component of self has a positive sign.

Equivalent to (self.x.is_sign_positive(), self.y.is_sign_positive(), ...).

Source

pub fn sign_negative_mask(self) -> Mask<N, f64, A>

Returns a mask where each component is true if the corresponding component of self has a negative sign.

Equivalent to (self.x.is_sign_negative(), self.y.is_sign_negative(), ...).

Source

pub fn recip(self) -> Self

Computes 1.0 / self.

Source

pub fn element_sum(self) -> f64

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

The order of addition is unspecified and may differ between target architectures.

Source

pub fn element_product(self) -> f64

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

The order of multiplication is unspecified and may differ between target architectures.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN, or if min > max.

Source

pub fn max_element(self) -> f64

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn min_element(self) -> f64

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

This function is not consistent with IEEE semantics in regards to NaN propagation and handling of -0.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if any input is NaN.

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 1.0 if the component is positive, +0.0 or INFINITY
  • -1.0 if the component is negative, -0.0 or NEG_INFINITY
  • NaN if the component is NaN
Source

pub fn copysign(self, sign: Self) -> Self

Returns a vector with the magnitudes of self and the signs of sign.

Equivalent to (self.x.copysign(sign.x), self.y.copysign(sign.y), ...).

Source

pub fn dot(self, rhs: Self) -> f64

Computes the dot product of self and rhs.

Source

pub fn length_squared(self) -> f64

Computes the squared length/magnitude of the vector.

Source

pub fn distance_squared(self, other: Self) -> f64

Computes the squared Euclidean distance between self and other.

Source

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.

Source

pub fn midpoint(self, other: Self) -> Self

Computes the middle point between self and other.

Equivalent to self.lerp(other, 0.5) but is cheaper to compute and may return a slightly different value.

Source

pub fn is_normalized(self) -> bool

Returns whether the vector has the length 1.0 or not.

This function uses a precision threshold of approximately 1e-4.

Source

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 (see the crate documentation):

Panics if other is a zero vector.

Source

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 (see the crate documentation):

Panics if other is not normalized.

Source

pub fn reject_from(self, other: Self) -> Self

Returns the vector rejection of self from other.

Corresponds to a vector pointing at self from the projection of self onto other, or simply self - self.project_onto(other).

other must not be a zero vector.

§Panics

When assertions are enabled (see the crate documentation):

Panics if other is a zero vector.

Source

pub fn reject_from_normalized(self, other: Self) -> Self

Returns the vector rejection of self from other.

Corresponds to a vector pointing at self from the projection of self onto other, or simply self - self.project_onto(other).

other must be normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if other is not normalized.

Source

pub fn reflect(self, normal: Self) -> Self

Returns the reflection of self through normal.

normal must be normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if normal is not normalized.

§Example
use ggmath::{Vec2, vec2};

let vec: Vec2<f32> = vec2!(1.0, 2.0);

assert_eq!(vec.reflect(Vec2::X), vec2!(-1.0, 2.0));
Source§

impl<A: Alignment> Vector<3, f64, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source

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 result is not necessarily normalized. For that use Self::any_orthonormal_vector() instead.

Source

pub fn any_orthonormal_vector(self) -> Self

Returns some unit vector that is orthogonal to self.

self must normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if self is not normalized.

Source

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 all orthogonal to each other and are normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if self is not normalized.

Source§

impl<const N: usize, A: Alignment> Vector<N, f64, A>

Source

pub fn floor(self) -> Self

Rounds the vector’s components down.

Source

pub fn ceil(self) -> Self

Rounds the vector’s components up.

Source

pub fn round(self) -> Self

Rounds the vector’s components to the nearest integer.

Source

pub fn trunc(self) -> Self

Rounds the vector’s components towards zero.

Source

pub fn fract(self) -> Self

Returns the fractional part of the vector.

Equivalent to self - self.trunc().

Source

pub fn mul_add(self, a: Self, b: Self) -> Self

Fused multiply-add. Computes (self * a) + b with only one rounding error, yielding a more accurate result than an unfused multiply-add.

Using mul_add is slower than an unfused multiply-add on most target architectures.

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result. It is specified by IEEE 754 as fusedMultiplyAdd and guaranteed not to change.

Source

pub fn div_euclid(self, rhs: Self) -> Self

Euclidiean Division.

Equivalent to (self.x.div_euclid(rhs.x), self.y.div_euclid(rhs.y), ...).

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result.

Source

pub fn rem_euclid(self, rhs: Self) -> Self

Euclidiean Remainder.

Equivalent to (self.x.rem_euclid(rhs.x), self.y.rem_euclid(rhs.y), ...).

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result.

Source

pub fn sqrt(self) -> Self

Returns the square root of the vector’s components.

Equivalent to (self.x.sqrt(), self.y.sqrt(), ...).

§Precision

The result of this operation is guaranteed to be the rounded infinite-precision result. It is specified by IEEE 754 as squareRoot and guaranteed not to change.

Source

pub fn sin(self) -> Self

Computes the sine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn cos(self) -> Self

Computes the cosine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn tan(self) -> Self

Computes the tangent of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn asin(self) -> Self

Computes the arcsine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn acos(self) -> Self

Computes the arccosine of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn atan(self) -> Self

Computes the arctangent of the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn sin_cos(self) -> (Self, Self)

Simultaneously computes the sine and cosine of the vector’s components.

Equivalent to (self.sin(), self.cos()) but may be more performant and might return a slightly different value.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn length(self) -> f64

Returns the length/magnitude of the vector.

Source

pub fn distance(self, other: Self) -> f64

Computes the Euclidean distance between self and other.

Source

pub fn move_towards(self, other: Self, max_delta: f64) -> Self

Moves self towards other by at most 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.

Source

pub fn normalize(self) -> Self

Returns a vector with the direction of self and length 1.0.

§Panics

When assertions are enabled (see the crate documentation):

Panics if the input is a zero vector, or if the result is non finite or zero.

Source

pub fn try_normalize(self) -> Option<Self>

Returns Self::normalize, or None if the input is zero or if the result is non finite or zero.

Source

pub fn normalize_or(self, fallback: Self) -> Self

Returns Self::normalize, or fallback if the input is zero or if the result is non finite or zero.

Source

pub fn normalize_or_zero(self) -> Self

Returns Self::normalize, or a zero vector if the input is zero or if the result is non finite.

Source

pub fn normalize_and_length(self) -> (Self, f64)

Simultaneously computes Self::normalize and Self::length.

If self is a zero vector, the result is (Self::ZERO, 0.0).

Source

pub fn with_max_length(self, max: f64) -> Self

Returns the input vector but with a length of no more than max.

§Panics

When assertions are enabled (see the crate documentation):

Panics if max is negative.

Source

pub fn with_min_length(self, min: f64) -> Self

Returns the input vector but with a length of no less than min.

§Panics

When assertions are enabled (see the crate documentation):

Panics if min is negative.

Source

pub fn clamp_length(self, min: f64, max: f64) -> Self

Returns the input vector buth with a length of no less than min and no more than max.

§Panics

When assertions are enabled (see the crate documentation):

Panics if min > max, or if min or max are negative.

Source

pub fn angle_between(self, other: Self) -> f64

Returns the angle (in radians) between self and other in the range [0, +π].

The vectors do not need to be unit vectors but they do need to be non-zero.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn exp(self) -> Self

Computes the exponential function e^self for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn exp2(self) -> Self

Computes 2^self for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn ln(self) -> Self

Computes the natural logarithm for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn log2(self) -> Self

Computes the base 2 logarithm for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn powf(self, n: f64) -> Self

Computes self^n for the vector’s components.

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn refract(self, normal: Self, eta: f64) -> Self

Returns the vector refraction of self through normal and eta.

eta is the incident refraction-index divided by the transmitted refraction-index.

When total internal reflection occurs, the result is a zero vector.

self and normal must be normalized.

§Panics

When assertions are enabled (see the crate documentation):

Panics if self or normal are not normalized.

Source§

impl<A: Alignment> Vector<2, f64, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source

pub fn rotate(self, angle: f64) -> Self

Rotates self by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source§

impl<A: Alignment> Vector<3, f64, A>

Source

pub fn rotate_x(self, angle: f64) -> Self

Rotates self around the x axis by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn rotate_y(self, angle: f64) -> Self

Rotates self around the y axis by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source

pub fn rotate_z(self, angle: f64) -> Self

Rotates self around the z axis by angle (in radians).

§Unspecified precision

The precision of this function is non-deterministic. This means it varies by platform, version, and can even differ within the same execution from one invocation to the next.

Source§

impl<const N: usize, A: Alignment> Vector<N, i8, A>

Source

pub fn element_sum(self) -> i8

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> i8

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> i8

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> i8

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if any component is $T::MIN.

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 0 if the component is zero
  • 1 if the component is positive
  • -1 if the component is negative
Source

pub fn dot(self, rhs: Self) -> i8

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> i8

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn distance_squared(self, other: Self) -> i8

Computes the squared Euclidean distance between self and other.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if overflow or division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if overflow or division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_div(self, rhs: Self) -> Self

Computes self / rhs, saturating at the numeric bounds instead of overflowing.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Computes self / rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Computes self % rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source§

impl<A: Alignment> Vector<2, i8, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source§

impl<A: Alignment> Vector<3, i8, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source§

impl<const N: usize, A: Alignment> Vector<N, i16, A>

Source

pub fn element_sum(self) -> i16

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> i16

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> i16

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> i16

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if any component is $T::MIN.

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 0 if the component is zero
  • 1 if the component is positive
  • -1 if the component is negative
Source

pub fn dot(self, rhs: Self) -> i16

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> i16

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn distance_squared(self, other: Self) -> i16

Computes the squared Euclidean distance between self and other.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if overflow or division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if overflow or division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_div(self, rhs: Self) -> Self

Computes self / rhs, saturating at the numeric bounds instead of overflowing.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Computes self / rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Computes self % rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source§

impl<A: Alignment> Vector<2, i16, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source§

impl<A: Alignment> Vector<3, i16, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source§

impl<const N: usize, A: Alignment> Vector<N, i32, A>

Source

pub fn element_sum(self) -> i32

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> i32

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> i32

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> i32

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if any component is $T::MIN.

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 0 if the component is zero
  • 1 if the component is positive
  • -1 if the component is negative
Source

pub fn dot(self, rhs: Self) -> i32

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> i32

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn distance_squared(self, other: Self) -> i32

Computes the squared Euclidean distance between self and other.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if overflow or division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if overflow or division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_div(self, rhs: Self) -> Self

Computes self / rhs, saturating at the numeric bounds instead of overflowing.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Computes self / rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Computes self % rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source§

impl<A: Alignment> Vector<2, i32, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source§

impl<A: Alignment> Vector<3, i32, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source§

impl<const N: usize, A: Alignment> Vector<N, i64, A>

Source

pub fn element_sum(self) -> i64

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> i64

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> i64

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> i64

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if any component is $T::MIN.

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 0 if the component is zero
  • 1 if the component is positive
  • -1 if the component is negative
Source

pub fn dot(self, rhs: Self) -> i64

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> i64

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn distance_squared(self, other: Self) -> i64

Computes the squared Euclidean distance between self and other.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if overflow or division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if overflow or division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_div(self, rhs: Self) -> Self

Computes self / rhs, saturating at the numeric bounds instead of overflowing.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Computes self / rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Computes self % rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source§

impl<A: Alignment> Vector<2, i64, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source§

impl<A: Alignment> Vector<3, i64, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source§

impl<const N: usize, A: Alignment> Vector<N, i128, A>

Source

pub fn element_sum(self) -> i128

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> i128

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> i128

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> i128

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if any component is $T::MIN.

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 0 if the component is zero
  • 1 if the component is positive
  • -1 if the component is negative
Source

pub fn dot(self, rhs: Self) -> i128

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> i128

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn distance_squared(self, other: Self) -> i128

Computes the squared Euclidean distance between self and other.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if overflow or division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if overflow or division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_div(self, rhs: Self) -> Self

Computes self / rhs, saturating at the numeric bounds instead of overflowing.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Computes self / rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Computes self % rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source§

impl<A: Alignment> Vector<2, i128, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source§

impl<A: Alignment> Vector<3, i128, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source§

impl<const N: usize, A: Alignment> Vector<N, isize, A>

Source

pub fn element_sum(self) -> isize

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> isize

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> isize

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> isize

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn abs(self) -> Self

Returns the absolute values of the vector’s components.

Equivalent to (self.x.abs(), self.y.abs(), ...).

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if any component is $T::MIN.

Source

pub fn signum(self) -> Self

Returns the signum of the vector’s components.

Equivalent to (self.x.signum(), self.y.signum(), ...).

For each component:

  • 0 if the component is zero
  • 1 if the component is positive
  • -1 if the component is negative
Source

pub fn dot(self, rhs: Self) -> isize

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> isize

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn distance_squared(self, other: Self) -> isize

Computes the squared Euclidean distance between self and other.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if overflow or division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if overflow or division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_div(self, rhs: Self) -> Self

Computes self / rhs, saturating at the numeric bounds instead of overflowing.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Computes self / rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Computes self % rhs, wrapping around at the boundary of the type.

§Panics

Panics if any component of rhs is 0.

Source§

impl<A: Alignment> Vector<2, isize, A>

Source

pub fn perp(self) -> Self

Returns self rotated by 90 degrees.

Source§

impl<A: Alignment> Vector<3, isize, A>

Source

pub fn cross(self, rhs: Self) -> Self

Computes the cross product of self and rhs.

Source§

impl<const N: usize, A: Alignment> Vector<N, u8, A>

Source

pub fn element_sum(self) -> u8

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> u8

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> u8

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> u8

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn dot(self, rhs: Self) -> u8

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> u8

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source§

impl<const N: usize, A: Alignment> Vector<N, u16, A>

Source

pub fn element_sum(self) -> u16

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> u16

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> u16

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> u16

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn dot(self, rhs: Self) -> u16

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> u16

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source§

impl<const N: usize, A: Alignment> Vector<N, u32, A>

Source

pub fn element_sum(self) -> u32

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> u32

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> u32

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> u32

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn dot(self, rhs: Self) -> u32

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> u32

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source§

impl<const N: usize, A: Alignment> Vector<N, u64, A>

Source

pub fn element_sum(self) -> u64

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> u64

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> u64

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> u64

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn dot(self, rhs: Self) -> u64

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> u64

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source§

impl<const N: usize, A: Alignment> Vector<N, u128, A>

Source

pub fn element_sum(self) -> u128

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> u128

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> u128

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> u128

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn dot(self, rhs: Self) -> u128

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> u128

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source§

impl<const N: usize, A: Alignment> Vector<N, usize, A>

Source

pub fn element_sum(self) -> usize

Computes the sum of the vector’s components.

Equivalent to self.x + self.y + ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any addition overflows. Addition is performed in order.

Source

pub fn element_product(self) -> usize

Computes the product of the vector’s components.

Equivalent to self.x * self.y * ....

§Panics

When assertions are enabled (see the crate documentation):

Panics if any multiplication overflows. Multiplication is performed in order.

Source

pub fn max(self, other: Self) -> Self

Returns the maximum between the components of self and other.

Equivalent to (self.x.max(other.x), self.y.max(other.y), ...).

Source

pub fn min(self, other: Self) -> Self

Returns the minimum between the components of self and other.

Equivalent to (self.x.min(other.x), self.y.min(other.y), ...).

Source

pub fn clamp(self, min: Self, max: Self) -> Self

Clamps the vector’s components between the components of min and max.

Equivalent to (self.x.clamp(min.x, max.x), self.y.clamp(min.y, max.y), ...).

§Panics

Panics if min > max.

Source

pub fn max_element(self) -> usize

Returns the maximum between the vector’s components.

Equivalent to self.x.max(self.y).max(self.z)....

Source

pub fn min_element(self) -> usize

Returns the minimum between the vector’s components.

Equivalent to self.x.min(self.y).min(self.z)....

Source

pub fn dot(self, rhs: Self) -> usize

Computes the dot product of self and rhs.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn length_squared(self) -> usize

Computes the squared length/magnitude of the vector.

§Panics

When assertions are enabled (see the crate documentation) or overflow checks are enabled:

Panics if an overflow occurs.

Source

pub fn checked_add(self, rhs: Self) -> Option<Self>

Computes self + rhs, returning None if overflow occured.

Source

pub fn checked_sub(self, rhs: Self) -> Option<Self>

Computes self - rhs, returning None if overflow occured.

Source

pub fn checked_mul(self, rhs: Self) -> Option<Self>

Computes self * rhs, returning None if overflow occured.

Source

pub fn checked_div(self, rhs: Self) -> Option<Self>

Computes self / rhs, returning None if division by zero occured.

Source

pub fn checked_rem(self, rhs: Self) -> Option<Self>

Computes self % rhs, returning None if division by zero occurred.

Source

pub fn saturating_add(self, rhs: Self) -> Self

Computes self + rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_sub(self, rhs: Self) -> Self

Computes self - rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn saturating_mul(self, rhs: Self) -> Self

Computes self * rhs, saturating at the numeric bounds instead of overflowing.

Source

pub fn wrapping_add(self, rhs: Self) -> Self

Computes self + rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_sub(self, rhs: Self) -> Self

Computes self - rhs, wrapping around at the boundary of the type.

Source

pub fn wrapping_mul(self, rhs: Self) -> Self

Computes self * rhs, wrapping around at the boundary of the type.

Source§

impl<const N: usize, A: Alignment> Vector<N, bool, A>

Source

pub fn all(self) -> bool

Returns true if all of the vector’s components are true.

Source

pub fn any(self) -> bool

Returns true if any of the vector’s components are true.

Source

pub fn select<T: Scalar>( self, if_true: Vector<N, T, A>, if_false: Vector<N, T, A>, ) -> Vector<N, T, A>

Selects between the components of if_true and if_false based on the boolean values of the vector.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const ZERO: Self

All 0.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + One,

Source

pub const ONE: Self

All 1.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const NEG_ONE: Self

All -1.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Min,

Source

pub const MIN: Self

All T::MIN.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Max,

Source

pub const MAX: Self

All T::MAX.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Nan,

Source

pub const NAN: Self

All NaN (Not a Number).

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const INFINITY: Self

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const NEG_INFINITY: Self

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const TRUE: Self

All true.

Source§

impl<const N: usize, T, A: Alignment> Vector<N, T, A>

Source

pub const FALSE: Self

All false.

Source§

impl<T, A: Alignment> Vector<2, T, A>
where T: Scalar + Zero + One,

Source

pub const X: Self

(1, 0).

Source

pub const Y: Self

(0, 1).

Source§

impl<T, A: Alignment> Vector<3, T, A>
where T: Scalar + Zero + One,

Source

pub const X: Self

(1, 0, 0).

Source

pub const Y: Self

(0, 1, 0).

Source

pub const Z: Self

(0, 0, 1).

Source§

impl<T, A: Alignment> Vector<4, T, A>
where T: Scalar + Zero + One,

Source

pub const X: Self

(1, 0, 0, 0).

Source

pub const Y: Self

(0, 1, 0, 0).

Source

pub const Z: Self

(0, 0, 1, 0).

Source

pub const W: Self

(0, 0, 0, 1).

Source§

impl<T, A: Alignment> Vector<2, T, A>
where T: Scalar + Zero + NegOne,

Source

pub const NEG_X: Self

(-1, 0).

Source

pub const NEG_Y: Self

(0, -1).

Source§

impl<T, A: Alignment> Vector<3, T, A>
where T: Scalar + Zero + NegOne,

Source

pub const NEG_X: Self

(-1, 0, 0).

Source

pub const NEG_Y: Self

(0, -1, 0).

Source

pub const NEG_Z: Self

(0, 0, -1).

Source§

impl<T, A: Alignment> Vector<4, T, A>
where T: Scalar + Zero + NegOne,

Source

pub const NEG_X: Self

(-1, 0, 0, 0).

Source

pub const NEG_Y: Self

(0, -1, 0, 0).

Source

pub const NEG_Z: Self

(0, 0, -1, 0).

Source

pub const NEG_W: Self

(0, 0, 0, -1).

Source§

impl<T, A: Alignment> Vector<2, T, A>
where T: Scalar,

Source

pub fn xx(self) -> Vector<2, T, A>

Returns (self.x, self.x).

Source

pub fn xy(self) -> Vector<2, T, A>

Returns (self.x, self.y).

Source

pub fn yx(self) -> Vector<2, T, A>

Returns (self.y, self.x).

Source

pub fn yy(self) -> Vector<2, T, A>

Returns (self.y, self.y).

Source

pub fn xxx(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.x).

Source

pub fn xxy(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.y).

Source

pub fn xyx(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.x).

Source

pub fn xyy(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.y).

Source

pub fn yxx(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.x).

Source

pub fn yxy(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.y).

Source

pub fn yyx(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.x).

Source

pub fn yyy(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.y).

Source

pub fn xxxx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.x).

Source

pub fn xxxy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.y).

Source

pub fn xxyx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.x).

Source

pub fn xxyy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.y).

Source

pub fn xyxx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.x).

Source

pub fn xyxy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.y).

Source

pub fn xyyx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.x).

Source

pub fn xyyy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.y).

Source

pub fn yxxx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.x).

Source

pub fn yxxy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.y).

Source

pub fn yxyx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.x).

Source

pub fn yxyy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.y).

Source

pub fn yyxx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.x).

Source

pub fn yyxy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.y).

Source

pub fn yyyx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.x).

Source

pub fn yyyy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.y).

Source

pub fn with_x(self, value: T) -> Self

Returns the vector with the x component set to the given value.

Source

pub fn with_y(self, value: T) -> Self

Returns the vector with the y component set to the given value.

Source

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.

Source

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.

Source§

impl<T, A: Alignment> Vector<3, T, A>
where T: Scalar,

Source

pub fn xx(self) -> Vector<2, T, A>

Returns (self.x, self.x).

Source

pub fn xy(self) -> Vector<2, T, A>

Returns (self.x, self.y).

Source

pub fn xz(self) -> Vector<2, T, A>

Returns (self.x, self.z).

Source

pub fn yx(self) -> Vector<2, T, A>

Returns (self.y, self.x).

Source

pub fn yy(self) -> Vector<2, T, A>

Returns (self.y, self.y).

Source

pub fn yz(self) -> Vector<2, T, A>

Returns (self.y, self.z).

Source

pub fn zx(self) -> Vector<2, T, A>

Returns (self.z, self.x).

Source

pub fn zy(self) -> Vector<2, T, A>

Returns (self.z, self.y).

Source

pub fn zz(self) -> Vector<2, T, A>

Returns (self.z, self.z).

Source

pub fn xxx(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.x).

Source

pub fn xxy(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.y).

Source

pub fn xxz(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.z).

Source

pub fn xyx(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.x).

Source

pub fn xyy(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.y).

Source

pub fn xyz(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.z).

Source

pub fn xzx(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.x).

Source

pub fn xzy(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.y).

Source

pub fn xzz(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.z).

Source

pub fn yxx(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.x).

Source

pub fn yxy(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.y).

Source

pub fn yxz(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.z).

Source

pub fn yyx(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.x).

Source

pub fn yyy(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.y).

Source

pub fn yyz(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.z).

Source

pub fn yzx(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.x).

Source

pub fn yzy(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.y).

Source

pub fn yzz(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.z).

Source

pub fn zxx(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.x).

Source

pub fn zxy(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.y).

Source

pub fn zxz(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.z).

Source

pub fn zyx(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.x).

Source

pub fn zyy(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.y).

Source

pub fn zyz(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.z).

Source

pub fn zzx(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.x).

Source

pub fn zzy(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.y).

Source

pub fn zzz(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.z).

Source

pub fn xxxx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.x).

Source

pub fn xxxy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.y).

Source

pub fn xxxz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.z).

Source

pub fn xxyx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.x).

Source

pub fn xxyy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.y).

Source

pub fn xxyz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.z).

Source

pub fn xxzx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.x).

Source

pub fn xxzy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.y).

Source

pub fn xxzz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.z).

Source

pub fn xyxx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.x).

Source

pub fn xyxy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.y).

Source

pub fn xyxz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.z).

Source

pub fn xyyx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.x).

Source

pub fn xyyy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.y).

Source

pub fn xyyz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.z).

Source

pub fn xyzx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.x).

Source

pub fn xyzy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.y).

Source

pub fn xyzz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.z).

Source

pub fn xzxx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.x).

Source

pub fn xzxy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.y).

Source

pub fn xzxz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.z).

Source

pub fn xzyx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.x).

Source

pub fn xzyy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.y).

Source

pub fn xzyz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.z).

Source

pub fn xzzx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.x).

Source

pub fn xzzy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.y).

Source

pub fn xzzz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.z).

Source

pub fn yxxx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.x).

Source

pub fn yxxy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.y).

Source

pub fn yxxz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.z).

Source

pub fn yxyx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.x).

Source

pub fn yxyy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.y).

Source

pub fn yxyz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.z).

Source

pub fn yxzx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.x).

Source

pub fn yxzy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.y).

Source

pub fn yxzz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.z).

Source

pub fn yyxx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.x).

Source

pub fn yyxy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.y).

Source

pub fn yyxz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.z).

Source

pub fn yyyx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.x).

Source

pub fn yyyy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.y).

Source

pub fn yyyz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.z).

Source

pub fn yyzx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.x).

Source

pub fn yyzy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.y).

Source

pub fn yyzz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.z).

Source

pub fn yzxx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.x).

Source

pub fn yzxy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.y).

Source

pub fn yzxz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.z).

Source

pub fn yzyx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.x).

Source

pub fn yzyy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.y).

Source

pub fn yzyz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.z).

Source

pub fn yzzx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.x).

Source

pub fn yzzy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.y).

Source

pub fn yzzz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.z).

Source

pub fn zxxx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.x).

Source

pub fn zxxy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.y).

Source

pub fn zxxz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.z).

Source

pub fn zxyx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.x).

Source

pub fn zxyy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.y).

Source

pub fn zxyz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.z).

Source

pub fn zxzx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.x).

Source

pub fn zxzy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.y).

Source

pub fn zxzz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.z).

Source

pub fn zyxx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.x).

Source

pub fn zyxy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.y).

Source

pub fn zyxz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.z).

Source

pub fn zyyx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.x).

Source

pub fn zyyy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.y).

Source

pub fn zyyz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.z).

Source

pub fn zyzx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.x).

Source

pub fn zyzy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.y).

Source

pub fn zyzz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.z).

Source

pub fn zzxx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.x).

Source

pub fn zzxy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.y).

Source

pub fn zzxz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.z).

Source

pub fn zzyx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.x).

Source

pub fn zzyy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.y).

Source

pub fn zzyz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.z).

Source

pub fn zzzx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.x).

Source

pub fn zzzy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.y).

Source

pub fn zzzz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.z).

Source

pub fn with_x(self, value: T) -> Self

Returns the vector with the x component set to the given value.

Source

pub fn with_y(self, value: T) -> Self

Returns the vector with the y component set to the given value.

Source

pub fn with_z(self, value: T) -> Self

Returns the vector with the z component set to the given value.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

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.

Source

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.

Source§

impl<T, A: Alignment> Vector<4, T, A>
where T: Scalar,

Source

pub fn xx(self) -> Vector<2, T, A>

Returns (self.x, self.x).

Source

pub fn xy(self) -> Vector<2, T, A>

Returns (self.x, self.y).

Source

pub fn xz(self) -> Vector<2, T, A>

Returns (self.x, self.z).

Source

pub fn xw(self) -> Vector<2, T, A>

Returns (self.x, self.w).

Source

pub fn yx(self) -> Vector<2, T, A>

Returns (self.y, self.x).

Source

pub fn yy(self) -> Vector<2, T, A>

Returns (self.y, self.y).

Source

pub fn yz(self) -> Vector<2, T, A>

Returns (self.y, self.z).

Source

pub fn yw(self) -> Vector<2, T, A>

Returns (self.y, self.w).

Source

pub fn zx(self) -> Vector<2, T, A>

Returns (self.z, self.x).

Source

pub fn zy(self) -> Vector<2, T, A>

Returns (self.z, self.y).

Source

pub fn zz(self) -> Vector<2, T, A>

Returns (self.z, self.z).

Source

pub fn zw(self) -> Vector<2, T, A>

Returns (self.z, self.w).

Source

pub fn wx(self) -> Vector<2, T, A>

Returns (self.w, self.x).

Source

pub fn wy(self) -> Vector<2, T, A>

Returns (self.w, self.y).

Source

pub fn wz(self) -> Vector<2, T, A>

Returns (self.w, self.z).

Source

pub fn ww(self) -> Vector<2, T, A>

Returns (self.w, self.w).

Source

pub fn xxx(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.x).

Source

pub fn xxy(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.y).

Source

pub fn xxz(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.z).

Source

pub fn xxw(self) -> Vector<3, T, A>

Returns (self.x, self.x, self.w).

Source

pub fn xyx(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.x).

Source

pub fn xyy(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.y).

Source

pub fn xyz(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.z).

Source

pub fn xyw(self) -> Vector<3, T, A>

Returns (self.x, self.y, self.w).

Source

pub fn xzx(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.x).

Source

pub fn xzy(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.y).

Source

pub fn xzz(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.z).

Source

pub fn xzw(self) -> Vector<3, T, A>

Returns (self.x, self.z, self.w).

Source

pub fn xwx(self) -> Vector<3, T, A>

Returns (self.x, self.w, self.x).

Source

pub fn xwy(self) -> Vector<3, T, A>

Returns (self.x, self.w, self.y).

Source

pub fn xwz(self) -> Vector<3, T, A>

Returns (self.x, self.w, self.z).

Source

pub fn xww(self) -> Vector<3, T, A>

Returns (self.x, self.w, self.w).

Source

pub fn yxx(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.x).

Source

pub fn yxy(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.y).

Source

pub fn yxz(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.z).

Source

pub fn yxw(self) -> Vector<3, T, A>

Returns (self.y, self.x, self.w).

Source

pub fn yyx(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.x).

Source

pub fn yyy(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.y).

Source

pub fn yyz(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.z).

Source

pub fn yyw(self) -> Vector<3, T, A>

Returns (self.y, self.y, self.w).

Source

pub fn yzx(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.x).

Source

pub fn yzy(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.y).

Source

pub fn yzz(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.z).

Source

pub fn yzw(self) -> Vector<3, T, A>

Returns (self.y, self.z, self.w).

Source

pub fn ywx(self) -> Vector<3, T, A>

Returns (self.y, self.w, self.x).

Source

pub fn ywy(self) -> Vector<3, T, A>

Returns (self.y, self.w, self.y).

Source

pub fn ywz(self) -> Vector<3, T, A>

Returns (self.y, self.w, self.z).

Source

pub fn yww(self) -> Vector<3, T, A>

Returns (self.y, self.w, self.w).

Source

pub fn zxx(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.x).

Source

pub fn zxy(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.y).

Source

pub fn zxz(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.z).

Source

pub fn zxw(self) -> Vector<3, T, A>

Returns (self.z, self.x, self.w).

Source

pub fn zyx(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.x).

Source

pub fn zyy(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.y).

Source

pub fn zyz(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.z).

Source

pub fn zyw(self) -> Vector<3, T, A>

Returns (self.z, self.y, self.w).

Source

pub fn zzx(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.x).

Source

pub fn zzy(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.y).

Source

pub fn zzz(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.z).

Source

pub fn zzw(self) -> Vector<3, T, A>

Returns (self.z, self.z, self.w).

Source

pub fn zwx(self) -> Vector<3, T, A>

Returns (self.z, self.w, self.x).

Source

pub fn zwy(self) -> Vector<3, T, A>

Returns (self.z, self.w, self.y).

Source

pub fn zwz(self) -> Vector<3, T, A>

Returns (self.z, self.w, self.z).

Source

pub fn zww(self) -> Vector<3, T, A>

Returns (self.z, self.w, self.w).

Source

pub fn wxx(self) -> Vector<3, T, A>

Returns (self.w, self.x, self.x).

Source

pub fn wxy(self) -> Vector<3, T, A>

Returns (self.w, self.x, self.y).

Source

pub fn wxz(self) -> Vector<3, T, A>

Returns (self.w, self.x, self.z).

Source

pub fn wxw(self) -> Vector<3, T, A>

Returns (self.w, self.x, self.w).

Source

pub fn wyx(self) -> Vector<3, T, A>

Returns (self.w, self.y, self.x).

Source

pub fn wyy(self) -> Vector<3, T, A>

Returns (self.w, self.y, self.y).

Source

pub fn wyz(self) -> Vector<3, T, A>

Returns (self.w, self.y, self.z).

Source

pub fn wyw(self) -> Vector<3, T, A>

Returns (self.w, self.y, self.w).

Source

pub fn wzx(self) -> Vector<3, T, A>

Returns (self.w, self.z, self.x).

Source

pub fn wzy(self) -> Vector<3, T, A>

Returns (self.w, self.z, self.y).

Source

pub fn wzz(self) -> Vector<3, T, A>

Returns (self.w, self.z, self.z).

Source

pub fn wzw(self) -> Vector<3, T, A>

Returns (self.w, self.z, self.w).

Source

pub fn wwx(self) -> Vector<3, T, A>

Returns (self.w, self.w, self.x).

Source

pub fn wwy(self) -> Vector<3, T, A>

Returns (self.w, self.w, self.y).

Source

pub fn wwz(self) -> Vector<3, T, A>

Returns (self.w, self.w, self.z).

Source

pub fn www(self) -> Vector<3, T, A>

Returns (self.w, self.w, self.w).

Source

pub fn xxxx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.x).

Source

pub fn xxxy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.y).

Source

pub fn xxxz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.z).

Source

pub fn xxxw(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.x, self.w).

Source

pub fn xxyx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.x).

Source

pub fn xxyy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.y).

Source

pub fn xxyz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.z).

Source

pub fn xxyw(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.y, self.w).

Source

pub fn xxzx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.x).

Source

pub fn xxzy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.y).

Source

pub fn xxzz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.z).

Source

pub fn xxzw(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.z, self.w).

Source

pub fn xxwx(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.w, self.x).

Source

pub fn xxwy(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.w, self.y).

Source

pub fn xxwz(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.w, self.z).

Source

pub fn xxww(self) -> Vector<4, T, A>

Returns (self.x, self.x, self.w, self.w).

Source

pub fn xyxx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.x).

Source

pub fn xyxy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.y).

Source

pub fn xyxz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.z).

Source

pub fn xyxw(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.x, self.w).

Source

pub fn xyyx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.x).

Source

pub fn xyyy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.y).

Source

pub fn xyyz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.z).

Source

pub fn xyyw(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.y, self.w).

Source

pub fn xyzx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.x).

Source

pub fn xyzy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.y).

Source

pub fn xyzz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.z).

Source

pub fn xyzw(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.z, self.w).

Source

pub fn xywx(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.w, self.x).

Source

pub fn xywy(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.w, self.y).

Source

pub fn xywz(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.w, self.z).

Source

pub fn xyww(self) -> Vector<4, T, A>

Returns (self.x, self.y, self.w, self.w).

Source

pub fn xzxx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.x).

Source

pub fn xzxy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.y).

Source

pub fn xzxz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.z).

Source

pub fn xzxw(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.x, self.w).

Source

pub fn xzyx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.x).

Source

pub fn xzyy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.y).

Source

pub fn xzyz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.z).

Source

pub fn xzyw(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.y, self.w).

Source

pub fn xzzx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.x).

Source

pub fn xzzy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.y).

Source

pub fn xzzz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.z).

Source

pub fn xzzw(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.z, self.w).

Source

pub fn xzwx(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.w, self.x).

Source

pub fn xzwy(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.w, self.y).

Source

pub fn xzwz(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.w, self.z).

Source

pub fn xzww(self) -> Vector<4, T, A>

Returns (self.x, self.z, self.w, self.w).

Source

pub fn xwxx(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.x, self.x).

Source

pub fn xwxy(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.x, self.y).

Source

pub fn xwxz(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.x, self.z).

Source

pub fn xwxw(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.x, self.w).

Source

pub fn xwyx(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.y, self.x).

Source

pub fn xwyy(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.y, self.y).

Source

pub fn xwyz(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.y, self.z).

Source

pub fn xwyw(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.y, self.w).

Source

pub fn xwzx(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.z, self.x).

Source

pub fn xwzy(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.z, self.y).

Source

pub fn xwzz(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.z, self.z).

Source

pub fn xwzw(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.z, self.w).

Source

pub fn xwwx(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.w, self.x).

Source

pub fn xwwy(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.w, self.y).

Source

pub fn xwwz(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.w, self.z).

Source

pub fn xwww(self) -> Vector<4, T, A>

Returns (self.x, self.w, self.w, self.w).

Source

pub fn yxxx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.x).

Source

pub fn yxxy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.y).

Source

pub fn yxxz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.z).

Source

pub fn yxxw(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.x, self.w).

Source

pub fn yxyx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.x).

Source

pub fn yxyy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.y).

Source

pub fn yxyz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.z).

Source

pub fn yxyw(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.y, self.w).

Source

pub fn yxzx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.x).

Source

pub fn yxzy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.y).

Source

pub fn yxzz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.z).

Source

pub fn yxzw(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.z, self.w).

Source

pub fn yxwx(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.w, self.x).

Source

pub fn yxwy(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.w, self.y).

Source

pub fn yxwz(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.w, self.z).

Source

pub fn yxww(self) -> Vector<4, T, A>

Returns (self.y, self.x, self.w, self.w).

Source

pub fn yyxx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.x).

Source

pub fn yyxy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.y).

Source

pub fn yyxz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.z).

Source

pub fn yyxw(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.x, self.w).

Source

pub fn yyyx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.x).

Source

pub fn yyyy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.y).

Source

pub fn yyyz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.z).

Source

pub fn yyyw(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.y, self.w).

Source

pub fn yyzx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.x).

Source

pub fn yyzy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.y).

Source

pub fn yyzz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.z).

Source

pub fn yyzw(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.z, self.w).

Source

pub fn yywx(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.w, self.x).

Source

pub fn yywy(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.w, self.y).

Source

pub fn yywz(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.w, self.z).

Source

pub fn yyww(self) -> Vector<4, T, A>

Returns (self.y, self.y, self.w, self.w).

Source

pub fn yzxx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.x).

Source

pub fn yzxy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.y).

Source

pub fn yzxz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.z).

Source

pub fn yzxw(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.x, self.w).

Source

pub fn yzyx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.x).

Source

pub fn yzyy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.y).

Source

pub fn yzyz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.z).

Source

pub fn yzyw(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.y, self.w).

Source

pub fn yzzx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.x).

Source

pub fn yzzy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.y).

Source

pub fn yzzz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.z).

Source

pub fn yzzw(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.z, self.w).

Source

pub fn yzwx(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.w, self.x).

Source

pub fn yzwy(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.w, self.y).

Source

pub fn yzwz(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.w, self.z).

Source

pub fn yzww(self) -> Vector<4, T, A>

Returns (self.y, self.z, self.w, self.w).

Source

pub fn ywxx(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.x, self.x).

Source

pub fn ywxy(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.x, self.y).

Source

pub fn ywxz(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.x, self.z).

Source

pub fn ywxw(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.x, self.w).

Source

pub fn ywyx(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.y, self.x).

Source

pub fn ywyy(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.y, self.y).

Source

pub fn ywyz(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.y, self.z).

Source

pub fn ywyw(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.y, self.w).

Source

pub fn ywzx(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.z, self.x).

Source

pub fn ywzy(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.z, self.y).

Source

pub fn ywzz(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.z, self.z).

Source

pub fn ywzw(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.z, self.w).

Source

pub fn ywwx(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.w, self.x).

Source

pub fn ywwy(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.w, self.y).

Source

pub fn ywwz(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.w, self.z).

Source

pub fn ywww(self) -> Vector<4, T, A>

Returns (self.y, self.w, self.w, self.w).

Source

pub fn zxxx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.x).

Source

pub fn zxxy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.y).

Source

pub fn zxxz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.z).

Source

pub fn zxxw(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.x, self.w).

Source

pub fn zxyx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.x).

Source

pub fn zxyy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.y).

Source

pub fn zxyz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.z).

Source

pub fn zxyw(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.y, self.w).

Source

pub fn zxzx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.x).

Source

pub fn zxzy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.y).

Source

pub fn zxzz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.z).

Source

pub fn zxzw(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.z, self.w).

Source

pub fn zxwx(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.w, self.x).

Source

pub fn zxwy(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.w, self.y).

Source

pub fn zxwz(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.w, self.z).

Source

pub fn zxww(self) -> Vector<4, T, A>

Returns (self.z, self.x, self.w, self.w).

Source

pub fn zyxx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.x).

Source

pub fn zyxy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.y).

Source

pub fn zyxz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.z).

Source

pub fn zyxw(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.x, self.w).

Source

pub fn zyyx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.x).

Source

pub fn zyyy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.y).

Source

pub fn zyyz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.z).

Source

pub fn zyyw(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.y, self.w).

Source

pub fn zyzx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.x).

Source

pub fn zyzy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.y).

Source

pub fn zyzz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.z).

Source

pub fn zyzw(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.z, self.w).

Source

pub fn zywx(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.w, self.x).

Source

pub fn zywy(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.w, self.y).

Source

pub fn zywz(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.w, self.z).

Source

pub fn zyww(self) -> Vector<4, T, A>

Returns (self.z, self.y, self.w, self.w).

Source

pub fn zzxx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.x).

Source

pub fn zzxy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.y).

Source

pub fn zzxz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.z).

Source

pub fn zzxw(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.x, self.w).

Source

pub fn zzyx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.x).

Source

pub fn zzyy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.y).

Source

pub fn zzyz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.z).

Source

pub fn zzyw(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.y, self.w).

Source

pub fn zzzx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.x).

Source

pub fn zzzy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.y).

Source

pub fn zzzz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.z).

Source

pub fn zzzw(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.z, self.w).

Source

pub fn zzwx(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.w, self.x).

Source

pub fn zzwy(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.w, self.y).

Source

pub fn zzwz(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.w, self.z).

Source

pub fn zzww(self) -> Vector<4, T, A>

Returns (self.z, self.z, self.w, self.w).

Source

pub fn zwxx(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.x, self.x).

Source

pub fn zwxy(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.x, self.y).

Source

pub fn zwxz(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.x, self.z).

Source

pub fn zwxw(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.x, self.w).

Source

pub fn zwyx(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.y, self.x).

Source

pub fn zwyy(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.y, self.y).

Source

pub fn zwyz(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.y, self.z).

Source

pub fn zwyw(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.y, self.w).

Source

pub fn zwzx(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.z, self.x).

Source

pub fn zwzy(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.z, self.y).

Source

pub fn zwzz(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.z, self.z).

Source

pub fn zwzw(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.z, self.w).

Source

pub fn zwwx(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.w, self.x).

Source

pub fn zwwy(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.w, self.y).

Source

pub fn zwwz(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.w, self.z).

Source

pub fn zwww(self) -> Vector<4, T, A>

Returns (self.z, self.w, self.w, self.w).

Source

pub fn wxxx(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.x, self.x).

Source

pub fn wxxy(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.x, self.y).

Source

pub fn wxxz(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.x, self.z).

Source

pub fn wxxw(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.x, self.w).

Source

pub fn wxyx(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.y, self.x).

Source

pub fn wxyy(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.y, self.y).

Source

pub fn wxyz(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.y, self.z).

Source

pub fn wxyw(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.y, self.w).

Source

pub fn wxzx(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.z, self.x).

Source

pub fn wxzy(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.z, self.y).

Source

pub fn wxzz(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.z, self.z).

Source

pub fn wxzw(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.z, self.w).

Source

pub fn wxwx(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.w, self.x).

Source

pub fn wxwy(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.w, self.y).

Source

pub fn wxwz(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.w, self.z).

Source

pub fn wxww(self) -> Vector<4, T, A>

Returns (self.w, self.x, self.w, self.w).

Source

pub fn wyxx(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.x, self.x).

Source

pub fn wyxy(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.x, self.y).

Source

pub fn wyxz(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.x, self.z).

Source

pub fn wyxw(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.x, self.w).

Source

pub fn wyyx(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.y, self.x).

Source

pub fn wyyy(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.y, self.y).

Source

pub fn wyyz(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.y, self.z).

Source

pub fn wyyw(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.y, self.w).

Source

pub fn wyzx(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.z, self.x).

Source

pub fn wyzy(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.z, self.y).

Source

pub fn wyzz(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.z, self.z).

Source

pub fn wyzw(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.z, self.w).

Source

pub fn wywx(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.w, self.x).

Source

pub fn wywy(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.w, self.y).

Source

pub fn wywz(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.w, self.z).

Source

pub fn wyww(self) -> Vector<4, T, A>

Returns (self.w, self.y, self.w, self.w).

Source

pub fn wzxx(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.x, self.x).

Source

pub fn wzxy(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.x, self.y).

Source

pub fn wzxz(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.x, self.z).

Source

pub fn wzxw(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.x, self.w).

Source

pub fn wzyx(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.y, self.x).

Source

pub fn wzyy(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.y, self.y).

Source

pub fn wzyz(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.y, self.z).

Source

pub fn wzyw(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.y, self.w).

Source

pub fn wzzx(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.z, self.x).

Source

pub fn wzzy(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.z, self.y).

Source

pub fn wzzz(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.z, self.z).

Source

pub fn wzzw(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.z, self.w).

Source

pub fn wzwx(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.w, self.x).

Source

pub fn wzwy(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.w, self.y).

Source

pub fn wzwz(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.w, self.z).

Source

pub fn wzww(self) -> Vector<4, T, A>

Returns (self.w, self.z, self.w, self.w).

Source

pub fn wwxx(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.x, self.x).

Source

pub fn wwxy(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.x, self.y).

Source

pub fn wwxz(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.x, self.z).

Source

pub fn wwxw(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.x, self.w).

Source

pub fn wwyx(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.y, self.x).

Source

pub fn wwyy(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.y, self.y).

Source

pub fn wwyz(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.y, self.z).

Source

pub fn wwyw(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.y, self.w).

Source

pub fn wwzx(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.z, self.x).

Source

pub fn wwzy(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.z, self.y).

Source

pub fn wwzz(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.z, self.z).

Source

pub fn wwzw(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.z, self.w).

Source

pub fn wwwx(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.w, self.x).

Source

pub fn wwwy(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.w, self.y).

Source

pub fn wwwz(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.w, self.z).

Source

pub fn wwww(self) -> Vector<4, T, A>

Returns (self.w, self.w, self.w, self.w).

Source

pub fn with_x(self, value: T) -> Self

Returns the vector with the x component set to the given value.

Source

pub fn with_y(self, value: T) -> Self

Returns the vector with the y component set to the given value.

Source

pub fn with_z(self, value: T) -> Self

Returns the vector with the z component set to the given value.

Source

pub fn with_w(self, value: T) -> Self

Returns the vector with the w component set to the given value.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn with_wzxy(self, value: Vector<4, T, A>) -> Self

Returns the vector with the w, z, x and y components set to the given values.

Source

pub fn with_wzyx(self, value: Vector<4, T, A>) -> Self

Returns the vector with the w, z, y and x components set to the given values.

Trait Implementations§

Source§

impl<const N: usize, T, A: Alignment> Add<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Add<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Add for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Add<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<const N: usize, T, A: Alignment> AddAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Add<Output = T>,

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl<const N: usize, T, A: Alignment> AddAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Add<Output = T>,

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitAnd<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitAnd<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: T) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitAnd for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitAnd<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitAndAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitAnd<Output = T>,

Source§

fn bitand_assign(&mut self, rhs: T)

Performs the &= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitAndAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitAnd<Output = T>,

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitOr<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitOr<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: T) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitOr for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitOr<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitOrAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitOr<Output = T>,

Source§

fn bitor_assign(&mut self, rhs: T)

Performs the |= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitOrAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitOr<Output = T>,

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitXor<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitXor<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: T) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitXor for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitXor<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitXorAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitXor<Output = T>,

Source§

fn bitxor_assign(&mut self, rhs: T)

Performs the ^= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> BitXorAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + BitXor<Output = T>,

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Clone for Vector<N, T, A>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const N: usize, T, A: Alignment> Debug for Vector<N, T, A>

Source§

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

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

impl<const N: usize, T, A: Alignment> Default for Vector<N, T, A>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T, A: Alignment> Deref for Vector<2, T, A>
where T: Scalar,

Source§

type Target = Xy<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T, A: Alignment> Deref for Vector<3, T, A>
where T: Scalar,

Source§

type Target = Xyz<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T, A: Alignment> Deref for Vector<4, T, A>
where T: Scalar,

Source§

type Target = Xyzw<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T, A: Alignment> DerefMut for Vector<2, T, A>
where T: Scalar,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T, A: Alignment> DerefMut for Vector<3, T, A>
where T: Scalar,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T, A: Alignment> DerefMut for Vector<4, T, A>
where T: Scalar,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<const N: usize, T, A: Alignment> Display for Vector<N, T, A>

Source§

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

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

impl<const N: usize, T, A: Alignment> Div<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Div<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Div for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Div<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<const N: usize, T, A: Alignment> DivAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Div<Output = T>,

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> DivAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Div<Output = T>,

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<T, A: Alignment> From<(T,)> for Vector<2, T, A>
where T: Scalar,

Source§

fn from(value: (T,)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T,)> for Vector<3, T, A>
where T: Scalar,

Source§

fn from(value: (T,)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T,)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (T,)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T, T)> for Vector<2, T, A>
where T: Scalar,

Source§

fn from(value: (T, T)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T, T, T)> for Vector<3, T, A>
where T: Scalar,

Source§

fn from(value: (T, T, T)) -> Self

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T, T, Vector<2, T, A>)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (T, T, Vector<2, T, A>)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T, Vector<2, T, A>)> for Vector<3, T, A>
where T: Scalar,

Source§

fn from(value: (T, Vector<2, T, A>)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T, Vector<2, T, A>, T)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (T, Vector<2, T, A>, T)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(T, Vector<3, T, A>)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (T, Vector<3, T, A>)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<2, T, A>,)> for Vector<2, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<2, T, A>,)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<2, T, A>, T)> for Vector<3, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<2, T, A>, T)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<2, T, A>, T, T)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<2, T, A>, T, T)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<2, T, A>, Vector<2, T, A>)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<2, T, A>, Vector<2, T, A>)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<3, T, A>,)> for Vector<3, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<3, T, A>,)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<3, T, A>, T)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<3, T, A>, T)) -> Self

Converts to this type from the input type.
Source§

impl<T, A: Alignment> From<(Vector<4, T, A>,)> for Vector<4, T, A>
where T: Scalar,

Source§

fn from(value: (Vector<4, T, A>,)) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize, T, A: Alignment> Hash for Vector<N, T, A>

Source§

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

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

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

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

impl<const N: usize, T, A: Alignment> Index<usize> for Vector<N, T, A>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

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

impl<const N: usize, T, A: Alignment> IndexMut<usize> for Vector<N, T, A>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

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

impl<const N: usize, T, A: Alignment> IntoIterator for &Vector<N, T, A>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = <[T; N] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, const N: usize, T, A: Alignment> IntoIterator for &'a mut Vector<N, T, A>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = <&'a mut [T; N] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<const N: usize, T, A: Alignment> IntoIterator for Vector<N, T, A>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = <[T; N] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<const N: usize, T, A: Alignment> Mul<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Mul<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Mul for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Mul<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<const N: usize, T, A: Alignment> MulAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Mul<Output = T>,

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> MulAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Mul<Output = T>,

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Neg for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Neg<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Not for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Not<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<const N: usize, T, A: Alignment> PartialEq for Vector<N, T, A>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize, T, A: Alignment> Rem<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Rem<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: T) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Rem for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Rem<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<const N: usize, T, A: Alignment> RemAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Rem<Output = T>,

Source§

fn rem_assign(&mut self, rhs: T)

Performs the %= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> RemAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Rem<Output = T>,

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Shl<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shl<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: T) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Shl for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shl<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Self) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize, T, A: Alignment> ShlAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shl<Output = T>,

Source§

fn shl_assign(&mut self, rhs: T)

Performs the <<= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> ShlAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shl<Output = T>,

Source§

fn shl_assign(&mut self, rhs: Self)

Performs the <<= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Shr<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shr<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: T) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Shr for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shr<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Self) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize, T, A: Alignment> ShrAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shr<Output = T>,

Source§

fn shr_assign(&mut self, rhs: T)

Performs the >>= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> ShrAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Shr<Output = T>,

Source§

fn shr_assign(&mut self, rhs: Self)

Performs the >>= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Sub<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Sub<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Sub for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Sub<Output = T>,

Source§

type Output = Vector<N, T, A>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<const N: usize, T, A: Alignment> SubAssign<T> for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Sub<Output = T>,

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> SubAssign for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Sub<Output = T>,

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<const N: usize, T, A: Alignment> Copy for Vector<N, T, A>

Source§

impl<const N: usize, T, A: Alignment> Eq for Vector<N, T, A>
where Length<N>: SupportedLength, T: Scalar + Eq,

Source§

impl<const N: usize, T, A: Alignment> RefUnwindSafe for Vector<N, T, A>

Source§

impl<const N: usize, T, A: Alignment> Send for Vector<N, T, A>

Source§

impl<const N: usize, T, A: Alignment> Sync for Vector<N, T, A>

Source§

impl<const N: usize, T, A: Alignment> Unpin for Vector<N, T, A>

Source§

impl<const N: usize, T, A: Alignment> UnwindSafe for Vector<N, T, A>

Auto Trait Implementations§

§

impl<const N: usize, T, A> Freeze for Vector<N, T, A>
where <<T as Scalar>::Repr as ScalarRepr>::VectorRepr<N, T, A>: Freeze,

§

impl<const N: usize, T, A> UnsafeUnpin for Vector<N, T, A>
where <<T as Scalar>::Repr as ScalarRepr>::VectorRepr<N, T, A>: UnsafeUnpin,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.