[−][src]Struct ezcgmath::vector::Vector2
A 2-dimensional vector
Fields
x: Scalar
y: Scalar
Implementations
impl Vector2
[src]
pub const fn new(x: Scalar, y: Scalar) -> Self
[src]
Creates a new instance of a Vector4 with values (x, y).
pub const fn unit_x() -> Self
[src]
Returns a vector of (1.0, 0.0, 0.0).
pub const fn unit_y() -> Self
[src]
Returns a vector of (0.0, 1.0).
pub fn dot(&self, rhs: &Vector2) -> Scalar
[src]
Returns the dot product of the vector with the vector 'rhs'.
pub fn length(&mut self) -> Scalar
[src]
The length of the vector.
pub fn normalize(&mut self)
[src]
Normalizes the vector to a length of one.
Trait Implementations
impl AbsDiffEq<Vector2> for Vector2
[src]
type Epsilon = Scalar
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
[src]
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
[src]
impl Add<Vector2> for Vector2
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl AddAssign<Vector2> for Vector2
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl Clone for Vector2
[src]
impl Copy for Vector2
[src]
impl Debug for Vector2
[src]
impl Default for Vector2
[src]
impl Div<f32> for Vector2
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Scalar) -> Self::Output
[src]
impl DivAssign<f32> for Vector2
[src]
fn div_assign(&mut self, rhs: Scalar)
[src]
impl Mul<f32> for Vector2
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> Self
[src]
impl MulAssign<f32> for Vector2
[src]
fn mul_assign(&mut self, rhs: Scalar)
[src]
impl Neg for Vector2
[src]
impl PartialEq<Vector2> for Vector2
[src]
impl RelativeEq<Vector2> for Vector2
[src]
fn default_max_relative() -> Self::Epsilon
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
impl StructuralPartialEq for Vector2
[src]
impl Sub<Vector2> for Vector2
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector2) -> Self
[src]
impl SubAssign<Vector2> for Vector2
[src]
fn sub_assign(&mut self, rhs: Vector2)
[src]
impl UlpsEq<Vector2> for Vector2
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vector2
impl Send for Vector2
impl Sync for Vector2
impl Unpin for Vector2
impl UnwindSafe for Vector2
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,