Struct geometric::Vector4
[−]
[src]
pub struct Vector4<T: Copy> { pub components: [T; 4], }
Fields
components: [T; 4]
Methods
impl<T: Copy> Vector4<T>
[src]
fn new(components: [T; 4]) -> Self
fn x(&self) -> T
fn y(&self) -> T
fn z(&self) -> T
fn w(&self) -> T
fn map<F, O: Copy>(self, f: F) -> Vector4<O> where
F: Fn(T) -> O,
F: Fn(T) -> O,
Map a function over vector components
fn as_slice(&self) -> &[T]
fn fromv<V>(vector: V) -> Self where
T: Default,
V: AsRef<[T]>,
T: Default,
V: AsRef<[T]>,
Convenience method for converting between vector types, since a From implementation would conflict with the one in std::core. When converting from a smaller type, the result is padded with Default::default().
impl<T> Vector4<T> where
T: Copy + Add<Output = T> + Mul<Output = T>,
[src]
T: Copy + Add<Output = T> + Mul<Output = T>,
fn mag_sq(&self) -> T
Return the squared magnitude.
impl<T> Vector4<T> where
T: Float,
[src]
T: Float,
impl Vector4<f32>
[src]
fn abs(self) -> Self
fn floor(self) -> Self
fn ceil(self) -> Self
fn round(self) -> Self
fn trunc(self) -> Self
fn fract(self) -> Self
fn signum(self) -> Self
fn recip(self) -> Self
impl Vector4<f64>
[src]
fn abs(self) -> Self
fn floor(self) -> Self
fn ceil(self) -> Self
fn round(self) -> Self
fn trunc(self) -> Self
fn fract(self) -> Self
fn signum(self) -> Self
fn recip(self) -> Self
impl Vector4<i8>
[src]
impl Vector4<i16>
[src]
impl Vector4<i32>
[src]
impl Vector4<i64>
[src]
impl Vector4<isize>
[src]
Trait Implementations
impl<T: Clone + Copy> Clone for Vector4<T>
[src]
fn clone(&self) -> Vector4<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Copy + Copy> Copy for Vector4<T>
[src]
impl<T: Default + Copy> Default for Vector4<T>
[src]
impl<T: Debug + Copy> Debug for Vector4<T>
[src]
impl<T: PartialEq + Copy> PartialEq for Vector4<T>
[src]
fn eq(&self, __arg_0: &Vector4<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vector4<T>) -> bool
This method tests for !=
.
impl<T: Eq + Copy> Eq for Vector4<T>
[src]
impl<T: Copy> AsRef<[T; 4]> for Vector4<T>
[src]
impl<T: Copy> AsRef<[T]> for Vector4<T>
[src]
impl<T: Copy> From<[T; 4]> for Vector4<T>
[src]
impl<'a, T: Copy + Default> From<&'a [T]> for Vector4<T>
[src]
impl<T: Copy> Add for Vector4<T> where
T: Add<Output = T>,
[src]
T: Add<Output = T>,
type Output = Self
The resulting type after applying the +
operator
fn add(self, other: Self) -> Self::Output
The method for the +
operator
impl<T: Copy> AddAssign for Vector4<T> where
T: Add<Output = T>,
[src]
T: Add<Output = T>,
fn add_assign(&mut self, other: Self)
The method for the +=
operator
impl<T: Copy> Sub for Vector4<T> where
T: Sub<Output = T>,
[src]
T: Sub<Output = T>,
type Output = Self
The resulting type after applying the -
operator
fn sub(self, other: Self) -> Self::Output
The method for the -
operator
impl<T: Copy> SubAssign for Vector4<T> where
T: Sub<Output = T>,
[src]
T: Sub<Output = T>,
fn sub_assign(&mut self, other: Self)
The method for the -=
operator
impl<T: Copy> Mul for Vector4<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
type Output = Self
The resulting type after applying the *
operator
fn mul(self, other: Self) -> Self::Output
The method for the *
operator
impl<T: Copy> MulAssign for Vector4<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
fn mul_assign(&mut self, other: Self)
The method for the *=
operator
impl<T: Copy> Div for Vector4<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
type Output = Self
The resulting type after applying the /
operator
fn div(self, other: Self) -> Self::Output
The method for the /
operator
impl<T: Copy> DivAssign for Vector4<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
fn div_assign(&mut self, other: Self)
The method for the /=
operator
impl<T: Copy> Mul<T> for Vector4<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
type Output = Self
The resulting type after applying the *
operator
fn mul(self, constant: T) -> Self::Output
The method for the *
operator
impl<T: Copy> MulAssign<T> for Vector4<T> where
T: Mul<Output = T>,
[src]
T: Mul<Output = T>,
fn mul_assign(&mut self, constant: T)
The method for the *=
operator
impl<T: Copy> Div<T> for Vector4<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
type Output = Self
The resulting type after applying the /
operator
fn div(self, constant: T) -> Self::Output
The method for the /
operator
impl<T: Copy> DivAssign<T> for Vector4<T> where
T: Div<Output = T>,
[src]
T: Div<Output = T>,
fn div_assign(&mut self, constant: T)
The method for the /=
operator
impl<T: Copy> Neg for Vector4<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
type Output = Self
The resulting type after applying the -
operator
fn neg(self) -> Self::Output
The method for the unary -
operator
impl<T: Copy> Dot for Vector4<T> where
T: Add<Output = T> + Mul<Output = T>,
[src]
T: Add<Output = T> + Mul<Output = T>,
impl<T: Copy> Proj for Vector4<T> where
T: Add<Output = T> + Mul<Output = T> + Div<Output = T>,
[src]
T: Add<Output = T> + Mul<Output = T> + Div<Output = T>,