Struct vectory::V4xf64 [−][src]
A 4D vector type with elements of type f64
.
Fields
x: f64
y: f64
z: f64
w: f64
Implementations
impl V4xf64
[src]
pub const LANES: usize
[src]
The number of lanes in this vector.
pub const ZERO: V4xf64
[src]
A vector with all its elements set to zero.
pub const ONE: V4xf64
[src]
A vector with all its elements set to one.
pub fn new(x: f64, y: f64, z: f64, w: f64) -> Self
[src]
Constructs a new vector with the given values.
pub fn splat(value: f64) -> Self
[src]
Construct a new vector by setting each of its element to the given value.
pub fn unit_x() -> V4xf64
[src]
Returns a unit vector which points along the x
axis.
pub fn unit_y() -> V4xf64
[src]
Returns a unit vector which points along the y
axis.
pub fn unit_z() -> V4xf64
[src]
Returns a unit vector which points along the z
axis.
pub fn unit_w() -> V4xf64
[src]
Returns a unit vector which points along the w
axis.
pub fn as_slice(&self) -> &[f64]
[src]
Views this vector as an immutable slice.
pub fn as_mut_slice(&mut self) -> &mut [f64]
[src]
Views this vector as a mutable slice.
pub fn sum(self) -> f64
[src]
Returns the sum of all elements in this vector.
pub fn product(self) -> f64
[src]
Returns the product of all elements in this vector.
pub fn dot(self, other: Self) -> f64
[src]
Returns the dot product between self
and other
.
pub fn length_squared(self) -> f64
[src]
Returns the sqaured length of this vector.
pub fn length(self) -> f64
[src]
Returns the length of this vector.
pub fn length_recip(self) -> f64
[src]
pub fn distance_squared(self, other: Self) -> f64
[src]
Returns the squared euclidean distance between two points.
pub fn distance(self, other: Self) -> f64
[src]
Returns the euclidean distance between two points.
pub fn min(self, other: Self) -> Self
[src]
Returns a vector containing the mininum values for each elements of self
and other
.
pub fn max(self, other: Self) -> Self
[src]
Returns a vector containing the maximun values for each elements of self
and other
.
pub fn min_elem(self) -> f64
[src]
Returns the smallest element in this vector.
pub fn max_elem(self) -> f64
[src]
Returns the largest element in this vector.
pub fn apply<F>(&mut self, f: F) where
F: FnMut(f64) -> f64,
[src]
F: FnMut(f64) -> f64,
Applies the function f
to each element in order, in-place.
pub fn abs(self) -> Self
[src]
Computes the absolute value of self.
pub fn normalize(self) -> Self
[src]
Returns a normalized self
whose length is equal to 1.
pub fn clamp(self, min: Self, max: Self) -> Self
[src]
Restricts each element in self
to a certain interval given by the
corresponing element in min
and max
.
Panics
For each corresponing element in min
and max
, panics if min > max
, min
is NaN, or max
is NaN.
pub fn is_nan(self) -> bool
[src]
Returns true
if any elements are NaN
.
Trait Implementations
impl Add<V4xf64> for V4xf64
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl Add<V4xf64> for f64
[src]
type Output = V4xf64
The resulting type after applying the +
operator.
fn add(self, rhs: V4xf64) -> Self::Output
[src]
impl AddAssign<V4xf64> for V4xf64
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl AsMut<[f64]> for V4xf64
[src]
impl AsMut<V4xf64> for V4xf64
[src]
impl AsRef<[f64]> for V4xf64
[src]
impl AsRef<V4xf64> for V4xf64
[src]
impl Borrow<[f64]> for V4xf64
[src]
impl BorrowMut<[f64]> for V4xf64
[src]
fn borrow_mut(&mut self) -> &mut [f64]
[src]
impl Clone for V4xf64
[src]
impl Copy for V4xf64
[src]
impl Deref for V4xf64
[src]
impl DerefMut for V4xf64
[src]
impl Div<V4xf64> for V4xf64
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl Div<f64> for V4xf64
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: f64) -> Self::Output
[src]
impl DivAssign<V4xf64> for V4xf64
[src]
fn div_assign(&mut self, rhs: Self)
[src]
impl DivAssign<f64> for V4xf64
[src]
fn div_assign(&mut self, rhs: f64)
[src]
impl From<[f64; 4]> for V4xf64
[src]
impl From<(f64, f64, f64, f64)> for V4xf64
[src]
impl From<f64> for V4xf64
[src]
impl Into<[f64; 4]> for V4xf64
[src]
impl Into<(f64, f64, f64, f64)> for V4xf64
[src]
impl Mul<V4xf64> for V4xf64
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl Mul<V4xf64> for f64
[src]
type Output = V4xf64
The resulting type after applying the *
operator.
fn mul(self, rhs: V4xf64) -> Self::Output
[src]
impl Mul<f64> for V4xf64
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Self::Output
[src]
impl MulAssign<V4xf64> for V4xf64
[src]
fn mul_assign(&mut self, rhs: Self)
[src]
impl MulAssign<f64> for V4xf64
[src]
fn mul_assign(&mut self, rhs: f64)
[src]
impl Neg for V4xf64
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl PartialEq<V4xf64> for V4xf64
[src]
impl StructuralPartialEq for V4xf64
[src]
impl Sub<V4xf64> for V4xf64
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl SubAssign<V4xf64> for V4xf64
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
Auto Trait Implementations
impl RefUnwindSafe for V4xf64
impl Send for V4xf64
impl Sync for V4xf64
impl Unpin for V4xf64
impl UnwindSafe for V4xf64
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,