Struct vecmat::vec::Vec2
[−]
[src]
pub struct Vec2<T: Copy> { pub d: [T; 2], }
Fields
d: [T; 2]
Methods
impl<T> Vec2<T> where
T: Copy + Default,
[src]
T: Copy + Default,
fn new() -> Self
impl<T> Vec2<T> where
T: Copy,
[src]
T: Copy,
fn new_array(a: [T; 2]) -> Self
fn new_map<F>(f: F) -> Self where
F: Fn(usize) -> T,
F: Fn(usize) -> T,
fn new_scal(v: T) -> Self
impl<T> Vec2<T> where
T: Copy,
[src]
T: Copy,
impl<T> Vec2<T> where
T: Copy,
[src]
T: Copy,
impl<T> Vec2<T> where
T: Copy + Integer,
[src]
T: Copy + Integer,
fn div_floor(&self, other: Vec2<T>) -> Vec2<T>
fn mod_floor(&self, other: Vec2<T>) -> Vec2<T>
fn div_mod_floor(&self, other: Vec2<T>) -> (Vec2<T>, Vec2<T>)
impl<T> Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
fn sqr(self) -> T
impl<T> Vec2<T> where
T: Copy + Num + Float,
[src]
T: Copy + Num + Float,
impl<T> Vec2<T> where
T: Copy + Zero,
[src]
T: Copy + Zero,
impl Vec2<bool>
[src]
impl Vec2<bool>
[src]
impl<T> Vec2<T> where
T: Copy + PartialEq,
[src]
T: Copy + PartialEq,
impl<T> Vec2<T> where
T: Copy + PartialOrd,
[src]
T: Copy + PartialOrd,
fn vlt(&self, vec: Vec2<T>) -> Vec2<bool>
fn vle(&self, vec: Vec2<T>) -> Vec2<bool>
fn vgt(&self, vec: Vec2<T>) -> Vec2<bool>
fn vge(&self, vec: Vec2<T>) -> Vec2<bool>
impl<T> Vec2<T> where
T: Copy + PartialOrd,
[src]
T: Copy + PartialOrd,
Trait Implementations
impl<T: Clone + Copy> Clone for Vec2<T>
[src]
fn clone(&self) -> Vec2<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 Vec2<T>
[src]
impl<T: Debug + Copy> Debug for Vec2<T>
[src]
impl<T: PartialEq + Copy> PartialEq for Vec2<T>
[src]
fn eq(&self, __arg_0: &Vec2<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vec2<T>) -> bool
This method tests for !=
.
impl<T> Index<usize> for Vec2<T> where
T: Copy,
[src]
T: Copy,
type Output = T
The returned type after indexing
fn index(&self, i: usize) -> &Self::Output
The method for the indexing (container[index]
) operation
impl<T> IndexMut<usize> for Vec2<T> where
T: Copy,
[src]
T: Copy,
fn index_mut(&mut self, i: usize) -> &mut Self::Output
The method for the mutable indexing (container[index]
) operation
impl<T> Default for Vec2<T> where
T: Copy + Default,
[src]
T: Copy + Default,
impl<T> Display for Vec2<T> where
T: Copy + Display,
[src]
T: Copy + Display,
fn fmt(&self, f: &mut Formatter) -> FmtResult
Formats the value using the given formatter. Read more
impl<T> Neg for Vec2<T> where
T: Copy + Num + Signed,
[src]
T: Copy + Num + Signed,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn neg(self) -> Self::Output
The method for the unary -
operator
impl<T> Add for Vec2<T> where
T: Copy + Num + Add<Output = T>,
[src]
T: Copy + Num + Add<Output = T>,
type Output = Vec2<T>
The resulting type after applying the +
operator
fn add(self, vec: Vec2<T>) -> Self::Output
The method for the +
operator
impl<T> Sub for Vec2<T> where
T: Copy + Num + Sub<Output = T>,
[src]
T: Copy + Num + Sub<Output = T>,
type Output = Vec2<T>
The resulting type after applying the -
operator
fn sub(self, vec: Vec2<T>) -> Self::Output
The method for the -
operator
impl<T> AddAssign for Vec2<T> where
T: Copy + Num + Add<Output = T>,
[src]
T: Copy + Num + Add<Output = T>,
fn add_assign(&mut self, vec: Vec2<T>)
The method for the +=
operator
impl<T> SubAssign for Vec2<T> where
T: Copy + Num + Sub<Output = T>,
[src]
T: Copy + Num + Sub<Output = T>,
fn sub_assign(&mut self, vec: Vec2<T>)
The method for the -=
operator
impl<T> Mul for Vec2<T> where
T: Copy + Num + Mul<Output = T>,
[src]
T: Copy + Num + Mul<Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, vec: Vec2<T>) -> Self::Output
The method for the *
operator
impl<T> Mul<T> for Vec2<T> where
T: Copy + Num + Mul<Output = T>,
[src]
T: Copy + Num + Mul<Output = T>,
type Output = Vec2<T>
The resulting type after applying the *
operator
fn mul(self, a: T) -> Self::Output
The method for the *
operator
impl<T> Div for Vec2<T> where
T: Copy + Num + Div<Output = T>,
[src]
T: Copy + Num + Div<Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, vec: Vec2<T>) -> Self::Output
The method for the /
operator
impl<T> Div<T> for Vec2<T> where
T: Copy + Num + Div<Output = T>,
[src]
T: Copy + Num + Div<Output = T>,
type Output = Vec2<T>
The resulting type after applying the /
operator
fn div(self, a: T) -> Self::Output
The method for the /
operator
impl<T> Rem for Vec2<T> where
T: Copy + Num + Rem<Output = T>,
[src]
T: Copy + Num + Rem<Output = T>,
type Output = Vec2<T>
The resulting type after applying the %
operator
fn rem(self, vec: Vec2<T>) -> Self::Output
The method for the %
operator
impl<T> Rem<T> for Vec2<T> where
T: Copy + Num + Rem<Output = T>,
[src]
T: Copy + Num + Rem<Output = T>,
type Output = Vec2<T>
The resulting type after applying the %
operator
fn rem(self, a: T) -> Self::Output
The method for the %
operator
impl<T> MulAssign for Vec2<T> where
T: Copy + Num + Mul<Output = T>,
[src]
T: Copy + Num + Mul<Output = T>,
fn mul_assign(&mut self, vec: Vec2<T>)
The method for the *=
operator
impl<T> MulAssign<T> for Vec2<T> where
T: Copy + Num + Mul<Output = T>,
[src]
T: Copy + Num + Mul<Output = T>,
fn mul_assign(&mut self, a: T)
The method for the *=
operator
impl<T> DivAssign for Vec2<T> where
T: Copy + Num + Div<Output = T>,
[src]
T: Copy + Num + Div<Output = T>,
fn div_assign(&mut self, vec: Vec2<T>)
The method for the /=
operator
impl<T> DivAssign<T> for Vec2<T> where
T: Copy + Num + Div<Output = T>,
[src]
T: Copy + Num + Div<Output = T>,
fn div_assign(&mut self, a: T)
The method for the /=
operator
impl<T> RemAssign for Vec2<T> where
T: Copy + Num + Rem<Output = T>,
[src]
T: Copy + Num + Rem<Output = T>,
fn rem_assign(&mut self, vec: Vec2<T>)
The method for the %=
operator
impl<T> RemAssign<T> for Vec2<T> where
T: Copy + Num + Rem<Output = T>,
[src]
T: Copy + Num + Rem<Output = T>,
fn rem_assign(&mut self, a: T)
The method for the %=
operator
impl<T> Dot<Vec2<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
impl<T> Zero for Vec2<T> where
T: Copy + Num + Zero,
[src]
T: Copy + Num + Zero,
fn zero() -> Self
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl Not for Vec2<bool>
[src]
type Output = Vec2<bool>
The resulting type after applying the !
operator
fn not(self) -> Self::Output
The method for the unary !
operator
impl BitAnd for Vec2<bool>
[src]
type Output = Vec2<bool>
The resulting type after applying the &
operator
fn bitand(self, other: Vec2<bool>) -> Self::Output
The method for the &
operator
impl BitOr for Vec2<bool>
[src]
type Output = Vec2<bool>
The resulting type after applying the |
operator
fn bitor(self, other: Vec2<bool>) -> Self::Output
The method for the |
operator
impl BitXor for Vec2<bool>
[src]
type Output = Vec2<bool>
The resulting type after applying the ^
operator
fn bitxor(self, other: Vec2<bool>) -> Self::Output
The method for the ^
operator
impl BitAndAssign for Vec2<bool>
[src]
fn bitand_assign(&mut self, other: Vec2<bool>)
The method for the &=
operator
impl BitOrAssign for Vec2<bool>
[src]
fn bitor_assign(&mut self, other: Vec2<bool>)
The method for the |=
operator
impl BitXorAssign for Vec2<bool>
[src]
fn bitxor_assign(&mut self, other: Vec2<bool>)
The method for the ^=
operator
impl<T> Outer<Vec2<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
impl<T> Dot<Mat2x2<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
impl<T> Outer<Vec3<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
impl<T> Dot<Mat3x2<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
impl<T> Outer<Vec4<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,
impl<T> Dot<Mat4x2<T>> for Vec2<T> where
T: Copy + Num,
[src]
T: Copy + Num,