Struct euler::Vec2
[−]
[src]
#[repr(C)]pub struct Vec2 { pub x: f32, pub y: f32, }
2D vector.
Fields
x: f32
X co-ordinate.
y: f32
Y co-ordinate.
Methods
impl Vec2
[src]
fn dot(self, other: Vec2) -> f32
[src]
Returns the dot product of two vectors.
fn normalize(self) -> Vec2
[src]
Returns a vector in the same direction but with unit magnitude.
Trait Implementations
impl Clone for Vec2
[src]
fn clone(&self) -> Vec2
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Vec2
[src]
impl Debug for Vec2
[src]
impl PartialEq for Vec2
[src]
fn eq(&self, __arg_0: &Vec2) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Vec2) -> bool
[src]
This method tests for !=
.
impl AsRef<[f32; 2]> for Vec2
[src]
impl From<[f32; 2]> for Vec2
[src]
impl Into<[f32; 2]> for Vec2
[src]
impl From<Vec3> for Vec2
[src]
impl From<Vec4> for Vec2
[src]
impl Add<Vec2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the +
operator.
fn add(self, rhs: Vec2) -> Self::Output
[src]
Performs the +
operation.
impl Sub<Vec2> for Vec2
[src]
type Output = Vec2
The resulting type after applying the -
operator.
fn sub(self, rhs: Vec2) -> Self::Output
[src]
Performs the -
operation.
impl ApproxEq for Vec2
[src]
type Epsilon = <f32 as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> Self::Epsilon
[src]
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> Self::Epsilon
[src]
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
The default ULPs to tolerate when testing values that are far-apart. Read more
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
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
The inverse of ApproxEq::ulps_eq
.